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
pour supprimer une ligne manuellement items = JSON.parse(localStorage.getItem("Business")); items.splice(4,1); localStorage.setItem("Business", JSON.stringify(items));
function onConnect(){ var login=document.getElementById("login").value; var passWord= document.getElementById("password").value; direction(login,passWord); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeItem() {\nlet id = $(this).parent().attr('id');\nlet arr = JSON.parse(localStorage.getItem('transactions'));\narr.forEach((e, i) => {\nif(id == e.id) {\narr.splice(i, 1);\n}\n});\n// Push new array to local storage\nlocalStorage.setItem('transactions', JSON.stringify(arr));\n// Clean History Field\n$('.append').empty();\n// Update UI\nshowPrevData();\n}", "function undoStorageItem(){\n var store = JSON.parse(localStorage.getItem(\"toStorage\"));\n console.log(store);\n store.pop();\n console.log(store);\n localStorage.setItem(\"toStorage\", JSON.stringify(store));\n}", "function delet(index){\n persons.splice(index , 1);\n localStorage.setItem('personsList' , JSON.stringify(persons)); // 3shan lma ados delete yems7 men el local storge kman\n show();\n}", "function removeElement(index){\nlet payment;\n if(localStorage.getItem('payment') === null)\n {payment = [];}\n else\n {\n payment = JSON.parse(localStorage.getItem('payment'));\n payment.forEach((element , position) => {\n if(position == index)\n { payment.splice(position , 1);}\n })//end of the forEach\n payment = localStorage.setItem('payment' , JSON.stringify(payment));\n cleanList();\n showPayment();\n}//end of the else\n}//end of the function removeElement ", "function clearStorageOrderItem(){\r\n for (var i = 0; i < window.localStorage.length; i++) {\r\n if (window.localStorage.key(i).indexOf(\"orderItem_ZP\") != -1) {\r\n window.localStorage.removeItem(window.localStorage.key(i));\r\n }\r\n }\r\n }", "function realDel(itemIndex) {\r\n console.log(\"delete\", itemIndex)\r\n //retireving values from local storage\r\n var itemJsonArrayStr = localStorage.getItem('itemsJson')\r\n itemJsonArray = JSON.parse(itemJsonArrayStr);\r\n //delete itemIndex element from the array\r\n itemJsonArray.splice(itemIndex, 1);\r\n //again update the string inside the storage\r\n var str2 = JSON.stringify(itemJsonArray)\r\n localStorage.setItem('itemsJson', str2)\r\n //after deletion update/populate the table\r\n update();\r\n}", "function deleteIt(itemIndex) {\n itemJsonArraystr = localStorage.getItem('itemsJson')\n itemJsonArray = JSON.parse(itemJsonArraystr);\n\n itemJsonArray.splice(itemIndex, 1);\n\n localStorage.setItem('itemsJson', JSON.stringify(itemJsonArray));\n update();\n}", "function removeLocalItems(item) {\n let items;\n // Checking whether the localStorage is empty\n if (localStorage.getItem(\"items\") === null) {\n items = [];\n // If not, we push new items to it\n } else {\n items = JSON.parse(localStorage.getItem(\"items\"));\n }\n // Locating the index of the selected entry to remove\n const itemIndex = item.children[0].innerText;\n // Calling splice to remove selected entry\n items.splice(items.indexOf(itemIndex), 1);\n // Pushing localStorage back, now that it has been edited with splice\n localStorage.setItem(\"items\", JSON.stringify(items));\n}", "function remove(items) {\r\n const notearray = localStorage.getItem(\"items\")\r\n ? JSON.parse(localStorage.getItem(\"items\"))\r\n : [];\r\n const todoindex = items.childNodes[0].innerText;\r\n notearray.splice(notearray.indexOf(todoindex), 1);\r\n localStorage.setItem(\"items\", JSON.stringify(notearray));\r\n}", "function deleteitems(){\n localStorage.clear();\n location.reload();\n}", "function removeFromStorage(s) {\n\tlet r = localStorage.getItem(\"Tasks\");\n\tr = JSON.parse(r);\n\tlet i = r.indexOf(s);\n\tconsole.log(i);\n\tr.splice(i, 1);\n\tconsole.log(r);\n\tr = JSON.stringify(r);\n\tlocalStorage.setItem(\"Tasks\", r);\n}", "function saveTodosremove(index){\r\n let todo;\r\n if (localStorage.getItem('todo') === null){\r\n todo = [];\r\n }\r\n else{\r\n todo = JSON.parse(localStorage.getItem('todo'));\r\n }\r\n todo.splice(index-1, 1);\r\n localStorage.setItem('todo', JSON.stringify(todo));\r\n}", "function remover2(turnos2) {\n registrados = JSON.parse(localStorage.getItem('registra2'))\n registrados.splice(turnos2, 1)\n localStorage.setItem('registra2', JSON.stringify(registrados))\n mostrar();\n}", "function eliminar(nombre) {\n console.log(nombre)\n let datos = JSON.parse(localStorage.getItem('datos'));\n for(let i = 0; i < datos.length; i++) {\n if(datos[i].nombre == nombre) {\n datos.splice(i, 1);\n }\n }\n \n localStorage.setItem('datos', JSON.stringify(datos));\n IngresarDatos();\n}", "removeFromLocalStorage() {\n const songsInStorage = localStorage.getItem(\"Songs\");\n let currentArray = [];\n if (songsInStorage) {\n currentArray = JSON.parse(songsInStorage);\n const index = this.indexContainingID(currentArray, this.props.info.id);\n if (index > -1) {\n currentArray.splice(index, 1);\n }\n }\n localStorage.removeItem(\"Songs\");\n localStorage.setItem(\"Songs\", JSON.stringify(currentArray));\n }", "function eliminarEstudiante() {\n //funcion al botton \n\n $(\".eliminar\").click(function() {\n\n var cedula_estudiante = $(this).attr(\"id\");\n\n var estudiantes = JSON.parse(localStorage.getItem('estudiantes'));\n\n for (var i = 0; i < estudiantes.length; i++) {\n\n if (estudiantes[i] != undefined) {\n\n if (estudiantes[i].cedula == cedula_estudiante) {\n\n delete estudiantes[i];\n\n }\n }\n\n };\n\n localStorage.setItem('estudiantes', JSON.stringify(estudiantes));\n // alert\n alert('Estudiante eliminada');\n // refrescar\n location.reload(true);\n\n\n });\n}", "function clear_storage(){\r\n localStorage.clear();\r\n var arrAppointment = [];\r\n arrAppointment.push(JSON.parse(localStorage.getItem('tbAppointment')));\r\n localStorage.setItem('tbAppointment', JSON.stringify(arrAppointment));\r\n print(true);\r\n}", "eliminarAuto({ item }) {\n let posicion = this.informacion_vehiculos.findIndex(\n automovil => automovil == item\n );\n this.informacion_vehiculos.splice(posicion, 1);\n localStorage.setItem('automoviles', JSON.stringify(this.informacion_vehiculos));\n }", "removeFromLocalStorage(id){\n let items = this.getLocalStorage()\n items = items.filter(function(item){\n if(item.id !== id){\n return item\n } \n\n })\n\n localStorage.setItem('list', JSON.stringify(items))\n}", "function eliminarItemCarrito(item){\n carrito.splice(item.numeroItem,1);\n let i = 0;\n for(item of carrito){\n carrito[i].numeroItem = i;\n i++;\n }\n\n localStorage.setItem( \"productos\", JSON.stringify(carrito));\n}", "function deleteItem(item) {\n var order = JSON.parse(sessionStorage.getItem(\"order\"));\n if (typeof item == \"number\") {\n order[\"custom\"] = order[\"custom\"].splice(1, item);\n } else {\n delete order[item];\n }\n sessionStorage.setItem(\"order\", JSON.stringify(order));\n document.location.reload(true);\n}", "function eliminarDelCarrito(producto){\n\n let productoEnStorage = JSON.parse(localStorage[producto.id]);\n\n productoEnStorage.talle[0].stock -= 1;\n\n if(productoEnStorage.talle[0].stock == 0){\n\n productoEnStorage.talle.splice(0,1);\n\n }\n\n if(productoEnStorage.talle.length==0){\n\n localStorage.removeItem(producto.id);\n\n }else{\n\n localStorage.removeItem(producto.id);\n\n localStorage.setItem(producto.id, JSON.stringify(productoEnStorage));\n\n }\n\n}", "function clearItem(){\n localStorage.setItem(\"items\", JSON.stringify([]))\n const ul = document.querySelector(\"ul\")\n Array.from(ul.children).forEach(e => e.remove())\n }", "function removeFromLocalStorage(todoItem){\n\n const todoIndex = todoItem.children[0].innerText;\n let todos;\n todos.splice(todos.indexOf(todoIndex), 1);\n localStorage.setItem('todos', stringify(todos));\n\n}", "function removeItem(i) {\n\tcart.splice(i, 1); // on supprime le ième item du panier \n\tlocalStorage.clear(); // on le retire du localstorage\n\t// On met à jour le nouveau panier après suppression de l'article\n\tlocalStorage.setItem(\"cart\", JSON.stringify(cart));\n\t// Panier vide si le nbre d'items est nul \n\tcartNumber();\n\tlet cartnum = document.getElementById(\"cart_number\").textContent;\n\tif (cartnum == 0) {\n\t\tclearCart();\n\t}\n\t// On met à jour de la page pour affichage de la suppression Sau client\n\twindow.location.reload();\n}", "function excluir(a)\n{\n try{\n postagens = JSON.parse(localStorage['postagens'])\n }\n catch(erro)\n {\n postagens = [{titulo: \"Lista de livros Favoritos\",data:\"Mon Sep 28 2020\", post: txtPadrao}];\n }\n var tam = postagens.length;\n if(tam == 1 )\n {\n gate = true;\n console.log(gate);\n }\n if(a<=tam){\n postagens.splice((tam-a-1), 1); // retira o post da lista(vetor) postagens\n }\n var JSONReadyUsers = JSON.stringify(postagens); // lista ==> string\n localStorage.setItem(\"postagens\", JSONReadyUsers);// armazena a nova lista no localStorage\n location.reload();// atualiza a pagina\n return false;\n\n}", "function deleteLS(delItem){\n console.log(\"delete activated\");\n let task;\n if(localStorage.getItem('task') === null)\n {\n task=[];\n }\n else\n {\n task=JSON.parse(localStorage.getItem('task'));\n\n\n }\n\n \n task.forEach(function(tasks,index){\n \n if(delItem.innerHTML === tasks){\n \n\n \n \n task.splice(index,1);\n }\n })\n localStorage.setItem('task',JSON.stringify(task));\n}", "function removeDataFromStorage(taskLi){\r\n let tasks;\r\n if(localStorage.getItem('tasks') ===null){\r\n tasks = [];\r\n }else{\r\n tasks = JSON.parse(localStorage.getItem('tasks'));\r\n }\r\n\r\n let li = taskLi;\r\n li.removeChild(li.lastChild);\r\n\r\n tasks.forEach((taskList, index)=>{\r\n if(li.textContent.trim() === taskList){\r\n tasks.splice(index, 1);\r\n };\r\n });\r\n localStorage.setItem('tasks', JSON.stringify(tasks));\r\n}", "function removeFromLS(taskItem){\r\n // from store in local stroage\r\n let tasks;\r\n if(localStorage.getItem('tasks')===null){\r\n tasks=[];\r\n }\r\n else{\r\n tasks=JSON.parse(localStorage.getItem('tasks'));\r\n }\r\n let li = taskItem;\r\n li.removeChild(li.lastChild); //<a>x</a> ei item ta remove hoa jabe karon ata local stroage a ni\r\n\r\n tasks.forEach(function(task, index){ // local stroage er upore\r\n if(li.textContent.trim()===task){\r\n tasks.splice(index, 1); // task ke remove korbe\r\n }\r\n });\r\n\r\n localStorage.setItem('tasks', JSON.stringify(tasks));\r\n\r\n}", "function removeOldData() {\n\tlocalStorage.clear();\n}", "function deleteBLItem(){\n var item = localStorage.getItem('item'); // Depending on the value of the key 'item', the respective value is retrieved\n var inBucketList = JSON.parse(localStorage.getItem('inBucketList')); // Array \"inBucketList\" is retrieved from local storage\n var blIndex = inBucketList.indexOf(item); // Respective item that has been clicked on to be deleted is retrieved from Array\n document.getElementById(item).style.display = \"none\"; // The item that has been removed from the array is no longer visible in the BL\n inBucketList.splice(blIndex, 1); // Item is removed from Bucket List Array\n localStorage.setItem('inBucketList', JSON.stringify(inBucketList)); // Array is stored in local storage\n}", "function eliminar (eliminar){\n var data = JSON.parse(sessionStorage.getItem(\"pedido\"));\n //borro todo\n $( \"#pedido *\" ).remove();\n $(\"#total h4\").remove();\n \n data.splice(eliminar, 1); \n sessionStorage.setItem('pedido',JSON.stringify(data));\n\n cargarPedido(data);\n \n if(data.length < 1){\n $(\"#total h4\").remove();\n $('#resumen').hide();\n overlay.classList.remove('active');\n popup.classList.remove('active');\n }\n}", "function removeLocalTodos(todo){\n //check if i have todo alredy\n let todos;\n if(localStorage.getItem('todos')===null){\n todos=[];\n }\n else{\n todos=JSON.parse(localStorage.getItem('todos'));\n }\n\n //getting index of todo\n const todoIndex=todo.children[0].innerText;\n todos.splice(todos.indexOf(todoIndex), 1);\n localStorage.setItem(\"todos\",JSON.stringify(todos));\n}", "function removeData(e) {\n // GET DATA\n let pItems = JSON.parse(localStorage.getItem(\"pending\"));\n // REMOVE THE ITEM\n pItems.splice(e, 1);\n // STORE REMAINING DATA TO LOCAL STORATE\n localStorage.setItem(\"pending\", JSON.stringify(pItems));\n // UPDATE HTML WITH NEW DATA\n displayPending();\n}", "function deleteTask(index) {\n\tlet getLocalStorage = localStorage.getItem(\"New Todo\"); //getting localStorage\n listArr = JSON.parse(getLocalStorage);\n listArr.splice(index, 1)//remove or delete the particuler indexed li\n //after remove li again update localStorage\n localStorage.setItem(\"New Todo\", JSON.stringify(listArr)); // transforming js objcet into a json string\n\tshowTasks();\n}", "function removeFromStorage(id) {\n\t// get array from local storage\n\tlet itemsLS = getFromStorage();\n\n\tfor (var i = 0, len = itemsLS.length; i < len; i++) {\n\t\tif (itemsLS[i].id === id) {\n\n\t\t\titemsLS.splice(i, 1);\n\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// apply changes\n\tlocalStorage.setItem('items', JSON.stringify(itemsLS));\n}", "function deleteAlarm(i){\n console.log(\"test\");\n var alarms = JSON.parse(localStorage[\"alarms\"]);\n \n alarms.splice(i,1);\n localStorage[\"alarms\"] = JSON.stringify(alarms);\n \n loadAlarms();\n}", "removeFromLocalStorage(target){\n let lists = this.getWordToLocalStorage()\n lists.forEach((value, index) => {\n if(target === value.english){\n lists.splice(index, 1)\n }\n })\n localStorage.setItem('todos', JSON.stringify(lists))\n }", "function removetodo(todo)\n{ \nlet todos;\nif(localStorage.getItem('todos')=== null)\n{\n todos=[];\n} \nelse\n{\ntodos=JSON.parse(localStorage.getItem('todos')); \n} \nconst todoindex= todo.children[0].innerText;\ntodos.splice(todos.indexOf(todoindex),1); \nlocalStorage.setItem(\"todos\",JSON.stringify(todos)); \n}", "eliminarProductoLocalStorage(productoID){\n let productosLS;\n productosLS = this.obtenerProductosLocalStorage();\n productosLS.forEach(function(productoLS, index){\n if(productoLS.id === productoID){\n productosLS.splice(index, 1);\n }\n });\n\n localStorage.setItem('productos', JSON.stringify(productosLS));\n }", "function deletePage(index) {\r\n let pages = localStorage.getItem('pages');\r\n if (pages == null) {\r\n pagesObj = [];\r\n }\r\n else {\r\n pagesObj = JSON.parse(pages);\r\n }\r\n pagesObj.splice(index, 1);\r\n localStorage.setItem('pages', JSON.stringify(pagesObj))\r\n showpaeges();\r\n\r\n}", "function Delete(e){\n let items = [];\n JSON.parse(localStorage.getItem('items')).map(data=>{\n if(data.id != e.parentElement.parentElement.children[0].textContent){\n \n items.push(data);\n\n }\n })\n localStorage.setItem('items',JSON.stringify(items));\n window.location.reload();\n}", "delete_item(itemBox, name){\n console.log(itemBox);\n console.log(itemBox.parentNode);\n itemBox.parentNode.removeChild(itemBox);\n let index = memo_list.indexOf(name);\n memo_list.splice(index, 1);\n window.localStorage.setItem(\"memo\", JSON.stringify(memo_list));\n }", "function deleteTodo(i) {\n let toDoTask = localStorage.getItem(\"localtodo\");\n let todoObj = JSON.parse(toDoTask);\n todoObj.splice(i, 1);\n localStorage.setItem(\"localtodo\", JSON.stringify(todoObj));\n showTodo();\n}", "function eliminarTodo() {\n localStorage.clear(productosCarrito);\n productosCarrito=[];\n console.log(productosCarrito);\n actualizarElCarrito();\n}", "function removeItemLocalStorage(name) {\n localStorage.removeItem(name);\n}", "function eliminarDeLocalStorage(producto) {\n let productosLS;\n //Obtiene el arreglo de localStorage\n productosLS = obtenerProductoLocal();\n productosLS.forEach((productoLS, index) => {\n if (productoLS.id === producto)\n productosLS.splice(index, 1)\n });\n localStorage.setItem('productos', JSON.stringify(productosLS));\n}", "eliminarProductoLocalStorage(productoID){\n let productosLS;\n productosLS = this.obtenerProductosLocalStorage();\n productosLS.forEach(function(productoLS, index){\n if(productoLS.id === productoID){\n productosLS.splice(index, 1);\n }\n });\n \n localStorage.setItem('productos', JSON.stringify(productosLS));\n }", "function bdelete(r) {\r\n var table = document.getElementById(\"todo\");\r\n var i = r.parentNode.parentNode.rowIndex;\r\n table.deleteRow(i);\r\n var data = localStorage.getItem(\"array\").split(\",\");\r\n data = data.splice((i*4),4);\r\n var store = [];\r\n store.push(data);\r\n localStorage.setItem(\"array\", store.toString());\r\n var row = localStorage.getItem(\"trow\");\r\n row = row-1;\r\n localStorage.setItem(\"trow\",row);\r\n}", "function removeItemFromLocalStorage(listItem) {\n let items;\n if (localStorage.getItem('items') === null) {\n items = [];\n } else {\n items = JSON.parse(localStorage.getItem('items'));\n }\n items.forEach((item, index) => {\n if (listItem.textContent === item) {\n items.splice(index, 1);\n }\n });\n localStorage.setItem('items', JSON.stringify(items));\n}", "function removetaskfromlocalstroage(taskitem){\n // console.log('hay');\n console.log(taskitem);\n console.log(taskitem.textContent);\n\n let tasks;\n if(localStorage.getItem('tasks') === null){\n tasks = [];\n }else{\n tasks = JSON.parse(localStorage.getItem('tasks'));\n }\n\n tasks.forEach((task, index)=>{\n // console.log(task);\n\n if(task === taskitem.textContent){\n\n // where we want to start(index) , where we wnat to end (how many) \n tasks.splice(index,1);\n }\n\n });\n\n // tasks = tasks.filter(task => task !== taskitem.textContent);\n\n localStorage.setItem('tasks', JSON.stringify(tasks));\n\n}", "function deleteGroceryProduct(index) {\r\n let getLocalStorageData = localStorage.getItem(\"groceryListItem\");\r\n groceryListItem = JSON.parse(getLocalStorageData);\r\n groceryListItem.splice(index, 1);\r\n localStorage.setItem(\"groceryListItem\", JSON.stringify(groceryListItem));\r\n showGroceryList();\r\n}", "function deletDataFromeLocalStorage(id) {\n const items = JSON.parse(localStorage.getItem(\"productItme\"));\n\n let result = items.filter(product => {\n return product.id !== id;\n });\n\n localStorage.setItem(\"productItme\", JSON.stringify(result));\n\n if(result.length === 0) location.reload();\n }", "function removeTodoFromLocalStorage(todoContainer){\r\n const todo = todoContainer.children[0].innerText;\r\n let todos = LocalStorage();\r\n\r\n todos.splice(todos.indexOf(todo),1);\r\n console.log(todos);\r\n localStorage.setItem('todos',JSON.stringify(todos));\r\n}", "function elimina_all_prenotazioni(){\r\n prenotazioni=JSON.parse(localStorage.getItem(\"prenotazioni\") || \"[]\");\r\n user=JSON.parse(sessionStorage.user);\r\n document.write(prenotazioni.length+\"<br>\")\r\n for(var i=0;i<prenotazioni.length;i++){\r\n document.write(i+\"<br>\");\r\n utente_prenotazione=JSON.parse(prenotazioni[i].utente);\r\n if(utente_prenotazione.username == user.username){\r\n prenotazioni.splice(i, 1);\r\n i--;\r\n }\r\n }\r\n localStorage.setItem(\"prenotazioni\", JSON.stringify(prenotazioni));\r\n sessionStorage.removeItem(\"user\");\r\n window.location.href = \"index.html\";\r\n}", "function removeProductFromLocalStorage(productItem){\n let products;\n if(localStorage.getItem('products') === null){\n products = [];\n }else{\n products = JSON.parse(localStorage.getItem('products'))\n }\n products.forEach(function(product, index){\n if(productItem.firstChild.textContent === product.product && productItem.firstChild.nextSibling.textContent === `${product.price}€` ){\n //console.log(products,\"avant\")\n products.splice(index,1)\n //console.log(products,\"apres\")\n }\n })\n localStorage.setItem('products', JSON.stringify(products));\n}", "function removeTasksFromLocalStorage(taskItem) {\n\t// Provera\n\tlet tasks; \n\tif (localStorage.getItem('tasks') === null) {\n\t\ttasks = [];\t\t\n\t} else {\n\t\ttasks = JSON.parse(localStorage.getItem('tasks'));\n\t}\n\n\ttasks.forEach(function(task, index) {\n\t\t//Sta se tacno proverava(to pozia tasks pa se vraca u removeTasksFromLoca....)\n\t\t// index mi nije jasan....(drugi parametar o forEach)\n\t\tif (taskItem.textContent === task) {\n\t\t\ttasks.splice(index, 1);\n\t\t}\n\t});\n\n\tlocalStorage.setItem('tasks', JSON.stringify(tasks));\n}", "function removeTaskFromLocalStorage(taskItem){\n\n let tasks;\n if(localStorage.getItem('tasks') === null){\n tasks = [];\n }else {\n tasks =JSON.parse(localStorage.getItem('tasks'));\n \n}\n\ntasks.forEach(function(task, index){\n if(taskItem.textContent === task){\n tasks.splice(index, 1);\n }\n })\n localStorage.setItem('tasks', JSON.stringify(tasks));\n}", "function eliminarFavoritos() {\n let favoritoId = $(this).attr(\"myAttr2\");\n let usuariosFavsLocalStorage = window.localStorage.getItem(\"AppProductosFavoritos\");\n let usuariosFavsJSON = JSON.parse(usuariosFavsLocalStorage);\n if (usuariosFavsJSON && usuariosFavsJSON.length > 0) {\n for (let i = 0; i < usuariosFavsJSON.length; i++) {\n let unFavJson = usuariosFavsJSON[i];\n if (unFavJson.usuario === usuarioLogueado.email) {\n let losFavoritos = unFavJson.favoritos;\n for (let j = 0; j < losFavoritos.length; j++) {\n let unFavorito = losFavoritos[j];\n if (unFavorito.elProducto._id == favoritoId) {\n losFavoritos.splice(j, 1);\n window.localStorage.setItem(\"AppProductosFavoritos\", JSON.stringify(usuariosFavsJSON));\n ons.notification.alert(\"Favorito Eliminado\", { title: 'Favoritos' });\n }\n }\n }\n }\n }\n crearListadoFavoritos();\n}", "function deleteProductFromList(name) {\n\n var listArray = JSON.parse(window.localStorage.getItem(nickname));\n //Good old stream. Filter without that item and write new list.\n var newArray = listArray.filter(function (e) {\n return e.name !== name;\n });\n var JSONArray = JSON.stringify(newArray);\n window.localStorage.setItem(nickname, JSONArray);\n writeListToPage();\n\n\n}", "function deleteNote(index)\n{\n//console.log(\"deleting\",index);\nlet notes=localStorage.getItem(\"notes\");\nif (notes===null)\n{\nnotesObj=[];\n}\nelse\n{\nnotesObj=JSON.parse(notes);\n}\nnotesObj.splice(index,1);\nlocalStorage.setItem(\"notes\",JSON.stringify(notesObj));\nshowNotes();\n}", "function removeLocalTodos(todo){\n //CHECK DO I ALREADY HAVE THINGS IN THERE? / LOCAL STORAGE\n let todos;\n if(localStorage.getItem(\"todos\") === null){\n todos = [];\n }else {\n todos = JSON.parse(localStorage.getItem(\"todos\"));\n }\n // console.log(todo.children[0].innerText);\n // console.log(todos.indexOf(\"sujan\"));\n const todoIndex = todo.children[0].innerText;\n todos.splice(todos.indexOf(todoIndex), 1);\n localStorage.setItem(\"todos\", JSON.stringify(todos));\n}", "function souprimeUser(n) {\n\tlet allStorage = localStorage.getItem(\"donnesStorage\");\n\tlet donneAll = creeTabel(allStorage);\n\tdonneAll.splice(n,1);\n\tcreeStorage(donneAll);\n\tlocation.reload();\n}", "function elimina_account(){\r\n var users = JSON.parse(localStorage.getItem(\"users\") || \"[]\");\r\n var user=JSON.parse(sessionStorage.user);\r\n\r\n for(var i=0;i<users.length;i++){\r\n if(users[i].username == user.username){\r\n users.splice(i, 1);\r\n localStorage.setItem(\"users\", JSON.stringify(users));\r\n elimina_all_prenotazioni();\r\n }\r\n }\r\n}", "function removeItem(name) {\n let items = JSON.parse(localStorage.getItem('items'));\n if(items !== null && items.length > 1) {\n /* delete item. if there's only 1, remove all localstorage */\n if(typeof items.forEach === \"function\") {\n items.forEach(function(item, i) {\n if(item.name == name) {\n items.splice(i, 1);\n localStorage.setItem('items', JSON.stringify(items));\n }\n })\n }else {\n if(items.name == name) {\n removeAllStorage();\n }\n }\n }else {\n removeAllStorage();\n }\n updateCart();\n }", "function eliminarLocalStorage(){\n\tlocalStorage.clear();\n}", "static deleteTodoFromLocalStorage(id){\r\n const todo = Store.getDataFromLocalStorage()\r\n todo.forEach((ele,index) => {\r\n if(ele.id === id){\r\n todo.splice(index,1)\r\n }\r\n localStorage.setItem('todo',JSON.stringify(todo))\r\n });\r\n }", "function removeLocalTodo(todo) {\r\n //CHECK\r\n if(localStorage.getItem('todos') === null) {\r\n todos = []\r\n }else{\r\n todos = JSON.parse(localStorage.getItem('todos'))\r\n } \r\n const todoIndex = todo.children[0].innerText // children[0] porque ese es el <li></li> del todo, cuyo texto es el todo que queremos remover\r\n todos.splice(todos.indexOf(todoIndex), 1)\r\n localStorage.setItem(\"todos\", JSON.stringify(todos))\r\n}", "function borrarItem(id){\n for(let i in carrito){\n \n if (id==carrito[i]){\n carrito.splice(i,1)\n }\n }\n localStorage.setItem(\"enCarrito\",JSON.stringify(carrito))\n mostrarItemsEnCarrito()\n refrescar()\n if(carrito==\"\"){\n deshacerOcultar()\n }\n}", "function removeTaskLocalStorage(taskItem){\n let taskArrayItem;\n if(localStorage.getItem('savedTasks') === null){\n taskArrayItem = [];\n } else {\n taskArrayItem = JSON.parse(localStorage.getItem('savedTasks'));\n }\n taskArrayItem.forEach(\n function(taskStored, index){\n if(taskStored.task === taskItem){\n taskArrayItem.splice(index, 1);\n // console.log(taskArrayItem);\n }\n }\n );\n\n localStorage.setItem('savedTasks', JSON.stringify(taskArrayItem));\n}", "function deleteNote(index){\r\n\r\nlet notes = localStorage.getItem('notes');\r\n\r\n if(notes == null){\r\n notesObj = [];\r\n }\r\n else{\r\n notesObj = JSON.parse(notes);\r\n }\r\n \r\n notesObj.splice(index, 1);\r\n localStorage.setItem('notes', JSON.stringify(notesObj));\r\n showNotes();\r\n}", "function eliminarAlumno(legajoActual){\n for (let i = 0; i < listadoAlumnos.length; i++){\n if(listadoAlumnos[i][\"legajo\"] == legajoActual){\n //elimino del Array\n listadoAlumnos.splice(i, 1);\n //Elimino del local storage, no estaria eliminando lo que se carga con la pagina\n localStorage.removeItem(legajoActual);\n }\n }\n}", "function removeItemFromLocalStorage (key){\n window.localStorage.removeItem(key);\n}", "function deleteSave(){\n localStorage.removeItem(\"game\");\n location.reload();\n }", "function limpiar(){\n\tlocalStorage.clear();\n\tvar divCont = document.getElementById('content');\n\tdivCont.parentNode.removeChild(divCont);\n}", "removeTv(e){\n let id = e.target.id\n console.log(id)\n let tv = JSON.parse(localStorage.getItem('tv'));\n for (let c = 0 ; c < tv.result.length ;c++){\n if(tv.result[c].description === id){\n tv.result.splice(c,1)\n }\n }\n localStorage.setItem('tv',JSON.stringify(tv))\n window.location.href= '/display/my%20list'\n }", "function myfunc2(){\nput.value =\"\"\narr = []\nlocalStorage.clear()\t\t\nitems.innerHTML = \"\"\t\n\t}", "function RemoveBot(orderIndex) {\r\n var localData = JSON.parse(localStorage.getItem('formData')) || [];\r\n localData.splice(orderIndex, 1);\r\n localStorage.setItem('formData', JSON.stringify(localData));\r\n doShowAll();\r\n}", "function deleteRow(button){\r\n var x = button.parentNode.parentNode.id;\r\n document.getElementById(x).remove();\r\n del = JSON.parse(localStorage.getItem('PhoneBook'));\r\n del.splice(x,1);\r\n localStorage.setItem('PhoneBook', JSON.stringify(del));\r\n\r\n\r\n}", "function _delete() {\n var content = JSON.parse(localStorage.getItem(LS_KEY));\n content = content.filter((entry) => !(this.name === entry.name && this.key === entry.key && this.action === entry.action));\n localStorage.setItem(LS_KEY, JSON.stringify(content));\n renderList();\n}", "unfavoriteLocalStorage() {\n let favorites = localStorage.getItem(\"favorites\");\n //console.log(localStorage);\n let favoritesJSON = {\n questions: []\n };\n if (favorites != null) favoritesJSON = JSON.parse(favorites);\n //console.log(favoritesJSON);\n let questionList = favoritesJSON.questions;\n for (let i = 0; i < questionList.length; i ++) {\n if (questionList[i].question == this.props.question) {\n questionList.splice(i, 1);\n break;\n }\n }\n favoritesJSON.questions = questionList;\n localStorage.setItem(\"favorites\", JSON.stringify(favoritesJSON));\n }", "removeItemFromBasket(id) {\n let index = null;\n this.basket.forEach(function(item, idx) {\n if(item.uid == id) {\n index = idx;\n }\n });\n this.basket.splice(index, 1);\n xdLocalStorage.setItem('panier_erecolnat', JSON.stringify(this.basket));\n }", "function del(i){\nvar t = document.getElementById(\"game_\"+i);\nt.parentNode.remove(t);\nvar storage = window.localStorage;\nvar ii = storage.getItem(\"i\");\nii = ii - 1;\nstorage.removeItem(\"data_\"+i);\nstorage.setItem(\"i\",ii);\nlocation.reload(\"true\");\n}", "function EliminarChambaIndicada(){\n\t//debugger;\n\t// este obtiene el nombre donde guardo las chambas en el localstorage ('Noeliachambas')\n\tvar acumulador = localStorage.getItem(\"Usuario_Actual\") + \"chambas\";\n\t// este obtiene ese nombre ('Noeliachambas')y lo parsea para poder obtener el arreglo de arreglos \n\tvar chambas=JSON.parse(localStorage.getItem(acumulador));\n\t// este for recorre todo el arreglo de arreglos\n\tfor (i=0; i< chambas.length; i++){\n\t\t// este for recorre cada uno de esos arreglos\n\t\tfor (j=0; j< chambas[i].length; j++){\n\t\t\t// esta variable es para obtener el id del elemento en el que estoy actualmente\n\t\t\teliminar = JSON.parse(localStorage.getItem(\"id\"));\n\t\t\t// pregunto que si ese id es igual al id de la chamba\n\t\t\tif(eliminar == chambas[i][j]){\n\t\t\t\t// si es igual, intonces le digo que me elimine el que esta actualmente o sea i\n\t\t\t\tchambas.splice(i, 1);\n\t\t\t\t// luego vuelvo a guardarlo en localstorage todos loa arreglos menos el que eliminó obviamente\n\t\t\t\tlocalStorage[acumulador] = JSON.stringify(chambas);\n\t\t\t\t// muestro el mensaje para saber que se eliminó\n\t\t\t\talert(\"Se Eliminó correctamente\");\n\t\t\t}\n\t\t}\n\t}\n}", "function deleteList() {\n\n items.length = 0;\n localStorage.removeItem('list');\n insertItemsToList(items, itemsList);\n}", "function removeFromLocalStorage() {\n let storageArray = JSON.parse(localStorage.getItem(\"team\"));\n const updatedArray = storageArray.filter(\n (pokemon) => pokemon.id != $(this).attr(\"id\")\n );\n localStorage.setItem(\"team\", JSON.stringify(updatedArray));\n getDamageRelations()\n}", "function remove(index, data) {\n const id = data._id;\n arr.splice(index, 1);\n localStorage.setItem(\"items\", JSON.stringify(arr));\n fetch(`/delete/${id}`, {\n method: \"DELETE\"\n });\n}", "function removeLocalTodo(todoItem){\n let todoList;\n localStorage.getItem('todoList') === null ? todoList = [] : todoList = JSON.parse(localStorage.getItem('todoList'));\n todoList.splice(todoList.indexOf(todoItem), 1);\n localStorage.setItem('todoList', JSON.stringify(todoList));\n}", "removeEbook(e){\n let id = e.target.id\n console.log(id)\n let ebook = JSON.parse(localStorage.getItem('ebook'));\n for (let c = 0 ; c < ebook.result.length ;c++){\n if(ebook.result[c].book === id){\n ebook.result.splice(c,1)\n }\n }\n localStorage.setItem('ebook',JSON.stringify(ebook))\n window.location.href= '/display/my%20list'\n }", "function delete_save() {\n\tvamp_load_vals.forEach(\n\t\tfunction (val) {\n\t\t\tlocalStorage.removeItem(val);\n\t\t}\n\t);\n\t\t\n\t// Also delete special stuff:\n\tlocalStorage.removeItem('money_flag');\n\tlocalStorage.removeItem('energy_upgrade_flag');\n\tlocalStorage.removeItem('buffer');\n\t\n\tmessage('Your local save has been wiped clean.');\n}", "function deleteProductyes() {\r\n row = localStorage.getItem(\"index\");\r\n productParts.splice(row - 1, 1);\r\n localStorage.setItem(\"productParts\", JSON.stringify(productParts));\r\n document.getElementById('dontdelete').click();\r\n displayProductList(productParts);\r\n}", "function storge(items) {\r\n const notearray = localStorage.getItem(\"items\")\r\n ? JSON.parse(localStorage.getItem(\"items\"))\r\n : [];\r\n notearray.push(items);\r\n localStorage.setItem(\"items\", JSON.stringify(notearray));\r\n}", "removeMusic(e){\n let id = e.target.id\n let music = JSON.parse(localStorage.getItem('music'));\n for (let c = 0 ; c < music.result.length ;c++){\n if(music.result[c].name === id){\n music.result.splice(c,1)\n }\n }\n localStorage.setItem('music',JSON.stringify(music))\n window.location.href= '/display/my%20list'\n }", "function resetStorage() {\n localStorage.clear();\n // document.getElementById(\"addItems\").innerHTML = \"\";\n}", "function remove(){\n document.getElementById('textField').value = \"\";\n localStorage.removeItem('text');\n\n document.getElementById('emailField').value = \"\";\n localStorage.removeItem('email');\n\n\n document.getElementById('numField').value = \"\";\n localStorage.removeItem('num');\n\n\n document.getElementById('areaField').value = \"\";\n localStorage.removeItem('area');\n\n alert('The Form Local Storage Data Is Terminated !!!')\n }", "function removeTaskFromLocalStorage(taskItem) {\n let tasks;\n if(localStorage.getItem('tasks') === null) {\n tasks = [];\n } else {\n tasks = JSON.parse(localStorage.getItem('tasks'));\n }\n\n\n tasks.forEach(function(task, index) {\n if(taskItem.textContent === task) {\n tasks.splice(index, 1);\n\n }\n\n\n });\n\n localStorage.setItem('tasks', JSON.stringify(tasks));\n\n}", "function deleteItemFromShoppingCart(index) {\r\n let getLocalStorageData = localStorage.getItem(\"shoppingCartListItem\");\r\n shoppingCartListItem = JSON.parse(getLocalStorageData);\r\n shoppingCartListItem.splice(index, 1);\r\n localStorage.setItem(\"shoppingCartListItem\", JSON.stringify(shoppingCartListItem));\r\n showShoppingCartList();\r\n}", "function removeItem(e) {\n\n // getting the item to be deleted \n let todoItem = e.target.previousSibling.textContent;\n let idx = allItems.indexOf(todoItem); // looking for item's index in the tasks list\n allItems.splice(idx, 1); // removing the found index from the tasks list\n // console.log(allItems);\n localStorage.setItem(\"tasks\", JSON.stringify(allItems)); // updating the local storage \n list.innerHTML = \"\"; \n show(); \n}", "function deleteNote(index) {\r\n let notes = localStorage.getItem(\"notes\");\r\n if (notes == null) {\r\n notesObj = [];\r\n }\r\n else {\r\n notesObj = JSON.parse(notes); //string to array\r\n }\r\n notesObj.splice(index,1);//removes JS array elements and adds the existing elements back in place\r\n localStorage.setItem('notes', JSON.stringify(notesObj));//to update the local storage\r\n showNotes();\r\n\r\n}", "function deleteList(){\n\tlocalStorage.removeItem(list.key); // <===== SAVING TO LOCAL STORAGE\n\tlist = new signUpList(\"list\",\"signUpList\");\n\tupdateList();\n}", "function deleteItemFromStorage(itemIndex) {\r\n\t\tconst items = [];\r\n\t\tlet id = 0;\r\n\t\tgetItems().forEach((list, index) => {\r\n\t\t\tif (index !== parseInt(itemIndex)) {\r\n\t\t\t\tlist.id = id\r\n\t\t\t\titems.push(list)\r\n\t\t\t\tid += 1;\r\n\t\t\t}\r\n\t\t});\r\n\t\tsessionStorage.setItem('items', JSON.stringify(items));\r\n\t}" ]
[ "0.7596621", "0.745728", "0.7423483", "0.7410875", "0.739466", "0.7370081", "0.7370008", "0.73557967", "0.7307887", "0.7290829", "0.7286613", "0.7257068", "0.7254782", "0.72445923", "0.7234836", "0.72248477", "0.72214556", "0.7219268", "0.71734667", "0.7162025", "0.7155825", "0.7145898", "0.7134103", "0.7119164", "0.70837784", "0.7051203", "0.70489484", "0.7036694", "0.70233494", "0.7022005", "0.7019102", "0.7012018", "0.700857", "0.7006444", "0.69988364", "0.6982836", "0.69759315", "0.69533855", "0.6946825", "0.69359624", "0.6935857", "0.69298184", "0.6923937", "0.6910776", "0.6895828", "0.68920875", "0.6891328", "0.68885684", "0.6866522", "0.6865301", "0.6848274", "0.6844908", "0.6840656", "0.68397945", "0.68378586", "0.6833886", "0.6831707", "0.68303984", "0.6822617", "0.6822323", "0.6822046", "0.68203765", "0.6819066", "0.68147314", "0.68030846", "0.6801745", "0.6794672", "0.67888355", "0.67857087", "0.6784934", "0.67711437", "0.67682755", "0.67653453", "0.67617524", "0.67537147", "0.67534375", "0.6750475", "0.6745284", "0.6742958", "0.6742159", "0.6739229", "0.6736405", "0.6734076", "0.6731723", "0.6729262", "0.67286116", "0.6726257", "0.67222595", "0.6717979", "0.6716042", "0.6711246", "0.67052335", "0.67043835", "0.6703099", "0.6696542", "0.6693192", "0.6692648", "0.66831845", "0.6682543", "0.6681608", "0.66808033" ]
0.0
-1
avoiding old IEbug Calculates whether log level passes the given treshold
function _passingTreshold(logLevels, logTreshold, logLevel) { var tresholdValue = _.isNumber(logTreshold) ? logTreshold : logLevels[logTreshold] , logValue = logLevels[logLevel]; // when 'console' log requested, allow for any treshold greater than 0 return ('console' === logLevel) ? (logTreshold > 0) : logValue >= tresholdValue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static toLog(param) {\n const restrictionNum = this.LOG_LEVELS[this.logLevel];\n const requiredNum = this.LOG_LEVELS[param];\n return requiredNum > restrictionNum;\n }", "function is_level( level ) {\n return log_level > 0\n ? log_level > level\n : log_methods.length + log_level <= level;\n }", "function shouldLog(level) {\n return _logLevel >= level;\n}", "function is_level(level) {\n return log_level > 0 ? log_level > level : log_methods.length + log_level <= level;\n }", "function levelThreshhold(level) {\n return Math.pow(level, 2) * 100;\n}", "severity_enabled(sev) {\n if (!this._assert_sev(sev)) { return false; }\n let val = this._sev_value(sev);\n if (Util.DebugLevel == Util.LEVEL_TRACE) return true;\n if (Util.DebugLevel == Util.LEVEL_DEBUG) {\n return val >= LoggerUtility.SEVERITIES.DEBUG;\n }\n if (Util.DebugLevel == Util.LEVEL_OFF) {\n return val >= LoggerUtility.SEVERITIES.INFO;\n }\n return val >= LoggerUtility.SEVERITIES.WARN;\n }", "function logLevel() {\n var match = /[?&]log=([a-z]+)/.exec(window.location.search);\n return match ? match[1] : \"\";\n }", "function _() {\n return b.logLevel;\n}", "function N() {\n return S.logLevel;\n}", "function passesWarning(){\n return (billsTotal() >= warningLevelSet);\n }", "shouldLog(logLevel) {\n return (!!this._logger &&\n logLevel !== exports.HttpPipelineLogLevel.OFF &&\n logLevel <= this._logger.minimumLogLevel);\n }", "shouldLog(logLevel) {\n return (!!this._logger &&\n logLevel !== exports.HttpPipelineLogLevel.OFF &&\n logLevel <= this._logger.minimumLogLevel);\n }", "function getLogLevel(){if(logClient.logLevel===LogLevel.DEBUG){return LogLevel$1.DEBUG;}else if(logClient.logLevel===LogLevel.SILENT){return LogLevel$1.SILENT;}else{return LogLevel$1.ERROR;}}", "static isMoreOrEqualSevere(a, b) {\n return ConsoleLogger.severity[a] >= ConsoleLogger.severity[b];\n }", "function _checkLevel(){\n var currentTime = new Date().getTime();\n if (currentTime - levelTime > consts.LEVEL_INTERVAL){\n level += 1;\n interval = calcIntervalByLevel(level);\n views.setLevel(level);\n levelTime = currentTime;\n }\n}", "function checkThreshold() {\n\n\t\tupTime = null;\n\t\tdownTime = null;\n\n\t\t// don't work out linear yet\n\t\tif ( (vOld < threshold) && (v >= threshold) ) {\n\t\t\tupTime = true;\n\t\t}\n\t\telse if ( (vOld > threshold) && (v <= threshold) ) {\n\t\t\tdownTime = true;\n\t\t}\n\n\t}", "function T() {\n return E.logLevel;\n}", "function T() {\n return E.logLevel;\n}", "function logLevelSeverity(level) {\n switch (level) {\n case LogLevel.DEBUG:\n return 20;\n case LogLevel.INFO:\n return 40;\n case LogLevel.WARN:\n return 60;\n case LogLevel.ERROR:\n return 80;\n default:\n return (0, helpers_1.assertNever)(level);\n }\n}", "shouldLog(logLevel) {\n return this._options.shouldLog(logLevel);\n }", "shouldLog(logLevel) {\n return this._options.shouldLog(logLevel);\n }", "function isBelowThreshold(currentValue) {\r\n return currentValue < 40;\r\n }", "function checkLogs(){\n\n}", "function getLevel(l) {\n return LEVELS[l] || 7; // Default to debug\n}", "function severityLevel(num, severity_type) {\n if (isNaN(num)) return 'NA';\n if (num == 0) return 'Level 0';\n if (num <= severity_type[1]) return 'Level 1';\n if (num <= severity_type[2]) return 'Level 2';\n if (num <= severity_type[3]) return 'Level 3';\n if (num <= severity_type[4]) return 'Level 4';\n return 'Level 5';\n}", "function checkLevel(){\r\n let r = Math.floor(lines / 10) + 1\r\n if(r > level) {\r\n level = r\r\n }\r\n adjustDropSpeed()\r\n}", "function checkExperience(experience, level) {\n const y = (BASE*level) * (Math.pow(Math.E, level));\n return experience >= y ? ++level : level;\n}", "function showLevel (level) {\n switch (level) {\n case 'info':\n return true\n case 'error':\n return false\n default:\n return true\n }\n}", "function validateLevel(logLevel) {\n return config.logLevelRange.indexOf(logLevel);\n }", "function _closeToThreshold(abserr, relerr, expected) {\n return Math.max(abserr, relerr * Math.abs(expected));\n }", "function checkLevel(score) {\n if (score <= 20) {\n level = 1\n } else if (score <= 40) {\n level = 2\n } else if (score <= 60) {\n level = 3\n } else if (score <= 80) {\n level = 4\n } else {\n level = 5\n }\n return level\n}", "function CheckTraceLog(logMessage)\n{\n var trace_ExecutionCount=0\n do\n {\n aqUtils.Delay(2000)\n trace_ExecutionCount = trace_ExecutionCount + 1\n }\n while (aqString.FindLast(Trace_Log.Text,logMessage)==-1 && trace_ExecutionCount<=10) \n \n if(trace_ExecutionCount==11)\n {\n return false\n }\n else\n {\n return true\n } \n}", "function D() {\n return N.logLevel;\n}", "function levels () {\n if (billTotalTotal >= costWarning && billTotalTotal < costCritical) {\n return 'warning'\n }\n if (billTotalTotal >= costCritical) {\n return 'danger'\n }\n }", "function getLevels () {\n var args = global.args;\n\n if (!args.__log_levels) {\n let levels = ['access', 'proxy'];\n ['warn', 'error', 'debug', 'detail'].forEach(function (level) {\n if (args[level]) {\n levels.push(level);\n }\n });\n\n args.__log_levels = levels;\n }\n\n return args.__log_levels;\n}", "function getLogLevel() {\n return logLevel;\n}", "function getLogLevel() {\n return logLevel;\n}", "function getLogLevel() {\n return logLevel;\n}", "function getLogLevel() {\n return logLevel;\n}", "function Is(t) {\n var e;\n e = t, b.setLogLevel(e);\n}", "function isLessLevel(a, b)\n{\n\tif (a === Level1_b)\n\t\treturn b !== Level1 && b !== Level1_b;\n\n\tif (b === Level1_b)\n\t\treturn a !== Level1;\n\n\treturn a < b;\n}", "function reportMouseLog() {\n\t\t\t// Only log if X,Y have changed and have changed over the specified\n\t\t\t// minimum theshold.\n\t\t\tif (lastLogX !== lastX ||\n\t\t\t lastLogY !== lastY) {\n\t\t\t\tvar pixels = Math.round(Math.sqrt(Math.pow(lastLogY - lastY, 2) +\n\t\t\t\t\t\t\t\t\t\tMath.pow(lastLogX - lastX, 2)));\n\n\t\t\t\tif (pixels >= MIN_LOG_PIXEL_CHANGE) {\n\t\t\t\t\t// add to the log\n\t\t\t\t\tt.log(LOG_TYPE_MOUSE, BOOMR.now(), {\n\t\t\t\t\t\tx: lastX,\n\t\t\t\t\t\ty: lastY\n\t\t\t\t\t});\n\n\t\t\t\t\tlastLogX = lastX;\n\t\t\t\t\tlastLogY = lastY;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "get logLevel() {\r\n return this._logLevel;\r\n }", "function getLog() {\n\tvar log;\n\n\tif (log = GM_getValue(_log_name)) {\n\t\t_log_data = readQuery(log);\n\t\treturn Number(_log_data.enable) ? true : false;\n\t}\n\telse {\n\t\t_log_data = null;\n\t\treturn false;\n\t}\n}", "function isBelowThreshold(item) {\n return item < 10;\n }", "function getSyslogLevel(level) \n{\n\treturn level && levels[level] ? levels[level] : 'info';\n}", "function passesCritical(){\n return (billsTotal()>= criticalLevelSet);\n}", "function log(aktlvl, msg) {\r\n\t\tlogArr[logArr.length] = msg;\r\n\t\t\r\n\t\tif (logLevels.indexOf(aktlvl) <= efConfig.log) { \r\n\t\t\tdisplayMessage(msg);\r\n\t\t}\r\n\t\tif (aktlvl == \"tiddler\"){ \r\n\t\t\tcreateTiddler(logName, {responseText:logArr.join(\"\\n\")})\r\n\t\t}\r\n\t} // function log()", "isEnabled() {\n return this.enabled && this.severity >= exports.Severity.WARN;\n }", "function check_log(fileName)\n{\n\tvar content = fs.readFileSync(fileName, 'ascii').trim();\n\tvar lines = content.split('\\n');\n\tvar cnt = 0;\n\tvar previous = 0;\n\tfor (var i = 0; i < lines.length; i++) {\n\t var line = lines[i];\n\t var seg = line.split(',');\n\n\t if (seg[0].match(/2019-03-([0~3][7-9])\\s+/)) {\n\t //console.log(i, \" - ts\", seg[0]);\n\t if (cnt++ > 0) {\n\t \tvar ts = moment(seg[0]).unix();\n\t \tif (ts - previous > 10 * 60 + 30) {\n\t \t\tconsole.log(\"Warn: ts gap too big! at line\", i + 1)\n\t \t\tconsole.log(\"pre: \", i-1, lines[i-1]);\n\t \t\tconsole.log(\"cur: \", i, lines[i]);\n\t \t}\n\t \t\tprevious = ts;\n\n\t } else {\n\t \t\tprevious = moment(seg[0]).unix();\n\t }\n\t }\n\t}\n}", "logInfo(text) {\n if (this.availableLogLevels.indexOf(this.logLevel) <= this.availableLogLevels.indexOf('info')) {\n console.log(`Info : ${text}`);\n }\n }", "get logLevel() {\n return this._logLevel;\n }", "function log(level, message) {\n if (level <= log_level) {\n console.log(message);\n }\n}", "function IsLogLevelEnabled(currentLogLevel, currentLogLevelIsBitMask, targetLogLevel) {\r\n return currentLogLevelIsBitMask ?\r\n ((currentLogLevel & targetLogLevel) === targetLogLevel) :\r\n (currentLogLevel >= targetLogLevel);\r\n }", "function CalculateLogLevelsBitMaskValue(logLevels) {\r\n var logLevel = simplr_logger_1.LogLevel.None;\r\n for (var _i = 0, logLevels_1 = logLevels; _i < logLevels_1.length; _i++) {\r\n var level = logLevels_1[_i];\r\n logLevel |= level;\r\n }\r\n return logLevel;\r\n }", "function logWithLevel(level, msg, logFileName, consoleFormatter) {\n \"use strict\";\n if (logLevel >= level) {\n log(msg, logFileName, consoleFormatter);\n }\n}", "level(name) {\n // loop backwards over the levels because we want to take the hightest\n // level that matches. if DEBUG and OFF both match, we take DEBUG.\n for (let i = LEVEL.DEBUG; i >= 0; i--) {\n let patterns = this._level_patterns.get(LEVEL_NAME[i + '']);\n if (this._checkPattern(name, patterns)) {\n return i;\n }\n }\n return LEVEL.ERROR;\n }", "get logLevel() {\n return winston.level\n }", "get threshold() {\n return gainToDb(this._gt.value);\n }", "function log2(v) {\n let r;\n let shift;\n r = (v > 0xFFFF) << 4;\n v >>>= r;\n shift = (v > 0xFF) << 3;\n v >>>= shift;\n r |= shift;\n shift = (v > 0xF) << 2;\n v >>>= shift;\n r |= shift;\n shift = (v > 0x3) << 1;\n v >>>= shift;\n r |= shift;\n return r | v >> 1;\n }", "function updateLoggingLevel(val, success, error) {\n updateKV('Updating Logging Level', 'update-logging-level', val, success, error);\n}", "thresholdMet() {}", "thresholdMet() {}", "function OnLevelAlert()\n{\n}", "function tolerance(zoomLevel) {\n return 2 * Math.pow(2, -zoomLevel);\n}", "function isPassing(ratio) {\n if (ratio >= 7.99) {\n return \"Passing - Level AAA\";\n }\n else if (ratio >= 4.5) {\n return \"Passing - Level AA\";\n }\n else {\n return \"Failing\";\n }\n}", "function getMessageLevel(winstonLevel) {\n\t\n\t// TODO: Find a way to get the actual level values from AI's SDK\n\t// They are defined in SDK's \"Library/Contracts.ts\"\n\t \n\tvar levels = {\n\t\temerg: 4,\t// AI 'Critical' \n\t\talert: 4,\t// AI 'Critical' \n\t\tcrit: 4,\t// AI 'Critical' \n\t\terror: 3,\t// AI 'Error' \n\t\twarning: 2,\t// AI 'Warning' \n\t\twarn: 2,\t// AI 'Warning'\n\t\tnotice: 1,\t// AI 'Informational'\n\t\tinfo: 1,\t// AI 'Informational'\n\t\tverbose: 0,\t// AI 'Verbose'\n\t\tdebug: 0,\t// AI 'Verbose'\n\t\tsilly: 0\t// AI 'Verbose'\n\t};\n\t \n\treturn winstonLevel in levels ? levels[winstonLevel] : levels.info; \n}", "function checkTiltAndLight() {\n local supplyVoltage = hardware.voltage();\n local voltage = supplyVoltage * TiltAndLight.read();\n\n //devicelog(false,voltage);\n\n if (voltage > tiltThreshold){\n MedCanisterState.tilted = true;\n return \"Tilted\";\n }\n else{\n MedCanisterState.tilted = false;\n if (voltage < lidOpenLightThreshold){\n MedCanisterState.lidopen = true;\n return \"Opened\";\n }\n else{\n MedCanisterState.lidopen = false;\n return \"Closed\";\n }\n\n }\n}", "function testGood (level, spotMeta=streetsville) {\n let value = 'bad';\n spotMeta.levels\n .some( function (d) {\n if ( (d[0] < level) && ( level < d[1]) ) {\n // console.log(d);\n value = d[2]; return; }\n });\n //console.log(value)\n return value\n}", "function thresholdSetter(e) {\n threshold = Number(e.target.value)*0.01;\n}", "function testGreaterThan(val) {\n if (val > 100) { // Change this line\n return \"Over 100\";\n }\n\n if (val > 10) { // Change this line\n return \"Over 10\";\n }\n\n return \"10 or Under\";\n}", "function logVerbosity(level) {\n verbosity = level;\n return verbosity;\n }", "showPixelsOnTopOfLowerTreshold(canvasObject, t1, n) {\n if (canvasObject.domPixelsOnTopOfLowerTreshold != null) {\n canvasObject.domPixelsOnTopOfLowerTreshold.innerHTML = `Jumlah pixel pada ${canvasObject.stringTitle.toLowerCase()} dengan nilai pixel >= lower treshold (${t1}) adalah : ${n} pixel`;\n }\n }", "function log (level, message) {\r\n\r\n}", "function checkSkillThresholds(old_skill_exp, new_skill_exp){\n let new99s = [];\n let new120s = [];\n let isNewMax = false;\n const LVL_99_INV_EXP = 36073511;\n const LVL_120_INV_EXP = 80618654;\n const LVL_99_EXP = 13034431;\n const LVL_120_EXP = 104273167;\n let isDif = false;\n let level99threshold = LVL_99_EXP;\n let level120threshold = LVL_120_EXP;\n let numNew99s = 0;\n let numOld99s = 0;\n \n let result = {};\n // loop over each skill and compare their old and new exp\n for(let skill in new_skill_exp) {\n // set exp threshold if invention or not.\n if (skill.toLowerCase() == \"invention\") {\n level99threshold = LVL_99_INV_EXP;\n level120threshold = LVL_120_INV_EXP;\n } else {\n level99threshold = LVL_99_EXP;\n level120threshold = LVL_120_EXP;\n }\n // new_exp has data after the decimal so round that off\n old_exp = old_skill_exp[skill.toLowerCase()];\n new_exp = Math.round(new_skill_exp[skill])\n // check if they're equal. If they break the 99 or 120 threshold\n // log them.\n if(old_exp != new_exp){\n isDif = true;\n if(old_exp < level99threshold && new_exp >= level99threshold)\n {\n new99s.push(skill);\n }\n if(old_exp < level120threshold && new_exp >= level120threshold)\n {\n new120s.push(skill);\n }\n }\n if(new_exp > level99threshold)\n {\n numNew99s++;\n }\n if(old_exp > level99threshold)\n {\n numOld99s++;\n }\n }\n // update for archaeology!\n if (numOld99s < 27 && (numNew99s) == 27)\n {\n isNewMax = true;\n } else\n {\n isNewMax = false;\n }\n if (isDif)\n return {\"99s\": new99s, \"120s\": new120s, \"isNewMax\": isNewMax};\n else\n return null;\n}", "levelExpNeeded(level) {\n return (level - 1) * 100;\n }", "constructor(level) {\n this.debug = level >= DEBUG ? this.log('DEBUG', '#0000FF') : function() {};\n this.info = level >= INFO ? this.log('INFO', '#00C864') : function() {};\n this.warn = level >= WARN ? this.log('WARN', '#C80164') : function() {};\n }", "thresholdMessage(oee) {\n if (oee < 30) {\n this.view.thresholdMessage(oee)\n }\n }", "function testGreaterThan(val) {\n if (val > 100) { // Change this line\n return \"Over 100\";\n }\n if (val > 10) { // Change this line\n return \"Over 10\";\n }\n return \"10 or Under\";\n}", "function myLog(myString, level)\n {\n\n if ((self.debugLevel!=0)&&(level<=self.debugLevel))\n {\n console.log(myString);\n }\n }", "getLevel(feature) {\n return feature.properties.level;\n }", "getWindDangerLevel(data) {\n var j, len, ref, w;\n ref = this.getWarnings(data);\n for (j = 0, len = ref.length; j < len; j++) {\n w = ref[j];\n if (w.type === 'wind') {\n return w.level;\n }\n }\n return 0;\n }", "function testGreaterThan(val) {\n\tif (val > 100) {\n\t\treturn \"Over 100\";\n\t}\n\t\n\tif (val > 10) {\n\t\treturn \"Over 10\";\n\t}\n\t\n\treturn \"10 or Under\";\n}", "threshold (n) {\n // return n >= 0 ? 1 : -1;\n return n;\n }", "function levelToGain(level) {\r\n return level > 0 ? 2**(-(1.0-level)*3.32193*35/20) : 0; // 3.32193=log2(10); 35=scales level to -35...0 dB\r\n}", "function testGreaterThan(val) {\n\tif (val > 100) {\n\t\treturn \"Over 100\";\n\t}\n\tif (val > 10) {\n\t\treturn \"Over 10\";\n\t}\n\n\treturn \"10 or Under\";\n}", "function testGreaterThan(val){\n if (val > 100){\n return \"Over 100\";\n }\n if (val > 10){\n return \"Over 10\";\n }\n return \"10 or Under\";\n}", "function testLog10(callback)\n{\n\ttesting.assertEquals(Math.log10(10), 1, 'Wrong log 10 of 10', callback);\n\ttesting.success(callback);\n}", "function testGreaterThan(val) {\n\tif (val >= 20) {\n\t\treturn \"20 or Over\";\n\t}\n\t\n\tif (val >= 10) {\n\t\treturn \"10 or Over\";\n\t}\n\t\n\treturn \"Less than 10\";\n}", "log(level, message, extraInfo) {\n if ((0, logging_1.logLevelSeverity)(level) >= (0, logging_1.logLevelSeverity)(__classPrivateFieldGet(this, _Client_logLevel, \"f\"))) {\n __classPrivateFieldGet(this, _Client_logger, \"f\").call(this, level, message, extraInfo);\n }\n }", "function filterByHighImportance(el) {\n if (el.importance >= 4) {\n return true;\n }\n }", "function updateSigLevel(msg) {\n if (debug) {\n console.log(msg)\n console.log(sigLevel)\n }\n sigLevel = parseFloat(msg);\n if (debug) {\n console.log(sigLevel)\n }\n}", "function check_logging() {\n // Get the most recently logged song\n $.getJSON( \"http://10.0.1.10/log/api/v1.0/songs\", {desc: true, n: 1},\n function( data ) {\n // Construct a moment from the song's timestamp\n var mom_song = moment( data[\"songs\"][0].timestamp, moment.ISO_8601 );\n // Construct a moment for the threshold of 17m30s ago\n var mom_threshold = moment().subtract( 17, 'minutes' ).subtract( 30, 'seconds' );\n\n // If the song was logged before our threshold (17m30s), display the\n // alert message; otherwise, hide it\n if ( mom_song.isBefore( mom_threshold ) )\n $('#alert').css( 'display','initial' );\n else\n $('#alert').css( 'display','none' );\n });\n}", "function grade_node_status(rtt,loss){\n\tvar grade = -1\n\tif(rtt < 100 && loss < 0.01){\n\t\tgrade = 1\n\t} else if (rtt < 150 && loss < 0.02){\n\t\tgrade = 2\n\t} else if (rtt < 200 && loss < 0.04) {\n\t\tgrade = 3\n\t} else if (rtt < 300 && loss < 0.08) {\n\t\tgrade = 4\n\t} else if (loss < 0.9){\n\t\tgrade = 5\n\t} else if(loss > 0.9) {\n\t\tgrade = 6\n\t}\n\treturn grade;\n}", "set logLevel(aLogLevel) {\n if (!aLogLevel ||\n !((aLogLevel == Ci.gsILoggingService.LEVEL_OFF) ||\n (aLogLevel == Ci.gsILoggingService.LEVEL_FATAL) ||\n (aLogLevel == Ci.gsILoggingService.LEVEL_ERROR) ||\n (aLogLevel == Ci.gsILoggingService.LEVEL_WARN) ||\n (aLogLevel == Ci.gsILoggingService.LEVEL_DEBUG) ||\n (aLogLevel == Ci.gsILoggingService.LEVEL_INFO) ||\n (aLogLevel == Ci.gsILoggingService.LEVEL_TRACE))) {\n dump(\"LoggingService.set logLevel called with invalid argument.\\n\");\n throw Cr.NS_ERROR_INVALID_ARG;\n }\n\n this._firefoxPreferenceService.\n setIntPref(GS_PREFERENCE_LOGLEVEL, aLogLevel);\n }", "function assessSituation(dangerLevel, saveTheDay, badExcuse){\n if(dangerLevel >50){\n console.log(badExcuse);\n } else if(dangerLevel >= 10 && dangerLevel >=50){\n console.log(saveTheDay);\n } else if(dangerLevel <=9){\n console.log(\"Meh. Hard pass.\");\n }\n}", "get minimumLogLevel() {\n return logContext.minimumLogLevel\n }", "function testGreaterThan(val) {\n if (val > 100) {\n return \"over 100\";\n }\n if (val > 10) {\n return \"over 10\";\n }\n return \"under 10\";\n}", "static get LOG_ERRORS() {\n return false;\n }", "function testGreaterOrEqual(val) {\n if (val >= 20) { // Change this line\n return \"20 or Over\";\n }\n\n if (val >= 10) { // Change this line\n return \"10 or Over\";\n }\n\n return \"Less than 10\";\n}" ]
[ "0.7078592", "0.6772465", "0.67403865", "0.6683781", "0.6357224", "0.6217686", "0.61500543", "0.60483897", "0.59366786", "0.59135354", "0.5868117", "0.5868117", "0.58139783", "0.5813451", "0.5775238", "0.57187974", "0.5695288", "0.5695288", "0.5657519", "0.5653344", "0.5653344", "0.5645822", "0.5595264", "0.55424243", "0.5511358", "0.5510357", "0.5509938", "0.549997", "0.54957205", "0.5457895", "0.5449416", "0.5441708", "0.5436716", "0.5412092", "0.5403545", "0.53893816", "0.53893816", "0.53893816", "0.53893816", "0.5382019", "0.53798527", "0.5372541", "0.53585094", "0.532859", "0.5313847", "0.5312788", "0.53098136", "0.52946925", "0.5292911", "0.52597284", "0.5231744", "0.5219918", "0.52142054", "0.5210093", "0.52067757", "0.5199041", "0.5187987", "0.5185483", "0.5177775", "0.5173281", "0.51708746", "0.51502556", "0.51502556", "0.51393914", "0.51387", "0.5126222", "0.5119686", "0.5118489", "0.5111447", "0.5106372", "0.509967", "0.5098977", "0.5094313", "0.50923216", "0.50853705", "0.50815606", "0.50722605", "0.5072075", "0.50630283", "0.5055493", "0.5054673", "0.5050631", "0.5046427", "0.5024717", "0.50230825", "0.5022893", "0.5022357", "0.50132793", "0.50098646", "0.500781", "0.5007518", "0.50063336", "0.500628", "0.4990643", "0.4990022", "0.49899828", "0.49822733", "0.4978245", "0.4973719", "0.497337" ]
0.78095204
0
logs to console if passing log level treshold
function _logToConsole(logLevel, message) { var logConfig = app.config && app.config.logConfig , logLevels = logConfig && logConfig.logLevels , logTreshold = logConfig && logConfig.browserLogTreshold , shouldLogToConsole = logLevels && logTreshold , writeLog; // NOTE: 'log' level - special case always logged to console, if logging to console enabled in general // used to log AJAX requests, responses & errors to console only // (otherwise it triggers the endless loop logging via AJAX POST which triggers logging of AJAX requests) if (shouldLogToConsole && ('console' === logLevel || true === _passingTreshold(logLevels, logTreshold, logLevel))) { writeLog = consoleWrapper.log; message = [_getLogDate(), message].join(' '); writeLog(message); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _passingTreshold(logLevels, logTreshold, logLevel) {\n var tresholdValue = _.isNumber(logTreshold) ? logTreshold : logLevels[logTreshold]\n , logValue = logLevels[logLevel];\n\n // when 'console' log requested, allow for any treshold greater than 0\n return ('console' === logLevel) ? (logTreshold > 0) : logValue >= tresholdValue;\n }", "function shouldLog(level) {\n return _logLevel >= level;\n}", "function log(level, message) {\n if (level <= log_level) {\n console.log(message);\n }\n}", "function log(level) {\n if (log.level >= level) {\n console.log.apply(console, Array.prototype.slice.call(arguments, 1));\n }\n}", "static toLog(param) {\n const restrictionNum = this.LOG_LEVELS[this.logLevel];\n const requiredNum = this.LOG_LEVELS[param];\n return requiredNum > restrictionNum;\n }", "function logWithLevel(level, msg, logFileName, consoleFormatter) {\n \"use strict\";\n if (logLevel >= level) {\n log(msg, logFileName, consoleFormatter);\n }\n}", "function mylog(msg){\n if (debug == \"1\"){\n console.log(msg)\n }\n}", "logInfo(text) {\n if (this.availableLogLevels.indexOf(this.logLevel) <= this.availableLogLevels.indexOf('info')) {\n console.log(`Info : ${text}`);\n }\n }", "function L(level, ...args) {\n if (1 || level <= lrOptions.logLevel) {\n console.log(PF(...args));\n }\n}", "function is_level( level ) {\n return log_level > 0\n ? log_level > level\n : log_methods.length + log_level <= level;\n }", "function is_level(level) {\n return log_level > 0 ? log_level > level : log_methods.length + log_level <= level;\n }", "logVerbose(text) {\n if (this.availableLogLevels.indexOf(this.logLevel) <= this.availableLogLevels.indexOf('verbose')) {\n console.log(`Verbose: ${text}`);\n }\n }", "function writeLog(msg) {\n if (logEnabled) {\n console.log(msg);\n }\n}", "function log () {\n if (shouldLog) {\n console.log.apply(this, arguments)\n }\n}", "function myLog(myString, level)\n {\n\n if ((self.debugLevel!=0)&&(level<=self.debugLevel))\n {\n console.log(myString);\n }\n }", "function console_log(stringa){\n if (global_verbosity_argo > 0){\n console.log(stringa);\n }\n}", "function log() {\n var level = arguments[0];\n if (config.levels[level] >= config.levels[currentLogLevel]) {\n var value = arguments[1];\n if (value !== null && typeof value === 'object' && typeof value.pipe === 'function') {\n value.pipe(getstream(level));\n } else {\n _logger.log.apply(_logger, arguments);\n }\n return true\n }\n return false\n }", "function log (level, message) {\r\n\r\n}", "shouldLog(logLevel) {\n return this._options.shouldLog(logLevel);\n }", "shouldLog(logLevel) {\n return this._options.shouldLog(logLevel);\n }", "function log(msg){\n if(debug==true)\n console.log(msg);\n}", "logInfo(message) {\n if (this.logLevel < 10 /* INFO */)\n return;\n console.log(message);\n }", "log(level, message, extraInfo) {\n if ((0, logging_1.logLevelSeverity)(level) >= (0, logging_1.logLevelSeverity)(__classPrivateFieldGet(this, _Client_logLevel, \"f\"))) {\n __classPrivateFieldGet(this, _Client_logger, \"f\").call(this, level, message, extraInfo);\n }\n }", "function log(msg) {\n if (params.hasOwnProperty('verbose')) {\n console.log(msg)\n }\n}", "shouldLog(logLevel) {\n return (!!this._logger &&\n logLevel !== exports.HttpPipelineLogLevel.OFF &&\n logLevel <= this._logger.minimumLogLevel);\n }", "shouldLog(logLevel) {\n return (!!this._logger &&\n logLevel !== exports.HttpPipelineLogLevel.OFF &&\n logLevel <= this._logger.minimumLogLevel);\n }", "function debuglog(){\n if(false)\n console.log.apply(this,arguments)\n}", "static log(...args) {\n if (this.toLog('LOG')) {\n console.log.apply(console, arguments);\n }\n }", "function log(msg)\n{\n\tif (debug_mode !== false)\n\t{\n\t\tconsole.log(msg);\n\t}\n}", "function console_log(msg){\n\tif(menu_config.development_mode){\n\t\tconsole.log(msg);\n\t}\n}", "_setVerbosity() {\n this._logger = {\n info: () => {},\n error: () => {},\n warn: () => {},\n log: () => {}\n };\n\n if(this.config.verbose){\n this._logger = {\n info: console.info,\n error: console.error,\n warn: console.warn,\n log: console.log\n }\n }\n }", "function log(m){\n if (showLog){\n // console.log(m);\n }\n}", "function log(/* ...args */) {\n if (log_enabled) {\n console.log.apply(console, [].slice.call(arguments));\n }\n}", "function logger(param) {\n\t\tif (DEBUG)\n\t\t\tconsole.log(param);\n\t}", "function _log() {\n if (verbose && console) {\n console.log.apply(console, arguments);\n }\n }", "function log() {\n\ttry { \n\t\tconsole.log(\n\t\t\tshowOnly(logjs).forFilter(\n\t\t\t\t{\n\t\t\t\t\tapp: \"opsebf\",\n\t\t\t\t\tdate: \"20180623\",\n\t\t\t\t\tafter: \"1900\",\n\t\t\t\t}\n\t\t\t)\n\t\t);\n\t}\n\tcatch(err) {\n\t\tvar msg = \"opsebf logs only in development stage\";\n\t\tconsole.warn(msg);\n\t}\n}", "function log(m) {\n if (window.console) console.log(m);\n}", "consoleDevLog(...args) {\n if (this.logging) {\n console.log(...args);\n }\n }", "function logVerbosity(level) {\n verbosity = level;\n return verbosity;\n }", "function log() {\n var messages = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n messages[_i] = arguments[_i];\n }\n if (_Options__WEBPACK_IMPORTED_MODULE_1__[\"options\"].verbose) {\n if (console) {\n console.log.apply(console, Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spread\"])(messages));\n }\n }\n}", "function logIt(someMessage) {\n if (useLogging) {\n console.log(someMessage);\n }\n}", "function logIt(someMessage) {\n if (useLogging) {\n console.log(someMessage);\n }\n}", "function logIt(someMessage) {\n if (useLogging) {\n console.log(someMessage);\n }\n}", "function loginit(loglevel) {\n if ( /normal|verbose|veryverbose/.test(loglevel) ) { llog.on(); }\n //if (loglevel ==='verbose' ) { ... } // enable log on child module\n //if (loglevel ==='veryverbose' ) { ... } // enable verbose log on child module\n}", "log(...args) {\n if (this.options && this.options.debug) {\n console.log(...args);\n }\n }", "function showLog(txt)\n{\n\tif(showLog==true){\n\t\tconsole.log(txt);\n\t}\n}", "function log(msg) {\n if (window.console) {\n //console.log(msg);\n }\n}", "function log(level) {\n if(level <= verbosity && trace) {\n var args = Array.prototype.slice.call(arguments, 1);\n args.unshift(\"WebSQL:\");\n if(_isFunction(trace.text)) {\n trace.text(args, \"color: purple\");\n } else if(_isFunction(trace.log)) {\n trace.log(args.join(' '));\n }\n }\n }", "function enableLogging() {\n logEnabled = true;\n}", "function log(message){\r\n\tvar logging = false;\r\n\tif(logging){\r\n\t\tconsole.log(message);\r\n\t}\r\n}", "logVerbose(message) {\n if (this.logLevel < 20 /* VERBOSE */)\n return;\n console.log(message);\n }", "function log(m) {\n\tif (window.console) console.log(m);\n}", "function debuglog(txt) {\n if (DEBUG_ENABLED) log(txt);\n }", "function log(msg) {\n\tif (log.enabled) {\n\t\tconsole.log('QUOOR: ' + msg);\n\t}\n}", "log(...args) {\n if (this.options && this.options.debug) {\n console.log.apply(this, arguments);\n }\n }", "log (message) {\n // eslint-disable-next-line no-console\n if (this.verbose) console.log(message)\n }", "log() {\n if (!this.options.debug) {\n return;\n }\n\n // try to use 'debug' instead of 'log'\n // @todo Check IE9+\n (console.debug || console.info || console.log).apply(window.console, arguments);\n }", "function showLevel (level) {\n switch (level) {\n case 'info':\n return true\n case 'error':\n return false\n default:\n return true\n }\n}", "function consoleLog(msg) {\n if (verbose) {\n var now = new Date();\n Ext.log({}, Ext.Date.format(now, 'U') + ' | ' + msg);\n }\n }", "_log() {\n if (this.debug) {\n console.log(...arguments);\n }\n }", "log() {\n if (this.debug) {\n console.log(...arguments)\n }\n }", "function log(message) {\n if (GM_prefRoot.getValue(\"logChrome\", false)) {\n logf.apply(null, arguments);\n }\n}", "function print(options, message, loglevel = null, method = 'log') {\n var _a;\n // not in json mode\n // not silent\n // not at a loglevel under minimum specified\n if (!options.json &&\n options.loglevel !== 'silent' &&\n (loglevel == null ||\n logLevels[((_a = options.loglevel) !== null && _a !== void 0 ? _a : 'warn')] >= logLevels[loglevel])) {\n console[method](message);\n }\n}", "function log(message) {\n if (GM_prefRoot.get(\"logChrome\", false)) {\n logf.apply(null, arguments);\n }\n}", "function log(msg) {\n if(debug)\n console.log(msg);\n}", "function consoleLog() {\n if (typeof(console) == 'object' && typeof(console[\"log\"]) != \"undefined\") {\n console.log.apply(console, arguments);\n }\n}", "function log(msg) {\n\t\tif (DEBUG) {\n\t\t\tif (typeof console != 'undefined')\n\t\t\t\tconsole.log(msg);\n\t\t}\n\t}", "function log() {\n if (window.console) console.log.apply(console,arguments);\n}", "function log( ...args ) {\n\n if (!production) {\n\n console.log( ...args );\n\n }\n}", "function log(var1) {\n\tif(alerts_on == true) {\n\t\tconsole.log(var1);\n\t}\n}", "log(message, update) {\n if (this.logLevel < 3) {\n return\n }\n\n this.write(message, !update)\n }", "function loggerCallback(logLevel, message, piiLoggingEnabled) {\n console.log(message);\n}", "function log(x)\r\n{\r\n if (typeof(window.console) !== 'undefined') {\r\n window.console.log(x);\r\n }\r\n}", "log(level, message) {\n if (!this.options)\n return;\n if (this.options.logger) {\n this.options.logger(level, message);\n }\n else {\n switch (level) {\n case \"log\":\n console.log(message);\n break;\n case \"info\":\n console.info(message);\n break;\n case \"warn\":\n console.warn(message);\n break;\n case \"error\":\n console.error(message);\n break;\n }\n }\n }", "function ovverideConsole() {\n console.log = (message, args = []) => {\n const pattern = /^\\[bot\\.(info|error|plugin)\\](.*)/;\n const matches = message.match(pattern);\n\n if (!matches) {\n logger.log(message, ...args);\n return;\n }\n\n if (matches.length > 1) {\n const method = matches[1];\n const textMessage = matches[2]\n if (typeof logger[method] === 'function') {\n logger[method](textMessage, ...args);\n }\n }\n }\n}", "function myLog(message, logIt)\n{\n\tif (logIt)\n\t{\n\t\tconsole.log(message);\n\t}\n}", "function log(txt) {\n if(state.gameConfig.debug)\n console.log(txt)\n }", "function _() {\n return b.logLevel;\n}", "function log(val) {\n if(window.console)\n window.console.log(val);\n}", "function logit(msg){\r\n if(lc_Prefs.debug){\r\n if(logit.caller.name){\r\n msg = logit.caller.name + \": \" + msg\r\n }\r\n GM_log(msg);\r\n // !if not GM_log write to console!\r\n }\r\n}", "function checkLogs(){\n\n}", "constructor(level) {\n this.debug = level >= DEBUG ? this.log('DEBUG', '#0000FF') : function() {};\n this.info = level >= INFO ? this.log('INFO', '#00C864') : function() {};\n this.warn = level >= WARN ? this.log('WARN', '#C80164') : function() {};\n }", "function log(level, subject) {\n\t\tvar console = (window.console) ? window.console : {assert: function(){}, clear: function(){}, group: function(){}, groupCollapsed: function(){}, groupEnd: function(){}, debug: function(){}, log: function(){}, warn: function(){}, error: function(){}, }\n\t\t// console[level](subject);\n\t}", "setLogLevel(logLevel) {\n if (this.availableLogLevels.indexOf(logLevel) > -1) {\n this.logLevel = logLevel;\n }\n }", "function log(msg, useInBrowserLog){\n if(console) console.log(msg);\n}", "function getLogLevel(){if(logClient.logLevel===LogLevel.DEBUG){return LogLevel$1.DEBUG;}else if(logClient.logLevel===LogLevel.SILENT){return LogLevel$1.SILENT;}else{return LogLevel$1.ERROR;}}", "function wc_debugLog(note, priority) {\n if (priority - wc_debugMode > 0) console.log(note);\n}", "function log(aktlvl, msg) {\r\n\t\tlogArr[logArr.length] = msg;\r\n\t\t\r\n\t\tif (logLevels.indexOf(aktlvl) <= efConfig.log) { \r\n\t\t\tdisplayMessage(msg);\r\n\t\t}\r\n\t\tif (aktlvl == \"tiddler\"){ \r\n\t\t\tcreateTiddler(logName, {responseText:logArr.join(\"\\n\")})\r\n\t\t}\r\n\t} // function log()", "function clog(x){ console.warn(x) }", "set logLevel(level) {\n winston.level = level\n winston.debug('Requested log level to to: ' + level)\n winston.debug('Log level is now: ' + winston.level)\n }", "function L() {\n if (window.console && console.log) {\n console.log.apply(console, arguments);\n }\n}", "function logLevel() {\n var match = /[?&]log=([a-z]+)/.exec(window.location.search);\n return match ? match[1] : \"\";\n }", "function stackdriverLog(msg, debugLevel = 0) {\n if (constants.GLOBAL_DEBUG_ON) {\n console.log(msg);\n }\n}", "get logLevel() {\r\n return this._logLevel;\r\n }", "logDebug(message) {\n if (this.logLevel < 30 /* DEBUG */)\n return;\n console.log(message);\n }", "function logger () {\n if (process.env.RSA_DEBUG === 'true') console.log.apply(console, arguments) // eslint-disable-line\n}", "log(message) {\n if (this.verbose) {\n // tslint:disable-next-line no-console\n console.log(message);\n }\n }", "function consoleLog(msg) {\n if (typeof console.log != \"undefined\") {\n console.log(newclass + \": \" + msg);\n }\n}", "function warn () {\n if (shouldLog) {\n console.warn.apply(this, arguments)\n }\n}", "function cLog() {\n if ( allowLog ) {\n var text = '';\n for ( var i = 0; i < arguments.length; i++ ) {\n text += arguments[ i ] + ' ';\n }\n console.log( text );\n }\n}", "_logError() {\n console.log(\n `${Logger.colors.invalid}An invalid log level '${this.level}' was provided on logger instantiation.`,\n `\\nThe valid logger levels are as follows: ${Logger.validLevels.join(\n \", \"\n )}${Logger.colors.reset}`\n );\n }" ]
[ "0.7439479", "0.717772", "0.7114075", "0.68671894", "0.67454404", "0.6675245", "0.6635942", "0.662115", "0.66020495", "0.6595696", "0.6557402", "0.6527667", "0.6478416", "0.64368135", "0.6369496", "0.63677603", "0.63635105", "0.6348583", "0.6347433", "0.6347433", "0.6331852", "0.62904763", "0.62867403", "0.6259555", "0.6246817", "0.6246817", "0.6245132", "0.62369937", "0.62304026", "0.62249833", "0.6190902", "0.61755747", "0.6172023", "0.61014485", "0.6095111", "0.6093527", "0.60882264", "0.60787714", "0.6068019", "0.6058211", "0.6048338", "0.6048338", "0.6048338", "0.60382974", "0.603682", "0.6032713", "0.60326", "0.6025994", "0.6022055", "0.6020418", "0.60184985", "0.60107386", "0.60102206", "0.6005123", "0.59972817", "0.59962296", "0.59865016", "0.59854555", "0.59778625", "0.59746575", "0.59722126", "0.5958951", "0.5955862", "0.59555167", "0.5948299", "0.5933764", "0.5932018", "0.59273905", "0.59063214", "0.5905884", "0.5902647", "0.5901945", "0.5885216", "0.5884721", "0.5882006", "0.5879391", "0.5878969", "0.5873021", "0.5868583", "0.5868139", "0.5862254", "0.5860639", "0.58572984", "0.5852347", "0.58520514", "0.58500254", "0.5848868", "0.5845708", "0.5844595", "0.58414495", "0.5840012", "0.58391577", "0.58340746", "0.5824539", "0.582197", "0.58177155", "0.5815198", "0.58112794", "0.5803965", "0.57962686", "0.57962674" ]
0.0
-1
logs back to server & logentries if passing log level treshold
function _logToServer(logLevel, message, flush) { var logConfig = app.config && app.config.logConfig , logLevels = logConfig && logConfig.logLevels , logTreshold = logConfig && logConfig.clientAppLogTreshold , loggingUrl = logConfig && logConfig.loggingUrl , shouldLogToServer = logLevels && logTreshold && loggingUrl && 'console' !== logLevel , timeoutValue = 10 *1000 , logLengthFlushTreshold = 30 , logCacheLength , shouldFlush; if (shouldLogToServer && true === _passingTreshold(logLevels, logTreshold, logLevel)) { logCacheLength = app.cache.logData.length; message = [_getLogDate(), message].join(' '); app.cache.logData.push(['[', logCacheLength, '] ', message].join('')); window.clearTimeout(app.cache.logTimer); shouldFlush = logCacheLength > logLengthFlushTreshold || true === flush; if (true === shouldFlush) { _writeLogsToServer(logLevel, loggingUrl); } else { app.cache.logTimer = window.setTimeout(function() { _writeLogsToServer(logLevel, loggingUrl); }, timeoutValue); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function log(aktlvl, msg) {\r\n\t\tlogArr[logArr.length] = msg;\r\n\t\t\r\n\t\tif (logLevels.indexOf(aktlvl) <= efConfig.log) { \r\n\t\t\tdisplayMessage(msg);\r\n\t\t}\r\n\t\tif (aktlvl == \"tiddler\"){ \r\n\t\t\tcreateTiddler(logName, {responseText:logArr.join(\"\\n\")})\r\n\t\t}\r\n\t} // function log()", "function _passingTreshold(logLevels, logTreshold, logLevel) {\n var tresholdValue = _.isNumber(logTreshold) ? logTreshold : logLevels[logTreshold]\n , logValue = logLevels[logLevel];\n\n // when 'console' log requested, allow for any treshold greater than 0\n return ('console' === logLevel) ? (logTreshold > 0) : logValue >= tresholdValue;\n }", "function wwLog(logLevel, oData){\n\t\n\t// check if post back to main exists\n\t// if dosent exist, dont do anything\n\tif (typeof postMsgToMain == 'function') { \n\t\tpostMsgToMain(logLevel, \"INFO\" ,oData); \n\t}\n\n\n}", "log(level, message, extraInfo) {\n if ((0, logging_1.logLevelSeverity)(level) >= (0, logging_1.logLevelSeverity)(__classPrivateFieldGet(this, _Client_logLevel, \"f\"))) {\n __classPrivateFieldGet(this, _Client_logger, \"f\").call(this, level, message, extraInfo);\n }\n }", "log(message, update) {\n if (this.logLevel < 3) {\n return\n }\n\n this.write(message, !update)\n }", "function checkLogs(){\n\n}", "function _writeLogsToServer(logLevel, loggingUrl) {\n var dataToSend;\n\n dataToSend = {\n logLevel: logLevel\n , logData : app.cache.logData\n };\n app.cache.logData = [];\n $.ajax({\n type: 'POST'\n , url: loggingUrl\n , data: dataToSend\n });\n }", "function shouldLog(level) {\n return _logLevel >= level;\n}", "static toLog(param) {\n const restrictionNum = this.LOG_LEVELS[this.logLevel];\n const requiredNum = this.LOG_LEVELS[param];\n return requiredNum > restrictionNum;\n }", "function logLevel() {\n var match = /[?&]log=([a-z]+)/.exec(window.location.search);\n return match ? match[1] : \"\";\n }", "function updateLogs() {\r\n updatePositionLogs();\r\n updateContactLogs();\r\n}", "logOnServer(severity, url, lineNr, message) {\n // Can't use client here as we need to send to a different endpoint\n API._fetch(LOGGING_ENDPOINT, [{ severity, url, lineNr, message }])\n }", "function log (level, message) {\r\n\r\n}", "function updateLoggingLevel(val, success, error) {\n updateKV('Updating Logging Level', 'update-logging-level', val, success, error);\n}", "function log() {\n\t\t//var args = [].slice.call(arguments);\n\t\t//send('LOG', args);\n\t}", "function showlog(status) { }", "function is_level(level) {\n return log_level > 0 ? log_level > level : log_methods.length + log_level <= level;\n }", "function lemurlog_Switch(event, mode)\n{\n // don't allow switch if we're in private browse mode!\n if (!lemurlogtoolbar_inPrivateBrowseMode) {\n var time = new Date().getTime();\n \n lemurlog_g_enable = !lemurlog_g_enable;\n if(lemurlog_g_enable)\n {\n lemurlog_DoWriteLogFile(lemurlog_LOG_FILE, \"StartLogging\\t\" + time + \"\\n\");\n }\n else\n {\n lemurlog_g_enable = true; // crazy hack to allow writing in log file.\n lemurlog_DoWriteLogFile(lemurlog_LOG_FILE, \"PauseLogging\\t\" + time + \"\\n\");\n lemurlog_g_enable = false;\n }\n lemurlog_SetButtons();\n }\n}", "shouldLog(logLevel) {\n return (!!this._logger &&\n logLevel !== exports.HttpPipelineLogLevel.OFF &&\n logLevel <= this._logger.minimumLogLevel);\n }", "shouldLog(logLevel) {\n return (!!this._logger &&\n logLevel !== exports.HttpPipelineLogLevel.OFF &&\n logLevel <= this._logger.minimumLogLevel);\n }", "stopLog() {\n this.isLogging = false;\n }", "function log(level, message) {\n if (level <= log_level) {\n console.log(message);\n }\n}", "function is_level( level ) {\n return log_level > 0\n ? log_level > level\n : log_methods.length + log_level <= level;\n }", "function appendLog(req, res, next) {\n req.log = log.child({ \n 'ip': req.ip, 'method': req.method, 'url': req.originalUrl\n });\n next();\n}", "function _log() {\n // logger.trace.apply(logger, arguments)\n}", "function logRequest(){\n res.removeListener('finish', logRequest);\n res.removeListener('close', logRequest);\n httpLogger.info({\n startTime: req._startTime,\n duration: (new Date() - req._startTime),\n statusCode: req.statusCode,\n method: req.method,\n ip: req.ip,\n uri: req.originalUrl,\n userId: (req.user && req.user._id.toString())\n });\n }", "function trace(msg){\r\n rootLogger.trace(msg)\r\n}", "function getLogLevel(){if(logClient.logLevel===LogLevel.DEBUG){return LogLevel$1.DEBUG;}else if(logClient.logLevel===LogLevel.SILENT){return LogLevel$1.SILENT;}else{return LogLevel$1.ERROR;}}", "onLogEnd(request, response) {\n const { debug, logRequest } = this.injector.settings.logger;\n if (request.log) {\n if (debug) {\n request.log.debug({\n event: \"request.end\",\n status: response.statusCode,\n data: request.ctx.data\n });\n }\n else if (logRequest) {\n request.log.info({\n event: \"request.end\",\n status: response.statusCode\n });\n }\n request.log.flush();\n }\n }", "function log(toAdd) {\n if (verboseMode && notError) {\n logString += toAdd + \"<br />\";\n }\n}", "function loginit(loglevel) {\n if ( /normal|verbose|veryverbose/.test(loglevel) ) { llog.on(); }\n //if (loglevel ==='verbose' ) { ... } // enable log on child module\n //if (loglevel ==='veryverbose' ) { ... } // enable verbose log on child module\n}", "function L(level, ...args) {\n if (1 || level <= lrOptions.logLevel) {\n console.log(PF(...args));\n }\n}", "function log() {\n var level = arguments[0];\n if (config.levels[level] >= config.levels[currentLogLevel]) {\n var value = arguments[1];\n if (value !== null && typeof value === 'object' && typeof value.pipe === 'function') {\n value.pipe(getstream(level));\n } else {\n _logger.log.apply(_logger, arguments);\n }\n return true\n }\n return false\n }", "sendLogs() {\n this.log.info('logging from tests');\n }", "function middleware(req, res, next) {\n if (req.url === '/log') {\n var level = req.body.level,\n message = req.body.message,\n meta = req.body.meta;\n\n if (level && message && log[level]) {\n if (meta) {\n log[level](message, meta);\n } else {\n log[level](message);\n }\n }\n res.end();\n } else {\n next();\n }\n}", "function enableLogging() {\n logEnabled = true;\n}", "function _saveLog(logLevel, message, flush) {\n var voidLogging = (!logLevel || !message);\n\n if (true === voidLogging) {\n return;\n }\n\n _logToConsole(logLevel, message);\n _logToServer(logLevel, message, flush);\n }", "function log() {\n logger.hit(`${this.req.url} ${this.statusCode} ${this.req.method} ${this.req.body.From} ${this.req.body.Body} ${this[action_symbol]}`, this)\n}", "function logCurentCallToLocaLStorage() {\n\n}", "setLogLevel(logLevel) {\n if (this.availableLogLevels.indexOf(logLevel) > -1) {\n this.logLevel = logLevel;\n }\n }", "function setLogEnabled(enabled) {\n logEnabled = enabled;\n}", "function sendLogsToServer() {\n IdbRTC.getLog().then((data) => {\n if (data && data.length > 0) {\n let counter = 0, tempArray = [], dynamicLength = data.length;\n while (dynamicLength > 0) {\n /* Length of array which will be added to 'tempArray' */\n let len = dynamicLength >= messagesPerPostCall ? messagesPerPostCall : data.length;\n /* From index for slicing the 'data' */\n let from = counter * messagesPerPostCall;\n /* To index for slicing the 'data' */\n let to = from + len;\n tempArray.push(data.slice(from, to));\n dynamicLength = dynamicLength - len;\n counter++;\n }\n tempArray.map((arr) => {\n /* Double check so as we do not increase 4xx error counts on ES servers. */\n arr.length > 0 && postCall(arr);\n });\n }\n });\n}", "function log() {\n //log here\n }", "function clear_client_log()\n\t{\n\t\t// Remove indicator icon\n\t\tjQuery('#topmenu_info_error').remove();\n\n\t\tif (!window.localStorage) return false;\n\n\t\tvar max = MAX_LOGS;\n\t\t// check if we have more log entries then allowed, happens if MAX_LOGS get changed in code\n\t\tif (window.localStorage[LASTLOG] > MAX_LOGS)\n\t\t{\n\t\t\tmax = 1000;\t// this should NOT be changed, if MAX_LOGS get's smaller!\n\t\t}\n\t\tfor(var i=0; i < max; ++i)\n\t\t{\n\t\t\tif (typeof window.localStorage[LOG_PREFIX+i] != 'undefined')\n\t\t\t{\n\t\t\t\tdelete window.localStorage[LOG_PREFIX+i];\n\t\t\t}\n\t\t}\n\t\tdelete window.localStorage[LASTLOG];\n\n\t\treturn true;\n\t}", "function postLog() {\n api(\"POST\", \"/log\", JSON.stringify(logData), (res)=>{/*donothing*/});\n}", "enableLogging() {\n /**\n * GENERIC ERROR LOGGING\n */\n this.conn.on('error', (err) => {\n this.logMessage(err, false);\n });\n if (!this.verbose) {\n return;\n }\n /**\n * VERBOSE EVENT LOGGING\n */\n this.conn.on('connect', (conn) => {\n this.logMessage(`Connection established to ${conn.currentServer.url.host}`);\n });\n this.conn.on('disconnect', () => {\n this.logMessage('Disconnected', false);\n });\n this.conn.on('reconnect', () => {\n this.logMessage('Reconnected', false);\n });\n this.conn.on('close', () => {\n this.logMessage('Connection closed');\n });\n }", "break() {\n this.write('log', '', null, false);\n }", "stopAndLog() {\n\t\tthis.stop();\n\t\tthis.log();\n\t}", "function logResponse(respMsg) {\r\n\tif (logFile == \"yes\") {\r\n\t\tfs.appendFileSync(\"error.log\", \"\\r\" + respMsg)\r\n\t}\r\n}", "doLog(level, parentArgs) {\r\n if (!this.initialized) {\r\n return; // no instance to log\r\n }\r\n\r\n let args = Array.prototype.slice.call(parentArgs);\r\n if (Buffer.isBuffer(args[0])) { // the first argument is \"reqId\"\r\n let reqId = args.shift().toString('base64');\r\n args[0] = reqId + ': ' + args[0];\r\n }\r\n this.instance[level].apply(this.instance, args);\r\n }", "logInfo(text) {\n if (this.availableLogLevels.indexOf(this.logLevel) <= this.availableLogLevels.indexOf('info')) {\n console.log(`Info : ${text}`);\n }\n }", "function sendLogList(logData) {\n var xhr = new XMLHttpRequest(),\n startTime = new Date().getTime();\n\n xhr.onreadystatechange = function () {\n var endTime = new Date().getTime(),\n consumption = endTime - startTime;\n\n if (xhr.readyState == 4) {\n\n // caps the maximum of response time\n if (consumption < config.logIntervalLimit) {\n\n // response time checks if it bigger than logResponseLimit\n // than increase the time of log interval\n if (consumption > config.logResponseLimit) {\n config.logIntervalUse *= 2;\n stopInterval();\n startInterval();\n\n // or decrease the time of log interval\n } else if (config.logIntervalUse > config.logIntervalMin) {\n config.logIntervalUse /= 2;\n stopInterval();\n startInterval();\n }\n }\n }\n };\n xhr.open('POST', config.server + 'rest/widgets/log', true);\n xhr.timeout = 5000;\n xhr.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');\n xhr.send(JSON.stringify(logData));\n\n loggingList.length = 0;\n }", "function uiLog_flush() {\n _uiLog_flushSet = null;\n\n // nothing to flush?\n if(_uiLog_entries.length == 0)\n return;\n\n // prepare log for transfer\n var log = \"\";\n for(var i = 0; i < _uiLog_entries.length; i++) {\n // get an entry\n var entry = _uiLog_entries[i];\n\n // add the entry to the log\n log += entry[\"time\"] + \"\\t\" +\n entry[\"event\"] + \"\\t\" +\n entry[\"target\"] + \"\\t\" +\n entry[\"id\"];\n for(var j = 0; j < entry[\"paramNumber\"]; j++)\n // parameters can have new lines and other special characters\n log += \"\\t\" + escape(entry[\"param\"+j]);\n\n log += \"\\n\";\n }\n\n // use commFrame to communicate to the backend\n top.code.comm_scheduleLoad(\"/uiLog.php?log=\"+escape(log));\n\n // clean up the log\n _uiLog_entries = new Array();\n}", "applyAudit() {\n super.applyAudit();\n this.log.debug('This is only another custom messagem from your custom server :)');\n }", "function onSuccessLogAuth(req, res) {\n var data = {\"Author\" : req.query.uid, \"LogType\" : ldatabase.LogType.ApiAuthFail}\n ldatabase.queryLogs(data, onSuccessLogGrab, onFaulLogGrab, req, res)\n}", "get logLevel() {\r\n return this._logLevel;\r\n }", "function log(level) {\n if (log.level >= level) {\n console.log.apply(console, Array.prototype.slice.call(arguments, 1));\n }\n}", "function receiver(request, sender, sendResponse) {\n getLevel(request.time,request.level);\n}", "set logLevel(level) {\n winston.level = level\n winston.debug('Requested log level to to: ' + level)\n winston.debug('Log level is now: ' + winston.level)\n }", "function logAllTheThings(req, res, next) {\n\n log = [];\n log.push(req.header('user-agent').replace(/,/g, ' '));\n log.push(new Date().toISOString()); \n log.push(req.method);\n log.push(req.originalUrl);\n log.push(`${req.protocol.toUpperCase()}/${req.httpVersion}`); \n log.push(res.statusCode);\n\n fs.appendFile(\n 'server/log.csv', `\\n ${log.toString()}`,\n (err) => {if(err) throw err, console.log(err); else console.log(\"Traffic added to log.\")});\n next();\n}", "shouldLog(logLevel) {\n return this._options.shouldLog(logLevel);\n }", "shouldLog(logLevel) {\n return this._options.shouldLog(logLevel);\n }", "function logit(msg){\r\n if(lc_Prefs.debug){\r\n if(logit.caller.name){\r\n msg = logit.caller.name + \": \" + msg\r\n }\r\n GM_log(msg);\r\n // !if not GM_log write to console!\r\n }\r\n}", "function mylogging(logg)\r\n{\r\n\t let r = logg.requests[0].response.headers ;\r\n\t r = JSON.stringify(r) ;\r\n\t console.log(r) ;\r\n\t fs.writeFileSync(filePath,r);\r\n}", "function log(message) {\n if (VERBOSE_LOGGING)\n postmessage('@console', \"Worker Log : \" + message);\n }", "function lastLog(luser) {\n //alert(rl);\n var logfetchurl = config.fetchLogs;\n var param = \"&user=\" + luser; //+ \"&role=\" + rl;\n param += \"&start=1&end=1\";\n $.ajax({\n url: logfetchurl,\n type: 'POST',\n data: param,\n header: \"application/x-www-form-urlencoded\",\n async: false,\n success: function(data) {\n var status1 = \"<p style=\\\"direction:ltr;\\\">Status:\" + \" \" + data['status'] + \", Message:\" + data['message'] + \"</p>\";\n if (data[\"status\"].toLowerCase() == \"success\") {\n tmp = data.records[0];\n $('.notify').remove();\n $.notify(status1, {\n type: \"success\",\n \"position\": \"top\",\n background: \"#31b0d5\"\n });\n } else {\n tmp = 0;\n $('.notify').remove();\n $.notify(status1, {\n type: \"warning\",\n \"position\": \"top\"\n });\n }\n },\n error: function(jqXHR, exception) {\n var msg = '';\n if (jqXHR.status === 0) {\n msg = 'Not connect.\\n Verify Network.';\n } else if (jqXHR.status == 404) {\n msg = 'Requested page not found. [404]';\n } else if (jqXHR.status == 500) {\n msg = 'Internal Server Error [500].';\n } else if (exception === 'parsererror') {\n msg = 'Requested JSON parse failed.';\n } else if (exception === 'timeout') {\n msg = 'Time out error.';\n } else if (exception === 'abort') {\n msg = 'Ajax request aborted.';\n } else {\n msg = 'Uncaught Error.\\n' + jqXHR.responseText;\n }\n //alert(msg);\n }\n });\n return false;\n}", "function myLog(myString, level)\n {\n\n if ((self.debugLevel!=0)&&(level<=self.debugLevel))\n {\n console.log(myString);\n }\n }", "function LogEvents(){ \r\n if (GM_getValue('autoLog', '') != \"checked\" || document.body.innerHTML.indexOf('message_body') == -1)\r\n return;\r\n var boxes = document.getElementById(SCRIPT.appID+'_content').getElementsByTagName('span');\r\n if(boxes.length==0)\r\n return;\r\n GM_log('Autoplayer autoLog');\r\n var messagebox = boxes[0];\r\n // skip this messagebox... for now\r\n if(messagebox.innerHTML.indexOf('Someone has invited you to join their Clan') != -1){\r\n if(boxes[1].innerHTML.indexOf('New') != -1)\r\n messagebox = boxes[2];\r\n else\r\n messagebox = boxes[1];\r\n }\r\n if(messagebox.innerHTML.indexOf('You just bought') != -1){\r\n var item = messagebox.innerHTML.split('You just bought')[1].split('for')[0];\r\n addToLog(\"You just bought \" + item);\r\n }\r\n else if(messagebox.innerHTML.indexOf('You successfully dominated') != -1){\r\n var minion = messagebox.innerHTML.split('You successfully dominated ')[1];\r\n minion = minion.split('.')[0];\r\n addToLog(\"You successfully dominated \" + minion);\r\n }\r\n else if(messagebox.innerHTML.indexOf('Rare Ability') != -1){\r\n var ability = boxes[1].innerHTML.split('return true;\">')[1].split('</a>')[0];\r\n addToLog(\"acquired Rare Ability \" + ability);\r\n }\r\n else if(messagebox.innerHTML.indexOf('You withdrew') != -1){\r\n var deposit = messagebox.innerHTML.split('blood.gif\">')[1];\r\n deposit = deposit.replace(\",\",\"\");\r\n deposit = deposit.replace(\",\",\"\");\r\n deposit = parseInt(deposit);\r\n addToLog(\"withrew \" + deposit);\r\n }\r\n else if(messagebox.innerHTML.indexOf('deposited and stored safely') != -1){\r\n var deposit = messagebox.innerHTML.split('blood.gif\">')[1];\r\n deposit = deposit.replace(\",\",\"\");\r\n deposit = deposit.replace(\",\",\"\");\r\n deposit = parseInt(deposit);\r\n addToLog(\"deposit \" + deposit);\r\n }\r\n else if(messagebox.innerHTML.indexOf('more health') != -1){\r\n var addHealth = messagebox.innerHTML.split('You get')[1].split('more health')[0];\r\n var cost = 0;\r\n if(messagebox.innerHTML.indexOf('blood.gif\">') != -1)\r\n cost = messagebox.innerHTML.split('blood.gif\">')[1];\r\n cost = cost.replace(\",\",\"\");\r\n cost = cost.replace(\",\",\"\");\r\n cost = parseInt(cost );\r\n addToLog(\"health +\"+ addHealth + \" for \" + cost );\r\n }\r\n else if(messagebox.innerHTML.indexOf('You fought with') != -1){\r\n if(GM_getValue('freshMeat', '') != \"checked\"){\r\n var user = messagebox.innerHTML.split('href=\"')[1].split('\"')[0];\r\n var username = messagebox.innerHTML.split('true;\">')[1].split('</a>')[0];\r\n user = '<a href=\"'+user+'\">'+username+'</a>';\r\n\r\n var battleResult = document.evaluate(\"//span[@class='good']\",document,null,9,null).singleNodeValue;\r\n if(battleResult!=null && battleResult.innerHTML.indexOf('blood.gif\">') != -1){\r\n var cost = battleResult.innerHTML.split('blood.gif\">')[1]; \r\n cost = cost.replace(\",\",\"\");\r\n cost = cost.replace(\",\",\"\");\r\n addToLog(\"fought \"+ user + \" WON \" +parseInt(cost));\r\n }\r\n battleResult = document.evaluate(\"//span[@class='bad']\",document,null,9,null).singleNodeValue;\r\n if(battleResult!=null && battleResult.innerHTML.indexOf('blood.gif\">') != -1)\r\n {\r\n var cost = battleResult.innerHTML.split('blood.gif\">')[1]; \r\n cost = cost.replace(\",\",\"\");\r\n cost = cost.replace(\",\",\"\");\r\n addToLog(\"fought \"+ user + \" LOST \" +parseInt(cost));\r\n }\r\n for (var i=1;i<boxes.length;i++)\r\n if(boxes[i].innerHTML.indexOf('found')!= -1){\r\n addToLog(\"found \"+ boxes[i].innerHTML.split('found ')[1].split('while fighting ')[0]);\r\n i=boxes.length;\r\n }\r\n if(GM_getValue('rFightList', '') == \"checked\")\r\n CycleFightList(); \r\n }\r\n }\r\n else if(messagebox.innerHTML.indexOf('too weak to fight') != -1){\r\n if(GM_getValue('rFightList', '') == \"checked\")\r\n CycleFightList(); \r\n }\r\n else if(messagebox.innerHTML.indexOf('You cannot fight a member of your Clan') != -1){\r\n if(GM_getValue('rFightList', '') == \"checked\"){\r\n var opponents = GM_getValue('fightList', '').split(\"\\n\");\r\n var opponentList=\"\";\r\n for (var i=1;i<opponents.length;i++)\r\n opponentList = opponentList+ opponents[i]+\"\\n\";\r\n GM_setValue('fightList', opponentList);\r\n }\r\n }\r\n else if(messagebox.innerHTML.indexOf('The Wheel and fate has smiled upon you') != -1){\r\n addToLog(messagebox.innerHTML.split('smiled upon you.<br>')[1].split('Repay the favor')[0]);\r\n }\r\n else if(messagebox.innerHTML.indexOf('The wheel halts suddenly') != -1){\r\n addToLog(messagebox.innerHTML.split('<br>')[1]);\r\n setTimeout(\"document.location ='\" + \"http://apps.facebook.com/\"+SCRIPT.name+\"/buffs.php\", delay);\r\n return; \r\n }\r\n else if(messagebox.innerHTML.indexOf('hours and') != -1){\r\n // index page shows crypt timer\r\n if (location.href.indexOf(SCRIPT.name+'/index') != -1){\r\n // do nothing for now\r\n }\r\n // buffs page shows buff timer\r\n if (location.href.indexOf(SCRIPT.name+'/buffs') != -1){\r\n var now = Math.floor(new Date().getTime() / 1000);\r\n time = 3600 * parseInt(messagebox.innerHTML.split('hours')[0]);\r\n time = time + 60 *(1+ parseInt(messagebox.innerHTML.split('hours and')[1]));\r\n GM_setValue('spin',now + time );\r\n }\r\n }\r\n else if(messagebox.innerHTML.indexOf('Fresh Meat') != -1){\r\n // do nothing\r\n }\r\n else if(messagebox.innerHTML.indexOf('icon-blood.gif') != -1){\r\n // do nothing\r\n }\r\n else if(messagebox.innerHTML.indexOf('You cannot heal so fast') != -1){\r\n document.getElementById(SCRIPT.appID+'_health_refill_popup').style.display = 'block';\r\n setTimeout(function(){document.getElementById(SCRIPT.appID+'_health_refill_popup').getElementsByTagName('form')[0].submit();},delay);\r\n return;\r\n }\r\n else if(messagebox.innerHTML.indexOf('You do not have enough favor points to spin the wheel again') != -1){\r\n window.location = \"http://apps.facebook.com/\"+SCRIPT.name+\"/buffs.php\";\r\n return;\r\n }\r\n //else\r\n //alert(messagebox.innerHTML);\r\n}", "function _log(text) {\r\n\tif (Config.debug) {\r\n\t\tGM_log((new Date().getTime() - Cache.startTime) + 'ms | ' + text);\r\n\t}\r\n}", "function clearErrorLog(){\n sendRequest(\n 'tools',\n {\n 'action': 'clearErrorLog'\n }, function(data){\n $('#logerrorcount').html('0');\n });\n}", "function setLogLevel(level) {\r\n instances.forEach(function (inst) {\r\n inst.logLevel = level;\r\n });\r\n}", "function setLogMode(mode) {\n logMode = mode;\n }", "function testForErrorOnlyLogging() {\n let loggerConfig = {\n \"log-level\": customLogger.LOG_LEVEL.error\n }\n\n customLogger.setConfig(loggerConfig);\n\n let txnID = shortid.generate();\n customLogger.logMessage(\"This is ERROR message 1 for same transaction\", customLogger.LOG_LEVEL.error, \"some-business-tag\", txnID);\n customLogger.logMessage(\"This is ERROR message 2 for same transaction\", customLogger.LOG_LEVEL.error, \"some-business-tag\", txnID);\n\n customLogger.logMessage(\"This is DEBUG message. Will not be logged\", customLogger.LOG_LEVEL.debug, \"some-business-tag\", shortid.generate());\n customLogger.logMessage(\"This is INFO message. Will not be logged\", customLogger.LOG_LEVEL.info, \"some-business-tag\", shortid.generate());\n customLogger.logMessage(\"This is VERBOSE message. Will not be logged\", customLogger.LOG_LEVEL.verbose, \"some-business-tag\", shortid.generate());\n customLogger.logMessage(\"This is WARN message. Will not be logged\", customLogger.LOG_LEVEL.warn, \"some-business-tag\", shortid.generate());\n}", "function debugOut(msg) {\r\n if (debugMode) GM_log(msg);\r\n}", "function reportMouseLog() {\n\t\t\t// Only log if X,Y have changed and have changed over the specified\n\t\t\t// minimum theshold.\n\t\t\tif (lastLogX !== lastX ||\n\t\t\t lastLogY !== lastY) {\n\t\t\t\tvar pixels = Math.round(Math.sqrt(Math.pow(lastLogY - lastY, 2) +\n\t\t\t\t\t\t\t\t\t\tMath.pow(lastLogX - lastX, 2)));\n\n\t\t\t\tif (pixels >= MIN_LOG_PIXEL_CHANGE) {\n\t\t\t\t\t// add to the log\n\t\t\t\t\tt.log(LOG_TYPE_MOUSE, BOOMR.now(), {\n\t\t\t\t\t\tx: lastX,\n\t\t\t\t\t\ty: lastY\n\t\t\t\t\t});\n\n\t\t\t\t\tlastLogX = lastX;\n\t\t\t\t\tlastLogY = lastY;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function sendLog(malfunctionId){\n timestamp = userActions[1][0];\n userActions = JSON.stringify(userActions);\n $.ajax({\n url: myApp.urSrvURL + \"log.php\",\n type: \"POST\",\n data: ({\"logData\": userActions, \"timestamp\": timestamp, \"malfunctionId\": malfunctionId})\n });\n }", "set logLevel(aLogLevel) {\n if (!aLogLevel ||\n !((aLogLevel == Ci.gsILoggingService.LEVEL_OFF) ||\n (aLogLevel == Ci.gsILoggingService.LEVEL_FATAL) ||\n (aLogLevel == Ci.gsILoggingService.LEVEL_ERROR) ||\n (aLogLevel == Ci.gsILoggingService.LEVEL_WARN) ||\n (aLogLevel == Ci.gsILoggingService.LEVEL_DEBUG) ||\n (aLogLevel == Ci.gsILoggingService.LEVEL_INFO) ||\n (aLogLevel == Ci.gsILoggingService.LEVEL_TRACE))) {\n dump(\"LoggingService.set logLevel called with invalid argument.\\n\");\n throw Cr.NS_ERROR_INVALID_ARG;\n }\n\n this._firefoxPreferenceService.\n setIntPref(GS_PREFERENCE_LOGLEVEL, aLogLevel);\n }", "log(kind, msg, data){ this.logger(kind, msg, data) }", "function withLogging() {\n try {\n saveUserData(user);\n } catch (error) {\n logToSnapErrors(error);\n }\n}", "function log() {\n if (logging) {\n for (let i = 0; i < logBody.length; i++)\n console.log(logBody[i])\n }\n }", "function l(pvScriptName,pvFunctionName,pvMessage,pvLevel){\n\n // This function can be passed a pre-formatted log string, usually passed back from the balu-parse-server.\n // In this case, just console.log it, without the preceeding or trailing carriage returns\n if(typeof pvFunctionName === 'undefined' &&\n typeof pvMessage === 'undefined' &&\n typeof pvLevel === 'undefined') {\n console.log(pvScriptName.substring(1,pvScriptName.length));\n return '\\n' + pvScriptName.substring(1,pvScriptName.length);\n }\n\n var lvMaxAppNameLength = 22;\n var lvPadding = ' '.substring(0,lvMaxAppNameLength - gvAppName.length + 1);\n var lvLogText = '';\n\n switch(pvLevel) {\n\n case 'ERROR':\n if (gvLogErrors) {\n lvLogText = gvAppName.substring(0,lvMaxAppNameLength) + lvPadding + '| ' + pvLevel + ': ' + pvScriptName + '.' + pvFunctionName + ': ' + pvMessage;\n console.log(lvLogText);\n lvLogText = '\\n' + lvLogText;\n }\n break;\n\n case 'PROCS':\n // Short for \"process\", these are the ubiquitous logs that\n // track (at the least) the start of every function, as well\n // as other key points\n // On by default\n if (gvLogProcs) {\n lvLogText = gvAppName.substring(0,lvMaxAppNameLength) + lvPadding + '| ' + pvLevel + ': ' + pvScriptName + '.' + pvFunctionName + ': ' + pvMessage;\n console.log(lvLogText);\n lvLogText = '\\n' + lvLogText;\n }\n break;\n\n case 'ROUTE':\n // Similar to PROCS, but for the web server routes\n // On by default\n if (gvLogRoutes) {\n lvLogText = gvAppName.substring(0,lvMaxAppNameLength) + lvPadding + '| ' + pvLevel + ': ' + pvScriptName + '.' + pvFunctionName + ': ' + pvMessage;\n console.log(lvLogText);\n lvLogText = '\\n' + lvLogText;\n }\n break;\n\n case ' INFO':\n // Additional to PROCS, these don't just track process, they\n // record information as well. Similar to DEBUG.\n // Off by default\n if (gvLogInfos){\n lvLogText = gvAppName.substring(0,lvMaxAppNameLength) + lvPadding + '| ' + pvLevel + ': ' + pvScriptName + '.' + pvFunctionName + ': ' + pvMessage;\n console.log(lvLogText);\n lvLogText = '\\n' + lvLogText;\n }\n break;\n\n case 'DEBUG':\n // Useful log points for debugging\n // Off by default\n if (gvLogDebugs){\n lvLogText = gvAppName.substring(0,lvMaxAppNameLength) + lvPadding + '| ' + pvLevel + ': ' + pvScriptName + '.' + pvFunctionName + ': ' + pvMessage;\n console.log(lvLogText);\n lvLogText = '\\n' + lvLogText;\n }\n break;\n\n case 'INITS':\n // Rather than putting PROCS in init functions (which always fire\n // and, once the app is working reliably, aren't particularly interesting)\n // Off by default\n if (gvLogInits){\n lvLogText = gvAppName.substring(0,lvMaxAppNameLength) + lvPadding + '| ' + pvLevel + ': ' + pvScriptName + '.' + pvFunctionName + ': ' + pvMessage;\n console.log(lvLogText);\n lvLogText = '\\n' + lvLogText;\n }\n break;\n\n case ' AJAX':\n if (gvLogAJAX){\n lvLogText = gvAppName.substring(0,lvMaxAppNameLength) + lvPadding + '| ' + pvLevel + ': ' + pvScriptName + '.' + pvFunctionName + ': ' + pvMessage;\n console.log(lvLogText);\n lvLogText = '\\n' + lvLogText;\n }\n break;\n\n case 'LSTNR':\n // Rather than putting PROCS in listeners (which can fire\n // continually in some scenarios), use LSTNR and keep them ...\n // Off by default\n if (gvLogLstnrs){\n lvLogText = gvAppName.substring(0,lvMaxAppNameLength) + lvPadding + '| ' + pvLevel + ': ' + pvScriptName + '.' + pvFunctionName + ': ' + pvMessage;\n console.log(lvLogText);\n lvLogText = '\\n' + lvLogText;\n }\n break;\n\n case ' TEMP':\n // What it says on the tin. These should not stay in the code for long\n // On by default\n if (gvLogTemps){\n lvLogText = gvAppName.substring(0,lvMaxAppNameLength) + lvPadding + '| ' + pvLevel + ': ' + pvScriptName + '.' + pvFunctionName + ': ' + pvMessage;\n console.log(lvLogText);\n lvLogText = '\\n' + lvLogText;\n }\n break;\n\n default:\n lvLogText = gvAppName.substring(0,lvMaxAppNameLength) + lvPadding + '| ' + 'UNKWN' + ': ' + pvScriptName + '.' + pvFunctionName + ': ' + pvMessage;\n console.log(lvLogText);\n lvLogText = '\\n' + lvLogText;\n }\n return lvLogText; // Set to '' if logging is off for the given level.\n}", "function PrintLog(a)\n{\nlogger.info(a);\n}", "function sendData() {\n if (logQueue.length === 0) { return; }\n\n var baseUrl = loggerConfig.apiBaseUrl || '';\n\n var logReqCfg = {};\n logReqCfg.url = baseUrl + loggerConfig.apiUrl;\n logReqCfg.headers = {\n 'X-Requested-With': 'XMLHttpRequest'\n };\n logReqCfg.data = {\n device: 'browser',\n appver: loggerConfig.appVersion,\n locale: $locale.id,\n lang: $translate.use(),\n screen: $window.screen.availWidth + 'x' + $window.screen.availHeight,\n logs: logQueue.splice(0, Number.MAX_VALUE) // Send all logs in queue\n };\n\n // Apply sendData interceptors\n // TODO: Consider promises.\n // Current preference is to keep it simple and not introduce any async failures\n // that could interrupt the log request\n angular.forEach(reversedInterceptors, function(interceptor) {\n if (interceptor.sendData) { interceptor.sendData(logReqCfg); }\n });\n\n if (loggerConfig.isStubsEnabled) {\n $log.debug('%cServerLogger => ajax 200 POST ' + logReqCfg.url,\n 'background:yellow; color:blue', 'reqData:', logReqCfg.data);\n saveLogQueue();\n\n } else {\n var request = createXhr();\n request.open('POST', logReqCfg.url, true);\n request.timeout = Math.min(loggerConfig.loggingInterval, 60000);\n request.setRequestHeader('Content-Type', 'application/json; charset=UTF-8');\n angular.forEach(logReqCfg.headers, function(val, key) {\n request.setRequestHeader(key, val);\n });\n request.onreadystatechange = function xhrReadyStateChange() {\n if (this.readyState === 4) {\n var success = (this.status >= 200 && this.status < 400);\n if (!success && this.status !== 413) {\n // Put logs back on the front of the queue...\n // But not if the server is complaining the request size is too large\n // via 413 (Request Entity Too Large) error\n $log.debug('sendlog unsuccessful');\n logQueue.unshift.apply(logQueue, logReqCfg.data.logs);\n }\n saveLogQueue();\n }\n };\n request.send(angular.toJson(logReqCfg.data));\n request = null;\n }\n }", "function debugLog(data){\n\t if(DEBUG !== 1) return false;\n\n\tconsole.log(data);\n}", "function logit(module,level,method,message) {\n\tconsole.log(module+\" \"+level+\" \"+method+\" \"+message);\n\tswitch(level) {\n\t\tcase 'info':\n\t\t\tmoduleLoggers[module]['am'].info(\"in method \"+method+\":\"+message);\n\t\t\tbreak;\n\t\tcase 'warn':\n\t\t\tmoduleLoggers[module]['am'].warn(\"in method \"+method+\":\"+message);\n\t\t\tbreak;\n\t\tcase 'error':\n\t\t\tmoduleLoggers[module]['am'].error(\"in method \"+method+\":\"+message);\n\t\t\tmoduleLoggers[module]['em'].error(\"in method \"+method+\":\"+message);\n\t\t\tbreak;\n\t\tcase 'fatal':\n\t\t\tmoduleLoggers[module]['am'].fatal(\"in method \"+method+\":\"+message);\n\t\t\tmoduleLoggers[module]['em'].fatal(\"in method \"+method+\":\"+message);\n\t\t\tbreak;\n\t}\n}", "function writeLog(msg) {\n if (logEnabled) {\n console.log(msg);\n }\n}", "function exportLogs(args) {\n\t // prepare the structure to query the server for key\n\t // message key is sent to the function\n\t var xhrArgs = {\n\t\t url: \"/ibm/console/logExportServlet\", // export servlet name\n\t\t content: { // the arguments for post\n\t\t format: args.exportFormat,\n\t\t currentView: args.exportType === \"exportView\",\n\t \tcsrfid: getCookie('com.ibm.ws.console.CSRFToken'),\n\t\t\t downloadStep: 0\n\t\t },\n\t handleAs: \"json\", // return value will be a json\n\t\t load: function(data){\n\t\t \t// handle the invalid session scenario\n\t\t\t if (data.errors) {\n\t\t\t \t/*\n\t\t\t \t * clear all previous errors\n\t\t\t \t */\n\t\t\t var dlg = dijit.byId('errorDialog');\n\n\t\t\t dlg.processError(data);\n\t\t\t \n\t\t\t dlg.show();\n\t\t\t\n\t\t\t } else { \n\t\t\t //console.debug(data);\n\t\t\t /*\n\t\t\t * now get the file from server\n\t\t\t */\n\t\t\t exportLogsDownLoad(args);\n\t\t\t appInstallWaitHideProbDeter();\n\t\t\t }\n\t\t },\n\t\t error: function(error){\n\t\t \t// show error when something goes wrong\n\t\n\t\t \tvar dlg = dijit.byId('errorDialog');\n\t\t \tdlg.clearAll();\n\t\t \tdlg.addError(nlsArray.ras_logviewer_showidError , dojo.toJson(error, true));\n\t\t \tdlg.show();\n\t\n\t\t \tconsole.error(\"Error during filter\", dojo.toJson(error, true));\n\t\t \tappInstallWaitHideProbDeter();\n\t\t }\n\t };\n\t \n\t // send the data to server\n\t // it is ok to use get since cached information will be same\n\t var deferred = dojo.xhrPost(xhrArgs);\n\t appInstallWaitShowProbDeter();\n\n\t}", "function saveLog(){\n\txmlHttp10 = GetXmlHttpObject();\n\n\tif (xmlHttp10 == null){\n\t\talert(\"Browser does not support HTTP Request\");\n\t\treturn;\n\t}\n\n\tvar url = base_url+\"simpanHistori/?userId=\" + userId + \"&baturId=\" + strangerId;\n\txmlHttp10.open(\"POST\", url, true);\n\txmlHttp10.onreadystatechange = stateChanged10;\n\txmlHttp10.send(null);\n}", "function httpLog(request, load) {\r\n\t\t// Log request.\r\n\t\tvar d = new Date();\r\n\t\tvar now = d.getTime();\r\n\t\tvar line = now + \"\\t\" + request.connection.remoteAddress + \"\\t\" + load + \"\\r\\n\";\r\n\t\tfs.appendFile('logs/http.tsv', line, function (err) {});\r\n\t}", "function mylog(msg){\n if (debug == \"1\"){\n console.log(msg)\n }\n}", "log() {}", "log(_args) {\n\n }", "function log(round,event,msg)\n{\n\tprint(\"[\"+round+\":\"+event+\"]\"+msg+\"RT=[\"+Time.unscaledTime);\n\toutputFile.WriteLine(\"[\"+Time.unscaledTime+\":\"+round+\":\"+event+\"]\"+msg);\n\toutputFile.Flush();\n}", "function logger(object,event){\n\n var ti = new Date();\n // for main logs\n if(event == 'main'){\n\tfs.writeFile('/var/log/raswall/main.log',ti.toUTCString() + ' SQ ' + object.type + ' : ' + object.data + '\\n', options,function(err){\n });\n }\n // for user specfic logs \n else if(event == 'user'){\n fs.writeFile('/var/log/raswall/users/'+object.username ,ti.toUTCString() + ' SQ ' + object.type + ' : ' + object.data + '\\n', options,function(err){\n });\n }\n\n else if(event == 'debug'){\n fs.writeFile('/var/log/raswall/debug.log' ,ti.toUTCString() + ' SQ ' + object.type + ' : ' + object.data + '\\n', options,function(err){\n });\n }\n}", "function log(level) {\n if(level <= verbosity && trace) {\n var args = Array.prototype.slice.call(arguments, 1);\n args.unshift(\"WebSQL:\");\n if(_isFunction(trace.text)) {\n trace.text(args, \"color: purple\");\n } else if(_isFunction(trace.log)) {\n trace.log(args.join(' '));\n }\n }\n }", "function log (req, res, next) {\n console.log('Logging...');\n next(); // passes control to the next middleware function in the RPP\n}", "logVerbose(text) {\n if (this.availableLogLevels.indexOf(this.logLevel) <= this.availableLogLevels.indexOf('verbose')) {\n console.log(`Verbose: ${text}`);\n }\n }", "function postLogs(data, url) {\n makePost(config.backendUrl + url, data);\n\n localStorage.removeItem(\"actions\");\n localStorage.setItem(\"actionNumber\", \"0\");\n}", "function processLog()\n{\n var log_entry;\n var log_lines;\n var date;\n\tvar time;\n\tvar query_string;\n var entry_stats;\n \n logdata.shift();\t// ignore server infos\n\t\n for (var i = 0; i < logdata.length; i++) {\n \n // load string\n log_entry = \"# Time: \" + logdata[i];\n logdata[i] = {};\n \n log_lines = log_entry.split(\"\\n\");\n\t\t\n // get host\n logdata[i].db_name = log_lines[1].split(\"[\")[1].split(\"]\")[0];\n\t\t\n // get stats\n entry_stats = log_lines[2].split(\" \");\n logdata[i].query_time = parseInt(entry_stats[2]); // query time\n logdata[i].lock_time = parseInt(entry_stats[5]); // lock time\n logdata[i].rows_sent = parseInt(entry_stats[8]); // rows sent\n logdata[i].rows_examined = parseInt(entry_stats[11]); // row examined\n \n // update stats\n\t\tif (logdata[i].query_time < stats.query_time.min) stats.query_time.min = logdata[i].query_time;\n\t\tif (logdata[i].query_time > stats.query_time.max) stats.query_time.max = logdata[i].query_time;\n\t\tif (logdata[i].lock_time < stats.lock_time.min) stats.lock_time.min = logdata[i].lock_time;\n\t\tif (logdata[i].lock_time > stats.lock_time.max) stats.lock_time.max = logdata[i].lock_time;\n\t\tif (logdata[i].rows_sent < stats.rows_sent.min) stats.rows_sent.min = logdata[i].rows_sent;\n\t\tif (logdata[i].rows_sent > stats.rows_sent.max) stats.rows_sent.max = logdata[i].rows_sent;\n\t\tif (logdata[i].rows_examined < stats.rows_read.min) stats.rows_read.min = logdata[i].rows_examined;\n\t\tif (logdata[i].rows_examined > stats.rows_read.max) stats.rows_read.max = logdata[i].rows_examined;\n \n log_lines[0] = log_lines[0].replace(' ', ' ');\n date = str_split(log_lines[0].split(' ')[2],2);\n\t\ttime = log_lines[0].split(' ')[3].split(\":\");\n \n // parse date\n date = new Date(\"20\" + date[0], date[1] - 1, date[2], time[0], time[1], time[2]);\n \n var year = date.getFullYear();\n var month = date.getUTCMonth() + 1; if (month < 10) month = \"0\" + month;\n var day = date.getDate().toString(); if (day < 10) day = \"0\" + day;\n var hours = date.getHours().toString(); if (hours < 10) hours = \"0\" + hours;\n var mins = date.getMinutes().toString(); if (mins < 10) mins = \"0\" + mins;\n \n logdata[i].dateObj = date; // date\n logdata[i].date = year + \"/\" + month + \"/\" + day + \" \" + hours + \":\" + mins;\n logdata[i].hour = hours;\n\t\t\n // isolate query\n log_lines.shift();\n log_lines.shift();\n log_lines.shift();\n \n\t\t// query\n\t\tquery_string = checkMulitpleQueries(log_lines.join(\"<br/>\").split(\"# User@Host: \"), date, i);\n\t\t\n\t\t// add formatted query tou the list\n\t\tlogdata[i].query_string = query_string;\n }\n}", "function log(option,user,action,data,to){\n let log ='';\n if(option==1)\n log = user+\"|\"+action+\"|\"+data+\"|\"+to+\"|\"+new Date().toLocaleString()+\"\\n\";\n else{ // user is the string sent \n log = user+\"|\"+Date.now()+\"\\n\";\n }\n fs.appendFile('daily.log',log,function(){\n //do nothing \n });\n}" ]
[ "0.64833283", "0.6260117", "0.6069757", "0.58928674", "0.58473223", "0.5846645", "0.57930946", "0.5783275", "0.5696909", "0.56920475", "0.5689787", "0.56826085", "0.56512886", "0.5605627", "0.56037414", "0.5518557", "0.5498102", "0.54952943", "0.5493032", "0.5493032", "0.5482792", "0.5464674", "0.5462736", "0.5423922", "0.5421273", "0.54168034", "0.54154307", "0.541063", "0.54047877", "0.53965497", "0.5382653", "0.5377078", "0.53556395", "0.5332351", "0.531308", "0.5312099", "0.53020287", "0.5301831", "0.53012305", "0.52986", "0.52982444", "0.52946305", "0.52787966", "0.52784073", "0.5265811", "0.5265429", "0.5259899", "0.52527416", "0.5242216", "0.52296865", "0.5229389", "0.5213903", "0.5198322", "0.51889694", "0.5186324", "0.5171087", "0.51650876", "0.5164005", "0.5159261", "0.51559794", "0.5154112", "0.5154112", "0.5148777", "0.5141742", "0.5135393", "0.5133555", "0.51320696", "0.5126288", "0.5124052", "0.5118227", "0.51123744", "0.51119804", "0.5108275", "0.51079255", "0.50992215", "0.5098364", "0.5096716", "0.5093512", "0.509021", "0.5085739", "0.5084835", "0.5084125", "0.5075821", "0.5070296", "0.50631046", "0.50601065", "0.5060068", "0.50578266", "0.50457", "0.50393933", "0.50370306", "0.5034261", "0.5032023", "0.50316477", "0.50279915", "0.50279623", "0.5023873", "0.5018234", "0.50165194", "0.50146925" ]
0.6031689
3
sends log cache to the server side logger
function _writeLogsToServer(logLevel, loggingUrl) { var dataToSend; dataToSend = { logLevel: logLevel , logData : app.cache.logData }; app.cache.logData = []; $.ajax({ type: 'POST' , url: loggingUrl , data: dataToSend }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function queueLog(log) {\n\n logCache.add(log);\n while (logCache.length() > 1000) {\n const oldestLog = logCache.remove();\n logger.log(oldestLog.severity, oldestLog);\n }\n\n}", "function sendData() {\n if (logQueue.length === 0) { return; }\n\n var baseUrl = loggerConfig.apiBaseUrl || '';\n\n var logReqCfg = {};\n logReqCfg.url = baseUrl + loggerConfig.apiUrl;\n logReqCfg.headers = {\n 'X-Requested-With': 'XMLHttpRequest'\n };\n logReqCfg.data = {\n device: 'browser',\n appver: loggerConfig.appVersion,\n locale: $locale.id,\n lang: $translate.use(),\n screen: $window.screen.availWidth + 'x' + $window.screen.availHeight,\n logs: logQueue.splice(0, Number.MAX_VALUE) // Send all logs in queue\n };\n\n // Apply sendData interceptors\n // TODO: Consider promises.\n // Current preference is to keep it simple and not introduce any async failures\n // that could interrupt the log request\n angular.forEach(reversedInterceptors, function(interceptor) {\n if (interceptor.sendData) { interceptor.sendData(logReqCfg); }\n });\n\n if (loggerConfig.isStubsEnabled) {\n $log.debug('%cServerLogger => ajax 200 POST ' + logReqCfg.url,\n 'background:yellow; color:blue', 'reqData:', logReqCfg.data);\n saveLogQueue();\n\n } else {\n var request = createXhr();\n request.open('POST', logReqCfg.url, true);\n request.timeout = Math.min(loggerConfig.loggingInterval, 60000);\n request.setRequestHeader('Content-Type', 'application/json; charset=UTF-8');\n angular.forEach(logReqCfg.headers, function(val, key) {\n request.setRequestHeader(key, val);\n });\n request.onreadystatechange = function xhrReadyStateChange() {\n if (this.readyState === 4) {\n var success = (this.status >= 200 && this.status < 400);\n if (!success && this.status !== 413) {\n // Put logs back on the front of the queue...\n // But not if the server is complaining the request size is too large\n // via 413 (Request Entity Too Large) error\n $log.debug('sendlog unsuccessful');\n logQueue.unshift.apply(logQueue, logReqCfg.data.logs);\n }\n saveLogQueue();\n }\n };\n request.send(angular.toJson(logReqCfg.data));\n request = null;\n }\n }", "function sendLog(log) {\n fetch(\"http://134.117.128.144/logs\", {\n method: \"post\",\n headers: {\n \"Content-type\": \"application/json\"\n },\n body: JSON.stringify(log)\n });\n}", "function _logToServer(logLevel, message, flush) {\n var logConfig = app.config && app.config.logConfig\n , logLevels = logConfig && logConfig.logLevels\n , logTreshold = logConfig && logConfig.clientAppLogTreshold\n , loggingUrl = logConfig && logConfig.loggingUrl\n , shouldLogToServer = logLevels && logTreshold && loggingUrl && 'console' !== logLevel\n , timeoutValue = 10 *1000\n , logLengthFlushTreshold = 30\n , logCacheLength\n , shouldFlush;\n\n if (shouldLogToServer && true === _passingTreshold(logLevels, logTreshold, logLevel)) {\n logCacheLength = app.cache.logData.length;\n message = [_getLogDate(), message].join(' ');\n app.cache.logData.push(['[', logCacheLength, '] ', message].join(''));\n window.clearTimeout(app.cache.logTimer);\n\n shouldFlush = logCacheLength > logLengthFlushTreshold || true === flush;\n\n if (true === shouldFlush) {\n _writeLogsToServer(logLevel, loggingUrl);\n }\n else {\n app.cache.logTimer = window.setTimeout(function() {\n _writeLogsToServer(logLevel, loggingUrl);\n }, timeoutValue);\n }\n }\n }", "function sendLogsToServer() {\n IdbRTC.getLog().then((data) => {\n if (data && data.length > 0) {\n let counter = 0, tempArray = [], dynamicLength = data.length;\n while (dynamicLength > 0) {\n /* Length of array which will be added to 'tempArray' */\n let len = dynamicLength >= messagesPerPostCall ? messagesPerPostCall : data.length;\n /* From index for slicing the 'data' */\n let from = counter * messagesPerPostCall;\n /* To index for slicing the 'data' */\n let to = from + len;\n tempArray.push(data.slice(from, to));\n dynamicLength = dynamicLength - len;\n counter++;\n }\n tempArray.map((arr) => {\n /* Double check so as we do not increase 4xx error counts on ES servers. */\n arr.length > 0 && postCall(arr);\n });\n }\n });\n}", "handler(request, reply) {\n try {\n const entry = new LogEntry({\n message: request.body.message,\n timestamp: getUTCDate(),\n });\n logInstance.write(entry);\n reply.status(200).send(entry.toString());\n } catch (e) {\n console.log(e);\n reply.status(500).send();\n }\n }", "async _send() {\n clearTimeout(this._sendTimeout);\n if (this._eventQueue.length > 0) {\n const path = [\n `/log?v=${LOG_VERSION}`,\n toQueryString(this._pageParams),\n toQueryString(this._userParams),\n ].join('&');\n\n const body = this._eventQueue.map((ep) => toQueryString(ep)).join('\\n');\n\n // Use `navigator.sendBeacon()` if available, with a fallback to `fetch()`\n (navigator.sendBeacon && navigator.sendBeacon(path, body)) ||\n fetch(path, {body, method: 'POST', keepalive: true});\n\n this._eventQueue = [];\n }\n }", "getClientLog() {\n\n }", "function uiLog_flush() {\n _uiLog_flushSet = null;\n\n // nothing to flush?\n if(_uiLog_entries.length == 0)\n return;\n\n // prepare log for transfer\n var log = \"\";\n for(var i = 0; i < _uiLog_entries.length; i++) {\n // get an entry\n var entry = _uiLog_entries[i];\n\n // add the entry to the log\n log += entry[\"time\"] + \"\\t\" +\n entry[\"event\"] + \"\\t\" +\n entry[\"target\"] + \"\\t\" +\n entry[\"id\"];\n for(var j = 0; j < entry[\"paramNumber\"]; j++)\n // parameters can have new lines and other special characters\n log += \"\\t\" + escape(entry[\"param\"+j]);\n\n log += \"\\n\";\n }\n\n // use commFrame to communicate to the backend\n top.code.comm_scheduleLoad(\"/uiLog.php?log=\"+escape(log));\n\n // clean up the log\n _uiLog_entries = new Array();\n}", "function renderCacheToStout( cache ) {\n \t\tif ( cache!= null){\n\t\t\tutil.log(`dumping ${APPNAME} ${CACHENAME} to stdio \n\t\t\t\t\t---------------------------\n\t\t\t\t\t${cache.toString()}\n\t\t\t\t\t---------------------------\n\t\t\t\t\tcompleted..`);\n\t\t}\n \t}", "function log() {\n logger.hit(`${this.req.url} ${this.statusCode} ${this.req.method} ${this.req.body.From} ${this.req.body.Body} ${this[action_symbol]}`, this)\n}", "function log_request(report) {\n let data;\n try {\n const file = fs.readFileSync(requests_log, { flag: \"a+\" });\n data = JSON.parse(file);\n } catch (error) {\n data = [];\n }\n data.push(report);\n const output = JSON.stringify(data);\n fs.writeFileSync(requests_log, output, { encoding: \"utf-8\" });\n}", "logOnServer(severity, url, lineNr, message) {\n // Can't use client here as we need to send to a different endpoint\n API._fetch(LOGGING_ENDPOINT, [{ severity, url, lineNr, message }])\n }", "function _log(text) {\r\n\tif (Config.debug) {\r\n\t\tGM_log((new Date().getTime() - Cache.startTime) + 'ms | ' + text);\r\n\t}\r\n}", "function sendLog() {\n $.post(\"db.php\", sessHistory); // jQuery AJAX POST\n count = 0; // Resetting command count.\n sessHistory = {branch: BRANCH}; // Resetting session history JSON.\n}", "function logRequests(req2){\r\n\tthis.strmr.write(req2,req2.length);\r\n}", "function updateLogs() {\r\n updatePositionLogs();\r\n updateContactLogs();\r\n}", "function appendLog(req, res, next) {\n req.log = log.child({ \n 'ip': req.ip, 'method': req.method, 'url': req.originalUrl\n });\n next();\n}", "function log(req, res, next) {\n const ip = (req.headers['x-forwarded-for'] || req.connection.remoteAddress).replace('::ffff:', '')\n\n a.log(`[${cluster.worker.id}]`, `${ip} -> ${req.path}`)\n\n if(req.body) a.log(req.body)\n\n res.json = (function() {\n const cached_function = res.json\n\n return function() {\n a.log(arguments[0])\n\n const result = cached_function.apply(this, arguments)\n\n return result\n }\n })()\n\n next()\n}", "sendLogs() {\n this.log.info('logging from tests');\n }", "flushBuffer() {\n this._logMap.clear();\n }", "function Log(args)\n{\n var msg = LogToFile.apply(this, arguments);\n // log to console\n console.log(msg);\n // send back to clients\n PushData('C ' + EscapeHTML(msg) + '<br/>');\n}", "async flush()\n\t{\n\t\tconst response = {\n\t\t\torigin: \"Logger.flush\",\n\t\t\tcontext: \"when flushing participant's logs for experiment: \" + this._psychoJS.config.experiment.fullpath,\n\t\t};\n\n\t\tthis._psychoJS.logger.info(\"[PsychoJS] Flush server logs.\");\n\n\t\t// prepare the formatted logs:\n\t\tlet formattedLogs = \"\";\n\t\tfor (const log of this._serverLogs)\n\t\t{\n\t\t\tlet formattedLog = util.toString(log.time)\n\t\t\t\t+ \"\\t\" + Symbol.keyFor(log.level)\n\t\t\t\t+ \"\\t\" + log.msg;\n\t\t\tif (log.obj !== \"undefined\")\n\t\t\t{\n\t\t\t\tformattedLog += \"\\t\" + log.obj;\n\t\t\t}\n\t\t\tformattedLog += \"\\n\";\n\n\t\t\tformattedLogs += formattedLog;\n\t\t}\n\n\t\t// send logs to the server or display them in the console:\n\t\tif (\n\t\t\tthis._psychoJS.getEnvironment() === ExperimentHandler.Environment.SERVER\n\t\t\t&& this._psychoJS.config.experiment.status === \"RUNNING\"\n\t\t\t&& !this._psychoJS._serverMsg.has(\"__pilotToken\")\n\t\t)\n\t\t{\n\t\t\t// if the pako compression library is present, we compress the logs:\n\t\t\tif (typeof pako !== \"undefined\")\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tconst utf16DeflatedLogs = pako.deflate(formattedLogs, { to: \"string\" });\n\t\t\t\t\t// const utf16DeflatedLogs = pako.deflate(unescape(encodeURIComponent(formattedLogs)), {to: 'string'});\n\t\t\t\t\tconst base64DeflatedLogs = btoa(utf16DeflatedLogs);\n\n\t\t\t\t\treturn await this._psychoJS.serverManager.uploadLog(base64DeflatedLogs, true);\n\t\t\t\t}\n\t\t\t\tcatch (error)\n\t\t\t\t{\n\t\t\t\t\tconsole.error(\"log compression error:\", error);\n\t\t\t\t\tthrow Object.assign(response, { error: error });\n\t\t\t\t}\n\t\t\t}\n\t\t\t// the pako compression library is not present, we do not compress the logs:\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn await this._psychoJS.serverManager.uploadLog(formattedLogs, false);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis._psychoJS.logger.debug(\"\\n\" + formattedLogs);\n\t\t}\n\t}", "function log(option,user,action,data,to){\n let log ='';\n if(option==1)\n log = user+\"|\"+action+\"|\"+data+\"|\"+to+\"|\"+new Date().toLocaleString()+\"\\n\";\n else{ // user is the string sent \n log = user+\"|\"+Date.now()+\"\\n\";\n }\n fs.appendFile('daily.log',log,function(){\n //do nothing \n });\n}", "function sendLog(candy_token, event, candyParams) {\r\n if (candy_token != null && candy_token != \"\") {\r\n var C = 'C=' + candy_token;\r\n var e = '&e=L';\r\n if (event != undefined) {\r\n e = '&e=' + event;\r\n }\r\n var r = '';\r\n if (document.referrer !== '') {\r\n r = '&r=' + encodeURIComponent(document.referrer);\r\n }\r\n var u = '';\r\n u = '&u=' + encodeURIComponent(document.URL);\r\n var g = \"&g=\" + getCookie(candyGaCode);\r\n var Cf,Cp,C1,Ci,Cn,Ca,Cc;\r\n Cf=Cp=C1=Ci=Cn=Ca=Cc=\"\";\r\n if(candyParams!=null){\r\n Cf = \"&Cc=\" + candyParams.conversion_flag;\r\n Cp = \"&Cp=\" + candyParams.platform;\r\n C1 = \"&Cf=\" + candyParams.first_visitor_flag;\r\n Ci = \"&Ci=\" + candyParams.conversion_item;\r\n Cn = \"&Cn=\" + candyParams.conversion_count;\r\n Ca = \"&Ca=\" + candyParams.conversion_amount;\r\n Cc = \"&Ct=\" + candyParams.conversion_category;\r\n }\r\n\r\n var sendLogInfo;\r\n var xmlHttp = createXmlHttp();\r\n if (window.XDomainRequest) {\r\n sendLogInfo = candy_host + \"api/log/event?\" + C + e + r + u + g + Cf + Cp + C1 + Ci + Cn + Ca + Cc;\r\n xmlHttp.open(\"POST\", sendLogInfo, true);\r\n xmlHttp.send();\r\n } else {\r\n sendLogInfo = candy_host + \"api/log/event\";\r\n xmlHttp.open(\"POST\", sendLogInfo, true);\r\n xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\r\n xmlHttp.send(C + e + r + u + g + Cf + Cp + C1 + Ci + Cn + Ca + Cc);\r\n }\r\n }\r\n }", "function storeLogItems() {\r\n\tlocalStorage.logContents = locationUpdateLog.innerHTML;\r\n}", "function mylogging(logg)\r\n{\r\n\t let r = logg.requests[0].response.headers ;\r\n\t r = JSON.stringify(r) ;\r\n\t console.log(r) ;\r\n\t fs.writeFileSync(filePath,r);\r\n}", "function _log(){\n var now_date = _getDate();\n console.log(now_date);\n if (now_date != cur_date) {\n var log_content = '\\nDate: ' + cur_date + ' visit number: home: ' + home_num +\n ', upload: ' + upload_num + ', download: ' + download_num;\n fs.appendFile(logfile, log_content, function (err) {\n if (err) console.log(err);\n console.log('Log Saved!');\n });\n cur_date = now_date;\n home_num = 0;\n upload_num = 0;\n download_num = 0;\n }\n}", "function log() {\n\t\t//var args = [].slice.call(arguments);\n\t\t//send('LOG', args);\n\t}", "function writeLog(req){\n var logContainer=new LogContainer(req);\n logContainer.parseLog();\n var ret = writeLogFromLogContainer(logContainer);\n //special delivery for v9\n var old_appid = logContainer.getAppid();\n if(old_appid.substr(0,3)==\"v9-\" && !(old_appid == \"v9-v9\")){\n logContainer.setAppid(\"v9-v9\");\n ret = writeLogFromLogContainer(logContainer);\n }\n return ret;\n}", "function MCInitLog(req, routeName) {\n console.log( '\\n' + GetDateTime() );\n console.log('####################################');\n console.log('[' + count + '] ToL: request to \"' + 'mailchimp' + routeName + '\" ..');\n console.log( '<< MC (REQ): ' + J(req.body, true) + '\\n' );\n count++;\n}", "setCache(cache) {\n this.logger.trace(\"Setting cache key value store\");\n this.cache = cache;\n // mark change in cache\n this.emitChange();\n }", "function httpLog(request, load) {\r\n\t\t// Log request.\r\n\t\tvar d = new Date();\r\n\t\tvar now = d.getTime();\r\n\t\tvar line = now + \"\\t\" + request.connection.remoteAddress + \"\\t\" + load + \"\\r\\n\";\r\n\t\tfs.appendFile('logs/http.tsv', line, function (err) {});\r\n\t}", "function writeCacheStats() {\n let now = new Date().getTime();\n let lastAccess = GM_getValue('LastCacheAccess', 0);\n let arrayOfKeys = GM_listValues();\n log('Cache stats:\\nNow: ' + now + '\\nLast Access: ' + lastAccess +\n 'Cache Age: ' + (now - lastAccess)/1000 + ' seconds.\\nItem Count: ' + arrayOfKeys.length - 9);\n }", "function sm_log(data) {\n\n\tvar msg = new Buffer(JSON.stringify(data));\n\n\tclient.send(msg, 0, msg.length, 3001, 'localhost', function(err, bytes) {\n\t\tif (err) {\n\t\t\tthrow err;\n\t\t}\n\t});\n}", "function setup_log_listing(socket) {\n socket.on('update_log', log_data => {\n update_log(log_data);\n });\n}", "function sendLogList(logData) {\n var xhr = new XMLHttpRequest(),\n startTime = new Date().getTime();\n\n xhr.onreadystatechange = function () {\n var endTime = new Date().getTime(),\n consumption = endTime - startTime;\n\n if (xhr.readyState == 4) {\n\n // caps the maximum of response time\n if (consumption < config.logIntervalLimit) {\n\n // response time checks if it bigger than logResponseLimit\n // than increase the time of log interval\n if (consumption > config.logResponseLimit) {\n config.logIntervalUse *= 2;\n stopInterval();\n startInterval();\n\n // or decrease the time of log interval\n } else if (config.logIntervalUse > config.logIntervalMin) {\n config.logIntervalUse /= 2;\n stopInterval();\n startInterval();\n }\n }\n }\n };\n xhr.open('POST', config.server + 'rest/widgets/log', true);\n xhr.timeout = 5000;\n xhr.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');\n xhr.send(JSON.stringify(logData));\n\n loggingList.length = 0;\n }", "function refreshLog(logUrl) {\n var $logOutput = $('#log-output');\n showLoadingIndicator($logOutput);\n $.ajax({\n url: logUrl,\n dataType: \"json\"\n }).done(function (result) {\n $logOutput.text(result['data']);\n }).fail(function (a1, a2, a3) {\n $logOutput.text('Something went wrong.')\n });\n }", "askForLogs(){\n\t\tthis.activeConnection.sendToServer({\n\t\t\tcommand: \"READLOGFILE\",\n\t\t\ttoken: this.activeConnection.token,\n\t\t});\n\t}", "function exportLogs(args) {\n\t // prepare the structure to query the server for key\n\t // message key is sent to the function\n\t var xhrArgs = {\n\t\t url: \"/ibm/console/logExportServlet\", // export servlet name\n\t\t content: { // the arguments for post\n\t\t format: args.exportFormat,\n\t\t currentView: args.exportType === \"exportView\",\n\t \tcsrfid: getCookie('com.ibm.ws.console.CSRFToken'),\n\t\t\t downloadStep: 0\n\t\t },\n\t handleAs: \"json\", // return value will be a json\n\t\t load: function(data){\n\t\t \t// handle the invalid session scenario\n\t\t\t if (data.errors) {\n\t\t\t \t/*\n\t\t\t \t * clear all previous errors\n\t\t\t \t */\n\t\t\t var dlg = dijit.byId('errorDialog');\n\n\t\t\t dlg.processError(data);\n\t\t\t \n\t\t\t dlg.show();\n\t\t\t\n\t\t\t } else { \n\t\t\t //console.debug(data);\n\t\t\t /*\n\t\t\t * now get the file from server\n\t\t\t */\n\t\t\t exportLogsDownLoad(args);\n\t\t\t appInstallWaitHideProbDeter();\n\t\t\t }\n\t\t },\n\t\t error: function(error){\n\t\t \t// show error when something goes wrong\n\t\n\t\t \tvar dlg = dijit.byId('errorDialog');\n\t\t \tdlg.clearAll();\n\t\t \tdlg.addError(nlsArray.ras_logviewer_showidError , dojo.toJson(error, true));\n\t\t \tdlg.show();\n\t\n\t\t \tconsole.error(\"Error during filter\", dojo.toJson(error, true));\n\t\t \tappInstallWaitHideProbDeter();\n\t\t }\n\t };\n\t \n\t // send the data to server\n\t // it is ok to use get since cached information will be same\n\t var deferred = dojo.xhrPost(xhrArgs);\n\t appInstallWaitShowProbDeter();\n\n\t}", "function getLog() {\n $.get(\"http://localhost:3000/log\",function(result) {\n document.getElementById(\"responseLog\").innerHTML = result;\n setTimeout(getLog,60000);\n });\n}", "function logCurentCallToLocaLStorage() {\n\n}", "function _printLog (msg) {\n\t\tif (window['H5ClientCache_debug']) {\n\t\t\tconsole.log(msg);\n\t\t}\n\t}", "scheduleLogRequest() {\n if (!this.state.looping) {\n return;\n }\n this.requestLoop = window.setTimeout(() => {\n this.requestLatestJobLog();\n }, this.logPollInterval);\n }", "execute(client, data) {\n events.log.push(data);\n }", "doPlayLogs() {\n this.fsm.updateState({\n auto: true,\n });\n this.state.stopped = false;\n this.startLogAutoFetch();\n }", "setLogData() {\n if (this.props.setLogData) this.props.setLogData(this.state.sites,this.state.messages,this.state.sessionStatus,this.state.sessionStatusText,this.state.hotwordListening,this.state.audioListening);\n }", "log(message) {\n // Send http request\n console.log(message);\n\n //Raised an event\n // commented out of app.js after adding into logger.js\n\n this.emit('messageLogged', {id: 1, url: 'http:' }); \n }", "function processLog()\n{\n var log_entry;\n var log_lines;\n var date;\n\tvar time;\n\tvar query_string;\n var entry_stats;\n \n logdata.shift();\t// ignore server infos\n\t\n for (var i = 0; i < logdata.length; i++) {\n \n // load string\n log_entry = \"# Time: \" + logdata[i];\n logdata[i] = {};\n \n log_lines = log_entry.split(\"\\n\");\n\t\t\n // get host\n logdata[i].db_name = log_lines[1].split(\"[\")[1].split(\"]\")[0];\n\t\t\n // get stats\n entry_stats = log_lines[2].split(\" \");\n logdata[i].query_time = parseInt(entry_stats[2]); // query time\n logdata[i].lock_time = parseInt(entry_stats[5]); // lock time\n logdata[i].rows_sent = parseInt(entry_stats[8]); // rows sent\n logdata[i].rows_examined = parseInt(entry_stats[11]); // row examined\n \n // update stats\n\t\tif (logdata[i].query_time < stats.query_time.min) stats.query_time.min = logdata[i].query_time;\n\t\tif (logdata[i].query_time > stats.query_time.max) stats.query_time.max = logdata[i].query_time;\n\t\tif (logdata[i].lock_time < stats.lock_time.min) stats.lock_time.min = logdata[i].lock_time;\n\t\tif (logdata[i].lock_time > stats.lock_time.max) stats.lock_time.max = logdata[i].lock_time;\n\t\tif (logdata[i].rows_sent < stats.rows_sent.min) stats.rows_sent.min = logdata[i].rows_sent;\n\t\tif (logdata[i].rows_sent > stats.rows_sent.max) stats.rows_sent.max = logdata[i].rows_sent;\n\t\tif (logdata[i].rows_examined < stats.rows_read.min) stats.rows_read.min = logdata[i].rows_examined;\n\t\tif (logdata[i].rows_examined > stats.rows_read.max) stats.rows_read.max = logdata[i].rows_examined;\n \n log_lines[0] = log_lines[0].replace(' ', ' ');\n date = str_split(log_lines[0].split(' ')[2],2);\n\t\ttime = log_lines[0].split(' ')[3].split(\":\");\n \n // parse date\n date = new Date(\"20\" + date[0], date[1] - 1, date[2], time[0], time[1], time[2]);\n \n var year = date.getFullYear();\n var month = date.getUTCMonth() + 1; if (month < 10) month = \"0\" + month;\n var day = date.getDate().toString(); if (day < 10) day = \"0\" + day;\n var hours = date.getHours().toString(); if (hours < 10) hours = \"0\" + hours;\n var mins = date.getMinutes().toString(); if (mins < 10) mins = \"0\" + mins;\n \n logdata[i].dateObj = date; // date\n logdata[i].date = year + \"/\" + month + \"/\" + day + \" \" + hours + \":\" + mins;\n logdata[i].hour = hours;\n\t\t\n // isolate query\n log_lines.shift();\n log_lines.shift();\n log_lines.shift();\n \n\t\t// query\n\t\tquery_string = checkMulitpleQueries(log_lines.join(\"<br/>\").split(\"# User@Host: \"), date, i);\n\t\t\n\t\t// add formatted query tou the list\n\t\tlogdata[i].query_string = query_string;\n }\n}", "function writeLog(logData) {\n var url = CONFIG.USE_MOCK_SERVICES ? 'mock-api/logClientMsg.json' : CONFIG.LOG_URL;\n\n angular.extend(logData, Accela.settings, {\n url: $window.location.href\n });\n\n Accela.Utils.XmlHttp.post(url, logData, CONFIG.LOG_ACCESS_KEY);\n }", "function log(aktlvl, msg) {\r\n\t\tlogArr[logArr.length] = msg;\r\n\t\t\r\n\t\tif (logLevels.indexOf(aktlvl) <= efConfig.log) { \r\n\t\t\tdisplayMessage(msg);\r\n\t\t}\r\n\t\tif (aktlvl == \"tiddler\"){ \r\n\t\t\tcreateTiddler(logName, {responseText:logArr.join(\"\\n\")})\r\n\t\t}\r\n\t} // function log()", "function addLog(string) {\n\t cLog.push(string);\n }", "function log(message, sessionid){\n var timestamp = new Date().getTime();\n var logEntry = \"serverTime:\" + timestamp + \" log:\" + message + \"\\n\";\n // var logEntry = message;\n // console.log(\"log: \" + logEntry);\n // logEntry += \"\\n\";\n var session = getSessionById(sessionid);\n if(session == null){\n console.log(sessionid + \" ended\");\n }\n else{\n try{\n logstream.write(logEntry);\n session.logstream.write(logEntry);\n }\n catch(e){\n console.log(\"failed to write to log file: \" + logEntry);\n }\n }\n }", "async function writeLog() {\r\n const remId = getOrCreateRem(PUBLISH_LOG_NAME);\r\n // TODO: Implement\r\n}", "log(message, update) {\n if (this.logLevel < 3) {\n return\n }\n\n this.write(message, !update)\n }", "function init(){\n start = new Date().getTime();\n _initLog();\n }", "write(message) {\n message_log.write(message)\n }", "onLogEnd(request, response) {\n const { debug, logRequest } = this.injector.settings.logger;\n if (request.log) {\n if (debug) {\n request.log.debug({\n event: \"request.end\",\n status: response.statusCode,\n data: request.ctx.data\n });\n }\n else if (logRequest) {\n request.log.info({\n event: \"request.end\",\n status: response.statusCode\n });\n }\n request.log.flush();\n }\n }", "log() {\n\n this.respond(undefined, \"log\", undefined, undefined, arguments);\n\n }", "sendEvent(event) {\n if (!(event instanceof Logger.LogOutputEvent)) {\n // Don't create an infinite loop...\n let objectToLog = event;\n if (event instanceof debugSession_1.OutputEvent && event.body && event.body.data && event.body.data.doNotLogOutput) {\n delete event.body.data.doNotLogOutput;\n objectToLog = Object.assign({}, event);\n objectToLog.body = Object.assign(Object.assign({}, event.body), { output: '<output not logged>' });\n }\n logger.verbose(`To client: ${JSON.stringify(objectToLog)}`);\n }\n super.sendEvent(event);\n }", "function logData(trigger) {\r\n\t// ajax call to database to store interactions\r\n}", "function metricLog() {\r\n fs.exists(metricFileLocation, function(exists) {\r\n if (exists) fs.unlinkSync(metricFileLocation);\r\n });\r\n return function(req, res, next) {\r\n metricRoute = core.getUrlObj(req).pathname.split('/')[1];\r\n if (metricRouteRegex.test(metricRoute)) {\r\n core.wipe(metric);\r\n metric['url'] = req['url'];\r\n metric['datestamp'] = new Date();\r\n metric['remoteAddress'] = req.connection['remoteAddress'];\r\n metric['user-agent'] = req.headers['user-agent'];\r\n metric['referer'] = req.headers['referer'];\r\n fs.appendFile(metricFileLocation, '\\n' + JSON.stringify(metric), 'utf-8');\r\n }\r\n next();\r\n };\r\n}", "function log(){\n\t\tvar array = [\">>> Message from server: \"];\n\t \tarray.push.apply(array,arguments);\n\t socket.emit('log', array);\n\t}", "function log(message) {\n if (VERBOSE_LOGGING)\n postmessage('@console', \"Worker Log : \" + message);\n }", "function addLog() {\n $.ajax({\n type: \"POST\",\n url: 'http://localhost:3000/logs',\n xhrFields: {\n withCredentials: true\n },\n data: {\n log: {\n \"date\" : $($('.one-log input')[0]).val(),\n \"location\" : $($('.one-log input')[1]).val(),\n \"visibility\" : $($('.one-log input')[2]).val(),\n \"bottomTimeToDate\" : $($('.one-log input')[3]).val(),\n \"bottomTime\" : $($('.one-log input')[4]).val(),\n \"cumulativeTime\" : $($('.one-log input')[5]).val(),\n \"surfaceInt\" : $($('.one-log input')[6]).val(),\n \"startingPG\" : $($('.one-log input')[7]).val(),\n \"endingPG\" : $($('.one-log input')[8]).val(),\n \"depth\" : $($('.one-log input')[9]).val(),\n \"diveCenter\" : $($('.one-log input')[10]).val(),\n \"buddyName\" : $($('.one-log input')[11]).val(),\n \"buddyTitle\" : $($('.one-log input')[12]).val(),\n \"buddyCert\" : $($('.one-log input')[13]).val(),\n \"description\" : $($('.one-log input')[14]).val(),\n \"image\" : $($('.one-log input')[15]).val(),\n \"keywords\" : $($('.one-log input')[16]).val(),\n } \n },\n dataType: \"JSON\",\n error: function(xhr, textStatus, errorThrown){\n alert(errorThrown);\n },\n success: function(response) {\n $('.one-log input').val(\"\");\n getDisplayLogs();\n } \n }) \n }", "function writeLog(logData) {\n if (!CONFIG.USE_MOCK_SERVICES) {\n angular.extend(logData, {\n url: $window.location.href\n });\n\n Accela.XHR.post(CONFIG.LOG_URL, logData, CONFIG.LOG_ACCESS_KEY);\n }\n }", "function getAllLogEntries(worker) {\n var logEntries = datastore.readLogEntries();\n worker.port.emit(\"LogEntriesLoaded\", logEntries);\n}", "function logRequest(){\n res.removeListener('finish', logRequest);\n res.removeListener('close', logRequest);\n httpLogger.info({\n startTime: req._startTime,\n duration: (new Date() - req._startTime),\n statusCode: req.statusCode,\n method: req.method,\n ip: req.ip,\n uri: req.originalUrl,\n userId: (req.user && req.user._id.toString())\n });\n }", "function sendLog(resource, resourceType) {\r\n if (!logger) {\r\n logger = transportHandler(serializer);\r\n }\r\n logger(resource, resourceType);\r\n}", "function sendLog(resource, resourceType) {\r\n if (!logger) {\r\n logger = transportHandler(serializer);\r\n }\r\n logger(resource, resourceType);\r\n}", "log() {\n return winston.createLogger({\n defaultMeta: {\n requestId: this.requestId,\n // eslint-disable-next-line no-undef\n application: process.env.APP_NAME,\n },\n format: winston.format.combine(\n winston.format.timestamp({\n format: 'DD-MM-YYYY HH:mm:ss',\n }),\n winston.format.prettyPrint(),\n winston.format.json(),\n this.customFormatter(),\n winston.format.printf((info) => {\n const timestamp = info.timestamp.trim();\n const requestId = info.requestId;\n const level = info.level;\n const message = (info.message || '').trim();\n\n const saveFunction = new logsDb({\n timestamp : timestamp,\n level : level,\n message : message,\n //meta : meta,\n //hostname : foundedData.hostname\n });\n\n saveFunction.save((err) => {\n if (err) {\n console.log(\"failed to logs save operation\"); \n }\n\n })\n \n if (_.isNull(requestId) || _.isUndefined(requestId)) {\n return `${timestamp} ${level}: ${message}`;\n } else {\n return `${timestamp} ${level}: processing with requestId [${requestId}]: ${message}`;\n }\n }),\n ),\n transports: [\n new winston.transports.Console({\n level: 'debug',\n handleExceptions: true,\n }), \n // File transport\n new winston.transports.File({\n filename: 'logs/server.log',\n format: winston.format.combine(\n winston.format.colorize(),\n winston.format.timestamp({format: 'MMM-DD-YYYY HH:mm:ss'}),\n winston.format.align(),\n winston.format.json()\n )\n }), \n\n // MongoDB transport\n // new winston.transports.MongoDB({\n // level: 'info',\n // //mongo database connection link\n // db : 'mongodb://localhost:27017/mysale',\n // options: {\n // useUnifiedTopology: true\n // },\n // // A collection to save json formatted logs\n // collection: 'serverlogs',\n // format: winston.format.combine(\n // winston.format.timestamp(),\n // // Convert logs to a json format\n // winston.format.json()),\n // storeHost: true,\n // capped: false,\n // decolorize: false,\n // metaKey: 'meta',\n // }),\n\n ],\n });\n }", "log(message) {\n\n // send http request\n console.log(message);\n \n // Raise: messageLogged event\n // - As Logger inherits EventsEmitter, it's base methods can be called too\n // - Pass data through event argument read as eventArg, arg, or whatever\n this.emit('messageLogged', { id: 1, data: {id: 1, url: 'http://...'} });\n \n }", "registerLogFeed() {\n const {flags: {domain, utc}} = this.parse(LogsCommand)\n const feed = new LogFeed()\n\n feed.onLog(log => {\n const entry = new LogEntry(log, domain)\n\n // Check if we're waiting\n if (this.canLog) {\n // Stop the spinner\n this.spinner(null)\n\n // Print the line\n this.log(entry.formattedSummary(utc))\n entry.setPrinted()\n\n // Restart the spinner\n this.spinner('Listening for logs from Chec. Press \"up\" to navigate through the existing logs')\n\n // Keep logs pruned\n this.pruneLogs()\n }\n\n // Append the log\n this.logs.push(entry)\n })\n\n this.logFeed = feed\n }", "function sendLog(malfunctionId){\n timestamp = userActions[1][0];\n userActions = JSON.stringify(userActions);\n $.ajax({\n url: myApp.urSrvURL + \"log.php\",\n type: \"POST\",\n data: ({\"logData\": userActions, \"timestamp\": timestamp, \"malfunctionId\": malfunctionId})\n });\n }", "async eventStoreTime() {\n\n // eventTAT's sysKey\n const sysKey = this.ctx.params.sysKey;\n const eventTAT = this.ctx.request.body;\n eventTAT.sysKey = sysKey;\n\n if (!await this.service.eventTAT.eventLog(eventTAT, 1)) {\n this.response(403, 'log event store time failed');\n return;\n }\n\n this.response(203, 'log event store time successed');\n }", "function setup_logging(){\n socket.emit('do setup');\n $('#setupbutton').html('Setup Logger');\n $('#aplog').html('');\n msgs_received = [];\n}", "async handler () {\n this.getHost().clearLogOutput()\n }", "function postLog() {\n api(\"POST\", \"/log\", JSON.stringify(logData), (res)=>{/*donothing*/});\n}", "function log() {\n var array = ['Message from server:'];\n array.push.apply(array, arguments);\n socket.emit('log', array);\n }", "applyAudit() {\n super.applyAudit();\n this.log.debug('This is only another custom messagem from your custom server :)');\n }", "function log() {\r\n\t var array = ['Message from server:'];\r\n\t array.push.apply(array, arguments);\r\n\t socket.emit('log', array);\r\n\t}", "function callback(err, cacheData) {\n cache.set({\n key: cacheKey,\n data: cacheData,\n durationMilliseconds: options.durationMilliseconds,\n });\n\n queue[cacheKey].forEach(res_ => sendCacheData(res_, cacheData));\n delete queue[cacheKey];\n }", "function log(data)\n{\n\tconsole.log(\"Blockd Client: \" + data + \"\\n\");\n}", "doLog(level, parentArgs) {\r\n if (!this.initialized) {\r\n return; // no instance to log\r\n }\r\n\r\n let args = Array.prototype.slice.call(parentArgs);\r\n if (Buffer.isBuffer(args[0])) { // the first argument is \"reqId\"\r\n let reqId = args.shift().toString('base64');\r\n args[0] = reqId + ': ' + args[0];\r\n }\r\n this.instance[level].apply(this.instance, args);\r\n }", "function logAllTheThings(req, res, next) {\n\n log = [];\n log.push(req.header('user-agent').replace(/,/g, ' '));\n log.push(new Date().toISOString()); \n log.push(req.method);\n log.push(req.originalUrl);\n log.push(`${req.protocol.toUpperCase()}/${req.httpVersion}`); \n log.push(res.statusCode);\n\n fs.appendFile(\n 'server/log.csv', `\\n ${log.toString()}`,\n (err) => {if(err) throw err, console.log(err); else console.log(\"Traffic added to log.\")});\n next();\n}", "log(kind, msg, data){ this.logger(kind, msg, data) }", "function postLogs(data, url) {\n makePost(config.backendUrl + url, data);\n\n localStorage.removeItem(\"actions\");\n localStorage.setItem(\"actionNumber\", \"0\");\n}", "function log() {\n //log here\n }", "requestLatestJobLog() {\n this.state.scrollToEndOnNext = true;\n this.ui.showElement('spinner');\n this.state.awaitingLog = true;\n this.bus.emit(jcm.MESSAGE_TYPE.LOGS, {\n [jcm.PARAM.JOB_ID]: this.jobId,\n latest: true,\n });\n }", "log (loggerID, ...msg) {\n if (this.loggers[loggerID]) console.log(`${nowString()}[${loggerID}]:`, ...msg)\n if (this.recorders[loggerID]) {\n this.recorders[loggerID].push({\n time: nowString(),\n msg: msg\n })\n }\n }", "function sendLog(resource, resourceType) {\n if (!logger) {\n logger = transportHandler(serializer);\n }\n logger(resource, resourceType);\n}", "function log() {\n var array = [\"Message from server:\"];\n array.push.apply(array, arguments);\n socket.emit(\"log\", array);\n }", "function file_cache_flush() {\n\t\tfile_cache_dir_save(true /* immediately */);\n\t}", "function log() {\n var array = ['Message from server:'];\n array.push.apply(array, arguments);\n socket.emit('log', array);\n }", "function log() {\n var array = ['Message from server:'];\n array.push.apply(array, arguments);\n socket.emit('log', array);\n }", "function log() {\n var array = ['Message from server:'];\n array.push.apply(array, arguments);\n socket.emit('log', array);\n }", "function log() {\n var array = ['Message from server:'];\n array.push.apply(array, arguments);\n socket.emit('log', array);\n }", "log(message) {\n //send http request\n \n console.log(message);\n this.emit('messageLogged', {id: 1, url: 'http://'}); // making a noise, produce a signaling\n \n }", "function cacheService($window,\n logger) {\n\n logger = logger.getLogger('cacheService');\n\n /*\n * Public interface\n */\n\n var service = {};\n\n /**\n * Sets the cache data for the specified request.\n * @param {!string} url URL of the REST service call.\n * @param {?map=} params Map of strings or objects which will be turned to ?key1=value1&key2=value2 after the url.\n * If the value is not a string, it will be JSONified.\n * @param {Object} data The received data.\n * @param {Date=} date The cache date, now date is used if not specified.\n */\n service.setCacheData = function(url, params, data, date) {\n var cacheKey = getCacheKey(url, params);\n\n cachedData[cacheKey] = {\n date: date || new Date(),\n data: data\n };\n\n logger.log('Cache set for key: \"' + cacheKey + '\"');\n\n saveCacheData();\n };\n\n /**\n * Gets the cached data (if possible) for the specified request.\n * @param {!string} url URL of the REST service call.\n * @param {?map=} params Map of strings or objects which will be turned to ?key1=value1&key2=value2 after the url.\n * If the value is not a string, it will be JSONified.\n * @return {?Object} The cached data or null if no cached data exists for this request.\n */\n service.getCacheData = function(url, params) {\n var cacheKey = getCacheKey(url, params);\n var cacheEntry = cachedData[cacheKey];\n\n if (cacheEntry) {\n logger.log('Cache hit for key: \"' + cacheKey + '\"');\n return cacheEntry.data;\n }\n\n return null;\n };\n\n /**\n * Gets the cached data date (if possible) for the specified request.\n * @param {!string} url URL of the REST service call.\n * @param {?map=} params Map of strings or objects which will be turned to ?key1=value1&key2=value2 after the url.\n * If the value is not a string, it will be JSONified.\n * @return {?Object} The cached data date or null if no cached data exists for this request.\n */\n service.getCacheDate = function(url, params) {\n var cacheKey = getCacheKey(url, params);\n var cacheEntry = cachedData[cacheKey];\n return cacheEntry ? cacheEntry.date : null;\n };\n\n /**\n * Clears the cached data (if exists) for the specified request.\n * @param {!string} url URL of the REST service call.\n * @param {?map=} params Map of strings or objects which will be turned to ?key1=value1&key2=value2 after the url.\n * If the value is not a string, it will be JSONified.\n */\n service.clearCacheData = function(url, params) {\n var cacheKey = getCacheKey(url, params);\n cachedData[cacheKey] = undefined;\n logger.log('Cache cleared for key: \"' + cacheKey + '\"');\n saveCacheData();\n };\n\n /**\n * Cleans cache entries older than the specified date.\n * @param {date=} expirationDate The cache expiration date. If no date is specified, all cache is cleared.\n */\n service.cleanCache = function(expirationDate) {\n if (expirationDate) {\n angular.forEach(cachedData, function(value, key) {\n if (expirationDate >= value.date) {\n cachedData[key] = undefined;\n }\n });\n } else {\n cachedData = {};\n }\n saveCacheData();\n };\n\n /**\n * Sets the cache persistence.\n * Note that changing the cache persistence will also clear the cache from its previous storage.\n * @param {'local'|'session'=} persistence How the cache should be persisted, it can be either\n * in the local or session storage, or if no parameters is provided it will be only in-memory (default).\n */\n service.setPersistence = function(persistence) {\n service.cleanCache();\n storage = persistence === 'local' || persistence === 'session' ? $window[persistence + 'Storage'] : null;\n\n loadCacheData();\n };\n\n /*\n * Internal\n */\n\n var cachedData = {};\n var storage = null;\n\n /**\n * Gets the cache key for the specified url and parameters.\n * @param {!string} url The request URL.\n * @param {?map=} params Map of strings or objects which will be turned to ?key1=value1&key2=value2 after the url.\n * If the value is not a string, it will be JSONified.\n * @return {string} The corresponding cache key.\n */\n function getCacheKey(url, params) {\n return url + (params ? angular.toJson(params) : '');\n }\n\n /**\n * Saves the current cached data into persisted storage.\n */\n function saveCacheData() {\n if (storage) {\n storage.cachedData = angular.toJson(cachedData);\n }\n }\n\n /**\n * Loads cached data from persisted storage.\n */\n function loadCacheData() {\n var data = storage ? storage.cachedData : null;\n cachedData = data ? angular.fromJson(data) : {};\n }\n\n /*\n * Initializes service.\n */\n\n loadCacheData();\n\n return service;\n }", "function writeLog(mesg, type, success, cardID, cardType, clientID)\n{\n if (!fs.existsSync(__dirname + '/logs'))\n {\n fs.mkdirSync(__dirname + '/logs', 0o744);\n }\n\n var logEntry =\n {\n \"logType\" : type,\n \"cardID\" : cardID,\n \"cardType\" : cardType,\n \"clientID\" : clientID,\n \"description\" : mesg,\n \"success\" : success,\n \"timestamp\" : (new Date()).valueOf()\n };\n\n fs.appendFile('logs/log.txt', JSON.stringify(logEntry) + '\\n', function (err)\n {\n if (err) throw err;\n });\n\n fs.stat('logs/log.txt', function (err, stats)\n {\n if(stats != undefined)\n {\n if(stats.size > 10000) //Log greater than 10 KB\n {\n //Rename file to enable logging to continue\n fs.rename('logs/log.txt', 'logs/log.json', function(err)\n {\n if ( err ) console.log('ERROR: ' + err);\n });\n\n //Read in file and send to the reporting team\n logInfo(\"Log size limit reached, sending log to reporting subsystem\", -1, \"N/A\", -1);\n\n var lineReader = require('readline').createInterface({\n input: require('fs').createReadStream('logs/log.json')\n });\n\n let postdata = '{ \"logs\": [';\n lineReader.on('line', function (line) {\n postdata += line + ',';\n });\n postdata += ']}';\n\n let options = {\n host: 'https://still-oasis-34724.herokuapp.com',\n port: 80,\n path: '/uploadLog',\n method: 'POST',\n dataToSend : postdata,\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n 'Content-Length': Buffer.byteLength(postdata)\n }\n };\n\n sendAuthenticationRequest(options, function(){});\n }\n }\n });\n}" ]
[ "0.6405307", "0.6376967", "0.6295099", "0.61457807", "0.60091144", "0.60043174", "0.59848076", "0.59594107", "0.5888953", "0.5842822", "0.58364433", "0.5818091", "0.5817487", "0.5787537", "0.57789475", "0.575589", "0.5711394", "0.56921595", "0.5670618", "0.564355", "0.56359535", "0.56189394", "0.56109774", "0.5609116", "0.56061035", "0.56040394", "0.556131", "0.5553538", "0.55523854", "0.5544412", "0.553708", "0.55015737", "0.549388", "0.54853517", "0.5484272", "0.54789484", "0.54671997", "0.5466509", "0.5457072", "0.5452822", "0.5431468", "0.5422865", "0.54068565", "0.54062134", "0.5402905", "0.53913367", "0.5382912", "0.53786397", "0.5358727", "0.5354701", "0.5348542", "0.53386074", "0.53307813", "0.5329635", "0.5319", "0.5317347", "0.5308034", "0.5306955", "0.53024775", "0.53014576", "0.52891755", "0.5288845", "0.5284314", "0.5266524", "0.5257353", "0.5249811", "0.5249688", "0.5244528", "0.52353233", "0.52353233", "0.52263904", "0.5218011", "0.5203893", "0.5203402", "0.51975965", "0.51851517", "0.51850563", "0.51801467", "0.5174342", "0.5173758", "0.51703805", "0.51698905", "0.5166407", "0.5160171", "0.5157357", "0.51405156", "0.5132717", "0.513125", "0.51271117", "0.5122051", "0.51113415", "0.51098907", "0.51060575", "0.5100957", "0.5100957", "0.5100957", "0.5100957", "0.50998205", "0.50995344", "0.5096915" ]
0.6037193
4
Saves logged message to the logging URL/server
function _saveLog(logLevel, message, flush) { var voidLogging = (!logLevel || !message); if (true === voidLogging) { return; } _logToConsole(logLevel, message); _logToServer(logLevel, message, flush); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _writeLogsToServer(logLevel, loggingUrl) {\n var dataToSend;\n\n dataToSend = {\n logLevel: logLevel\n , logData : app.cache.logData\n };\n app.cache.logData = [];\n $.ajax({\n type: 'POST'\n , url: loggingUrl\n , data: dataToSend\n });\n }", "write(message) {\n message_log.write(message)\n }", "function saveLocally(msg){\n\t\n\tlocalStorage.setItem(storageKey.toString(), JSON.stringify(msg));\n\t$(\"#infoScreen\").html(\"Saved location to local storage<br>\" + new Date());\n\tstorageKey++;\n}", "function log(msg) {\n // using synchronous append file\n // because otherwise it tries to open and append the same file\n // >2000 times simultaneously\n // this crashes the server on windows\n // behaviour which is generally frowned upon\n //\n\tfs.appendFileSync(filepath, msg + \"\\n\", function (err) {\n\t if (err) throw err;\n\t // console.log('Saved!');\n\t});\n\t// console.log(\"Logging data\");\n}", "function sendLog(log) {\n fetch(\"http://134.117.128.144/logs\", {\n method: \"post\",\n headers: {\n \"Content-type\": \"application/json\"\n },\n body: JSON.stringify(log)\n });\n}", "function saveLog(){\n\txmlHttp10 = GetXmlHttpObject();\n\n\tif (xmlHttp10 == null){\n\t\talert(\"Browser does not support HTTP Request\");\n\t\treturn;\n\t}\n\n\tvar url = base_url+\"simpanHistori/?userId=\" + userId + \"&baturId=\" + strangerId;\n\txmlHttp10.open(\"POST\", url, true);\n\txmlHttp10.onreadystatechange = stateChanged10;\n\txmlHttp10.send(null);\n}", "async save() {\n try {\n const logString = JSON.stringify(this.serializeJson());\n await this.storage.set(storageKey, logString);\n }\n catch (err) {\n logError('Failed to save progress log:', err);\n }\n }", "function writeLog(logData) {\n var url = CONFIG.USE_MOCK_SERVICES ? 'mock-api/logClientMsg.json' : CONFIG.LOG_URL;\n\n angular.extend(logData, Accela.settings, {\n url: $window.location.href\n });\n\n Accela.Utils.XmlHttp.post(url, logData, CONFIG.LOG_ACCESS_KEY);\n }", "function log(message, sessionid){\n var timestamp = new Date().getTime();\n var logEntry = \"serverTime:\" + timestamp + \" log:\" + message + \"\\n\";\n // var logEntry = message;\n // console.log(\"log: \" + logEntry);\n // logEntry += \"\\n\";\n var session = getSessionById(sessionid);\n if(session == null){\n console.log(sessionid + \" ended\");\n }\n else{\n try{\n logstream.write(logEntry);\n session.logstream.write(logEntry);\n }\n catch(e){\n console.log(\"failed to write to log file: \" + logEntry);\n }\n }\n }", "function lemurlog_DoWriteLogFile(fileName, text) {\n lemurlog_WriteLogFile(fileName, text);\n lemurlog_checkAutoUpload();\n}", "logOnServer(severity, url, lineNr, message) {\n // Can't use client here as we need to send to a different endpoint\n API._fetch(LOGGING_ENDPOINT, [{ severity, url, lineNr, message }])\n }", "function log(message) {\n if (VERBOSE_LOGGING)\n postmessage('@console', \"Worker Log : \" + message);\n }", "function postLogs(data, url) {\n makePost(config.backendUrl + url, data);\n\n localStorage.removeItem(\"actions\");\n localStorage.setItem(\"actionNumber\", \"0\");\n}", "log(message) {\n\n // send http request\n console.log(message);\n \n // Raise: messageLogged event\n // - As Logger inherits EventsEmitter, it's base methods can be called too\n // - Pass data through event argument read as eventArg, arg, or whatever\n this.emit('messageLogged', { id: 1, data: {id: 1, url: 'http://...'} });\n \n }", "function writeLog (taId, event, message) {\n\t\tvar ta = Ext.getCmp (taId);\n\t\tta.setValue (ta.getValue () + event + ': ' + message + '\\n');\n\t}", "function writeMessage(message){\n\tconsole.log(message);\n\tfs.appendFile(\"log.txt\",message,function(err){\n\t\tif (err) throw err;\n\t});\n}", "function writeLog(logData) {\n if (!CONFIG.USE_MOCK_SERVICES) {\n angular.extend(logData, {\n url: $window.location.href\n });\n\n Accela.XHR.post(CONFIG.LOG_URL, logData, CONFIG.LOG_ACCESS_KEY);\n }\n }", "function _log(){\n var now_date = _getDate();\n console.log(now_date);\n if (now_date != cur_date) {\n var log_content = '\\nDate: ' + cur_date + ' visit number: home: ' + home_num +\n ', upload: ' + upload_num + ', download: ' + download_num;\n fs.appendFile(logfile, log_content, function (err) {\n if (err) console.log(err);\n console.log('Log Saved!');\n });\n cur_date = now_date;\n home_num = 0;\n upload_num = 0;\n download_num = 0;\n }\n}", "function saveToStorage(){\n\tvar length = keyLog[fullTimeStamp].length;\n\tif(length != 0 && saving != true && enabled == true){\n\t\tsaving = true;\n\t\t//console.log(\"data was saved\");\n\t\tchrome.storage.local.get(fullTimeStamp, function(storage){\n\t\t//console.log(\"Saved Log\" );\n\t\t//console.log(storage);\n\t\tif(storage[fullTimeStamp] != undefined){\n\t\t\tstorage[fullTimeStamp] += keyLog[fullTimeStamp];\n\t\t\tchrome.storage.local.set(storage, function(){\n\t\t\t\tsaving = false;\n\t\t\t});\n\t\t}else{\n\t\t\tchrome.storage.local.set(keyLog, function(){\n\t\t\t\tsaving = false;\n\t\t\t});\n\t\t}\n\t\tgetTimeStamp();\n\t\t});\n\t}\n}", "log(message, update) {\n if (this.logLevel < 3) {\n return\n }\n\n this.write(message, !update)\n }", "log(message) {\n //Sends an HTTP request\n console.log('testing' + message);\n\n //Raise an event\n // 'this' references Logger class itself, which extends EventEmitter\n this.emit('messageLogged', { id: 1, url: 'http://' });\n }", "function _logToServer(logLevel, message, flush) {\n var logConfig = app.config && app.config.logConfig\n , logLevels = logConfig && logConfig.logLevels\n , logTreshold = logConfig && logConfig.clientAppLogTreshold\n , loggingUrl = logConfig && logConfig.loggingUrl\n , shouldLogToServer = logLevels && logTreshold && loggingUrl && 'console' !== logLevel\n , timeoutValue = 10 *1000\n , logLengthFlushTreshold = 30\n , logCacheLength\n , shouldFlush;\n\n if (shouldLogToServer && true === _passingTreshold(logLevels, logTreshold, logLevel)) {\n logCacheLength = app.cache.logData.length;\n message = [_getLogDate(), message].join(' ');\n app.cache.logData.push(['[', logCacheLength, '] ', message].join(''));\n window.clearTimeout(app.cache.logTimer);\n\n shouldFlush = logCacheLength > logLengthFlushTreshold || true === flush;\n\n if (true === shouldFlush) {\n _writeLogsToServer(logLevel, loggingUrl);\n }\n else {\n app.cache.logTimer = window.setTimeout(function() {\n _writeLogsToServer(logLevel, loggingUrl);\n }, timeoutValue);\n }\n }\n }", "function saveLog(){\n\n\tlet collectedData = null;\n\tcollectCurrentData()\n\t.then((result)=>{\n\t\tcollectedData = result; //collect the data\n\t\treturn localforage.getItem('logs'); //get the log in memory\n\t})\n\t.then((logs)=>{\n\t\tif(!logs) //if there are no logs instantiate an obj\n\t\t\tlogs = {}\n\t\tlet key = 'log'+logNumber;\n\t\tlogs[key] = collectedData; //write the collected results to the obj\n\t\tcurrKey=key;\n\t\t//console.log(logs[key]);\n\t\treturn localforage.setItem('logs',logs); //save back into memory\n\t})\n\t.then(()=>{\n\t\tif(logNumber>maxLogNumber){ //if the logNumber is larger than the maxLogNumber - update the max log number\n\n\t\tmaxLogNumber = logNumber;\n\t\treturn localforage.setItem('maxLogNumber',maxLogNumber); //write max log number back into memory\n\t\t}\n\t})\n\t.catch((err)=>{\n\t\tconsole.log(err);\n\t\tconsole.error(\"!!LOG FAILED TO SAVE\");\n\t});\n}", "function sendLog(malfunctionId){\n timestamp = userActions[1][0];\n userActions = JSON.stringify(userActions);\n $.ajax({\n url: myApp.urSrvURL + \"log.php\",\n type: \"POST\",\n data: ({\"logData\": userActions, \"timestamp\": timestamp, \"malfunctionId\": malfunctionId})\n });\n }", "persist() {\n // TODO: Needs error handling!\n fetch(self.writeURL, { method: 'post' })\n .then(response => {\n alert('Saved')\n response.text().then(data => console.log(data))\n })\n\n self.timestamp = null\n\n return true\n }", "function log(option,user,action,data,to){\n let log ='';\n if(option==1)\n log = user+\"|\"+action+\"|\"+data+\"|\"+to+\"|\"+new Date().toLocaleString()+\"\\n\";\n else{ // user is the string sent \n log = user+\"|\"+Date.now()+\"\\n\";\n }\n fs.appendFile('daily.log',log,function(){\n //do nothing \n });\n}", "log(message) {\n this.loggingFunction(message);\n }", "function logger(message) {\n fs.appendFile(LOG_FILE, message + '\\n');\n}", "function logMessage(username, content) {\r\n\tmessagesJSON.messages.push({\r\n\t\tuser: username,\r\n\t\tmessage: content\r\n\t})\r\n}", "function saveTranscriptMessage(msg) {\n transcriptHistory.push(msg)\n}", "function appendToAuditLog(data) {\n var oldData = localStorage.getItem('auditLog');\n if(oldData === null) {\n oldData = \"\";\n }\n localStorage.setItem('auditLog', oldData + data + '\\n');\n }", "function storeLogItems() {\r\n\tlocalStorage.logContents = locationUpdateLog.innerHTML;\r\n}", "function sm_log(data) {\n\n\tvar msg = new Buffer(JSON.stringify(data));\n\n\tclient.send(msg, 0, msg.length, 3001, 'localhost', function(err, bytes) {\n\t\tif (err) {\n\t\t\tthrow err;\n\t\t}\n\t});\n}", "function WriteToLog(data) {\r\n if (!webPlayer && data != '' && typeof (data) == 'string') {\r\n UIEvent(\"WriteToLog\", getTimeAndDateForLog() + \" \" + data);\r\n }\r\n}", "log(message) {\n this.stream.write((new Date()).toUTCString() + \" ------ \" + message + \"\\n\");\n this.emit('log', message);\n }", "function sendAndSaveMessage(room, user, message){\n //Write on chat\n let who = user;\n if (user === name) who = 'Me';\n writeOnHistory('<b>' + who + ':</b> ' + message);\n\n //Storing message in IndexedDB\n getRoomData(room).then(data => {\n var newObj = {\n date: Date(),\n user: user,\n message: message\n }\n data.messages.push(newObj);\n updateField(room, \"messages\", data.messages);\n });\n}", "log(message) {\r\n this.messageService.add(`操作信息: ${message}`);\r\n }", "function postToServer(key){\n\tlocalforage.getItem('logs')\n\t.then((logs)=>{\n\t\tlet log = logs[key];\n\t\tlog = formatVolunteers(log);\n\t\tconsole.log(log);\n\t\t$.ajax({\n\t\t\ttype : 'POST',\n\t\t\tcontentType: \"application/json; charset=utf-8\",\n\t\t\turl : \"sample\",\n\t\t\tdataType: 'json',\n\t\t\tdata : JSON.stringify(log),\n\t\t\tsuccess : (response)=>{\n\t\t\t\tconsole.log(response);\n\t\t\t\tlog.submitted = true;\n\t\t\t\talert(\"Upload Success!\");\n\t\t\t\tlocalforage.setItem('logs',logs)\n\t\t\t\t.then(()=>window.location.reload(false));\n\t\t\t},\n\t\t\terror : (response)=>{\n\t\t\t\tconsole.log(response);\n\t\t\t\talert('Upload Failed!');\n\t\t\t\twindow.location.reload(false);\n\t\t\t\t$('.uploadModal').fadeOut(300);\n\n\t\t\t}\n\t\t});\n\n\t})\n}", "sendLogs() {\n this.log.info('logging from tests');\n }", "function saveMessage(element) {\n const message = {\n text: element.text(),\n id: element.attr('id').replace('m', ''),\n y: element.css('top').replace('px', ''),\n x: element.css('left').replace('px', ''),\n toString: function () {\n return 'text=' + this.text + '&id=' + this.id + '&y=' + this.y + '&x=' + this.x;\n }\n };\n query('type=saveMessage&' + message.toString());\n}", "log(message) {\n //send http request\n \n console.log(message);\n this.emit('messageLogged', {id: 1, url: 'http://'}); // making a noise, produce a signaling\n \n }", "function write(message)\n\t{\n\t\tlog.debug('Writing %s', message);\n\t\tconnection.write(message);\n\t}", "function sendLog() {\n $.post(\"db.php\", sessHistory); // jQuery AJAX POST\n count = 0; // Resetting command count.\n sessHistory = {branch: BRANCH}; // Resetting session history JSON.\n}", "function log(message) {\n\t//Would send HTTP request\n\tconsole.log(message); \n}", "log(message){\n // Send an HTTP request\n console.log(message);\n \n // Raise an event\n /*\n \n We first give the name of the event we want to emit. Then, we can pass\n some data. It's good practice to encapsulate the event argument in an\n object where the data is labeled. \n \n */\n this.emit('messageLogged', { id: 1, url: 'http://'});\n }", "function logMessage(aString) {\n\tinfoPage.writeLog(aString);\n}", "function writeToLog(data) {\n\n fs.appendFile(\"log.txt\", data, function(err) {\n if (err) {\n return console.log(err);\n }\n console.log(space + \"log.txt was updated!\" + \"\\n\");\n whatIsNext();\n });\n}", "function log(message) {\n const CheckInLogPath = 'check_in.log';\n\n console.log(`Logging ${message}`);\n\n fs.appendFileSync(CheckInLogPath, message + '\\n');\n}", "function basicSave(flash) {\n fs.appendFile('log.txt', 'Front: ' + flashcard.front + 'Back: ' + flashcard.back + '\\n', 'UTF-8', function(error) {\n if (error) throw error;\n });\n}", "function saveMessage() {\n message.save(function(err, savedMessage) {\n if(err) {\n return res.status(500).json({\n title: 'An error occurred',\n error: err\n })\n }\n //Successfully saved\n console.log(\"Saved message: \", savedMessage);\n return res.status(201).json({\n title: 'Message saved',\n obj: savedMessage\n })\n })\n }", "function clozeSave(flash) {\n fs.appendFile('log.txt', 'Cloze: ' + flashcard.cloze + 'Question: ' + flashcard.question + '\\n' + 'UTF-8', function(error) {\n if (error) throw error;\n });\n}", "function withLogging() {\n try {\n saveUserData(user);\n } catch (error) {\n logToSnapErrors(error);\n }\n}", "function sendLog()\n{\n var jqDlg = $(app.STATUS_PROMPT_LEFT).css(\"display\", \"block\"), // display warning\n checked = $(app.SENDLOG_PROMPT_STOP).attr(\"checked\");\n closeSendLog();\n\n if (\"undefined\" !== typeof(Storage))\n {\n window.localStorage.stopSendLogPrompt = checked; // set localstorage\n }\n\n app.log(2, 'SENDLOG_USERCOMMENT: ' + $('textarea', app.SENDLOG_PROMPT).val());\n $('textarea', app.SENDLOG_PROMPT).val('');\n\n jqDlg.css('background-image', 'url(images/waiting-trans.gif)');\n $('#message', jqDlg).text('Sending log file to GoCast...');\n $('#stop-showing', jqDlg).css('display', 'none');\n $('#stop-showing-text', jqDlg).css('display', 'none');\n $('img.close', jqDlg).css('display', 'none');\n Callcast.SendLogsToLogCatcher(function()\n {\n // success callback\n $('#message', jqDlg).text('Sending log file to GoCast... DONE.');\n setTimeout(function() {jqDlg.css(\"display\", \"none\");}, 1000);\n console.log(\"SendLogsToLogCatcher success\", jqDlg);\n },\n function() // fail callback\n {\n $('#message', jqDlg).text('Sending log file to GoCast... FAILED.');\n setTimeout(function() {jqDlg.css(\"display\", \"none\");}, 1000);\n Callcast.SendLiveLog(\"SendLogsToLogCatcher failed\");\n });\n}", "function logMsg(msg){\n var date = new Date();\n console.log(date.getFullYear() + \"-\" + (date.getMonth() + 1) + \"-\" + date.getDate() + \" \" + date.getHours() + \":\" + date.getMinutes() + \":\" + date.getSeconds() + \": \" + msg);\n\n\n // log to mongoDB if it is activated\n if(MONGO_LOG){\n MongoClient.connect(mongoUrl, function (err, db) {\n if (err) {\n console.log('Unable to connect to the mongoDB server. Error:', err);\n } else {\n var collection = db.collection('Running_Log');\n var log = {time: date, msg: msg};\n collection.insert([log], function (err, result) {\n if (err) {\n console.log(err);\n } else {\n }\n db.close();\n });\n }\n });\n }\n }", "function saveToDb(sender, receiver, message) {\n messageDb.save(sender, receiver, htmlEntityFilter.filter(message)).then(result => {\n log.info('message saved to db')\n }, (error) => {\n log.error(error)\n })\n}", "function logged(logData) {\n\n console.log(logData);\n\n fs.appendFile('log.txt', logData + '\\n', function (err) {\n\n if (err) return logged('Error logging data to file: ' + err);\n });\n}", "async logDispatch(instance, level, data) {\n //保存到数据库中\n const time = new Date();\n this.send({\n type: \"add_log\",\n name: instance.fileName,\n level,\n data: { time: time.toUTCString(), level, data },\n })\n await instance.logModel.create({ level, data, time });\n }", "_write(msg, level = LogLevel.Log) {\n // [null, undefined] => string\n msg = msg + '';\n if (this._pendingLogQ) {\n this._pendingLogQ.push({ msg, level });\n }\n else if (this._currentLogger) {\n this._currentLogger.log(msg, level);\n }\n }", "log(message) {\n // Send http request\n console.log(message);\n\n //Raised an event\n // commented out of app.js after adding into logger.js\n\n this.emit('messageLogged', {id: 1, url: 'http:' }); \n }", "function wwLog(logLevel, oData){\n\t\n\t// check if post back to main exists\n\t// if dosent exist, dont do anything\n\tif (typeof postMsgToMain == 'function') { \n\t\tpostMsgToMain(logLevel, \"INFO\" ,oData); \n\t}\n\n\n}", "function writeLog(data) {\n console.log(data);\n fs.appendFileSync(logFile, data+\"\\n\");\n}", "function storeMessageRemotely(elem) {\n clearUI();\n console.log('Message sent to server:');\n}", "saveAndPublish() {\n this.growl.show({\n severity: 'success',\n summary: 'Success Message',\n detail: 'Your changes have been saved and are now LIVE all over the world'\n });\n }", "write(message, encoding) {\n // eslint-disable-line no-unused-vars\n logger.info(message);\n }", "function writeMessage(message){\n console.log(message);\n}", "log(kind, msg, data){ this.logger(kind, msg, data) }", "function _saveMessages()\n\t\t{\n\t\t\tvar messages = _getMessages();\n\t\t\tif (messages.length)\t\t\t//delete messages already displayed\n\t\t\t{\n\t\t\t\twhile (messages.length && EZ.getTime(messages[0].time) < displayTime)\n\t\t\t\t\tmessages.shift();\n\t\t\t}\n\t\t\tif (messages.length)\n\t\t\t{\n\t\t\t\tpage.messageCount = messages.length;\n\t\t\t\tpage.messageTime = formattedDate;\n\t\t\t}\n\t\t\t//=========================================================================\n\t\t\tEZ.store.set('.EZtrace.messages.' + ourPageName + '@', messages);\n\t\t\t//=========================================================================\n\t\t}", "function gameLog(message) {\n if (usernames.length === 0) { gameLogMessages = []; }\n const messageId = gameLogMessages.length;\n gameLogMessages = [...gameLogMessages, [messageId, message]];\n io.emit(GAME_LOG_MESSAGE, gameLogMessages);\n}", "function log(data, info, logCommand) { // log(param1, param2) and use parameters to log the data in log.txt\r\n\r\n if (logCommand === \"concert-this\") {\r\n var command = \"concert-this \" + info;\r\n } else if (logCommand === \"spotify-this-song\") {\r\n var command = \"spotify-this-song \" + info;\r\n } else if (logCommand === \"movie-this\") {\r\n var command = \"movie-this \" + info;\r\n }\r\n var log = \"\\n\" + \"Command: \" + command + \"\\n\" + data + \"\\n\" + \"===========\" + \"\\n\";\r\n fs.appendFile(\"log.txt\",log, function(error) {\r\n if (error) {\r\n return console.log(error);\r\n }\r\n \r\n })\r\n}", "function writeLogToDisk(fakeLog, filename) {\n fileWritten = false;\n fs.writeFile(filename, JSON.stringify(fakeLog, null, \"\\t\"), function(err) {\n if (err) {\n console.log(\"error writing file\");\n }\n });\n}", "function Log(args)\n{\n var msg = LogToFile.apply(this, arguments);\n // log to console\n console.log(msg);\n // send back to clients\n PushData('C ' + EscapeHTML(msg) + '<br/>');\n}", "log ({ commit }, message) {\n commit('ADD_MESSAGE', {\n text: message,\n type: 'log',\n time: new Date()\n })\n }", "function postLog() {\n api(\"POST\", \"/log\", JSON.stringify(logData), (res)=>{/*donothing*/});\n}", "function saveFile(){\n socket.emit(\"save_file\",\n {\n room:roomname,\n user:username,\n text:editor.getSession().getValue()\n });\n}", "function logger(content,level) {\n\n var datestring = new Date().toISOString().split('T')[0];\n var timestring = new Date().toISOString().replace('T',' ');\n\n var filename = datestring+'-server.log';\n var line = timestring + level + content + \"\\n\";\n\n fs.appendFile(filename, line, function (err) {\n if (err) throw err;\n });\n}", "function log(message) {\n fs.appendFile(logPath, `[${NAME}]\\t${new Date().toISOString()}\\t${message}\\n`, (err) => {\n if (err) throw err\n })\n console.log(message)\n}", "handler(request, reply) {\n try {\n const entry = new LogEntry({\n message: request.body.message,\n timestamp: getUTCDate(),\n });\n logInstance.write(entry);\n reply.status(200).send(entry.toString());\n } catch (e) {\n console.log(e);\n reply.status(500).send();\n }\n }", "function logResponse(respMsg) {\r\n\tif (logFile == \"yes\") {\r\n\t\tfs.appendFileSync(\"error.log\", \"\\r\" + respMsg)\r\n\t}\r\n}", "async function writeLog() {\r\n const remId = getOrCreateRem(PUBLISH_LOG_NAME);\r\n // TODO: Implement\r\n}", "function mylogging(logg)\r\n{\r\n\t let r = logg.requests[0].response.headers ;\r\n\t r = JSON.stringify(r) ;\r\n\t console.log(r) ;\r\n\t fs.writeFileSync(filePath,r);\r\n}", "function saveMessage(msg){\n const result = messageRef.push().set(msg);\n console.log(result);\n}", "function saveMessage() {\r\n var messageText=document.querySelector('#messages').value;\r\n // Add a new message entry to the database.\r\n return firebase.firestore().collection('messages').add({\r\n name: getUserName(),\r\n text: messageText,\r\n timestamp: firebase.firestore.FieldValue.serverTimestamp()\r\n }).catch(function(error) {\r\n console.error('Error writing new message to database', error);\r\n });\r\n}", "function saveReplay() {\n fs.writeFile(\"./replyMSG.json\", JSON.stringify(replyMSG), function(err) {\n if (err) throw err;\n });\n}", "function pushLog(text) {\r\n\tchatLog.push(text);\r\n\tconsole.log(text);\r\n}", "function log(aktlvl, msg) {\r\n\t\tlogArr[logArr.length] = msg;\r\n\t\t\r\n\t\tif (logLevels.indexOf(aktlvl) <= efConfig.log) { \r\n\t\t\tdisplayMessage(msg);\r\n\t\t}\r\n\t\tif (aktlvl == \"tiddler\"){ \r\n\t\t\tcreateTiddler(logName, {responseText:logArr.join(\"\\n\")})\r\n\t\t}\r\n\t} // function log()", "function writeToLog(data) {\n\tconsole.log(data);\n}", "function LogMessage(\n\tmsg\n) {\n\tvar record = Session.Installer.CreateRecord( 0 );\n\trecord.StringData( 0 ) = msg;\n\tSession.Message( MsgKind.Log, record );\n}", "function writeLog(db, ip, tag, action, target, callback){\n console.log(ip+\", \" + tag + \", \" + action + \", \" + target);\n //if (session.useremail==null) return;\n if (arguments.length==4){\n callback = function(err, result){\n if (err) {\n return console.log('insert error', err);\n }\n }\n }\n db.collection('logs').insert({\n user : ip,\n tag : tag,\n action : action,\n target : target,\n time : (new Date()).getTime()\n\n }, callback);\n\n}", "function writeToLog(errMessage) { \n\n //fs is required to create/write to the log file\n var fs = require('fs');\n\n //Create new date object, which stores the current date & time by default\n var dateTime = new Date();\n\n\t// updates logfile.txt \t\n fs.appendFile(pathtolog, dateTime + \":\\t\" + errMessage + \"\\n\", function (err) {\n if (err) throw err;\n console.log(\"Written to log: \" + errMessage);\n });\n}", "function writeLog() {\n //Load current Log Data\n let log = loadLog();\n\n //Get Current Timestamp\n let timestamp = Date.now();\n\n //Create Dummy Data as an Object\n let obj = {\n timestamp: timestamp,\n roomArea1: {\n temperature: random(30, 36),\n humidity: random(60, 70),\n },\n roomArea2: {\n temperature: random(30, 36),\n humidity: random(60, 70),\n },\n roomArea3: {\n temperature: random(30, 36),\n humidity: random(60, 70),\n },\n roomArea4: {\n temperature: random(30, 36),\n humidity: random(60, 70),\n },\n roomArea5: {\n temperature: random(30, 36),\n humidity: random(60, 70),\n },\n };\n\n //Push new Dummy Data to Log Data\n log.push(obj);\n\n //Write to Logs/log.json file\n fs.writeFileSync(\"logs/log.json\", JSON.stringify(log), (err) => {\n if (err) {\n console.error(err);\n }\n });\n\n //Output Log Writing Time\n console.log(\"Write Log : \", new Date(timestamp));\n}", "function writeLog(mesg, type, success, cardID, cardType, clientID)\n{\n if (!fs.existsSync(__dirname + '/logs'))\n {\n fs.mkdirSync(__dirname + '/logs', 0o744);\n }\n\n var logEntry =\n {\n \"logType\" : type,\n \"cardID\" : cardID,\n \"cardType\" : cardType,\n \"clientID\" : clientID,\n \"description\" : mesg,\n \"success\" : success,\n \"timestamp\" : (new Date()).valueOf()\n };\n\n fs.appendFile('logs/log.txt', JSON.stringify(logEntry) + '\\n', function (err)\n {\n if (err) throw err;\n });\n\n fs.stat('logs/log.txt', function (err, stats)\n {\n if(stats != undefined)\n {\n if(stats.size > 10000) //Log greater than 10 KB\n {\n //Rename file to enable logging to continue\n fs.rename('logs/log.txt', 'logs/log.json', function(err)\n {\n if ( err ) console.log('ERROR: ' + err);\n });\n\n //Read in file and send to the reporting team\n logInfo(\"Log size limit reached, sending log to reporting subsystem\", -1, \"N/A\", -1);\n\n var lineReader = require('readline').createInterface({\n input: require('fs').createReadStream('logs/log.json')\n });\n\n let postdata = '{ \"logs\": [';\n lineReader.on('line', function (line) {\n postdata += line + ',';\n });\n postdata += ']}';\n\n let options = {\n host: 'https://still-oasis-34724.herokuapp.com',\n port: 80,\n path: '/uploadLog',\n method: 'POST',\n dataToSend : postdata,\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n 'Content-Length': Buffer.byteLength(postdata)\n }\n };\n\n sendAuthenticationRequest(options, function(){});\n }\n }\n });\n}", "function message(msg) {\n $(\"#logger\").text(msg);\n }", "function logMe(input){\n var now = new Date();\n var output = now.toTimeString() + \": \" + input;\n $.writeln(output);\n var logFile = File(\"/path/to/logfile.txt\");\n logFile.open(\"e\");\n logFile.writeln(output);\n logFile.close();\n}", "function logMe(input){\n var now = new Date();\n var output = now.toTimeString() + \": \" + input;\n $.writeln(output);\n var logFile = File(\"/path/to/logfile.txt\");\n logFile.open(\"e\");\n logFile.writeln(output);\n logFile.close();\n}", "function saveError(error) {\n const score = fs.readFileSync('./scores/score.log').toString();\n\n fs.writeFile('./scores/score.log', score.concat(`\\n${error}`), err => {\n if (err) {\n console.log(err);\n }\n });\n}", "function insertLogEvent(data) {\n console.warn(\"TO-DO: HIB Implement the log insertion in [\" + insertLogEventAPI + \"] ---> \" + JSON.stringify(data));\n }", "saveNewMessage(message) {\n if(message) {\n const { currentUser } = this.state;\n const newMessage = {\n type: \"newMessage\",\n username: currentUser,\n content: message\n };\n this.socket.send(JSON.stringify(newMessage));\n }\n }", "function logOutPut() {\n fs.appendFile(\"log.txt\", dataOutPut, function (err) {\n if (err) {\n console.log(err);\n } else {\n if (commandRequest !== \"my-tweets\")\n console.log(dataOutPut);\n }\n });\n}", "function writeToLog(str) {\n\t\t//writeToLog doesn't need private access to name/passwd,\n\t\t//so might as well make it shared between users\n\t\tsharedLog.push(this.getName() + ':' + str);\n\t\treturn true;\n\t}", "function callback_logd(e, logd_) {\n logd = logd_;\n update_and_publish();\n }" ]
[ "0.6926584", "0.6887182", "0.63915145", "0.6350084", "0.63223106", "0.62875396", "0.6270809", "0.62093645", "0.6179677", "0.61468315", "0.61127514", "0.6097059", "0.6073327", "0.6060821", "0.605587", "0.60324955", "0.59994054", "0.5962099", "0.5902836", "0.5884365", "0.587937", "0.58744764", "0.5858538", "0.5841154", "0.5835318", "0.580573", "0.5791034", "0.5788275", "0.5770398", "0.573467", "0.5733714", "0.5730176", "0.56843704", "0.56732935", "0.56726015", "0.56597877", "0.5649647", "0.5624802", "0.5620249", "0.56127053", "0.5608369", "0.5603863", "0.55991745", "0.55946213", "0.5594206", "0.5581335", "0.5565867", "0.5565457", "0.5559643", "0.555863", "0.55444914", "0.5535418", "0.5532712", "0.5521035", "0.5520746", "0.5519683", "0.55173707", "0.55145264", "0.55102646", "0.5507453", "0.5506689", "0.5501452", "0.54993623", "0.54990554", "0.5495005", "0.5493288", "0.5486034", "0.5480773", "0.5475885", "0.5475291", "0.54517156", "0.5444963", "0.54425997", "0.5435703", "0.54349685", "0.5426245", "0.5411428", "0.5406917", "0.5406745", "0.53971463", "0.5387961", "0.538341", "0.53828865", "0.5370816", "0.5368269", "0.53670055", "0.53668", "0.53645897", "0.53609", "0.5355691", "0.53515744", "0.53476024", "0.53424686", "0.53424686", "0.5340082", "0.5337789", "0.5331048", "0.5330907", "0.533037", "0.532574" ]
0.676562
2
gets current date as string in the format used for logging
function _getLogDate() { var date = new Date() , year = date.getFullYear() , month = ["0", (date.getMonth() + 1)].join('').substr(-2) , day = ["0", date.getDate()].join('').substr(-2) , hours = ["0", date.getHours()].join('').substr(-2) , minutes = ["0", date.getMinutes()].join('').substr(-2) , seconds = ["0", date.getSeconds()].join('').substr(-2) ; return [ [year, month, day].join('-') , [hours, minutes, seconds].join(':') ].join(' '); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCurrentDateString() {\n return dataUtils_1.formatDate.bind(new Date())('yyyy-MM-dd-hhmm');\n}", "function getCurrentDateString() {\n\t\tlet date = new Date();\n\t\tlet dateString = \"\" + date.getFullYear() + \"-\" + (date.getMonth() + 1) + \"-\" + date.getDate() + \"-\" + \n\t\t\t(date.getHours() + 1) + \"-\" + (date.getMinutes() + 1);\n\n\t\treturn dateString;\n}", "function dateTodayStr() {\n\n var today = new Date();\n return dateFmtStr(today);\n}", "function getCurrentDateString() {\n var today = new Date();\n var dd = today.getDate();\n var mm = today.getMonth() + 1;\n var yyyy = today.getFullYear();\n\n if (dd < 10) {\n dd = '0' + dd\n }\n\n if (mm < 10) {\n mm = '0' + mm\n }\n\n return yyyy + '-' + mm + '-' + dd;\n}", "function getCurrentDateString() {\n return 'NAME_OF_BOT_HERE :: ' + (new Date()).toISOString() + ' ::';\n }", "function nowAsString() {\n return new Date().toISOString().substring(0, 10);\n}", "function getDateString() {\n var now = new Date();\n var day = (\"0\" + now.getDate()).slice(-2);\n var month = (\"0\" + (now.getMonth() + 1)).slice(-2);\n return (month) + \"/\" + (day) + \"/\" + now.getFullYear();\n }", "function dateString () {\n now = new Date();\n year = \"\" + now.getFullYear();\n month = \"\" + (now.getMonth() + 1); if (month.length == 1) { month = \"0\" + month; }\n day = \"\" + now.getDate(); if (day.length == 1) { day = \"0\" + day; }\n hour = \"\" + now.getHours(); if (hour.length == 1) { hour = \"0\" + hour; }\n minute = \"\" + now.getMinutes(); if (minute.length == 1) { minute = \"0\" + minute; }\n second = \"\" + now.getSeconds(); if (second.length == 1) { second = \"0\" + second; }\n return year + \"-\" + month + \"-\" + day + \" \" + hour + \"_\" + minute + \"_\" + second;\n}", "function getCurrentDate() {\n function pad(string) {\n return (\"0\" + string).slice(0, 2);\n }\n\n const now = new Date();\n const month = pad(now.getMonth() + 1);\n const day = pad(now.getDate());\n const hours = pad(now.getHours());\n const minutes = pad(now.getMinutes());\n const seconds = pad(now.getSeconds());\n return `${now.getUTCFullYear()}${month}${day}-${hours}${minutes}${seconds}`;\n}", "function getFormattedDateString() {\n const now = new Date();\n const date_string = `${now.getFullYear().toString()}${(now.getMonth() < 10 ? (\"0\" + (now.getMonth() + 1).toString()) : (now.getMonth() + 1).toString())}${(now.getDate < 10 ? (\"0\" + now.getDate().toString()) : now.getDate().toString())}`;\n return date_string;\n }", "function getFormattedCurrentDateTime() {\n return new Date().toJSON().slice(0, 19).replace('T', ' ');\n}", "getCurrentDateFormated() {\n let today = new Date();\n let day = today.getDate();\n let month = today.getMonth()+1;\n let year = today.getFullYear();\n\n if( day < 10) {\n day = \"0\" + day;\n }\n\n if(month < 10) {\n month = \"0\"+month\n }\n\n return `${year}-${month}-${day}`\n }", "getCurrentDate()\n {\n // get date:\n let date = new Date();\n // format:\n return date.toISOString().slice(0, 19).replace('T', ' ');\n }", "function nowAsString() {\n return new Date().toISOString().replace(\"T\", \" \").replace(\"Z\",\" \");\n}", "function currentDate() {\n var date = new Date();\n var day = date.getDate() <= 9 ? '0' + date.getDate() : date.getDate();\n var month = (date.getMonth() + 1) <= 9 ? '0' + (date.getMonth() + 1) : (date.getMonth() + 1);\n var year = date.getFullYear();\n var strOne = day + '/' + month + '/' + year;\n var strTwo = day + '-' + month + '-' + year;\n var strDate = strOne + '\\n' + strTwo;\n\n\n return strDate;\n}", "function currentDate() {\r\n const today = new Date(); \r\n const nullBeforeMonth = today.getMonth() <= 9 ? '0' : '' \r\n const nullBeforeDay = today.getDate() <= 9 ? '0' : '' \r\n const date = nullBeforeDay + today.getDate() + '.' + nullBeforeMonth + (today.getMonth() + 1) + '.' + today.getFullYear();\r\n return date\r\n }", "function displayCurrentTime() {\n var currentDate = new Date();\n console.log(formatCurrentTime(currentDate));\n}", "getCurrentDate () {\n var dateTime = new Date()\n return '[' + dateTime.getFullYear() + '/' +\n (dateTime.getMonth() + 1).toString().padStart(2, '0') + '/' +\n dateTime.getDate().toString().padStart(2, '0') + ' ' +\n dateTime.getHours().toString().padStart(2, '0') + ':' +\n dateTime.getMinutes().toString().padStart(2, '0') + ':' +\n dateTime.getSeconds().toString().padStart(2, '0') + ']'\n }", "function getCurrentDate() {\n const d = new Date();\n let month = (d.getMonth() + 1).toString();\n if (month.length < 2) {\n month = `0${month}`;\n }\n let day = d.getDate().toString();\n if (day.length < 2) {\n day = `0${day}`;\n }\n return `${d.getFullYear()}-${month}-${day}`;\n}", "function matter_datetime(){\n var dt = curr_date() + ' ' + curr_time() + ' -0400';\n return dt;\n }", "function nowString () {\n const stamp = new Date()\n const h = stamp.getHours().toString().padStart(2, '0')\n const m = stamp.getMinutes().toString().padStart(2, '0')\n const s = stamp.getSeconds().toString().padStart(2, '0')\n const ms = stamp.getMilliseconds().toString().padStart(3, '0')\n return `${h}:${m}:${s}.${ms}`\n}", "function getCurrentDate() {\n\tvar currentDate = new Date();\n\tvar day = currentDate.getDate();\n\tvar month = currentDate.getMonth() + 1;\n\tvar year = currentDate.getFullYear();\n\treturn (month + \"/\" + day + \"/\" + year);\n}", "function getCurrentDateFormatted() {\n var date = new Date();\n var month = date.getMonth() + 1;\n var day = date.getDate();\n var year = date.getFullYear();\n \n var formattedDate = year + \"-\" +\n ((\"\" + month).length < 2 ? \"0\" : \"\") + month + \"-\" +\n ((\"\" + day).length < 2 ? \"0\" : \"\") + day;\n \n return formattedDate;\n}", "function getCurrentDate() {\r\n var time = new Date();\r\n month = time.getMonth();\r\n month = ( month < 10 ) ? '0' + month : month;\r\n day = time.getDate();\r\n day = ( day < 10 ) ? '0' + day : day;\r\n return( month + '/' + day + '/' + time.getYear() );\r\n}", "get currentDate(){\r\n return new Date().toDateString();\r\n }", "function formatCurrentDateTime() {\n // Timestamp from API seems to be GMT, which the JS Date object handles\n var dayName = ['Sunday', 'Monday', 'Tuesday', \n 'Wednesday', 'Thursday', 'Friday', 'Saturday']; \n var localNow = new Date(),\n dayString = dayName[ localNow.getDay() ],\n localTime = localNow.toLocaleTimeString();\n // console.log(\"in formatCurrentDateTime\", dayString, localTime);\n return 'as of ' + dayString + ' ' + localTime;\n}", "function getCurrentDate(){\n let newDate = new Date()\n let date = newDate.getDate();\n let month = newDate.getMonth() + 1;\n let year = newDate.getFullYear();\n return `${year}-${month<10?`0${month}`:`${month}`}-${date<10?`0${date}`:`${date}`}`\n }", "function getCurrentDate(date) {\n\tvar today = date,\n\t\tdd = checkTime(today.getDate()),\n\t\tmm = checkTime(today.getMonth() + 1), // January is 0!\n\t\tyyyy = today.getFullYear();\n\n\treturn dd + '-' + mm + '-' + yyyy;\n}", "function getDateString() {\n var today = new Date();\n var month = monthNames[today.getMonth()];\n var day = getOrdinal(today.getDate());\n var year = today.getFullYear();\n return month + ' ' + day + ', ' + year;\n}", "function getDateString(now)\n{\n const options={year:'numeric',month:'long',day:'numeric'};\n return now.toLocaleDateString('en-Us',options);\n \n}", "function date()\n{\n let dateObj = new Date();\n // current date\n let date = (\"0\" + dateObj.getDate()).slice(-2);\n let month = (\"0\" + (dateObj.getMonth() + 1)).slice(-2);\n let year = dateObj.getFullYear();\n let hours = dateObj.getHours();\n let minutes = dateObj.getMinutes();\n let seconds = dateObj.getSeconds();\n\n return year + \"_\" + month + \"_\" + date + \"_\" + hours + \"_\" + minutes + \"_\" + seconds;\n}", "function getNow() {\n\tnow = new Date();\n\tyyyy = now.getFullYear().toString();\n\tm = now.getMonth() + 1;\n\tmm = m.toString();\n if (mm.length == 1) mm = '0' + mm;\n\tdd = now.getDate().toString();\n\tif (dd.length == 1) dd = '0' + dd;\n\thh = now.getHours().toString();\n\tmn = now.getMinutes().toString();\n\tif (mn.length == 1) mn = '0' + mn;\n\treturn yyyy + mm + dd + \"_\" + hh + \":\" + mn;\n}", "function getCurrentDate(){\n\n var today = new Date();\n var dd = String(today.getDate()).padStart(2, '0');\n var mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!\n var yyyy = today.getFullYear();\n\n return today = mm + '.' + dd + '.' + yyyy;\n //document.write(today);\n}", "function currentDate()\n{\n var currDate = new Date(),\n year = currDate.getFullYear(),\n month = currDate.getMonth()+1,//los meses en javascript empiezan por 0\n day = currDate.getDate();\n if(month <= 9)\n month = '0'+month;\n\n if(day <= 9)\n day = '0'+day;\n var formatDate = day +'-'+ month +'-'+ year; \n return formatDate; \n}", "function CurrentDate(){\n var today = new Date();\n var dd = today.getDate();\n var mm = today.getMonth()+1;\n var yyyy = today.getFullYear();\n if(dd<10){dd='0'+dd}\n if(mm<10){mm='0'+mm}\n today = mm+'/'+dd+'/'+yyyy;\n return today\n }", "function getDateAsString() {\n var currentDate = new Date(); //We use the JavaScript Date object/function and then configure it\n\n var currentMonth;\n var currentDay;\n\n if(currentDate.getMonth() < 10) {\n currentMonth = \"0\" + String(currentDate.getMonth()+1); //0 indexed month, january is 0\n } else {\n currentMonth = String(currentDate.getMonth()+1);\n }\n\n if(currentDate.getDate() < 10) {\n currentDay = \"0\" + String(currentDate.getDate());\n } else {\n currentDay = String(currentDate.getDate());\n }\n\n var date = currentDate.getFullYear() + \".\" + currentMonth + \".\" + currentDay;\n return date; //returns the date string\n}", "function dateFmtStr(today) {\n\n var dd = today.getDate();\n var mm = today.getMonth() + 1; //January is 0!\n var yyyy = today.getFullYear();\n return mm + '/' + dd + '/' + yyyy;\n}", "function getCurrentTime() \n{\n // Compute date time information\n let today = new Date();\n let hour = (today.getHours() < 10) ? '0' + today.getHours() : today.getHours();\n let minute = (today.getMinutes() < 10) ? '0' + today.getMinutes() : today.getMinutes();\n let second = (today.getSeconds() < 10) ? '0' + today.getSeconds() : today.getSeconds();\n let year = today.getFullYear();\n let month = (today.getMonth() < 10) ? '0' + today.getMonth() : today.getMonth();\n let day = (today.getDate() < 10) ? '0' + today.getDate() : today.getDate();\n\n // Format datetime to YYYY-MM-DD_HH:mm:ss\n let time = hour + ':' + minute + ':' + second;\n let date = year + '-' + month + '-' + day;\n\n return date + '_' + time;\n}", "getCurrentDateTime() {\n const today = new Date();\n let dd = today.getDate();\n let mm = today.getMonth() + 1; // January is 0!\n const yyyy = today.getFullYear();\n let hours = today.getHours();\n let minutes = today.getMinutes();\n\n if (dd < 10) {\n dd = `0${dd}`;\n }\n if (mm < 10) {\n mm = `0${mm}`;\n }\n if (hours < 10) {\n hours = `0${hours}`;\n }\n if (minutes < 10) {\n minutes = `0${minutes}`;\n }\n return `${dd}/${mm}/${yyyy}-${hours}:${minutes}`.replace(/\\//g, '').replace(/:/g, '').replace(' ', '');\n }", "function dateNow(){\n var now = new Date();\n var day = now.getDate();\n let month = now.getMonth()+1;\n let year = now.getFullYear();\n return console.log(month+\"/\"+day+\"/\"+year);\n}", "getLogStamp() {\r\n const date = new Date();\r\n return `[${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()} ${this.name}:${this.serial}]`;\r\n }", "function xl_GetDateStr()\n{\n\tvar today = new Date()\n\tvar year = today.getYear()\n\tif(year<1000) year+=1900\n\t\tvar todayStr = GetMonth(today.getMonth()) + \" \" + today.getDate()\n\ttodayStr += \", \" + year\n\treturn todayStr\n}", "function datestamp() {\n\tvar currentDate \t= new Date();\n\treturn currentDate.getFullYear() + \"-\" + completeDateVals(currentDate.getMonth()+1) + \"-\"\n\t + completeDateVals(currentDate.getDate()) + \",\" + completeDateVals(currentDate.getHours())\n\t + \":\" + completeDateVals(currentDate.getMinutes())\n\t + \":\" + completeDateVals(currentDate.getSeconds())\n\t + \":\" + completeDateValsMilliseconds(currentDate.getMilliseconds());\n\t \n}", "function getTodayString() {\n let now = new Date();\n let year = now.getFullYear();\n \n let month = now.getMonth() + 1;\n if (month < 10) {\n month = '0' + month;\n }\n \n let day = now.getDate();\n if (day < 10) {\n day = '0' + day;\n }\n \n return `\\`${year}-${month}-${day}\\``;\n}", "function currentDate() {\n const today = new Date();\n const currDate = today.getDate();\n const currMonth = getMonthName(today.getMonth());\n const currYear = today.getUTCFullYear();\n const suffixArray = [\"st\", \"nd\", \"rd\", \"th\"];\n let suffix = suffixArray[3];\n if (currDate === 1 || currDate === 21 || currDate === 31) {\n suffix = suffixArray[0];\n } else if (currDate === 2 || currDate === 22) {\n suffix = suffixArray[1];\n } else if (currDate === 3 || currDate === 23) {\n suffix = suffixArray[2];\n }\n let date = currDate + suffix + ' of ' + currMonth + ' ' + currYear;\n return date;\n}", "function datestamp() {\n\tvar currentDate \t= new Date();\n\treturn currentDate.getFullYear() + \"-\" + completeDateVals(currentDate.getMonth()+1) + \"-\"\n\t + completeDateVals(currentDate.getDate()) + \",\" + completeDateVals(currentDate.getHours())\n\t + \":\" + completeDateVals(currentDate.getMinutes())\n\t + \":\" + completeDateVals(currentDate.getSeconds())\n\t + \":\" + completeDateValsMilliseconds(currentDate.getMilliseconds());\n\n}", "function getCurrentDate(){\n var today = new Date();\n var dd = today.getDate();\n var mm = today.getMonth()+1; //January is 0!\n var yyyy = today.getFullYear();\n return mm + '/' + dd + '/'+ yyyy;\n\n}", "function prettyDate() {\n var theTimeIsNow = new Date(Date.now());\n var hors = theTimeIsNow.getHours();\n var mens = theTimeIsNow.getMinutes();\n var sex = theTimeIsNow.getSeconds();\n return hors + \":\" + mens + \":\" + sex;\n }", "function formatDate(current_datetime){\n return current_datetime.getDate()+ \"-\" + (current_datetime.getMonth() + 1) + \"-\" + current_datetime.getFullYear()\n }", "function current_date() {\n today = new Date();\n var mmm = today.getMonth();\n var dd = today.getDate();\n var yyyy = today.getFullYear();\n\n if (dd < 10) dd = '0' + dd;\n if (mmm == 0) mmm = 'JAN';\n if (mmm == 1) mmm = 'FEB';\n if (mmm == 2) mmm = 'MAR';\n if (mmm == 3) mmm = 'APR';\n if (mmm == 4) mmm = 'MAY';\n if (mmm == 5) mmm = 'JUN';\n if (mmm == 6) mmm = 'JUL';\n if (mmm == 7) mmm = 'AUG';\n if (mmm == 8) mmm = 'SEP';\n if (mmm == 9) mmm = 'OCT';\n if (mmm == 10) mmm = 'NOV';\n if (mmm == 11) mmm = 'DEC';\n\n return (mmm + '-' + dd + '-' + yyyy)\n\n}", "function currentDate(){\n var d = new Date();\n console.log(d);\n }", "function getCurrentDate()\n{\n var today = new Date();\n var dd = (today.getDate() >= 10) ? today.getDate() : \"0\"+today.getDate();\n var mm = (today.getMonth()+1 >= 10) ? today.getMonth()+1 : \"0\"+(today.getMonth()+1);\n var yyyy = today.getFullYear();\n var date = yyyy+'-'+mm+'-'+dd;\n return date;\n}", "function logDate() {\n var today = new Date();\n\n console.log(\"Todays date is: \" + today.getDate() + \".\" + (today.getMonth()+1) + \".\" + today.getFullYear());\n}", "function getCurrentDateTime() {\n let today = new Date();\n let date = `${today.getMonth() +\n 1}/${today.getDate()}/${today.getFullYear()}`;\n\n return `${date} ${formatAMPM(today)}`;\n}", "function getCurDate(){\r\n var today = new Date();\r\n var dd = today.getDate();\r\n var mm = today.getMonth()+1;\r\n var yyyy = today.getFullYear();\r\n if(dd<10){dd='0'+dd}\r\n if(mm<10){mm='0'+mm} \r\n return dd+'/'+mm+'/'+yyyy;\r\n \r\n}", "function _getDateString() {\n return Utilities.formatDate((new Date()), AdWordsApp.currentAccount().getTimeZone(), \"yyyy-MM-dd\");\n}", "function dateNow() {\n\tconst rightNow = new Date();\n\tconst hour = rightNow.getHours();\n\tconst min = rightNow.getMinutes();\n\tconst seconds = rightNow.getSeconds();\n\tconst res = rightNow.toISOString().slice(0, 10).replace(/-/g, \"/\");\n\treturn `${res} - ${hour % 12}:${min}:${seconds>=10? seconds:\"0\"+seconds} ${hour > 12 ? \"pm\" : \"am\"}`;\n}", "function now() {\n\tvar date = new Date()\n\treturn (date.getFullYear() + '-' + fix(date.getMonth() + 1) +\n\t\t'-' + fix(date.getDate()) + ' ' + fix(date.getHours()) +\n\t\t':' + fix(date.getMinutes()));\n}", "function get_formatted_date(date) {\n function get_formatted_num(num, expected_length) {\n var str = \"\";\n var num_str = num.toString();\n var num_zeros = expected_length - num_str.length;\n for (var i = 0; i < num_zeros; ++i) {\n str += '0';\n }\n str += num_str;\n return str;\n }\n var msg = get_formatted_num(date.getFullYear(), 4) + \"-\";\n msg += get_formatted_num(date.getMonth() + 1, 2) + \"-\";\n msg += get_formatted_num(date.getDate(), 2) + \" \";\n msg += get_formatted_num(date.getHours(), 2) + \":\";\n msg += get_formatted_num(date.getMinutes(), 2) + \":\";\n msg += get_formatted_num(date.getSeconds(), 2);\n return msg;\n}", "function getCurrentDate(){\r\n\tvar curDate = new Date();\t// Used to gather the current date on the user's system\r\n\tvar formatDate = \"\";\t// Will store the properly formatted date\r\n\t\r\n\t// This switch statement will take the number representing the day of the week,\r\n\t// and turn it into the appropriate String.\r\n\tswitch(curDate.getDay()){\r\n\t\tcase 0: formatDate += \"Sunday\";\r\n\t\t\t\t\t\tbreak;\r\n\t\tcase 1: formatDate += \"Monday\";\r\n\t\t\t\t\t\tbreak;\r\n\t\tcase 2: formatDate += \"Tuesday\";\r\n\t\t\t\t\t\tbreak;\r\n\t\tcase 3: formatDate += \"Wednesday\";\r\n\t\t\t\t\t\tbreak;\r\n\t\tcase 4: formatDate += \"Thursday\";\r\n\t\t\t\t\t\tbreak;\r\n\t\tcase 5: formatDate += \"Friday\";\r\n\t\t\t\t\t\tbreak;\r\n\t\tcase 6: formatDate += \"Saturday\";\r\n\t\t\t\t\t\tbreak;\r\n\t}\r\n\r\n\tformatDate += \", \";\r\n\t\r\n\t// This switch statement will take the number representing the month and turn\r\n\t// it into the appropriate String.\r\n\tswitch(curDate.getMonth()){\r\n\t\tcase 0: formatDate += \"January\";\r\n\t\t\t\t\t\tbreak;\r\n\t\tcase 1: formatDate += \"February\";\r\n\t\t\t\t\t\tbreak;\r\n\t\tcase 2: formatDate += \"March\";\r\n\t\t\t\t\t\tbreak;\r\n\t\tcase 3: formatDate += \"April\";\r\n\t\t\t\t\t\tbreak;\r\n\t\tcase 4: formatDate += \"May\";\r\n\t\t\t\t\t\tbreak;\r\n\t\tcase 5: formatDate += \"June\";\r\n\t\t\t\t\t\tbreak;\r\n\t\tcase 6: formatDate += \"July\";\r\n\t\t\t\t\t\tbreak;\r\n\t\tcase 7: formatDate += \"August\";\r\n\t\t\t\t\t\tbreak;\r\n\t\tcase 8: formatDate += \"September\";\r\n\t\t\t\t\t\tbreak;\r\n\t\tcase 9: formatDate += \"October\";\r\n\t\t\t\t\t\tbreak;\r\n\t\tcase 10: formatDate += \"November\";\r\n\t\t\t\t\t\tbreak;\r\n\t\tcase 11: formatDate += \"December\";\r\n\t\t\t\t\t\tbreak;\r\n\t}\r\n\r\n\tformatDate += \" \";\r\n\t\r\n\t// The remainder of the date will now be added to the String\r\n\tformatDate += curDate.getDate() + \", \";\r\n\tformatDate += curDate.getFullYear();\r\n\treturn formatDate;\r\n}", "function currentDate() {\n var today = new Date();\n var dd = today.getDate();\n var mm = today.getMonth() + 1; //January is 0!\n var yyyy = today.getFullYear();\n\n if (dd < 10) {\n dd = '0' + dd;\n }\n\n if (mm < 10) {\n mm = '0' + mm;\n }\n\n today = yyyy + '-' + mm + '-' + dd;\n return today;\n}", "function getCurrentDate() {\n\tvar d = new Date();\n\tvar year = d.getFullYear();\n\tvar month = (\"0\" + (d.getMonth() + 1)).slice(-2);\n\tvar day = (\"0\" + d.getDate()).slice(-2);\n\tvar theDate = year + month + day;\n\treturn theDate;\n}", "function getCurrentDateInSqlFormat()\r\n{\r\n var date = new Date();\r\n var day = date.getDate();\r\n var monthIndex = date.getMonth();\r\n var year = date.getFullYear();\r\n var hours = date.getHours();\r\n var mins = date.getMinutes();\r\n var sec = date.getSeconds();\r\n \r\n \r\n return day + \"-\" + (monthIndex + 1) + \"-\" + year + \" \" + hours + \":\" + mins + \":\" + sec;\r\n\r\n}", "function currentDate() {\n const now = new Date();\n const year = now.getFullYear(); // return year\n const mnth = months[now.getMonth()]; // return month(0 - 11) //here now.getMonth() gives you the current date in number as incex for the month\n const date = now.getDate(); // return date (1 - 31)\n const hours = now.getHours(); // return number (0 - 23)\n const minutes = (now.getMinutes() < 10 ? \"0\" : \"\") + now.getMinutes(); // return number (0 -59)\n\n const time = `${mnth} ${date}, ${year} ${hours}:${minutes}`;\n return time;\n}", "function getNow(){\n\tvar mydate = new Date()\n\treturn mydate.getFullYear() +'-'+ (mydate.getMonth()+1) +'-'+ mydate.getDay() +' '+mydate.getHours()+':'+mydate.getMinutes()+':'+mydate.getSeconds()\n}", "function getDate()\n\t\t\t{\n\t\t\t\tvar date = new Date();\n\t\t\t\treturn date.toDateString();\n\t\t\t}", "function getDate() {\n document.write((new Date()).toDateString());\n}", "function createDateString(currentdate)\n{\n var currentDay = checkDate(currentdate.getDate());\n var currentMonth = checkDate(currentdate.getMonth()+1);\n var currentYear = checkDate(currentdate.getFullYear());\n var currentHour = checkDate(currentdate.getHours());\n var currentMinutes = checkDate(currentdate.getMinutes()); \n var currentSecond = checkDate(currentdate.getSeconds()); \n\n var currentDateTime = currentDay + \"/\"\n + currentMonth + \"/\" \n + currentYear + \" ( \" \n + currentHour + \":\" \n + currentMinutes + \":\" \n + currentSecond + \" ) \" ;\n return currentDateTime;\n}", "function getCurrentTimeString() {\n const date = new Date();\n return date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds();\n}", "function currentDate(){\n let today = new Date();\n const dd = String(today.getDate()).padStart(2, '0');\n const mm = String(today.getMonth() + 1).padStart(2, '0'); //Acrescenta um pois janeiro é 0\n const yyyy = today.getFullYear();\n\n today = yyyy + '-' + mm + '-' + dd;\n\n return today;\n}", "function _getDateString() {\n var myDate = new Date();\n // forward compatability with ES5 Shims\n if (typeof myDate.getFullYear !== \"function\") {\n myDate.getFullYear = function() {\n return (myDate.getYear + 1900); // offset from year 1900\n };\n }\n\n var myYear = myDate.getFullYear().toString();\n var myMonth = _zeroPad(myDate.getMonth() + 1, 2); // counts from 0\n var myDay = _zeroPad(myDate.getDate(), 2);\n var myHours = _zeroPad(myDate.getHours(), 2);\n var myMinutes = _zeroPad(myDate.getMinutes(), 2);\n var mySeconds = _zeroPad(myDate.getSeconds(), 2);\n\n return myYear + \n \"-\" + myMonth + \n \"-\" + myDay + \n \"T\" + myHours + \n ':' + myMinutes + \n ':' + mySeconds +\n '.' + (myDate.getMilliseconds() / 1000).toFixed(3).slice(2, 5);\n }", "function logStart() {\n return (new Date(Date.now())).toLocaleTimeString() + \" MMM-Nightscout: \";\n}", "function getTodayString() {\n var d = new Date();\n var month = '' + (d.getMonth() + 1);\n var day = '' + d.getDate();\n var year = d.getFullYear();\n\n if (month.length < 2) {month = '0' + month};\n if (day.length < 2) {day = '0' + day};\n\n return([year, month, day].join('-'));\n}", "function current_date(){\n\tvar fullDate = new Date();\n\t//convert month to 2 digits\n\tvar twoDigitMonth = ((fullDate.getMonth().length+1) === 1)? (fullDate.getMonth()+1) :(fullDate.getMonth()+1);\n\tvar currentDate = fullDate.getFullYear() + \"-\" + twoDigitMonth + \"-\" + fullDate.getDate()+\" \"+fullDate.getHours()+':'+fullDate.getMinutes()+':'+fullDate.getSeconds();\n\treturn currentDate;\n}", "function getDateInFormat() {\n var today = new Date();\n var dd = today.getDate();\n\n var mm = today.getMonth() + 1;\n var yyyy = today.getFullYear();\n if (dd < 10) {\n dd = '0' + dd;\n }\n if (mm < 10) {\n mm = '0' + mm;\n }\n return today = mm + '/' + dd + '/' + yyyy;\n}", "function getTodayDate() {\n const today = new Date();\n let dd = today.getDate();\n let mm = today.getMonth() + 1; // January is 0!\n\n const yyyy = today.getFullYear();\n if (dd < 10) {\n dd = `0${dd}`;\n }\n if (mm < 10) {\n mm = `0${mm}`;\n }\n const stringDate = `${dd}/${mm}/${yyyy}`;\n return stringDate;\n }", "function currentDateTime(){\n let date_ob = new Date();\n // current date\n // adjust 0 before single digit date\n let day = (\"0\" + date_ob.getDate()).slice(-2);\n // current month\n let month = (\"0\" + (date_ob.getMonth() + 1)).slice(-2);\n // current year\n let year = date_ob.getFullYear();\n // current hours\n let hours = date_ob.getHours();\n // current minutes\n let minutes = date_ob.getMinutes();\n // current seconds\n let seconds = date_ob.getSeconds();\n return year+'-'+month+'-'+day+'T'+hours+\":\"+minutes+\":\"+seconds+\"Z\";\n }", "function getCurrentDate( date ){\n return datetime = date.getDate() + \"/\" + (date.getMonth() + 1) + \"/\" + date.getFullYear() + ' at ' + date.getHours() + ':' + date.getMinutes();\n}", "function getDate(){\n let currentdate = new Date(); \n return currentdate.getDate() + \"/\"\n + (currentdate.getMonth()+1) + \"/\" \n + currentdate.getFullYear() + \" @ \" \n + currentdate.getHours() + \":\" \n + currentdate.getMinutes() + \":\" \n + currentdate.getSeconds();\n}", "function getDateFormat(){\n let d = new Date()\n return `${d.getDate()}/${d.getMonth()}/${d.getFullYear()} - ${d.getHours()}:${d.getMinutes()}:${d.getSeconds()}`\n}", "function sc_currentDate() {\n return new Date();\n}", "function getTodayDate () {\n const today = new Date();\n\n const dd = String(today.getDate()).padStart(2, '0');\n const mm = String(today.getMonth() + 1).padStart(2, '0'); \n const yyyy = today.getFullYear();\n\n const hrs = today.getHours();\n const min = today.getMinutes();\n\n const todayDate = dd + '/' + mm + '/' + yyyy;\n const todayTime = hrs + ':' + min;\n\n return `${todayDate}, ${todayTime}`;\n}", "todayDateString () {\n return todayDateString\n }", "function getCurrentTime(){\r\n var today = new Date();\r\n var dd = formatToTwoDigit(today.getDate());\r\n var mm = formatToTwoDigit(today.getMonth()+1); \r\n var yyyy = today.getFullYear();\r\n var hour = formatToTwoDigit(today.getHours());\r\n var minute = formatToTwoDigit(today.getMinutes());\r\n\r\n if(configuration[\"dateMode\"] == 0){\r\n return dd+\"-\"+mm+\"-\"+yyyy+\" \"+hour+\":\"+minute;\r\n }\r\n else if(configuration[\"dateMode\"] == 1){\r\n return mm+\"-\"+dd+\"-\"+yyyy+\" \"+hour+\":\"+minute;\r\n }\r\n else if(configuration[\"dateMode\"] == 2){\r\n return yyyy+\"-\"+mm+\"-\"+dd+\" \"+hour+\":\"+minute;\r\n }\r\n else{\r\n return yyyy+\"-\"+mm+\"-\"+dd+\" \"+hour+\":\"+minute; //if dateMode?? // 0:dd/mm/yyyy 1:mm/dd/yyyy 2:yyyy/mm/dd\r\n }\r\n}", "function getFormatedDateNow(){\n var d = new Date();\n\n var str = \"day/month/year hour:minute:second\"\n .replace('day', d.getDate() <10? '0'+ d.getDate() : d.getDate())\n .replace('month', (d.getMonth() + 1) <10? '0' + (d.getMonth()+1) : (d.getMonth()+1))\n .replace('year', d.getFullYear())\n .replace('hour', d.getHours() <10? '0'+ d.getHours() : d.getHours() )\n .replace('minute', d.getMinutes() <10? '0'+ d.getMinutes() : d.getMinutes())\n .replace('second', d.getSeconds() <10? '0'+ d.getSeconds() : d.getSeconds());\n console.log(str);\n return str;\n}", "getFormattedDate(date) {\n const year = date.getFullYear();\n const month = (date.getUTCMonth() + 1).toString().padStart(2, '0');\n const day = (date.getUTCDate()).toString().padStart(2, '0');\n // Logger.log(`Day: ${day}, Month: ${month}, Year:${year}`)\n const dateFormatted = `${year}-${month}-${day}`;\n return dateFormatted;\n }", "function datestring () {\n var d = new Date(Date.now() - 5*60*60*1000); //est timezone\n return d.getUTCFullYear() + '-'\n + (d.getUTCMonth() + 1) + '-'\n + d.getDate();\n}", "function datestring () {\n var d = new Date(Date.now() - 5*60*60*1000); //est timezone\n return d.getUTCFullYear() + '-'\n + (d.getUTCMonth() + 1) + '-'\n + d.getDate();\n}", "function currentDate() {\n var today = new Date();\n var dd = today.getDate();\n var mm = today.getMonth() + 1; //January is 0!\n var yyyy = today.getFullYear();\n\n if (dd < 10) {\n dd = '0' + dd;\n }\n\n if (mm < 10) {\n mm = '0' + mm;\n }\n\n today = yyyy + '-' + mm + '-' + dd;\n return today;\n}", "function getCurrentTime(){\n var today = new Date();\n var dd = formatToTwoDigit(today.getDate());\n var mm = formatToTwoDigit(today.getMonth()+1); \n var yyyy = today.getFullYear();\n var hour = formatToTwoDigit(today.getHours());\n var minute = formatToTwoDigit(today.getMinutes());\n return yyyy+\"-\"+mm+\"-\"+dd+\" \"+hour+\":\"+minute;\n}", "function get_timestr() { \n\tvar d = new Date();\n\treturn d.toLocaleString() + \"<br />\\n\";\n}", "function getNow(){\n var date = new Date(); \n var day = date.getDate();\n var month = date.getMonth()+1;\n var year = date.getFullYear();\n var hours = date.getHours();\n var minutes = date.getMinutes();\n var seconds = date.getSeconds();\n \n if (day < 10) {\n day = \"0\" + day;\n }\n \n if (month < 10) {\n month = \"0\" + month;\n }\n \n if (hours < 10) {\n hours = \"0\" + hours;\n }\n \n if (minutes < 10) {\n minutes = \"0\" + minutes;\n }\n\n if (seconds < 10) {\n seconds = \"0\" + seconds;\n } \n \n return year + \"-\" + month + \"-\" + day + \" \" + hours + \"-\" + minutes + \"-\" + seconds;\n ;\n return datetime;\n}", "function getCurrentTime(){\n\t//get timestamp and format it\n\t\tvar date = new Date();\n\t\tvar hours = date.getHours()\n\t\tvar ampm = (hours >= 12) ? \"PM\" : \"AM\";\n\t\thours = hours% 12||12;\n\t\tvar minutes =date.getMinutes();\n\t\tminutes = (minutes <10) ? \"0\" + minutes:minutes;\n\t\treturn \"(\" + hours + \":\" + minutes + ampm + \")\";\n}", "dateFormate() {\n let today = new Date('dd/MM/yyyy');\n console.log(today);\n today.toLocaleDateString(\"en-US\");\n }", "function now() {\n function i0(num) {\n return ((\"\" + num).length == 1 ? \"0\" + num : \"\" + num)\n }\n\n var hoje = new Date();\n return i0(hoje.getDate()) + \"/\" + i0(hoje.getMonth() + 1) + \"/\" + hoje.getFullYear();\n}", "function now(){\r\n const date = new Date()\r\n const hour = date.getHours()\r\n const minute = date.getMinutes()\r\n const day = date.getUTCDate()\r\n const month = date.getMonth()\r\n const year = date.getFullYear()\r\n return year + \"-\" + month + \"-\" + day + \" \" + hour + \":\" + minute + \":\" + date.getSeconds()\r\n}", "function getDateString() {\n var d = new Date();\n return d.getDate() + \" \" + months[d.getMonth()] + \" \" + (d.getYear() + 1900);\n}", "function getNowFormatDate() {\n var date = new Date();\n var seperator1 = \"-\";\n var year = date.getFullYear();\n var month = date.getMonth() + 1;\n var strDate = date.getDate();\n if (month >= 1 && month <= 9) {\n month = \"0\" + month;\n }\n if (strDate >= 0 && strDate <= 9) {\n strDate = \"0\" + strDate;\n }\n var currentdate = year + seperator1 + month + seperator1 + strDate;\n return currentdate;\n}", "function nowDate() {\n var now = new Date(),\n anio = now.getFullYear(),\n mes = now.getMonth() < 9 ? \"0\" + (now.getMonth() + 1) : now.getMonth() + 1,\n dia = now.getDate() <= 9 ? \"0\" + now.getDate() : now.getDate();\n return anio + \"-\" + mes + \"-\" + dia;\n}", "function datenow(){\n\n var today = new Date();\n var date = today.getFullYear()+'-'+((\"0\" + (today.getMonth() + 1)).slice(-2))+'-'+today.getDate();\n\n return date;\n\n }" ]
[ "0.8167107", "0.81571275", "0.7892863", "0.7817666", "0.7658069", "0.75566417", "0.7548325", "0.7542989", "0.752024", "0.7511584", "0.7461424", "0.74475205", "0.7443938", "0.74351466", "0.74282503", "0.74241674", "0.73647475", "0.73635495", "0.73525167", "0.73227614", "0.73221326", "0.7319704", "0.72972107", "0.7277053", "0.72574353", "0.7250085", "0.72482383", "0.7238517", "0.72232985", "0.7214172", "0.7213071", "0.7212479", "0.72085756", "0.7192553", "0.7171367", "0.7169683", "0.7165757", "0.71636844", "0.7146803", "0.71459097", "0.7141324", "0.7127884", "0.7127504", "0.7126253", "0.71184987", "0.71093124", "0.70685655", "0.7066808", "0.7063321", "0.70553493", "0.70487577", "0.7047379", "0.70418936", "0.70374054", "0.70242125", "0.7016445", "0.70108604", "0.7008443", "0.7006468", "0.7005699", "0.7003476", "0.70001376", "0.69948524", "0.6994796", "0.69892275", "0.6985649", "0.698369", "0.6979934", "0.69725084", "0.6972257", "0.6967759", "0.6965632", "0.69636863", "0.696102", "0.6943072", "0.69423467", "0.69375163", "0.69345903", "0.69328344", "0.6923881", "0.6919803", "0.691654", "0.69087195", "0.6906326", "0.69057506", "0.6905316", "0.68977314", "0.68977314", "0.6897448", "0.689413", "0.68849576", "0.68806654", "0.68777275", "0.68690616", "0.68690324", "0.68529", "0.68378705", "0.68313617", "0.68300617", "0.68280566" ]
0.7319823
21
Function with default value for parameters
function displayStars2(nr = 4) { var line = ""; for (var i = 0; i < nr; i++) { line += "*"; console.log(line); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function default_val(arg, val) {\n\treturn typeof arg === \"undefined\" ? val : arg;\n} // default_val()", "function defaultValue(a,b,c=10)\n{\n console.log(a+\" \"+b+\" \"+c);\n}", "function defaultParams(a, b, c = 0) {\n console.log(a, b, c);\n}", "function functionName(param = value) {\n //codes\n}", "function a(param=0) {\n return param;\n}", "function foo(param = 'no') {\n return 'yes';\n}", "function argumentOrDefault(key){var args=customizations; return args[key]===undefined ? _defaultParams2.default[key] : args[key];}", "function argFunction(value = 'test') {\n console.log(value)\n}", "function sum_one(a, b=5){\n return a+b;\n}", "function defaultValue(v) { }", "function defaulted(value,defaultValue){return value!==undefined?value:defaultValue;}", "function print(firstParameter = 5) {\n console.log(firstParameter);\n}", "function defaultParams6(name = 'Zonayed Ahmed', age = 21) {\n console.log('My name is ' + name + ' and I am ' + age + ' years old!');\n}", "function soSomething (x, y=4){\n console.log(x,y);\n}", "function quux (foo = 'FOO') {\n\n}", "function defaultParams() {\n console.log(es5Function());\n console.log(es5Function(5));\n console.log(es5Function(1, 2));\n console.log(\"-------------\");\n console.log(es6Function());\n console.log(es6Function(5));\n console.log(es6Function(1, 2));\n console.log(\"-------------\");\n console.log(es6Function2());\n console.log(es6Function2(5));\n console.log(es6Function2(1, 2));\n console.log(\"-------------\");\n console.log(es6Function3());\n console.log(es6Function3(5));\n console.log(es6Function3(1, 2));\n console.log(es6Function3(undefined, 2));\n}", "function myFn( callback = _=>console.log(\"This is Default Value Function\") ){\n\tvar msg = \"Hello World\";\n\tcallback(msg);\n}", "function _defaultArg(name, _default) {\n return isUndefined(name) ? _default : name;\n}", "function foo( { a = 10, b = 20 } = {} ) {\n console.log( `[defaults for function arguments] a = ${a}, b = ${b}` );\n}", "function newFunction (name,age,country){\n var name =name || 'Naty';\n var age = age || 32;\n var country = country || 'MX';\n console.log(name, age, country);\n}", "function argumentOrDefault(key) {\n\t var args = customizations;\n\t return args[key] === undefined ? _defaultParams2['default'][key] : args[key];\n\t }", "function DefaultReturnValue() {}", "function newFunction(name,age,country){\n var name= name || 'jared';\n var age= age||32;\n var country = country||'Mexico';\n console.log(name,age,country);\n}", "function default_missing_values(default_val)\n{\n\treturn default_val;\n}", "function newFunc(name, age) {\n var name = name || 'oscar'\n var age = age || 32\n console.log(name, age)\n}", "function foo(a, b = 2) {\n // foo() => a = undefined, b = 2\n // foo(1) => a = 1, b = 2\n // foo(1, \"truc\") => a = 1, b = \"truc\"\n}", "function test(a, b=3, c=42)\r\n{\r\n\treturn a+b+c;\r\n}", "function defaults(a,b,c){if(a!=null){return a;}if(b!=null){return b;}return c;}", "function defaults(a,b,c){if(a!=null){return a;}if(b!=null){return b;}return c;}", "function defaults(a,b,c){if(a!=null){return a;}if(b!=null){return b;}return c;}", "function add1(a, b = 5) {\n // here we set a default value for the argument (b = 5)\n return a + b;\n}", "function hello(data = 1) {\n\n console.log('hey ' + data)\n}", "function newFunction(name, age, country) {\n var name = name || 'Eduardo';\n var age = age || 27;\n var country = country || 'MX';\n console.log(name, age, country)\n}", "function argumentOrDefault(key) {\r\n var args = customizations;\r\n return args[key] === undefined ? _defaultParams2['default'][key] : args[key];\r\n }", "function def(arg, val) { return (typeof arg !== 'undefined') ? arg : val; }", "function myOtherFunction (first_argument = second_argument, second_argument) {}", "function helloWorldWithDefaultParam( name = \"student\" ) {\n return `Hello, ${name}!`;\n}", "function person(name='John Doe', age=99) {\n console.log(name+' '+age)\n}", "function newFunction(name, age, country) {\n var name = name || 'oscar';\n var age = age || 32;\n var country = country || 'MX';\n console.log(name, age, country);\n}", "function setDefaults(fn) {\r\n var defaults = slice(arguments, 1);\r\n return function() {\r\n var args = slice(arguments), i = args.length;\r\n for (args = args.concat(slice(defaults, i)); i--;) {\r\n if (args[i] === undefined) {\r\n args[i] = defaults[i];\r\n }\r\n }\r\n return fn.apply(this, args);\r\n };\r\n }", "function argumentOrDefault(key) {\n var args = customizations;\n return args[key] === undefined ? _defaultParams2['default'][key] : args[key];\n }", "function argumentOrDefault(key) {\n var args = customizations;\n return args[key] === undefined ? _defaultParams2['default'][key] : args[key];\n }", "function argumentOrDefault(key) {\n var args = customizations;\n return args[key] === undefined ? _defaultParams2['default'][key] : args[key];\n }", "function argumentOrDefault(key) {\n var args = customizations;\n return args[key] === undefined ? _defaultParams2['default'][key] : args[key];\n }", "function oneArgWithDefaut (x = 'default') {\n console.log(`x: ${x}`)\n}", "function fn(a = 42, b = a) {\n return b;\n}", "function myFunction(x, y = 10) {\n // y is 10 if not passed or undefined\n return x + y;\n }", "function newFunction(name, age, country) {\n var name = name || 'Manases';\n var age = age || 20;\n var country = country || 'El Salvador';\n\n console.log(name, age, country);\n}", "function addDefaultParams(num1, num2) {\n if (num2 === void 0) { num2 = 10; }\n if (num2)\n return num1 + num2;\n else\n return num1;\n}", "function defualtVlaue(x = 0) {\r\n return x;\r\n}", "function defaultParameters(cat1 = 'kitty', cat2 = 'guru', cat3 = 'mofu') {\n console.log(`my cat names are ${cat1} and ${cat2} and ${cat3} `)\n\n}", "function defaultValue(x, y = 12) {\n // y is 12 if not passed (or passed as undefined)\n return x + y;\n}", "function assignParameterValue(argument, defaultValue){\n\t\t\treturn typeof argument !== 'undefined' ? argument : defaultValue;\n\t\t}", "function assignParameterValue(argument, defaultValue){\n\t\t\treturn typeof argument !== 'undefined' ? argument : defaultValue;\n\t\t}", "function newFunction(name, age, country) {\n\tvar name = name || 'Armando';\n\tvar age = age || 22;\n\tvar country = country || 'MX';\n\tconsole.log(name, age, country); \n}", "function twoArgsWithDefault (x, y = 'default') {\n console.log(`x: ${x}, y: ${y}`)\n}", "function add(a=10 , b = 20 ){\r\n\treturn a+b;\r\n}", "function fn(arg1, arg2, arg3 = 0) {\n return arg1 + arg2 + arg3;\n}", "function newFunction2(name = 'oscar', age = 32, country = \"MX\") {\n console.log(name, age, country);\n}", "function getDefaultVal(defaultVal, data) {\n\treturn $isFunction(defaultVal)\n\t\t? defaultVal.call(data)\n\t\t: defaultVal;\n}", "function exampleDef(a = 5, b = 10, c = 15) {\r\n console.log(`a=${a}, b=${b}, c=${c}`);\r\n}", "function welcome( yourName = \"John Doe\"){\n return yourName;\n}", "function test(name, age) {\n if (!name)\n name = \"defaultname\"\n if (!age)\n age = 26\n //logic\n}", "function foo({first=10, second=true} = {}) {\n\n}", "function optional(a = 1, b = 1) {\n console.log(\"a+b\", a + b)\n}", "function changeDefaultValues(parameters) {\n\tif (parameters[\"id\"] != undefined) {\n\t\tID = parameters[\"id\"];\n\t};\n\n\tif (parameters[\"amt\"] != undefined) {\n\t\tinitialValue = parameters[\"amt\"];\n\t\tuserCurrentValue = initialValue;\n\t\tmarketCurrentValue = initialValue;\n\t};\n\n\tif (parameters[\"years\"] != undefined) {\n\t\tyears = parameters[\"years\"];\n\t};\n\n\tif (parameters[\"speed\"] != undefined) {\n\t\tspeed = parameters[\"speed\"];\n\t};\n\n\tif (parameters[\"inv\"] != undefined) {\n\t\tinMarketDefault = Boolean(Number(parameters[\"inv\"]));\n\t\tinMarketCurrent = inMarketDefault;\n\t};\n}", "function f (x, y=2, z = 3) {\n console.log(x,y,z); //1 2 3\n return x + y + z;\n}", "function helloSomeone(name = \"Frankie\"){\r\n console.log(\"Hello\" + name)\r\n}", "function newFunction2(name = 'oscar', age = 23, country = 'colombia') {\n console.log(name, age, country);\n}", "function defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n return c;\n }", "function defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n return c;\n }", "function defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n return c;\n }", "function defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n return c;\n }", "function defaultValue(test,defaultValue) {\r\n\treturn (typeof test !== 'undefined' ? test : defaultValue);\r\n}", "function newFunction2(name = 'oscar', age = '32', country = 'CO' ){\n console.log(name, age, country);\n}", "function soma(a,b = 30) {\n console.log(a+b);\n}", "function defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n return c;\n }", "function sum(a, b = 1) {\n return a + b;\n}", "function greetSomeone(name = \"Guest\") {\n console.log(\"Good morning, \" + name)\n}", "function assignDefaultValue(value, defaultValue) {\n if (checkForParameter(value)) return value;\n return defaultValue;\n }", "function sayHello(name = \"stranger\") {\n return \"hello \" + name;\n}", "function functionName([a, b, c=3]) {\n console.log(a, b, c);\n}", "function defaults$1(a, b, c) {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n return c;\n}", "function foo() {\n var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'www.wikipedia.com';\n var message = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'Welcome to wikipedia';\n console.log(\"Argument with Default Parameter Url =\" + url);\n console.log(\"Argument with Default Parameter message =\" + message);\n}", "function defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n return c;\n }", "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }" ]
[ "0.75550795", "0.7539978", "0.7457728", "0.7411537", "0.72163695", "0.7205764", "0.71646106", "0.7074297", "0.70729846", "0.70634437", "0.7047585", "0.704401", "0.70314825", "0.69784015", "0.69525", "0.69519174", "0.6938717", "0.6935913", "0.69104004", "0.6879523", "0.6868612", "0.68616235", "0.68431145", "0.6820402", "0.6805756", "0.68030053", "0.67821825", "0.6767278", "0.6767278", "0.6767278", "0.6766575", "0.6763869", "0.675961", "0.67554456", "0.6751793", "0.6747695", "0.6745548", "0.6741187", "0.67410916", "0.6735765", "0.6727091", "0.6727091", "0.6727091", "0.6727091", "0.67227364", "0.6719826", "0.6716035", "0.67089224", "0.6689468", "0.6681895", "0.6671751", "0.666511", "0.66417724", "0.66417724", "0.6593647", "0.6583268", "0.65741485", "0.6568881", "0.65632546", "0.65545994", "0.6553076", "0.6537408", "0.65319073", "0.6509172", "0.6508173", "0.65057915", "0.64914995", "0.64904016", "0.6487322", "0.647171", "0.647171", "0.647171", "0.647171", "0.64698535", "0.6469677", "0.64498", "0.6439907", "0.6430912", "0.6425864", "0.6421093", "0.64184374", "0.6417418", "0.6408214", "0.63959026", "0.63890624", "0.6383765", "0.6383765", "0.6383765", "0.6383765", "0.6383765", "0.6383765", "0.6383765", "0.6383765", "0.6383765", "0.6383765", "0.6383765", "0.6383765", "0.6383765", "0.6383765", "0.6383765", "0.6383765" ]
0.0
-1
Am modificat si caracterul
function displayStars3(nr = 4, char = "*") { // se respecta ordinea parametrilor si trebuie definite toate valorie chiar daca nu se schimba var line = ""; for (var i = 0; i < nr; i++) { line += char; console.log(line); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "atualizaNome() //controler\r\n {\r\n this._elemento.textContent = `[${this._idade}] ${this._nome}`;\r\n }", "replacerChangNiveau(){\n this.viderLaFile();\n this.cellule = this.jeu.labyrinthe.cellule(0,0);\n this.direction = 1;\n\t\t\t\tthis.vitesse = 0;\n }", "function letras(campo){\n campo.value=campo.value.toUpperCase();\n }", "function KarModification(field, CUni)\r\n{\r\n\tif (LC_KAR == LCUNI || IsBanglaHalant(LCUNI) || CUni==\"্র\" || CUni==\"্য\")\r\n\t{\r\n\t\tvar len = LC_STRING.length;\r\n\t\tLC_STRING = LC_STRING + CUni;\r\n\t\tRemoveNInsert(field, LC_STRING + LC_KAR,len+LC_KAR.length);\r\n\t}\r\n\telse if(CUni==\"র্\")\r\n\t{\r\n\t\tvar len = LC_STRING.length;\r\n\t\tLC_STRING = CUni + LC_STRING;\r\n\t\tRemoveNInsert(field, LC_STRING + LC_KAR,len+LC_KAR.length);\r\n\t}\r\n\telse if(IsBanglaHalant(CUni))\r\n\t{\r\n\t\tLC_STRING = LC_STRING + CUni;\r\n\t\tInsert(field, CUni);\r\n\t}\r\n\telse\r\n\t{\r\n\t\tInsert(field, CUni);\r\n\t\tResetKarModifier();\r\n\t}\r\n}", "function deleteCharacter() {\n setMatricula(matricula.slice(0, -1));\n setMatriculaLogada(matricula.slice(0, -1));\n if (matricula.length <= 1) {\n setInputVisible(false);\n setAluno({ auth: \"\", access: false, name: \"\" });\n }\n }", "separarCaracteres(){\r\n let cadena = this.objetoExpresion();\r\n for(let i = 0; i <= cadena.length-1; i++){\r\n this._operacion.addObjeto(new Dato(cadena.charAt(i)));\r\n }\r\n //Hace el arbol mediante la lista ya hecha \r\n this._operacion.armarArbol();\r\n //Imprime el orden normal \r\n this.printInfoInOrder();\r\n }", "function majusculeNom() {\n let nom = elementNom.value;\n nom = nom.toUpperCase();\n elementNom.value = nom;\n}", "set nombre(nom){\n this._nombres = nom;\n }", "function User_Update_Types_d_attribut_Liste_des_types_d_attribut_de_personne0(Compo_Maitre)\n{\n var Table=\"typeattribut\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var ta_nom=GetValAt(30);\n if (!ValiderChampsObligatoire(Table,\"ta_nom\",TAB_GLOBAL_COMPO[30],ta_nom,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ta_nom\",TAB_GLOBAL_COMPO[30],ta_nom))\n \treturn -1;\n var Req=\"update \"+Table+\" set \";\n Req+=\"ta_nom=\"+(ta_nom==\"\" ? \"null\" : \"'\"+ValiderChaine(ta_nom)+\"'\" )+\"\";\n Req+=\" where \"+NomCleMaitre+\"=\"+CleMaitre;\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de la mise à jour\");\nreturn CleMaitre;\n\n}", "function OAndOuKarModification(field, CH1, CH2)\r\n{\r\n\tif (document.selection) \r\n\t{\r\n\t\tfield.focus();\r\n\t\tsel = document.selection.createRange();\r\n\t\tif (field.value.length >= 1)\r\n\t\t\tsel.moveStart('character', -1); \r\n\t\tif(sel.text.charAt(0) == 'ে')\r\n\t\t\tsel.text = CH1;\r\n\t\telse\r\n\t\t\tsel.text = sel.text.charAt(0) + CH2;\r\n\t\tsel.collapse(true);\r\n\t\tsel.select();\r\n\t}\r\n\telse if (field.selectionStart || field.selectionStart == 0)\r\n\t{\r\n\t\tvar startPos = field.selectionStart-1;\r\n\t\tvar endPos = field.selectionEnd;\r\n\t\tvar scrollTop = field.scrollTop;\r\n\t\tvar CH;\r\n\t\tstartPos = (startPos == -1 ? field.value.length : startPos );\r\n\t\tif(field.value.substring(startPos, startPos+1) == \"ে\")\r\n\t\t\tCH = CH1;\r\n\t\telse\r\n\t\t{\r\n\t\t\tstartPos=startPos+1;\r\n\t\t\tCH = CH2;\r\n\t\t}\r\n\t\tfield.value = field.value.substring(0, startPos)\r\n\t\t\t+ CH\r\n\t\t\t+ field.value.substring(endPos, field.value.length);\r\n\t\tfield.focus();\r\n\t\tfield.selectionStart = startPos + CH.length;\r\n\t\tfield.selectionEnd = startPos + CH.length;\r\n\t\tfield.scrollTop = scrollTop;\r\n\t}\r\n\r\n}", "senseAccent(){ // SI EL MÈTODE NO PASSA ALGUN VALOR, SE LI POSSA this. MÉS EL ATRIBUT CORRESPONENT.\n \n this._entrada = this._entrada.replace(/[aàáAÀÁ]/gi, 'A');\n this._entrada = this._entrada.replace(/[eèéEÈÉ]/gi, 'E');\n this._entrada = this._entrada.replace(/[iìíIÌÍ]/gi, 'I');\n this._entrada = this._entrada.replace(/[oòóOÒÓ]/gi, 'O');\n this._entrada = this._entrada.replace(/[uùúUÙÚ]/gi, 'U');\n\n this._clau = this._clau.replace(/[aàáAÀÁ]/gi, 'A');\n this._clau = this._clau.replace(/[eèéEÈÉ]/gi, 'E');\n this._clau = this._clau.replace(/[iìíIÌÍ]/gi, 'I');\n this._clau = this._clau.replace(/[oòóOÒÓ]/gi, 'O');\n this._clau = this._clau.replace(/[uùúUÙÚ]/gi, 'U');\n }", "modificarContraccionHelices(){\n this.contraer_helices = !this.contraer_helices;\n }", "function continuaCopia ()\r\n{\r\n this.wordActual = this.getNewWord ();\r\n this.actual = \"\";\r\n this.init ();\r\n}", "function escribirCantidadIconCarrito(cantidadcarrito){\n iconcarrito.textContent=cantidadcarrito;\n}", "moverDerecha(){\n this.salaActual.jugador = false;\n this.salaActual = this.salaActual.derecha;\n this.salaActual.entradaAnteriorSala = posicionSala.derecha;\n this.salaActual.jugador = true;\n }", "function atkDuMonstre (monstre){\n cible();\n if (vieCible == vieGue){\n nomCible = \"au Guerrier\";\n }\n if (vieCible == viePre){\n nomCible = \"au Prêtre\";\n }\n if (vieCible == vieArc){\n nomCible = \"à l'Archer\";\n }\n if (vieCible == vieVol){\n nomCible = \"au Voleur\";\n }\n\tvieCible.value -= atkMonstre;\n\tvieCible.innerHTML = vieCible.value;\n\tdescription.innerHTML = monstre+\" inflige \"+atkMonstre+\" \"+nomCible;\n}", "function escribirInstruccion (instruccion){\n let instruccion = {\n Selecciona:'Selecciona Piedra, Pajaro o Agua',\n\n }\n}", "function continuaPregunta () {\r\n this.wordActual = this.getNewWord ();\r\n this.actual = \"\";\r\n this.init ();\r\n}", "posZahtMet()\n {\n this.posZah=!this.posZah;\n }", "function doEditCitizen() {\r\n\tallElements = document.getElementById('editCitizenForm');\r\n\ttmp = allElements.children[0];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Mail:/,\"Email:\");\r\n\ttmp = allElements.children[4];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/New password:/,\"Yeni \\u015fifre:\");\r\n\ttmp = allElements.children[8];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/New password repeat:/,\"Tekrar yeni \\u015fifre:\");\r\n\ttmp = allElements.children[12];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Old password:/,\"Eski \\u015fifre: :\");\r\n\ttmp = allElements.children[16];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/New avatar:/,\"Yeni avatar:\");\r\n\ttmp = allElements.childNodes[30];\r\n\ttmp.nodeValue=tmp.nodeValue.replace(\"max. size\",\"max. boyut :\");\r\n\t\r\n allElements = document.getElementsByTagName('TD');\r\n tmp = allElements[19]\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Citizen/,\"Vatanda\\u015f\");\r\n\treplaceInputByValue({\"Edit citizen\":[\"Edit citizen\",\"Profil d\\u00fczenle\"]});\r\n}", "function aumentarTamanhoTexto() {\n document.documentElement.classList.contains('textoMaior')\n ? (aumentarTexto.textContent = 'A+')\n : (aumentarTexto.textContent = 'A-');\n\n document.documentElement.classList.toggle('textoMaior');\n }", "function mostraretro1() {\n retrouno.style.display=\"block\";\n fronte1fronte1.replaceChild(retrouno,fronte1);\n //modifica delle descrizioni con il contenuto della lettera\n testo.style.display=\"block\";\n descrizionedescrizione.replaceChild(testo, descrizione); \n }", "function borrarUlt ()\r\n{\r\n var cad = this.actual;\r\n if (cad.length > 0)\r\n {\r\n this.actual = cad.substring (0, cad.length - 1);\r\n }\r\n this.actualitza (\"black\");\r\n}", "function Modification(){\n Id_special = $(this).parent().parent().attr(\"id\");\n $('#Ajout_tache').attr(\"onclick\",\"chang_modify()\");\n for(var cpt = 0 ; cpt < Table.length; cpt++) {\n if(Table[cpt].return_this_id() == Id_special){\n var elem = Table[cpt].return_All_entred_element();\n $(\"#Time_stemp\").val(elem[2]);\n $(\"#Titre_Tach\").val(elem[0]);\n $(\"option:selected\").val(elem[1]);\n\n }\n }\n }", "function ChangeEscolaProibida(chave_classe, indice, dom) {\n AtualizaGeral();\n}", "decrire(){\n\t\treturn `Nom : ${this.nom}, prénom : ${this.prenom}`;\n\t}", "moverAbajo(){\n this.salaActual.jugador = false;\n this.salaActual = this.salaActual.abajo;\n this.salaActual.entradaAnteriorSala = posicionSala.abajo;\n this.salaActual.jugador = true;\n\n }", "function modificarStat(contenedorPadreStat, nombreStat, valorStat) {\r\n\tcontenedorPadreStat.removeChild(contenedorPadreStat.firstChild);\r\n\t\r\n\tif (nombreStat == \"mediareal\") {\r\n\t\t// Añadimos como hijo a \"valorStat\" en negrita.\r\n\t\tvar textoNegrita = document.createElement(\"b\");\r\n\t\tcontenedorPadreStat.appendChild(textoNegrita);\r\n\t\ttextoNegrita.appendChild(document.createTextNode(valorStat));\r\n\t} else {\r\n\t\t// Creamos un span para darle estilo a la parte decimal del número.\r\n\t\tvar spanPosicionesDecimales = document.createElement(\"span\");\r\n\t\tspanPosicionesDecimales.style.fontSize = \"9px\";\r\n\t\tspanPosicionesDecimales.appendChild(document.createTextNode(valorStat.substring(3)));\r\n\t\r\n\t\t// Añadimos como hijos a la parte entera y a la parte decimal.\r\n\t\tcontenedorPadreStat.appendChild(document.createTextNode(valorStat.substring(0, 3)));\r\n\t\tcontenedorPadreStat.appendChild(spanPosicionesDecimales);\r\n\t}\r\n\t\r\n\t// Finalmente, aprovechamos para ampliar el padding del elemento contenedor.\r\n\testablecerPaddingLateralContenedor(contenedorPadreStat, \"1px\");\r\n}", "set setRaza(newName){\n this.raza = newName;\n }", "function escolta () {\r\n text = this.ant;\r\n if(this.validate) {\r\n \tthis.capa.innerHTML=\"\";\r\n index = cerca (this.paraules, text); \r\n if (index == -1) {\r\n this.capa.innerHTML=this.putCursor(\"black\");\r\n }\r\n else {\r\n this.putImg (this.dirImg+\"/\"+this.paraules[index].imatge);\r\n this.capa.innerHTML += \"<br>\" + this.paraules[index].paraula;\r\n this.putSound (this.paraules[index].so);\r\n }\r\n }\r\n \r\n\r\n}", "gEspacio(palabra){\n if(palabra==\" \"){\n palabra=\"_\"\n }\n return palabra\n }", "setApellido (precio) {\n this.apellido = apellido;\n }", "function change(ime, godini, programer, lokacija) {\n ime = 'Vancho';\n godini = 40;\n programer = false;\n lokacija.grad = 'Bitola';\n}", "function setModifier(){\n\n\t$('#strMod').html(getModifier($('#str').val()));\n\n\t$('#dexMod').html(getModifier($('#dex').val()));\n\n\t$('#conMod').html(getModifier($('#con').val()));\n\n\t$('#intMod').html(getModifier($('#int').val()));\n\n\t$('#wisMod').html(getModifier($('#wis').val()));\n\n\t$('#chaMod').html(getModifier($('#cha').val()));\n\n}", "function escoltaDictat () {\r\n this.capa.innerHTML=\"\";\r\n if(!this.validate) {\r\n this.putSound (this.paraules[this.wordActual].so);\r\n this.capa.innerHTML += this.actual+this.putCursor ('black');\r\n }\r\n else {\r\n this.putSound(this.paraules[this.wordActual].so);\r\n this.putImg(this.dirImg + this.paraules[this.wordActual].imatge);\r\n this.capa.innerHTML += \"<br>\" + this.paraules[this.wordActual].paraula.toUpperCase();\r\n this.actual = \"\";\r\n }\r\n}", "function OnMunicipality_Change( e , type )\r\n{\r\n Alloy.Globals.ShedModeShedPosition[\"MUNICIPALITY\"] = $.widgetAppTextFieldShedModeFormsShedPositionMunicipality.get_text_value() ;\r\n}", "decrire() {\n return `${this.nom} a ${this.sante} points de vie et ${this.force} en force`; //ATTENTION: \"this\"\n //Une propriété dont la valeur est une fonction est appelée une méthode.\n }", "function changemaker() {\r\n \r\n if(this.textContent === '') {\r\n \r\n this.textContent = 'X';\r\n }\r\n else if(this.textContent === 'X') {\r\n \r\n this.textContent = 'O';\r\n }\r\n else {\r\n \r\n this.textContent = '';\r\n }\r\n}", "moverArriba(){\n this.salaActual.jugador = false;\n this.salaActual = this.salaActual.arriba;\n this.salaActual.entradaAnteriorSala = posicionSala.arriba;\n this.salaActual.jugador = true;\n }", "set modificarNombre(nuevoNombre) {\n this.nombre = nuevoNombre;\n }", "function toCaracter(obligatoriedad) {\n if (obligatoriedad == 1) {\n return \"*\";\n }\n else\n return \"\";\n\n}", "function escoltaPregunta ()\r\n{\r\n if(this.validate) {\r\n this.capa.innerHTML=\"\";\r\n this.putImg (this.dirImg+\"/\"+this.paraules[index].imatge);\r\n this.capa.innerHTML+=\"<br>\"+this.paraules[index].paraula.toUpperCase();\r\n this.putSound (this.paraules[index].so);\r\n }\r\n else {\r\n this.capa.innerHTML = \"\"\r\n this.putImg (this.dirImg+\"/\"+this.paraules[index].imatge);\r\n this.putSound (this.paraules[index].so);\r\n this.capa.innerHTML += \"<br>\" + this.actual+this.putCursor ('black');\r\n }\r\n}", "function mascaraCep(t, mask){\n var i = t.value.length;\n var saida = mask.substring(1,0);\n var texto = mask.substring(i)\n if (texto.substring(0,1) != saida){\n t.value += texto.substring(0,1);\n }\n }", "suprimerObjet(nomRecherche) {\n\t\t\t\tfor(let i=0; i<this.inventaire.length; i++){ //boucle sur le tableau des sprites de l'inventaire\n\t\t\t\t\t\tif(this.inventaire[i].nom==nomRecherche){\n\t\t\t\t\t\t\t\tthis.inventaire[i].nom = null;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t}", "function User_Update_Types_d_attribut_Catégories_2(Compo_Maitre)\n{\n var Table=\"categorie\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var cr_libelle=GetValAt(33);\n if (!ValiderChampsObligatoire(Table,\"cr_libelle\",TAB_GLOBAL_COMPO[33],cr_libelle,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"cr_libelle\",TAB_GLOBAL_COMPO[33],cr_libelle))\n \treturn -1;\n var cr_description=GetValAt(34);\n if (!ValiderChampsObligatoire(Table,\"cr_description\",TAB_GLOBAL_COMPO[34],cr_description,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"cr_description\",TAB_GLOBAL_COMPO[34],cr_description))\n \treturn -1;\n var Req=\"update \"+Table+\" set \";\n Req+=\"cr_libelle=\"+(cr_libelle==\"\" ? \"null\" : \"'\"+ValiderChaine(cr_libelle)+\"'\" )+\",cr_description=\"+(cr_description==\"\" ? \"null\" : \"'\"+ValiderChaine(cr_description)+\"'\" )+\"\";\n Req+=\" where \"+NomCleMaitre+\"=\"+CleMaitre;\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de la mise à jour\");\nreturn CleMaitre;\n\n}", "function comprovarPregunta () {\r\n this.capa.innerHTML=\"\";\r\n if (this.actual.toUpperCase() != this.correcte.toUpperCase()) {\r\n this.putImg(\"imatges/error.gif\")\r\n this.putSound(this.soMal);\r\n this.actual = \"\";\r\n }\r\n else\r\n {\r\n this.validate=1;\r\n this.putImg(this.dirImg + this.paraules[this.wordActual].imatge)\r\n this.putSound(this.paraules[this.wordActual].so);\r\n this.capa.innerHTML += \"<br>\" + this.paraules[this.wordActual].paraula.toUpperCase();\r\n this.actual = \"\";\r\n }\r\n}", "function FiltroStringa(stringa,campo,colore) {\r\n var indice =0;\r\n var carattere = new String();\r\n var vecchiocarattere = new String();\r\n var nuovastringa = new String();\r\n \r\n for (indice=0; indice < stringa.length; indice++) {\r\n carattere = stringa.charAt(indice);\r\n if (carattere.charCodeAt(0) != 32 || vecchiocarattere.charCodeAt(0) != 32) {\r\n if (indice == 0 \r\n || vecchiocarattere.charCodeAt(0) == 32 // spazio\r\n || vecchiocarattere.charCodeAt(0)==39 // apostrofo\r\n || vecchiocarattere.charCodeAt(0)==45 // trattino -\r\n || vecchiocarattere.charCodeAt(0)==40 //parentesi aperta\r\n )\r\n {\r\n nuovastringa += carattere.toUpperCase();\r\n } else {\r\n nuovastringa += carattere.toLowerCase();\r\n }\r\n vecchiocarattere = carattere;\r\n }\r\n }\r\n document.getElementById(campo).value=nuovastringa;\r\n document.getElementById(campo).style.background=\"white\";\r\n document.getElementById(campo).style.color=colore;\r\n \r\n if (campo=='parrocchia_battesimo') {\r\n AssegnaBattesimo('blur');\r\n }\r\n \r\n return nuovastringa;\r\n}", "function change(){\r\n if(this.textContent === ''){\r\n this.textContent = 'X';\r\n }else if (this.textContent === 'X') {\r\n this.textContent = 'O';\r\n }else {\r\n this.textContent = '';\r\n }\r\n}", "function User_Delete_Types_d_attribut_Liste_des_types_d_attribut_de_personne0(Compo_Maitre)\n{\n var Table=\"typeattribut\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var Req=\"delete from \"+Table+\" where \"+NomCleMaitre+\" = \"+CleMaitre;\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de la supression\");\nreturn CleMaitre;\n\n}", "function listarMetodosC(){\n\n let listaMetodosC = \"\";\n if($(\"#nuevoMetodoPagoC\").val()==\"Efectivo\"){\n\n $(\"#listaMetodoPagoC\").val(\"Efectivo\");\n }else{\n $(\"#listaMetodoPagoC\").val($(\"#nuevoMetodoPagoC\").val() + \"-\" + $(\"#nuevoCodigoTransaccionC\").val());\n }\n}", "function mascara(t, mask){\n var i = t.value.length;\n var saida = mask.substring(1,0);\n var texto = mask.substring(i)\n if (texto.substring(0,1) != saida){\n t.value += texto.substring(0,1);\n }\n }", "function changeMarker(){\r\n if(this.textContent === ''){\r\n this.textContent = 'X';\r\n }else if (this.textContent === 'X') {\r\n this.textContent = 'O';\r\n }else {\r\n this.textContent = '';\r\n }\r\n}", "function actualitza ()\r\n{\r\n this.capa.innerHTML = this.actual + this.putCursor ('black');\r\n}", "function filtrosPartidos(filtro, columna) {\n //Activar el filtro por letra\n var columna_elegida = document.getElementsByClassName('col_' + columna);\n var nuevo_texto = '';\n switch (filtro) {\n case '1':\n nuevo_texto = 'L';\n break;\n case '2':\n nuevo_texto = 'E';\n break;\n case '3':\n nuevo_texto = 'V';\n break;\n }\n for (var i = 0; i < columna_elegida.length; i++) {\n columna_elegida.item(i).innerHTML = nuevo_texto;\n }\n\n \n}", "function modifyText() {\n const t2 = document.getElementById(\"t5\");\n if (t2.firstChild.nodeValue == \"5\") {\n t2.firstChild.nodeValue = \"mff\";\n } else {\n t2.firstChild.nodeValue = \"aik\";\n }\n}", "function actualitzaPregunta (color) {\r\n index = this.wordActual;\r\n this.capa.innerHTML=\"\";\r\n this.putImg (this.dirImg+\"/\"+this.paraules[index].imatge);\r\n this.capa.innerHTML += \"<br> \"+this.actual + this.putCursor (color);\r\n}", "set_operasi() {\n document.getElementById(\"operasi-hasil\").innerHTML = this.operasi_hasil;\n }", "function modificado(t) {\n datos();\n}", "function texte2(){\n document.querySelector(\".textM\").classList.add(\"textM3\")\n document.querySelector(\".textM\").innerText= `fonctionne en bluethoot ! ou part cable !\n peut se rechargé sur un socle transportable`;\n}", "function User_Update_Cantons_Liste_des_cantons0(Compo_Maitre)\n{\n var Table=\"canton\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var ct_nom=GetValAt(140);\n if (!ValiderChampsObligatoire(Table,\"ct_nom\",TAB_GLOBAL_COMPO[140],ct_nom,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ct_nom\",TAB_GLOBAL_COMPO[140],ct_nom))\n \treturn -1;\n var Req=\"update \"+Table+\" set \";\n Req+=\"ct_nom=\"+(ct_nom==\"\" ? \"null\" : \"'\"+ValiderChaine(ct_nom)+\"'\" )+\"\";\n Req+=\" where \"+NomCleMaitre+\"=\"+CleMaitre;\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de la mise à jour\");\nreturn CleMaitre;\n\n}", "getApellido () {\n return this.apellido;\n }", "function alfanumerico(campo)\n\t{\n\tvar charpos = campo.value.search(\"[^A-Za-z0-9. ]\");\n\tif(campo.value.length > 0 && charpos >= 0)\n\t\t{\n\t\tcampo.value = campo.value.slice(0, -1)\n\t\tcampo.focus();\n\t\treturn false;\n\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\treturn true;\n\t\t\t\t}\n\t}", "function imprimirNombreenmatusculas(){\n nombre= nombre.toUpperCase()\n console.log(nombre)\n}", "setNom(nom){\n this.nom = nom;\n }", "function controllo(nome,cognome){\n var nome_pul = nome.replace(/[^A-Za-z0-9]/g, \"\"); \n var cognome_pul = cognome.replace(/[^A-Za-z0-9]/g, \"\");\n if(nome==nome_pul && cognome==cognome_pul)\n return true;\n else return false;\n}", "moverIzquierda(){\n this.salaActual.jugador = false;\n this.salaActual = this.salaActual.izquierda;\n this.salaActual.entradaAnteriorSala = posicionSala.izquierda;\n this.salaActual.jugador = true;\n }", "setRegularDot(regularDot){\r\n this.regularDot = regularDot;\r\n }", "changerJoueur() {\n this.indexJoueurActuel = !this.indexJoueurActuel;\n }", "function RefModification(field)\r\n{\r\n\tvar len = 1;\r\n\tvar kar = \"\";\r\n\tvar str = \"\";\r\n\tvar halant_found = true;\r\n\tvar CH = \"\";\r\n\t\tfield.focus();\r\n\twhile(true)\r\n\t{\r\n\t\tif (document.selection) \r\n\t\t{\r\n\t\t\tsel = document.selection.createRange();\r\n\t\t\tif (field.value.length >= len)\r\n\t\t\t{\r\n\t\t\t\tsel.moveStart('character', -1 * len); \r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tCH = \"\",\r\n\t\t\t\tlen--;\r\n\t\t\t\tsel.moveStart('character', -1 * len);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tCH = sel.text.charAt(0);\r\n\t\t}\r\n\t\telse if (field.selectionStart || field.selectionStart == 0) \r\n\t\t{\r\n\t\t\tvar startPos = field.selectionStart-len;\r\n\t\t\tvar endPos = field.selectionEnd;\r\n\t\t\tvar scrollTop = field.scrollTop;\r\n\r\n\t\t\tif(startPos <0)\r\n\t\t\t{\r\n\t\t\t\tCH = \"\",\r\n\t\t\t\tlen--;\r\n\t\t\t\tstartPos = field.selectionStart-len;\r\n\t\t\t\tbreak;\r\n\t\t\t} \r\n\t\t\tCH = field.value.substring(startPos, startPos+1)\r\n\r\n\t\t}\r\n\r\n\t\tif(len!=1 && IsBanglaKar(CH))\r\n\t\t\tbreak;\r\n\r\n\t\tif(len==1 && IsBanglaKar(CH))\r\n\t\t\tkar=CH;\r\n\t\telse if(IsBanglaSoroborno(CH) || IsBanglaDigit(CH) || IsSpace(CH))\r\n\t\t\tbreak;\r\n\t\telse if(IsBanglaBanjonborno(CH))\r\n\t\t{\r\n\t\t\tif(halant_found==true)\r\n\t\t\t{\r\n\t\t\t\tstr = CH + str;\r\n\t\t\t\thalant_found = false;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\telse if(IsBanglaHalant(CH))\r\n\t\t{\r\n\t\t\tstr = CH + str;\r\n\t\t\thalant_found = true;\r\n\t\t}\r\n\t\tlen++;\r\n\t}\r\n\r\n\tvar line = CH + \"র্\" + str + kar;\r\n\tif (document.selection) \r\n\t{\r\n\t\tsel.text = line;\r\n\t\tsel.collapse(true);\r\n\t\tsel.select();\r\n\t}\r\n\telse if (field.selectionStart || field.selectionStart == 0) \r\n\t{\r\n\t\tfield.value = field.value.substring(0, startPos)\r\n\t\t\t\t+ line\r\n\t\t\t\t+ field.value.substring(endPos, field.value.length);\r\n\t\tfield.focus();\r\n\t\tfield.selectionStart = startPos + line.length;\r\n\t\tfield.selectionEnd = startPos + line.length;\r\n\t\tfield.scrollTop = scrollTop;\r\n\t}\r\n\r\n}", "function setModificationProjet() {\n $(\"#operationControleurModification\").val(\"modificationProjet\");\n}", "changerNom() {\n // Mauvaise pratique\n // this.state = {\n //\n // }\n if (this.state.name === 'B') {\n this.setState({\n name: \"A\"\n })\n }\n else {\n this.setState({\n name: \"B\",\n })\n }\n }", "function doEditCitizen() {\r\n\tallElements = document.getElementById('editCitizenForm');\r\n\ttmp = allElements.children[0];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Mail:/,\"Email:\");\r\n\ttmp = allElements.children[4];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/New password:/,\"Új jelszó:\");\r\n\ttmp = allElements.children[8];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/New password repeat:/,\"Ismétlés:\");\r\n\ttmp = allElements.children[12];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Old password:/,\"Régi jelszó: :\");\r\n\ttmp = allElements.children[16];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/New avatar:/,\"Új avatar:\");\r\n\ttmp = allElements.childNodes[30];\r\n\ttmp.nodeValue=tmp.nodeValue.replace(\"max. size\",\"Max. méret; :\");\r\n\t\r\n allElements = document.getElementsByTagName('TD');\r\n tmp = allElements[19]\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Citizen/,\"Polgár\");\r\n\treplaceInputByValue({\"Edit citizen\":[\"Edit citizen\",\"Polgár szerkesztése\"]});\r\n}", "setNombre (precio) {\n this.nombre = nombre;\n }", "function mostrafronte1() {\n fronte1.style.display=\"block\";\n fronte1fronte1.replaceChild(fronte1,retrouno);\n //modifica del contenuto della lettera con le descrizioni\n descrizione.style.display=\"block\";\n descrizionedescrizione.replaceChild(descrizione, testo); \n }", "function literaryMutilator() {\n\tlet tacoPara = document.getElementById(\"three\");\n\tlet regex = /taco/;\n\ttacoPara.innerHTML = tacoPara.innerHTML.replace(regex, 'YUM')\n}", "function limpiar(){\n\n Ext.getCmp('nombreBanco').setValue('');\n Ext.getCmp('idBanco').setValue(''); \n }", "function activar_batiseñal() {\n return \"activada\";\n}", "LiberarPreso(valor){\nthis.liberation=valor;\n }", "function editarContacto(nombreEliminar,a,b,c) {\n\tfor (var i =0;i < arrayContactos.length;i++) {\n\t\tif (arrayContactos[i].nombre == nombreEliminar ) {\n\t\t\tarrayContactos[i].nombre=a;\n\t\t\tarrayContactos[i].direccion=b;\n\t\t\tarrayContactos[i].telefono=c;\n\t\t}\n\t}\n\tguardarDatosLocales();\n}", "function cambiaSecreta(){\n secreta=normalize(secreta);\n secreta=secreta.toUpperCase();\n secreta=secreta.replace(/ /g, \"\");\n}", "function apenasPonto(obj_input, esse, por_esse) {\n var retorno = obj_input.value;\n while (retorno.indexOf(esse) > - 1)\n retorno = retorno.replace(esse, por_esse);\n obj_input.value = retorno;\n}", "function vaLetras(e) {\n key = e.keyCode || e.which;\n tecla = String.fromCharCode(key).toString();\n letras = \" áéíóúabcdefghijklmnñopqrstuvwxyzÁÉÍÓÚABCDEFGHIJKLMNÑOPQRSTUVWXYZ\";//Se define todo el abecedario que se quiere que se muestre.\n especiales = [8, 37, 39, 46, 6]; //Es la validación del KeyCodes, que teclas recibe el campo de texto.\n\n tecla_especial = false\n for (var i in especiales) {\n if (key == especiales[i]) {\n tecla_especial = true;\n break;\n }\n }\n\n if (letras.indexOf(tecla) == -1 && !tecla_especial) {\n //alert('Tecla no aceptada');\n return false;\n }\n}", "function changeText() {\n \n }", "decrire() \n {\n return `${this.nom} a ${this.sante} points de vie, ${\n this.force\n } en force et ${this.xp} points d'expérience`;\n }", "function imprimirNombreMayuscula({ nombre }) { //entre las llaves colocamos el nombre de la propiedad a la cual queremos acceder\n console.log(nombre.toUpperCase());\n}", "changeCouleurText(val) {\r\n this.textlogoid.style.color = val;\r\n}", "function mayusculas(e) {\n e.value = e.value.toUpperCase();\n }", "function comprovarDictat () {\r\n this.capa.innerHTML=\"\";\r\n if (this.actual.toLowerCase() !=this.correcte.toLowerCase()) {\r\n this.putImg(\"imatges/error.gif\");\r\n this.putSound(this.soMal);\r\n this.actual = \"\";\r\n }\r\n else\r\n {\r\n this.putImg(this.dirImg + this.paraules[this.wordActual].imatge);\r\n this.putSound(this.paraules[this.wordActual].so);\r\n this.actual = \"\";\r\n this.capa.innerHTML += \"<br>\" + this.paraules[this.wordActual].paraula.toUpperCase();\r\n this.actual = \"\";\r\n this.validate=1;\r\n }\r\n}", "function changeMarker(){\n \tif(this.textContent === ''){\n \t\tthis.textContent= 'X';\n \t\t// console.log(\"DONE\")\n \t}\n \telse if(this.textContent==='X'){\n \t\tthis.textContent='O';\n \t\t\t}\n \telse {\n \t\tthis.textContent='';\n \t\t \t}\t\n \t}", "function letras(n) {\n\tpermitidos = /[^a-zA-Z]/;\n\tcadena = n.value;\n\tband = false;\n\tfor (i = 0; i < cadena.length; i++) {\n\t\tletra = cadena.substring(i, i + 1);\n\t\tif (permitidos.test(letra)) {\n\t\t\tcadena2 = cadena;\n\t\t\tcadena = cadena2.replace(letra, \"\");\n\t\t\tband = true;\n\t\t}\n\t}\n\tif (band === true) {\n\t\tn.value = cadena;\n\t}\n}", "function minusculamayuscula(texto){\n return texto.toUpperCase()\n}", "function editannounement() {\n\n}", "setbezeichnung(abezeichnung){\n this.bezeichnung = abezeichnung;\n }", "function leerTecla(){\n\tswitch (valorTecla) {\n\t\tcase 38: // up\n\t\tcase 37: // left\n\t\tcase 40: // down\n\t\tcase 39: // right\n\t\t\tmoverCamara(valorTecla);\n\t\t\tbreak;\n\n\t\tcase 32: // space\n\t\t\tbreak;\n\n\t\tcase 65: // a\n\t\t\tbreak;\n\n\t\tcase 83: // s\n\t\t\tbreak;\n\t}\n\tvalorTecla=0;\n}", "function editManCon(id) {\n\n\t/* Da znamo koji id trebamo promjeniti*/\n\tvar idBroj = 0;\n\tvar poslano = \"\";\n\n\tif(id)\n\t{\n\t\tidBroj = id;\n\t}\n\n\tif(this.id) {\n\t\tidBroj = this.id.slice(16);\n\t}\n\n\t/* Text koji mjenjamo */\n\tvar textId = \"editInputMan\" + idBroj;\n\tvar text = document.getElementById(textId).value;\n\n\tvar xhr = new XMLHttpRequest();\n\n\txhr.open(\"POST\", \"ajaxInj.php?editManChangeId=\" + idBroj + \"&textManChange=\" + text, true);\t\n\t\n\txhr.send();\n\t\n\t\n\t/* Ovo sam morao radi firefoxa reloadao je prije neg sto bi AJAX obavio posao */\n\txhr.onreadystatechange = function() \n\t{\n\t\tif(this.readyState == 4 && this.status == 200)\n\t\t{\n\t\t\tlocation.reload();\n\t\t}\n\t}\n\n\n}", "function setAllHorseText(textVal){\n $scope.horses.forEach(function(horse) {\n horse.horseText = textVal\n })\n }", "decrire() {\n return `${this.nom} a ${this.sante} points de vie, ${\n this.force\n } en force et ${this.xp} points d'expérience`;\n }", "decrire() {\n return `${this.nom} a ${this.sante} points de vie, ${\n this.force\n } en force et ${this.xp} points d'expérience`;\n }", "decrire() {\n return `${this.nom} a ${this.sante} points de vie, ${\n this.force\n } en force et ${this.xp} points d'expérience`;\n }", "function cambiarColor() {\r\n var fraseCoche = document.getElementById(\"cocheAzul\").textContent;\r\n var cambioDeColor = fraseCoche.replace('blau', 'verd');\r\n document.getElementById(\"ejercicio6Parte1\").innerHTML = cambioDeColor;\r\n}", "function User_Update_Types_de_personne_Liste_des_types_de_personne0(Compo_Maitre)\n{\n var Table=\"typepersonne\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var tp_type=GetValAt(49);\n if (!ValiderChampsObligatoire(Table,\"tp_type\",TAB_GLOBAL_COMPO[49],tp_type,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"tp_type\",TAB_GLOBAL_COMPO[49],tp_type))\n \treturn -1;\n var Req=\"update \"+Table+\" set \";\n Req+=\"tp_type=\"+(tp_type==\"\" ? \"null\" : \"'\"+ValiderChaine(tp_type)+\"'\" )+\"\";\n Req+=\" where \"+NomCleMaitre+\"=\"+CleMaitre;\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de la mise à jour\");\nreturn CleMaitre;\n\n}" ]
[ "0.6440903", "0.6160613", "0.6102996", "0.6064726", "0.5894387", "0.58638525", "0.58527774", "0.5785966", "0.5753966", "0.57209444", "0.5717911", "0.5690156", "0.5688827", "0.56878036", "0.5671609", "0.5654149", "0.5648903", "0.5609282", "0.5596887", "0.5579981", "0.5567882", "0.5553858", "0.5533195", "0.5531611", "0.5530155", "0.55209893", "0.5499234", "0.5494355", "0.54557776", "0.54509205", "0.5450558", "0.54330224", "0.54201084", "0.54199636", "0.5410896", "0.53926647", "0.5387039", "0.53861886", "0.5384746", "0.5380787", "0.5373634", "0.5371098", "0.53649193", "0.5362633", "0.5357861", "0.5352046", "0.5338122", "0.53362244", "0.53301597", "0.53240037", "0.5323552", "0.5321621", "0.53194237", "0.5313617", "0.5311588", "0.5310399", "0.53052545", "0.530318", "0.5301217", "0.5299884", "0.5298032", "0.52948093", "0.529207", "0.5288327", "0.52876353", "0.5283052", "0.5282635", "0.5282432", "0.5278258", "0.5275779", "0.5268248", "0.5263577", "0.5260214", "0.52518976", "0.5245546", "0.52411836", "0.52387255", "0.52378595", "0.5237172", "0.5234535", "0.52332693", "0.52327275", "0.5228906", "0.5226912", "0.52232224", "0.5222537", "0.5217658", "0.52158964", "0.5202722", "0.51945215", "0.5188243", "0.518519", "0.5176988", "0.517212", "0.51638526", "0.51618075", "0.51614064", "0.51614064", "0.51614064", "0.5159892", "0.5155443" ]
0.0
-1
se pune fct intre () apoi ca sa se autoapeleze se mai pun (); Function with function as parameter
function testFunction() { alert("Exec from another function"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fuctionPanier(){\n\n}", "function miFuncion (){}", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "function funcionParametro(fn) {\n\tfn();\n}", "function fieMetFunctionAlsParameter(eenFunctie){\n console.log(\"zo meteen wordt de doorgegeven function uitgevoerd\");\n eenFunctie();\n}", "saludar(fn){\n console.log(`Hola me llamo ${this.nombre} ${this.apellido}`)\n if(fn){\n fn(this.nombre,this.apellido, false)\n }\n }", "function fun1( /*parametros opcionais*/ ){ /*retorno opcional*/ }", "saludar(fn){\n console.log(`Hola me llamo ${this.nombre} ${this.apellido} y soy programador`)\n if(fn){\n fn(this.nombre,this.apellido, true)\n }\n }", "function miFuncion(){\n\n}", "function executaFuncao (funcao){\n funcao();\n}", "function fun1(){} //toda a função de js retorna alguma coisa", "function lalalala() {\n\n}", "function fuction() {\n\n}", "function armado_funcion( arguments ) {\n //You get the selected option of select\n div = document.getElementById('functions').value;\n\n //The text is assembled according to the corresponding function\n cantRows = 0;\n text_function = '';\n //Function + arguments\n //If the function has arguments\n if (arguments != false){\n //It will remove the last \",\" to the arguments, if arguments ==''=> function without arguments\n arguments = arguments.substring(0,arguments.length - 1);\n }\n text_function = div + '(' + arguments + ')';\n\n //Adding new function text\n insertarTexto(text_function);\n\n //Hides the div to add row\n document.getElementById('div_with_functions').toggle();\n\n}", "function nombreFuncion(parametro){\n return \"regresan algo\"\n}", "saludar(fn){//recepcion de funcion\n var {nombre, apellido}=this //desgrloce de variables\n console.log(`Hola me llamo ${nombre} ${apellido}`)\n if(fn){\n fn(nombre, apellido, true)\n }\n }", "function funcionPorDefinicion(){\n //Body\n }", "function nombreFuncion(){\n \n}", "function funcionamiento(){\n alert('Aun no tiene funcionamiento');\n}", "function funcionamiento(){\n alert('Aun no tiene funcionamiento');\n}", "function funcEjemplo() {\n console.log(\"Ejemplo de funcion opcional\");\n}", "function iniFungsi(func) {\n func();\n func();\n\n return function () {\n console.log(\"Done!\");\n };\n}", "function fn() {\n\t\t }", "function fun() { }", "function onloevha() {\n}", "function cargarpista1 (){\n \n}", "function mascaraTel(o, f) {\n v_obj = o;\n v_fun = f;\n setTimeout(\"execmascara()\", 1);\n}", "function miFuncion() { // function declaration Declarativas expresión \n return 3; \n}", "function crearFuncionExplorarUnidades(id, coste){\r\n\t\t\t\tvar funcion = function (){\r\n\t\t\t\t\t\tvar a = find(\"//input[@type='text']\", XPList).snapshotItem(id - 1);\r\n\t\t\t\t\t\tvar b = find(\"//div[@name='exp\" + id + \"']\", XPFirst);\r\n\t\t\t\t\t\tvar c = calculateResourceTime(arrayByN(coste, a.value));\r\n\t\t\t\t\t\tif (c) b.innerHTML = c; else b.innerHTML = '';\r\n\t\t\t\t};\r\n\t\t\t\treturn funcion;\r\n\t\t}", "function miFuncion(x) {\n\n return this.numero + x;\n\n}", "function imprimir4(fn){\n\n\t//Ejecutamos la funcion anonima\n\tfn();\n\n}", "function saludarFamilia(apellido){\n return function saludarMiembro(nombre){\n console.log(`hola ${nombre} ${apellido}`)\n }\n}", "function Interfaz(){}", "function funcionario(nome, sobrenome) {\n this.nome = nome;\n this.sobrenome = sobrenome;\n}", "function funcion() {\n return numeracion;\n}", "function Ejemplo(){return true}", "function iniciar() {\n \n }", "function Func_s() {\n}", "function mostrar() {}", "function mostrar() {}", "function fm(){}", "function mojaFunkcija(){\n console.log('Zdarvo svete!');\n}", "function execFunJs($this,func){\n\tlet trParent = $($this).parent().parent().parent().prev();\n\tf_color_fila(trParent[0],3,function(){\n\t\teval(func);\n\t});\n\n}", "function va(t,e){0}", "function ea(){}", "function firstFunc(funcParam){\n funcParam();\n}", "saludar(fn) {\n\t\tlet { nombre, apellido } = this;\n\t\tconsole.log(\n\t\t\t`Hola me llamo ${nombre} ${apellido} y soy desarrollador/a`\n\t\t);\n\t\tif (fn) {\n\t\t\tfn(nombre, apellido, true);\n\t\t}\n\t}", "function wrapfunction(fn,message){if(typeof fn!=='function'){throw new TypeError('argument fn must be a function');}return fn;}", "function fun1 ( ) {}", "function fun1(){}", "function fun1(){}", "function wa(){}", "function fie1(){\n console.log(\"fie1 wordt uitgevoerd\");\n}", "function Fo(t,e){0}", "function func(){\r\n\r\n}", "function run(fun) {\n fun(); // Executa a funcao passada como parametro\n}", "function otroCallback(miOtroCallback){\n\tmiOtroCallback('Un argumento para esta función');\n}", "function otroCallback(miOtroCallback){\n\tmiOtroCallback('Un argumento para esta función');\n}", "function fn() {}", "function saludar()\r\n{\r\n console.log('Hola Soy Una Funcion');\r\n}", "function sveikinuosi( funkcijosPavadinimas ){\n console.log(\"Labutaitis\");\n if (funkcijosPavadinimas != null && funkcijosPavadinimas != undefined) {\n funkcijosPavadinimas();\n }\n}", "function e(a){f(Fa,a)}", "function nuevaFuncion(nombre = \"Tomas\", edad = \"21\", ciudad = \"Linares\")\n{\n console.log(nombre, edad, ciudad)\n}", "function executaFuncao(funcao) {\n console.log('Executa a funcao abaixo!');\n funcao();\n}", "function escolha(p) {\n novoJogo();//chamando a função para limpar a tela\n document.getElementById(\"resultado\").innerHTML = '';//limpando o mostra ganhador\n // document.getElementById(\"aviso\").innerHTML = ''; //limpando o aviso\n escB = p;// x é o parametro de x e O é o parametro de O\n}", "function createFareMultiplier(integar){\nreturn function (Multiplier) {\n return Multiplier * integar;\n }}", "function callFunction(fun){\n\tfun();\n}", "function makeEmptyFunction(arg) {\n\t\t\t\t\treturn function () {\n\t\t\t\t\t\treturn arg;\n\t\t\t\t\t};\n\t\t\t\t}", "function i(e,t){if(\"function\"!=typeof e)throw new TypeError(\"argument fn must be a function\");return e}", "function ba(){}", "function ba(){}", "function ba(){}", "function ba(){}", "function blabla() {\n\n}", "getFunction() {\n const expression = document.getElementById(\"funct\").value.toLowerCase();\n\n if (expression == \"\") {\n console.log(\"empty function field\");\n return;\n }\n // replace('ln(x)', 'log(x, 2.71828182846)')\n const finalexpression = this.scrubln(expression).trim();\n // console.log(finalexpression, expression);\n\n if (!this.functionAlreadyExists(expression)) {\n try {\n const node = math.parse(finalexpression);\n const code = node.compile();\n\n const coords = this.getExpressionValues(code);\n\n this.functionArray.push(\n new FunctionObject(expression, finalexpression, coords, code, this)\n );\n this.addFunctionDetailsDiv();\n this.drawFunctionValuesToGraph(coords);\n } catch (err) {\n console.log(\"input created a problem...\");\n console.log(err);\n }\n }\n console.log(\"expression alreadu input\");\n }", "function getFuncion(num) {\n if (num === void 0) { num = 1; }\n return 'Función normal de JS';\n}", "function makeEmptyFunction(arg) {\n\t\t\t return function () {\n\t\t\t return arg;\n\t\t\t };\n\t\t\t}", "function saludar(){\n return 'hola'\n}", "function saludConFunciones(nombre,cb) {\n return cb(nombre)\n}", "function callFunction(fun) {\r\n fun()\r\n}", "function Go_Funciones()\n {\n if( g_listar == 1 )\n {\n Get_Marca_Producto();\n }\n \n }", "function fieMetFunctionAlsUitkomst(){\n var getal = Math.random();\n if(getal < 0.5){\n return fie2;\n }\n return function(){\n console.log(\"deze anonieme function is de uitkomst van een andere function\");\n }\n}", "function Ha(){}", "function fun1( ) { }", "function anula() {\n anular(1);\n}", "function anula() {\n anular(1);\n}", "function myFnCall(fn) {\n return new Function('return ' + fn)();\n }", "function toonGetal() {\n return function (getal, naam) {\n console.log(getal + ' voor ' + naam);\n }\n}", "function saludar(parametro){\n return parametro;\n}", "function setIntervalCustom(fn,timer){\n \n return setTimeout(function(){\n \n if(typeof fn == \"function\"){\n fn();\n setIntervalCustom(fn,timer);\n }\n else{\n console.log(\"passing function is not a function\");\n }\n },timer) \n }", "function an(){}", "function mostrarPalabra(){\n \n}", "function callFunction(fun){\n fun();\n}", "function makefunc(x) {\r\n// return function() { return x; }\r\n// return new Function($direct_func_xxx$);\r\n return new Function(\"return x;\")\r\n}", "function fun1() {}", "function fun1() {}", "function FunctionUtils() {}", "executeFunction(value) {\n //FN:fonction1;\n var self = this;\n self.send(FN_PREFIX + SEPARATOR + value + END);\n }", "function salut(){\r\n\treturn \"Salut !\";\r\n}" ]
[ "0.749152", "0.74317986", "0.7373698", "0.7373698", "0.7373698", "0.72726965", "0.71698695", "0.70301735", "0.70177954", "0.694629", "0.6833677", "0.676632", "0.6703324", "0.6621192", "0.65922624", "0.6556764", "0.65446204", "0.65215355", "0.651996", "0.6480593", "0.64726704", "0.64726704", "0.6416408", "0.6351169", "0.63353485", "0.6310736", "0.6272722", "0.626603", "0.62600076", "0.6245886", "0.62417233", "0.6234954", "0.6227151", "0.62181526", "0.6210706", "0.61947745", "0.61846054", "0.6167312", "0.61667377", "0.61493635", "0.6134681", "0.6134681", "0.6123187", "0.61112154", "0.61007136", "0.60794306", "0.6052302", "0.60521495", "0.6049432", "0.6048713", "0.6039445", "0.60317665", "0.60317665", "0.60242146", "0.6022885", "0.6019305", "0.6014027", "0.601383", "0.6007891", "0.6007891", "0.6003806", "0.5983971", "0.59722537", "0.5968179", "0.595252", "0.5942245", "0.593789", "0.59322244", "0.5926721", "0.59259236", "0.5925188", "0.5919017", "0.5919017", "0.5919017", "0.5919017", "0.5893903", "0.5889573", "0.5888467", "0.58689654", "0.5867607", "0.58658016", "0.5864753", "0.58614063", "0.58567536", "0.585444", "0.58469963", "0.5846334", "0.5846334", "0.58402866", "0.5836517", "0.5827364", "0.58267057", "0.5822182", "0.58193004", "0.5818993", "0.58118194", "0.5803933", "0.5803933", "0.57934254", "0.57929766", "0.5789167" ]
0.0
-1
Check the logged in user status. If any point in time, the user is logged in then he can not able to see the login or register route. For that, a componentDidMount method has been added. If the current user is logged in user and trying to register the new user, then it prevents it and redirects to a home route.
componentWillReceiveProps(nextProps) { if (nextProps.auth.isAuthenticated) { this.props.history.push("/"); } if (nextProps.errors) { this.setState({ errors: nextProps.errors, }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "componentDidMount() {\n getCurrentUser().then((data) => {\n if (typeof data.error !== 'undefined') {\n data.isAuth = false\n } else if(typeof data.isAuth === 'undefined') {\n data.isAuth = true\n }\n\n // Update current user state since this can't be done in class\n // constructor otherwise other components expecting user.isAuth\n // will fail horrendously\n if (this.state.user.isAuth !== data.isAuth) {\n this.setState({ user: data})\n\n if (this.state.user.isAuth) {\n let path = window.location.pathname\n\n if (path === LOGIN_ROUTE) {\n this.props.history.push(HOME_ROUTE)\n } else {\n this.props.history.push(path)\n }\n } else {\n this.props.history.push(LOGIN_ROUTE)\n }\n }\n })\n }", "function checkUserStatus() {\n if (firebase.auth().currentUser === null) { loadLoginPage(); }\n else { loadHomePage(); }\n }", "function checkIfLoggedIn() {\n if(ls.token && ls.user_id) {\n axios.get(`${process.env.REACT_APP_DB_URL}/users/${ls.user_id}`, {\n headers: {\n authorization: `Bearer ${ls.token}`\n }\n })\n .then((foundUser) => {\n setLoginStatus(true)\n })\n .catch((err) => {\n setLoginStatus(false)\n })\n }\n }", "async componentDidMount() {\n // If user is already logged in, forward them to the private area.\n if (isLoggedIn()) {\n navigate(`/app/profile`)\n }\n }", "checkLoggedInStatus() {\n this.bitski.getUser().then(user => {\n this.toggleLoading(false);\n this.validateUser(user);\n }).catch(error => {\n this.toggleLoading(false);\n this.setError(error);\n showLoginButton();\n });\n }", "checkAuthStatus(){\n\t\tfirebase.auth().onAuthStateChanged(function(user) {\n\t\t\tif (user) {\n\t\t\t\tthis.setState({loggedIn: true, user : user, errorCode : '', errorMessage : ''});\n\t\t\t\tconsole.log(\"user logged in\");\n\t\t \t} else {\n\t\t \tthis.setState({loggedIn: false, user : null});\n\t\t \t}\n\t\t}.bind(this));\n\t}", "function checkUser() {\n service.onceAuthData().then(function(authData){\n if (authData && !authData.anonymous) {\n $location.path('/main/' + authData.uid);\n } else {\n $location.path('/login');\n }\n });\n }", "componentDidMount() {\n this.props.getUserHistory();\n if (!this.props.user.loggedIn) {\n redirect(\"/login\");\n }\n }", "function checkIfUserInitialized() {\n if (currentuser) {\n loadHomePage();\n } else {\n updateCurrentUser().then(function () {\n loadHomePage();\n }).catch(function () {\n loadSettingsPage();\n });\n }\n}", "checkAlreadyLoggedIn(props) {\n if (/\\/(amc-sign-up|appraiser-sign-up|login)/.test(this.props.location.pathname)) {\n return props.auth.get('user') && !props.auth.get('signingUp');\n }\n }", "function checkUserLogin() {\n if (!user) {\n loginWithRedirect()\n } else {\n getUserTeam();\n }\n }", "checkIfUserIsLoggedIn(){\n if(this.props.locateApplication.isLoggedIn){\n return true;\n }\n return false;\n }", "componentDidMount() {\n // If logged in and user navigates to Register page, should redirect them to homepage\n if (this.props.auth.isAuthenticated) {\n this.props.history.push(\"/\");\n }\n }", "checkLogin() {\n\t\taxios(`${this.base}/isLoggedIn`, {\n\t\t\theaders: {\n\t\t\t\tAuthorization: `Bearer ${TokenService.read()}`\n\t\t\t}\n\t\t})\n\t\t\t.then(response => {\n\t\t\t\tconsole.log(`Response: ${JSON.stringify(response.data)}`);\n\t\t\t\tthis.setState({\n\t\t\t\t\tuser: response.data,\n\t\t\t\t\tisAuthed: true\n\t\t\t\t});\n\t\t\t})\n\t\t\t.catch(error => console.log(`Error: ${error}`));\n\t}", "function checkLoginStatus() {\n firebase.auth().onAuthStateChanged(function (user) {\n if (!user) {\n // Take the user to the login page\n window.location.href = 'login.html';\n } else {\n // Validate user is auth\n isUserAuth(user.uid);\n }\n });\n }", "componentWillMount() {\n if(!this.state.authenticated) {\n \n }\n }", "componentWillMount() {\n if(localStorage.getItem('userToken') == 'NaN'){\n //console.log(localStorage.getItem('userToken'));\n if(this.props.location.pathname != '/'){\n this.redirectToLogin();\n }\n }else{\n if(this.props.location.pathname == '/auth'){\n //return this.setUser();\n if(localStorage.getItem('userRole') == \"Fornitore\"){\n return browserHistory.push('/profilo-fornitore'); // reindirizzo alla home page\n }\n if(localStorage.getItem('userRole') == \"Banditore\"){\n return browserHistory.push('/banditore-pannel'); // reindirizzo alla home page\n }\n if(localStorage.getItem('userRole') == \"Supervisore\"){\n return browserHistory.push('/admin-pannel'); // reindirizzo alla home page\n }\n }\n }\n //listener per gli eventi che si possono verificare nell'applicazio\n eventBus.on('logout', () => this.onLogout());\n eventBus.on('toLogin', () => this.redirectToLogin());\n }", "componentDidMount() {\n\t\t//checkksto see if the user logged in is so we redirect him to dashboard\n\t\tif (this.props.auth.isAuthenticated) {\n\t\t\tthis.props.history.push('/dashboard');\n\t\t}\n\t}", "componentDidMount() {\n if (!localStorage.getItem(\"token\")) {\n this.props.history.push(\"/\");\n } else {\n api.auth.getCurrentUser().then(data => {\n if (data.error || this.props.authUser.id !== data.user.id) {\n this.props.history.push(\"/\");\n }\n });\n }\n }", "componentDidMount() {\n\n let currentUser = TokenService.getUserId();\n console.log(currentUser)\n\n //if the user is not logged in, send him to landing page\n if (!TokenService.hasAuthToken()) {\n window.location = '/';\n }\n }", "function checkAuthentificationState(){\n //Check if user is authorized\n var isAuthorized = checkLoginState();\n //React\n if(isAuthorized){\n showLoggedInView();\n }else{\n showLoggedOutView();\n }\n}", "componentDidMount(){\n const {setCurrentUser} = this.props;\n this.unsubscribeFromAuth = auth.onAuthStateChanged(async userAuth => {\n //this.setState({currentUser:user});\n //createUserProfileDocument(user);\n //console.log(user);\n alert(\"Into Component Did Mount of App.js********************************\");\n console.log(\"Into Component Did Mount of App.js********************************\");\n console.log(\"Unsubscribe from Auth is \" + this.unsubscribeFromAuth);\n \n if(userAuth){ //userAuth will be False if UserAuth is failed...i.e. when user is not logged in..still as guest\n alert(\"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Into UserAUth if condition^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\");\n const userRef = await createUserProfileDocument(userAuth); // store user profile in db\n // userRef.onSnapshot(snapShot =>{ // set the current user props in set state\n // this.setState({\n // currentUser:{\n // id:snapShot.id,\n // ...snapShot.data()\n // }\n // },alert(\"Set State Done in if condition\"))\n // })\n\n userRef.onSnapshot(snapshot => {\n setCurrentUser({\n id:snapshot.id,\n ...snapshot.data()\n });\n })\n\n\n }else{\n alert(\"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Into UserAUth ELSE condition^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\")\n //alert(\"***********BEFORE CURRENT USER SET STATE*******************\");\n setCurrentUser(userAuth,alert(\"Set State Done in else condition\")) // when the user logs out set the currentUser to Null\n\n }\n\n //*****AFter set state render method is called againb */\n //alert(\"***********AFTER CURRENT USER SET STATE*******************\");\n console.log(\"User Auth is \" + userAuth);\n console.log(this.state) // if the user has not signin then currentUser will be null\n\n alert(\"OUT of Component Did Mount of App.js********************************\")\n });\n }", "componentWillMount(){\n if(window.sessionStorage.getItem(\"loggedIn\") != 1){\n alert(\"Not logged in\");\n this.setState({ redirect: '/' });\n }\n }", "checkLoggedIn() {\n this.isLoggedIn(null);\n }", "componentDidMount(){\n fire.auth().onAuthStateChanged((user)=>{\n if(user){\n window.location.href = '/admin';\n }\n else{\n this.setState(\n {logged:0}\n );\n }\n })\n }", "function checkLoggedIn() {\n const configObj = {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n Accept: \"application/json\",\n },\n };\n fetch(DATABASE + \"/users\", configObj)\n .then((resp) => resp.json())\n .then((user) => {\n if (user) redirectAfterLogIn(user);\n })\n .catch((err) => console.log(err.message));\n}", "async componentDidMount() {\n\n if (!isLoggedIn()) { // for not loged user go to login\n navigate(`/login`)\n }\n _this.getlogWorks();\n }", "function App() {\n\n const [state, setState] = useState({\n loggedInStatus: false,\n user: {}\n })\n\n const checkLoginStatus = () =>{\n axios.get(\"http://localhost:3001/logged_in\", { withCredentials: true}).then(response =>{\n if (response.data.logged_in && state.loggedInStatus === false){\n setState({\n loggedInStatus: true,\n user: response.data.user\n })\n } else if (!response.data.logged_in && state.loggedInStatus === true){\n setState({\n loggedInStatus: false,\n user: {}\n })\n }\n // console.log(\"logged in?\", response);\n }).catch(error =>{\n console.log(\"logged in error\", error)\n })\n }\n\n useEffect(()=>{\n checkLoginStatus()\n })\n\n const handleLogin = (data) =>{\n setState({\n loggedInStatus: true,\n user: data.user\n })\n }\n\n const handleLogout = () =>{\n\n setState({\n loggedInStatus: false,\n user: {}\n })\n console.log(state)\n }\n\n return (\n <div className=\"App\">\n <Router>\n {state.loggedInStatus ? (\n <Route\n\n path={\"/\"}\n render={props => (\n <Dashboard { ...props} handleLogout={handleLogout} user={state.user} loggedInStatus={state.loggedInStatus}/>\n )}\n />\n ) : (\n <Route\n\n path={\"/\"}\n render={props => (\n <Auth { ...props} handleLogin={handleLogin} loggedInStatus={state.loggedInStatus}/>\n )}\n />\n )}\n\n\n\n </Router>\n\n </div>\n );\n}", "function checkUserValidation() {\n const authUser = CACHE.getAuthenticatedUser();\n if (!authUser) {\n $('body').html('You are not authorized to view this page.');\n window.open('/', '_self');\n }\n}", "function checkUserValidation() {\n const authUser = CACHE.getAuthenticatedUser();\n if (!authUser) {\n $('body').html('You are not authorized to view this page.');\n window.open('/', '_self');\n }\n}", "checkLogin() {\n firebase.auth().onAuthStateChanged((user) => {\n if(user) {\n this.setState({\n isLogined: true\n });\n } else {\n this.setState({\n isLogined: false\n });\n }\n })\n }", "componentDidMount() {\n if (this.props.loginUser) {\n this.setState({ user: this.props.loginUser, valid: true });\n }\n }", "async function checkIfLoggedIn() {\n // let's see if we're logged in\n const token = localStorage.getItem(\"token\");\n const username = localStorage.getItem(\"username\");\n\n // if there is a token in localStorage, call User.getLoggedInUser\n // to get an instance of User with the right details\n // this is designed to run once, on page load\n currentUser = await User.getLoggedInUser(token, username);\n await generateStories();\n\n if (currentUser) {\n showNavForLoggedInUser();\n fillUserInfo();\n $userProfile.show();\n }\n else{\n $userProfile.hide();\n }\n }", "function checkUser() {\n\tif (user) {\n\t\tconsole.log(\"Signed in as user \" + user.email);\n\t\t// console.log(user);\n\t\thideLoginScreen();\n\t} else {\n\t\tconsole.log(\"No user is signed in\");\n\t}\n}", "async function checkLogin() {\n try {\n const userResponse = await axios.get('/api/auth/check_login');\n if (userResponse.status === 200) {\n setLoggedIn(true);\n \n }\n } catch {\n setLoggedIn(false);\n console.log(\"User is not logged in\");\n }\n }", "function checkAuth() {\n if (CONFIG.userLogged) {\n $location.path('/home');\n }\n }", "render() {\n if (localStorage.getItem('isLoggedIn') !== \"true\") {\n return (\n <div className=\"main\">\n <h5 className=\"display-4 text-center\">Account Dashboard</h5>\n <hr></hr>\n <h1 className=\"display-9 text-center\">Not Logged In. Please log in to see the dashboard</h1>\n\n </div>\n )\n } else if (this.state.isAdmin === true) {\n return (\n <div className=\"main\">\n\n <Redirect to=\"/Admin\" />\n\n </div>\n )\n }\n else if (this.state.isEmployee === true) {\n return (\n <div className=\"main\">\n <Redirect to=\"/Employee\" />\n\n </div>\n )\n }\n else if (this.state.isCustomer === true) {\n return (\n <div className=\"main\">\n <Redirect to=\"/Customer\" />\n </div>\n )\n }\n else {\n\n //A VERY UNLIKELY SCENARIO - IN CASE user attempts to access a dashboard through illegal means.\n return (\n <div className=\"main\">\n <h5 className=\"display-4 text-center\">Account Dashboard</h5>\n <hr></hr>\n <h1 className=\"display-9 text-center\">No Account Defined. Please contact your local admin.</h1>\n\n </div>\n )\n }\n }", "componentDidMount() {\n if (this.props.context.authUser) {\n this.props.history.push('/signuperror')\n }\n }", "function checkUser(request , response){\n var user;\n\n // Check if the user was already autentified in studion\n var token = getToken(request.urlQuery);\n\n if (token.length > 0) {\n\n user = storage.tokens[token];\n if (user) {\n loginByPassword(user.name, user.pass); \n }\n }\n\n if (!currentSession().belongsTo('Admin')) {\n response[\"headers\"].LOCATION = '/login/';\n } else {\n response[\"headers\"].LOCATION = '/index.html';\n }\n}", "componentDidMount(){ \n // check fro error\n if(this.props.error){\n return toast.error(this.props.error)\n }\n \n // If auth,redirect to /users/main\n if(this.props.isAuth){\n this.props.history.push(\"/users/main\")\n }\n }", "componentDidMount(){\n console.log('requireNoAuth.did.mount isAuthenticated:', this.props.isAuthenticated);\n this.onAuthCheck(this.props);\n }", "async checkUserSignedIn(){\n\t\ttry {\n\t\t\tlet profile = await Storage.getProfile();\n\t\t\tif (profile == null){\n\t\t\t\t//user hasn't signed in\n\t\t\t\tthis.setState({isChecking: false});\n\t\t\t} else {\n\t\t\t\tthis.setState({isChecking: false});\n\t\t\t\tthis.props.navigation.navigate('Main');\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tAlert.alert('Something Went Wrong');\n\t\t\t//user hasn't signed in\n\t\t\tthis.setState({isChecking: false});\n\t\t}\n\t}", "componentDidMount(){\n let check = checkUser()\n if(check){\n this.props.history.push(\"/movie\")\n }\n }", "componentDidMount() {\n this.checkAuth();\n }", "componentDidMount() { \r\n // redirect an already logged-in employee to the private area\r\n this.handleLoggedIn();\r\n }", "async componentDidMount() {\r\n\t\tif (!this.props.isAuthenticated) {\r\n\t\treturn;\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\tconst users = await this.users();\r\n\t\t\tthis.setState({ users });\r\n\t\t\tconst projects = await this.projects();\r\n\t\t\tthis.setState({ projects });\r\n\t\t} catch (e) {\r\n\t\t\talert(e);\r\n\t\t}\r\n\r\n\t\tthis.setState({ isLoading: false });\r\n\r\n\t\t//If the user is inactive, the system log out the user and redirect him to the login page\r\n\t\tif( getLoggedInUserInfo(this.state.users).tx_stts === \"Inactive\" )\r\n\t\t{\r\n\t\t\talert(\"Your account is currently inactive, please ask the administrator to activate your account\");\r\n\t\t\tawait Auth.signOut();\r\n\t\t\tthis.props.userHasAuthenticated(false);\r\n\t\t\tsetCookie(\"tx_user_mail\", \"\");\r\n\t\t\tthis.props.history.push(\"/login\");\t\t\t\r\n\t\t}\t\r\n\t}", "isLoggedIn() {\n if (user) {\n return true\n } else {\n return false\n }\n }", "checkAuth() {\n let userLoggedIn = false;\n const token = localStorage.getItem('token');\n\n // check if there's a token in storage\n if(token) {\n const reqObj = {\n token: token\n };\n\n fetch(deploymentConfig().apiUrl + '/api/auth/check', {\n method: 'POST',\n body: JSON.stringify(reqObj)\n })\n .then((resp) => resp.json())\n .then(res => {\n if(res.auth) { // authentication is valid\n userLoggedIn = true;\n if(this.state.userLoggedIn !== userLoggedIn) {\n this.setState({userLoggedIn});\n }\n } else { // auth invalid\n localStorage.removeItem('token');\n window.location.hash = deploymentConfig().baseUrl + '#/login';\n }\n });\n } else { // no token = no auth\n if(!document.location.hash.includes('login')) {\n window.location.hash = deploymentConfig().baseUrl + '#/login';\n }\n }\n\n // return value doesn't matter, auth logic is handled within function\n return true;\n }", "componentDidMount() {\n this.shouldNavigateAway(() => {\n this.props\n .dispatch(getAuthedUser(this.props.auth, this.props.id))\n .then(() => this.setState({ loading: false }));\n });\n }", "function checkAuthorised() {\n var loggedIn = isLoggedIn();\n $q.when(loggedIn, function (res) {\n if (res.data === false) {\n state.go('home');\n }\n });\n }", "componentDidMount(){\n if(this.props.auth.isAuthenticated) {\n this.props.getUsers();\n this.setState({user: this.props.auth.user});\n } else {\n this.props.history.push(\"/\");\n }\n }", "async componentWillMount() {\n const res = await axios.post(window.location.origin + \"/currentuser\");\n if (res.data.success) {\n this.setState({ cookie: res.data.cookie });\n }\n //decode cookie from server\n let decoded = jwtDecode(this.state.cookie);\n //get role of user to redirect them to their page\n if (decoded.role === 1) {\n this.setState({ isAdmin: true });\n } else if (decoded.role === 0 && decoded.reg === 1) {\n this.setState({ isUser: true });\n } else if (decoded.paid === 1) {\n this.setState({ inVideochat: true });\n } else {\n this.setState({ isReg: true });\n }\n }", "componentWillMount() {\n firebase.auth.onAuthStateChanged((user) => {\n if (user) {\n this.checkRole(user, 'admin');\n this.checkRole(user, 'leaders');\n } else {\n this.setState({ adminSignedIn: false, leaderSignedIn: false }); \n }\n });\n }", "componentDidMount(){\n const auth = localStorage.getItem('username')\n if (auth){\n window.location.replace('/Main')\n }\n }", "_loginRedirect() {\n if (!this.isLoading && !this.hasUser) {\n this.props.history.push('/login');\n }\n }", "componentDidMount() {\n if (!this.props.user) {\n apolloClient.query({\n query: WHOAMI,\n variables: {},\n })\n .then(data => {\n if (data && data.data && data.data.whoami) {\n this.props.setUser(data.data.whoami);\n }\n })\n // eslint-disable-next-line no-console\n .catch(error => console.error('Error checking backend for existing session', error))\n .finally(() => this.props.setChecked());\n }\n }", "isLogged(){\n return !!user; /* si es nulo la doble negacion retorna False si existe retorna True, llamarlo en PrivateRoute */\n }", "function isUserLoggedIn() {\n // Replace with your authentication check logic\n return true;\n}", "checkUser() {\n\t\tthis.context.loginClient\n\t\t\t.query({\n\t\t\t\tquery: this.GET_USERS_QUERY,\n\t\t\t\tvariables: {\n\t\t\t\t\tCode_User: `'${document.getElementById('username').value}'`,\n\t\t\t\t\tPassword: `'${document.getElementById('pass').value}'`\n\t\t\t\t},\n\t\t\t\tfetchPolicy: 'no-cache'\n\t\t\t})\n\t\t\t.then((data) => {\n\t\t\t\tif (data.data.getvalid_users) {\n\t\t\t\t\tconst user = data.data.getvalid_users;\n\t\t\t\t\tif (user.IsActive == 0) {\n\t\t\t\t\t\tlocalStorage.clear();\n\t\t\t\t\t\tthis.props.handleOpenSnackbar('error', 'Error: Loading users: User invalid');\n\t\t\t\t\t\tthis.setState({ loadingLogin: false });\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (document.getElementById('pass').value === 'TEMP') {\n\t\t\t\t\t\t\tlocalStorage.setItem('ChangePassword', user.Id);\n\t\t\t\t\t\t\twindow.location.href = '/reset';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tlocalStorage.setItem('ChangePassword', user.Id);\n\t\t\t\t\t\t\tlocalStorage.setItem('LoginId', user.Id);\n\t\t\t\t\t\t\tlocalStorage.setItem('CodeUser', user.Code_User);\n\t\t\t\t\t\t\tlocalStorage.setItem('FullName', user.Full_Name);\n\t\t\t\t\t\t\tlocalStorage.setItem('Token', user.Token);\n\t\t\t\t\t\t\tlocalStorage.setItem('IdRoles', user.Id_Roles);\n\t\t\t\t\t\t\tlocalStorage.setItem(\"Id_Entity\", user.Id_Entity);\n\t\t\t\t\t\t\tlocalStorage.setItem('IdSchedulesEmployees', user.IdSchedulesEmployees);\n\t\t\t\t\t\t\tlocalStorage.setItem('IdSchedulesManager', user.IdSchedulesManager);\n\n\t\t\t\t\t\t\tlocalStorage.setItem('isEmployee', user.Id_Roles == 13 ? true : false);\n\n\t\t\t\t\t\t\tif (user.Id_Roles == 1 || user.Id_Roles == 10 || user.Id_Roles == 2) { localStorage.setItem('ShowMarkup', true); }\n\t\t\t\t\t\t\telse { localStorage.setItem('ShowMarkup', false); }\n\n\t\t\t\t\t\t\tif (user.IsAdmin == 1) {\n\t\t\t\t\t\t\t\tlocalStorage.setItem('IsAdmin', true);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tlocalStorage.setItem('IsAdmin', true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (user.AllowEdit == 1) {\n\t\t\t\t\t\t\t\tlocalStorage.setItem('AllowEdit', true);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tlocalStorage.setItem('AllowEdit', true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (user.AllowDelete == 1) {\n\t\t\t\t\t\t\t\tlocalStorage.setItem('AllowDelete', true);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tlocalStorage.setItem('AllowDelete', true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (user.AllowInsert == 1) {\n\t\t\t\t\t\t\t\tlocalStorage.setItem('AllowInsert', true);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tlocalStorage.setItem('AllowInsert', true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (user.AllowExport == 1) {\n\t\t\t\t\t\t\t\tlocalStorage.setItem('AllowExport', true);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tlocalStorage.setItem('AllowExport', true);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\twindow.location.href = '/home';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tlocalStorage.clear();\n\t\t\t\t\tthis.props.handleOpenSnackbar('error', 'Error: Loading users: User not exists in data base');\n\t\t\t\t\tthis.setState({ loadingLogin: false });\n\t\t\t\t}\n\t\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\tthis.props.handleOpenSnackbar('error', 'Error: Validating user: ' + error);\n\n\t\t\t\tthis.setState({ loadingLogin: false });\n\t\t\t});\n\t}", "componentWillMount() {\n\t\tif (cookie.load(\"userId\") == null) {\n\t\t\tthis.props.setLoggedIn(-1);\n\t\t} else {\n\t\t\tif (!(cookie.load(\"userId\") == -1)) {\n\t\t\t\tthis.props.setLoggedIn(cookie.load(\"userId\"));\n\t\t\t\tthis.props.history.push({\n\t\t\t\t\tpathname: '/user/form',\n\t\t\t\t});\n\t\t\t}\n }\n\t}", "checkLoginState() {\n if (this.state.loggedIn === 1) return <HomePageRouter />;\n else return <AuthPageRouter />;\n }", "componentWillMount() {\n\t\tif(!this.checkForLogin())\n\t\t\tthis.showLogin();\n\t\telse\n\t\t\tthis.showHome();\n\t}", "componentDidMount() {\n AOS.init();\n $(\"input[type='username']\")[0].focus();\n\n axios.get(`${getHost()}/restaurantEnter/login`).then((response)=>{\n if(response.data.loggedIn === true){\n if(window.location.href = \"/entry\"){\n window.location.href= \"/restaurant_admin\";\n }\n }\n else{\n \n }\n \n })\n }", "componentDidMount()\n\t{\n\t\t// runs before render()\n\t\t// ensure we do not go to register if we are already logged in\n\t\tif (global.client != null)\n\t\t{\n\t\t // go back where we came from\n\t\t this.props.navigation.goBack();\n\t\t}\n }", "componentDidUpdate(){\n console.log(this.props.auth)\n if(Object.keys(this.props.auth.user).length === 0){\n window.location.href = \"/\"\n }\n }", "async function checkIfLoggedIn() {\n // let's see if we're logged in\n const token = localStorage.getItem(\"token\");\n const username = localStorage.getItem(\"username\");\n\n // if there is a token in localStorage, call User.getLoggedInUser\n // to get an instance of User with the right details\n // this is designed to run once, on page load\n if (token && username){\n currentUser = await User.getLoggedInUser(token, username);\n }\n \n await generateStories(); // generate main story feed\n\n if (currentUser) {\n // if user logged in, show custom logged in components\n showNavForLoggedInUser();\n $submitForm.show();\n await generateFavorites();\n $favoriteArticles.show();\n // updated user information at the bottom of the page\n $(\"#profile-name\").append(currentUser.name);\n $(\"#profile-username\").append(currentUser.username);\n $(\"#profile-account-date\").append(currentUser.createdAt);\n }\n }", "async function validloggued() {\n const user = await AsyncStorage.getItem(\"user\");\n if (user)\n dispatch({\n type: AUTH_LOGUIN,\n payload: user,\n });\n else\n dispatch({\n type: AUTH_LOGUOT,\n payload: null,\n });\n }", "async function checkIfLoggedIn() {\n // let's see if we're logged in\n const token = localStorage.getItem(\"token\");\n const username = localStorage.getItem(\"username\");\n\n // if there is a token in localStorage, call User.getLoggedInUser\n // to get an instance of User with the right details\n // this is designed to run once, on page load\n currentUser = await User.getLoggedInUser(token, username);\n\n hideElements();\n\n $allStoriesList.removeClass(\"hidden\");\n $loadMore.removeClass(\"hidden\");\n\n await generateStories();\n\n if (currentUser) {\n showNavForLoggedInUser();\n }\n }", "componentDidMount() {\r\n const {user} = this.context.state;\r\n\r\n if (Object.keys(user).length) {\r\n this.props.history.push('/');\r\n }\r\n }", "componentDidMount() {\n const auth = new Auth(); \n\n // The Auth() class handles the Authentication and redirects the User based on the success of the authentication. \n auth.handleAuthentication(); \n }", "componentDidMount() {\n const loggedinUser = localStorage.getItem('user');\n if (loggedinUser) {\n const foundUser = JSON.parse(loggedinUser)\n this.setState({user: foundUser})\n this.setState({isLoggedIn: true})\n }\n this.setState({isLoading: false})\n }", "componentDidMount() {\n if (this.props.currentUser && Object.values(this.props.user).length < 1) {\n this.props.fetchUser(this.props.currentUser.id)\n }\n }", "componentDidMount() {\n\n // Check if logged in\n Axios.get(\n process.env.REACT_APP_API_URL + '/users/login/check',\n {\n headers: {\n 'Content-Type': 'application/json',\n 'Accept': 'application/json'\n },\n\n withCredentials: true\n }\n ).then(({ data }) => {\n if (data.data.isloggedin) {\n this.setState({ isloggedin: true });\n }\n }).catch(err => {\n this.setState({ isloading: false });\n });\n\n }", "isLoggedIn() {\n return localStorage.getItem('user') != null\n }", "isUserLoggedIn() {\n return null !== sessionStorage.getItem('username') && null !== sessionStorage.getItem('accessToken')\n }", "componentWillMount() {\n if (!this.props.authenticated) {\n this.context.router.push('/signin');\n }\n }", "checkIfLoggedIn(){\n if(!this.state.cookies.get('user')) {\n window.location.href = '/signup';\n } else {\n this.setState({user: this.state.cookies.get('user')._id}, () => console.log(this.state))\n }\n }", "async isLoggedIn() {\n const user = {};\n //await Parse.User.currentAsync();\n if (user) {\n Actions.homeScreen();\n } else {\n Actions.loginScreen();\n }\n }", "async function checkIfLoggedIn() {\n // let's see if we're logged in\n const token = localStorage.getItem(\"token\");\n const username = localStorage.getItem(\"username\");\n\n // if there is a token in localStorage, call User.getLoggedInUser\n // to get an instance of User with the right details\n // this is designed to run once, on page load\n currentUser = await User.getLoggedInUser(token, username);\n await generateStories();\n\n if (currentUser) {\n showNavForLoggedInUser(currentUser);\n }\n }", "componentDidMount() {\n this.setState(\n { user: JSON.parse(localStorage.getItem(\"LogedInUser\")) },\n () => {\n if (this.state.user == null) history.push(\"/\");\n }\n );\n this.getPostsFromApi();\n }", "checkLoggedStatus() {\n\t\tif (sessionStorage.auth_token) {\n\t\t\tthis.setState({\n\t\t\t\tisLoggedIn: true\n\t\t\t})\n\t\t}\n\t}", "async function checkIfLoggedIn() {\n // let's see if we're logged in\n const token = localStorage.getItem(\"token\");\n const username = localStorage.getItem(\"username\");\n\n // if there is a token in localStorage, call User.getLoggedInUser\n // to get an instance of User with the right details\n // this is designed to run once, on page load\n currentUser = await User.getLoggedInUser(token, username);\n if (currentUser) {\n await showNavForLoggedInUser();\n }\n await generateStories();\n }", "async function checkAuthState() {\n //Confirm if user is authenticated and signed in\n try {\n await Auth.currentAuthenticatedUser();\n //Console -> Success Message\n console.log('✅ User is signed in');\n //Set user auth state -> Logged In\n setUserLoggedIn('loggedIn');\n } catch (err) {\n //Else, console -> error message\n console.log('❌ User is not signed in');\n //Set User Auth State -> Logged Out\n setUserLoggedIn('loggedOut');\n }\n }", "componentDidMount(){\n var nav = this.props.navigator;\n BackAndroid.addEventListener('hardwareBackPress', () => {\n if (nav.getCurrentRoutes().length === 1 ) {\n return false;\n }\n nav.pop();\n return true;\n });\n var self = this;\n\n //Checks if user is already logged in\n firebase.auth().onAuthStateChanged(function(user) {\n //goes to the list view page if the user is already logged in\n if (user) {\n\n self.props.navigator.immediatelyResetRouteStack([{name: 'MyListView'}]);\n\n } else {\n // goes to login page when the user isn't logged in\n self.props.navigator.popToTop();\n\n\n self.props.navigator.immediatelyResetRouteStack([{name: 'Login'}]);\n return;\n }\n });\n }", "componentWillMount() {\n\t\t\tif (!this.props.isAuthenticated) {\n\t\t\t\tthis.props.history.push(\"/signin\");\n\t\t\t}\n\t\t}", "isLoggedIn() {\n return _isObject(this.user) &&\n _isNumber(this.user.id) && this.user.id !== GUEST_USER_ID\n }", "isLoggedIn() {\n return _isObject(this.user) &&\n _isNumber(this.user.id) && this.user.id !== GUEST_USER_ID\n }", "function checkUser() {\n\tif (sessionStorage.getItem(\"userID\") === null) {\n\t\twindow.location.href = \"../../index.html\";\n\t} else {\n\t\tdocument.getElementById(\"signOutDiv\").setAttribute(\"style\", \"display:block;\");\n\t\tdocument.getElementById(\"signUpDiv\").setAttribute(\"style\", \"display:none;\");\n\t}\n}", "componentDidMount() {\n this.unregisterAuthObserver = firebase.auth().onAuthStateChanged(\n (user) => {\n this.setState({isSignedIn: !!user});\n this.setLoggedIn(!!user);\n }\n );\n }", "checkAuth(){\n if (localStorage.getItem('token') === \"\") {\n console.log(\"not logged in\");\n\n this.setState(prevState => ({\n \n auth: !prevState.auth\n }))\n\n\n\n \n console.log(this.state.auth)\n }\n else {\n console.log(\"user logged in\");\n this.setState(prevState => ({\n auth: this.state.auth\n }))\n console.log(this.state.auth)\n }\n \n \n }", "componentDidMount() {\n axios.get(\n process.env.REACT_APP_API_URL + '/users/login/check', {\n headers: {\n 'Content-Type': 'application/json',\n 'Accept': 'application/json'\n },\n withCredentials: true\n }\n ).then(res => {\n this.setState({ isloggedin: true, isloading: false });\n }).catch(err => {\n this.setState({ isloggedin: false, isloading: false });\n });\n }", "function checkLoggedIn() {\n if (window.location.pathname == \"/\" || window.location.pathname == \"/Register\") {\n if (getUsernameCookie() != \"\") {\n window.location.pathname = \"/Homepage\";\n }\n } else {\n if (getUsernameCookie() == \"\") {\n window.location.pathname = \"/\";\n }\n }\n}", "static validateAuthorization(props) {\n\t\tif (localStorage.getItem('user')) props.history.push('/');\n\t}", "componentWillUpdate(nextProps) {\n if(!this.state.authenticated) {\n // Use your router to redirect them to login page\n }\n }", "handleLogin(e) {\n e.preventDefault();\n\n axios.post('/api/login', {\n username: this.state.username,\n password: this.state.password\n })\n .then(response => {\n if (response.data.authenticated) {\n // if the user is a doctor, redirects to /patients,\n // if user is patient, redirects to /overview\n if (response.data.isDoctor) {\n browserHistory.push('/patients');\n } else {\n browserHistory.push('/overview');\n }\n } else {\n // Set a message for failed login\n this.setState({\n message: response.data.message\n });\n }\n })\n .catch(error => {\n console.log('Error in login: ', error);\n browserHistory.push('/login');\n });\n\n }", "componentDidMount() {\n\t\tthis.unregisterAuthObserver = firebase.auth().onAuthStateChanged(user =>{\n console.log(\"Auth state changed!\");\n if(user) {\n this.props.signInSuccess(user);\n }\n\t\t});\n\t}", "componentDidMount() {\n this.authUnRegFunc = firebase.auth().onAuthStateChanged(firebaseUser => {\n if (firebaseUser) {\n this.setState({ user: firebaseUser, loading: false });\n } else {\n this.setState({ user: null, loading: false });\n }\n });\n }", "componentDidMount(){\n if(localStorage.getItem('userAuthToken')){\n this.setState({ isAuthenticated: true })\n }\n }", "componentWillMount() {\n // Sync the state from Firebase\n base.syncState(\"users\", {\n context: this,\n state: \"users\"\n });\n\n // Check if they have logged in before\n const localStorageUser = localStorage.getItem(\"pizza-love\");\n if (localStorageUser) {\n this.setState({ currentUser: localStorageUser });\n console.log(\"User Loaded from Local Storage\");\n }\n }", "componentDidMount(){\n firebase\n .auth()\n .onAuthStateChanged((user)=>{\n if(user){\n this.props.history.push('/home')\n console.log('User Redirected')\n }\n })\n }", "componentWillMount() {\n this.handleMountedLogin();\n }" ]
[ "0.741374", "0.7395984", "0.7139761", "0.69564575", "0.691879", "0.679675", "0.67255414", "0.67246497", "0.6704702", "0.66541594", "0.66535926", "0.6607667", "0.6605635", "0.6595049", "0.6582313", "0.65817094", "0.6576838", "0.64852655", "0.6480433", "0.6473142", "0.6471758", "0.6468446", "0.6461943", "0.6433361", "0.64217234", "0.6420075", "0.64116424", "0.63909453", "0.63874686", "0.63874686", "0.6372267", "0.63713384", "0.63510597", "0.6340739", "0.633929", "0.63365626", "0.6326043", "0.631507", "0.6304243", "0.6291213", "0.62900823", "0.62895787", "0.6289189", "0.6273205", "0.62620455", "0.6260787", "0.6257735", "0.62402534", "0.6237546", "0.62292325", "0.62261707", "0.62164134", "0.620672", "0.6206326", "0.62046367", "0.6197404", "0.61930555", "0.61877924", "0.6187678", "0.61819595", "0.6177798", "0.61754405", "0.61628467", "0.61550236", "0.6145603", "0.61409205", "0.61333954", "0.6126235", "0.6126039", "0.6125374", "0.6120161", "0.6116027", "0.61153257", "0.61122537", "0.6111184", "0.61086345", "0.6108307", "0.6099379", "0.6097762", "0.6095754", "0.6093388", "0.60852873", "0.60719323", "0.6066788", "0.60665184", "0.6065575", "0.6065575", "0.606467", "0.6060972", "0.60560834", "0.6054981", "0.6050108", "0.6046811", "0.60418683", "0.60410005", "0.6039996", "0.603507", "0.60292727", "0.6024275", "0.6018745", "0.60162675" ]
0.0
-1
Retrieves a custom parameter of a Run user. The Run user is identified by the token in the constructor.
async getItem(tagoRunURL, key) { const result = await this.doRequest({ path: `/run/${tagoRunURL}/sdb/${key}`, method: "GET", }); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUserToken(){\n\t\treturn $cookies.get('user.token');\n\t}", "function getUserToken(sID, rID){\n\tvar parametersCall = {\n\t\tproviderID : provId,\n\t\tapplicationID : appId,\n\t\tsessionID : sID,\n\t\trunaID : rID\n\t}\n\tnoTokenCall('GET','https://'+VAR_STAG_URL+'runaservices.corriere.it/runaClientExt/preferences/api/getToken', parametersCall, 'getUserToken');\n}", "function getUserFromToken() {\n const token = getToken();\n return token ? JSON.parse(atob(token.split('.')[1])).user : null;\n}", "static getUserToken(){\n let token = JSON.parse(localStorage.getItem('USER')).token;\n return token;\n }", "static getUserToken(){\n let token = JSON.parse(localStorage.getItem('USER')).token;\n return token;\n }", "function fetchArg(context, cb) {\n try{ \n let theUserId = getUserIdFromPrincipals(context);\n if(theUserId == '') {\n let tknVal = getTokenValue(context);\n if(tknVal !== '') {\n app.models.AccessToken.findOne({where: {id : tknVal}}, function(err, ret) {\n cb(err, ret);\n });\n }else{\n cb(null, {});\n }\n }else{\n cb(null, {userId: theUserId});\n }\n } catch(e){\n console.log('Error in Role Resolver: Fetch Argument... '+ e);\n }\n }", "function getUser(token){\n const tokenParts = token.split('.');\n const encodedPayload = tokenParts[1];\n const rawPayload = atob(encodedPayload);// atob zet versleutelde data om te zetten naar leesbare tekst\n const user = JSON.parse(rawPayload); // user uit token halen zonder dat je code nodig hebt.\n return user;\n}", "get user() { return this.args.user }", "function getToken() {\n return token;\n }", "getUser() {\n return decode(this.getToken());\n }", "get token() {\n return (this.tokenGenerated) ? this.config.token : new Error(\"Token not Generated... Please use getUserToken()\");\n }", "function resolve_user_from_locals_token(request, callback){\n user_controller.findUser(request.locals.authenticated_user.id, request.locals.authenticated_user.is_admin, function(data){\n callback(data);\n });\n}", "getUser() {\n return decode(this.getToken());\n }", "requestToken() {\n return this.get('request-token');\n }", "get user() {\n return this.fapp.get('user');\n }", "function getTokenValue(context, cb) {\n try{\n let tokenVal = '';\n /*if(context && context.remotingContext) {\n if(context.remotingContext.args) {\n if(context.remotingContext.args.auth_user_id)\n tokenVal = context.remotingContext.args.auth_user_id;\n else if(context.remotingContext.args.custom && context.remotingContext.args.custom.auth_user_id)\n tokenVal = context.remotingContext.args.custom.auth_user_id;\n } else if(context.remotingContext.req) {\n if(context.remotingContext.req.query) {\n if(context.remotingContext.req.query.accesstoken)\n tokenVal = context.remotingContext.req.query.accesstoken;\n else if(context.remotingContext.req.query.access_token)\n tokenVal = context.remotingContext.req.query.access_token;\n }\n }\n }*/\n // if(typeof context.remotingContext.args.auth_user_id !== 'undefined')\n // tokenVal = context.remotingContext.args.auth_user_id;\n // else if(typeof context.remotingContext.req.query.accesstoken !== 'undefined')\n // tokenVal = context.remotingContext.req.query.accesstoken;\n // else if(typeof context.remotingContext.req.query.access_token !== 'undefined')\n // tokenVal = context.remotingContext.req.query.access_token;\n // else if(typeof context.remotingContext.args.custom.auth_user_id !== 'undefined')\n // tokenVal = context.remotingContext.args.custom.auth_user_id;\n\n if(context.remotingContext.args) {\n if(context.remotingContext.args.accessToken)\n tokenVal = context.remotingContext.args.accessToken;\n else if(context.remotingContext.args.access_token)\n tokenVal = context.remotingContext.args.access_token;\n else if(context.remotingContext.args.apiParams) {\n if(typeof context.remotingContext.args.apiParams.accessToken !== 'undefined')\n tokenVal = context.remotingContext.args.apiParams.accessToken;\n else if(typeof context.remotingContext.args.apiParams.access_token !== 'undefined')\n tokenVal = context.remotingContext.args.apiParams.access_token;\n } \n }\n return tokenVal;\n } catch(e){\n console.log('Exception catched in Role Resolver: Getting Token value... ');\n console.log(e);\n }\n }", "function grabUserToken() {\n url = url.split('=');\n var newAccessToken = url[1];\n\n writeScript(newAccessToken);\n}", "getUserIdByToken(authKey) {\n const userData = this.app.readDataFile(userFilePath);\n const user = userData.find(item => item.token === authKey);\n\n return user ? user.id : false;\n }", "function userToken(payload) {\n return {\n type: _user.TOKEN,\n payload\n };\n}", "function userId(token){\n\tif(token) return token.split('.')[0];\n\treturn false;\n}", "function getUser () {return user;}", "getPipelineVariableForUser(incomingOptions, cb) {\n const Bitbucket = require('./dist');\n\n let apiInstance = new Bitbucket.PipelinesApi(); // String | The account // String | The UUID of the variable to retrieve.\n /*let username = \"username_example\";*/ /*let variableUuid = \"variableUuid_example\";*/ apiInstance.getPipelineVariableForUser(\n incomingOptions.username,\n incomingOptions.variableUuid,\n (error, data, response) => {\n if (error) {\n cb(error, null, response);\n } else {\n cb(null, data, response);\n }\n }\n );\n }", "function token(user) {\n return getUserToken(buildUser(user));\n}", "function getUserToken () {\n return getCurrentUser().then((currentUser) => {\n return currentUser.getIdToken(true);\n }).then((token) => {\n return getSignedInUser().then((user) => {\n return {\n user: user,\n token: token\n };\n });\n });\n }", "getValue() {\n return this.token;\n }", "function parseUser(token) {\n let name;\n jwt.verify(token, env.access_token_secret, (err, username) => {\n if (!err) {\n name = username;\n }\n });\n return name;\n}", "function getOAuthToken() {\n return ScriptApp.getOAuthToken();\n}", "function getUser(){\n return user;\n }", "get authTokenInput() {\n return this._authToken;\n }", "getUserID() {\n return this.userData.id;\n }", "getToken() { return this.token.getToken(); }", "function getUserID() {\n\n var token = getCookie()\n if (token == \"guest\") {\n return 'guest'\n }\n var decodedJWT = jwt_decode(token);\n return decodedJWT.sub\n}", "function getTokenPayload(token) {\n let payload = jwt.decode(token);\n return payload.username;\n }", "getValue() {\n const { variable } = this.props;\n if (this.props.user[variable]) return this.props.user[variable];\n\n return this.getDefault();\n }", "function addCustomTokenToRequest(uid, req) {\n return firebaseAdminApp.auth().createCustomToken(uid).then((token) => {\n console.log('Created Custom token for UID \"', uid, '\" Token:', token);\n req.user.token = token;\n });\n}", "function userId(decodedToken) {\n return jwt_1.readPropertyWithWarn(decodedToken, exports.mappingUserFields.id.keyInJwt);\n}", "function currentUserFromToken(req) {\n return decodedToken(req.headers.authorization.split('Bearer ')[1]);\n}", "tokenValue () {\n return this.currentToken.value()\n }", "getUserId() {\n const profile = this.getFhirUser();\n\n if (profile) {\n return profile.split(\"/\")[1];\n }\n\n return null;\n }", "getUserIdToken() {\n\t\treturn this.cognitoUser.getSignInUserSession().getIdToken().getJwtToken();\n\t}", "token() {\n return {\n id: this.id,\n role: this.role,\n };\n }", "getToken() {\n return this.token;\n }", "function getUserId(){\n VK.api(\"users.get\", { fields: 'timezone'}, \n function(data){ \n appUserId = data.response[0].id;\n appUserTimeZone = data.response[0].timezone;\n getHashtagsFromServerAndShow();\n }\n );\n }", "getToken() {\n return _token;\n }", "token() {\n return {\n _id: this._id,\n role: this.role\n }\n }", "getUser() {\n const token = localStorage.getItem('Authorization');\n let user = null;\n\n // If a token exists then decode it\n if (token) {\n const base64Url = token.split('.')[1];\n const base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/');\n const secondsSinceEpoch = new Date() / 1000;\n const parsedToken = JSON.parse(window.atob(base64));\n\n // If current date is after expiration date then destroy it\n if (secondsSinceEpoch > parsedToken.exp) {\n this.destroyToken();\n } else {\n user = parsedToken;\n }\n }\n\n return user;\n }", "function getUserNameValue() {\n return document.querySelector(\"#user-name\").value;\n}", "function getUser(param1, callback) {\n\n bot.api.users.info({user: param1}, function(err, result){\n callback(result.user.name);\n }); \n}", "function checkToken() {\n chrome.storage.local.get(\"token\", result => {\n var token = result.token;\n if (token != undefined) getUserId(token);\n else window.oauth2.start();\n });\n}", "function fetch_user_token()\n{\n if(document.cookie.indexOf(\"_bn_ut\")>=0)\n return getCookie(\"_bn_ut\");\n else\n {\n var err = {\"responseText\":'INVALID_TOKEN',\"status\":403};\n error_response(err);\n }\n}", "getUserName() {\n return this.userData.name;\n }", "get user() { return this.user_; }", "function getToken() {\n return token || null;\n }", "async function getUserOnJWT(token) {\n const e = new FormError();\n let user;\n let user_capabilities;\n try {\n // Attempt to decode the JWT token\n const data = decodeJWT(token);\n\n // We should have an ID attribute\n if (!data.id) throw new Error();\n\n // Check that we've got a valid session\n user = await User.findById(data.id);\n if (!user) throw new Error();\n\n const { meta_value } = await Usermeta.findOne({\n attributes: ['meta_value'],\n where: {\n user_id: user.id,\n meta_key: `${prefix}capabilities`,\n },\n });\n if (!meta_value) throw new Error();\n user_capabilities = meta_value.split('\"')[1];\n } catch (_) {\n e.set('session', 'Invalid session ID');\n }\n e.throwIf();\n\n return {\n user,\n user_capabilities,\n };\n }", "function fetchUserByToken(token) {\n return fetch({\n method: 'POST',\n url: 'http://localhost:3000/get-current-user',\n headers: new Headers({\n authorization: token,\n }),\n })\n .then(res => res.json())\n .catch(err => err);\n}", "getCurrentUserId() {\r\n return JSON.parse(localStorage.getItem(\"user\")).id;\r\n }", "retrieveUserHostedPropertyValue(incomingOptions, cb) {\n const Bitbucket = require('./dist');\n\n let apiInstance = new Bitbucket.PropertiesApi(); // String | The user // String | The key of the Connect app // String | The name of the property.\n /*let username = \"username_example\";*/ /*let appKey = \"appKey_example\";*/ /*let propertyName = \"propertyName_example\";*/ apiInstance.retrieveUserHostedPropertyValue(\n incomingOptions.username,\n incomingOptions.appKey,\n incomingOptions.propertyName,\n (error, data, response) => {\n if (error) {\n cb(error, null, response);\n } else {\n cb(null, '', response);\n }\n }\n );\n }", "function getUser() {\n return user;\n }", "get() {\n return {\n authenticated: authenticated,\n createLoginUrl: () => 'loginUrl',\n createLogoutUrl: () => 'logoutUrl',\n fullName: 'fName',\n ready: true,\n subject: zeroUuid,\n token: 'token',\n tokenParsed: {\n given_name: 'John',\n family_name: 'Doe',\n name: 'John Doe',\n email: '[email protected]',\n identity_provider: 'idir',\n idp_userid: zeroGuid,\n preferred_username: 'johndoe',\n realm_access: {},\n resource_access: {\n chefs: {\n roles: roles,\n },\n },\n },\n userName: 'uName',\n };\n }", "get apiUser() { return this.get('apiUser'); }", "function fetchToken() {\n $.getJSON(buildTokenUrl(), {command: 'request'}, response => {\n token = response.token;\n console.log(`session token fetched: ${token}`);\n });\n}", "getValue() {\n return this.token.access_token;\n }", "function findCurrentUser() {\n return \"stefan\"\n }", "function userName(decodedToken) {\n return jwt_1.readPropertyWithWarn(decodedToken, exports.mappingUserFields.userName.keyInJwt);\n}", "getToken() {\n return JSON.parse(localStorage.getItem(TOKEN_KEY));\n }", "function getSelectedSystemUser() {\n\treturn getCache(EXTRA_SYSTEM_USER);\n}", "function rawGetUserTokenByToken(token, tenant, callback)\n{\n\tvar\t_callback = callback;\n\n\tif(!apiutil.isSafeString(token)){\n\t\tvar\terror = new Error('token parameter is wrong');\n\t\tr3logger.elog(error.message);\n\t\t_callback(error, null);\n\t\treturn;\n\t}\n\n\tvar\t_tenant\t\t= apiutil.isSafeString(tenant) ? tenant.toLowerCase() : '';\n\tvar\t_orgtoken\t= token;\n\n\t// get unscoped token\n\trawGetUserUnscopedTokenbyTokenWrap(_orgtoken, function(err, jsonres)\n\t{\n\t\tvar\terror;\n\t\tif(null !== err){\n\t\t\terror = new Error('could not get user access token by ' + err.message);\n\t\t\tr3logger.elog(error.message);\n\t\t\t_callback(error, null);\n\t\t\treturn;\n\t\t}\n\n\t\t// save to local val\n\t\tvar\t_userid\t\t\t= jsonres.userid;\n\t\tvar\t_username\t\t= jsonres.user;\n\t\tvar\t_unscopedtoken\t= jsonres.token;\n\t\tvar\t_tokenexpire\t= jsonres.expire;\t\t\t\t\t\t\t// eslint-disable-line no-unused-vars\n\t\tvar\t_region\t\t\t= jsonres.region;\t\t\t\t\t\t\t// eslint-disable-line no-unused-vars\n\n\t\t// break when unscoped token\n\t\tif(!apiutil.isSafeString(_tenant)){\n\t\t\t_callback(null, _unscopedtoken);\n\t\t\treturn;\n\t\t}\n\n\t\t// get scoped user token\n\t\treturn rawGetScopedUserToken(_unscopedtoken, _username, _userid, _tenant, _callback);\n\t});\n}", "getProfile() {\n\t\treturn decode(this.getToken());\n\t}", "function getUsrToken() {\n //if (!isUsrTokenValid()) {\n // return \"\";\n //}else\n return localStorage.getItem(\"usrToken\");\n}", "function getUser() {\n return {\n name: 'Awotunde',\n handle: '@egunawo33', \n location: 'Orun, Aye'\n }\n}", "validateUser(token) {\n return this.name === token;\n }", "get_token_string(){\n return this.token_string;\n }", "assignToken() {\n this.token = `${this.username}-${new Date().toISOString()}-${Math.floor(Math.random() * 1000000)}`;\n }", "function getToken(){\n return localStorage.getItem(\"token\");\n}", "get token() {\n return this._token;\n }", "getUserName() {\n let loggedInUser = this.loginUserNameLabel.getText();\n console.log(`User is logged in as ${loggedInUser}`);\n return loggedInUser;\n }", "function getConfig(token, _function) {\n const myuri = uri + '/user/PL19-11/devices';\n let args = {\n headers: { \n \"Content-Type\": \"application/json\",\n \"Authorization\": \"JWT \" + token\n }\n };\n // direct way\n client.get(myuri, args, _function)\n}", "_getRunValue(options) {\n const mods = allModules();\n const applyWorkingDirectoryToken = (runSegment) => {\n if (runSegment.includes(':') || runSegment.startsWith(workingDirectoryToken) || mods.apps.includes(`ui-${runSegment}`) || mods.platforms.includes(runSegment)) {\n return runSegment;\n }\n return `${workingDirectoryToken}:${runSegment}`;\n };\n\n if (options.uiTest && options.uiTest.run) {\n return options.uiTest.run; // Pass a raw --run value to ui-testing\n } else if (options.run) {\n return options.run.split('/').map(applyWorkingDirectoryToken).join('/'); // Parse --run and apply token as needed\n } else {\n return workingDirectoryToken; // No --run specified, apply token\n }\n }", "function getIntheamToken(bot, message, userID, cb) {\n controller.storage.users.get(userID, (err, user) => {\n if (!err && user && user.token && user.token.length > 0) {\n const token = user.token;\n bot.botkit.log('found user token in local storage', token)\n cb(token)\n } else {\n bot.botkit.log('error getting user or user token from storage', err)\n bot.removeReaction(message, 'thinking_face')\n bot.reply(message, 'Looks like we haven\\'t been introduced yet. I\\'m Slackwarrior and I\\'m here to help you manage your tasks. Please feel free to ask me for `help` any time. :robot_face:')\n }\n })\n}", "get userInput() {\n return this._user;\n }", "getUserDataScript(registerpath)\n\t{\n\t\tif(r3IsEmptyString(registerpath, true)){\n\t\t\tconsole.error('registerpath(' + JSON.stringify(registerpath) + ') parameter is wrong.');\n\t\t\treturn null;\n\t\t}\n\n\t\t// get user token script by expanding template\n\t\tlet\tuserDataScript = this.r3Context.getExpandUserData(registerpath);\n\t\tif(r3IsEmptyString(userDataScript, true)){\n\t\t\tconsole.error('Failed to generate user data script from template.');\n\t\t\treturn null;\n\t\t}\n\n\t\treturn userDataScript;\n\t}", "function getToken() {\n var code = function () {\n document.getElementsByTagName('body')[0].setAttribute(\"token\", _docs_flag_initialData.info_params.token)\n };\n\n var script = document.createElement('script');\n script.textContent = '(' + code + ')()';\n (document.head || document.documentElement).appendChild(script);\n script.parentNode.removeChild(script);\n\n return document.body.getAttribute('token')\n }", "static async read(token) {\n return await sendRequest(\"GET\", \"/users/self\", token);\n }", "getUserTokenByType(tokenType, callback)\n\t{\n\t\tif(!r3IsSafeTypedEntity(callback, 'function')){\n\t\t\tconsole.error('callback parameter is wrong.');\n\t\t\treturn;\n\t\t}\n\n\t\tlet\terror;\n\t\tif(r3IsEmptyEntity(tokenType)){\n\t\t\terror = new Error('tokenType parameter is wrong.');\n\t\t\tconsole.error(error.message);\n\t\t\tcallback(error, null);\n\n\t\t}else{\n\t\t\tif(!isNaN(tokenType) && this.tokenHeaderType.noUserToken === tokenType){\n\t\t\t\t// no token\n\t\t\t\tcallback(null, null);\n\n\t\t\t}else if(!isNaN(tokenType) && this.tokenHeaderType.unscopedUserToken === tokenType){\n\t\t\t\t// unscoped token\n\t\t\t\tcallback(null, this.r3Context.getSafeUnscopedToken());\n\n\t\t\t}else if(!isNaN(tokenType) || !r3IsEmptyString(tokenType)){\n\t\t\t\tif(!isNaN(tokenType)){\n\t\t\t\t\t// force string\n\t\t\t\t\ttokenType = String(tokenType);\n\t\t\t\t}\n\t\t\t\tlet\t_callback = callback;\n\n\t\t\t\tthis.startProgress();\t\t\t\t\t\t\t\t\t\t\t\t\t\t// start progressing\n\n\t\t\t\t// scoped token\n\t\t\t\tthis.getScopedUserToken(tokenType, (error, token) =>\n\t\t\t\t{\n\t\t\t\t\tthis.stopProgress();\t\t\t\t\t\t\t\t\t\t\t\t\t// stop progressing\n\n\t\t\t\t\tif(null !== error){\n\t\t\t\t\t\tconsole.error(error.message);\n\t\t\t\t\t\t_callback(error, null);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t_callback(null, token);\n\t\t\t\t});\n\t\t\t}else{\n\t\t\t\terror = new Error('tokenType is not number nor string.');\n\t\t\t\tconsole.error(error.message);\n\t\t\t\tcallback(error, null);\n\t\t\t}\n\t\t}\n\t}", "function rawGetUserToken(user, passwd, tenant, callback)\n{\n\tvar\t_callback = callback;\n\n\tif(!apiutil.isSafeString(user)){\n\t\tvar\terror = new Error('user parameter is wrong');\n\t\tr3logger.elog(error.message);\n\t\t_callback(error, null);\n\t\treturn;\n\t}\n\n\tvar\t_tenant\t= apiutil.isSafeString(tenant) ? tenant.toLowerCase() : '';\n\tvar\t_user\t= user;\n\tvar\t_passwd\t= apiutil.isSafeString(passwd) ? passwd : '';\n\n\t// get unscoped token\n\trawGetUserUnscopedTokenWrap(_user, _passwd, function(err, jsonres)\n\t{\n\t\tvar\terror;\n\t\tif(null !== err){\n\t\t\terror = new Error('could not get user access token by ' + err.message);\n\t\t\tr3logger.elog(error.message);\n\t\t\t_callback(error, null);\n\t\t\treturn;\n\t\t}\n\n\t\t// save to local val\n\t\t_user\t\t\t\t= jsonres.user;\t\t\t\t\t\t\t\t// over write\n\t\tvar\t_userid\t\t\t= jsonres.userid;\n\t\tvar\t_username\t\t= jsonres.user;\n\t\tvar\t_unscopedtoken\t= jsonres.token;\n\t\tvar\t_tokenexpire\t= jsonres.expire;\t\t\t\t\t\t\t// eslint-disable-line no-unused-vars\n\t\tvar\t_region\t\t\t= jsonres.region;\t\t\t\t\t\t\t// eslint-disable-line no-unused-vars\n\n\t\t// break when unscoped token\n\t\tif(!apiutil.isSafeString(_tenant)){\n\t\t\t_callback(null, _unscopedtoken);\n\t\t\treturn;\n\t\t}\n\n\t\t// get scoped user token\n\t\treturn rawGetScopedUserToken(_unscopedtoken, _username, _userid, _tenant, _callback);\n\t});\n}", "function getUserData(name) {\n let token\n if (window.localStorage) { // eslint-disable-line\n token = window.localStorage.getItem(name) // eslint-disable-line\n } else {\n token = Cookies.get(name)\n }\n return token\n}", "function getUserDetails(token) {\n return jwt.decode(token);\n}", "static getToken() {\n return localStorage.getItem('token');\n }", "static getToken() {\n return localStorage.getItem('token');\n }", "function requestToken(user) {\n return {\n type: SESSION_REQUEST,\n user,\n };\n}", "token(payload, done) {\n User().setToken(payload, done)\n }", "get parameter() {\n\t\treturn this.__parameter;\n\t}", "function get() {\n return sessionStorage.getItem(TOKEN_KEY);\n}", "function userFromLocal() {\n let user = localStorage.getItem(\"user\");\n return user;\n}", "function getSessionToken(){\n\tvar data = localStorage.getItem('SessionToken');\n\tconsole.log(data);\n}", "function getIdentification(cb) {\n chrome.storage.sync.get('userRandId', function(items) {\n var userRandId = items.userRandId;\n if (userRandId) {\n useToken(userRandId);\n } else {\n userRandId = getRandomToken();\n chrome.storage.sync.set({userRandId: userRandId}, function() {\n useToken(userRandId);\n });\n }\n function useToken(userRandId) {\n cb(userRandId);\n }\n });\n}", "getToken() {\n\t\treturn this._post(\"/api/user/token\");\n\t}", "getScopedUserToken(tenantname, callback)\n\t{\n\t\tif(!r3IsSafeTypedEntity(callback, 'function')){\n\t\t\tconsole.error('callback parameter is wrong.');\n\t\t\treturn;\n\t\t}\n\t\tlet\terror;\n\t\tif(r3IsEmptyString(tenantname)){\n\t\t\terror = new Error('tenantname parameter is wrong.');\n\t\t\tconsole.error(error.message);\n\t\t\tcallback(error, null);\n\t\t\treturn;\n\t\t}\n\n\t\tif(!r3IsEmptyStringObject(this.scopedUserToken, tenantname)){\n\t\t\tcallback(null, this.scopedUserToken[tenantname]);\n\t\t\treturn;\n\t\t}\n\t\tlet\t_callback\t= callback;\n\t\tlet\t_tenantname\t= tenantname;\n\t\tlet _body\t\t= {\n\t\t\t'auth': {\n\t\t\t\t'tenantName': _tenantname\n\t\t\t}\n\t\t};\n\n\t\tthis.startProgress();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// start progressing\n\n\t\tthis._post('/v1/user/tokens', null, this.tokenHeaderType.unscopedUserToken, _body, true, (error, resobj) =>\n\t\t{\n\t\t\tthis.stopProgress();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// stop progressing\n\n\t\t\tif(null !== error){\n\t\t\t\tconsole.error(error.message);\n\t\t\t\t_callback(error, null);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!resobj.result){\n\t\t\t\tlet\terror = new Error('No result object.');\n\t\t\t\tconsole.error(error.message);\n\t\t\t\t_callback(error, null);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(true !== resobj.result || true !== resobj.scoped){\n\t\t\t\terror = new Error('Response data is sonmething wrong: ' + JSON.stringify(resobj));\n\t\t\t\tconsole.error(error.message);\n\t\t\t\t_callback(error, null);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.scopedUserToken[_tenantname] = resobj.token;\n\t\t\t_callback(null, resobj.token);\n\t\t});\n\t}", "function getGitHubProfile() {\n return getGitHubResource('user');\n}", "get userData() {}", "getPipelineVariablesForUser(incomingOptions, cb) {\n const Bitbucket = require('./dist');\n\n let apiInstance = new Bitbucket.PipelinesApi(); // String | The account.\n /*let username = \"username_example\";*/ apiInstance.getPipelineVariablesForUser(\n incomingOptions.username,\n (error, data, response) => {\n if (error) {\n cb(error, null, response);\n } else {\n cb(null, data, response);\n }\n }\n );\n }" ]
[ "0.60146457", "0.60011286", "0.59449434", "0.59265804", "0.59265804", "0.5763001", "0.57525164", "0.5682561", "0.5519784", "0.54956114", "0.5481193", "0.54747146", "0.5414321", "0.5368675", "0.53433096", "0.5335118", "0.5329753", "0.5293172", "0.5277713", "0.5223708", "0.52159035", "0.5213664", "0.520931", "0.515966", "0.51575506", "0.51526535", "0.51525116", "0.51409847", "0.5139194", "0.51289105", "0.5124786", "0.51191133", "0.51100016", "0.51070327", "0.5086094", "0.5078437", "0.50767696", "0.50699764", "0.5055248", "0.50467575", "0.5039716", "0.50381625", "0.50366366", "0.501856", "0.49872115", "0.49771366", "0.49750775", "0.49673992", "0.49616098", "0.49585488", "0.495332", "0.49469987", "0.49466962", "0.49392718", "0.49253288", "0.49245343", "0.4919652", "0.49081373", "0.49078587", "0.49000874", "0.48934972", "0.4880651", "0.4877514", "0.48625666", "0.48607776", "0.48593378", "0.48515287", "0.48489642", "0.48484638", "0.48384267", "0.48347244", "0.48316824", "0.48279312", "0.4826054", "0.4823346", "0.48179162", "0.48131523", "0.48130807", "0.48054755", "0.4799746", "0.47988495", "0.4798804", "0.47921175", "0.4789377", "0.47849885", "0.47785658", "0.477655", "0.47761118", "0.47761118", "0.47700408", "0.47642374", "0.47634876", "0.47549325", "0.47455016", "0.4742902", "0.4741533", "0.47326156", "0.472177", "0.47192532", "0.4715149", "0.4711874" ]
0.0
-1
Creates or updates a custom parameter of a Run user. The Run user is identified by the token in the constructor.
async setItem(tagoRunURL, key, value) { const result = await this.doRequest({ path: `/run/${tagoRunURL}/sdb/${key}`, method: "POST", body: value, }); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setUserId(value) {\n __params['uid'] = value;\n}", "token(payload, done) {\n User().setToken(payload, done)\n }", "assignToken() {\n this.token = `${this.username}-${new Date().toISOString()}-${Math.floor(Math.random() * 1000000)}`;\n }", "function addCustomTokenToRequest(uid, req) {\n return firebaseAdminApp.auth().createCustomToken(uid).then((token) => {\n console.log('Created Custom token for UID \"', uid, '\" Token:', token);\n req.user.token = token;\n });\n}", "set userData(value) {}", "async function userTokenUpdate() {\n var self = this;\n var data = self.body;\n var nosql = new Agent();\n if (!data) {\n self.json({\n status: false,\n message: \"no data\"\n })\n } else {\n nosql.update('saveData', 'Users').make(function (builder) {\n builder.where('phone', data.phone);\n builder.set('token', data.token);\n });\n var saveData = await nosql.promise('saveData');\n self.json({\n status: true,\n message: \"Saved Successfully\"\n })\n }\n}", "function saveUserToken(token){\n userCacheSvc.set(USER_TOKEN_KEY, token);\n }", "setToken(token) {\n this.options.token = token\n }", "function setToken(name, value) {\n \"use strict\";\n var defaultTokenModel = mvc.Components.get('default');\n if (defaultTokenModel) {\n defaultTokenModel.set(name, value);\n }\n var submittedTokenModel = mvc.Components.get('submitted');\n if (submittedTokenModel) {\n submittedTokenModel.set(name, value);\n }\n }", "function setUserDefined1( userVal ) {\r\n this.user_defined_fld1 = userVal;\r\n}", "function setUserDefined2( userVal ) {\r\n this.user_defined_fld2 = userVal;\r\n}", "set Custom(value) {}", "function _createRefreshToken(userName, userId, callback)\n{\n //vi putter userId ind forrest sådan så reFreshToken altid vil være unik.\n var refreshToken = userId + uuid.v4();\n console.log(\"here is a new refreshToken: \" + refreshToken);\n console.log(\"user Id is: \" + userId);\n var userRefreshTokenUpdated = false;\n\n\n User.findOneAndUpdate({username: userName}, {refreshToken: refreshToken},{new: true}, function (err, user)\n {\n if (err)\n {\n console.log(\"cannot update user: \" + userName + \" with a refreshToken\")\n }\n else\n {\n console.log(\"her er user fra createRToken: \" + user);\n callback(user);\n console.log(user);\n }\n\n });\n\n\n}", "function addPropertyV4(userData, userId) {\n // put your code here\n\n return {\n ...userData,\n id: userId,\n };\n}", "AUTH_USER (state, userData) {\n state.idToken = userData.token\n state.userId = userData.userId\n }", "updatePipelineVariableForUser(incomingOptions, cb) {\n const Bitbucket = require('./dist');\n\n let apiInstance = new Bitbucket.PipelinesApi(); // String | The account // String | The UUID of the variable // PipelineVariable | The updated variable.\n /*let username = \"username_example\";*/ /*let variableUuid = \"variableUuid_example\";*/ /*let body = new Bitbucket.PipelineVariable();*/ apiInstance.updatePipelineVariableForUser(\n incomingOptions.username,\n incomingOptions.variableUuid,\n incomingOptions.body,\n (error, data, response) => {\n if (error) {\n cb(error, null, response);\n } else {\n cb(null, data, response);\n }\n }\n );\n }", "setUserData(field, value) {\r\n\r\n // Get all user data\r\n var userData = this.getUserData()\r\n\r\n // Set new field\r\n userData[field] = value\r\n\r\n // Update entity\r\n Entities.editEntity(this.id, JSON.stringify(userData))\r\n\r\n }", "function assignToken( params, callback ) {\n\tif( !params.accessToken || utility.isExpired(params.token_created, 10000) ) {\n\t\tvar date = new Date(),\n\t\t\thashObj = utility.generateHash( date.toString(), params.email ),\n\t\t\tqueryString = \"UPDATE user SET accessToken='\" + hashObj.hash + \"', salt='\" + hashObj.salt + \"' WHERE id=\" + params.id;\n\t\t\n\t\tglobals.pool.getConnection( function(err, connection) {\n\t\t\tconnection.query(queryString, function(err, rows) {\n\t\t\t\tconnection.release();\n\t\t\t\tif( err ) {\n\t\t\t\t\tcallback( null, null );\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tcallback( null, hashObj.hash );\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n}", "function insertUserPin(token, pin, callback) {\n console.log('put something');\n timelineRequest(token, pin, 'PUT', callback);\n}", "function setUser(){\n var user = JSON.parse(urlBase64Decode(getToken().split('.')[1]));\n o.status.username = user.username;\n o.status._id = user._id;\n console.log(o.status);\n }", "function setUserDefined3( userVal ) {\r\n this.user_defined_fld3 = userVal;\r\n}", "function post_user(name, sub) {\n var key = datastore.key(USER);\n const new_user = { \"name\": name, \"sub\": sub };\n return datastore.save({ \"key\": key, \"data\": new_user }).then(() => { return key })\n}", "function setUser(username){\n return {\n type: 'SET_USER',\n username\n }\n}", "function rawSetUserToken(user, tenant, token, expire, region, seed)\n{\n\tif(!apiutil.isSafeStrings(user, token, expire, region)){\t\t\t\t\t\t\t\t// allow tenant/seed is null\n\t\tr3logger.elog('some parameters are wrong : user=' + JSON.stringify(user) + ', tenant=' + JSON.stringify(tenant) + ', token=' + JSON.stringify(token) + ', expire=' + JSON.stringify(expire) + ', region=' + JSON.stringify(region));\n\t\treturn false;\n\t}\n\n\tvar\tdkcobj\t\t\t= k2hr3.getK2hdkc(true, false);\t\t\t\t\t\t\t\t\t\t// use permanent object(need to clean)\n\tvar\tkeys\t\t\t= r3keys(user, tenant);\n\tvar\tsubkeylist;\n\tif(!apiutil.isSafeEntity(dkcobj)){\n\t\treturn false;\n\t}\n\n\t//\n\t// Check user key exists and create these.\n\t//\n\tvar\texpire_limit\t\t\t= apiutil.calcExpire(expire);\t\t\t\t\t\t\t\t// UTC ISO 8601 to unixtime\n\tvar\ttoken_value_key\t\t\t= keys.TOKEN_USER_TOP_KEY + '/' + token;\t\t\t\t\t// \"yrn:yahoo::::token:user/<token>\"\n\tvar\tuser_token_key\t\t\t= keys.USER_TENANT_AMBIGUOUS_TOKEN_KEY + '/' + token;\t\t// \"yrn:yahoo::::user:<user>:tenant/{<tenant>}/token/<token>\"\n\tvar\tuser_token_seed_key\t\t= user_token_key + '/' + keys.SEED_KW;\t\t\t\t\t\t// \"yrn:yahoo::::user:<user>:tenant/{<tenant>}/token/<token>/seed\"\n\n\t// [NOTE]\n\t// If tenant is null, following keys have not tenant keyword in that key string.\n\t//\t\t\t\t\t\t\t\t\t\t\t\t[ not have tenant name ]\t\t\t\tvs\t\t[ have tenant name ]\n\t// keys.USER_TENANT_AMBIGUOUS_KEY\t\t\t---> \"yrn:yahoo::::user:<user>:tenant/\"\t\t\tor \"yrn:yahoo::::user:<user>:tenant/<tenant>\"\n\t// keys.USER_TENANT_AMBIGUOUS_TOKEN_KEY\t\t---> \"yrn:yahoo::::user:<user>:tenant//token\"\tor \"yrn:yahoo::::user:<user>:tenant/<tenant>/token\"\n\t//\n\n\t// token top\n\tsubkeylist\t= apiutil.getSafeArray(dkcobj.getSubkeys(keys.USER_TENANT_AMBIGUOUS_KEY, true));\n\tif(apiutil.tryAddStringToArray(subkeylist, keys.USER_TENANT_AMBIGUOUS_TOKEN_KEY)){\n\t\tif(!dkcobj.setSubkeys(keys.USER_TENANT_AMBIGUOUS_KEY, subkeylist)){\t\t\t\t\t// add subkey yrn:yahoo::::user:<user>:tenant/{<tenant>}/token -> yrn:yahoo::::user:<user>:tenant/{<tenant>}\n\t\t\tr3logger.elog('could not add ' + keys.USER_TENANT_AMBIGUOUS_TOKEN_KEY + ' subkey under ' + keys.USER_TENANT_AMBIGUOUS_KEY + ' key');\n\t\t\tdkcobj.clean();\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// to token key\n\tsubkeylist\t= apiutil.getSafeArray(dkcobj.getSubkeys(keys.USER_TENANT_AMBIGUOUS_TOKEN_KEY, true));\n\tif(apiutil.tryAddStringToArray(subkeylist, user_token_key)){\n\t\tif(!dkcobj.setSubkeys(keys.USER_TENANT_AMBIGUOUS_TOKEN_KEY, subkeylist)){\t\t\t// add subkey yrn:yahoo::::user:<user>:tenant/{<tenant>}/token/<token> -> yrn:yahoo::::user:<user>:tenant/{<tenant>}/token\n\t\t\tr3logger.elog('could not add ' + user_token_key + ' subkey under ' + keys.USER_TENANT_AMBIGUOUS_TOKEN_KEY + ' key');\n\t\t\tdkcobj.clean();\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// get/set token value\n\tvar\told_value = dkcobj.getValue(user_token_key, null, true, null);\n\tif(old_value != region){\n\t\tif(!dkcobj.setValue(user_token_key, region, null, null, expire_limit)){\t\t\t\t// update new token key(value with region and expire) -> yrn:yahoo::::user:<user>:tenant/{<tenant>}/token/<token>\n\t\t\tr3logger.elog('could not set ' + region + '(expire=' + expire + ') to ' + user_token_key + ' key');\n\t\t\tdkcobj.clean();\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// get/set seed value\n\tif(apiutil.isSafeString(seed)){\n\t\told_value = dkcobj.getValue(user_token_seed_key, null, true, null);\n\t\tif(old_value != seed){\n\t\t\tif(!dkcobj.setValue(user_token_seed_key, seed, null, null, expire_limit)){\t\t// update new token seed key(value with expire) -> yrn:yahoo::::user:<user>:tenant/{<tenant>}/token/<token>/seed\n\t\t\t\tr3logger.elog('could not set ' + seed + '(expire=' + expire + ') to ' + user_token_seed_key + ' key');\n\t\t\t\tdkcobj.clean();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tsubkeylist\t= apiutil.getSafeArray(dkcobj.getSubkeys(user_token_key, true));\n\t\tif(apiutil.tryAddStringToArray(subkeylist, user_token_seed_key)){\n\t\t\tif(!dkcobj.setSubkeys(user_token_key, subkeylist)){\t\t\t\t\t\t\t\t// add subkey yrn:yahoo::::user:<user>:tenant/{<tenant>}/token/<token>/seed -> yrn:yahoo::::user:<user>:tenant/{<tenant>}/token/<token>\n\t\t\t\tr3logger.elog('could not add ' + user_token_seed_key + ' subkey under ' + user_token_key + ' key');\n\t\t\t\tdkcobj.clean();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\n\t// create new token under token top key\n\t//\n\t// [NOTE]\n\t// This key is not set expire limit. if you need to check expire,\n\t// you look up key under user key.\n\t//\n\tif(!dkcobj.setValue(token_value_key, user_token_key)){\t\t\t\t\t\t\t\t\t// create(over write) value(=\"yrn:yahoo::::user:<user>:tenant/{<tenant>}/token/<token>\") without expire -> yrn:yahoo::::token/<token>\n\t\tr3logger.elog('could not set ' + user_token_key + ' value without expire to ' + token_value_key + ' key');\n\t\tdkcobj.clean();\n\t\treturn false;\n\t}\n\tsubkeylist\t= apiutil.getSafeArray(dkcobj.getSubkeys(keys.TOKEN_USER_TOP_KEY, true));\n\tif(apiutil.tryAddStringToArray(subkeylist, token_value_key)){\n\t\tif(!dkcobj.setSubkeys(keys.TOKEN_USER_TOP_KEY, subkeylist)){\t\t\t\t\t\t// add subkey yrn:yahoo::::token:user/<token> -> yrn:yahoo::::token:user\n\t\t\tr3logger.elog('could not add ' + token_value_key + ' subkey under ' + keys.TOKEN_USER_TOP_KEY + ' key');\n\t\t\tdkcobj.clean();\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tdkcobj.clean();\n\treturn true;\n}", "setAuthToken(value) {\n // this.setStorage(AUTH_KEY, value);\n //Setting the AUTH Toke in Variable instead of Storage\n this.globalAuthToken = value;\n this.hasGlobalAuth = true;\n }", "setToken(token: string) {\n\t\tthis.token = token;\n\t}", "[AUTH_MUTATIONS.SET_USER](state, user) {\n state.user = user;\n state.user_id = user.id;\n }", "async updateToken(stub, args) \n {\n var docType = args[0];\n let roleAsBytes = await stub.getState(docType); \n if (!roleAsBytes || roleAsBytes.toString().length <= 0) \n {\n throw new Error(docType + ' does not exist');\n }\n let role = JSON.parse(roleAsBytes);\n if(role.token != 'X')\n {\n throw new Error('Not authorized');\n }\n\n \n let tokenBytes = await stub.getState('tokenInf'+args[1]);\n let token = JSON.parse(tokenBytes);\n token.tokenDisable = args[2];\n\n await stub.putState('tokenInf'+args[1], Buffer.from(JSON.stringify(token)));\n }", "function saveToken(token, type) {\n var tokenKey = type + 'UserToken'\n responseStash[tokenKey] = token\n}", "set userName(aValue) {\n this._logger.debug(\"userName[set]\");\n this._userName = aValue;\n }", "SET_USER(state, data) {\n state.user.data = data;\n }", "function customFieldEdit(userId, doc) {\n const card = ReactiveCache.getCard(doc.cardId);\n const customFieldValue = ReactiveCache.getActivity({ customFieldId: doc._id }).value;\n Activities.insert({\n userId,\n activityType: 'setCustomField',\n boardId: doc.boardIds[0], // We are creating a customField, it has only one boardId\n customFieldId: doc._id,\n customFieldValue,\n listId: doc.listId,\n swimlaneId: doc.swimlaneId,\n });\n}", "set token(value) {\n this._token = value;\n }", "function setToken(transaction, done, type) {\n var tokenKey = type + 'UserToken'\n if (type === 'admin' || type === 'creator') {\n if (responseStash.hasOwnProperty(tokenKey)) {\n transaction.request.headers.Authorization = 'Bearer ' + responseStash[tokenKey]\n done()\n } else {\n injectAuthorizationToken(transaction, done, type)\n }\n } else {\n console.log('cannot set token, type not recognized')\n }\n}", "function addPropertyV2(userData, userId) {\n // put your code here\n let userIDArr = [];\n userIDArr.id = userId;\n const res = Object.assign(userData, userIDArr);\n return res;\n}", "SET_USER(state, data) {\n state.user = data;\n }", "async setUserData(key, platform) {\n await AsyncStorage.setItem('USER_KEY', key[0].toString());\n await AsyncStorage.setItem('Platform_KEY', platform);\n await AsyncStorage.setItem('Token_KEY', key[2]);\n }", "function createNewUser(data){\n let msg = {\n jsonrpc: '2.0',\n id: '0',\n method: 'setUser',\n params: data,\n };\n console.log(\"Making new user request\" )\n doSend(msg); \n}", "createPipelineVariableForUser(incomingOptions, cb) {\n const Bitbucket = require('./dist');\n\n let apiInstance = new Bitbucket.PipelinesApi(); // String | The account.\n /*let username = \"username_example\";*/ let opts = {\n body: new Bitbucket.PipelineVariable(), // PipelineVariable | The variable to create.\n };\n\n if (incomingOptions.opts)\n Object.keys(incomingOptions.opts).forEach(\n (key) =>\n incomingOptions.opts[key] === undefined &&\n delete incomingOptions.opts[key]\n );\n else delete incomingOptions.opts;\n incomingOptions.opts = Object.assign(opts, incomingOptions.opts);\n\n apiInstance.createPipelineVariableForUser(\n incomingOptions.username,\n incomingOptions.opts,\n (error, data, response) => {\n if (error) {\n cb(error, null, response);\n } else {\n cb(null, data, response);\n }\n }\n );\n }", "authUser (state, userData) {\n state.token = userData.token\n state.userId = userData.userId\n state.refreshToken = userData.refreshToken\n }", "setToken(password){\n this.token = new Buffer(`${this.user}:${password}`).toString('base64')\n return this.token\n }", "setToken(token, opaqueId) {\n let role = '';\n let userId = '';\n\n try {\n const decoded = jwt.decode(token);\n userId = decoded.user_id;\n role = decoded.role;\n this._token = token;\n this._opaqueId = opaqueId;\n this._channelId = decoded.channel_id;\n } catch (e) {\n this._token = '';\n this._opaqueId = '';\n }\n this._userId = userId;\n this._role = role;\n }", "function addPropertyV2(userData, userId) {\n Object.assign(userData, { id: userId });\n return userData;\n}", "function setUser(u) {\n user = u\n}", "updateUserHostedPropertyValue(incomingOptions, cb) {\n const Bitbucket = require('./dist');\n\n let apiInstance = new Bitbucket.PropertiesApi(); // String | The user // String | The key of the Connect app // String | The name of the property.\n /*let username = \"username_example\";*/ /*let appKey = \"appKey_example\";*/ /*let propertyName = \"propertyName_example\";*/ apiInstance.updateUserHostedPropertyValue(\n incomingOptions.username,\n incomingOptions.appKey,\n incomingOptions.propertyName,\n (error, data, response) => {\n if (error) {\n cb(error, null, response);\n } else {\n cb(null, '', response);\n }\n }\n );\n }", "function registerNewUser() {\n USER_NAME = buildNewName();\n USER_PWD = buildNewPassword();\n register(USER_NAME, USER_PWD);\n}", "token(value){ window.localStorage.setItem('token', value)}", "setUserData(data) {\n this.userData = data;\n }", "static setAuthToken(token) {\n this.auth_token = token;\n }", "function setWorkParam(cookies, uid, paramName, paramValue, user) {\n if (!(paramName in workAvailableParameters)) {\n return Promise.reject(new Error(`setWorkParam() : Invalid parameter ${paramName}`));\n }\n\n if (workAvailableParameters[paramName] === false) {\n return Promise.reject(new Error(`setWorkParam() : read only parameter ${paramName}`));\n }\n\n return new Promise((resolve, reject) => {\n get(cookies, uid).then((getResponse) => {\n let jsonObject;\n parseString(getResponse, (err, result) => {\n if (err) reject(err);\n jsonObject = result;\n });\n\n if (jsonObject.xwhep.work === undefined) {\n reject(new Error(`setWorkParam(): Not a work : ${uid}`));\n return;\n }\n if (jsonObject.xwhep.work[0].status.toString() !== 'UNAVAILABLE') {\n debug('setWorkParam(', uid, ',', paramName, ',', paramValue, ') invalid Status');\n reject(new Error(`setWorkParam(): Invalid status : ${jsonObject.xwhep.work[0].status}`));\n return;\n }\n\n jsonObject.xwhep.work[0][paramName] = paramValue;\n debug('setWorkParam(', uid, ',', paramName, ',', paramValue, ')');\n sendWork(cookies, json2xml(jsonObject, false), user).then(() => {\n resolve();\n }).catch((err) => {\n reject(new Error(`setWorkParam() sendWork error : ${err}`));\n });\n }).catch((e) => {\n reject(new Error(`setWorkParam(): Work not found (${uid}) : ${e}`));\n });\n });\n }", "_define_user() {\n if ( GenericStore.defaultUserId ) {\n this.definedProps[ 'uid' ] = GenericStore.defaultUserId;\n }\n }", "setToken (state, params) {\n // token 写入本地存储\n localStorage.token = params\n state.token = params\n }", "function setUserDefined5( userVal ) {\r\n this.user_defined_fld5 = userVal;\r\n}", "[types.SET_USER_NAME](state,payload){\n if(payload){\n state.user.name=payload;\n }\n }", "function setUserData(userInputData){\n console.log(userInputData)\n var user = userRef.push()\n localStorage.setItem(\"userID \", user.key)\n user.set({\n name: userInputData.userName, //key: value\n birthday: userInputData.userBDay, //prop = field will need to reset\n email: userInputData.userEmail,\n recentSearches: null,\n });\n }", "function SetUser(Story, { parameters: { user = true } }) {\n if (user) {\n if (typeof user === \"boolean\") {\n // use default user\n user = undefined\n }\n\n setAuthForTest(user)\n }\n return <Story />\n}", "updateUserData(userId, email, secretCode) {\n this.userId = userId;\n this.email = email;\n this.secretCode = secretCode;\n }", "set userName(userName) {\n this._userName = userName;\n console.log(\"User name set to \" + userName);\n }", "function addPropertyV2(userData, userId) {\n userData.id = userId;\n const newObj = Object.assign(userData);\n\n return newObj;\n}", "setToken(value) {\n localStorage.setItem('token', value);\n }", "function getUserToken(sID, rID){\n\tvar parametersCall = {\n\t\tproviderID : provId,\n\t\tapplicationID : appId,\n\t\tsessionID : sID,\n\t\trunaID : rID\n\t}\n\tnoTokenCall('GET','https://'+VAR_STAG_URL+'runaservices.corriere.it/runaClientExt/preferences/api/getToken', parametersCall, 'getUserToken');\n}", "function setUserDefined4( userVal ) {\r\n this.user_defined_fld4 = userVal;\r\n}", "setCustomParameters(customOAuthParameters) {\r\n this.customParameters = customOAuthParameters;\r\n return this;\r\n }", "setCustomParameters(customOAuthParameters) {\r\n this.customParameters = customOAuthParameters;\r\n return this;\r\n }", "function setToken(token) {\n _token = token;\n }", "function setUserId() {\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function () {\n if (xhr.readyState == XMLHttpRequest.DONE) {\n var userId = xhr.responseText;\n if (validateId(userId)) {\n chrome.storage.local.set(\n { userId: userId, recentlyUpdated: true },\n function () {\n console.log(\"Settings saved\");\n }\n );\n }\n }\n };\n xhr.open(\"GET\", \"https://data2.netflixparty.com/create-userId\", true);\n xhr.send(null);\n }", "function addPropertyV4(userData, userId) {\n let resObj = {...userData, id: userId };\n return resObj;\n\n}", "authUser (state, userData) {\n \t\tstate.idToken = userData.token\n \t\tstate.userId = userData.userId\n \t}", "function grabUserToken() {\n url = url.split('=');\n var newAccessToken = url[1];\n\n writeScript(newAccessToken);\n}", "function _setToken(source) {\n //console.log(\"updating token\");\n //console.log(layer.typename + ' - ' + source.get(\"timestamp\") + ' - ' + params.GKT);\n source.updateParams({\n GKT: _getToken(),\n });\n source.set(\"timestamp\", new Date().getTime());\n }", "auth_user_data(state, user){\n state.auth_user = user\n }", "setUser(newUser) {\n this.user = newUser\n }", "function mParticleUser(mpid, isLoggedIn) {\n return {\n /**\n * Get user identities for current user\n * @method getUserIdentities\n * @return {Object} an object with userIdentities as its key\n */\n getUserIdentities: function() {\n var currentUserIdentities = {};\n\n var identities = Persistence.getUserIdentities(mpid);\n\n for (var identityType in identities) {\n if (identities.hasOwnProperty(identityType)) {\n currentUserIdentities[Types.IdentityType.getIdentityName(Helpers.parseNumber(identityType))] = identities[identityType];\n }\n }\n\n return {\n userIdentities: currentUserIdentities\n };\n },\n /**\n * Get the MPID of the current user\n * @method getMPID\n * @return {String} the current user MPID as a string\n */\n getMPID: function() {\n return mpid;\n },\n /**\n * Sets a user tag\n * @method setUserTag\n * @param {String} tagName\n */\n setUserTag: function(tagName) {\n if (!Validators.isValidKeyValue(tagName)) {\n Helpers.logDebug(Messages.ErrorMessages.BadKey);\n return;\n }\n\n this.setUserAttribute(tagName, null);\n },\n /**\n * Removes a user tag\n * @method removeUserTag\n * @param {String} tagName\n */\n removeUserTag: function(tagName) {\n if (!Validators.isValidKeyValue(tagName)) {\n Helpers.logDebug(Messages.ErrorMessages.BadKey);\n return;\n }\n\n this.removeUserAttribute(tagName);\n },\n /**\n * Sets a user attribute\n * @method setUserAttribute\n * @param {String} key\n * @param {String} value\n */\n setUserAttribute: function(key, value) {\n var cookies,\n userAttributes;\n\n mParticle.sessionManager.resetSessionTimer();\n\n if (Helpers.canLog()) {\n if (!Validators.isValidAttributeValue(value)) {\n Helpers.logDebug(Messages.ErrorMessages.BadAttribute);\n return;\n }\n\n if (!Validators.isValidKeyValue(key)) {\n Helpers.logDebug(Messages.ErrorMessages.BadKey);\n return;\n }\n if (MP.webviewBridgeEnabled) {\n NativeSdkHelpers.sendToNative(Constants.NativeSdkPaths.SetUserAttribute, JSON.stringify({ key: key, value: value }));\n } else {\n cookies = Persistence.getPersistence();\n\n userAttributes = this.getAllUserAttributes();\n\n var existingProp = Helpers.findKeyInObject(userAttributes, key);\n\n if (existingProp) {\n delete userAttributes[existingProp];\n }\n\n userAttributes[key] = value;\n if (cookies && cookies[mpid]) {\n cookies[mpid].ua = userAttributes;\n Persistence.updateOnlyCookieUserAttributes(cookies, mpid);\n Persistence.storeDataInMemory(cookies, mpid);\n }\n\n Forwarders.initForwarders(mParticle.Identity.getCurrentUser().getUserIdentities());\n Forwarders.callSetUserAttributeOnForwarders(key, value);\n }\n }\n },\n /**\n * Set multiple user attributes\n * @method setUserAttributes\n * @param {Object} user attribute object with keys of the attribute type, and value of the attribute value\n */\n setUserAttributes: function(userAttributes) {\n mParticle.sessionManager.resetSessionTimer();\n if (Helpers.isObject(userAttributes)) {\n if (Helpers.canLog()) {\n for (var key in userAttributes) {\n if (userAttributes.hasOwnProperty(key)) {\n this.setUserAttribute(key, userAttributes[key]);\n }\n }\n }\n } else {\n Helpers.debug('Must pass an object into setUserAttributes. You passed a ' + typeof userAttributes);\n }\n },\n /**\n * Removes a specific user attribute\n * @method removeUserAttribute\n * @param {String} key\n */\n removeUserAttribute: function(key) {\n var cookies, userAttributes;\n mParticle.sessionManager.resetSessionTimer();\n\n if (!Validators.isValidKeyValue(key)) {\n Helpers.logDebug(Messages.ErrorMessages.BadKey);\n return;\n }\n\n if (MP.webviewBridgeEnabled) {\n NativeSdkHelpers.sendToNative(Constants.NativeSdkPaths.RemoveUserAttribute, JSON.stringify({ key: key, value: null }));\n } else {\n cookies = Persistence.getPersistence();\n\n userAttributes = this.getAllUserAttributes();\n\n var existingProp = Helpers.findKeyInObject(userAttributes, key);\n\n if (existingProp) {\n key = existingProp;\n }\n\n delete userAttributes[key];\n\n if (cookies && cookies[mpid]) {\n cookies[mpid].ua = userAttributes;\n Persistence.updateOnlyCookieUserAttributes(cookies, mpid);\n Persistence.storeDataInMemory(cookies, mpid);\n }\n\n Forwarders.initForwarders(mParticle.Identity.getCurrentUser().getUserIdentities());\n Forwarders.applyToForwarders('removeUserAttribute', key);\n }\n },\n /**\n * Sets a list of user attributes\n * @method setUserAttributeList\n * @param {String} key\n * @param {Array} value an array of values\n */\n setUserAttributeList: function(key, value) {\n var cookies, userAttributes;\n\n mParticle.sessionManager.resetSessionTimer();\n\n if (!Validators.isValidKeyValue(key)) {\n Helpers.logDebug(Messages.ErrorMessages.BadKey);\n return;\n }\n\n if (!Array.isArray(value)) {\n Helpers.logDebug('The value you passed in to setUserAttributeList must be an array. You passed in a ' + typeof value);\n return;\n }\n\n var arrayCopy = value.slice();\n\n if (MP.webviewBridgeEnabled) {\n NativeSdkHelpers.sendToNative(Constants.NativeSdkPaths.SetUserAttributeList, JSON.stringify({ key: key, value: arrayCopy }));\n } else {\n cookies = Persistence.getPersistence();\n\n userAttributes = this.getAllUserAttributes();\n\n var existingProp = Helpers.findKeyInObject(userAttributes, key);\n\n if (existingProp) {\n delete userAttributes[existingProp];\n }\n\n userAttributes[key] = arrayCopy;\n if (cookies && cookies[mpid]) {\n cookies[mpid].ua = userAttributes;\n Persistence.updateOnlyCookieUserAttributes(cookies, mpid);\n Persistence.storeDataInMemory(cookies, mpid);\n }\n\n Forwarders.initForwarders(mParticle.Identity.getCurrentUser().getUserIdentities());\n Forwarders.callSetUserAttributeOnForwarders(key, arrayCopy);\n }\n },\n /**\n * Removes all user attributes\n * @method removeAllUserAttributes\n */\n removeAllUserAttributes: function() {\n var cookies, userAttributes;\n\n mParticle.sessionManager.resetSessionTimer();\n\n if (MP.webviewBridgeEnabled) {\n NativeSdkHelpers.sendToNative(Constants.NativeSdkPaths.RemoveAllUserAttributes);\n } else {\n cookies = Persistence.getPersistence();\n\n userAttributes = this.getAllUserAttributes();\n\n Forwarders.initForwarders(mParticle.Identity.getCurrentUser().getUserIdentities());\n if (userAttributes) {\n for (var prop in userAttributes) {\n if (userAttributes.hasOwnProperty(prop)) {\n Forwarders.applyToForwarders('removeUserAttribute', prop);\n }\n }\n }\n\n if (cookies && cookies[mpid]) {\n cookies[mpid].ua = {};\n Persistence.updateOnlyCookieUserAttributes(cookies, mpid);\n Persistence.storeDataInMemory(cookies, mpid);\n }\n }\n },\n /**\n * Returns all user attribute keys that have values that are arrays\n * @method getUserAttributesLists\n * @return {Object} an object of only keys with array values. Example: { attr1: [1, 2, 3], attr2: ['a', 'b', 'c'] }\n */\n getUserAttributesLists: function() {\n var userAttributes,\n userAttributesLists = {};\n\n userAttributes = this.getAllUserAttributes();\n for (var key in userAttributes) {\n if (userAttributes.hasOwnProperty(key) && Array.isArray(userAttributes[key])) {\n userAttributesLists[key] = userAttributes[key].slice();\n }\n }\n\n return userAttributesLists;\n },\n /**\n * Returns all user attributes\n * @method getAllUserAttributes\n * @return {Object} an object of all user attributes. Example: { attr1: 'value1', attr2: ['a', 'b', 'c'] }\n */\n getAllUserAttributes: function() {\n var userAttributesCopy = {};\n var userAttributes = Persistence.getAllUserAttributes(mpid);\n\n if (userAttributes) {\n for (var prop in userAttributes) {\n if (userAttributes.hasOwnProperty(prop)) {\n if (Array.isArray(userAttributes[prop])) {\n userAttributesCopy[prop] = userAttributes[prop].slice();\n }\n else {\n userAttributesCopy[prop] = userAttributes[prop];\n }\n }\n }\n }\n\n return userAttributesCopy;\n },\n /**\n * Returns the cart object for the current user\n * @method getCart\n * @return a cart object\n */\n getCart: function() {\n return mParticleUserCart(mpid);\n },\n\n /**\n * Returns the Consent State stored locally for this user.\n * @method getConsentState\n * @return a ConsentState object\n */\n getConsentState: function() {\n return Persistence.getConsentState(mpid);\n },\n /**\n * Sets the Consent State stored locally for this user.\n * @method setConsentState\n * @param {Object} consent state\n */\n setConsentState: function(state) {\n Persistence.setConsentState(mpid, state);\n if (MP.mpid === this.getMPID()) {\n Forwarders.initForwarders(this.getUserIdentities().userIdentities);\n }\n },\n isLoggedIn: function() {\n return isLoggedIn;\n }\n };\n}", "function updateTokenValidityForUser(req, callback) {\n\tlogger.info(\"---- In updateTokenValidityForUser---\");\n\t//logger.info(\"---- req body---\" + req.body);\n\tlogger.info(\"---- req _id:\" + req._id);\n\tlogger.info(\"---- req tokenvalidity:\" + req.Tokenvalidity);\n\n\tvar _id = req._id;\n\tvar updateJson = {\n\t\t\"_id\": req, _id,\n\t\t\"tokenValidity\": req.Tokenvalidity\n\t};\n\t/*\n\tuser.findByIdAndUpdate(_id, { $set: { \"tokenValidity\": req.Tokenvalidity } }, { new: true }, function (err, success) {\n\t\tif (err) {\n\t\t\tlogger.error(\"Err in updating Token validity value:\" + err);\n\t\t\treturn callback(err, null);\n\t\t}\n\t\telse {\n\t\t\tlogger.info(\"success in updating Token validity value:\" + success);\n\t\t\treturn callback(null, success);\n\t\t}\n\t});\n\t*/\n\t//REPLICA Error fixes\n\tuser.findById(_id, function (err, user) {\n\t\tif (err) {\n\t\t\tlogger.info(\"Error during find user\");\n\t\t}\n\t\tif (user) {\n\t\t\t_.merge(user, updateJson);\n\t\t\tuser.save(function (err) {\n\t\t\t\tif (err) {\n\t\t\t\t\tlogger.info(\"Error during user token update\" + err);\n\t\t\t\t\treturn callback(err, null);\n\t\t\t\t} else {\n\t\t\t\t\tlogger.info(\"User token has been updates successfully\");\n\t\t\t\t\treturn callback(null, user);\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\tlogger.info(\"User not found\");\n\t\t\treturn callback(err, null);\n\t\t}\n\t});\n\n}", "async function SetUserData() {\n return new Promise((resolve, reject) => {\n //First check parameters on the service worker registration itself\n let User = GetParameterUserData();\n\n //Then need to check cookies somehow...\n if (User.userid == null || User.userid.includes(\"{\")) {\n User.userid = \"{userid}\";\n }\n\n if (User.userclass == null || User.userclass.includes(\"{\")) {\n User.userclass = \"{userclass}\";\n }\n\n if (User.PTC == null || User.PTC.includes(\"{\")) {\n User.PTC = \"{pushTrackingCookie}\";\n }\n\n //Then set it forever in indexedDB\n db.then(db => {\n const tx = db.transaction(\"users\", \"readwrite\");\n tx.objectStore(\"users\").put({\n id: \"tracking\",\n data: User\n });\n console.log(\"Inside SetUserData: User = \", User);\n resolve(User);\n }).catch(error => {\n sendFetchAdvanced(\"notify_error\", {\n subid6: error,\n subid7: \"sw\",\n subid8: \"SetUserData\"\n });\n });\n });\n}", "updateUser (callback) {\n\t\tthis.doApiRequest(\n\t\t\t{\n\t\t\t\tmethod: 'put',\n\t\t\t\tpath: '/users/me',\n\t\t\t\tdata: this.data,\n\t\t\t\ttoken: this.token\n\t\t\t},\n\t\t\t(error, response) => {\n\t\t\t\tif (error) { return callback(error); }\n\t\t\t\tObject.assign(this.expectedUser, response.user.$set, this.data, {\n\t\t\t\t\tlastReads: {},\n\t\t\t\t\tpreferences: {\n\t\t\t\t\t\tacceptedTOS: true\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tdelete this.data;\t// don't need this anymore\n\t\t\t\tcallback();\n\t\t\t}\n\t\t);\n\t}", "set userName(aValue) {\n this._logService.debug(\"gsDiggUserDTO.userName[set]\");\n this._userName = aValue;\n }", "function registerUserProperties (varProperty, varValue, fncCallback) {\r\n providers.forEach(function _registerUserProperties (provider) {\r\n if (typeof provider.obj.registerUserProperties === 'function') {\r\n provider.obj.registerUserProperties(varProperty, varValue, fncCallback);\r\n }\r\n });\r\n}", "function addPropertyV3(userData, userId) {\n\n const newObj = Object.assign({}, userData);\n newObj.id = userId;\n\n\n return newObj;\n\n}", "[AUTH_MUTATIONS.SET_TOKEN](state, token) {\n state.token = token\n }", "function create_user(userobject){\n\n}", "function User(myName) {\n this.myName = myName;\n this.PI = 3.14;\n //this.myName = myName;\n }", "function setUserId() {\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function() {\n if (xhr.readyState == XMLHttpRequest.DONE) {\n var userId = xhr.responseText;\n if(validateId(userId)) {\n chrome.storage.local.set({'userId': userId, 'recentlyUpdated': true}, function() {\n console.log('Settings saved');\n });\n chrome.runtime.setUninstallURL(\"https://www.netflixparty.com/uninstall?userId=\" + userId);\n }\n }\n }\n xhr.open('GET', 'https://data2.netflixparty.com/create-userId', true);\n xhr.send(null);\n }", "[AUTH_MUTATIONS.SET_USER](state, user) {\n state.user = user\n }", "function userToken(payload) {\n return {\n type: _user.TOKEN,\n payload\n };\n}", "function renewAppUserToken() {\n\n }", "function setUser(user) {\n callOnHub('setUser', user);\n}", "function setUser(user) {\n callOnHub('setUser', user);\n}", "function setUser(user) {\n callOnHub('setUser', user);\n}", "makeUserData(callback) {\n\t\tsuper.makeUserData(() => {\n\t\t\tthis.data.compactModifiedRepos = {\n\t\t\t\t[this.team.id]: {\n\t\t\t\t\ta: 1\n\t\t\t\t}\n\t\t\t};\n\t\t\tcallback();\n\t\t});\n\t}", "set userName (value) {\n this._userName = value\n /**\n * @event IrcUser#userName\n */\n this.emit('userName')\n }", "set registered(aValue) {\n this._logService.debug(\"gsDiggUserDTO.registered[set]\");\n this._registered = aValue;\n }", "setUser (user) {\n AppStorage.setUserData(user)\n AppDispatcher.handleAction({\n actionType: 'USER_SET',\n data: user\n })\n }", "function set_new_user_name(env, title, first, initial, last) {\n init_new_user_storage(env);\n env.auth.new_user.name = [title, first, initial, last];\n}", "function updateUserStuff(user) {\n console.log(\"doing stuff for\", user.get('username'));\n}", "function addPropertyV4(userData, userId) {\n const newObj = {...userData };\n newObj.id = userId;\n return newObj;\n}", "function addToken(playername, counter, counterid, tokentype) {\n return {\n type: 'ADD_TOKEN',\n payload: {\n playername: playername,\n counter: counter,\n counterid: counterid,\n tokentype: tokentype\n }\n };\n}", "function addPropertyV3(userData, userId) {\n // put your code here\n let userIdArr = [];\n userIdArr.id = userId;\n const copyUserData = Object.assign({}, userData);\n const res = Object.assign(copyUserData, userIdArr);\n return res;\n}", "saveToken(token, role){\n this.token = token; \n this.role = role; \n localStorage.setItem('token', token) \n localStorage.setItem('role', role)\n }", "function setToken(newToken) {\n token = angular.isString(newToken) ? newToken : token;\n }", "async setCustomUserClaims(uid, customUserClaims) {\n state_mgmt_1.updateUser(uid, { customClaims: customUserClaims });\n }" ]
[ "0.5659154", "0.56403583", "0.56177485", "0.5595903", "0.5546379", "0.5506581", "0.54361624", "0.541964", "0.5378096", "0.5339057", "0.5331473", "0.52860504", "0.5226598", "0.51550525", "0.51489383", "0.5125288", "0.5108242", "0.5106016", "0.5095631", "0.5087242", "0.50839734", "0.5076639", "0.50591063", "0.5036794", "0.50103337", "0.4952836", "0.49356252", "0.4926972", "0.4901046", "0.49007937", "0.4897577", "0.48914972", "0.48882747", "0.48763287", "0.4854691", "0.48514345", "0.48510578", "0.48354688", "0.48306236", "0.48297673", "0.48288053", "0.481865", "0.48159218", "0.48085365", "0.48021418", "0.47958857", "0.4789849", "0.4785219", "0.4778335", "0.47767383", "0.4769251", "0.4755468", "0.47501317", "0.47471085", "0.47453868", "0.47433499", "0.4735008", "0.47348008", "0.47332382", "0.47322908", "0.47321755", "0.47317797", "0.47248468", "0.47248468", "0.47148776", "0.46981338", "0.4695985", "0.4695578", "0.468889", "0.46846098", "0.46833548", "0.46804416", "0.46749935", "0.46744803", "0.46737602", "0.4673064", "0.46698016", "0.4668448", "0.4649216", "0.464776", "0.46461222", "0.46441525", "0.4631112", "0.4628505", "0.46096054", "0.4595051", "0.45912963", "0.45912963", "0.45912963", "0.45911446", "0.45894682", "0.4588846", "0.45860508", "0.45856345", "0.4576815", "0.457577", "0.45755494", "0.45701966", "0.45505744", "0.4544929", "0.4544489" ]
0.0
-1
Delete a custom parameter of a Run user. The Run user is identified by the token in the constructor.
async removeItem(tagoRunURL, key) { const result = await this.doRequest({ path: `/run/${tagoRunURL}/sdb/${key}`, method: "DELETE", }); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeToken() {\n setValue(\"token\", null);\n}", "delete() {\n if (typeof this.ctxPtr !== 'undefined' && this.ctxPtr !== null) {\n Module._vscf_message_info_custom_params_delete(this.ctxPtr);\n this.ctxPtr = null;\n }\n }", "function rawRemoveScopedUserToken(token)\n{\n\tif(!apiutil.isSafeString(token)){\n\t\tr3logger.elog('parameter is wrong : token=' + JSON.stringify(token));\n\t\treturn false;\n\t}\n\n\t//\n\t// Check token\n\t//\n\tif(0 === token.indexOf('R=')){\n\t\tr3logger.elog('token(' + JSON.stringify(token) + ') is role token.');\n\t\treturn false;\n\t}else if(0 === token.indexOf('U=')){\n\t\ttoken = token.substr(2);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// cut 'U='\n\t}\n\tvar\ttoken_info = rawCheckUserToken(token);\n\tif(\tnull === token_info\t\t\t\t\t\t\t||\n\t\t!apiutil.isSafeString(token_info.user)\t\t||\n\t\t!apiutil.isSafeString(token_info.tenant)\t||\n\t\t!apiutil.isSafeEntity(token_info.scoped)\t||\n\t\t'boolean' !== typeof token_info.scoped\t\t||\n\t\ttrue !== token_info.scoped\t\t\t\t\t)\n\t{\n\t\tr3logger.elog('token(' + JSON.stringify(token) + ') is something wrong.');\n\t\treturn false;\n\t}\n\n\t//\n\t// Remove token\n\t//\n\tvar\tdkcobj\t\t\t= k2hr3.getK2hdkc(true, false);\t\t\t\t\t\t\t\t\t\t// use permanent object(need to clean)\n\tvar\tsubkeylist;\n\tvar\terrmsg\t\t\t= '';\n\tif(!apiutil.isSafeEntity(dkcobj)){\n\t\treturn false;\n\t}\n\n\t//\n\t// Keys\n\t//\n\tvar\tkeys\t\t\t= r3keys(token_info.user, token_info.tenant);\n\tvar\ttoken_top_key\t= keys.TOKEN_USER_TOP_KEY;\t\t\t\t\t\t\t\t\t\t\t// \"yrn:yahoo::::token:user\"\n\tvar\ttoken_value_key\t= keys.TOKEN_USER_TOP_KEY + '/' + token;\t\t\t\t\t\t\t// \"yrn:yahoo::::token:user/<token>\"\n\tvar\tutoken_top_key\t= keys.USER_TENANT_AMBIGUOUS_TOKEN_KEY;\t\t\t\t\t\t\t\t// \"yrn:yahoo::::user:<user>:tenant/<tenant>/token\"\n\tvar\tutoken_token_key= keys.USER_TENANT_AMBIGUOUS_TOKEN_KEY + '/' + token;\t\t\t\t// \"yrn:yahoo::::user:<user>:tenant/{<tenant>}/token/<token>\"\n\tvar\tutoken_seed_key\t= utoken_token_key + '/' + keys.SEED_KW;\t\t\t\t\t\t\t// \"yrn:yahoo::::user:<user>:tenant/{<tenant>}/token/<token>/seed\"\n\n\t//\n\t// check under token top\n\t//\n\tsubkeylist\t= apiutil.getSafeArray(dkcobj.getSubkeys(token_top_key, true));\n\tif(apiutil.removeStringFromArray(subkeylist, token_value_key)){\t\t\t\t\t\t\t// remove subkeys \"yrn:yahoo::::token:user/<token>\" -> \"yrn:yahoo::::token:user\"\n\t\tif(!dkcobj.setSubkeys(token_top_key, subkeylist)){\n\t\t\terrmsg += 'could not remove ' + token_value_key + ' subkey under ' + token_top_key + ' key, ';\n\t\t}\n\t}\n\tif(!dkcobj.remove(token_value_key, false)){\t\t\t\t\t\t\t\t\t\t\t\t// remove key \"yrn:yahoo::::token:user/<token>\"\n\t\terrmsg += 'could not remove ' + token_value_key + 'key, probably it is not existed, ';\n\t}\n\n\t//\n\t// check under user top\n\t//\n\tsubkeylist\t= apiutil.getSafeArray(dkcobj.getSubkeys(utoken_top_key, true));\n\tif(apiutil.removeStringFromArray(subkeylist, utoken_token_key)){\t\t\t\t\t\t// remove subkeys \"yrn:yahoo::::user:<user>:tenant/{<tenant>}/token/<token>\" -> \"yrn:yahoo::::user:<user>:tenant/{<tenant>}/token\"\n\t\tif(!dkcobj.setSubkeys(utoken_top_key, subkeylist)){\n\t\t\terrmsg += 'could not remove ' + utoken_token_key + ' subkey under ' + utoken_top_key + ' key, ';\n\t\t}\n\t}\n\tsubkeylist\t= apiutil.getSafeArray(dkcobj.getSubkeys(utoken_token_key, true));\n\tif(apiutil.removeStringFromArray(subkeylist, utoken_seed_key)){\t\t\t\t\t\t\t// remove subkeys \"yrn:yahoo::::user:<user>:tenant/{<tenant>}/token/<token>/seed\" -> \"yrn:yahoo::::user:<user>:tenant/{<tenant>}/token/<token>\"\n\t\tif(!dkcobj.setSubkeys(utoken_token_key, subkeylist)){\n\t\t\terrmsg += 'could not remove ' + utoken_seed_key + ' subkey under ' + utoken_token_key + ' key, ';\n\t\t}\n\t}\n\tif(!dkcobj.remove(utoken_seed_key, false)){\t\t\t\t\t\t\t\t\t\t\t\t// remove key \"yrn:yahoo::::user:<user>:tenant/{<tenant>}/token/<token>/seed\"\n\t\terrmsg += 'could not remove ' + utoken_seed_key + 'key, probably it is not existed, ';\n\t}\n\tif(!dkcobj.remove(utoken_token_key, false)){\t\t\t\t\t\t\t\t\t\t\t// remove key \"yrn:yahoo::::user:<user>:tenant/{<tenant>}/token/<token>\"\n\t\terrmsg += 'could not remove ' + utoken_token_key + 'key, probably it is not existed, ';\n\t}\n\n\tif(apiutil.isSafeString(errmsg)){\n\t\tr3logger.elog(errmsg);\n\t}\n\n\tdkcobj.clean();\n\treturn true;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Returns true even if there is an error in deletion processing\n}", "function deleteUser(user) {\n console.log(user, 'deleted');\n}", "function deleteUser(user) {\n console.log(user, 'deleted');\n}", "function deleteUserToken() {\n setCookie('token', '', 0);\n}", "deletePipelineVariableForUser(incomingOptions, cb) {\n const Bitbucket = require('./dist');\n\n let apiInstance = new Bitbucket.PipelinesApi(); // String | The account // String | The UUID of the variable to delete.\n /*let username = \"username_example\";*/ /*let variableUuid = \"variableUuid_example\";*/ apiInstance.deletePipelineVariableForUser(\n incomingOptions.username,\n incomingOptions.variableUuid,\n (error, data, response) => {\n if (error) {\n cb(error, null, response);\n } else {\n cb(null, '', response);\n }\n }\n );\n }", "function deleteData() {\n return deleteType(USER_T);\n}", "deleteUserHostedPropertyValue(incomingOptions, cb) {\n const Bitbucket = require('./dist');\n\n let apiInstance = new Bitbucket.PropertiesApi(); // String | The user // String | The key of the Connect app // String | The name of the property.\n /*let username = \"username_example\";*/ /*let appKey = \"appKey_example\";*/ /*let propertyName = \"propertyName_example\";*/ apiInstance.deleteUserHostedPropertyValue(\n incomingOptions.username,\n incomingOptions.appKey,\n incomingOptions.propertyName,\n (error, data, response) => {\n if (error) {\n cb(error, null, response);\n } else {\n cb(null, '', response);\n }\n }\n );\n }", "function deleteActiveUser(delActiveUser) {\n alert(\"User \" + activeUser.nome + \" (\" + activeUser.numero + \") successfully logged out.\");\n localStorage.removeItem(\"ActiveUser\");\n resetVariables();\n}", "async destroy() {\n const { ctx, service } = this;\n const params = getParams(ctx, 'body');\n const condition = Object.assign({}, params);\n const res = await service.user.crud({\n type: 'deleteOne',\n condition,\n });\n ctx.body = res;\n }", "function delete_token (token) {\n // Remove the id from the saved list\n var token_data = $.data(token.get(0), \"tokeninput\");\n var callback = $(input).data(\"settings\").onDelete;\n\n var index = token.prevAll().length;\n if(index > selected_token_index) index--;\n\n // Delete the token\n token.remove();\n selected_token = null;\n\n // Show the input box and give it focus again\n focus_with_timeout(input_box);\n\n // Remove this token from the saved list\n saved_tokens = saved_tokens.slice(0,index).concat(saved_tokens.slice(index+1));\n if(index < selected_token_index) selected_token_index--;\n\n // Update the hidden input\n update_hidden_input(saved_tokens, hidden_input);\n\n token_count -= 1;\n\n if($(input).data(\"settings\").tokenLimit !== null) {\n input_box\n .show()\n .val(\"\");\n focus_with_timeout(input_box);\n }\n\n // Execute the onDelete callback if defined\n if($.isFunction(callback)) {\n callback.call(hidden_input,token_data);\n }\n }", "function delete_token (token) {\n // Remove the id from the saved list\n var token_data = $.data(token.get(0), \"tokeninput\");\n var callback = $(input).data(\"settings\").onDelete;\n\n var index = token.prevAll().length;\n if(index > selected_token_index) index--;\n\n // Delete the token\n token.remove();\n selected_token = null;\n\n // Show the input box and give it focus again\n focus_with_timeout(input_box);\n\n // Remove this token from the saved list\n saved_tokens = saved_tokens.slice(0,index).concat(saved_tokens.slice(index+1));\n if(index < selected_token_index) selected_token_index--;\n\n // Update the hidden input\n update_hidden_input(saved_tokens, hidden_input);\n\n token_count -= 1;\n\n if($(input).data(\"settings\").tokenLimit !== null) {\n input_box\n .show()\n .val(\"\");\n focus_with_timeout(input_box);\n }\n\n // Execute the onDelete callback if defined\n if($.isFunction(callback)) {\n callback.call(hidden_input,token_data);\n }\n }", "deleteUserApiToken() {\n this.__userApiToken__ = null\n sessionStorage.removeItem('freendies-user-token')\n }", "function delete_token (token) {\n // Remove the id from the saved list\n var token_data = $.data(token.get(0), \"tokeninput\");\n var callback = settings.onDelete;\n\n var index = token.prevAll().length;\n if(index > selected_token_index) index--;\n\n // Delete the token\n token.remove();\n selected_token = null;\n\n // Show the input box and give it focus again\n input_box.focus();\n\n // Remove this token from the saved list\n saved_tokens = saved_tokens.slice(0,index).concat(saved_tokens.slice(index+1));\n if(index < selected_token_index) selected_token_index--;\n\n // Update the hidden input\n update_hidden_input(saved_tokens, hidden_input);\n\n token_count -= 1;\n\n if(settings.tokenLimit !== null) {\n input_box\n .show()\n .val(\"\")\n .focus();\n }\n\n // Execute the onDelete callback if defined\n if($.isFunction(callback)) {\n callback.call(hidden_input,token_data);\n }\n }", "function delete_token (token) {\n // Remove the id from the saved list\n var token_data = $.data(token.get(0), \"tokeninput\");\n var callback = settings.onDelete;\n\n var index = token.prevAll().length;\n if(index > selected_token_index) index--;\n\n // Delete the token\n token.remove();\n selected_token = null;\n\n // Show the input box and give it focus again\n input_box.focus();\n\n // Remove this token from the saved list\n saved_tokens = saved_tokens.slice(0,index).concat(saved_tokens.slice(index+1));\n if(index < selected_token_index) selected_token_index--;\n\n // Update the hidden input\n var token_ids = $.map(saved_tokens, function (el) {\n return el.id;\n });\n hidden_input.val(token_ids.join(settings.tokenDelimiter));\n\n token_count -= 1;\n\n if(settings.tokenLimit !== null) {\n input_box\n .show()\n .val(\"\")\n .focus();\n }\n\n // Execute the onDelete callback if defined\n if($.isFunction(callback)) {\n callback.call(hidden_input,token_data);\n }\n }", "static revokeToken() {\n this._revokeUserAuthorizationFromStore();\n\n const url = this.authUrlBeginning + \"revoke_token/\";\n const tokenFromLS = this.getTokenFromLS();\n\n localStorage.setItem(\"tokenObject\", \"\");\n\n const data = { token: tokenFromLS, client_id: process.env.REACT_APP_CLIENT_ID };\n const options = {\n headers: {\n \"Content-Type\": \"application/json\"\n },\n method: \"POST\",\n body: data\n };\n\n this._fetchFromAPI(url, options);\n }", "function removeUser() {\n const getParams = new URLSearchParams(location.search);\n const taskID = getParams.get('taskID');\n const userID = 1; // Get current userID from cookies?\n const params = new URLSearchParams('taskID=' + taskID + '&userID=' + userID);\n console.log('/task-remove-user', params);\n fetch('/task-remove-user', {method: 'post', body: params})\n .then(() => getTaskInfo());\n}", "function delete_token (token) {\n // Remove the id from the saved list\n var token_data = $.data(token.get(0), \"tokeninput\");\n var callback = $(input).data(\"settings\").onDelete;\n\n var index = token.prevAll().length;\n if(index > selected_token_index) index--;\n\n // Delete the token\n token.remove();\n selected_token = null;\n\n // Show the input box and give it focus again\n focus_with_timeout(input_box);\n\n // Remove this token from the saved list\n saved_tokens = saved_tokens.slice(0,index).concat(saved_tokens.slice(index+1));\n if (saved_tokens.length == 0) {\n input_box.attr(\"placeholder\", settings.placeholder)\n }\n if(index < selected_token_index) selected_token_index--;\n\n // Update the hidden input\n update_hidden_input(saved_tokens, hidden_input);\n\n token_count -= 1;\n\n if($(input).data(\"settings\").tokenLimit !== null) {\n input_box\n .show()\n .val(\"\");\n focus_with_timeout(input_box);\n }\n\n // Execute the onDelete callback if defined\n if($.isFunction(callback)) {\n callback.call(hidden_input,token_data);\n }\n\n\t\t\t\tresize_input(true);\n }", "function userDeleted(data){\n console.log(\" User Deleted: \"+data);\n}", "function removeParam(paramObj) {\n vm.parametersList.deleteParameterItem(paramObj);\n $timeout(vm.validateNamesUnique);\n }", "function removeStoredToken(){\n var url = 'https://accounts.google.com/o/oauth2/revoke?token=' + tokenStored;\n window.fetch(url);\n chrome.identity.removeCachedAuthToken({token: tokenStored}, function (){});\n}", "function deleteToken () {\n localStorage.removeItem('token')\n}", "deleteToken() {\n this.commit(\"removeToken\")\n this.commit(\"unsetAuthUser\")\n // router.push({name: \"login\"})\n }", "async remove() {\n // this function is really just a wrapper around axios\n await axios({\n url: `${BASE_URL}/users/${this.username}`,\n method: \"DELETE\",\n data: {\n token: this.loginToken\n }\n });\n }", "delete(data, cb) {\n const { queryStringObject: { id } } = data;\n // Check for valid id\n const validId = helpers.auditParam(id, 'string', { requiredLength: 20, operator: '=='});\n if (validId) {\n // Lookup the token\n _data.read('tokens', id, (err, tokenData) => {\n if (!err && tokenData) {\n // Token found\n _data.delete('tokens', id, err => {\n if (!err) {\n cb(200);\n } else {\n cb(500, {Error: 'Could not delete the specified token'});\n }\n });\n } else {\n cb(400, {Error: 'Could not find the specified token'});\n }\n });\n } else {\n cb(400, {Error: 'Missing required field'});\n }\n }", "static delete(req, res) {\n\n const getIdUser = parseInt(req.params.user)\n\n GEN_DATA_AGUNAN.destroy({ where: { UserId: getIdUser } })\n .then((data) => {\n res.status(200).json({\n message: \"delete Data success\",\n result: data\n })\n })\n .catch((err) => {\n res.status(500).json({\n message: \"Internal Server Error\",\n log: err\n })\n })\n }", "destroyToken() {\n localStorage.removeItem('Authorization');\n }", "deleteUserWithSameParams() {\n cy.okapiRequest({\n method: 'DELETE',\n path: `users/${DefaultUser.defaultUiPatron.body.id}`,\n });\n cy.okapiRequest({\n method: 'DELETE',\n path: `groups/${DefaultUser.defaultUiPatron.body.patronGroup}`,\n });\n }", "deleteUser(user) {\n if(user.privilege === global.SUPER_ADMIN) {\n console.log(\"Errr! You are trying to delete a super admin user\");\n return 401;\n }\n user = null;\n return user;\n }", "function delete_user() {\n\tvar uri = \"http://localhost:8081/\" + user.accountType + \"s/\" + user.id;\n\tvar xhr = createRequest(\"DELETE\", uri);\n\txhr.onload = function() {\n\t\tif(xhr.status == 400) alert(\"Format Error\");\n\t\telse if(xhr.status != 200) alert(\"Something went wrong :/\");\n\t\telse {\n\t\t\tlocalStorage.removeItem(\"user\");\n\t\t\twindow.location.href = \"/\";\n\t\t}\n\t}\n\txhr.send();\n}", "function unlink(service, req, res) {\n var user = req.user;\n user[service].token = undefined;\n user.save(function(err) {\n res.redirect('/profile');\n })\n}", "deletePipelineVariableForTeam(incomingOptions, cb) {\n const Bitbucket = require('./dist');\n\n let apiInstance = new Bitbucket.PipelinesApi(); // String | The account // String | The UUID of the variable to delete.\n /*let username = \"username_example\";*/ /*let variableUuid = \"variableUuid_example\";*/ apiInstance.deletePipelineVariableForTeam(\n incomingOptions.username,\n incomingOptions.variableUuid,\n (error, data, response) => {\n if (error) {\n cb(error, null, response);\n } else {\n cb(null, '', response);\n }\n }\n );\n }", "function deleteUser() {\n playersRef.child(thisIsPlayerNumberX).remove();\n // disableGamePlay();\n}", "function deleteUser(){ \n let userId = parseInt(event.target.dataset.id)\n\n fetch(`${BASE_URL}/users/${userId}`, {\n method: 'DELETE'\n })\n\n this.location.reload()\n}", "function deleteUserPermission(user) {\n $('#userIdDelete').val(user.user_id);\n $('#nameDelete').text(user.first_name + ' ' + user.last_name);\n $('#deleteModal').modal('show');\n}", "delete(token) {\n this.assignedValues.delete(token);\n this.tearDownBindingObserver(token);\n const upstream = this.getRaw(token);\n\n if (upstream) {\n this.hydrate(token, upstream);\n } else {\n this.store.delete(token);\n }\n }", "function deleteUserPin(pin, callback) {\n timelineRequest(pin, 'DELETE', callback);\n}", "function deleteUserPin(pin, callback) {\n timelineRequest(pin, 'DELETE', callback);\n}", "function deleteUserPin(pin, callback) {\n timelineRequest(pin, 'DELETE', callback);\n}", "deleteUser(ctx, payload) {\n return new Promise((resolve, reject) => {\n axios\n .delete(`admin/user/${payload.id}?token=${payload.token}`)\n .then(response => {\n resolve(response);\n })\n .catch(error => {\n reject(error);\n });\n });\n }", "del() {\n let argv = this.argv;\n let key = argv.del || argv.d;\n let config = this.readSteamerConfig({ isGlobal: this.isGlobal });\n\n delete config[key];\n\n this.createSteamerConfig(config, {\n isGlobal: this.isGlobal,\n overwrite: true,\n });\n }", "deleteUserRequest() {\n SuperAgent\n .del('/users/' + this.props.user._id)\n .end((error, response) => {\n if (error) {\n console.log('UserCard - Error deleting user from request');\n } else {\n this.props.removeUser(this.props.index);\n }\n });\n }", "deleteUser({ commit }, id) {\n commit(\"deleteUser\", id)\n }", "function revokeToken() {\n\t\texec_result.innerHTML='';\n\t\tgetAuthToken({\n\t\t\t'interactive': false,\n\t\t\t'callback': revokeAuthTokenCallback,\n\t\t});\n\t}", "function deleteUserPin(pin, callback) {\n timelineRequest(pin, 'DELETE', null, null, callback);\n}", "function deleteUserPin(pin, callback) {\n timelineRequest(pin, 'DELETE', null, null, callback);\n}", "async removeProjectUser(input = { projectId: '0', userIds: [] }) {\n\n return await this.request({\n name: 'project.people.remove',\n args: [input.projectId],\n params: {\n remove: {\n userIdList: this.formatList(input.userIds)\n }\n }\n });\n\n }", "destroyToken () {\n localStorage.removeItem('token')\n localStorage.removeItem('expiration')\n\n admin = false\n professor = false\n student = false\n }", "function removeUserArticle(user) {\n document.querySelector(`[data-id=\"${user.id}\"]`).remove();\n}", "function deleteUser(userData) {\n // Makes sure that currentUser is set before getting messages from the server\n AuthFactory.auth.$onAuthStateChanged(function(currentUser) {\n\n if(currentUser){\n currentUser.getToken().then(function(idToken) {\n return $http({\n method: 'DELETE',\n url: '/profile-edit/delete-user/' + mentorId,\n headers: {\n id_token: idToken\n },\n data: {\n userData: userData\n }\n })\n .then(function(response) {\n getProfiles();\n }),\n function(error) {\n console.log('Error with user DELETE request: ', error);\n };\n });\n }\n });\n }", "function delToken() {\n noToken = \"Token Removed\";\n $.ajax({\n type: 'POST',\n url: '/savetoken',\n data: { token: noToken },\n success: function() {\n console.log('Removed token from SP database: ' + noToken);\n window.location.reload();\n }\n });\n}", "delete(param, value) {\n return this.clone({\n param,\n value,\n op: 'd'\n });\n }", "function deleteUserElement(req){\n deleteElement(dataTable_users,'#user_'+req.request.data);\n updateUserSelect();\n}", "function deleteToken(){\n try\n {\n return LocalStorage.removeObject(Constants.TOKEN);\n \n }\n catch(err)\n {\n return {};\n }\n }", "async deletePost({ user, params }, res) {\n const deletePost = await Post.destroy({\n _id: postID\n })\n const updatedUser = await User.findOneAndUpdate(\n { _id: user._id },\n { $pull: { savedPosts: { postID: params.id } } },\n { new: true }\n );\n if (!updatedUser) {\n return res.status(404).json({ message: \"Couldn't find user with this id!\" });\n }\n return res.json(updatedUser);\n }", "function deleteValue(key){\n\tif (hasStorage()) {\n\t\tlocalStorage.removeItem(window.xuser.id + '|' + key);\n\t}\n}", "function removeDeviceToken() {\n var tkn = {\n \"token\": $scope.regId\n };\n $http.post('http://192.168.1.106:8000/unsubscribe', JSON.stringify(tkn))\n .success(function(data, status) {\n console.log(\"Token removed, device is successfully unsubscribed and will not receive push notifications.\");\n })\n .error(function(data, status) {\n console.log(\"Error removing device token.\" + data + \" \" + status)\n });\n }", "delete(userlogin) {\n return __awaiter(this, void 0, void 0, function* () {\n if (userlogin == null) {\n throw new nullargumenterror_1.NullArgumentError('userLogin');\n }\n let index = this.logins.findIndex(l => l.user == userlogin.user);\n if (index != -1) {\n this.logins.splice(index, 1);\n }\n });\n }", "deleteDeploymentVariable(incomingOptions, cb) {\n const Bitbucket = require('./dist');\n\n let apiInstance = new Bitbucket.PipelinesApi(); // String | The account // String | The repository // String | The environment // String | The UUID of the variable to delete.\n /*let username = \"username_example\";*/ /*let repoSlug = \"repoSlug_example\";*/ /*let environmentUuid = \"environmentUuid_example\";*/ /*let variableUuid = \"variableUuid_example\";*/ apiInstance.deleteDeploymentVariable(\n incomingOptions.username,\n incomingOptions.repoSlug,\n incomingOptions.environmentUuid,\n incomingOptions.variableUuid,\n (error, data, response) => {\n if (error) {\n cb(error, null, response);\n } else {\n cb(null, '', response);\n }\n }\n );\n }", "function deleteUser(userID){\n /* Exceptions */\n var func = arguments.callee.toString().match(/function ([^\\(]+)/)[1];\n if (typeof userID != 'number' || !Number.isInteger(userID)){\n throw `${func}: userID must be an integer.`;\n }\n var queryDum = `\n DELETE FROM\n users\n WHERE\n user_id = ?\n `;\n var columnVals = [userID];\n con.query(queryDum,columnVals);\n}", "function remove() {\n // sessionStorage.removeItem(TOKEN_KEY);\n}", "deleteRepositoryPipelineVariable(incomingOptions, cb) {\n const Bitbucket = require('./dist');\n\n let apiInstance = new Bitbucket.PipelinesApi(); // String | The account // String | The repository // String | The UUID of the variable to delete.\n /*let username = \"username_example\";*/ /*let repoSlug = \"repoSlug_example\";*/ /*let variableUuid = \"variableUuid_example\";*/ apiInstance.deleteRepositoryPipelineVariable(\n incomingOptions.username,\n incomingOptions.repoSlug,\n incomingOptions.variableUuid,\n (error, data, response) => {\n if (error) {\n cb(error, null, response);\n } else {\n cb(null, '', response);\n }\n }\n );\n }", "function useDeleteButton() {\r\n var user = document.getElementById(\"userID\").value;\r\n deleteASingleUser(user)\r\n startPage()\r\n}", "delete(param, value) {\n return this.clone({ param, value, op: 'd' });\n }", "delete(param, value) {\n return this.clone({ param, value, op: 'd' });\n }", "delete(param, value) {\n return this.clone({ param, value, op: 'd' });\n }", "delete(param, value) {\n return this.clone({ param, value, op: 'd' });\n }", "delete(param, value) {\n return this.clone({ param, value, op: 'd' });\n }", "deleteVar(name) {\n const args = this._getArgsByPrefix(name);\n return this.request(`${this.prefix}del_var`, args);\n }", "teamTeamIdUserUserIdDelete(incomingOptions, cb) {\n const Rollbar = require('./dist');\n\n let apiInstance = new Rollbar.DefaultApi(); // String | Use an account access token with 'write' scop // String | // String |\n /*let xRollbarAccessToken = \"xRollbarAccessToken_example\";*/ /*let teamId = \"teamId_example\";*/ /*let userId = \"userId_example\";*/ apiInstance.teamTeamIdUserUserIdDelete(\n incomingOptions.xRollbarAccessToken,\n incomingOptions.teamId,\n incomingOptions.userId,\n (error, data, response) => {\n if (error) {\n cb(error, null, response);\n } else {\n cb(null, data.result, response);\n }\n }\n );\n }", "static removeToken() {\n window.localStorage.removeItem(this.TOKEN_KEY);\n }", "async function deleteFavoriteTeam(user_id, team_id){\r\n await DButils.execQuery(\r\n `DELETE FROM dbo.favoriteTeams \r\n WHERE (user_id = '${user_id}' AND team_id = '${team_id}');`\r\n );\r\n}", "deletePullRequestHostedPropertyValue(incomingOptions, cb) {\n const Bitbucket = require('./dist');\n\n let apiInstance = new Bitbucket.PropertiesApi(); // String | The account // String | The repository // String | The pull request ID // String | The key of the Connect app // String | The name of the property.\n /*let username = \"username_example\";*/ /*let repoSlug = \"repoSlug_example\";*/ /*let pullrequestId = \"pullrequestId_example\";*/ /*let appKey = \"appKey_example\";*/ /*let propertyName = \"propertyName_example\";*/ apiInstance.deletePullRequestHostedPropertyValue(\n incomingOptions.username,\n incomingOptions.repoSlug,\n incomingOptions.pullrequestId,\n incomingOptions.appKey,\n incomingOptions.propertyName,\n (error, data, response) => {\n if (error) {\n cb(error, null, response);\n } else {\n cb(null, '', response);\n }\n }\n );\n }", "async remove() {\n const { id } = this;\n const options = {\n TableName: process.env.userTableName,\n Key: ddb.prepare({ id })\n };\n return ddb.call('deleteItem', options);\n }", "function removeUser(User, data) {\n var userName = User.get('user');\n\n if (!_.isUndefined(data[userName])) {\n delete data[userName];\n }\n\n return data;\n }", "logOutUser(){\n localStorage.removeItem('token')\n }", "removeByLoginName(loginName) {\r\n const o = this.clone(SiteUsers_1, `removeByLoginName(@v)`);\r\n o.query.set(\"@v\", `'${encodeURIComponent(loginName)}'`);\r\n return o.postCore();\r\n }", "function eliminarPersona(user,res){\n tb_persona.connection.query(\"DELETE FROM persona WHERE id=\" + user.id);\n res.send();\n}", "delete(user) {\n return __awaiter(this, void 0, void 0, function* () {\n if (user == null) {\n throw new nullargumenterror_1.NullArgumentError('user');\n }\n let index = this.users.findIndex(u => u.id == user.id);\n if (index != -1) {\n this.users.splice(index, 1);\n }\n });\n }", "deleteProfile() {}", "function easyDel(pid, token, cb) {\n deletePost({\n from: selfId,\n original: selfId,\n pid: pid,\n token: token,\n deleted: 0\n }, function(res) {\n console.log(\"DELETED POST\");\n cb(res);\n });\n}", "deleteUser() {\n this.deleteBox.seen = true\n }", "remove (user, callback) {\n\t\tthrow new Error ('Not yet implemented');\n\t}", "delete({user, bookmark }, res) {\n if (user && user.id == bookmark.userId) {\n bookmark.destroy()\n .then( ()=> res.json(bookmark) );\n } else {\n res.sendStatus(403);\n }\n }", "function deleteAccount() {\n var storedParam = localStorage.getItem(\"userId\");\n var webMethod = \"../AccountServices.asmx/DeleateUser\";\n var parameters = \"{\\\"userId\\\":\\\"\" + encodeURI(storedParam) + \"\\\"}\";\n\n $.ajax({\n type: \"POST\",\n url: webMethod,\n data: parameters,\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n success: function (msg) {\n signOut();\n }\n });\n}", "deleteTokenFromSDK(queryData, tokenId, merchantId = config.merchantId) {\n return new Promise((resolve, reject) => {\n connectSdk.tokens.remove(merchantId, tokenId, queryData, (error, sdkResponse) => {\n if (error) return reject(error);\n\n return resolve(sdkResponse);\n });\n });\n }", "function delete_user() {\r\n alertBox.hide();\r\n const username = Utils.getInput();\r\n if(Utils.isEmpty(username))\r\n return;\r\n\r\n fetch('./delete', Utils.postUserParam(username)).then(function(response) {\r\n if(response.status !== 200) {\r\n alertBox.show('No such username!', true);\r\n return;\r\n }\r\n\r\n response.json().then(function(data) {\r\n alertBox.show(data.msg, false);\r\n init_saved(); //updates saved list\r\n });\r\n });\r\n }", "function delete_param(category, value){\n let params = deserialize_params(); //invokes the deserialize function again to get params because objects can't be passed to this via HTML\n let newparams = params[category]; //look at only array of params of same type (q, a, or n)\n newparams.splice(value,1); //remove param to be deleted\n params[category] = newparams;\n serialize_params(params); //serialize params with changes\n}", "removePermission(projectId, userId, callback) {\n scitran.removePermission('projects', projectId, userId, callback);\n }", "function del(config, auth, className, objectId, context) {\n if (typeof objectId !== 'string') {\n throw new Parse.Error(Parse.Error.INVALID_JSON, 'bad objectId');\n }\n\n if (className === '_User' && auth.isUnauthenticated()) {\n throw new Parse.Error(Parse.Error.SESSION_MISSING, 'Insufficient auth to delete user');\n }\n\n enforceRoleSecurity('delete', className, auth);\n\n let inflatedObject;\n let schemaController;\n\n return Promise.resolve()\n .then(() => {\n const hasTriggers = checkTriggers(className, config, ['beforeDelete', 'afterDelete']);\n const hasLiveQuery = checkLiveQuery(className, config);\n if (hasTriggers || hasLiveQuery || className == '_Session') {\n return new RestQuery(config, auth, className, { objectId })\n .execute({ op: 'delete' })\n .then(response => {\n if (response && response.results && response.results.length) {\n const firstResult = response.results[0];\n firstResult.className = className;\n if (className === '_Session' && !auth.isMaster && !auth.isMaintenance) {\n if (!auth.user || firstResult.user.objectId !== auth.user.id) {\n throw new Parse.Error(Parse.Error.INVALID_SESSION_TOKEN, 'Invalid session token');\n }\n }\n var cacheAdapter = config.cacheController;\n cacheAdapter.user.del(firstResult.sessionToken);\n inflatedObject = Parse.Object.fromJSON(firstResult);\n return triggers.maybeRunTrigger(\n triggers.Types.beforeDelete,\n auth,\n inflatedObject,\n null,\n config,\n context\n );\n }\n throw new Parse.Error(Parse.Error.OBJECT_NOT_FOUND, 'Object not found for delete.');\n });\n }\n return Promise.resolve({});\n })\n .then(() => {\n if (!auth.isMaster && !auth.isMaintenance) {\n return auth.getUserRoles();\n } else {\n return;\n }\n })\n .then(() => config.database.loadSchema())\n .then(s => {\n schemaController = s;\n const options = {};\n if (!auth.isMaster && !auth.isMaintenance) {\n options.acl = ['*'];\n if (auth.user) {\n options.acl.push(auth.user.id);\n options.acl = options.acl.concat(auth.userRoles);\n }\n }\n\n return config.database.destroy(\n className,\n {\n objectId: objectId,\n },\n options,\n schemaController\n );\n })\n .then(() => {\n // Notify LiveQuery server if possible\n const perms = schemaController.getClassLevelPermissions(className);\n config.liveQueryController.onAfterDelete(className, inflatedObject, null, perms);\n return triggers.maybeRunTrigger(\n triggers.Types.afterDelete,\n auth,\n inflatedObject,\n null,\n config,\n context\n );\n })\n .catch(error => {\n handleSessionMissingError(error, className, auth);\n });\n}", "function removeToken() {\n localStorage.removeItem('authorization');\n }", "deleteSessionToken() {\n store.delete(this.SESSION_TOKEN_STORAGE_KEY);\n }", "async function destroy(username) {\r\n await request\r\n .del(reqURL(`${config.routes.user.delete}/${username}`))\r\n .withCredentials()\r\n .set(\"Content-Type\", \"application/json\")\r\n .set(\"Accept\", \"application/json\")\r\n .auth(\"team\", \"DHKHJ98N-UHG9-K09J-7YHD-8Q7LK98DHGS7\");\r\n log(`destroy:${username}`);\r\n}", "function deleteSelected(){\n\t$('#deleteAccountBtn').on('click', function(){\n\t\tconst deletedUser = getUsername();\n\t\tdeleteUser(deletedUser);\n\t\tanomymizeUser(deletedUser);\n\t});\n}", "function deleteToken(req, res, next) {\n Token.deleteOne({\n _id: req.params.id,\n user: res.locals.user\n })\n .then(function(token) {\n if (token.deletedCount === 0) {\n res.status(404).json({\n error: {\n code: 404,\n message: `No such token: ${req.params.id}`\n }\n });\n } else {\n res.locals.attachment = {\n $pull: {\n tokens: req.params.id\n }\n };\n\n res.status(200).json({\n id: req.params.id,\n deleted: true\n });\n\n next();\n }\n })\n .catch(function(err) {\n console.log(err);\n\n res.status(500).json({\n error: {\n code: 500,\n message: 'Internal server error'\n }\n });\n });\n}", "async deleteUser({ rootGetters}, id){\n //set token additional header\n let tokenHeaders = {\n headers: { 'Authorization': \"Bearer \" + rootGetters.getToken }\n }\n //delete data user from API Server\n return await this.$axios.$delete('/user/' + id, tokenHeaders)\n }", "function delValue(params) {\n const { path, key, ipcEvent, options } = { path: './', key: '', ipcEvent: null, options: {}, ...params };\n const db = getOpenedDB(path, ipcEvent);\n if (!db) {\n return;\n }\n\n db.del(key, options).then(err => {\n if (err) {\n _handleError(err, ipcEvent);\n } else {\n if (ipcEvent) {\n ipcEvent.returnValue = {\n status: 'success'\n };\n } else {\n console.log(`Deleted ${path} -> ${key}`);\n }\n }\n });\n}", "function removeToken(removed, error) {\n return {\n type: SESSION_REMOVE,\n removed,\n error,\n };\n}", "function deleteUser() {\n fetch(\n `https://serene-basin-92650.herokuapp.com/delet-user/${mystorage.getItem(\n \"id\"\n )}`,\n {\n method: \"GET\",\n body: JSON.stringify(),\n headers: {\n \"Content-type\": \"application/json\",\n },\n }\n )\n .then((res) => res.json())\n .then((data) => {\n console.log(data);\n });\n if (data[\"status_code\"] == 200) {\n alert(\"profile deleted successful\");\n window.location.reload();\n } else {\n alert(\"profile not deleted\");\n }\n}", "function userAccountDelete(){\n // using delete will return a promise, and it will activate the onDelete function in the firebase.functions\n var user = auth.currentUser;\n user.delete().then(() => {\n\n //user deleted\n }).catch(err => {\n\n //some error happened\n });\n}" ]
[ "0.6025758", "0.59553814", "0.5855822", "0.57763153", "0.57763153", "0.57756644", "0.57037055", "0.5489108", "0.545625", "0.54480624", "0.5437034", "0.5437001", "0.5437001", "0.5435975", "0.5423958", "0.53701913", "0.5350273", "0.53465235", "0.5316363", "0.5305241", "0.529936", "0.5297698", "0.5247211", "0.5238101", "0.5236315", "0.5230713", "0.5180842", "0.5171295", "0.5154994", "0.514614", "0.51456726", "0.51369894", "0.513512", "0.5133677", "0.5120925", "0.5111996", "0.5095311", "0.5090801", "0.5090801", "0.5090801", "0.5084047", "0.50681204", "0.5066376", "0.5059402", "0.5048764", "0.5045517", "0.5045517", "0.5040374", "0.5022176", "0.50174844", "0.50144035", "0.50094783", "0.500753", "0.5003042", "0.49968055", "0.4986703", "0.49864954", "0.49593398", "0.49538577", "0.49455655", "0.4937113", "0.49336663", "0.49206054", "0.49164507", "0.4913739", "0.4913739", "0.4913739", "0.4913739", "0.4913739", "0.49115425", "0.49071327", "0.49018312", "0.4900184", "0.4896341", "0.48866677", "0.48852313", "0.48842105", "0.4878192", "0.4877968", "0.4874185", "0.48703903", "0.4869576", "0.48592386", "0.48485246", "0.48454008", "0.48444217", "0.48426214", "0.4829989", "0.48241574", "0.48155198", "0.48127747", "0.48109752", "0.48105302", "0.4810373", "0.48097846", "0.48047814", "0.47888443", "0.4782002", "0.47795424", "0.47727042", "0.47700274" ]
0.0
-1
given (lowNum, highNum, mult), print the numbers in multiples of mult from highNum down to lowNum, using a FOR loop. Example: For (2,9,3), print 9 6 3 (on successive lines).
function flexCountdown(lowNum, highNum, mult) { for (var i=highNum; i >= lowNum; i -= mult) { console.log(i); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function countByFourFl (highNum, lowNum, mult) {\n\tif (highNum<lowNum || mult == 0){\n\t\tconsole.log(\"Error\")\n\t\treturn\n\t}\n\twhile (highNum>=lowNum){\n\t\tif (highNum%mult==0){\n\t\t\tconsole.log(highNum)\n\t\t\thighNum-=mult\n\t\t} else {\n\t\t\thighNum--\n\t\t}\n\t}\n}", "function flexCount(lowNum,highNum,mult){\n while(highNum >= lowNum){\n if(highNum % mult == 0){\n console.log(highNum)\n }\n highNum -= 1\n\n}\n\n}", "function flex(low, high, mult){\n if((typeof low === 'number') && (typeof high === 'number') && (typeof mult === 'number') && mult){\n var highDiv = Math.floor(high / mult),\n lowDiv = Math.floor(low / mult)\n for(let i = highDiv; i > lowDiv; i -= 1){\n console.log(`The number in the countdown is ${i * mult}`)\n }\n } else {\n console.log(\"Invalid parameters\")\n }\n}", "function FlexCount(LowNum, HighNum, Mult){\n for(var i = HighNum; i < LowNum; i--){\n if(i / Mult === 0){\n console.log(i);\n }\n }\n}", "function showMultiples (num, numMultiples) {\n for (i=1; i<=numMultiples; i++) {\n var str = num + \" x \" + i + \" = \" + (num*i);\n console.log(str);\n }\n}", "function printmultiply(num,range=10)\n{\n console.log(`Up to range = ${range}`);\n for(let i = 1; i <= range; i++) {\n let product = num*i;\n console.log(`${num} * ${i} = ${product}`);\n}\n}", "function numbersInLoop(rangeStart, rangeEnd, divisor) {\n\tfor (index = rangeStart; index <= rangeEnd; index += 1) {\n\t\tif (index % divisor === 0) {\n\t\t\tconsole.log(index);\n\t\t}\n\t}\n}", "function numberRange(k,j,range=10) {\n for(let i = k; i<=j; i++)\n {\n console.log(`multiplication of ${k} up to range ${range}`);\n for(let y = 1; y<=range; y++)\n {\n let result = k * y;\n console.log(`${k}*${y}=${result}`)\n }\n k++;\n }\n}", "function main() {\n var n = parseInt(readLine());\n var i = 1;\n for (i=1; i<=10; i++) {\n var result = n*i;\n console.log(\"Multiple of \" + n + \"x\" + i + \"=\" +result);\n }\n\n}", "function multi(x) {\n for (var i = 1; i <= 10; i++)\n console.log(x + \"X\" + i + \"=\" + (i * x));\n \n}", "function printmultiplication(number) {\n console.log(`multiplication of ${number}`);\n for(let i= 1; i<=10; i++)\n {\n let result = number* i;\n console.log(`${number} * ${i} = ${result}`);\n }\n}", "function allProblems(low, high) {\n \n for (let a = low; a <= high; a++) {\n\tfor (let b = low; b <= high; b++) {\n\t problems.push({\n\t\tproblem: a + \" &times; \" + b,\n\t\tanswer: a*b\n\t });\n\t problems.push({\n\t\tproblem: a + \" + \" + b,\n\t\tanswer: a+b\n\t });\n\t problems.push({\n\t\tproblem: (a+b) + \" - \" + b,\n\t\tanswer: a\n\t });\n\t}\n }\n\n}", "function showMultiplicationTable(num) {\n for (var i = 0; i <= 10; i += 1) {\n console.log(num + \" X \" + i + \" = \" + (i * num));\n }\n}", "function multi(m) {\n var n1, n2;\n var i = 1\n n1 = m\n n2 = 12\n n2 = n2 + 1\n while (i < n2) {\n console.log(\"La Calcul de \" + (n1 + \"*\" + i + \" = \") + (n1 * i))\n i = i + 1\n\n }\n}", "function main() {\n var n = parseInt(readLine());\n for (let i = 1; i <= 10; i++) {\n var multiple = n * i\n console.log(n + ' x ' + i + ' = ' + multiple)\n }\n}", "function printAndCount(i=512, max=1000, mult=5){\n // while(i < max){\n // if(i % mult === 0){\n // console.log(i)\n // }\n // i++;\n // }\n let sum=0\n for(i; i<max; i+=5)\n {\n console.log(i)\n sum++;\n }\n \nconsole.log(sum);\n}", "function multiplesOfSix(min=0, max=600, inc=6){\n while(min < max){\n console.log(min)\n min += inc;\n }\n \n}", "function showMultiplicationTable() {\n var num = 7;\n for(var i = 1; i <= 10; ++i) {\n console.log(num + \"*\" + i + \"= \" + num * i);\n }\n}", "findMultiples(divisor, bottom, top) {\n let multiples = [];\n let start = this.findStart(divisor,bottom,top);\n if(start === 0){\n return multiples; // For occurrences when a lowest multiple does not exist in the range\n }\n while(start < top) {\n multiples.push(start);\n start = start + divisor;\n }\n\n return multiples;\n }", "function multiply() {\n for (i = 0; i <= 10; i++) {\n var mul = i * 9;\n console.log(mul);\n }\n }", "function mutiplicationTable(num) {\n if (num < 1 || num > 9) {\n console.log('1부터 9까지의 수를 입력해주세요')\n }\n for (i = 1; i <= num; i++) {\n for(j = 1; j <= 9; j++) {\n console.log(`${i} * ${j} = ${i * j}`);\n };\n };\n}", "function printNumbers(num1, num2) {\n for (var i = num1; i <= num2; i++) {\n console.log(i)\n }\n}", "function numbers(num1, num2)\n{\n for (i=num1; i<=num2; i++)\n {\n console.log(i);\n }\n}", "function showMultiplicationTable(num) {\n // create a loop that runs 10x\n for (var i = 1; i < 11; i += 1) {\n console.log(num + \" x \" + i + \"=\" + i * num);\n }\n}", "function exampleloop1()\r\n{ \r\n n=parseInt(prompt(\"Enter the val of n= \"));\r\n\r\n var i,j;\r\n\r\n for(i=1,j=n;i<=n;i++,j--)\r\n {\r\n document.write(i*j + \"<br>\");\r\n }\r\n}", "function mult(num1, num2) {\n\tconsole.log(\"3) \" + num1 * num2);\n}", "function divisibleBy(lowerBound, upperBound) {\n for (var i = lowerBound; i <= upperBound; i++) {\n if (i % 5 == 0 && i % 3 == 0) console.log(i);\n }\n }", "function mul(a) {\n\t//se declaran variables\n\tvar num = a;\n\tvar res;\n\tvar multiplos = [];\n\t//se plantea un for para averiguar que numeros entre 1 y 100 son multiplos del numero\n\tfor (var i =1; i <=100; i++) {\n\t\t//para saber si es multiplo se hace una operacion de MOD\n\t\tres = i % parseInt(num);\n\t\t//si el resultado del MOD es igual a cero es un multiplo del numero\n\t\tif (res == 0) {\n\t\t\tmultiplos.push(i);\n\t\t}\n\t}\n\tdocument.write(\"Los multiplos de \"+ num +\" son: \", multiplos);\n}", "function getMulTable(num) {\n let result = \"\";\n for (let i1 = 1; i1 <= num; i1++) {\n for (let i2 = 1; i2 <= num; i2++) {\n result += i1 * i2 + \" \";\n }\n result += \"\\n\";\n }\n return result;\n}", "function showMultiplicationTable(num){\n\t// var value;\n\tfor (var i = 1; i < 11; i++) {\n\t\tconsole.log(num + \" x \" + i + \" = \" + num*i);\n\t}\n}", "function finalCountdown(lowNum, highNum, mult, skip)\n{\n var i=lowNum;\n while(i<highNum)\n {\n if(i !== skip && i % 3 === 0)\n {\n console.log(i);\n }\n i++;\n }\n}", "function showMultiplicationTable(number) {\n for(var i = 1; i <= 10; i++) {\n console.log(number + \" x \" + i + \" = \" + (number * i));\n }\n}", "function printNumbers (x,y){\n for (var num=x; num<=y; num++)\n console.log(num);\n}", "function multipleNum(a, b) {\n\tconsole.log(a*b);\n}", "function printNumbers(start, end) {\n\tfor (i = start; i < end; i++) console.log(i);\n}", "function showMultiplicationTable(number) {\n\n for(let i = 1; i <= 10; i++) {\n\n let result = i * number;\n\n console.log(`${number} * ${i} = ${result}`)\n }\n}", "function multiples(num1, num2) {\n let new_array = [];\n for (let i = 1; i <= 100; i++) {\n if (i % num1 === 0 && i % num2 === 0) {\n new_array.push(i);\n }\n } //end of for\n return new_array;\n } //end of multiples", "function makeMultipleLister(num) {\n return () => {\n for (let multiple = num; multiple < 100; multiple += num) {\n console.log(multiple);\n }\n };\n}", "function sub(num1,num2,num3,num4) {\n let mult = num1 * num2\n if (mult > 100) {\n console.log(mult + num3 + num4)\n } else if (mult < 100) {\n console.log(mult - num3 - num4)\n } else if (mult == 100) {\n alert((num1 * num2 * num3) % num4)\n }\n}", "function MulSix(){\n var num = 1;\n while(num < 60,001){\n if(num % 6 === 0){\n console.log(num);\n }\n num++\n }\n \n \n}", "function multiplyBetween(num1, num2) {\n\tvar results = 0;\n\tvar total = 1\n\twhile (num1 < num2){\n\t\ttotal = total * num1++;\n\t\tresults = total;\n\t}\n\treturn results;\n}", "function multiples (n,m){\n const multArr = new Array(n)\n //numbers increase from 1*m to n*m\n return multArr\n\n}", "function showMultiplicationTable(number){\n for(var x = 1; x <= 10; x++){\n console.log(number.toString() + \" x \" + x + \" = \" + (number*x));\n }\n}", "function counting(min=1, max=100, mult=5){\n for(let i = min; i < max; i++){\n\n console.log(i % 10 === 0 ? 'Coding Dojo' : i % 5 === 0 ? ' Dojo' : i) \n\n // if(i % 10 === 0){\n // console.log(\"Coding\");\n // } else if ( i % 5 === 0) {\n // console.log(\"Coding Dojo\");\n // } else {\n // console.log(i)\n // }\n }\n}", "function showMultiples(num, numMultiples) {\n let stringArray = [];\n for (var i = 1; i < numMultiples; i++) { stringArray.push(num * i); }\n return stringArray;\n}", "function loopyLighthouse(range, multiples, word) {\n for (var i = range[0]; i <= range[1]; i++) {\n var output = \"\";\n if (i % multiples[0] === 0) {\n output += word[0];\n }\n if (i % multiples[1] === 0) {\n output += word[1];\n }\n console.log(output === \"\" ? i : output); //print the number if it didn't get caught by the if statements\n }\n }", "function printNumbers(start, end){\n while (Number(start)<= Number(end)){\n console.log(start);\n ++start;\n }\n}", "function multiplyBetween(num1, num2) {\n if(num1 >= num2){return 0};\n var array = [];\n for (var i=num1; i< num2; i++){\n array.push(i);\n }\n var mult =array.reduce((a,b)=>(a*b));\n return mult;\n}", "function multiplicate(){\n var result = 0;\n for(var i = 0; i <=12; i++){\n for(var j = 0; j <=12; j++){\n result = i * j;\n console.log(i + \" * \" + j + \" = \" + result)\n }\n } \n}", "function multiplyBetween(num1, num2) {\n\n if (num2 <= num1) {\n return 0;\n }\n\n var product = 1;\n for (var start = num1; start < num2; start++) {\n product = product * start;\n }\n return product;\n}", "function Ejericio6For() {\n var numeroMultiplo = \"\";\n var resultado = 0;\n\n for (var i = 1; i <= 450; i++) {\n\n resultado = parseInt(i % 5);\n\n if (resultado === 0) {\n numeroMultiplo += \"Numero:\" + i + \"<br>\";\n }\n\n }\n\n $('#numerosMultiples').html(numeroMultiplo);\n\n}", "function multiplesOfThree(limit) {\n for (var i = 1; i <= limit; i++) {\n console.log(3 * i);\n }\n}", "function printNumbersWhile(start,finish) {\n while (start <= finish) {\n console.log(start);\n start++;\n }\n\n}// function taking input and creating square of asteriks from that input", "function showMultiplicationTable(number) {\n var total;\n\n for(var i = 1; i <= 10; i++) {\n total = i*number;\n console.log(number + ' x ' + i + ' = ' + total);\n }\n\n\n}", "function mult(n){\n\tvar result = 1; // we can't begin with 0 because its a multiplication \n \tfor(var i = 0; i < n ; i++){\n \t\tresult = result * (n - i); // we increment i so we have each time n * (n - 1) * (n - 2) * ... * (n - (n -1))\n \t}\n \treturn result;\n\n }", "function multiply(a,b){\n let product = 0;\n for (let i=1;i<=b;i++){\n product += a;\n }\n console.log(\"#10: \"+ product);\n}", "function showMultiplicationTable(input) {\n for (let i = 0; i <= 10; i++) {\n console.log(input + ' x ' + i + ' = ' + i * input);\n }\n}", "function showMultiplicationTable(number) {\n for (var i = 1; i <= 10; i++) {\n var result = number * i;\n console.log(number + \" x \" + i + \" = \" + result);\n }\n return console.log(\"Here is the table you requested!\");\n }", "function showMultiplicationTable(x) {\n for (let y = 0; y < 10; y++) {\n console.log(x+ \" x \" + y + \"=\" + (x * y));\n }\n}", "function highFive(num){ //print numbers less than 6 and if equals to 5 then print High Five!\n for(var i=0; i<num; i++){\n if(i == 5){// if num equals to 5, log below\n console.log(\"High Five!\");\n }\n else{//print i\n console.log(i);\n }\n }\n}", "function findMultiples(integer, limit) {\r\n //your code here\r\n\r\n //\r\n let output = []\r\n for (let i = 1; (integer * i) <= limit; i++) {\r\n if ((integer * i) - limit <= 0) {\r\n output.push(integer*i)\r\n }\r\n }\r\n return output\r\n}", "function smallestMult(n) {\n\n // start number from the biggest\n let result = n - 1;\n\n let found;\n let counter = 0;\n\n // increase the result by one until the number is not fully divisible by the numbers\n do {\n result++;\n\n // check if number is divisible by all numbers or not\n found = true;\n for (let i = 2; i <= n; i++) {\n if (result % i !== 0) {\n found = false;\n break;\n }\n counter++;\n }\n\n } while (!found);\n\n console.log(`Iterations: ${counter}`);\n return result;\n\n}", "function multiplier(arr, num) {\n for (var i = 0; i < arr.length; ++i) {\n arr[i] *= num;\n }\n console.log(arr);\n}", "function minComMult(arr) {\n var range = [], foundAns = false;\n // Order the array values into a minimum and a maximum.\n var min = Math.min(arr[0], arr[1]);\n var max = Math.max(arr[0], arr[1]);\n \n // Create the range of integers between the min and max.\n for (var i = min; i <= max; i++) {\n range.push(i);\n }\n \n var test = min;\n \n // Test each multiple of the min until a multiple is found\n // that is divisible by all other numbers in the range.\n while (!foundAns) {\n test += min;\n for (var i = 1; i < range.length; i++) {\n if (test % range[i] === 0) {\n if (i === range.length - 1) {\n var ans = test;\n foundAns = true; \n } \n // check the next number in range\n else {\n continue;\n }\n } \n // move on to the next multiple of min\n else {\n break;\n }\n }\n }\n \n return ans;\n}", "function printNumbers (start, end) {\n count = 0\n while (count < end) {\n count ++;\n console.log(count)\n }\n}", "function factorialize(num) {\n let productOf = 1\n for(let i = 1; i <= num ; i++) {\n productOf *= i\n console.log(productOf)\n }\n return productOf;\n }", "function multiplesOf7(){\n for (var i=1; i <63; i++){\n if (i % 7 == 0){\n console.log(i)\n }\n }\n}", "function factoriel(monchiffre){\r\n var monfactoriel = 1;\r\n for (var i = 1 ; i <=monchiffre; i++){\r\n monfactoriel = i * monfactoriel;\r\n }\r\n console.log(monfactoriel);\r\n}", "function printNumbers(start, end) {\n for (var i = 1; i <= 10; i++) {\n console.log(i);\n }\n}", "function maxMultiple(divisor, bound){\n let answer = 0\n for(let n = bound; n>=divisor; n--){\n if(n%divisor===0){\n answer = n\n break\n }\n }\n return answer\n }", "function product_Range(a,b) {\n var prd = a,i = a;\n\n while (i++< b) {\n prd*=i;\n }\n return prd;\n}", "function RangePrint2(start, end){\n for (var num = start; num < end; num++){\n console.log(num)\n }\n}", "function looping(x,y){\n for(var i=0; i<x; i++){\n for(var j=0; j<x; j++){
\n console.log(i*j);\n }\n }\n}", "function printNumbers(start,finish) {\n for (var i = start; i <= finish; i++) {\n console.log(i);\n }\n}", "function printNumbers(start, end) {\r\n \"use strict\";\r\n for (let i = start; i <= end; i += 1) {\r\n console.log(i);\r\n }\r\n}", "function printNumbersInOrderGiven(firstNumberGiven,secondNumberGiven)\n{\n if(firstNumberGiven<secondNumberGiven)\n {\n for(;firstNumberGiven <= secondNumberGiven; firstNumberGiven++)\n {\n console.log(firstNumberGiven);\n }\n }\n else if(secondNumberGiven < firstNumberGiven)\n {\n for(;firstNumberGiven >= secondNumberGiven; firstNumberGiven--)\n {\n console.log(firstNumberGiven);\n }\n }\n\n}", "function Mult3(){\n for(var i = -300; i < 1; i=i+3){\n // if(i % 3 === 0){\n if(i != -3 && i != -6){\n console.log(i);\n }\n }\n }", "function printTable(num) {\n for(var i=1; i<=10; i++) {\n // console.log(num + ' X ' + i + ' = ' + (num*i) );\n console.log(`${num} X ${i} = ${num*i}`);\n } \n}", "function lab07whileKnownCountPart2() {\n // PART 2: YOUR CODE STARTS AFTER THIS LINE\n \n // Declare and assign variables\n var loopCounter = 1;\n var loopMaximum = 20;\n var baseMultiplier = 7;\n \n // Do all the looping!\n while(loopCounter <= loopMaximum) {\n var product;\n product = loopCounter * baseMultiplier;\n document.write(baseMultiplier + \" x \" + loopCounter + \" = \" + product + \"<br />\");\n loopCounter++;\n }\n}", "function mulBase(num, base) {\n const s = new Stack()\n do {\n s.push(num % base)\n console.log(num, num % base)\n num = Math.floor(num /= base)\n console.log(num)\n }while(num > 0)\n let converted = \"\"\n while(s.length() > 0) {\n converted += s.pop()\n }\n console.log(converted)\n return converted\n }", "function multi(n){\nvar result = 1\nvar i = 1\nwhile(i<=n){\n\tresult*= i\ni++\n}\n return result\n}", "function printing(arr) {\n var sum = arr[0];\n var min = arr[0];\n var max = arr[0];\n for (var i = 1; i < arr.length; ++i) {\n if (arr[i] < min) {\n min = arr[i];\n }\n if (arr[i] > max) {\n max = arr[i];\n }\n sum += arr[i];\n }\n console.log(max);\n console.log(min);\n console.log(sum / arr.length);\n}", "function smallestMultiple(maxMultipler) {\n let maxMultiplierFactorial = factorial(maxMultipler);\n let smallestMultiple = maxMultiplierFactorial;\n if (verbose) {\n console.log('smallestMultiple() -> maxMultipler:', maxMultipler);\n console.log('smallestMultiple() -> maxMultiplierFactorial:', maxMultiplierFactorial);\n console.log('smallestMultiple() -> smallestMultiple:', smallestMultiple);\n }\n for (let startingMultiple = (maxMultiplierFactorial - maxMultipler); startingMultiple > 1; startingMultiple -= maxMultipler) {\n if (verbose) {\n console.log('smallestMultiple() -> startingMultiple:', startingMultiple);\n }\n for (let counter = (maxMultipler - 1); counter > 1; counter--) {\n if (verbose) {\n console.log('smallestMultiple() -> counter:', counter);\n }\n if (!isEven(startingMultiple)) {\n if (verbose) {\n console.log('smallestMultiple() ->', startingMultiple, 'is not an even number');\n console.log('smallestMultiple() -> starting next iteration of outer for loop');\n }\n break;\n }\n if (startingMultiple > 5 && !multipleOfFive(startingMultiple)) {\n if (verbose) {\n console.log('smallestMultiple() ->', startingMultiple, 'is greater than 5');\n console.log('smallestMultiple() ->', startingMultiple, 'is not a multiple of 5');\n console.log('smallestMultiple() -> starting next iteration of outer for loop');\n }\n break;\n }\n if (startingMultiple % counter !== 0) {\n if (verbose) {\n console.log('smallestMultiple() ->', startingMultiple, '%', counter, '!== 0');\n console.log('smallestMultiple() -> starting next iteration of outer for loop');\n }\n break;\n }\n if (verbose) {\n console.log('smallestMultiple() ->', startingMultiple, '%', counter, '=== 0');\n }\n if (counter === 2) {\n smallestMultiple = startingMultiple;\n if (verbose) {\n console.log('smallestMultiple() -> smallestMultiple:', smallestMultiple);\n }\n }\n }\n }\n return smallestMultiple;\n}", "function lowestMult(){\n let i = 20+2; \n while (!isMult(i)){\n i+=2; // Go up by 2 because must be multiple of 2\n }\n return i;\n}", "function printTo(start, end) {\n\tvar i = start;\n\twhile(i <= 5280) {\n\t\tconsole.log(i);\n\t\ti++\n\t}\n}", "function multiply(arrayNum){\n var product = 1\n for (i=0; i<arrayNum.length; i++){\n product *= arrayNum[i];\n }\n return \"The product of your array is \" + product + \".\"\n}", "function printTable(x, y) {\n outer.innerHTML = \"\";\n for (i = 1; i <= y; i++) {\n const result = i * x;\n outer.innerHTML += `${x} * ${i} = ${result} <br>`;\n\n console.log(`${x} * ${i} = ${result}`);\n }\n\n outer.innerHTML += \"<br>\";\n}", "function RangePrint3(end){\n for (var num = 0; num < end; num++){\n console.log(num)\n }\n}", "function sumMults(n) {\n let mult = [],\n sum = 0,\n max = Math.floor(n / 3),\n i = 1;\n\n for (i; i <= max; i++) {\n if (i * 3 < n) {\n if (!mult.includes(i * 3)) {\n mult.push(i * 3);\n sum += i * 3;\n }\n }\n if (i * 5 < n) {\n if (!mult.includes(i * 5)) {\n mult.push(i * 5);\n sum += i * 5;\n }\n }\n }\n return sum;\n}", "function multiplesOf23() {\n\n var sum = 0;\n var result = ''\n\n for (var i=23; i<=500; i+=23) {\n result += i + '\\t'\n sum += i\n }\n\n console.log('Elements: ' + result);\n console.log('Sum: ' + sum);\n}", "function isMult(x){\n for (let i = 20 ; i > 10 ; i--){\n if (x%i!=0){return false;} \n }\n return true;\n}", "function multy2(...numbers) {\n console.log(numbers);\n console.log(\n numbers.reduce(function (value, curretValue) {\n return value * curretValue;\n })\n );\n}", "function mulTable(a) {\n var pro = 1,i;\n for(let i = 1; i <= 10; i++){\n pro = a * i;\n }\n console.log(a + \" X \" + i + \" = \" + pro);\n}", "function euler003( num ) {\n // starting index (first prime)\n var i = 2;\n\n // while the number to process is greater than the index\n while ( num > i ) {\n // if the index is a factor of the number\n if ( num % i === 0 ) {\n // then divide by the index\n num = num / i;\n console.log('num is: ' + num);\n }\n\n // increment the index\n i++;\n console.log('i is: ' + i);\n }\n\n // return the greatest factor that is only divisible by itself\n return i;\n}", "function sumMul(n,m){\n var multiples = n/m;\n var wholeNumber = Math.floor(multiples);\n for (var i = 0; i < wholeNumber; i++) {\n var sum = n+n\n }\n}", "function printInstructions() {\n console.log('Find the sum of all the multiples of 3 or 5 below 1000');\n}", "function printNumbers(num) {\n for (let i = num; i >= 0; i--) {\n console.log(i);\n }\n}", "function multiplesOf(numbers, number) { // add second argument\n var multiples = []; // change to array (so that we can store multiple numbers - not just one multiple)\n for (var i = 0; i < numbers.length; i++) {\n if (numbers[i] % number === 0) { // divide by the number\n multiples.push(numbers[i]); // add the current multiple found to the multiples array\n }\n }\n return multiples;\n }", "function loopFunc (word,num){\n num = num*num*num\n for(let i = 0; i<num;i++){\n console.log(word)\n }\n}", "function smallestMultiple(val1, val2) {\n var min = val1;\n var max = val2;\n var divisible = 0;\n var number = val2;\n\n while (divisible < max) {\n for (var i = max; i >= min; i--) {\n if (number % i == 0) {\n divisible += 1;\n } else {\n divisible = 0;\n number += 1;\n }\n }\n }\n\n return number;\n}" ]
[ "0.7144257", "0.7115182", "0.7066724", "0.691936", "0.67184705", "0.67080945", "0.6486981", "0.61510456", "0.61046696", "0.6058054", "0.603332", "0.6027762", "0.59837687", "0.59557974", "0.5905807", "0.5901794", "0.58650833", "0.5852761", "0.5834222", "0.57884115", "0.57575136", "0.575315", "0.57472265", "0.5739074", "0.57338524", "0.57272553", "0.57176876", "0.57073176", "0.570182", "0.56836736", "0.5681286", "0.5666511", "0.5657067", "0.56416076", "0.56327814", "0.5619314", "0.5618018", "0.559275", "0.55601037", "0.5552464", "0.55481005", "0.5543785", "0.553513", "0.5528054", "0.55195004", "0.5512808", "0.55019206", "0.54848", "0.5483002", "0.54825324", "0.5479895", "0.5472341", "0.5415148", "0.54093426", "0.53837895", "0.53807145", "0.53639066", "0.534563", "0.5340243", "0.53384775", "0.5337657", "0.53318614", "0.53132814", "0.52996373", "0.5290969", "0.5260031", "0.5259999", "0.52526605", "0.5239519", "0.5236671", "0.5234584", "0.5230867", "0.5221237", "0.52171606", "0.5206062", "0.520429", "0.5196528", "0.51947975", "0.5188472", "0.51835656", "0.51833886", "0.5177671", "0.5170831", "0.516213", "0.5151974", "0.5151781", "0.51516634", "0.514096", "0.5140006", "0.51340383", "0.51283634", "0.51230395", "0.51215327", "0.5114064", "0.5113503", "0.51119894", "0.510801", "0.5106436", "0.5105329", "0.51011515" ]
0.69407684
3
Takes a buffer of bytes and splits it into chunks, each of which starts with a MSG_TOKEN_START An array of these chunks is returned
splitBuffer( buf ) { let chunks = []; // discard any bytes at the front before the START let position = buf.indexOf( MSG_TOKEN_START ); if( position > 0 ) { // Clear the bytes before the start buf = buf.slice( position ); } else if( position < 0 ) { // no START at all... invalid message return []; } // we know buf[0] is a start, so look for another START let index = 1; while( (position = buf.indexOf( MSG_TOKEN_START, index )) > -1) { // If there are no bytes between START bytes, don't put an empty element in the array // This shouldn't happen based on the protocol design anyway if( index === position ) { chunks.push( Buffer.from([])); } else { chunks.push( buf.slice( index-1, position ) ); } // continue searching at the next byte index = position + 1; } if( index <= buf.length ) { //console.log('index:', index, 'left: ', buf.slice( index-1 ) ); chunks.push( buf.slice( index-1 )); } return chunks; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getChunk(i, message){\n\tvar m = [];\n\tfor(let j = 0; j < 16; ++j){\n\t\tm[j] = message[(i * 64) + (j * 4) + 0] << 0 |\n\t\t message[(i * 64) + (j * 4) + 1] << 8 |\n\t\t message[(i * 64) + (j * 4) + 2] << 16 |\n\t\t message[(i * 64) + (j * 4) + 3] << 24;\n\t}\n\treturn m;\n}", "function split(buf, by) {\n const bufs = [];\n let len = buf.length;\n let i = 0;\n\n while (len) {\n if (buf[i] == by) {\n if (i > 0) {\n bufs.push(buf.slice(0, i));\n buf = buf.slice(i + 1);\n }\n\n i = -1; /* reset to 0 for next tick */\n }\n\n ++i;\n --len;\n }\n\n if (i) {\n bufs.push(buf);\n }\n\n return bufs;\n}", "function splitMessage(message) {\n const messageBlocks = [Buffer.from(message.IV, 'base64')];\n\n const textBuffer = Buffer.from(message.ciphertext, 'base64');\n for(let i = 0; i < textBuffer.length / BLOCK_SIZE; i++) {\n messageBlocks.push(textBuffer.slice(i * BLOCK_SIZE, (i + 1) * BLOCK_SIZE));\n }\n\n return messageBlocks;\n}", "function read_chunks(socket, buffer) {\n\tvar str = buffer.toString('utf8');\n\tvar type = str.substr(0, 3);\n\tvar pid = socket.remoteAddress + ':' + socket.private_ip;\n\tconsole.log(\"TCP > \" + pid + \" \" + str);\n\n\tif (type === \"reg\"){\n\t\tadd_player(socket.remoteAddress + \":\" + str.substr(3), socket);\n\t}\n\telse if (type === \"nam\"){\n\t\tset_player_name(pid, str.substr(3));\n\t\tsend_str(\"hey\", socket);\n\t} else if (type === \"con\"){\n\n\t}\n}", "function splitBuffer(buffer, messageNumber, chunkSize) {\r\n \r\n var bufferSize = buffer.byteLength;\r\n //calculate the size of the data (doesn't include extra space in buffer)\r\n \r\n var sizeArray = new Int32Array(buffer, 0, 6*4);\r\n var dataSize = sizeArray[0]; \r\n\r\n console.log(\"dataSize:\", dataSize);\r\n \r\n var maxChunkSize = 1024*16;\r\n if (Number.isFinite(chunkSize)) {maxChunkSize = chunkSize;} //allow specification of a different chunk size. \r\n \r\n var additionalSize = (Math.ceil(dataSize / maxChunkSize) + 4 * 4) * 4; \r\n \r\n //var additionalSize = bufferSize - dataSize;\r\n //var movedDataArray = new Int32Array(buffer, dataSize, additionalSize); //this is where the data overwritten by the header is placed.\r\n //var dataArray = new Int32Array(buffer, 0, dataSize); //this is the original data\r\n var bufferArray = new Int8Array(buffer);\r\n var int32Array = new Int32Array(buffer);\r\n \r\n //var movedDataArrayOffset = dataSize; //this is where we start placing copied data so it won't get permanently overwritten by headers\r\n \r\n var chunkCount = Math.ceil((dataSize + additionalSize) / maxChunkSize);\r\n \r\n for (var i=0; i<chunkCount; i++) {\r\n var dataSource = new Uint8Array(buffer,i*maxChunkSize,4*4);\r\n var movedDataArrayOffset = dataSize + i * 4*4;\r\n bufferArray.set(dataSource, movedDataArrayOffset);\r\n //movedDataArrayOffset += 4*4;\r\n \r\n //after the data is moved then add a header to this chunk\r\n var header = new Uint32Array(buffer, i*maxChunkSize, 4);\r\n header[0] = messageNumber;\r\n header[1] = dataSize;\r\n header[2] = maxChunkSize;\r\n header[3] = i;\r\n }\r\n\r\n return(chunkCount);\r\n}", "function convert(message){\n var arr = []\n var x = 0;\n var y;\n var i;\n for (i = 0; i < 160; i++) { \n y = x+2\n arr.push(message.slice(x,y))\n x += 4;\n }\n var data = Buffer.concat(arr);\n return data\n}", "getChunks(content, env) {\n // Parse the whole markdown document and get tokens\n const tokens = this.markdownIt.parse(content, env);\n const chunks = [];\n\n let start = 0;\n let stop = 0;\n\n for (let i = 0; i < tokens.length; i++) {\n // TODO: invert condition to get rid of the 'continue' statement\n if (\n // We are starting tokens walk or in a chunk\n i < start ||\n !(\n // We are (NOT) closing a nested block\n (0 === tokens[i].level && -1 === tokens[i].nesting) ||\n // We are (NOT) in a root block\n (0 === tokens[i].level && 0 === tokens[i].nesting)\n )\n ) {\n continue; // eslint-disable-line no-continue\n }\n\n stop = i + 1;\n chunks.push(tokens.slice(start, stop));\n start = stop;\n }\n\n return chunks;\n }", "function readTokenToBuffer() {\n\t\t\t// init local variables\n\t\t\tvar startPos, matchPos, matchStr, match, length;\n\n\t\t\tfor (;;) if (tokenRegExp.lastIndex !== inputLength) {\n\t\t\t\tstartPos = tokenRegExp.lastIndex;\n\t\t\t\tif (match = tokenRegExp.exec(inputString)) {\n\t\t\t\t\tmatchStr = match[0], matchPos = match.index;\n\n\t\t\t\t\t// check if we have T_ERR token\n\t\t\t\t\tif (length = matchPos - startPos) {\n\t\t\t\t\t\ttokenBuffer.push({\n\t\t\t\t\t\t\ttype: T_ERR,\n\t\t\t\t\t\t\tpos: startPos,\n\t\t\t\t\t\t\tvalue: inputString.substr(startPos, length)\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tlength = match.length;\n\n\t\t\t\t\t// find matched group index\n\t\t\t\t\twhile (match[length--] === undefined);\n\n\t\t\t\t\t// obtain token info\n\t\t\t\t\tmatch = tokenIds[length];\n\t\t\t\t\t// match next token in case if this one is ignored\n\t\t\t\t\tif (match === IGNORE_START) continue;\n\t\t\t\t\t// return matched token\n\t\t\t\t\treturn tokenBuffer.push({\n\t\t\t\t\t\ttype: match,\n\t\t\t\t\t\tpos: matchPos,\n\t\t\t\t\t\tvalue: matchStr\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t// return T_ERR token in case if we couldn't match anything\n\t\t\t\telse return (\n\t\t\t\t\ttokenRegExp.lastIndex = inputLength,\n\t\t\t\t\ttokenBuffer.push({\n\t\t\t\t\t\ttype: T_ERR,\n\t\t\t\t\t\tpos: startPos,\n\t\t\t\t\t\tvalue: inputString.slice(startPos)\n\t\t\t\t\t})\n\t\t\t\t);\n\n\t\t\t}\n\t\t\t// return T_EOF if we reached end of file\n\t\t\telse return tokenBuffer.push({\n\t\t\t\ttype: T_EOF,\n\t\t\t\tpos: inputLength\n\t\t\t});\n\t\t}", "function customBufferSplitCRLF(buf) {\n var ret = [];\n var effLen = buf.length - 1, start = 0;\n for (var i = 0; i < effLen;) {\n if (buf[i] === 13 && buf[i + 1] === 10) {\n // do include the CRLF in the entry if this is not the first one.\n if (ret.length) {\n i += 2;\n ret.push(buf.slice(start, i));\n }\n else {\n ret.push(buf.slice(start, i));\n i += 2;\n }\n start = i;\n }\n else {\n i++;\n }\n }\n if (!ret.length)\n ret.push(buf);\n else if (start < buf.length)\n ret.push(buf.slice(start, buf.length));\n return ret;\n}", "function FFString_cutByteStringToArray(msg, maxlength) {\n\tvar str;\n\tvar len=0;\n\tvar temp;\n\tvar count;\n\tvar srTemp = new String(msg);\n\tvar arTemp = Array();\n\n\tlen = srTemp.length;\n\n\tfor(var i=0;srTemp.length>0;i++){\n\t\tcount = 0;\n\t\tfor(k=0 ; k<len ; k++) {\n\t\t\tstr = srTemp;\n\t\t\ttemp = srTemp.charAt(k);\n\t\t\t\n\t\t\tif(escape(temp).length > 4) {\n\t\t\t\tcount += 2;\n\t\t\t}\n\t\t\telse if (temp == '\\r' && srTemp.charAt(k+1) == '\\n') { //in case \\r\\n\n\t\t\t\tcount += 2;\n\t\t\t}\t\t\n\t\t\telse if(temp != '\\n') {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\tif(count > maxlength) {\n\t\t\t\tstr = srTemp.substring(0,k);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tarTemp[i] = new Array();\n\t\tarTemp[i] = str;\n\t\tsrTemp = srTemp.substring(k);\n\t}\n\treturn arTemp;\n}", "function chunk(text) {\n //185 characters seems to be longest discord tts reads\n let ii, lastSpaceIndex;\n const maxChunkSize = 184;\n let chunks = [];\n if (text.length > maxChunkSize) {\n for (ii = 0; ii < text.length; ii += lastSpaceIndex) {\n let temp = text.substring(ii, ii + maxChunkSize);\n lastSpaceIndex = temp.lastIndexOf(\" \");\n // need to check for the last \"part\" otherwise last index of space\n // will mean ii is always less than text.length\n if (ii + maxChunkSize > text.length) {\n chunks.push(text.substring(ii, ii + maxChunkSize));\n break;\n } else {\n chunks.push(text.substring(ii, ii + lastSpaceIndex));\n }\n }\n } else {\n chunks.push(text);\n }\n return chunks;\n}", "function blocks(buf, size) {\n var numBlocks = Math.ceil(buf.length / size);\n var result = [];\n var offset = 0;\n\n for (var i = 0; i < numBlocks; i++ ) {\n result.push(buf.slice(offset, size + offset));\n offset += size;\n }\n\n return result;\n}", "async readToEOL()\n {\n // Create buffer\n let bufs = [];\n\n while (true)\n {\n if (this.receivedBuffers.length > 0)\n {\n let src = this.receivedBuffers[0]\n let pos = indexInBuf(src, '\\n'.charCodeAt(0));\n if (pos >= 0 && pos < src.length)\n {\n // Use part of the buffer...\n\n // Copy out the bit we want\n let buf = Buffer.alloc(pos);\n src.copy(buf, 0, 0, pos);\n bufs.push(buf);\n\n // Skip the \\n\n pos++;\n\n if (pos < src.length)\n {\n // Split the buffer to extract the part we need\n let subBuf = Buffer.alloc(src.length - pos);\n src.copy(subBuf, 0, pos, pos + subBuf.length);\n this.receivedBuffers.shift();\n this.receivedBuffers.unshift(subBuf);\n }\n else\n {\n this.receivedBuffers.shift();\n }\n\n // Finished\n return bufs.map(x=> x.toString(\"utf8\")).join(\"\");\n }\n else\n {\n // Use the entire buffer\n bufs.push(src);\n this.receivedBuffers.shift().length;\n }\n }\n else\n {\n // Wait for more data\n await new Promise((resolve, reject) => {\n this.waiter = resolve;\n });\n this.waiter = null;\n }\n }\n }", "static *parse(/** !ArrayBuffer */ buf) {\n const reader = new Reader();\n const view = new DataView(buf);\n let /** number */ pos = 0;\n while (pos < buf.byteLength) {\n // Read the frame header\n const startMs = timeMs(view, pos);\n const len = view.getUint32(pos + 8, true);\n const endMs = pos + 12 + len < buf.byteLength\n ? timeMs(view, pos + 12 + len) : Infinity;\n const frame = new Frame();\n frame.startMs_ = startMs;\n frame.durationMs_ = endMs - startMs;\n reader.add(new DataView(buf, pos + 12, len));\n let cmd;\n while ((cmd = Command.parse(reader))) {\n if (cmd.keyframe) frame.keyframe_ = true;\n frame.commands_.push(cmd);\n }\n yield frame;\n pos += 12 + len;\n }\n }", "function splitMessage(message) {\n var runNumIndex = message.indexOf(':') + 1;\n return {\n // drop colon from the header\n header: message.toString('ascii', 0, runNumIndex - 1),\n run: message.readUInt32LE(runNumIndex),\n event: message.readUInt32LE(runNumIndex + 4),\n data: message.slice(runNumIndex + 8)\n };\n}", "function getTokenFromBuffer(offset) {\n\t\t\tvar toRead = offset - tokenBuffer.length + 1;\n\t\t\twhile (toRead-- > 0) readTokenToBuffer();\n\t\t\treturn tokenBuffer[offset];\n\t\t}", "function createParser() {\n let buffer;\n let position; // current read position\n let fieldLength; // length of the `field` portion of the line\n let discardTrailingNewline = false;\n let message = { event: '', data: '' };\n let pending = [];\n const decoder = new TextDecoder();\n return function parse(chunk) {\n if (buffer === undefined) {\n buffer = chunk;\n position = 0;\n fieldLength = -1;\n }\n else {\n const concat = new Uint8Array(buffer.length + chunk.length);\n concat.set(buffer);\n concat.set(chunk, buffer.length);\n buffer = concat;\n }\n const bufLength = buffer.length;\n let lineStart = 0; // index where the current line starts\n while (position < bufLength) {\n if (discardTrailingNewline) {\n if (buffer[position] === ControlChars.NewLine) {\n lineStart = ++position; // skip to next char\n }\n discardTrailingNewline = false;\n }\n // look forward until the end of line\n let lineEnd = -1; // index of the \\r or \\n char\n for (; position < bufLength && lineEnd === -1; ++position) {\n switch (buffer[position]) {\n case ControlChars.Colon:\n if (fieldLength === -1) {\n // first colon in line\n fieldLength = position - lineStart;\n }\n break;\n // \\r case below should fallthrough to \\n:\n case ControlChars.CchunkiageReturn:\n discardTrailingNewline = true;\n // eslint-disable-next-line no-fallthrough\n case ControlChars.NewLine:\n lineEnd = position;\n break;\n }\n }\n if (lineEnd === -1) {\n // end of the buffer but the line hasn't ended\n break;\n }\n else if (lineStart === lineEnd) {\n // empty line denotes end of incoming message\n if (message.event || message.data) {\n // NOT a server ping (\":\\n\\n\")\n if (!message.event)\n throw new Error('Missing message event');\n const event = common_1.validateStreamEvent(message.event);\n const data = common_1.parseStreamData(event, message.data);\n pending.push({\n event,\n data,\n });\n message = { event: '', data: '' };\n }\n }\n else if (fieldLength > 0) {\n // end of line indicates message\n const line = buffer.subarray(lineStart, lineEnd);\n // exclude comments and lines with no values\n // line is of format \"<field>:<value>\" or \"<field>: <value>\"\n // https://html.spec.whatwg.org/multipage/server-sent-events.html#event-stream-interpretation\n const field = decoder.decode(line.subarray(0, fieldLength));\n const valueOffset = fieldLength + (line[fieldLength + 1] === ControlChars.Space ? 2 : 1);\n const value = decoder.decode(line.subarray(valueOffset));\n switch (field) {\n case 'event':\n message.event = value;\n break;\n case 'data':\n // append the new value if the message has data\n message.data = message.data ? message.data + '\\n' + value : value;\n break;\n }\n }\n // next line\n lineStart = position;\n fieldLength = -1;\n }\n if (lineStart === bufLength) {\n // finished reading\n buffer = undefined;\n const messages = [...pending];\n pending = [];\n return messages;\n }\n else if (lineStart !== 0) {\n // create a new view into buffer beginning at lineStart so we don't\n // need to copy over the previous lines when we get the new chunk\n buffer = buffer.subarray(lineStart);\n position -= lineStart;\n }\n };\n}", "function splitOnChunk_(self, delimiter) {\n const next = (leftover, delimiterIndex) => CH.readWithCause(inputChunk => {\n const buffer = CK.builder();\n const {\n tuple: [carry, delimiterCursor]\n } = CK.reduce_(inputChunk, Tp.tuple(O.getOrElse_(leftover, () => CK.empty()), delimiterIndex), ({\n tuple: [carry, delimiterCursor]\n }, a) => {\n const concatenated = CK.append_(carry, a);\n\n if (delimiterCursor < CK.size(delimiter) && a === CK.unsafeGet_(delimiter, delimiterCursor)) {\n if (delimiterCursor + 1 === CK.size(delimiter)) {\n buffer.append(CK.take_(concatenated, CK.size(concatenated) - CK.size(delimiter)));\n return Tp.tuple(CK.empty(), 0);\n } else {\n return Tp.tuple(concatenated, delimiterCursor + 1);\n }\n } else {\n return Tp.tuple(concatenated, a === CK.unsafeGet_(delimiter, 0) ? 1 : 0);\n }\n });\n return CH.zipRight_(CH.write(buffer.build()), next(!CK.isEmpty(carry) ? O.some(carry) : O.none, delimiterCursor));\n }, halt => O.fold_(leftover, () => CH.failCause(halt), chunk => CH.zipRight_(CH.write(CK.single(chunk)), CH.failCause(halt))), done => O.fold_(leftover, () => CH.succeed(done), chunk => CH.zipRight_(CH.write(CK.single(chunk)), CH.succeed(done))));\n\n return new C.Stream(self.channel[\">>>\"](next(O.none, 0)));\n}", "function streamToArrayBuffer(stream) {\n const reader = stream.getReader();\n function next(buffer) {\n return reader.read().then(result => {\n if (result.done)\n return buffer;\n const chunk = result.value;\n const tmpBuffer = new Uint8Array(buffer.byteLength + chunk.byteLength);\n tmpBuffer.set(buffer, 0);\n tmpBuffer.set(chunk, buffer.byteLength);\n return next(tmpBuffer);\n });\n }\n return next(new Uint8Array(0));\n}", "static unravel(message) {\n let [length, contents] = message.split(/{(.*?)}/g),\n parts = contents.split('░');\n\n // Verify packet length\n if (Number(length) === parts.join('').length) {\n return parts;\n }\n return [];\n }", "function blobToArrayBufferConverter(blobChunks,callback){\n var blob = new Blob(blobChunks, {type: 'video/webm'});\n var fileReader = new FileReader();\n fileReader.readAsArrayBuffer(blob);\n fileReader.onload = function(progressEvent) {\n callback(this.result);\n }\n }", "readRecordsFromBuffer(buffer, count, fileOffset) {\n const records = [];\n let bufferOffset = 0;\n for (let i = 0; i < count; i++) {\n const record = this.readRecordFromBuffer(buffer.slice(bufferOffset), fileOffset + bufferOffset);\n bufferOffset += record.end - record.offset;\n records.push(record);\n }\n return records;\n }", "function extract_string(message_str) {\n\tvar message_arr = message_str.split(delimiter); //convert to array\t\n\treturn message_arr;\n}", "function split (string, delimiter) {\n let results = [];\n let delimiterLength = delimeter.length;\n for (var index=0; index < string.length; index++) {\n let characters = string.substr(index, delimeterLength);\n // let chunkStart =\n // let chunkEnd\n //console.log(characters, index)\n if (characters === delimiter) {\n //console.log(string.substr(0,index))\n }\n }\n return results\n}", "function splitPackets(bin) {\n // number of packets\n var num = buf2long(bin.slice(0, 2)),\n j = 2,\n packets = [];\n\n for(var i=0; i<num; i++) {\n // first two bytes is the packet length\n var size = buf2long(bin.slice(j, j+2)),\n packet = bin.slice(j+2, j+2+size);\n\n packets.push(packet);\n\n j += 2 + size;\n }\n\n return packets;\n }", "split(maxFragmentLength) {\n let start = 0;\n const totalLength = this.fragment.length;\n const fragments = [];\n if (maxFragmentLength == null) {\n maxFragmentLength = RecordLayer_1.RecordLayer.MAX_PAYLOAD_SIZE - FragmentedHandshake.headerLength;\n }\n // loop through the message and fragment it\n while (!fragments.length && start < totalLength) {\n // calculate maximum length, limited by MTU - IP/UDP headers - handshake overhead\n const fragmentLength = Math.min(maxFragmentLength, totalLength - start);\n // slice and dice\n const data = Buffer.from(this.fragment.slice(start, start + fragmentLength));\n if (data.length <= 0) {\n // this shouldn't happen, but we don't want to introduce an infinite loop\n throw new Error(`Zero or less bytes processed while fragmenting handshake message.`);\n }\n // create the message\n fragments.push(new FragmentedHandshake(this.msg_type, totalLength, this.message_seq, start, data));\n // step forward by the actual fragment length\n start += data.length;\n }\n return fragments;\n }", "function bytesToTuples(buf) {\n const tuples = [];\n let i = 0;\n while (i < buf.length) {\n const code = varint_1.default.decode(buf, i);\n const n = varint_1.default.decode.bytes;\n const p = protocols_1.protocols(code);\n const size = sizeForAddr(p, buf.slice(i + n));\n if (size === 0) {\n tuples.push([code]);\n i += n;\n continue;\n }\n const addr = buf.slice(i + n, i + n + size);\n i += size + n;\n if (i > buf.length) {\n // did not end _exactly_ at buf.length\n throw ParseError('Invalid address Uint8Array');\n }\n // ok, tuple seems good.\n tuples.push([code, addr]);\n }\n return tuples;\n}", "function chunker(str) {\n var len = str.length;\n if (len < 3)\n return [str];\n\n var result = [];\n result.push(str.substring(len - 3, len));\n str = str.slice(0, len - 3);\n\n for (var i = str.length - 1; i >= 0; i = i - 2) {\n if (i == 0)\n result.push(str.slice(0, 1));\n else\n result.push(str.slice(i - 1, i + 1));\n }\n return result;\n }", "decodePdu( encoded ) {\n\n let values = [];\n\n let index = 0;\n\n while( index < encoded.length ) {\n if( encoded[index] === MSG_TOKEN_ESC && index < encoded.length-1 ) {\n index++;\n\n if( encoded[index] === MSG_START_STUFF ){\n values.push( MSG_TOKEN_START );\n }\n else if( encoded[index] === MSG_ESC_STUFF ){\n values.push( MSG_TOKEN_ESC );\n }\n\n }\n else {\n values.push( encoded[index] );\n }\n\n index++;\n\n }\n\n return values;\n }", "function deserializeBinary(buf) {\n var data = new DataView(buf);\n // read the header: 1 + nbufs 32b integers\n var nbufs = data.getUint32(0);\n var offsets = [];\n if (nbufs < 2) {\n throw new Error('Invalid incoming Kernel Message');\n }\n for (var i = 1; i <= nbufs; i++) {\n offsets.push(data.getUint32(i * 4));\n }\n var jsonBytes = new Uint8Array(buf.slice(offsets[0], offsets[1]));\n var msg = JSON.parse((new TextDecoder('utf8')).decode(jsonBytes));\n // the remaining chunks are stored as DataViews in msg.buffers\n msg.buffers = [];\n for (var i = 1; i < nbufs; i++) {\n var start = offsets[i];\n var stop_1 = offsets[i + 1] || buf.byteLength;\n msg.buffers.push(new DataView(buf.slice(start, stop_1)));\n }\n return msg;\n}", "getLines(content: string): string[] {\n return content.split('\\n');\n }", "function splitText(text) {\n let parts = textchunk.chunk(text, maxCharacterCount);\n var i = 0;\n parts = parts.map(str => {\n // Compress whitespace.\n // console.log(\"-----\");\n // console.log(str);\n // console.log(\"-----\");\n return str.replace(/\\s+/g, ' ');\n }).map(str => {\n // Trim whitespace from the ends.\n return str.trim();\n });\n return Promise.resolve(parts);\n}", "function split(parsed){\n\tvar ret = [];\n\tvar chunk = [];\n\tfor(var i=0; i<parsed.length; i++){\n\n\t\tvar item = parsed[i];\n\t\tvar flags = item.flags;\n\t\t\n\t\tfor(var f=0; f<flags.length; f++){\n\t\t\tvar flagList = flags[f];\n\t\t\tif(spliton.indexOf(flagList.flag) > -1){\n\t\t\t\tif(chunk.length){\n\t\t\t\t\t//ret.push(chunk.slice());\n\t\t\t\t\tret.push(chunk);\n\t\t\t\t\tchunk = [];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tchunk.push(item);\n\t\t\n\t}\n\n\t//ret.push(chunk.slice());\n\tret.push(chunk);\n\n\treturn ret;\n}", "function split_newlines(s) {\n //return s.split(/\\x0d\\x0a|\\x0a/);\n\n s = s.replace(/\\x0d/g, '');\n var out = [],\n idx = s.indexOf(\"\\n\");\n while (idx !== -1) {\n out.push(s.substring(0, idx));\n s = s.substring(idx + 1);\n idx = s.indexOf(\"\\n\");\n }\n if (s.length) {\n out.push(s);\n }\n return out;\n }", "function split_newlines(s) {\n //return s.split(/\\x0d\\x0a|\\x0a/);\n\n s = s.replace(/\\x0d/g, '');\n var out = [],\n idx = s.indexOf(\"\\n\");\n while (idx !== -1) {\n out.push(s.substring(0, idx));\n s = s.substring(idx + 1);\n idx = s.indexOf(\"\\n\");\n }\n if (s.length) {\n out.push(s);\n }\n return out;\n }", "function splitResponse(str) {\n if (str.length <= 320) {\n return [str];\n }\n\n return chunkString(str, 300);\n}", "function processBuffer(self) {\n var messages = self.buffer.split('\\n');\n self.buffer = \"\";\n _.each(messages, function(message){\n if (message.length > 0) {\n var parsed = JSON.parse(message);\n processMessage(self, parsed);\n }\n });\n}", "arrayBuffer() {\n\t\treturn consumeBody$1.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "function bufferToTuples (buf) {\n const tuples = []\n let i = 0\n while (i < buf.length) {\n const code = varint.decode(buf, i)\n const n = varint.decode.bytes\n\n const p = protocols(code)\n\n const size = sizeForAddr(p, buf.slice(i + n))\n\n if (size === 0) {\n tuples.push([code])\n i += n\n continue\n }\n\n const addr = buf.slice(i + n, i + n + size)\n\n i += (size + n)\n\n if (i > buf.length) { // did not end _exactly_ at buffer.length\n throw ParseError('Invalid address buffer: ' + buf.toString('hex'))\n }\n\n // ok, tuple seems good.\n tuples.push([code, addr])\n }\n\n return tuples\n}", "function bufferToTuples (buf) {\n const tuples = []\n let i = 0\n while (i < buf.length) {\n const code = varint.decode(buf, i)\n const n = varint.decode.bytes\n\n const p = protocols(code)\n\n const size = sizeForAddr(p, buf.slice(i + n))\n\n if (size === 0) {\n tuples.push([code])\n i += n\n continue\n }\n\n const addr = buf.slice(i + n, i + n + size)\n\n i += (size + n)\n\n if (i > buf.length) { // did not end _exactly_ at buffer.length\n throw ParseError('Invalid address buffer: ' + buf.toString('hex'))\n }\n\n // ok, tuple seems good.\n tuples.push([code, addr])\n }\n\n return tuples\n}", "function bufferToTuples (buf) {\n const tuples = []\n let i = 0\n while (i < buf.length) {\n const code = varint.decode(buf, i)\n const n = varint.decode.bytes\n\n const p = protocols(code)\n\n const size = sizeForAddr(p, buf.slice(i + n))\n\n if (size === 0) {\n tuples.push([code])\n i += n\n continue\n }\n\n const addr = buf.slice(i + n, i + n + size)\n\n i += (size + n)\n\n if (i > buf.length) { // did not end _exactly_ at buffer.length\n throw ParseError('Invalid address buffer: ' + buf.toString('hex'))\n }\n\n // ok, tuple seems good.\n tuples.push([code, addr])\n }\n\n return tuples\n}", "function bufferToTuples (buf) {\n const tuples = []\n let i = 0\n while (i < buf.length) {\n const code = varint.decode(buf, i)\n const n = varint.decode.bytes\n\n const p = protocols(code)\n\n const size = sizeForAddr(p, buf.slice(i + n))\n\n if (size === 0) {\n tuples.push([code])\n i += n\n continue\n }\n\n const addr = buf.slice(i + n, i + n + size)\n\n i += (size + n)\n\n if (i > buf.length) { // did not end _exactly_ at buffer.length\n throw ParseError('Invalid address buffer: ' + buf.toString('hex'))\n }\n\n // ok, tuple seems good.\n tuples.push([code, addr])\n }\n\n return tuples\n}", "function bufferToTuples (buf) {\n const tuples = []\n let i = 0\n while (i < buf.length) {\n const code = varint.decode(buf, i)\n const n = varint.decode.bytes\n\n const p = protocols(code)\n\n const size = sizeForAddr(p, buf.slice(i + n))\n\n if (size === 0) {\n tuples.push([code])\n i += n\n continue\n }\n\n const addr = buf.slice(i + n, i + n + size)\n\n i += (size + n)\n\n if (i > buf.length) { // did not end _exactly_ at buffer.length\n throw ParseError('Invalid address buffer: ' + buf.toString('hex'))\n }\n\n // ok, tuple seems good.\n tuples.push([code, addr])\n }\n\n return tuples\n}", "function bufferToTuples (buf) {\n const tuples = []\n let i = 0\n while (i < buf.length) {\n const code = varint.decode(buf, i)\n const n = varint.decode.bytes\n\n const p = protocols(code)\n\n const size = sizeForAddr(p, buf.slice(i + n))\n\n if (size === 0) {\n tuples.push([code])\n i += n\n continue\n }\n\n const addr = buf.slice(i + n, i + n + size)\n\n i += (size + n)\n\n if (i > buf.length) { // did not end _exactly_ at buffer.length\n throw ParseError('Invalid address buffer: ' + buf.toString('hex'))\n }\n\n // ok, tuple seems good.\n tuples.push([code, addr])\n }\n\n return tuples\n}", "function bufferToTuples (buf) {\n const tuples = []\n let i = 0\n while (i < buf.length) {\n const code = varint.decode(buf, i)\n const n = varint.decode.bytes\n\n const p = protocols(code)\n\n const size = sizeForAddr(p, buf.slice(i + n))\n\n if (size === 0) {\n tuples.push([code])\n i += n\n continue\n }\n\n const addr = buf.slice(i + n, i + n + size)\n\n i += (size + n)\n\n if (i > buf.length) { // did not end _exactly_ at buffer.length\n throw ParseError('Invalid address buffer: ' + buf.toString('hex'))\n }\n\n // ok, tuple seems good.\n tuples.push([code, addr])\n }\n\n return tuples\n}", "function bufferToTuples (buf) {\n const tuples = []\n let i = 0\n while (i < buf.length) {\n const code = varint.decode(buf, i)\n const n = varint.decode.bytes\n\n const p = protocols(code)\n\n const size = sizeForAddr(p, buf.slice(i + n))\n\n if (size === 0) {\n tuples.push([code])\n i += n\n continue\n }\n\n const addr = buf.slice(i + n, i + n + size)\n\n i += (size + n)\n\n if (i > buf.length) { // did not end _exactly_ at buffer.length\n throw ParseError('Invalid address buffer: ' + buf.toString('hex'))\n }\n\n // ok, tuple seems good.\n tuples.push([code, addr])\n }\n\n return tuples\n}", "function bufferToTuples (buf) {\n const tuples = []\n let i = 0\n while (i < buf.length) {\n const code = varint.decode(buf, i)\n const n = varint.decode.bytes\n\n const p = protocols(code)\n\n const size = sizeForAddr(p, buf.slice(i + n))\n\n if (size === 0) {\n tuples.push([code])\n i += n\n continue\n }\n\n const addr = buf.slice(i + n, i + n + size)\n\n i += (size + n)\n\n if (i > buf.length) { // did not end _exactly_ at buffer.length\n throw ParseError('Invalid address buffer: ' + buf.toString('hex'))\n }\n\n // ok, tuple seems good.\n tuples.push([code, addr])\n }\n\n return tuples\n}", "function bufferToTuples (buf) {\n const tuples = []\n let i = 0\n while (i < buf.length) {\n const code = varint.decode(buf, i)\n const n = varint.decode.bytes\n\n const p = protocols(code)\n\n const size = sizeForAddr(p, buf.slice(i + n))\n\n if (size === 0) {\n tuples.push([code])\n i += n\n continue\n }\n\n const addr = buf.slice(i + n, i + n + size)\n\n i += (size + n)\n\n if (i > buf.length) { // did not end _exactly_ at buffer.length\n throw ParseError('Invalid address buffer: ' + buf.toString('hex'))\n }\n\n // ok, tuple seems good.\n tuples.push([code, addr])\n }\n\n return tuples\n}", "function MediaDownloader$parseChunkMedia(content) {\n return parseChunkMedia(new Uint8Array(content));\n}", "parseBasicToken(token) {\n return Buffer.from(token, 'base64').toString().split(':');\n }", "function split (matcher, mapper) {\n var decoder = new Decoder()\n var soFar = ''\n if('function' === typeof matcher)\n mapper = matcher, matcher = null\n if (!matcher)\n matcher = /\\r?\\n/\n\n function emit(stream, piece) {\n if(mapper) {\n try {\n piece = mapper(piece)\n }\n catch (err) {\n return stream.emit('error', err)\n }\n if('undefined' !== typeof piece)\n stream.queue(piece)\n }\n else\n stream.queue(piece)\n }\n\n function next (stream, buffer) { \n var pieces = (soFar + buffer).split(matcher)\n soFar = pieces.pop()\n\n for (var i = 0; i < pieces.length; i++) {\n var piece = pieces[i]\n emit(stream, piece)\n }\n }\n\n return through(function (b) {\n next(this, decoder.write(b))\n },\n function () {\n if(decoder.end) \n next(this, decoder.end())\n if(soFar != null)\n emit(this, soFar)\n this.queue(null)\n })\n}", "function split_content(content) {\n var ret = [];\n var lines = content.split('\\n');\n lines.forEach(function (line, index, array) {\n if (line.indexOf(\"###\") >= 0) {\n line = \"----\\n\\n\" + line;\n } else {\n if (line.indexOf(\"##\") >= 0) {\n line = \"---\\n\\n\" + line;\n }\n }\n ret.push(line);\n });\n return ret.join(\"\\n\");\n}", "function split_newlines(s) {\n\t\t\t//return s.split(/\\x0d\\x0a|\\x0a/);\n\n\t\t\ts = s.replace(/\\x0d/g, '');\n\t\t\tvar out = [],\n\t\t\t\tidx = s.indexOf(\"\\n\");\n\t\t\twhile (idx !== -1) {\n\t\t\t\tout.push(s.substring(0, idx));\n\t\t\t\ts = s.substring(idx + 1);\n\t\t\t\tidx = s.indexOf(\"\\n\");\n\t\t\t}\n\t\t\tif (s.length) {\n\t\t\t\tout.push(s);\n\t\t\t}\n\t\t\treturn out;\n\t\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "function handler(buffer) {\n let chunks = buffer.toString().split(\"\\n\");\n\n for (let chunk of chunks) {\n chunk = chunk.replace(/(\\r\\n|\\n|\\r)/gm, \"\").trim();\n\n if (chunk == \"OK\") {\n // if end of message stop listner and return result\n this.removeListener(\"data\", handler);\n resolve(answer);\n\n // if line is busy or another but not error\n } else if (chunk == \"BUSY\" || chunk == \"NO DIAL TONE\" || chunk == \"NO CARRIER\") {\n resolve();\n\n } else if (chunk == \"ERROR\") {\n this.removeListener(\"data\", handler);\n reject(`ERROR result on command - ${command}. Answer - ${chunk}`);\n\n } else {\n // if message is not fully get add to result this chunk\n answer += chunk;\n };\n };\n }", "splitTokens(scope, tokens) {\n const items = []\n let current = []\n for (let i = 0, token; (token = tokens[i]); i++) {\n // handle alternate marker\n if (this.delimiter.testAtStart(scope, tokens, i)) {\n items.push(current)\n current = []\n // eslint-disable-next-line no-continue\n continue\n }\n // handle nested start/emd\n if (this.start.testAtStart(scope, tokens, i)) {\n const end = this.findNestedEnd(scope, tokens, i)\n if (end) {\n current = current.concat(tokens.slice(i, end + 1))\n i = end\n // eslint-disable-next-line no-continue\n continue\n }\n }\n current.push(token)\n }\n // Pick up the last list ONLY if it's not empty\n // This ensures we don't pick up an empty list for a delimiter at the end.\n if (current.length) items.push(current)\n\n if (!items.length) return undefined\n return items\n }", "_transform(chunk, encoding, cb) {\n\n var me = this;\n //console.log('Chunk: ', chunk );\n\n // Concatenate any previous data, and split into an array of\n // encoded PDUs that start with a MSG_START byte\n let encodedPdus = this.splitBuffer( Buffer.concat([this.buffer, chunk]) );\n\n // Now we look through each of the encoded PDUs (which have not\n // yet been validated for length or checksum)\n encodedPdus.forEach( function( encodedPdu, pduIndex ){\n\n // Unstuff the PDU (remove escape codes)\n let pdu = me.decodePdu( encodedPdu );\n\n if( pdu.length >= MIN_MSG_LEN ) {\n\n // it is at least long enough to possibly be complete\n let msgLength = pdu[1]*256 + pdu[2];\n\n // If it's too long, truncate it. This shouldn't really happen\n // under normal circumstances, but no reason to keep extra bytes around.\n if(pdu.length + 3 > msgLength ) {\n pdu = pdu.slice(0, msgLength+3 );\n }\n\n // If it (now) has the expected number of bytes...\n if( msgLength === pdu.length-3 ) {\n\n // check the checksum\n let checksum = me.checksum( pdu, 1, msgLength +1 );\n\n if( checksum === pdu[ msgLength+2 ] ) {\n // Process the received PDU\n me.onReceive( pdu );\n }\n else {\n // report an incorrect checksum\n me.onReceiveError( pdu );\n } \n }\n else if( pduIndex === encodedPdu.length-1 ) {\n // if last PDU is incomplete, save it for later\n me.buffer = Buffer.from( encodedPdu );\n }\n\n }\n else if( pduIndex === encodedPdu.length-1 ) {\n // if last PDU is incomplete, save it for later\n me.buffer = Buffer.from( encodedPdu );\n }\n\n });\n\n // notify the caller that we are done processing the chunk\n cb();\n }", "function getBufferChunk(buffer, chunkNumber, chunkSize) {\r\n var bufferSize = buffer.byteLength;\r\n var maxChunkSize = 1024*16;\r\n if (Number.isFinite(chunkSize)) {maxChunkSize = chunkSize;} //allow specification of a different chunk size. \r\n \r\n //don't allow chunk length to extend past end of buffer\r\n var chunkStart = maxChunkSize * chunkNumber;\r\n var chunkLength = bufferSize - chunkStart;\r\n if (chunkLength > maxChunkSize) {chunkLength = maxChunkSize;}\r\n \r\n var bufferArray = new Int8Array(buffer, chunkStart, chunkLength);\r\n \r\n return(bufferArray);\r\n}", "function splitTextByToken(text, token) {\r\n let textParts = [\"\"];\r\n\r\n let textPartsIndex = 0;\r\n for (let i = 0; i < text.length; i++) {\r\n if (text[i] === token) {\r\n textPartsIndex++;\r\n textParts[textPartsIndex] = \"\";\r\n } else {\r\n textParts[textPartsIndex] += text[i];\r\n }\r\n }\r\n\r\n return textParts;\r\n}", "function processInput(buffer, cb) {\n if (buffer.length == 0) return buffer;\n var split_char = '\\n';\n var lines = buffer.split(split_char);\n // If there are any line splits, the below logic always works, but if there are none we need to detect this and skip\n // any processing.\n if (lines[0].length == buffer.length) return buffer;\n // Note last item is ignored since it is the remainder (or empty)\n for(var i = 0; i < lines.length-1; i++) {\n var line = lines[i];\n if (format == \"binary\") {\n target.produce(line, handleProduceResponse.bind(undefined, cb));\n } else if (format == \"avro\") {\n // Avro data should be passed in its JSON-serialized form\n try {\n var avro = JSON.parse(line);\n } catch (e) {\n console.log(\"Couldn't parse '\" + line + \"' as JSON\");\n continue;\n }\n target.produce(valueSchema, avro, handleProduceResponse.bind(undefined, cb));\n }\n // OR with key or partition:\n //target.produce({'partition': 0, 'value': line}, handleProduceResponse.bind(undefined, cb));\n //target.produce({'key': 'console', 'value': line}, handleProduceResponse.bind(undefined, cb));\n num_messages += 1;\n num_bytes += line.length;\n }\n return lines[lines.length-1];\n}", "function splitTextToArray(textes) {\r\n\tlet textArray = textes.split(\"\\n\");\r\n\treturn textArray;\r\n}", "splitArmoredBlocks(keyBlockStr) {\n let myRe = /-----BEGIN PGP (PUBLIC|PRIVATE) KEY BLOCK-----/g;\n let myArray;\n let retArr = [];\n let startIndex = -1;\n while ((myArray = myRe.exec(keyBlockStr)) !== null) {\n if (startIndex >= 0) {\n let s = keyBlockStr.substring(startIndex, myArray.index);\n retArr.push(s);\n }\n startIndex = myArray.index;\n }\n\n retArr.push(keyBlockStr.substring(startIndex));\n\n return retArr;\n }", "getChunkHandler() {\n var decoder = new TextDecoder();\n var partial = false;\n return (data) => {\n var currentTime = (new Date()).getTime();\n var elapsedMillis = currentTime - this.prevChunkRecvTime;\n this.prevChunkRecvTime = currentTime;\n\n if(data.done) {\n return true;\n }\n\n var chunk = decoder.decode(data.value || new Uint8Array, {stream: !data.done});\n var startIdx = 0, msg;\n if(partial) {\n var partialEnd = chunk.indexOf(\"}{\", startIdx);\n if(partialEnd == -1) {\n console.debug(\"Another partial received in entirety, skipping chunk\");\n startIdx = chunk.length;\n } else {\n console.debug(\"Partial dropped from the start of chunk\");\n startIdx = partialEnd + 1;\n }\n }\n\n if(startIdx < chunk.length) {\n if (chunk[startIdx] != '{') {\n throw new Error(\"Invalid chunk received, cannot process this request further\");\n }\n this.callback({type: \"stat_chunk\", msg: {elapsed: elapsedMillis}});\n \n while(true) {\n if(startIdx == chunk.length) {\n break;\n }\n var msgEnd = chunk.indexOf(\"}{\", startIdx);\n if(msgEnd == -1) {\n try {\n msg = JSON.parse(chunk.substring(startIdx));\n partial = false;\n this.callback({ type: \"data\", msg: this.transformer(msg)});\n } catch (err) {\n console.debug(\"Invalid JSON, partial received at the end. Dropping it\");\n partial = true;\n }\n startIdx = chunk.length;\n } else {\n try {\n msg = JSON.parse(chunk.substring(startIdx, msgEnd + 1));\n this.callback({ type: \"data\", msg: this.transformer(msg)});\n } catch (err) {\n throw new Error(\"Invalid JSON which was unexpected here: \" + err.message); \n }\n startIdx = msgEnd + 1;\n }\n }\n }\n return false;\n };\n }", "function splitLargeTokens(lineContent, tokens, onlyAtSpaces) {\r\n var lastTokenEndIndex = 0;\r\n var result = [], resultLen = 0;\r\n if (onlyAtSpaces) {\r\n // Split only at spaces => we need to walk each character\r\n for (var i = 0, len = tokens.length; i < len; i++) {\r\n var token = tokens[i];\r\n var tokenEndIndex = token.endIndex;\r\n if (lastTokenEndIndex + 50 /* LongToken */ < tokenEndIndex) {\r\n var tokenType = token.type;\r\n var lastSpaceOffset = -1;\r\n var currTokenStart = lastTokenEndIndex;\r\n for (var j = lastTokenEndIndex; j < tokenEndIndex; j++) {\r\n if (lineContent.charCodeAt(j) === 32 /* Space */) {\r\n lastSpaceOffset = j;\r\n }\r\n if (lastSpaceOffset !== -1 && j - currTokenStart >= 50 /* LongToken */) {\r\n // Split at `lastSpaceOffset` + 1\r\n result[resultLen++] = new LinePart(lastSpaceOffset + 1, tokenType);\r\n currTokenStart = lastSpaceOffset + 1;\r\n lastSpaceOffset = -1;\r\n }\r\n }\r\n if (currTokenStart !== tokenEndIndex) {\r\n result[resultLen++] = new LinePart(tokenEndIndex, tokenType);\r\n }\r\n }\r\n else {\r\n result[resultLen++] = token;\r\n }\r\n lastTokenEndIndex = tokenEndIndex;\r\n }\r\n }\r\n else {\r\n // Split anywhere => we don't need to walk each character\r\n for (var i = 0, len = tokens.length; i < len; i++) {\r\n var token = tokens[i];\r\n var tokenEndIndex = token.endIndex;\r\n var diff = (tokenEndIndex - lastTokenEndIndex);\r\n if (diff > 50 /* LongToken */) {\r\n var tokenType = token.type;\r\n var piecesCount = Math.ceil(diff / 50 /* LongToken */);\r\n for (var j = 1; j < piecesCount; j++) {\r\n var pieceEndIndex = lastTokenEndIndex + (j * 50 /* LongToken */);\r\n result[resultLen++] = new LinePart(pieceEndIndex, tokenType);\r\n }\r\n result[resultLen++] = new LinePart(tokenEndIndex, tokenType);\r\n }\r\n else {\r\n result[resultLen++] = token;\r\n }\r\n lastTokenEndIndex = tokenEndIndex;\r\n }\r\n }\r\n return result;\r\n}", "parse(buffer) {\n\n // Define the list of face normals\n const normals = [];\n\n // Define the list of face positions\n const positions = [];\n \n // Define the list of face indices\n const indices = [];\n \n // Define the index\n let index = 0;\n \n // Iterate through the buffer\n for (let i = 0; i < buffer.readUInt32LE(80); i++) {\n \n // Define the normal offset within the buffer\n const normalOffset = (84 + (i * 50));\n \n // Define the normals\n const normalX = buffer.readFloatLE((normalOffset + 0), true);\n const normalY = buffer.readFloatLE((normalOffset + 8), true);\n const normalZ = buffer.readFloatLE((normalOffset + 4), true);\n \n // Iterate through the section of the buffer\n for (let j = 1; j <= 3; j++) {\n \n // Define the position offset within the buffer\n const positionOffset = (normalOffset + j * 12);\n \n // Define the positions\n const positionX = buffer.readFloatLE((positionOffset + 0), true);\n const positionY = buffer.readFloatLE((positionOffset + 8), true);\n const positionZ = buffer.readFloatLE((positionOffset + 4), true);\n \n // Add the normals to the normals set\n normals.push(normalX, normalY, normalZ);\n \n // Add the positions to the positions set\n positions.push(positionX, positionY, positionZ);\n \n // Add the index to the indices set\n indices.push(index++);\n }\n }\n\n // Return the data\n return { normals, positions, indices };\n }", "function chunkString(str, len) {\n\tvar _size = Math.ceil(str.length / len),\n\t _ret = new Array(_size),\n\t _offset;\n\n\tfor (var _i = 0; _i < _size; _i++) {\n\t\t_offset = _i * len;\n\t\t_ret[_i] = str.substring(_offset, _offset + len);\n\t}\n\n\treturn _ret;\n}", "function deserializeFrames(buffer, encoders) {\n const frames = [];\n let offset = 0;\n while (offset + UINT24_SIZE < buffer.length) {\n const frameLength = readUInt24BE(buffer, offset);\n const frameStart = offset + UINT24_SIZE;\n const frameEnd = frameStart + frameLength;\n if (frameEnd > buffer.length) {\n // not all bytes of next frame received\n break;\n }\n const frameBuffer = buffer.slice(frameStart, frameEnd);\n const frame = deserializeFrame(frameBuffer, encoders);\n frames.push(frame);\n offset = frameEnd;\n }\n return [frames, buffer.slice(offset, buffer.length)];\n }", "async function collectTokens(testString, width, height) {\n let tokens = [];\n for await (let token of createStreamFromString(testString, width, height)) {\n tokens.push(token);\n }\n return tokens;\n}", "tokenize(input, callback) {\n this._line = 1;\n\n // If the input is a string, continuously emit tokens through the callback until the end\n if (typeof input === 'string') {\n this._input = this._readStartingBom(input);\n // If a callback was passed, asynchronously call it\n if (typeof callback === 'function') (0, _queueMicrotask.default)(() => this._tokenizeToEnd(callback, true));\n // If no callback was passed, tokenize synchronously and return\n else {\n const tokens = [];\n let error;\n this._tokenizeToEnd((e, t) => e ? error = e : tokens.push(t), true);\n if (error) throw error;\n return tokens;\n }\n }\n // Otherwise, the input must be a stream\n else {\n this._pendingBuffer = null;\n if (typeof input.setEncoding === 'function') input.setEncoding('utf8');\n // Adds the data chunk to the buffer and parses as far as possible\n input.on('data', data => {\n if (this._input !== null && data.length !== 0) {\n // Prepend any previous pending writes\n if (this._pendingBuffer) {\n data = Buffer.concat([this._pendingBuffer, data]);\n this._pendingBuffer = null;\n }\n // Hold if the buffer ends in an incomplete unicode sequence\n if (data[data.length - 1] & 0x80) {\n this._pendingBuffer = data;\n }\n // Otherwise, tokenize as far as possible\n else {\n // Only read a BOM at the start\n if (typeof this._input === 'undefined') this._input = this._readStartingBom(typeof data === 'string' ? data : data.toString());else this._input += data;\n this._tokenizeToEnd(callback, false);\n }\n }\n });\n // Parses until the end\n input.on('end', () => {\n if (typeof this._input === 'string') this._tokenizeToEnd(callback, true);\n });\n input.on('error', callback);\n }\n }", "function readMessages(bitStream, protocols, config) {\n // number of messages\n var length = bitStream[Binary[BinaryType.UInt16].read]();\n\n var messages = [];\n for (var i = 0; i < length; i++) {\n\n var type = bitStream[Binary[config.TYPE_BINARY_TYPE].read]();\n var protocol = protocols.getProtocol(type);\n var message = readMessage(bitStream, protocol, 1, type, config.TYPE_PROPERTY_NAME);\n message.protocol = protocol;\n messages.push(message);\n //console.log('read message', message)\n }\n return messages;\n}" ]
[ "0.61869943", "0.60298955", "0.59152037", "0.5880399", "0.5838884", "0.581013", "0.57597834", "0.5655488", "0.5653349", "0.56403196", "0.5609602", "0.5604847", "0.5600512", "0.5567884", "0.5562531", "0.55203986", "0.55201626", "0.5433067", "0.543182", "0.54123884", "0.5411549", "0.5391166", "0.53662735", "0.53545296", "0.53466576", "0.52812153", "0.5278851", "0.52747536", "0.52231133", "0.52192605", "0.5212561", "0.520593", "0.5189215", "0.51832956", "0.51832956", "0.5182989", "0.5180182", "0.51621914", "0.51572216", "0.51572216", "0.51572216", "0.51572216", "0.51572216", "0.51572216", "0.51572216", "0.51572216", "0.51572216", "0.51572216", "0.5153532", "0.5151632", "0.5149718", "0.5144304", "0.51340526", "0.50958794", "0.50958794", "0.50958794", "0.50958794", "0.50958794", "0.50958794", "0.50958794", "0.50958794", "0.50958794", "0.50958794", "0.50958794", "0.50958794", "0.50958794", "0.50958794", "0.50958794", "0.50958794", "0.50958794", "0.50958794", "0.50958794", "0.50958794", "0.50958794", "0.50958794", "0.50958794", "0.50958794", "0.50958794", "0.50958794", "0.50958794", "0.50958794", "0.50958794", "0.50958794", "0.50958794", "0.5088076", "0.5054024", "0.505012", "0.50481945", "0.50376636", "0.50355655", "0.5022798", "0.5008867", "0.4998098", "0.4998083", "0.49765137", "0.49664566", "0.49610057", "0.49332458", "0.49244246", "0.49211767" ]
0.8727454
0
Remove stuff characters from a buffer of data returns an array of bytes that may be shorter than the buffer passed in.
decodePdu( encoded ) { let values = []; let index = 0; while( index < encoded.length ) { if( encoded[index] === MSG_TOKEN_ESC && index < encoded.length-1 ) { index++; if( encoded[index] === MSG_START_STUFF ){ values.push( MSG_TOKEN_START ); } else if( encoded[index] === MSG_ESC_STUFF ){ values.push( MSG_TOKEN_ESC ); } } else { values.push( encoded[index] ); } index++; } return values; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeByteStuffing(buffer) {\n var ff = buffer.indexOf(0xFF, 0);\n if (ff === -1 || buffer[ff+1] !== 0)\n return buffer; /* Nothing to remove */\n var searchIndex = ff+2; /* Where to start next search for 0xFF */\n\n while (true) {\n var ff2 = buffer.indexOf(0xFF, searchIndex);\n\n if (ff2 == -1 || buffer[ff2+1] !== 0) {\n /* We are finished, just need to copy down any trailing bytes and trim buffer length */\n buffer.copy(buffer, ff+1, searchIndex);\n return buffer.slice(0, ff + buffer.length - searchIndex + 1);\n } else {\n /* Copy down the next range of good data, overwriting unwanted zero byte */\n buffer.copy(buffer, ff+1, searchIndex, ff2+1);\n }\n\n ff = ff + ff2 - searchIndex + 1; /* Position which 0xFF was just copied down to */\n searchIndex = ff2+2; /* Where next range of good bytes starts from */\n }\n }", "function FFString_cutByteStringToArray(msg, maxlength) {\n\tvar str;\n\tvar len=0;\n\tvar temp;\n\tvar count;\n\tvar srTemp = new String(msg);\n\tvar arTemp = Array();\n\n\tlen = srTemp.length;\n\n\tfor(var i=0;srTemp.length>0;i++){\n\t\tcount = 0;\n\t\tfor(k=0 ; k<len ; k++) {\n\t\t\tstr = srTemp;\n\t\t\ttemp = srTemp.charAt(k);\n\t\t\t\n\t\t\tif(escape(temp).length > 4) {\n\t\t\t\tcount += 2;\n\t\t\t}\n\t\t\telse if (temp == '\\r' && srTemp.charAt(k+1) == '\\n') { //in case \\r\\n\n\t\t\t\tcount += 2;\n\t\t\t}\t\t\n\t\t\telse if(temp != '\\n') {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\tif(count > maxlength) {\n\t\t\t\tstr = srTemp.substring(0,k);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tarTemp[i] = new Array();\n\t\tarTemp[i] = str;\n\t\tsrTemp = srTemp.substring(k);\n\t}\n\treturn arTemp;\n}", "function fixdata(data) {\n var o = \"\",\n l = 0,\n w = 10240;\n for (; l < data.byteLength / w; ++l) o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w, l * w + w)));\n o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w)));\n return o;\n }", "function fixData(data) {\n var o = '', l = 0, w = 10240;\n for (; l < data.byteLength / w; ++l) {\n o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w, l * w + w)));\n }\n o += String.fromCharCode.apply(null, new Uint8Array(data.slice(o.length)));\n return o;\n }", "function fixData(data) {\n var o = '', l = 0, w = 10240;\n for (; l < data.byteLength / w; ++l) {\n o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w, l * w + w)));\n }\n o += String.fromCharCode.apply(null, new Uint8Array(data.slice(o.length)));\n return o;\n }", "function fixdata(data) {\n\t\tvar o = \"\", l = 0, w = 10240;\n\t\tfor(; l<data.byteLength/w; ++l) o+=String.fromCharCode.apply(null,new Uint8Array(data.slice(l*w,l*w+w)));\n\t\to+=String.fromCharCode.apply(null, new Uint8Array(data.slice(l*w)));\n\t\treturn o;\n\t}", "function fixdata(data) {\n var o = \"\", l = 0, w = 10240;\n for(; l<data.byteLength/w; ++l) o+=String.fromCharCode.apply(null,new Uint8Array(data.slice(l*w,l*w+w)));\n o+=String.fromCharCode.apply(null, new Uint8Array(data.slice(l*w)));\n return o;\n}", "removeHeader(data) {\n let msg = MsgHeader.fromBuffer(data)\n\n let dataSize = data.length - msg.headerSize\n let buff = Buffer.alloc(dataSize)\n data.copy(buff, 0, msg.headerSize, msg.headerSize+dataSize)\n return buff\n }", "function fixBuffer(buffer) {\n var binary = '';\n var bytes = new Uint8Array(buffer);\n var len = bytes.byteLength;\n for (var i = 0; i < len; i++) {\n binary += String.fromCharCode(bytes[i]);\n }\n return binary;\n}", "function cutKeyBuffer(key) {\n var keySha1 = crypto.createHash('sha1').update(key).digest('hex');\n var keyHex = keySha1.slice(0, 32);\n return new Buffer(keyHex);\n }", "function FFString_cutByteString( msg, maxlength) {\n\tvar str,msg;\n\tvar len=0;\n\tvar temp;\n\tvar count;\n\tcount = 0;\n\t \n\tstr = new String(msg);\n\tlen = str.length;\n\n\tfor(k=0 ; k<len ; k++) {\n\t\ttemp = str.charAt(k);\n\t\t\n\t\tif(escape(temp).length > 4) {\n\t\t\tcount += 2;\n\t\t}\n\t\telse if (temp == '\\r' && str.charAt(k+1) == '\\n') { // in case \\r\\n\n\t\t\tcount += 2;\n\t\t}\t\t\n\t\telse if(temp != '\\n') {\n\t\t\tcount++;\n\t\t}\n\t\tif(count > maxlength) {\n\t\t\tstr = str.substring(0,k);\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn str;\n}", "getJunkBytes_() {\r\n /** @type {!Array<number>} */\r\n let bytes = [];\r\n if (this.junk.chunkId) {\r\n return bytes.concat(\r\n packString(this.junk.chunkId),\r\n pack(this.junk.chunkData.length, this.uInt32_),\r\n this.junk.chunkData);\r\n }\r\n return bytes;\r\n }", "function trimPack(pack) {\n var count = 0;\n var i = 0;\n while (i < pack.length) {\n if (pack[i] == 0) break;\n ++count;\n ++i;\n }\n var trimedPack = new Uint16Array(count);\n console.log(trimedPack);\n i = 0;\n while(i < trimedPack.length)\n {\n trimedPack[i]=pack[i];\n ++i;\n }\n return trimedPack;\n }", "static checksumBuffer(buf, length) {\n let checksum = '';\n let checksum_hex = '';\n for (let i = 0; i < (buf.length / length); i++) {\n checksum_hex = this.read64LE(buf, i);\n checksum = this.sumHex64bits(checksum, checksum_hex).substr(-16);\n }\n return checksum;\n }", "splitBuffer( buf ) {\n let chunks = [];\n\n // discard any bytes at the front before the START\n let position = buf.indexOf( MSG_TOKEN_START );\n\n if( position > 0 ) {\n // Clear the bytes before the start\n buf = buf.slice( position );\n }\n else if( position < 0 ) {\n // no START at all... invalid message\n return [];\n }\n\n // we know buf[0] is a start, so look for another START\n let index = 1;\n\n while( (position = buf.indexOf( MSG_TOKEN_START, index )) > -1) {\n \n // If there are no bytes between START bytes, don't put an empty element in the array\n // This shouldn't happen based on the protocol design anyway\n if( index === position ) {\n chunks.push( Buffer.from([]));\n }\n else {\n chunks.push( buf.slice( index-1, position ) );\n }\n\n\n // continue searching at the next byte\n index = position + 1;\n }\n\n if( index <= buf.length ) {\n //console.log('index:', index, 'left: ', buf.slice( index-1 ) );\n chunks.push( buf.slice( index-1 ));\n }\n\n return chunks;\n }", "function cleanInput(data) {\n\treturn data.toString().replace(/(\\r\\n|\\n|\\r)/gm, \"\");\n}", "function empty_array (buffer_to_empty) {\n while(buffer_to_empty.length > 0) {buffer_to_empty.pop();}\n }", "function $SYhk$var$copyFromBufferString(n, list) {\n var p = list.head;\n var c = 1;\n var ret = p.data;\n n -= ret.length;\n\n while (p = p.next) {\n var str = p.data;\n var nb = n > str.length ? str.length : n;\n if (nb === str.length) ret += str;else ret += str.slice(0, n);\n n -= nb;\n\n if (n === 0) {\n if (nb === str.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = str.slice(nb);\n }\n\n break;\n }\n\n ++c;\n }\n\n list.length -= c;\n return ret;\n} // Copies a specified amount of bytes from the list of buffered data chunks.", "function stripBom(data) {\n return data.replace(/^\\uFEFF/, '');\n}", "_filterOutTelnetCommands(chunk) {\n let i = 0;\n while (chunk[i] === IAC && chunk[i + 1] !== IAC) {\n if (chunk[i + 1] === SB) {\n i += 2;\n while(!(chunk[i] === IAC && chunk[i + 1] === SE)) i++;\n i += 2;\n }\n else i += 3;\n }\n return chunk.slice(i, chunk.length);\n }", "function __ISO97971( message, paddingBytes, remove ) {\n if ( remove === undefined ) {\n /* Allocate required padding length + message length. */\n let padded = Buffer.alloc( message.length + paddingBytes );\n\n /* Copy the message. */\n message.copy( padded );\n\n /* Append the first byte as 0x80 */\n Buffer.alloc( 1 ).fill( 0x80 ).copy( padded, message.length );\n\n /* Fill the rest of the padding with zeros. */\n Buffer.alloc( paddingBytes - 1 ).fill( 0x00 ).copy( message, message.length + 1 );\n\n /* Return the result. */\n return padded;\n }\n else {\n\n /* Scan backwards. */\n let lastIndex = message.length - 1;\n\n /* Find the amount of null padding bytes. */\n for ( ; lastIndex > 0; lastIndex-- )\n /* If a null byte is encountered, split at this index. */\n if ( message[ lastIndex ] !== 0x00 )\n break;\n\n /* Remove the null-padding. */\n let cleaned = message.slice( 0, lastIndex + 1 );\n\n /* Remove the final byte which is 0x80. */\n return cleaned.slice( 0, cleaned.length - 1 );\n }\n }", "function truncateEncodedString(buf, encoding, maxLen) {\n var truncated = buf.slice(0, maxLen);\n var len = maxLen;\n var tmp, str;\n while (len > 0 && len >= maxLen - 3) {\n tmp = len == maxLen ? truncated : buf.slice(0, len);\n str = decodeString(tmp, encoding);\n if (str.charAt(str.length-1) != '\\ufffd') {\n truncated = tmp;\n break;\n }\n len--;\n }\n return truncated;\n }", "flush() {\n const slice = this.buffer.slice(this.length);\n this.length += slice.length;\n return slice;\n }", "function stripBOM(content) {\r\n if (content.charCodeAt(0) === 0xFEFF) {\r\n content = content.slice(1);\r\n }\r\n return content;\r\n}", "function cleanInput(data) {\n\tvar newdata = data.toString().replace(/(\\r\\n|\\n|\\r)/gm,\"\");\n\tnewdata = newdata.replace(/\\|/gm, \" \");\n\tnewdata = newdata.replace(/\\s+/g, \" \");\n\tnewdata = newdata.split(\" \");\n\treturn newdata;\n}", "function stripBOM(content) {\n if(content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}", "function removeEmptyString(data){\n var ans = [];\n for(var i = 0; i < data.length; i++)\n if(data[i] != '')\n ans.push(data[i]);\n return ans;\n }", "stringToArrayBuffer(str) {\n var buf = new ArrayBuffer(str.length);\n var bufView = new Uint8Array(buf);\n\n for (var i=0, strLen=str.length; i<strLen; i++) {\n bufView[i] = str.charCodeAt(i)& 0xff;\n }\n\n return buf;\n}", "since(p)\n {\n return this.buf.subarray(p, this.o);\n }", "function stripBOM (content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1)\n }\n return content\n}", "cutoffContent(content) {\n\t\tlet newContent = content;\n\t\tif (newContent.split(/\\r\\n|\\r|\\n/).length > 3) {\n\t\t\tnewContent = newContent.split(/\\r\\n|\\r|\\n/).slice(0,3).join('\\n');\n\t\t}\n\t\treturn newContent.slice(0,280)\n\t}", "function stripBOM(content) {\n if (content.charCodeAt(0) === 0xfeff) {\n content = content.slice(1);\n }\n return content;\n}", "function BufferToArrayBuffer () {\n return (new Buffer(this)).buffer\n}", "function BufferToArrayBuffer () {\n return (new Buffer(this)).buffer\n}", "function BufferToArrayBuffer () {\n return (new Buffer(this)).buffer\n}", "function BufferToArrayBuffer () {\n return (new Buffer(this)).buffer\n}", "function imprimir(err, buffer) {\n 'use strict';\n var txt;\n if (err) {\n console.error(err);\n } else {\n txt = buffer.toString();\n console.log(txt.length);\n console.log(txt);\n }\n}", "flush() {\n const slice = this.buffer.slice(this.at);\n this.at += slice.length;\n return slice;\n }", "function flatUnescape(buffer) {\n var b, bytes = [];\n // Don't escape last byte\n for (var i = 0, end = buffer.length; i < end; ++i) {\n b = bops.readUInt8(buffer, i);\n // If low-byte escape tag use the following byte minus 1\n if (b === 0x01) bytes.push(bops.readUInt8(buffer, ++i) - 1);\n // If high-byte escape tag use the following byte plus 1\n else if (b === 0xfe) bytes.push(bops.readUInt8(buffer, ++i) + 1);\n // Otherwise no unescapement needed\n else bytes.push(b);\n }\n return bops.from(bytes);\n}", "shiftBufferFromUnresolvedDataArray(buffer) {\n if (!buffer) {\n buffer = new PooledBuffer(this.bufferSize, this.unresolvedDataArray, this.unresolvedLength);\n }\n else {\n buffer.fill(this.unresolvedDataArray, this.unresolvedLength);\n }\n this.unresolvedLength -= buffer.size;\n return buffer;\n }", "shiftBufferFromUnresolvedDataArray(buffer) {\n if (!buffer) {\n buffer = new PooledBuffer(this.bufferSize, this.unresolvedDataArray, this.unresolvedLength);\n }\n else {\n buffer.fill(this.unresolvedDataArray, this.unresolvedLength);\n }\n this.unresolvedLength -= buffer.size;\n return buffer;\n }", "cutoffContent(content) {\n\t\tlet newContent = content;\n\t\tif (newContent.split(/\\r\\n|\\r|\\n/).length > 3) {\n\t\t\tnewContent = newContent.split(/\\r\\n|\\r|\\n/).slice(0,3).join('\\n');\n\t\t}\n\t\treturn newContent.slice(0,280)\n\n\t}", "function copyFromBufferString(n,list){var p=list.head;var c=1;var ret=p.data;n-=ret.length;while(p=p.next){var str=p.data;var nb=n>str.length?str.length:n;if(nb===str.length)ret+=str;else ret+=str.slice(0,n);n-=nb;if(n===0){if(nb===str.length){++c;if(p.next)list.head=p.next;else list.head=list.tail=null;}else{list.head=p;p.data=str.slice(nb);}break;}++c;}list.length-=c;return ret;}// Copies a specified amount of bytes from the list of buffered data chunks.", "function copyFromBufferString(n,list){var p=list.head;var c=1;var ret=p.data;n-=ret.length;while(p=p.next){var str=p.data;var nb=n>str.length?str.length:n;if(nb===str.length)ret+=str;else ret+=str.slice(0,n);n-=nb;if(n===0){if(nb===str.length){++c;if(p.next)list.head=p.next;else list.head=list.tail=null;}else{list.head=p;p.data=str.slice(nb);}break;}++c;}list.length-=c;return ret;}// Copies a specified amount of bytes from the list of buffered data chunks.", "function copyFromBufferString(n,list){var p=list.head;var c=1;var ret=p.data;n-=ret.length;while(p=p.next){var str=p.data;var nb=n>str.length?str.length:n;if(nb===str.length)ret+=str;else ret+=str.slice(0,n);n-=nb;if(n===0){if(nb===str.length){++c;if(p.next)list.head=p.next;else list.head=list.tail=null;}else{list.head=p;p.data=str.slice(nb);}break;}++c;}list.length-=c;return ret;}// Copies a specified amount of bytes from the list of buffered data chunks.", "readUntil(chars, maxCharCount = 1024) {\r\n let startPosition = this.offset;\r\n let count = 0;\r\n let untilChar = '';\r\n while (!this.eos() && count++ < maxCharCount) {\r\n let char = this.read();\r\n if (chars.includes(char)) {\r\n untilChar = char;\r\n break;\r\n }\r\n }\r\n return [untilChar, this.text.slice(this.offset + 1, startPosition + 1)];\r\n }", "function stripMask(maskedData) {\n function isDigit(char) {\n return /\\d/.test(char);\n }\n return maskedData.split('').filter(isDigit);\n }", "function utf8CheckExtraBytes(self,buf,p){if((buf[0]&192)!==128){self.lastNeed=0;return\"�\".repeat(p)}if(self.lastNeed>1&&buf.length>1){if((buf[1]&192)!==128){self.lastNeed=1;return\"�\".repeat(p+1)}if(self.lastNeed>2&&buf.length>2){if((buf[2]&192)!==128){self.lastNeed=2;return\"�\".repeat(p+2)}}}}", "function pruneBuffer() {\n if (!buffer) return;\n if (type === 'fragmentedText') return;\n var start = buffer.buffered.length ? buffer.buffered.start(0) : 0;\n var bufferToPrune = playbackController.getTime() - start - mediaPlayerModel.getBufferToKeep();\n if (bufferToPrune > 0) {\n log('pruning buffer: ' + bufferToPrune + ' seconds.');\n isPruningInProgress = true;\n sourceBufferController.remove(buffer, 0, Math.round(start + bufferToPrune), mediaSource);\n }\n }", "function copyFromBufferString(n, list) {\n var p = list.head;\n var c = 1;\n var ret = p.data;\n n -= ret.length;\n\n while (p = p.next) {\n var str = p.data;\n var nb = n > str.length ? str.length : n;\n if (nb === str.length) ret += str;else ret += str.slice(0, n);\n n -= nb;\n\n if (n === 0) {\n if (nb === str.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = str.slice(nb);\n }\n\n break;\n }\n\n ++c;\n }\n\n list.length -= c;\n return ret;\n} // Copies a specified amount of bytes from the list of buffered data chunks.", "function toArray(buf) {\n return Array.prototype.slice.call(buf, 0);\n}", "async readToEOL()\n {\n // Create buffer\n let bufs = [];\n\n while (true)\n {\n if (this.receivedBuffers.length > 0)\n {\n let src = this.receivedBuffers[0]\n let pos = indexInBuf(src, '\\n'.charCodeAt(0));\n if (pos >= 0 && pos < src.length)\n {\n // Use part of the buffer...\n\n // Copy out the bit we want\n let buf = Buffer.alloc(pos);\n src.copy(buf, 0, 0, pos);\n bufs.push(buf);\n\n // Skip the \\n\n pos++;\n\n if (pos < src.length)\n {\n // Split the buffer to extract the part we need\n let subBuf = Buffer.alloc(src.length - pos);\n src.copy(subBuf, 0, pos, pos + subBuf.length);\n this.receivedBuffers.shift();\n this.receivedBuffers.unshift(subBuf);\n }\n else\n {\n this.receivedBuffers.shift();\n }\n\n // Finished\n return bufs.map(x=> x.toString(\"utf8\")).join(\"\");\n }\n else\n {\n // Use the entire buffer\n bufs.push(src);\n this.receivedBuffers.shift().length;\n }\n }\n else\n {\n // Wait for more data\n await new Promise((resolve, reject) => {\n this.waiter = resolve;\n });\n this.waiter = null;\n }\n }\n }", "function prepareCommand(command) {\n const buffer = Buffer.alloc(512);\n buffer[0] = command.charCodeAt(0);\n buffer[1] = command.charCodeAt(1);\n buffer[2] = command.charCodeAt(2);\n buffer[3] = command.charCodeAt(3);\n return buffer;\n}", "function convert(message){\n var arr = []\n var x = 0;\n var y;\n var i;\n for (i = 0; i < 160; i++) { \n y = x+2\n arr.push(message.slice(x,y))\n x += 4;\n }\n var data = Buffer.concat(arr);\n return data\n}", "arrayBuffer() {\n\t\treturn consumeBody$1.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "function utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\uFFFD'.repeat(p);\n }\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\uFFFD'.repeat(p + 1);\n }\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\uFFFD'.repeat(p + 2);\n }\n }\n }\n}", "function utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\uFFFD'.repeat(p);\n }\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\uFFFD'.repeat(p + 1);\n }\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\uFFFD'.repeat(p + 2);\n }\n }\n }\n}", "function chars_to_bytes(ac) {\n var retval = []\n for (var i = 0; i < ac.length; i++) {\n retval = retval.concat(str_to_bytes(ac[i]))\n }\n return retval\n }", "function getBytes(s) {\n var buf = [];\n for (var i = 0; i < s.length; i++) {\n buf.push(s.charCodeAt(i));\n }\n return buf;\n }", "function getBlobDataSliced() {\r\n\r\n var slice,\r\n byteArrays = [];\r\n\r\n for (var offset = 0; offset < byteCharacters.length; offset += sliceSize) {\r\n slice = byteCharacters.slice(offset, offset + sliceSize);\r\n\r\n byteNumbers = new Array(slice.length);\r\n\r\n for (var i = 0; i < slice.length; i++) {\r\n byteNumbers[i] = slice.charCodeAt(i);\r\n }\r\n\r\n byteArray = new Uint8Array(byteNumbers);\r\n\r\n // Add slice\r\n byteArrays.push(byteArray);\r\n }\r\n\r\n return byteArrays;\r\n }", "collect () {\n const buf = []\n buf.dataLength = 0\n this.on('data', c => {\n buf.push(c)\n buf.dataLength += c.length\n })\n return this.promise().then(() => buf)\n }", "checksum_buf(com){\n\tvar cs=0;\n\tvar cl=com.length;\n\tfor(var b=0; b<cl-1; b++){\n\t var by=com.readUInt8(b);\n\t var csb = ~by & 0x7F;\n\t cs = cs ^ csb;\n\t}\n\tcom.writeUInt8(cs,cl-1);\n\treturn String.fromCharCode(cs);\n }", "recycle() {\n if (this._length !== this._maxLength) {\n throw new Error('Can only recycle when the buffer is full');\n }\n this._startIndex = ++this._startIndex % this._maxLength;\n this.onTrimEmitter.fire(1);\n return this._array[this._getCyclicIndex(this._length - 1)];\n }", "function text_to_array(text)\n {\n var byte, bdx = 0, \n len = text.length, \n res = new Array(len),\n bytes = text_to_bytes(text)\n for(;;)\n { \n byte = get_byte(bytes, bdx)\n if(byte == 0)\n break\n res[bdx++] = byte\n }\n free(bytes)\n verify(bdx == text.length, \"UTF-8 not yet supported\")\n return res\n }", "function trim(data, max_length=100) {\n if (data.length > max_length) {\n data = data.slice(0, max_length - 3) + '...';\n }\n\n return data;\n}", "function getFixedString(buffer, offset, length)\n{\n var result = \"\";\n for (var i = 0; i < length; i++)\n {\n var val = buffer[offset + i];\n if (val == 0)\n {\n break;\n }\n result += String.fromCharCode(val);\n }\n return result;\n}", "function utf8CheckExtraBytes(self, buf, p) {\n\t if ((buf[0] & 0xC0) !== 0x80) {\n\t self.lastNeed = 0;\n\t return '\\uFFFD'.repeat(p);\n\t }\n\t if (self.lastNeed > 1 && buf.length > 1) {\n\t if ((buf[1] & 0xC0) !== 0x80) {\n\t self.lastNeed = 1;\n\t return '\\uFFFD'.repeat(p + 1);\n\t }\n\t if (self.lastNeed > 2 && buf.length > 2) {\n\t if ((buf[2] & 0xC0) !== 0x80) {\n\t self.lastNeed = 2;\n\t return '\\uFFFD'.repeat(p + 2);\n\t }\n\t }\n\t }\n\t}", "function utf8CheckExtraBytes(self, buf, p) {\n\t if ((buf[0] & 0xC0) !== 0x80) {\n\t self.lastNeed = 0;\n\t return '\\uFFFD'.repeat(p);\n\t }\n\t if (self.lastNeed > 1 && buf.length > 1) {\n\t if ((buf[1] & 0xC0) !== 0x80) {\n\t self.lastNeed = 1;\n\t return '\\uFFFD'.repeat(p + 1);\n\t }\n\t if (self.lastNeed > 2 && buf.length > 2) {\n\t if ((buf[2] & 0xC0) !== 0x80) {\n\t self.lastNeed = 2;\n\t return '\\uFFFD'.repeat(p + 2);\n\t }\n\t }\n\t }\n\t}", "function GetBufferSlice(buffer) {\n\n // First and last appearance respectively\n // we get the buffer slice in between\n var start = buffer.indexOf(\"<Network\");\n var end = buffer.indexOf(\"</FDSNStationXML>\", buffer.length - 25);\n\n return buffer.slice(start, end);\n\n }", "function wrapByteArr(buffer) {\n var diff = buffer.byteLength % 8;\n if(diff != 0) {\n var buffer = buffer.slice(0, buffer.byteLength-diff);\n }\n return new ByteArray(buffer);\n}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}" ]
[ "0.72799224", "0.59373635", "0.58751345", "0.5865399", "0.5865399", "0.57607377", "0.56863314", "0.56645143", "0.54388666", "0.543472", "0.540566", "0.5281841", "0.52608776", "0.52426165", "0.521595", "0.5185043", "0.516576", "0.5163557", "0.51568216", "0.5126668", "0.5086598", "0.507561", "0.50755113", "0.5049629", "0.5049072", "0.5036207", "0.5017518", "0.5003562", "0.49977568", "0.4977125", "0.49747223", "0.49725235", "0.496949", "0.496949", "0.496949", "0.496949", "0.49689758", "0.49516577", "0.49511546", "0.49401426", "0.49401426", "0.49392074", "0.49359378", "0.49359378", "0.49359378", "0.4919256", "0.4910582", "0.488777", "0.48871335", "0.4878332", "0.48768762", "0.48438218", "0.4831662", "0.48267204", "0.48191798", "0.48171252", "0.48171252", "0.48160446", "0.48106048", "0.4806854", "0.48059192", "0.48054528", "0.4802498", "0.47990513", "0.4793054", "0.47892654", "0.47864124", "0.47864124", "0.47811663", "0.47752345", "0.4764544", "0.4764544", "0.4764544", "0.4764544", "0.4764544", "0.4764544", "0.4764544", "0.4764544", "0.4764544", "0.4764544", "0.4764544", "0.4764544", "0.4764544", "0.4764544", "0.4764544", "0.4764544", "0.4764544", "0.4764544", "0.4764544", "0.4764544", "0.4764544", "0.4764544", "0.4764544", "0.4764544", "0.4764544", "0.4764544", "0.4764544", "0.4764544", "0.4764544", "0.4764544", "0.4764544" ]
0.0
-1
Called on a checksum error For future use...
onReceiveError( pdu ) { //console.log( 'JCOM1939 RX Error'); this.rxErrors++; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "error(error) {}", "hasCrcError() {\n return (this.flags & Flags.BAD_CRC) !== 0;\n }", "_onSerialError(err) {\n // not really sure how to handle this in a more elegant way\n\n this.emit('error', err);\n }", "function updateErrHandler(error, result) {\n\tif (error) {\n\t\tlog(\"cannot update data\")\n\t\tthrow error\n\t} else {\n\t\tlog(\"Update Success\") \n\t}\n}", "function bofError(msg) {\n throw new Error('Unsupported format, or corrupt file: ' + msg);\n }", "warn (code, msg, data = {}) {\n if (code === 'TAR_BAD_ARCHIVE' || code === 'TAR_ABORT')\n data.recoverable = false\n return super.warn(code, msg, data)\n }", "warn (code, msg, data = {}) {\n if (code === 'TAR_BAD_ARCHIVE' || code === 'TAR_ABORT')\n data.recoverable = false\n return super.warn(code, msg, data)\n }", "function handleError (err) {\n\t\t\t\tvar ackfn = self.awaitingAck[packet.ackid]\n\n\t\t\t\tif (!err) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (ackfn) {\n\t\t\t\t\tackfn(err, packet);\n\t\t\t\t} else if (!ackfn) {\n\t\t\t\t\tthrow err;\n\t\t\t\t}\n\n\t\t\t\tself.emit('error', err, packet);\n\t\t\t}", "function handleMetamaskError(error) {\n\t\t\t\t_that.ethereumEnablePending = false;\n\t\t\t\tenableResponse = true;\n\t\t\t\tif (error && ((error.code == 4001) ||\n\t\t\t\t\t(typeof error == \"string\" && error.indexOf(\"denied\") >= 0) ||\n\t\t\t\t\t(error.message && error.message.indexOf(\"denied\") >= 0) ||\n\t\t\t\t\t(error.message && error.message.indexOf(\"rejected\") >= 0))\n\t\t\t\t) {\n\t\t\t\t\tcallback(\"You rejected the connection, hit the refresh button to try again.\", true, false);\n\t\t\t\t} else {\n\t\t\t\t\tcallback(\"Account unlock failed, hit the refresh button to try again.\", true, false);\n\t\t\t\t\tconsole.log(\"enable request denied\");\n\t\t\t\t}\n\t\t\t}", "function generalChecks(){\n checkSumGenerated = dataConv.generateCheckSum(data.slice(1,-2)); //No tiene en cuenta el caracter inicial ni los 2 finales (estos son el checksum)\n checkSumIncoming = data.substr(data.length - 2); //Toma solo los 2 ultimos caracteres de la respuesta\n if (checkSumGenerated !== checkSumIncoming){\n console.log(\"Checksum validation error, the response is not valid\");\n return false; \n }else{\n return true;\n }\n}", "function err(strm,errorCode){strm.msg=msg[errorCode];return errorCode;}", "function syncError(error) {\n showStatus('Bad', 'Sync error! Check network connection.');\n console.log('Error: '+error);\n }", "function CheckBDEError( BDEResult ) {\n\tif ( 0 != BDEResult ) {\n\t\tErrorMessage( Messages.msierrBDEError, BDEResult, Icons.Critical + Buttons.btnOkOnly );\n\t\tthrow new Error( BDEResult );\n\t};\n}", "function packError(item)\n {\n self.error = item.error;\n\n if (! (item.error instanceof Pack.TruncError))\n {\n // NO truncation, just a raw error\n return false;\n }\n\n /************************************************************\n * Handle truncation\n *\n * Indicate truncation in the header\n */\n self.truncate();\n\n // Adjust our record counts based upon full records produced\n self.header.qdCount = qdCount;\n self.header.anCount = anCount;\n self.header.nsCount = nsCount;\n self.header.arCount = arCount;\n\n // Back-up and re-write the header\n pack.offset = offsetHeader;\n if (! self.header.pack( pack ))\n {\n self.error = self.header.error;\n return false;\n }\n\n // And move back to the end of the last full record\n pack.offset = offsetEnd;\n\n return false;\n }", "checkedEmitError(error) {\n if (!isIgnorableFileError(error)) {\n this.emit('error', error);\n }\n }", "async onWithdrawalReferenceError (uniqueId, address, amount, hash) {\n // Override this or listen to events!\n this.emit('withdrawalReferenceError', uniqueId, address, amount, hash)\n }", "_checkDone() {\n\n // it's only for SIGHASH_ALL, if implement other - change it!\n if (this._data.claimProofs.length) throw new Error('Tx is already signed, you can\\'t modify it');\n }", "function checksum() {\n const buf = this.buffer();\n if (buf.length !== 4340) {\n throw new Error('Can only checksum a save block');\n }\n\n // Exclude the existing checksum, then CRC the block\n const dbuf = new Buffer(4336);\n buf.copy(dbuf, 0, 4);\n this.set('checksum', ~crc.crc16ccitt(dbuf) & 0xFFFF);\n}", "function findErrHandler(error, result) {\n\tif (error) {\n\t\tlog(\"cannot find data\")\n\t\tthrow error\n\t} else {\n\t\tlog(result) \n\t}\n}", "function VeryBadError() {}", "static get ERROR () { return 0 }", "function serialError(err) {\n print('Something went wrong with the serial port. ' + err);\n}", "error() {}", "function processErrors(data){\n \n}", "function zzScanError(errorCode) {\n var message;\n try {\n message = ZZ_ERROR_MSG[errorCode];\n }\n catch (err) {\n message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR];\n }\n\n throw new Error(message);\n }", "onerror() {}", "onerror() {}", "function send_err(msg, input) {\n\t\t\tsendMsg({ msg: 'tx_error', e: msg, input: input });\n\t\t\tsendMsg({ msg: 'tx_step', state: 'committing_failed' });\n\t\t}", "function send_err(msg, input) {\n\t\t\tsendMsg({ msg: 'tx_error', e: msg, input: input });\n\t\t\tsendMsg({ msg: 'tx_step', state: 'committing_failed' });\n\t\t}", "function rispondi(result,cb){\n if(result!=\"err\"){\n cb(result);\n }\n else{\n cb(\"0\");\n }\n }", "function errorHandler(err) {\n\t$(\"#barcode-scan\").html(\"\")\n\t$(\"#barcode-scan\").html(\"<p>There was an error with your request:<br>\" + err + \"<br>Redirecting...</p>\")\n\t$('.checkout input[type=\"text\"]').val(\"\")\n\t$('.checkin input[type=\"text\"]').val(\"\")\n\t$(this).hide()\n\n\tsetTimeout(location.reload.bind(location), 3000)\n\n\t// Exits script\n\tthrow new Error(err)\n}", "async recover(command, err) {\n const {\n handler_id,\n } = command.data;\n\n await this.handleError(handler_id, err);\n\n return Command.retry();\n }", "function checksum(data) {\n\tvar result = 0;\n\n\tfor (var i = 0; i < 13; i++) {\n\t\tresult += parseInt(data[i]) * (3 - i % 2 * 2);\n\t}\n\n\treturn Math.ceil(result / 10) * 10 - result;\n}", "function croak(err) {\n throw new Error(`${err} (${line}:${col})`);\n }", "function OnErrorCallMaladie(jqXHR, status) {\n\t\t}", "function processFetchedError(done) {\n log.error(\"NO WIFI error display processedFetchedError()\");\n protoDisplayError();\n done(null);\n}", "function onDataReadFailure(errorCode)\n\t{\n\t\tconsole.log('Failed to synchronize leds with error: ' + errorCode);\n\t\tuser.app.disconnect();\n\t}", "function failureCB(){}", "function fallo() {\n return error(\"Reportar fallo\");\n}", "function OnErr() {\r\n}", "function err(strm, errorCode) {\n strm.msg = msg[errorCode];\n return errorCode;\n }", "onerror(err) {\n debug(\"error\", err);\n super.emit(\"error\", err);\n }", "function checksum(text) {\n var a = 1, b = 0;\n for (var index = 0; index < text.length; ++index) {\n a = (a + text.charCodeAt(index)) % 65521;\n b = (b + a) % 65521;\n }\n return (b << 16) | a;\n }", "isChecksumValid() {\n let checksum = 0;\n // Include load address and data.\n checksum += (this.loadAddress >> 8) & 0xFF;\n checksum += this.loadAddress & 0xFF;\n for (const b of this.data) {\n checksum += b;\n }\n checksum &= 0xFF;\n return checksum === this.checksum;\n }", "function checkUnsignedDigest () {\n // Read the digest content and check its header.\n trace('checking digest content header');\n const digestBuffer = fs.readFileSync(DIGEST_PATH);\n const digestContent = digestBuffer.toString('utf8').split('\\0', 1)[0];\n if (!digestContent.startsWith(DIGEST_CONTENT_HEADER)) {\n throw 'bad header in digest file: ' + DIGEST_PATH;\n }\n // TODO: Execute \"sha512sum -c\" or perform a compatible check.\n warn('TODO: check the digest content');\n}", "function CustomError() {}", "onError(task, err) {\n this.progress.updateAndStop();\n this.ftp.socket.setTimeout(this.ftp.timeout);\n this.ftp.dataSocket = undefined;\n task.reject(err);\n }", "function err(strm, errorCode) {\n strm.msg = msg[errorCode];\n return errorCode;\n }", "onError() {}", "function fileShareError(event) {\n // cleanup\n receiveBuffer = [];\n incomingFileData = [];\n receivedSize = 0;\n // error\n if (sendInProgress) {\n console.error(\"fileShareError\", event);\n alert(\"error: File Sharing \" + event.error);\n sendInProgress = false;\n }\n}", "function validateChecksum(emvString) {\n const emvData = emvString.substring(0, emvString.length - 4);\n const checksum = emvString.substring(emvString.length - 4);\n debug.log('emvData', emvData);\n debug.log('checksum', checksum);\n\n const expectedCRC = crc.computeCRC(emvData);\n return expectedCRC === checksum;\n}", "getAddressChecksumString () {\n return secUtil.toChecksumAddress(this.getAddressString())\n }", "function errox(id) {\n\tsw12u=id.substring(id.length-6,id.length-4)+id.substring(id.length-3,id.length-1);\n\tvar sw12x=sw12u.toUpperCase();\n\tmsg(\"debug\",\"sw12 = \"+sw12x+\" : \"+err[sw12x]);\t\n}", "function done ( error ) {\n if (error) {\n that.error = error\n }\n if ( cb ) cb( error )\n }", "function rispondi(risultato,cb){\n if(risultato!=\"err\"){\n cb(risultato);\n }\n else{\n cb(\"0\");\n }\n}", "function onPeerAgentFindError(errorCode) {\r\n\t\tconsole.log(\"Error code : \" + errorCode);\r\n\t}", "function err(strm, errorCode) {\n\t strm.msg = msg[errorCode];\n\t return errorCode;\n\t }", "function error (err) {\n if(error.err) return;\n callback(error.err = err);\n }", "function error(err) {\n if (error.err) return;\n callback((error.err = err));\n }", "function error(err) {\n if (error.err) return;\n callback((error.err = err));\n }", "function error(err) {\n if (error.err) return;\n callback((error.err = err));\n }", "function err(strm, errorCode) {\n strm.msg = msg[errorCode];\n return errorCode;\n }", "function rispondi(risultato,cb){\n\n \n if(risultato!=\"err\"){\n cb(risultato);\n }\n else{\n cb(\"0\");\n }\n}", "_getRpcErrorMessage(error) {\n if (error.data) {\n return error.data.message;\n }\n\n return error.message;\n }", "function transactionError(err) {\n return commandName === 'commitTransaction' ? err : null;\n }", "function transactionError(err) {\n return commandName === 'commitTransaction' ? err : null;\n }", "function deleteErrHandler(error, result) {\n\tif (error) {\n\t\tlog(\"cannot delete data\")\n\t\tthrow error\n\t} else {\n\t\tlog(\"Delete Success\") \n\t}\n}", "function unresumableError(err) {\n if (!callback) {\n changeStream.emit('error', err);\n changeStream.emit('close');\n }\n processResumeQueue(changeStream, err);\n changeStream.closed = true;\n }", "function checksum(s, type = 'i')\n{\n var chk = 0x5F378EA8;\n var len = s.length;\n for (var i = 0; i < len; i++) chk += (s.charCodeAt(i) * (i + 1));\n if(type === 's') return (chk & 0xffffffff).toString(16);\n else return (chk & 0xffffffff);\n}", "function handlerErroe(error){\r\n console.error(error.toString())\r\n this.emit('end');\r\n}", "function failureCB() { }", "function Ri(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "function errorHandler(transaction, error) {\n\talert('Error: ' + error.message + ' code: ' + error.code); \n}", "function err(strm, errorCode) {\n strm.msg = msg[errorCode];\n return errorCode;\n }", "function handleFundFailure(state, msg, ctx) {\n\tctx.debug.d(msg, `Fund failed`);\n\tconst {\n\t\ttask: { userId },\n\t\ttxResponse,\n\t} = state;\n\tthrow txResponse.error;\n\t//\tctx.receivers.update_task({ status: 'failed' }, txResponse.error);\n\t// return ctx.stop;\n}", "function errorHandler(transaction, error)\n{\n // error.message is a human-readable string.\n // error.code is a numeric error code\n alert('Oops. Error was '+error.message+' (Code '+error.code+')');\n \n // Handle errors here\n var we_think_this_error_is_fatal = true;\n if (we_think_this_error_is_fatal) return true;\n return false;\n}", "handleDeleteCartItemError(error) {\n // this.$emit('errorDelete'); can show flyout\n cartEventBus.$emit('cart-update-error');\n this.$refs.spinner.hideSpinner();\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 }", "dataError (error) {\n\t\treturn this.error('data', { reason: error, stack: error.stack });\n\t}", "onError(reason) {\n logger.debug(`Error: ${reason}`);\n store.dispatch(meetingActions.disconnectingFromMeeting());\n let pinError = reason ? reason.indexOf('PIN') !== -1 : false;\n let capacityError = reason ? reason.indexOf('resource') !== -1 : false;\n let error = pinError !== false ? 'pin-error' : capacityError !== false ? \"capacity-error\" : null;\n this.finalise(error);\n }", "function failFileRestoreRing(error) {\n\tvar restorefavringsfailed = $.t('restorefavringsfailed');\n\twindow.ringRestoreFailed = true;\n\tconsole.error(\"PhoneGap Plugin: FileSystem: Message: Restore - file does not exists, isn't writeable or isn't readable. Error code: \" + error.code);\n\tbuttonStateBackRest(\"enable\");\n\ttoast(restorefavringsfailed, 'short');\n}", "function error(err) {\n\t deferred.reject(err.message);\n\t}", "errorProc(payload) {\r\n this.lm('Bad command sent. Stopping.');\r\n\r\n payload.status = 'what?';\r\n payload.error = 'No such command';\r\n\r\n return payload;\r\n }", "function err(strm, errorCode) {\n\t strm.msg = msg[errorCode];\n\t return errorCode;\n\t}", "function err(strm, errorCode) {\n\t strm.msg = msg[errorCode];\n\t return errorCode;\n\t}", "function err(strm, errorCode) {\n\t strm.msg = msg[errorCode];\n\t return errorCode;\n\t}", "function err(strm, errorCode) {\n\t strm.msg = msg[errorCode];\n\t return errorCode;\n\t}", "function err(strm, errorCode) {\n\t strm.msg = msg[errorCode];\n\t return errorCode;\n\t}", "function err(strm, errorCode) {\n\t strm.msg = msg[errorCode];\n\t return errorCode;\n\t}", "function err(strm, errorCode) {\n\t strm.msg = msg[errorCode];\n\t return errorCode;\n\t}", "function onRead( error, actual ) {\n\t\t\texpect( error ).to.not.exist;\n\t\t\tassert.deepEqual( actual[ 0 ], SUM );\n\t\t\tdone();\n\t\t}", "function onRead( error, actual ) {\n\t\t\texpect( error ).to.not.exist;\n\t\t\tassert.deepEqual( actual[ 0 ], SUM );\n\t\t\tdone();\n\t\t}", "function errorHand(data) {\n console.log(data.toString());\n this.emit('end');\n}", "function fsErr(err) {\n if (typeof err === \"object\" && \"errno\" in err)\n return -err.errno;\n return -JSMIPS.ENOTSUP;\n}", "function onFileSystemFail(err) {\n console.log('deleteFileFromPersistentStorage file system fail: ' + fileName);\n console.log('error code = ' + err.code);\n }", "function fetchError(error) {\n\t\t\tself.isWaiting = false;\n\t\t\tself.isTransmitWaiting = false;\n\t\t\tif (error && error.data) {\n\t\t\t\tif(error.data.message) {\n\t\t\t\t\tsetError(error.data.message);\n\t\t\t\t} else {\n\t\t\t\t\tsetError(error.data.error);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tsetError(\"An unknown error occurred.\");\n\t\t\t}\n\t\t}", "function errorDownloadingData(error) {\n\tshowDialog(\"Error downloading Data from Server\", \"There was an error downloading data from the server. Check the stack below.<br>\" + error.message);\n}", "function err(msg)\n {\n debug(\"PROXY ERROR\", msg);\n packet.stream.send({end:true, res:{\"s\":500}}, msg.toString());\n }", "assetFailed (_err, _name) {\n this.assetCount++\n this.pct = this.assetCount / this.assetTotal\n if (this.assetCount === this.assetTotal) {\n this.complete()\n }\n }", "function generateFailureMessage(msg, sentStr, receivedStr, sentChecksum, receivedChecksum) {\n return(\n `\n =========================\n ${msg} DETECTED\n input: ${sentStr} : ${sentChecksum}\n corrupted: ${receivedStr} : ${receivedChecksum}\n `);\n}" ]
[ "0.6060786", "0.58355683", "0.57289815", "0.5688048", "0.5679692", "0.5659649", "0.5659649", "0.56430244", "0.5633417", "0.56287223", "0.5615648", "0.5584703", "0.55632716", "0.5562714", "0.55573773", "0.5553348", "0.55457026", "0.55332917", "0.55122864", "0.5490127", "0.5476699", "0.5454235", "0.5448101", "0.54376626", "0.5409193", "0.5397953", "0.5397953", "0.5395756", "0.5395756", "0.53847945", "0.5381613", "0.53726155", "0.5363837", "0.53265744", "0.531343", "0.5304267", "0.53032494", "0.5295113", "0.5292002", "0.52844036", "0.5281367", "0.526682", "0.5260132", "0.5257769", "0.5254736", "0.52527446", "0.524821", "0.52379435", "0.52301675", "0.52273405", "0.52234316", "0.5223293", "0.5222797", "0.5222166", "0.52136624", "0.5207422", "0.5207405", "0.52045673", "0.5204431", "0.5204431", "0.5204431", "0.5204393", "0.5200822", "0.52007955", "0.51996976", "0.51996976", "0.519758", "0.51919436", "0.51842195", "0.5172717", "0.5170918", "0.5167021", "0.51653534", "0.51642334", "0.5160792", "0.5156329", "0.5153701", "0.51507574", "0.51507574", "0.5149598", "0.5149054", "0.51462793", "0.5138716", "0.51385385", "0.51383114", "0.51383114", "0.51383114", "0.51383114", "0.51383114", "0.51383114", "0.51383114", "0.51365954", "0.51365954", "0.5136396", "0.5136262", "0.51329607", "0.51311105", "0.5130662", "0.5129411", "0.512415", "0.51203215" ]
0.0
-1
Called to handle a received, validated PDU.
onReceive( pdu ) { // We push it to the Transform object, which spits it out // the Readable side of the stream as a 'data' event this.push( Buffer.from( pdu.slice(3, pdu.length-1 ))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_transform(chunk, encoding, cb) {\n\n var me = this;\n //console.log('Chunk: ', chunk );\n\n // Concatenate any previous data, and split into an array of\n // encoded PDUs that start with a MSG_START byte\n let encodedPdus = this.splitBuffer( Buffer.concat([this.buffer, chunk]) );\n\n // Now we look through each of the encoded PDUs (which have not\n // yet been validated for length or checksum)\n encodedPdus.forEach( function( encodedPdu, pduIndex ){\n\n // Unstuff the PDU (remove escape codes)\n let pdu = me.decodePdu( encodedPdu );\n\n if( pdu.length >= MIN_MSG_LEN ) {\n\n // it is at least long enough to possibly be complete\n let msgLength = pdu[1]*256 + pdu[2];\n\n // If it's too long, truncate it. This shouldn't really happen\n // under normal circumstances, but no reason to keep extra bytes around.\n if(pdu.length + 3 > msgLength ) {\n pdu = pdu.slice(0, msgLength+3 );\n }\n\n // If it (now) has the expected number of bytes...\n if( msgLength === pdu.length-3 ) {\n\n // check the checksum\n let checksum = me.checksum( pdu, 1, msgLength +1 );\n\n if( checksum === pdu[ msgLength+2 ] ) {\n // Process the received PDU\n me.onReceive( pdu );\n }\n else {\n // report an incorrect checksum\n me.onReceiveError( pdu );\n } \n }\n else if( pduIndex === encodedPdu.length-1 ) {\n // if last PDU is incomplete, save it for later\n me.buffer = Buffer.from( encodedPdu );\n }\n\n }\n else if( pduIndex === encodedPdu.length-1 ) {\n // if last PDU is incomplete, save it for later\n me.buffer = Buffer.from( encodedPdu );\n }\n\n });\n\n // notify the caller that we are done processing the chunk\n cb();\n }", "function parseIncomingMessage (evt) {\n\n\t// get the notify_resp_type\n\n\t// parse evt.data\n\n\tvar blobReader = new FileReader();\n\tblobReader.onload = function() {\n\t\tvar dv = new DataView(this.result);\n\t\tvar indata = new Uint8Array(this.result);\n\t\tvar notify_resp_type = dv.getUint32(0,true);\n\n\t\tvar msgHeader = new MsgHeader();\n\t\tmsgHeader.Read(dv, 0);\n\n\t\tvar cardchar = \"\";\n\t\tvar cardcharPeer = \"\";\n\t\tvar errorMsg = \"\";\n\t\tvar PUIDindex = \"\";\n\t\tvar percentage = 0;\n\n\t\t// determine what action to take for this response or notification\n\t\tswitch ( msgHeader.dwCommand ) {\n\n\t\t\tcase JS_VERSION_NEG_RES:\n\t\t\t\tconsole.log(\"get VERSION_NEG_RES!\");\n\t\t\t\t//Read data and save it in \"versionNegRes\"\n\t\t\t\tvar versionNegRes = new VersionNegotiationRes();\n\t\t\t\tversionNegRes.Read(dv, MsgHeader.Size);\n\n\n\n\t\t\t\t//Update on Web Interface\n\t\t\t\tif (versionNegRes.dwStatusCode == 0x00) {\n\n\t\t\t\t} else {\n\t\t\t\t\t//alert(\"Negotiation failed!\");\n\t\t\t\t\t$(\"#VNErrorMsg\").effect(\"pulsate\",{times:3},3000);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase JS_SPACE_AVAIL_NOTIFY:\n\t\t\t\tconsole.log(\"get JS_SPACE_AVAIL_NOTIFY!\");\n\t\t\t\t//Read data and save it in \"spaceAvailableNoti\"\n\t\t\t\tvar spaceAvailableNoti = new SpaceAvailableNotification();\n\t\t\t\tspaceAvailableNoti.Read(dv, MsgHeader.Size);\n\n\t\t\t\t//Update on Web Interface\n\t\t\t\tif (spaceAvailableNoti.cbyTotalFreeSpaceCombined >= Math.pow(2,30)) {\n\t\t\t\t\t$(\".TotalFreeSpace\").html(\" \"+(spaceAvailableNoti.cbyTotalFreeSpaceCombined/Math.pow(2,30)).toFixed(2)+\" \");\n\t\t\t\t\t$(\".TotalFreeUnit\").html(\"&nbsp;GB\");\n\t\t\t\t}else if (spaceAvailableNoti.cbyTotalFreeSpaceCombined >= Math.pow(2,20)) {\n\t\t\t\t\t$(\".TotalFreeSpace\").html(\" \"+(spaceAvailableNoti.cbyTotalFreeSpaceCombined/Math.pow(2,20)).toFixed(2)+\" \");\n\t\t\t\t\t$(\".TotalFreeUnit\").html(\"&nbsp;MB\");\n\t\t\t\t} else if (spaceAvailableNoti.cbyTotalFreeSpaceCombined >= Math.pow(2,10)) {\n\t\t\t\t\t$(\".TotalFreeSpace\").html(\" \"+(spaceAvailableNoti.cbyTotalFreeSpaceCombined/Math.pow(2,10)).toFixed(2)+\" \");\n\t\t\t\t\t$(\".TotalFreeUnit\").html(\"&nbsp;KB\");\n\t\t\t\t} else if (spaceAvailableNoti.cbyTotalFreeSpaceCombined >= 0) {\n\t\t\t\t\t$(\".TotalFreeSpace\").html(\" \"+(spaceAvailableNoti.cbyTotalFreeSpaceCombined).toFixed(2)+\" \");\n\t\t\t\t\t$(\".TotalFreeUnit\").html(\"&nbsp;B\");\n\t\t\t\t}\n\n\t\t\t\tif (spaceAvailableNoti.cbyTotalFreeSpaceOnCardA >= Math.pow(2,30)) {\n\t\t\t\t\t$(\"#totalFreeA\").html(\" \"+(spaceAvailableNoti.cbyTotalFreeSpaceOnCardA/Math.pow(2,30)).toFixed(2)+\" \");\n\t\t\t\t\t$(\"#totalFreeAUnit\").html(\"&nbsp;GB\");\n\t\t\t\t}else if (spaceAvailableNoti.cbyTotalFreeSpaceOnCardA >= Math.pow(2,20)) {\n\t\t\t\t\t$(\"#totalFreeA\").html(\" \"+(spaceAvailableNoti.cbyTotalFreeSpaceOnCardA/Math.pow(2,20)).toFixed(2)+\" \");\n\t\t\t\t\t$(\"#totalFreeAUnit\").html(\"&nbsp;MB\");\n\t\t\t\t} else if (spaceAvailableNoti.cbyTotalFreeSpaceOnCardA >= Math.pow(2,10)) {\n\t\t\t\t\t$(\"#totalFreeA\").html(\" \"+(spaceAvailableNoti.cbyTotalFreeSpaceOnCardA/Math.pow(2,10)).toFixed(2)+\" \");\n\t\t\t\t\t$(\"#totalFreeAUnit\").html(\"&nbsp;KB\");\n\t\t\t\t} else if (spaceAvailableNoti.cbyTotalFreeSpaceOnCardA >= 0) {\n\t\t\t\t\t$(\"#totalFreeA\").html(\" \"+(spaceAvailableNoti.cbyTotalFreeSpaceOnCardA).toFixed(2)+\" \");\n\t\t\t\t\t$(\"#totalFreeAUnit\").html(\"&nbsp;B\");\n\t\t\t\t}\n\n\t\t\t\tif (spaceAvailableNoti.cbyTotalFreeSpaceOnCardB >= Math.pow(2,30)) {\n\t\t\t\t\t$(\"#totalFreeB\").html(\" \"+(spaceAvailableNoti.cbyTotalFreeSpaceOnCardB/Math.pow(2,30)).toFixed(2)+\" \");\n\t\t\t\t\t$(\"#totalFreeBUnit\").html(\"&nbsp;GB\");\n\t\t\t\t}else if (spaceAvailableNoti.cbyTotalFreeSpaceOnCardB >= Math.pow(2,20)) {\n\t\t\t\t\t$(\"#totalFreeB\").html(\" \"+(spaceAvailableNoti.cbyTotalFreeSpaceOnCardB/Math.pow(2,20)).toFixed(2)+\" \");\n\t\t\t\t\t$(\"#totalFreeBUnit\").html(\"&nbsp;MB\");\n\t\t\t\t} else if (spaceAvailableNoti.cbyTotalFreeSpaceOnCardB >= Math.pow(2,10)) {\n\t\t\t\t\t$(\"#totalFreeB\").html(\" \"+(spaceAvailableNoti.cbyTotalFreeSpaceOnCardB/Math.pow(2,10)).toFixed(2)+\" \");\n\t\t\t\t\t$(\"#totalFreeBUnit\").html(\"&nbsp;KB\");\n\t\t\t\t} else if (spaceAvailableNoti.cbyTotalFreeSpaceOnCardB >= 0) {\n\t\t\t\t\t$(\"#totalFreeB\").html(\" \"+(spaceAvailableNoti.cbyTotalFreeSpaceOnCardB).toFixed(2)+\" \");\n\t\t\t\t\t$(\"#totalFreeBUnit\").html(\"&nbsp;B\");\n\t\t\t\t}\n\n\t\t\t\tif (spaceAvailableNoti.cbyLargestJBODSpaceOnCardA >= Math.pow(2,30)) {\n\t\t\t\t\t$(\"#possibleJBODA\").html(\" \"+(spaceAvailableNoti.cbyLargestJBODSpaceOnCardA/Math.pow(2,30)).toFixed(2)+\" \");\n\t\t\t\t\t$(\"#possibleJBODAUnit\").html(\"&nbsp;GB\");\n\t\t\t\t}else if (spaceAvailableNoti.cbyLargestJBODSpaceOnCardA >= Math.pow(2,20)) {\n\t\t\t\t\t$(\"#possibleJBODA\").html(\" \"+(spaceAvailableNoti.cbyLargestJBODSpaceOnCardA/Math.pow(2,20)).toFixed(2)+\" \");\n\t\t\t\t\t$(\"#possibleJBODAUnit\").html(\"&nbsp;MB\");\n\t\t\t\t} else if (spaceAvailableNoti.cbyLargestJBODSpaceOnCardA >= Math.pow(2,10)) {\n\t\t\t\t\t$(\"#possibleJBODA\").html(\" \"+(spaceAvailableNoti.cbyLargestJBODSpaceOnCardA/Math.pow(2,10)).toFixed(2)+\" \");\n\t\t\t\t\t$(\"#possibleJBODAUnit\").html(\"&nbsp;KB\");\n\t\t\t\t} else if (spaceAvailableNoti.cbyLargestJBODSpaceOnCardA >= 0) {\n\t\t\t\t\t$(\"#possibleJBODA\").html(\" \"+(spaceAvailableNoti.cbyLargestJBODSpaceOnCardA).toFixed(2)+\" \");\n\t\t\t\t\t$(\"#possibleJBODAUnit\").html(\"&nbsp;B\");\n\t\t\t\t}\n\n\t\t\t\tif (spaceAvailableNoti.cbyLargestJBODSpaceOnCardB >= Math.pow(2,30)) {\n\t\t\t\t\t$(\"#possibleJBODB\").html(\" \"+(spaceAvailableNoti.cbyLargestJBODSpaceOnCardB/Math.pow(2,30)).toFixed(2)+\" \");\n\t\t\t\t\t$(\"#possibleJBODBUnit\").html(\"&nbsp;GB\");\n\t\t\t\t}else if (spaceAvailableNoti.cbyLargestJBODSpaceOnCardB >= Math.pow(2,20)) {\n\t\t\t\t\t$(\"#possibleJBODB\").html(\" \"+(spaceAvailableNoti.cbyLargestJBODSpaceOnCardB/Math.pow(2,20)).toFixed(2)+\" \");\n\t\t\t\t\t$(\"#possibleJBODBUnit\").html(\"&nbsp;MB\");\n\t\t\t\t} else if (spaceAvailableNoti.cbyLargestJBODSpaceOnCardB >= Math.pow(2,10)) {\n\t\t\t\t\t$(\"#possibleJBODB\").html(\" \"+(spaceAvailableNoti.cbyLargestJBODSpaceOnCardB/Math.pow(2,10)).toFixed(2)+\" \");\n\t\t\t\t\t$(\"#possibleJBODBUnit\").html(\"&nbsp;KB\");\n\t\t\t\t} else if (spaceAvailableNoti.cbyLargestJBODSpaceOnCardB >= 0) {\n\t\t\t\t\t$(\"#possibleJBODB\").html(\" \"+(spaceAvailableNoti.cbyLargestJBODSpaceOnCardB).toFixed(2)+\" \");\n\t\t\t\t\t$(\"#possibleJBODBUnit\").html(\"&nbsp;B\");\n\t\t\t\t}\n\n\t\t\t\tif (spaceAvailableNoti.cbyLargestStripeSpaceOnCard >= Math.pow(2,30)) {\n\t\t\t\t\t$(\".PossibleStripeSpace\").html(\" \"+(spaceAvailableNoti.cbyLargestStripeSpaceOnCard/Math.pow(2,30)).toFixed(2)+\" \");\n\t\t\t\t\t$(\".PossibleStripeUnit\").html(\"&nbsp;GB\");\n\t\t\t\t}else if (spaceAvailableNoti.cbyLargestStripeSpaceOnCard >= Math.pow(2,20)) {\n\t\t\t\t\t$(\".PossibleStripeSpace\").html(\" \"+(spaceAvailableNoti.cbyLargestStripeSpaceOnCard/Math.pow(2,20)).toFixed(2)+\" \");\n\t\t\t\t\t$(\".PossibleStripeUnit\").html(\"&nbsp;MB\");\n\t\t\t\t} else if (spaceAvailableNoti.cbyLargestStripeSpaceOnCard >= Math.pow(2,10)) {\n\t\t\t\t\t$(\".PossibleStripeSpace\").html(\" \"+(spaceAvailableNoti.cbyLargestStripeSpaceOnCard/Math.pow(2,10)).toFixed(2)+\" \");\n\t\t\t\t\t$(\".PossibleStripeUnit\").html(\"&nbsp;KB\");\n\t\t\t\t} else if (spaceAvailableNoti.cbyLargestStripeSpaceOnCard >= 0) {\n\t\t\t\t\t$(\".PossibleStripeSpace\").html(\" \"+(spaceAvailableNoti.cbyLargestStripeSpaceOnCard).toFixed(2)+\" \");\n\t\t\t\t\t$(\".PossibleStripeUnit\").html(\"&nbsp;B\");\n\t\t\t\t}\n\n\t\t\t\tif (spaceAvailableNoti.cbyLargestMirrorSpaceOnCard >= Math.pow(2,30)) {\n\t\t\t\t\t$(\".PossibleMirrorSpace\").html(\" \"+(spaceAvailableNoti.cbyLargestMirrorSpaceOnCard/Math.pow(2,30)).toFixed(2)+\" \");\n\t\t\t\t\t$(\".PossibleMirrorUnit\").html(\"&nbsp;GB\");\n\t\t\t\t}else if (spaceAvailableNoti.cbyLargestMirrorSpaceOnCard >= Math.pow(2,20)) {\n\t\t\t\t\t$(\".PossibleMirrorSpace\").html(\" \"+(spaceAvailableNoti.cbyLargestMirrorSpaceOnCard/Math.pow(2,20)).toFixed(2)+\" \");\n\t\t\t\t\t$(\".PossibleMirrorUnit\").html(\"&nbsp;MB\");\n\t\t\t\t} else if (spaceAvailableNoti.cbyLargestMirrorSpaceOnCard >= Math.pow(2,10)) {\n\t\t\t\t\t$(\".PossibleMirrorSpace\").html(\" \"+(spaceAvailableNoti.cbyLargestMirrorSpaceOnCard/Math.pow(2,10)).toFixed(2)+\" \");\n\t\t\t\t\t$(\".PossibleMirrorUnit\").html(\"&nbsp;KB\");\n\t\t\t\t} else if (spaceAvailableNoti.cbyLargestMirrorSpaceOnCard >= 0) {\n\t\t\t\t\t$(\".PossibleMirrorSpace\").html(\" \"+(spaceAvailableNoti.cbyLargestMirrorSpaceOnCard).toFixed(2)+\" \");\n\t\t\t\t\t$(\".PossibleMirrorUnit\").html(\"&nbsp;B\");\n\t\t\t\t}\n\n\t\t\t\t//update piechart\n\t\t\t\tvar totalA = parseInt($(\"#cardSizeA\").html());\n\t\t\t\tif (totalA > 0) {\n\t\t\t\t\tvar freeA = (100*spaceAvailableNoti.cbyTotalFreeSpaceOnCardA/totalA).toFixed(2);\n\t\t\t\t\tvar usedA = (100 - freeA).toFixed(2);\n\t\t\t\t\tLoadPieCharts(\"A\", usedA, freeA);\n\t\t\t\t}\n\n\n\t\t\t\tvar totalB = parseInt($(\"#cardSizeB\").html());\n\t\t\t\tif (totalB > 0) {\n\t\t\t\t\tvar freeB = (100*spaceAvailableNoti.cbyTotalFreeSpaceOnCardB/totalB).toFixed(2);\n\t\t\t\t\tvar usedB = (100 - freeB).toFixed(2);\n\t\t\t\t\tLoadPieCharts(\"B\", usedB, freeB);\n\t\t\t\t}\n\n\t\t\t\t//clear previous input value of partition size\n\t\t\t\t$(\"#PartitionSizeA\").val(\"\");\n\t\t\t\t$(\"#PartitionSizeB\").val(\"\");\n\n\t\t\t\t//hide error messages of new partition size\n\t\t\t\t$(\"#volumeSizeErrorMsgA\").hide();\n\t\t\t\t$(\"#volumeSizeErrorMsgB\").hide();\n\t\t\t\t//clear error messages of previous partition activity\n\t\t\t\tdocument.getElementById(\"definePartErrorMsgA\").innerHTML = \"\";\n\t\t\t\tdocument.getElementById(\"definePartErrorMsgB\").innerHTML = \"\";\n\n\t\t\t\tbreak;\n\n\t\t\tcase JS_PART_LIST_UPDATED_NOTIFY:\n\t\t\t\tconsole.log(\"get PART_LIST_UPDATED_NOTIFY!\");\n\t\t\t\t//Read data and save it in \"partListUpdateNoti\"\n\t\t\t\tvar partListUpdateNoti = new PartitionListUpdatedNotification();\n\t\t\t\tpartListUpdateNoti.Read(dv, indata);\n\n\t\t\t\t//console.log(\"cPartitions:\"+partListUpdateNoti.cPartitions);\n\t\t\t\t//Update on Web Interface\n\t\t\t\tvar GUIDA = $(\"#GUIDA\").html();\n\t\t\t\tvar GUIDB = $(\"#GUIDB\").html();\n\n\t\t\t\tvar PartInfoEntry = partListUpdateNoti.pie;\n\n\t\t\t\t//console.log(\"partitionNum:\"+partListUpdateNoti.cPartitions);\n\n\t\t\t\tif (partListUpdateNoti.cPartitions == 0) {\n\n\t\t\t\t\t//accordionVolume();\n\t\t\t\t\t$(\"#CardAPartitionList\").html(\"\");\n\t\t\t\t\t$(\"#CardBPartitionList\").html(\"\");\n\n\t\t\t\t} else {\n\n\t\t\t\t\tvar BstartIndex = partListUpdateNoti.cPartitions;\n\t\t\t\t\tfor (var i=0;i<partListUpdateNoti.cPartitions;i++) {\n\t\t\t\t\t\tif (PartInfoEntry[i].owGUID == GUIDB) {\n\t\t\t\t\t\t\tBstartIndex = i;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$(\"#PartitionNumA\").html(BstartIndex - 0);\n\t\t\t\t\t$(\"#PartitionNumB\").html(partListUpdateNoti.cPartitions - BstartIndex);\n\n\t\t\t\t\tgeneratePartitionEntries ( PartInfoEntry, 0, BstartIndex, 'CardAPartitionList' );\n\t\t\t\t\tgeneratePartitionEntries ( PartInfoEntry, BstartIndex, partListUpdateNoti.cPartitions, 'CardBPartitionList' );\n\t\t\t\t\t/*if (PartInfoEntry[0].owGUID == GUIDA) {\n\t\t\t\t\t\tPartitionNumA = partListUpdateNoti.cPartitions;\n\t\t\t\t\t\tgeneratePartitionEntries ( PartInfoEntry, partListUpdateNoti.cPartitions, 'CardAPartitionList' );\n\t\t\t\t\t} else if (PartInfoEntry[0].owGUID == GUIDB) {\n\t\t\t\t\t\tPartitionNumB = partListUpdateNoti.cPartitions;\n\t\t\t\t\t\tgeneratePartitionEntries ( PartInfoEntry, partListUpdateNoti.cPartitions, 'CardBPartitionList' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//GUID not recognized\n\t\t\t\t\t\tconsole.log(\"Unrecognized GUID in pie!\");\n\t\t\t\t\t}*/\n\n\t\t\t\t\taccordionVolume();\n\t\t\t\t\tsetDragArrowJBOD();\n\t\t\t\t\tsetDragArrowMirror();\n\t\t\t\t\tsetDragArrowStripe();\n\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase JS_PROG_REPORT_NOTIFY:\n\t\t\t\tconsole.log(\"get JS_PROG_REPORT_NOTIFY!\");\n\t\t\t\t//Read data and save it in \"progReportNoti\"\n\t\t\t\tvar progReportNoti = new ProgressReportNotification();\n\t\t\t\tprogReportNoti.Read(dv, MsgHeader.Size);\n\t\t\t\t//console.log(\"progReportNoti.dwCommand:\"+progReportNoti.dwCommand);\n\t\t\t\t//Update on Web Interface\n\n\t\t\t\tif (progReportNoti.owGUID == $(\"#GUIDA\").html()) {\n\t\t\t\t\tcardchar = \"A\";\n\t\t\t\t\tcardcharPeer = \"B\";\n\t\t\t\t} else if (progReportNoti.owGUID == $(\"#GUIDB\").html()) {\n\t\t\t\t\tcardchar = \"B\";\n\t\t\t\t\tcardcharPeer = \"A\";\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log(\"Wrong GUID in PROG_REPORT_NOTIFY!\");\n\t\t\t\t\tconsole.log(\"GUID:\"+progReportNoti.owGUID);\n\t\t\t\t}\n\n\t\t\t\tif (progReportNoti.dwErrorCode == 0) {\n\t\t\t\t\t//error code is 0\n\t\t\t\t\tconsole.log(progReportNoti.dwTotalStepsCompleted+\":\"+progReportNoti.dwTotalStepsRequired);\n\t\t\t\t\t//clear error message for\n\t\t\t\t\t//document.getElementById(\"CardError\"+cardchar).innerHTML = \"\";\n\t\t\t\t\t//clearCardErrorMsg(cardchar);\n\t\t\t\t\t//display card progress bar\n\t\t\t\t\tif (document.getElementById(\"cardProgArea\"+cardchar).style.display == \"none\" && (progReportNoti.dwTotalStepsCompleted<progReportNoti.dwTotalStepsRequired)) {\n\t\t\t\t\t\tshowCardProg(cardchar);\n\t\t\t\t\t}\n\n\t\t\t\t\tpercentage = 100*progReportNoti.dwTotalStepsCompleted/progReportNoti.dwTotalStepsRequired;\n\n\t\t\t\t\tswitch(progReportNoti.dwCommand) {\n\t\t\t\t\t\tcase JS_WIPE_MEDIA_REQ:\n\n\t\t\t\t\t\t\t$(\"#WipeErrorMark\"+cardchar).fadeTo(0,0);\n\t\t\t\t\t\t\t$(\"#WipeErrorMark\"+cardchar).prop(\"title\",\"\");\n\t\t\t\t\t\t\t$(\"#CardError\" + cardchar + \"WIPE\").html(\"\");\n\t\t\t\t\t\t\t$(\"#cardProg\"+cardchar).html(\"Wiping \"+percentage.toFixed(2).slice(0,-3)+\"%\");\n\t\t\t\t\t\t\t$(\"#cardProgCmd\"+cardchar).html(JS_WIPE_MEDIA_REQ);\n\n\t\t\t\t\t\t\tif (progReportNoti.dwTotalStepsCompleted < progReportNoti.dwTotalStepsRequired) {\n\n\t\t\t\t\t\t\t\t$(\"#cardProg\"+cardchar).width(percentage+\"%\");\n\t\t\t\t\t\t\t\t$(\"#BtnWipe\"+cardchar).prop(\"disabled\", true);\n\n\t\t\t\t\t\t\t} else if (progReportNoti.dwTotalStepsCompleted == progReportNoti.dwTotalStepsRequired) {\n\n\t\t\t\t\t\t\t\t$(\"#cardProgArea\"+cardchar).hide();\n\t\t\t\t\t\t\t\t$(\"#cardProg\"+cardchar).width(\"0%\");\n\t\t\t\t\t\t\t\t$(\"#cardProg\"+cardchar).html(\"\");\n\t\t\t\t\t\t\t\t$(\"#cardProgCmd\"+cardchar).html(\"\");\n\t\t\t\t\t\t\t\t$(\"#BtnWipe\"+cardchar).prop(\"disabled\", false);\n\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t//steps field not correct\n\t\t\t\t\t\t\t\tconsole.log(\"JS_PROG_REPORT_NOTIFY ERROR: dwTotalStepsCompleted > dwTotalStepsRequired\");\n\t\t\t\t\t\t\t\t$(\"#BtnWipe\"+cardchar).prop(\"disabled\", false);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase JS_DEFRAG_REQ:\n\n\t\t\t\t\t\t\t$(\"#DefragErrorMark\"+cardchar).fadeTo(0,0);\n\t\t\t\t\t\t\t$(\"#DefragErrorMark\"+cardchar).prop(\"title\",\"\");\n\t\t\t\t\t\t\t$(\"#CardError\" + cardchar + \"DEFRAG\").html(\"\");\n\t\t\t\t\t\t\t$(\"#cardProg\"+cardchar).html(\"Defragging \"+percentage.toFixed(2).slice(0,-3)+\"%\");\n\t\t\t\t\t\t\t$(\"#cardProgCmd\"+cardchar).html(JS_DEFRAG_REQ);\n\n\t\t\t\t\t\t\tif (progReportNoti.dwTotalStepsCompleted < progReportNoti.dwTotalStepsRequired) {\n\n\t\t\t\t\t\t\t\t$(\"#cardProg\"+cardchar).width(percentage+\"%\");\n\t\t\t\t\t\t\t\t$(\"#BtnDefrag\"+cardchar).prop(\"disabled\", true);\n\n\t\t\t\t\t\t\t} else if (progReportNoti.dwTotalStepsCompleted == progReportNoti.dwTotalStepsRequired) {\n\n\t\t\t\t\t\t\t\t$(\"#cardProgArea\"+cardchar).hide();\n\t\t\t\t\t\t\t\t$(\"#cardProg\"+cardchar).width(\"0%\");\n\t\t\t\t\t\t\t\t$(\"#cardProg\"+cardchar).html(\"\");\n\t\t\t\t\t\t\t\t$(\"#cardProgCmd\"+cardchar).html(\"\");\n\t\t\t\t\t\t\t\t$(\"#BtnDefrag\"+cardchar).prop(\"disabled\", false);\n\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t//steps field not correct\n\t\t\t\t\t\t\t\t$(\"#BtnDefrag\"+cardchar).prop(\"disabled\", false);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase JS_CONVERT_RAID_TYPE_REQ:\n\n\t\t\t\t\t\t\t$(\"#ConvertErrorMark\"+cardchar).hide();\n\t\t\t\t\t\t\t$(\"#ConvertErrorMark\"+cardchar).prop(\"title\",\"\");\n\t\t\t\t\t\t\t$(\"#CardError\" + cardchar + \"CVT\").html(\"\");\n\t\t\t\t\t\t\t$(\"#cardProg\"+cardchar).html(\"Converting \"+percentage.toFixed(2).slice(0,-3)+\"%\");\n\t\t\t\t\t\t\t$(\"#cardProgCmd\"+cardchar).html(JS_CONVERT_RAID_TYPE_REQ);\n\n\t\t\t\t\t\t\tif (progReportNoti.dwTotalStepsCompleted < progReportNoti.dwTotalStepsRequired) {\n\t\t\t\t\t\t\t\tif ($(\"#RAIDTypeStr\"+cardchar).html() == \"Mirror\") {\n\t\t\t\t\t\t\t\t\t$(\"#cardProg\"+cardchar).width(percentage+\"%\");\n\t\t\t\t\t\t\t\t} else if ($(\"#RAIDTypeStr\"+cardchar).html() == \"JBOD\") {\n\t\t\t\t\t\t\t\t\t$(\"#cardProg\"+cardchar).width(percentage+\"%\");\n\t\t\t\t\t\t\t\t\t$(\"#cardProg\"+cardcharPeer).html(\"Converting \"+percentage.toFixed(2).slice(0,-3));\n\t\t\t\t\t\t\t\t\t$(\"#cardProgCmd\"+cardcharPeer).html(JS_CONVERT_RAID_TYPE_REQ);\n\t\t\t\t\t\t\t\t\t$(\"#cardProg\"+cardcharPeer).width(percentage+\"%\");\n\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (progReportNoti.dwTotalStepsCompleted == progReportNoti.dwTotalStepsRequired) {\n\t\t\t\t\t\t\t\tif ($(\"#RAIDTypeStr\"+cardchar).html() == \"Mirror\") {\n\t\t\t\t\t\t\t\t\t$(\"#cardProgArea\"+cardchar).hide();\n\t\t\t\t\t\t\t\t\t$(\"#cardProg\"+cardchar).width(\"0%\");\n\t\t\t\t\t\t\t\t\t$(\"#cardProg\"+cardchar).html(\"\");\n\t\t\t\t\t\t\t\t\t$(\"#cardProgCmd\"+cardchar).html(\"\");\n\t\t\t\t\t\t\t\t} else if ($(\"#RAIDTypeStr\"+cardchar).html() == \"JBOD\") {\n\t\t\t\t\t\t\t\t\t$(\"#cardProgArea\"+cardchar).hide();\n\t\t\t\t\t\t\t\t\t$(\"#cardProgArea\"+cardcharPeer).hide();\n\t\t\t\t\t\t\t\t\t$(\"#cardProg\"+cardchar).width(\"0%\");\n\t\t\t\t\t\t\t\t\t$(\"#cardProg\"+cardcharPeer).width(\"0%\");\n\t\t\t\t\t\t\t\t\t$(\"#cardProg\"+cardchar).html(\"\");\n\t\t\t\t\t\t\t\t\t$(\"#cardProgCmd\"+cardchar).html(\"\");\n\t\t\t\t\t\t\t\t\t$(\"#cardProg\"+cardcharPeer).html(\"\");\n\t\t\t\t\t\t\t\t\t$(\"#cardProgCmd\"+cardcharPeer).html(\"\");\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t//unknow RAID type\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//hide \"convert\" button\n\t\t\t\t\t\t\t\t$(\"#confirmConvertRAIDType\"+cardchar).hide();\n\t\t\t\t\t\t\t\t$(\"#confirmConvertRAIDType\"+cardchar).prop(\"disabled\", false);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t//steps field is not correct\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase JS_SYNC_MIRROR_REQ:\n\n\t\t\t\t\t\t\t$(\"#CardError\" + cardchar + \"SYNC\").html(\"\");\n\t\t\t\t\t\t\t$(\"#cardProg\"+cardchar).html(\"Syncing \"+percentage.toFixed(2).slice(0,-3)+\"%\");\n\t\t\t\t\t\t\t$(\"#cardProgCmd\"+cardchar).html(JS_SYNC_MIRROR_REQ);\n\n\t\t\t\t\t\t\tif (progReportNoti.dwTotalStepsCompleted < progReportNoti.dwTotalStepsRequired) {\n\n\t\t\t\t\t\t\t\t$(\"#cardProg\"+cardchar).width(percentage+\"%\");\n\n\t\t\t\t\t\t\t} else if (progReportNoti.dwTotalStepsCompleted == progReportNoti.dwTotalStepsRequired) {\n\n\t\t\t\t\t\t\t\t$(\"#cardProgArea\"+cardchar).hide();\n\t\t\t\t\t\t\t\t$(\"#cardProg\"+cardchar).width(\"0%\");\n\t\t\t\t\t\t\t\t$(\"#cardProg\"+cardchar).html(\"\");\n\t\t\t\t\t\t\t\t$(\"#cardProgCmd\"+cardchar).html(\"\");\n\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t//steps field not correct\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tconsole.log(\"Command in Progress Notification is not recognized!\");\n\t\t\t\t\t\t\tconsole.log(\"progReportNoti.dwCommand=\"+progReportNoti.dwCommand);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t//error code is NOT 0\n\t\t\t\t\terrorMsg = parseErrorCode(progReportNoti.dwErrorCode);\n\t\t\t\t\t//reset progress bar for wipe/defrag/convert if error happens to present operation\n\t\t\t\t\t//Say wipe has error while convert is in progress, don't reset.\n\t\t\t\t\tif (progReportNoti.dwCommand == $(\"#cardProgCmd\"+cardchar).html()) {\n\t\t\t\t\t\t$(\"#cardProgArea\"+cardchar).hide();\n\t\t\t\t\t\t$(\"#cardProg\"+cardchar).width(\"0%\");\n\t\t\t\t\t\t$(\"#cardProg\"+cardchar).html(\"\");\n\t\t\t\t\t\t$(\"#cardProgCmd\"+cardchar).html(\"\");\n\t\t\t\t\t}\n\n\t\t\t\t\tif (progReportNoti.dwCommand == JS_CONVERT_RAID_TYPE_REQ) {\n\t\t\t\t\t\tswitch ($(\"#RAIDTypeStr\"+cardchar).html()) {\n\t\t\t\t\t\t\tcase \"JBOD\":\n\t\t\t\t\t\t\t\tdocument.getElementById(\"RAIDType\"+cardchar).selectedIndex = 1;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"Mirror\":\n\t\t\t\t\t\t\t\tdocument.getElementById(\"RAIDType\"+cardchar).selectedIndex = 2;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tdocument.getElementById(\"RAIDType\"+cardchar).selectedIndex = 0;\n\t\t\t\t\t\t\t\tconsole.log(\"convert reset raid type error!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (progReportNoti.dwCommand == JS_CONVERT_RAID_TYPE_REQ && $(\"#RAIDTypeStr\"+cardchar).html() == \"JBOD\") {\n\t\t\t\t\t\t$(\"#cardProgArea\"+cardcharPeer).hide();\n\t\t\t\t\t\t$(\"#cardProg\"+cardcharPeer).width(\"0%\");\n\t\t\t\t\t\t$(\"#cardProg\"+cardcharPeer).html(\"\");\n\t\t\t\t\t\t$(\"#cardProgCmd\"+cardcharPeer).html(\"\");\n\t\t\t\t\t}\n\n\t\t\t\t\tif (progReportNoti.dwCommand == JS_WIPE_MEDIA_REQ) {\n\t\t\t\t\t\t$(\"#BtnWipe\"+cardchar).prop(\"disabled\", false);\n\t\t\t\t\t}\n\t\t\t\t\tif (progReportNoti.dwCommand == JS_DEFRAG_REQ) {\n\t\t\t\t\t\t$(\"#BtnDefrag\"+cardchar).prop(\"disabled\", false);\n\t\t\t\t\t}\n\n\n\t\t\t\t\t//hide \"convert\" button\n\t\t\t\t\t$(\"#confirmConvertRAIDType\"+cardchar).hide();\n\t\t\t\t\t$(\"#confirmConvertRAIDType\"+cardchar).prop(\"disabled\", false);\n\n\t\t\t\t\t//display error message\n\t\t\t\t\t//var errorMsg = parseErrorCode(progReportNoti.dwErrorCode);\n\t\t\t\t\tconsole.log(\"progReportNoti.dwErrorCode=\"+progReportNoti.dwErrorCode+\",progReportNoti.dwCommand=\"+progReportNoti.dwCommand+\",\"+progReportNoti.dwTotalStepsCompleted+\":\"+progReportNoti.dwTotalStepsRequired);\n\t\t\t\t\t\t//document.getElementById(\"CardError\"+cardchar).innerHTML = \"0x\" + Dw2HexString(progReportNoti.dwErrorCode) + \"&emsp;&emsp;\" + errorMsg.toUpperCase();\n\t\t\t\t\tvar cmd = \"\";\n\t\t\t\t\tswitch(progReportNoti.dwCommand) {\n\t\t\t\t\t\tcase JS_WIPE_MEDIA_REQ:\n\t\t\t\t\t\t\tcmd = \"WIPE\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase JS_DEFRAG_REQ:\n\t\t\t\t\t\t\tcmd = \"DEFRAG\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase JS_CONVERT_RAID_TYPE_REQ:\n\t\t\t\t\t\t\tcmd = \"CVT\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase JS_SYNC_MIRROR_REQ:\n\t\t\t\t\t\t\tcmd = \"SYNC\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tconsole.log(\"progReportNoti wrong cmd!\");\n\t\t\t\t\t}\n\t\t\t\t\tupdateCardErrorMsg(cardchar, cmd, progReportNoti.dwErrorCode);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase JS_CHANGE_MEDIA_INFO_RES:\n\t\t\t\tconsole.log(\"get JS_CHANGE_MEDIA_INFO_RES!\");\n\t\t\t\t//Read data and save it in \"changeMediaInfoRes\"\n\t\t\t\tvar changeMediaInfoRes = new ChangeMediaInfoRes();\n\t\t\t\tchangeMediaInfoRes.Read(dv, MsgHeader.Size);\n\n\t\t\t\t//Update on Web Interface\n\n\t\t\t\tif (changeMediaInfoRes.owCardGUID == $(\"#GUIDA\").html()) {\n\t\t\t\t\tcardchar = \"A\";\n\t\t\t\t} else if (changeMediaInfoRes.owCardGUID == $(\"#GUIDB\").html()) {\n\t\t\t\t\tcardchar = \"B\";\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log(\"No match for GUID in CHANGE_MEDIA_INFO_RES!\");\n\t\t\t\t}\n\n\t\t\t\t//hide \"changemediainfo\" button\n\t\t\t\t$(\"#CMediaInfo\"+cardchar).fadeOut();\n\n\t\t\t\t//changeMediaInfo request comment is empty, then no change will be made for comment.\n\t\t\t\t//reset comment to previous one\n\t\t\t\tif ($(\"#CardDesc\"+cardchar).val() == \"\") {\n\t\t\t\t\tvar cmtStr = $(\"#userComment\"+cardchar).html();\n\t\t\t\t\t$(\"#CardDesc\"+cardchar).val(cmtStr);\n\t\t\t\t}\n\n\t\t\t\tif (changeMediaInfoRes.dwErrorCode != 0) {\n\n\t\t\t\t\t//display error message\n\t\t\t\t\tupdateCardErrorMsg(cardchar, \"CMI\", changeMediaInfoRes.dwErrorCode);\n\n\t\t\t\t\terrorMsg = parseErrorCode(changeMediaInfoRes.dwErrorCode);\n\t\t\t\t\tvar comment = $(\"#userComment\"+cardchar).html();\n\t\t\t\t\tif (comment != $(\"#CardDesc\"+cardchar).val()) {\n\t\t\t\t\t\t$(\"#ChangeMediaInfoCmtErrorMark\"+cardchar).prop(\"title\",\"Error: 0x\" + Dw2HexString(changeMediaInfoRes.dwErrorCode) + \" \" + errorMsg.toUpperCase());\n\t\t\t\t\t\t$(\"#ChangeMediaInfoCmtErrorMark\"+cardchar).fadeIn();\n\t\t\t\t\t}\n\n\t\t\t\t\tif (($(\"#SWLockStr\"+cardchar).html() == \"OFF\" && $(\"#SWLock\"+cardchar).prop(\"checked\")) || ($(\"#SWLockStr\"+cardchar).html() == \"ON\" && !$(\"#SWLock\"+cardchar).prop(\"checked\"))) {\n\t\t\t\t\t\t$(\"#ChangeMediaInfoSWLErrorMark\"+cardchar).prop(\"title\",\"Error: 0x\" + Dw2HexString(changeMediaInfoRes.dwErrorCode) + \" \" + errorMsg.toUpperCase());\n\t\t\t\t\t\t$(\"#ChangeMediaInfoSWLErrorMark\"+cardchar).fadeIn();\n\t\t\t\t\t}\n\t\t\t\t\t//console.log(\"changeMediaInfoRes.dwErrorCode = \"+changeMediaInfoRes.dwErrorCode);\n\n\t\t\t\t\t//reset ChangeMediaInfo\n\t\t\t\t\t$(\"#CardDesc\"+cardchar).val(comment);\n\t\t\t\t\tif ($(\"#SWLockStr\"+cardchar).html() == \"ON\") {\n\t\t\t\t\t\t$(\"#SWLock\"+cardchar).prop(\"checked\", true);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$(\"#SWLock\"+cardchar).prop(\"checked\", false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase JS_PREP_MEDIA_FOR_EJECT_RES:\n\t\t\t\tconsole.log(\"get JS_PREP_MEDIA_FOR_EJECT_RES!\");\n\t\t\t\t//Read data and save it in \"mediaEjectRes\"\n\t\t\t\tvar mediaEjectRes = new PrepareMediaForEjectionRes();\n\t\t\t\tmediaEjectRes.Read(dv, MsgHeader.Size);\n\n\t\t\t\t//Update on Web Interface\n\t\t\t\tif (mediaEjectRes.owGUID == $(\"#GUIDA\").html()) {\n\t\t\t\t\tcardchar = \"A\";\n\t\t\t\t} else if (mediaEjectRes.owGUID == $(\"#GUIDB\").html()) {\n\t\t\t\t\tcardchar = \"B\";\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log(\"No match for GUID in JS_PREP_MEDIA_FOR_EJECT_RES!\");\n\t\t\t\t}\n\n\t\t\t\tif (mediaEjectRes.dwErrorCode != 0) {\n\t\t\t\t\t//var errorMsg = parseErrorCode(mediaEjectRes.dwErrorCode);\n\t\t\t\t\t//document.getElementById(\"CardError\"+cardchar).innerHTML = \"EJECT - 0x\" + Dw2HexString(mediaEjectRes.dwErrorCode) + \"&emsp;\" + errorMsg.toUpperCase();\n\t\t\t\t\tupdateCardErrorMsg(cardchar, \"EJECT\", mediaEjectRes.dwErrorCode);\n\t\t\t\t\tconsole.log(\"mediaEjectRes.dwErrorCode = \"+mediaEjectRes.dwErrorCode);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase JS_MEDIA_INFO_CHANGE_NOTIFY:\n\t\t\t\tconsole.log(\"get MEDIA_INFO_CHANGE_NOTIFY!\");\n\t\t\t\t//Read data and save it in \"mediaInfoChangeNoti\"\n\t\t\t\tvar mediaInfoChangeNoti = new CardMediaInfoChangedNotification();\n\t\t\t\tmediaInfoChangeNoti.Read(dv, indata, MsgHeader.Size);\n\n\t\t\t\t//console.log(MediaInfoCNFlags & CMIC_FLAGS_MEDIA_IN_USE_MASK);//Flags(bit 0)-Media in use\n\t\t\t\t//console.log(MediaInfoCNFlags & CMIC_FLAGS_MEDIA_IS_PHYSICALLY_WRITE_PROTECTED_MASK);//Flags(bit 1)-Media is physically write-protected\n\t\t\t\t//console.log(MediaInfoCNFlags & CMIC_FLAGS_MEDIA_IS_SOFTWARE_WRITE_PROTECTED_MASK);//Flags(bit 2)-Media is software write protected\n\t\t\t\t//console.log(MediaInfoCNFlags & CMIC_FLAGS_MEDIA_QUIESCE_MASK);//Flags(bit 3)-quiesce in progress\n\n\t\t\t\t//Update on Web Interface\n\t\t\t\t//console.log(\"mediaInfoChangeNoti.dwSectorSize:\"+mediaInfoChangeNoti.dwSectorSize);\n\n\t\t\t\t//CardNumber 0x01 for card A and 0x02 for card B\n\t\t\t\tif (mediaInfoChangeNoti.dwCardNumber == 1) {\n\t\t\t\t\tcardchar = \"A\";\n\t\t\t\t\tcardcharPeer = \"B\";\n\t\t\t\t} else if (mediaInfoChangeNoti.dwCardNumber == 2) {\n\t\t\t\t\tcardchar = \"B\";\n\t\t\t\t\tcardcharPeer = \"A\";\n\t\t\t\t} else {\n\n\t\t\t\t}\n\n\t\t\t\tvar cardStatus = \"\";\n\t\t\t\tswitch(mediaInfoChangeNoti.dwReasonCode) {\n\t\t\t\t\tcase 0:\n\t\t\t\t\t\tcardStatus = \"NEW CONNECTION\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\tcardStatus = \"CARD INSERTED\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\tcardStatus = \"CARD REMOVED\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\tcardStatus = \"CHANGED BY REQUEST\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 4:\n\t\t\t\t\t\tcardStatus = \"PARTITION MOUNTED\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 5:\n\t\t\t\t\t\tcardStatus = \"PARTITION DISMOUNTED\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 6:\n\t\t\t\t\t\tcardStatus = \"MEDIA EJECT REQUESTED\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 7:\n\t\t\t\t\t\tcardStatus = \"CARD UNRECOGNIZED\";\n\t\t\t\t\t\tif ($(\"#GUID\"+cardcharPeer).html()!=\"\" && $(\"#GUID\"+cardcharPeer).html()!=\"00000000000000000000000000000000\") {\n\t\t\t\t\t\t\tif ($(\"#RAIDTypeStr\"+cardcharPeer).html()==\"Mirror\") {\n\t\t\t\t\t\t\t\t$(\"#syncBtn\"+cardchar).show();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcardStatus = \"UNKNOWN STATUS\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\n\t\t\t\t//check card HW lock flag\n\t\t\t\tif ((mediaInfoChangeNoti.dwFlags & CMIC_FLAGS_MEDIA_IS_PHYSICALLY_WRITE_PROTECTED_MASK) != 0) {\n\n\t\t\t\t\tdocument.getElementById(\"HWLock\"+cardchar).checked = true;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tdocument.getElementById(\"HWLock\"+cardchar).checked = false;\n\n\t\t\t\t}\n\n\t\t\t\t//check card SW lock flag\n\t\t\t\tif ((mediaInfoChangeNoti.dwFlags & CMIC_FLAGS_MEDIA_IS_SOFTWARE_WRITE_PROTECTED_MASK) != 0) {\n\n\t\t\t\t\t$(\"#SWLock\"+cardchar).prop(\"checked\" ,true);\n\t\t\t\t\t$(\"#SWLockStr\"+cardchar).html(\"ON\");\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$(\"#SWLock\"+cardchar).prop(\"checked\" ,false);\n\t\t\t\t\t$(\"#SWLockStr\"+cardchar).html(\"OFF\");\n\n\t\t\t\t}\n\n\t\t\t\t//check isPrimary flag\n\t\t\t\tif ((mediaInfoChangeNoti.dwFlags & CMIC_FLAGS_MEDIA_IS_PRIMARY_MIRROR_MASK) != 0) {\n\t\t\t\t\t$(\"#isPrimary\"+cardchar).html(\"YES\");\n\t\t\t\t} else {\n\t\t\t\t\t$(\"#isPrimary\"+cardchar).html(\"NO\");\n\t\t\t\t}\n\n\t\t\t\t//update MediaSize\n\t\t\t\tif (mediaInfoChangeNoti.cbySizeOfMedia >= Math.pow(2,30)) {\n\n\t\t\t\t\tdocument.getElementById(\"mediaSize\"+cardchar).innerHTML = (mediaInfoChangeNoti.cbySizeOfMedia/Math.pow(2,30)).toFixed(2) + \"&nbsp;GB\";\n\t\t\t\t\t$(\"#cardSize\"+cardchar).html(mediaInfoChangeNoti.cbySizeOfMedia);\n\n\t\t\t\t} else if (mediaInfoChangeNoti.cbySizeOfMedia >= Math.pow(2,20)) {\n\n\t\t\t\t\tdocument.getElementById(\"mediaSize\"+cardchar).innerHTML = (mediaInfoChangeNoti.cbySizeOfMedia/Math.pow(2,20)).toFixed(2) + \"&nbsp;MB\";\n\t\t\t\t\t$(\"#cardSize\"+cardchar).html(mediaInfoChangeNoti.cbySizeOfMedia);\n\n\t\t\t\t} else if (mediaInfoChangeNoti.cbySizeOfMedia >= Math.pow(2,10)) {\n\n\t\t\t\t\tdocument.getElementById(\"mediaSize\"+cardchar).innerHTML = (mediaInfoChangeNoti.cbySizeOfMedia/Math.pow(2,10)).toFixed(2) + \"&nbsp;KB\";\n\t\t\t\t\t$(\"#cardSize\"+cardchar).html(mediaInfoChangeNoti.cbySizeOfMedia);\n\n\t\t\t\t} else if (mediaInfoChangeNoti.cbySizeOfMedia >= 0) {\n\n\t\t\t\t\tdocument.getElementById(\"mediaSize\"+cardchar).innerHTML = (mediaInfoChangeNoti.cbySizeOfMedia).toFixed(2) + \"&nbsp;B\";\n\t\t\t\t\t$(\"#cardSize\"+cardchar).html(mediaInfoChangeNoti.cbySizeOfMedia);\n\n\t\t\t\t}\n\t\t\t\t//console.log(\"mediaInfoChangeNoti.cbySizeOfMedia=\"+mediaInfoChangeNoti.cbySizeOfMedia);\n\t\t\t\t//console.log(\"mediaInfoChangeNoti.dwSectorSize=\"+mediaInfoChangeNoti.dwSectorSize);\n\n\t\t\t\t//update RAID Type\n\t\t\t\tif (mediaInfoChangeNoti.dwRAIDType == 0) {\n\n\t\t\t\t\tdocument.getElementById(\"RAIDType\"+cardchar).selectedIndex = 1;\n\t\t\t\t\t$(\"#RAIDTypeStr\"+cardchar).html(\"JBOD\");\n\t\t\t\t\t$(\"#syncBtn\"+cardcharPeer).hide();\n\n\t\t\t\t} else if (mediaInfoChangeNoti.dwRAIDType == 1) {\n\n\t\t\t\t\tdocument.getElementById(\"RAIDType\"+cardchar).selectedIndex = 2;\n\t\t\t\t\t$(\"#RAIDTypeStr\"+cardchar).html(\"Mirror\");\n\t\t\t\t\tif ($(\"#GUID\"+cardcharPeer).html()!=\"\" && $(\"#GUID\"+cardcharPeer).html()!=\"00000000000000000000000000000000\") {\n\t\t\t\t\t\t$(\"#syncBtn\"+cardcharPeer).show();\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\t//unknow RAID type\n\n\t\t\t\t}\n\n\t\t\t\tdocument.getElementById(\"GUID\"+cardchar).innerHTML = mediaInfoChangeNoti.owCardGUID;\n\t\t\t\tdocument.getElementById(\"manString\"+cardchar).innerHTML = mediaInfoChangeNoti.achManufacturer;\n\t\t\t\tdocument.getElementById(\"CardDesc\"+cardchar).value = decodeURI(mediaInfoChangeNoti.achUserComment);\n\t\t\t\tdocument.getElementById(\"userComment\"+cardchar).innerHTML = decodeURI(mediaInfoChangeNoti.achUserComment);\n\t\t\t\t//document.getElementById(\"CardError\"+cardchar).innerHTML = \"\";\n\t\t\t\tclearCardErrorMsg(cardchar);\n\t\t\t\tdocument.getElementById(\"CardStatus\"+cardchar).innerHTML = cardStatus;\n\t\t\t\t$(\"#CardStatus\"+cardchar).effect(\"pulsate\",{times:1},1500);\n\n\t\t\t\tif (mediaInfoChangeNoti.dwSectorSize != 0) {\n\t\t\t\t\t//card is present\n\n\t\t\t\t\tif (mediaInfoChangeNoti.dwReasonCode == 2) {\n\t\t\t\t\t\t//card status is removed, disable all operations on card\n\t\t\t\t\t\tdocument.getElementById(\"RAIDType\"+cardchar).disabled = true;\n\t\t\t\t\t\tdocument.getElementById(\"SWLock\"+cardchar).disabled = true;\n\t\t\t\t\t\tdocument.getElementById(\"CardDesc\"+cardchar).disabled = true;\n\t\t\t\t\t\tdocument.getElementById(\"BtnWipe\"+cardchar).disabled = true;\n\t\t\t\t\t\tdocument.getElementById(\"BtnDefrag\"+cardchar).disabled = true;\n\t\t\t\t\t\tdocument.getElementById(\"BtnEject\"+cardchar).disabled = true;\n\n\t\t\t\t\t} else if (mediaInfoChangeNoti.dwReasonCode == 7) {\n\t\t\t\t\t\t//card status is unrecognized, disable all operations except wipe and eject\n\t\t\t\t\t\tdocument.getElementById(\"RAIDType\"+cardchar).disabled = true;\n\t\t\t\t\t\tdocument.getElementById(\"SWLock\"+cardchar).disabled = true;\n\t\t\t\t\t\tdocument.getElementById(\"CardDesc\"+cardchar).disabled = true;\n\t\t\t\t\t\tdocument.getElementById(\"BtnWipe\"+cardchar).disabled = false;\n\t\t\t\t\t\tdocument.getElementById(\"BtnDefrag\"+cardchar).disabled = true;\n\t\t\t\t\t\tdocument.getElementById(\"BtnEject\"+cardchar).disabled = false;\n\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tdocument.getElementById(\"RAIDType\"+cardchar).disabled = false;\n\t\t\t\t\t\tdocument.getElementById(\"SWLock\"+cardchar).disabled = false;\n\t\t\t\t\t\tdocument.getElementById(\"CardDesc\"+cardchar).disabled = false;\n\t\t\t\t\t\tdocument.getElementById(\"BtnWipe\"+cardchar).disabled = false;\n\t\t\t\t\t\tdocument.getElementById(\"BtnDefrag\"+cardchar).disabled = false;\n\t\t\t\t\t\tdocument.getElementById(\"BtnEject\"+cardchar).disabled = false;\n\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t//card is not present\n\n\t\t\t\t\t//display default RAID type\n\t\t\t\t\tdocument.getElementById(\"RAIDType\"+cardchar).selectedIndex = 0;\n\t\t\t\t\t$(\"#RAIDTypeStr\"+cardchar).html(\"---\");\n\t\t\t\t\t//hide mirror sync\n\t\t\t\t\t$(\"#syncBtnA\").hide();\n\t\t\t\t\t$(\"#syncBtnB\").hide();\n\t\t\t\t\t//no operation is allowed\n\t\t\t\t\tdocument.getElementById(\"RAIDType\"+cardchar).disabled = true;\n\t\t\t\t\tdocument.getElementById(\"SWLock\"+cardchar).disabled = true;\n\t\t\t\t\tdocument.getElementById(\"CardDesc\"+cardchar).disabled = true;\n\t\t\t\t\tdocument.getElementById(\"BtnWipe\"+cardchar).disabled = true;\n\t\t\t\t\tdocument.getElementById(\"BtnDefrag\"+cardchar).disabled = true;\n\t\t\t\t\tdocument.getElementById(\"BtnEject\"+cardchar).disabled = true;\n\n\t\t\t\t\t//reset upload/download offset area\n\t\t\t\t\tvar cardnum = 0;\n\t\t\t\t\tif (cardchar == \"A\") {\n\t\t\t\t\t\tcardnum = 1;\n\t\t\t\t\t} else if (cardchar == \"B\") {\n\t\t\t\t\t\tcardnum = 2;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.log(\"MediaChangeInfo error, cardchar=\"+ cardchar);\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (var i=0; i<MAX_PARTITION_PER_CARD; i++) {\n\t\t\t\t\t\t$(\"#uploadFileStart\"+cardnum+i).html(0);\n\t\t\t\t\t\t$(\"#uploadOffset\"+cardnum+i).html(0);\n\t\t\t\t\t\t//$(\"#uploadFileSize\"+cardnum+i).html(0); //The file size will get updated every time an upload is issued.\n\t\t\t\t\t\t$(\"#downloadOffset\"+cardnum+i).html(0);\n\t\t\t\t\t}\n\n\t\t\t\t\t//ignore card status in MediaChangeInfo notification\n\t\t\t\t\tdocument.getElementById(\"CardStatus\"+cardchar).innerHTML = \"CARD NOT PRESENT\";\n\t\t\t\t}\n\n\n\t\t\t\t$(\"#CMediaInfo\"+cardchar).fadeOut();\n\t\t\t\t$(\"#confirmConvertRAIDType\"+cardchar).fadeOut();\n\n\t\t\t\tbreak;\n\n\t\t\tcase JS_DEL_PART_RES:\n\t\t\t\tconsole.log(\"get JS_DEL_PART_RES!\");\n\t\t\t\t//Read data and save it in \"deletePartRes\"\n\t\t\t\tvar deletePartRes = new DeletePartitionRes();\n\t\t\t\tdeletePartRes.Read(dv, MsgHeader.Size);\n\n\t\t\t\t//Update on Web Interface\n\t\t\t\t//console.log(\"deletePartRes.owPUID = \"+deletePartRes.owPUID);\n\t\t\t\tPUIDindex = getPUIDindex(deletePartRes.owPUID);\n\t\t\t\tif (deletePartRes.dwErrorCode != 0){\n\t\t\t\t\terrorMsg = parseErrorCode(deletePartRes.dwErrorCode);\n\t\t\t\t\t$(\"#partActError\"+PUIDindex).html(\"ErrorCode: 0x\" + Dw2HexString(deletePartRes.dwErrorCode) + \"&emsp;&emsp;\" + errorMsg.toUpperCase());\n\t\t\t\t} else {\n\t\t\t\t\t//clear partition activity error message\n\t\t\t\t\t$(\"#partActError\"+PUIDindex).html(\"\");\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase JS_BREAK_MIRROR_RES:\n\t\t\t\tconsole.log(\"get JS_BREAK_MIRROR_RES!\");\n\t\t\t\t//Read data and save it in \"breakMirrorRes\"\n\t\t\t\tvar breakMirrorRes = new BreakMirrorRes();\n\t\t\t\tbreakMirrorRes.Read(dv, MsgHeader.Size);\n\n\t\t\t\t//Update on Web Interface\n\n\t\t\t\t/*process data\n\t\t\t\tconsole.log(dv.getUint32(16,true) + dv.getUint32(20,true) * Math.pow(2,32));//owPUID\n\t\t\t\tconsole.log(dv.getUint32(32,true));//dwErrorCode\n\t\t\t\t*/\n\t\t\t\tbreak;\n\t\t\tcase JS_PART_PROGRESS_NOTIFY:\n\t\t\t\tconsole.log(\"get JS_PART_PROGRESS_NOTIFY!\");\n\t\t\t\t//Read data and save it in \"partProgNoti\"\n\t\t\t\tvar partProgNoti = new PartitionProgressNotification();\n\t\t\t\tpartProgNoti.Read(dv, MsgHeader.Size);\n\n\t\t\t\t//Update on Web Interface\n\t\t\t\tPUIDindex = getPUIDindex(partProgNoti.owPUID);\n\n\t\t\t\t//console.log(\"partProgNoti.dwCommand:\"+partProgNoti.dwCommand);\n\t\t\t\t//console.log(\"partProgNoti.dwFlags:\"+partProgNoti.dwFlags);\n\n\t\t\t\tif (PUIDindex != \"\") {\n\n\t\t\t\t\t//while partition operation is in progress, receive PartitionListUpdateNotification.\n\t\t\t\t\t//Then progress bar for both mirror and its peer will show up. Only one is needed.\n\t\t\t\t\tif ($(\"#partType\"+PUIDindex).html() == \"Mirror\") {\n\t\t\t\t\t\tvar PeerPUID = $(\"#PeerPUIDStr\"+PUIDindex).html();\n\t\t\t\t\t\tvar PeerPUIDindex = getPUIDindex(PeerPUID);\n\t\t\t\t\t\t//hide peer partition progress bar if it's displayed\n\t\t\t\t\t\tif (document.getElementById(\"partProgArea\"+PeerPUIDindex).style.display != \"none\") {\n\t\t\t\t\t\t\tdocument.getElementById(\"partProgArea\"+PeerPUIDindex).style.display = \"none\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\n\t\t\t\t\tif (partProgNoti.dwErrorCode == 0) {\n\n\t\t\t\t\t\t//clear error message\n\t\t\t\t\t\t$(\"#partActError\"+PUIDindex).html(\"\");\n\n\t\t\t\t\t\tpercentage = 100*partProgNoti.dwOperationCompleted/partProgNoti.dwOperationRequired;\n\n\t\t\t\t\t\tswitch(partProgNoti.dwCommand) {\n\t\t\t\t\t\t\tcase JS_REBUILD_PART_REQ:\n\t\t\t\t\t\t\t\tconsole.log(\"value:\"+partProgNoti.dwOperationCompleted+\":\"+partProgNoti.dwOperationRequired);\n\t\t\t\t\t\t\t\t$(\"#partProg\"+PUIDindex).html(\"Rebuilding \"+percentage.toFixed(2).slice(0,-3)+\"%\");\n\t\t\t\t\t\t\t\t$(\"#partProgCmd\"+PUIDindex).html(JS_REBUILD_PART_REQ);\n\t\t\t\t\t\t\t\tif (partProgNoti.dwOperationCompleted < partProgNoti.dwOperationRequired) {\n\n\t\t\t\t\t\t\t\t\t$(\"#partProg\"+PUIDindex).width(percentage+\"%\");\n\n\t\t\t\t\t\t\t\t} else if (partProgNoti.dwOperationCompleted == partProgNoti.dwOperationRequired) {\n\n\t\t\t\t\t\t\t\t\t$(\"#partProgArea\"+PUIDindex).hide();\n\t\t\t\t\t\t\t\t\t$(\"#partProg\"+PUIDindex).width(\"0%\");\n\t\t\t\t\t\t\t\t\t$(\"#partProg\"+PUIDindex).html(\"\");\n\t\t\t\t\t\t\t\t\t$(\"#partProgCmd\"+PUIDindex).html(\"\");\n\n\t\t\t\t\t\t\t\t\t//enable partition activity list\n\t\t\t\t\t\t\t\t\t$(\"#actOptionDelete\"+PUIDindex).addClass(\"activityOption\");\n\t\t\t\t\t\t\t\t\tdocument.getElementById(\"actOptionDelete\"+PUIDindex).onclick = function(){showConfirmDelete(PUIDindex);};\n\t\t\t\t\t\t\t\t\t$(\"#actOptionFormat\"+PUIDindex).addClass(\"activityOption\");\n\t\t\t\t\t\t\t\t\tdocument.getElementById(\"actOptionFormat\"+PUIDindex).onclick = function(){showConfirmFormat(PUIDindex);};\n\t\t\t\t\t\t\t\t\t$(\"#actOptionRebuild\"+PUIDindex).addClass(\"activityOption\");\n\t\t\t\t\t\t\t\t\tdocument.getElementById(\"actOptionRebuild\"+PUIDindex).onclick = function(){showConfirmRebuild(PUIDindex);};\n\t\t\t\t\t\t\t\t\t$(\"#actOptionResize\"+PUIDindex).addClass(\"activityOption\");\n\t\t\t\t\t\t\t\t\tdocument.getElementById(\"actOptionResize\"+PUIDindex).onclick = function(){showConfirmResize(PUIDindex);};\n\t\t\t\t\t\t\t\t\t$(\"#actOptionVerify\"+PUIDindex).addClass(\"activityOption\");\n\t\t\t\t\t\t\t\t\tdocument.getElementById(\"actOptionVerify\"+PUIDindex).onclick = function(){showConfirmVerify(PUIDindex);};\n\t\t\t\t\t\t\t\t\t$(\"#actOptionShareUnshare\"+PUIDindex).addClass(\"activityOption\");\n\t\t\t\t\t\t\t\t\tif ($(\"#actOptionShareUnshare\"+PUIDindex).html().trim() == \"Share\") {\n\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"actOptionShareUnshare\"+PUIDindex).onclick = function(){showConfirmShare(PUIDindex);};\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"actOptionShareUnshare\"+PUIDindex).onclick = function(){showConfirmUnshare(PUIDindex);};\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tArrowPosition(ACT_IDLE, PUIDindex);\n\t\t\t\t\t\t\t\t\t$('#arrow'+PUIDindex).fadeTo(1000,1);\n\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t//step info error\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase JS_FORMAT_PART_REQ:\n\t\t\t\t\t\t\t\tconsole.log(\"value:\"+partProgNoti.dwOperationCompleted+\":\"+partProgNoti.dwOperationRequired);\n\t\t\t\t\t\t\t\t$(\"#partProg\"+PUIDindex).html(\"Formatting \"+percentage.toFixed(2).slice(0,-3)+\"%\");\n\t\t\t\t\t\t\t\t$(\"#partProgCmd\"+PUIDindex).html(JS_FORMAT_PART_REQ);\n\t\t\t\t\t\t\t\tif (partProgNoti.dwOperationCompleted < partProgNoti.dwOperationRequired) {\n\n\t\t\t\t\t\t\t\t\t$(\"#partProg\"+PUIDindex).width(percentage+\"%\");\n\n\t\t\t\t\t\t\t\t} else if (partProgNoti.dwOperationCompleted == partProgNoti.dwOperationRequired) {\n\n\t\t\t\t\t\t\t\t\t$(\"#partProgArea\"+PUIDindex).hide();\n\t\t\t\t\t\t\t\t\t$(\"#partProg\"+PUIDindex).width(\"0%\");\n\t\t\t\t\t\t\t\t\t$(\"#partProg\"+PUIDindex).html(\"\");\n\t\t\t\t\t\t\t\t\t$(\"#partProgCmd\"+PUIDindex).html(\"\");\n\n\t\t\t\t\t\t\t\t\t//enable partition activity list\n\t\t\t\t\t\t\t\t\t$(\"#actOptionDelete\"+PUIDindex).addClass(\"activityOption\");\n\t\t\t\t\t\t\t\t\tdocument.getElementById(\"actOptionDelete\"+PUIDindex).onclick = function(){showConfirmDelete(PUIDindex);};\n\t\t\t\t\t\t\t\t\t$(\"#actOptionFormat\"+PUIDindex).addClass(\"activityOption\");\n\t\t\t\t\t\t\t\t\tdocument.getElementById(\"actOptionFormat\"+PUIDindex).onclick = function(){showConfirmFormat(PUIDindex);};\n\t\t\t\t\t\t\t\t\t$(\"#actOptionRebuild\"+PUIDindex).addClass(\"activityOption\");\n\t\t\t\t\t\t\t\t\tdocument.getElementById(\"actOptionRebuild\"+PUIDindex).onclick = function(){showConfirmRebuild(PUIDindex);};\n\t\t\t\t\t\t\t\t\t$(\"#actOptionResize\"+PUIDindex).addClass(\"activityOption\");\n\t\t\t\t\t\t\t\t\tdocument.getElementById(\"actOptionResize\"+PUIDindex).onclick = function(){showConfirmResize(PUIDindex);};\n\t\t\t\t\t\t\t\t\t$(\"#actOptionVerify\"+PUIDindex).addClass(\"activityOption\");\n\t\t\t\t\t\t\t\t\tdocument.getElementById(\"actOptionVerify\"+PUIDindex).onclick = function(){showConfirmVerify(PUIDindex);};\n\t\t\t\t\t\t\t\t\t$(\"#actOptionShareUnshare\"+PUIDindex).addClass(\"activityOption\");\n\t\t\t\t\t\t\t\t\tif ($(\"#actOptionShareUnshare\"+PUIDindex).html().trim() == \"Share\") {\n\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"actOptionShareUnshare\"+PUIDindex).onclick = function(){showConfirmShare(PUIDindex);};\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"actOptionShareUnshare\"+PUIDindex).onclick = function(){showConfirmUnshare(PUIDindex);};\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tArrowPosition(ACT_IDLE, PUIDindex);\n\t\t\t\t\t\t\t\t\t$('#arrow'+PUIDindex).fadeTo(1000,1);\n\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t//step info error\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase JS_RESIZE_PART_REQ:\n\t\t\t\t\t\t\t\tconsole.log(\"value:\"+partProgNoti.dwOperationCompleted+\":\"+partProgNoti.dwOperationRequired);\n\t\t\t\t\t\t\t\t$(\"#partProg\"+PUIDindex).html(\"Resizing \"+percentage.toFixed(2).slice(0,-3)+\"%\");\n\t\t\t\t\t\t\t\t$(\"#partProgCmd\"+PUIDindex).html(JS_RESIZE_PART_REQ);\n\t\t\t\t\t\t\t\tif (partProgNoti.dwOperationCompleted < partProgNoti.dwOperationRequired) {\n\n\t\t\t\t\t\t\t\t\t$(\"#partProg\"+PUIDindex).width(percentage+\"%\");\n\n\t\t\t\t\t\t\t\t} else if (partProgNoti.dwOperationCompleted == partProgNoti.dwOperationRequired) {\n\n\t\t\t\t\t\t\t\t\t$(\"#partProgArea\"+PUIDindex).hide();\n\t\t\t\t\t\t\t\t\t$(\"#partProg\"+PUIDindex).width(\"0%\");\n\t\t\t\t\t\t\t\t\t$(\"#partProg\"+PUIDindex).html(\"\");\n\t\t\t\t\t\t\t\t\t$(\"#partProgCmd\"+PUIDindex).html(\"\");\n\n\t\t\t\t\t\t\t\t\t//enable partition activity list\n\t\t\t\t\t\t\t\t\t$(\"#actOptionDelete\"+PUIDindex).addClass(\"activityOption\");\n\t\t\t\t\t\t\t\t\tdocument.getElementById(\"actOptionDelete\"+PUIDindex).onclick = function(){showConfirmDelete(PUIDindex);};\n\t\t\t\t\t\t\t\t\t$(\"#actOptionFormat\"+PUIDindex).addClass(\"activityOption\");\n\t\t\t\t\t\t\t\t\tdocument.getElementById(\"actOptionFormat\"+PUIDindex).onclick = function(){showConfirmFormat(PUIDindex);};\n\t\t\t\t\t\t\t\t\t$(\"#actOptionRebuild\"+PUIDindex).addClass(\"activityOption\");\n\t\t\t\t\t\t\t\t\tdocument.getElementById(\"actOptionRebuild\"+PUIDindex).onclick = function(){showConfirmRebuild(PUIDindex);};\n\t\t\t\t\t\t\t\t\t$(\"#actOptionResize\"+PUIDindex).addClass(\"activityOption\");\n\t\t\t\t\t\t\t\t\tdocument.getElementById(\"actOptionResize\"+PUIDindex).onclick = function(){showConfirmResize(PUIDindex);};\n\t\t\t\t\t\t\t\t\t$(\"#actOptionVerify\"+PUIDindex).addClass(\"activityOption\");\n\t\t\t\t\t\t\t\t\tdocument.getElementById(\"actOptionVerify\"+PUIDindex).onclick = function(){showConfirmVerify(PUIDindex);};\n\t\t\t\t\t\t\t\t\t$(\"#actOptionShareUnshare\"+PUIDindex).addClass(\"activityOption\");\n\t\t\t\t\t\t\t\t\tif ($(\"#actOptionShareUnshare\"+PUIDindex).html().trim() == \"Share\") {\n\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"actOptionShareUnshare\"+PUIDindex).onclick = function(){showConfirmShare(PUIDindex);};\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"actOptionShareUnshare\"+PUIDindex).onclick = function(){showConfirmUnshare(PUIDindex);};\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tArrowPosition(ACT_IDLE, PUIDindex);\n\t\t\t\t\t\t\t\t\t$('#arrow'+PUIDindex).fadeTo(1000,1);\n\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t//step info error\n\t\t\t\t\t\t\t\t\tconsole.log(\"Error: partProgNoti.dwOperationCompleted > partProgNoti.dwOperationRequired\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase JS_VERIFY_PART_REQ:\n\t\t\t\t\t\t\t\t//console.log(\"value:\"+partProgNoti.dwOperationCompleted+\":\"+partProgNoti.dwOperationRequired);\n\t\t\t\t\t\t\t\t$(\"#partProg\"+PUIDindex).html(\"Verifying \"+percentage.toFixed(2).slice(0,-3)+\"%\");\n\t\t\t\t\t\t\t\t$(\"#partProgCmd\"+PUIDindex).html(JS_VERIFY_PART_REQ);\n\t\t\t\t\t\t\t\tif (partProgNoti.dwOperationCompleted < partProgNoti.dwOperationRequired) {\n\n\t\t\t\t\t\t\t\t\t$(\"#partProg\"+PUIDindex).width(percentage+\"%\");\n\n\t\t\t\t\t\t\t\t} else if (partProgNoti.dwOperationCompleted == partProgNoti.dwOperationRequired) {\n\n\t\t\t\t\t\t\t\t\t$(\"#partProgArea\"+PUIDindex).hide();\n\t\t\t\t\t\t\t\t\t$(\"#partProg\"+PUIDindex).width(\"0%\");\n\t\t\t\t\t\t\t\t\t$(\"#partProg\"+PUIDindex).html(\"\");\n\t\t\t\t\t\t\t\t\t$(\"#partProgCmd\"+PUIDindex).html(\"\");\n\n\t\t\t\t\t\t\t\t\t//enable partition activity list\n\t\t\t\t\t\t\t\t\t$(\"#actOptionDelete\"+PUIDindex).addClass(\"activityOption\");\n\t\t\t\t\t\t\t\t\tdocument.getElementById(\"actOptionDelete\"+PUIDindex).onclick = function(){showConfirmDelete(PUIDindex);};\n\t\t\t\t\t\t\t\t\t$(\"#actOptionFormat\"+PUIDindex).addClass(\"activityOption\");\n\t\t\t\t\t\t\t\t\tdocument.getElementById(\"actOptionFormat\"+PUIDindex).onclick = function(){showConfirmFormat(PUIDindex);};\n\t\t\t\t\t\t\t\t\t$(\"#actOptionRebuild\"+PUIDindex).addClass(\"activityOption\");\n\t\t\t\t\t\t\t\t\tdocument.getElementById(\"actOptionRebuild\"+PUIDindex).onclick = function(){showConfirmRebuild(PUIDindex);};\n\t\t\t\t\t\t\t\t\t$(\"#actOptionResize\"+PUIDindex).addClass(\"activityOption\");\n\t\t\t\t\t\t\t\t\tdocument.getElementById(\"actOptionResize\"+PUIDindex).onclick = function(){showConfirmResize(PUIDindex);};\n\t\t\t\t\t\t\t\t\t$(\"#actOptionVerify\"+PUIDindex).addClass(\"activityOption\");\n\t\t\t\t\t\t\t\t\tdocument.getElementById(\"actOptionVerify\"+PUIDindex).onclick = function(){showConfirmVerify(PUIDindex);};\n\t\t\t\t\t\t\t\t\t$(\"#actOptionShareUnshare\"+PUIDindex).addClass(\"activityOption\");\n\t\t\t\t\t\t\t\t\tif ($(\"#actOptionShareUnshare\"+PUIDindex).html().trim() == \"Share\") {\n\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"actOptionShareUnshare\"+PUIDindex).onclick = function(){showConfirmShare(PUIDindex);};\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"actOptionShareUnshare\"+PUIDindex).onclick = function(){showConfirmUnshare(PUIDindex);};\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tArrowPosition(ACT_IDLE, PUIDindex);\n\t\t\t\t\t\t\t\t\t$('#arrow'+PUIDindex).fadeTo(1000,1);\n\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t//step info error\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tconsole.log(\"Command in Partition Progress Notification is not recognized!!!\");\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//error code is not zero\n\t\t\t\t\t\tconsole.log(\"partProgress ErrorCode:\"+partProgNoti.dwErrorCode);\n\n\t\t\t\t\t\t//reset progress bar\n\t\t\t\t\t\t$(\"#partProgArea\"+PUIDindex).hide();\n\t\t\t\t\t\t$(\"#partProg\"+PUIDindex).width(\"0%\");\n\t\t\t\t\t\t$(\"#partProg\"+PUIDindex).html(\"\");\n\t\t\t\t\t\t$(\"#partProgCmd\"+PUIDindex).html(\"\");\n\n\t\t\t\t\t\t//enable partition activity list\n\t\t\t\t\t\t$(\"#actOptionDelete\"+PUIDindex).addClass(\"activityOption\");\n\t\t\t\t\t\tdocument.getElementById(\"actOptionDelete\"+PUIDindex).onclick = function(){showConfirmDelete(PUIDindex);};\n\t\t\t\t\t\t$(\"#actOptionFormat\"+PUIDindex).addClass(\"activityOption\");\n\t\t\t\t\t\tdocument.getElementById(\"actOptionFormat\"+PUIDindex).onclick = function(){showConfirmFormat(PUIDindex);};\n\t\t\t\t\t\t$(\"#actOptionRebuild\"+PUIDindex).addClass(\"activityOption\");\n\t\t\t\t\t\tdocument.getElementById(\"actOptionRebuild\"+PUIDindex).onclick = function(){showConfirmRebuild(PUIDindex);};\n\t\t\t\t\t\t$(\"#actOptionResize\"+PUIDindex).addClass(\"activityOption\");\n\t\t\t\t\t\tdocument.getElementById(\"actOptionResize\"+PUIDindex).onclick = function(){showConfirmResize(PUIDindex);};\n\t\t\t\t\t\t$(\"#actOptionVerify\"+PUIDindex).addClass(\"activityOption\");\n\t\t\t\t\t\tdocument.getElementById(\"actOptionVerify\"+PUIDindex).onclick = function(){showConfirmVerify(PUIDindex);};\n\t\t\t\t\t\t$(\"#actOptionShareUnshare\"+PUIDindex).addClass(\"activityOption\");\n\t\t\t\t\t\tif ($(\"#actOptionShareUnshare\"+PUIDindex).html().trim() == \"Share\") {\n\t\t\t\t\t\t\tdocument.getElementById(\"actOptionShareUnshare\"+PUIDindex).onclick = function(){showConfirmShare(PUIDindex);};\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.getElementById(\"actOptionShareUnshare\"+PUIDindex).onclick = function(){showConfirmUnshare(PUIDindex);};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//reset activity arrow\n\t\t\t\t\t\tArrowPosition(ACT_IDLE, PUIDindex);\n\t\t\t\t\t\t$('#arrow'+PUIDindex).fadeTo(1000,1);\n\n\t\t\t\t\t\t//show error message\n\t\t\t\t\t\terrorMsg = parseErrorCode(partProgNoti.dwErrorCode);\n\t\t\t\t\t\t$(\"#partActError\"+PUIDindex).html(\"ErrorCode: 0x\" + Dw2HexString(partProgNoti.dwErrorCode) + \"&emsp;&emsp;\" + errorMsg.toUpperCase());\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t//no PUID match, show partProgNoti.dwErrorCode???\n\t\t\t\t\tconsole.log(\"partProgress ErrorCode:\"+partProgNoti.dwErrorCode);\n\t\t\t\t}\n\n\n\t\t\t\tbreak;\n\n\t\t\tcase JS_DEFINE_PART_RES:\n\t\t\t\tconsole.log(\"get JS_DEFINE_PART_RES!\");\n\t\t\t\t//Read data and save it in \"definePartRes\"\n\t\t\t\tvar definePartRes = new DefinePartitionRes();\n\t\t\t\tdefinePartRes.Read(dv, MsgHeader.Size);\n\n\t\t\t\t//Update on Web Interface\n\t\t\t\tif (definePartRes.owCardGUID == $(\"#GUIDA\").html()) {\n\t\t\t\t\tcardchar = \"A\";\n\t\t\t\t} else if (definePartRes.owCardGUID == $(\"#GUIDB\").html()) {\n\t\t\t\t\tcardchar = \"B\";\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log(\"Wrong GUID in DEFINE_PART_RES!\");\n\t\t\t\t}\n\t\t\t\t//console.log(\"definePartRes.owPUID = \"+definePartRes.owPUID);\n\t\t\t\tif (definePartRes.dwErrorCode != 0) {\n\n\t\t\t\t\terrorMsg = parseErrorCode(definePartRes.dwErrorCode);\n\t\t\t\t\t$(\"#definePartErrorMsg\"+cardchar).html( \"ErrorCode: 0x\" + Dw2HexString(definePartRes.dwErrorCode) + \"&emsp;&emsp;\" + errorMsg.toUpperCase() );\n\t\t\t\t} else {\n\t\t\t\t\t$(\"#definePartErrorMsg\"+cardchar).html(\"\");\n\t\t\t\t}\n\n\t\t\t\t//print msg in console\n\t\t\t\t/*console.log(\"GUID:\"+definePartRes.owCardGUID);\n\t\t\t\tconsole.log(\"PUID:\"+definePartRes.owPUID);\n\t\t\t\tconsole.log(\"PeerPUID:\"+definePartRes.owPeerPUID);\n\t\t\t\tconsole.log(\"ErrorCode:\"+definePartRes.dwErrorCode);*/\n\n\t\t\t\tbreak;\n\t\t\tcase JS_SET_PART_OPTIONS_RES:\n\t\t\t\tconsole.log(\"get JS_SET_PART_RES!\");\n\t\t\t\t//Read data and save it in \"setPartRes\"\n\t\t\t\tvar setPartRes = new SetPartitionRes();\n\t\t\t\tsetPartRes.Read(dv, MsgHeader.Size);\n\n\t\t\t\t//Update on Web Interface\n\t\t\t\tPUIDindex = getPUIDindex(setPartRes.owPUID);\n\n\t\t\t\tif (setPartRes.dwErrorCode != 0) {\n\t\t\t\t\t//reset all partition options\n\t\t\t\t\tResetPartOp(PUIDindex);\n\t\t\t\t\t//show error code\n\t\t\t\t\terrorMsg = parseErrorCode(setPartRes.dwErrorCode);\n\t\t\t\t\t$(\"#SetPartError\"+PUIDindex).html(\"ErrorCode: 0x\" + Dw2HexString(setPartRes.dwErrorCode) + \"&emsp;&emsp;\" + errorMsg.toUpperCase() + \"&emsp;&emsp;\");\n\n\t\t\t\t} else {\n\t\t\t\t\t//succeed\n\t\t\t\t\t$(\"#SetPartError\"+PUIDindex).html(\"\");\n\n\t\t\t\t}\n\t\t\t\t//console.log(\"error code:\"+setPartRes.dwErrorCode);\n\t\t\t\tbreak;\n\t\t\tcase JS_CLAIM_PART_RES:\n\t\t\t\tconsole.log(\"get JS_CLAIM_PART_RES!\");\n\t\t\t\t//Read data and save it in \"claimPartRes\"\n\t\t\t\tvar claimPartRes = new ClaimPartitionRes();\n\t\t\t\tclaimPartRes.Read(dv, MsgHeader.Size);\n\n\t\t\t\t//Update on Web Interface\n\t\t\t\tPUIDindex = getPUIDindex(claimPartRes.owPUID);\n\n\t\t\t\tif (claimPartRes.dwErrorCode != 0) {\n\t\t\t\t\t//hide update reminder\n\t\t\t\t\t$(\"#updateReminder\"+PUIDindex).hide();\n\t\t\t\t\t//reset claim type\n\t\t\t\t\tif (document.getElementById(\"ClaimType\"+PUIDindex).options[0].defaultSelected) {\n\t\t\t\t\t\tdocument.getElementById(\"ClaimType\"+PUIDindex).selectedIndex = 0;\n\t\t\t\t\t} else if (document.getElementById(\"ClaimType\"+PUIDindex).options[1].defaultSelected) {\n\t\t\t\t\t\tdocument.getElementById(\"ClaimType\"+PUIDindex).selectedIndex = 1;\n\t\t\t\t\t} else if (document.getElementById(\"ClaimType\"+PUIDindex).options[2].defaultSelected) {\n\t\t\t\t\t\tdocument.getElementById(\"ClaimType\"+PUIDindex).selectedIndex = 2;\n\t\t\t\t\t}\n\n\t\t\t\t\t//disable update button\n\t\t\t\t\t$(\"#update\"+PUIDindex).prop(\"disabled\", true);\n\t\t\t\t\t//show error code\n\t\t\t\t\terrorMsg = parseErrorCode(claimPartRes.dwErrorCode);\n\t\t\t\t\t$(\"#SetPartError\"+PUIDindex).html(\"ErrorCode: 0x\" + Dw2HexString(claimPartRes.dwErrorCode) + \"&emsp;&emsp;\" + errorMsg.toUpperCase() + \"&emsp;&emsp;\");\n\n\t\t\t\t} else {\n\t\t\t\t\t//succeed\n\t\t\t\t\t$(\"#SetPartError\"+PUIDindex).html(\"\");\n\n\t\t\t\t}\n\t\t\t\t//console.log(\"claim ErrorCode:\"+claimPartRes.dwErrorCode);\n\n\t\t\t\tbreak;\n\t\t\tcase JS_RELEASE_PART_RES:\n\t\t\t\tconsole.log(\"get JS_RELEASE_PART_RES!\");\n\t\t\t\t//Read data and save it in \"releasePartRes\"\n\t\t\t\tvar releasePartRes = new ReleasePartitionRes();\n\t\t\t\treleasePartRes.Read(dv, MsgHeader.Size);\n\n\t\t\t\t//Update on Web Interface\n\t\t\t\tPUIDindex = getPUIDindex(releasePartRes.owPUID);\n\t\t\t\tif (releasePartRes.dwErrorCode != 0) {\n\t\t\t\t\t//hide update reminder\n\t\t\t\t\t$(\"#updateReminder\"+PUIDindex).hide();\n\t\t\t\t\t//disable update button\n\t\t\t\t\t$(\"#update\"+PUIDindex).prop(\"disabled\", true);\n\t\t\t\t\t//show error code\n\t\t\t\t\terrorMsg = parseErrorCode(releasePartRes.dwErrorCode);\n\t\t\t\t\t$(\"#SetPartError\"+PUIDindex).html(\"ErrorCode: 0x\" + Dw2HexString(releasePartRes.dwErrorCode) + \"&emsp;&emsp;\" + errorMsg.toUpperCase() + \"&emsp;&emsp;\");\n\n\t\t\t\t\t//console.log(\"releasePartRes.dwErrorCode=\"+releasePartRes.dwErrorCode);\n\t\t\t\t} else {\n\t\t\t\t\t//succeed\n\t\t\t\t\t$(\"#SetPartError\"+PUIDindex).html(\"\");\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase JS_SHARE_PART_RES:\n\t\t\t\tconsole.log(\"get JS_SHARE_PART_RES!\");\n\t\t\t\t//Read data and save it in \"sharePartRes\"\n\t\t\t\tvar sharePartRes = new SharePartitionRes();\n\t\t\t\tsharePartRes.Read(dv, MsgHeader.Size);\n\n\t\t\t\t//Updata on Web Interface\n\n\t\t\t\t//show error message\n\t\t\t\tif (sharePartRes.dwErrorCode != 0) {\n\t\t\t\t\tPUIDindex = getPUIDindex(sharePartRes.owPUID);\n\t\t\t\t\terrorMsg = parseErrorCode(sharePartRes.dwErrorCode);\n\t\t\t\t\t$(\"#partActError\"+PUIDindex).html(\"ErrorCode: 0x\" + Dw2HexString(sharePartRes.dwErrorCode) + \"&emsp;&emsp;\" + errorMsg.toUpperCase());\n\t\t\t\t}\n\t\t\t\t//console.log(\"share ErrorCode:\"+sharePartRes.dwErrorCode);\n\n\t\t\t\tbreak;\n\t\t\tcase JS_UNSHARE_PART_RES:\n\t\t\t\tconsole.log(\"get JS_UNSHARE_PART_RES!\");\n\t\t\t\t//Read data and save it in \"unsharePartRes\"\n\t\t\t\tvar unsharePartRes = new UnsharePartitionRes();\n\t\t\t\tunsharePartRes.Read(dv, MsgHeader.Size);\n\n\t\t\t\t//Update on Web Interface\n\t\t\t\tif (unsharePartRes.dwErrorCode != 0) {\n\t\t\t\t\tPUIDindex = getPUIDindex(unsharePartRes.owPUID);\n\t\t\t\t\terrorMsg = parseErrorCode(unsharePartRes.dwErrorCode);\n\t\t\t\t\t$(\"#partActError\"+PUIDindex).html(\"ErrorCode: 0x\" + Dw2HexString(unsharePartRes.dwErrorCode) + \"&emsp;&emsp;\" + errorMsg.toUpperCase());\n\t\t\t\t}\n\t\t\t\t//console.log(\"unshare ErrorCode:\"+unsharePartRes.dwErrorCode);\n\n\t\t\t\tbreak;\n\t\t\tcase JS_SD_RAW_REGISTERS_RES:\n\t\t\t\tconsole.log(\"get JS_SD_RAW_REGISTERS_RES!\");\n\t\t\t\t//Read data and save it in \"sdRawRegistersRes\"\n\t\t\t\tvar sdRawRegistersRes = new ReadRawRegistersRes();\n\t\t\t\tsdRawRegistersRes.Read(dv, MsgHeader.Size);\n\n\t\t\t\t//Update on Web Interface\n\t\t\t\tif (sdRawRegistersRes.dwErrorCode == 0) {\n\n\t\t\t\t\tif (sdRawRegistersRes.owCardGUID == $(\"#GUIDA\").html()) {\n\t\t\t\t\t\tcardchar = \"A\";\n\t\t\t\t\t\tcardcharPeer = \"B\";\n\t\t\t\t\t} else if (sdRawRegistersRes.owCardGUID == $(\"#GUIDB\").html()) {\n\t\t\t\t\t\tcardchar = \"B\";\n\t\t\t\t\t\tcardcharPeer = \"A\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.log(\"Wrong GUID in SD_RAW_REGISTERS_RES!\");\n\t\t\t\t\t}\n\n\t\t\t\t\t$(\"#OCR\"+cardchar).html(\"0x\"+Dw2HexString(sdRawRegistersRes.sdRawRegisters.dwOCR));\n\t\t\t\t\t$(\"#CID0\"+cardchar).html(\"0x\"+Dw2HexString(sdRawRegistersRes.sdRawRegisters.dwCID[0]));\n\t\t\t\t\t$(\"#CID1\"+cardchar).html(\"0x\"+Dw2HexString(sdRawRegistersRes.sdRawRegisters.dwCID[1]));\n\t\t\t\t\t$(\"#CID2\"+cardchar).html(\"0x\"+Dw2HexString(sdRawRegistersRes.sdRawRegisters.dwCID[2]));\n\t\t\t\t\t$(\"#CID3\"+cardchar).html(\"0x\"+Dw2HexString(sdRawRegistersRes.sdRawRegisters.dwCID[3]));\n\t\t\t\t\t$(\"#CSD0\"+cardchar).html(\"0x\"+Dw2HexString(sdRawRegistersRes.sdRawRegisters.dwCSD[0]));\n\t\t\t\t\t$(\"#CSD1\"+cardchar).html(\"0x\"+Dw2HexString(sdRawRegistersRes.sdRawRegisters.dwCSD[1]));\n\t\t\t\t\t$(\"#CSD2\"+cardchar).html(\"0x\"+Dw2HexString(sdRawRegistersRes.sdRawRegisters.dwCSD[2]));\n\t\t\t\t\t$(\"#CSD3\"+cardchar).html(\"0x\"+Dw2HexString(sdRawRegistersRes.sdRawRegisters.dwCSD[3]));\n\t\t\t\t\t$(\"#RCA\"+cardchar).html(\"0x\"+Dw2HexString(sdRawRegistersRes.sdRawRegisters.dwRCA));\n\t\t\t\t\t$(\"#DSR\"+cardchar).html(\"0x\"+Dw2HexString(sdRawRegistersRes.sdRawRegisters.dwDSR));\n\t\t\t\t\t$(\"#SCR\"+cardchar).html(\"0x\"+Dw2HexString(sdRawRegistersRes.sdRawRegisters.dwSCR));\n\n\t\t\t\t\t$(\"#RawReg\"+cardchar).fadeIn();\n\t\t\t\t\t$(\"#RawReg\"+cardcharPeer).fadeOut();\n\t\t\t\t\t$(\"#sdRawRegTable\").fadeIn();\n\n\t\t\t\t} else {\n\t\t\t\t\t//error\n\t\t\t\t\tconsole.log(\"sdRawRegistersRes.dwErrorCode:\"+sdRawRegistersRes.dwErrorCode);\n\t\t\t\t\t$(\"#sdRawRegTable\").fadeOut();\n\t\t\t\t\t$(\"#RawRegA\").fadeOut();\n\t\t\t\t\t$(\"#RawRegB\").fadeOut();\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase JS_CANCEL_QUEUED_TASK_RES:\n\t\t\t\tconsole.log(\"get JS_CANCEL_QUEUED_TASK_RES!\");\n\t\t\t\t//Read data and save it in \"cancelQueuedTaskRes\"\n\t\t\t\tvar cancelQueuedTaskRes = new CancelQueuedTaskRes();\n\t\t\t\tcancelQueuedTaskRes.Read(dv, MsgHeader.Size);\n\n\t\t\t\t//check UID to see if it's GUID\n\t\t\t\tif (cancelQueuedTaskRes.owUID == $(\"#GUIDA\").html()) {\n\t\t\t\t\tcardchar = \"A\";\n\t\t\t\t} else if (cancelQueuedTaskRes.owUID == $(\"#GUIDB\").html()) {\n\t\t\t\t\tcardchar = \"B\";\n\t\t\t\t} else {\n\t\t\t\t\t//UID is not GUID\n\n\t\t\t\t}\n\n\t\t\t\t//Update on Web Interface\n\t\t\t\tif (cardchar == \"A\" || cardchar == \"B\") {\n\t\t\t\t\tif (cancelQueuedTaskRes.dwErrorCode == 0) {\n\t\t\t\t\t\t//hide progress bar\n\t\t\t\t\t\t$(\"#cardProgArea\"+cardchar).hide();\n\n\t\t\t\t\t\t//reset progress bar\n\t\t\t\t\t\t$(\"#cardProg\"+cardchar).width(\"0%\");\n\t\t\t\t\t\t$(\"#cardProg\"+cardchar).html(\"\");\n\t\t\t\t\t\t$(\"#cardProgCmd\"+cardchar).html(\"\");\n\n\t\t\t\t\t\t//enable convert button\n\t\t\t\t\t\t$(\"#confirmConvertRAIDType\"+cardchar).prop(\"disabled\", false);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//var errorMsg = parseErrorCode(cancelQueuedTaskRes.dwErrorCode);\n\t\t\t\t\t\t//document.getElementById(\"CardError\"+cardchar).innerHTML = \"CANCEL - 0x\" + Dw2HexString(cancelQueuedTaskRes.dwErrorCode) + \"&emsp;\" + errorMsg.toUpperCase();\n\t\t\t\t\t\tupdateCardErrorMsg(cardchar, \"CANCEL\", cancelQueuedTaskRes.dwErrorCode);\n\t\t\t\t\t}\n\t\t\t\t} else if (cardchar == \"\") {\n\t\t\t\t\tPUIDindex = getPUIDindex(cancelQueuedTaskRes.owUID);\n\n\t\t\t\t\tif (cancelQueuedTaskRes.dwErrorCode == 0) {\n\t\t\t\t\t\t//hide progress bar\n\t\t\t\t\t\t$(\"#partProgArea\"+PUIDindex).hide();\n\t\t\t\t\t\t//reset activity arrow position\n\t\t\t\t\t\tArrowPosition(ACT_IDLE, PUIDindex);\n\t\t\t\t\t\t$('#arrow'+PUIDindex).fadeTo(1000,1);\n\t\t\t\t\t\t//reset the progress bar\n\t\t\t\t\t\t$(\"#partProg\"+PUIDindex).width(\"0%\");\n\t\t\t\t\t\t$(\"#partProg\"+PUIDindex).html(\"\");\n\t\t\t\t\t\t$(\"#partProgCmd\"+PUIDindex).html(\"\");\n\n\t\t\t\t\t\t//enable partition activity list\n\t\t\t\t\t\t$(\"#actOptionDelete\"+PUIDindex).addClass(\"activityOption\");\n\t\t\t\t\t\tdocument.getElementById(\"actOptionDelete\"+PUIDindex).onclick = function(){showConfirmDelete(PUIDindex);};\n\t\t\t\t\t\t$(\"#actOptionFormat\"+PUIDindex).addClass(\"activityOption\");\n\t\t\t\t\t\tdocument.getElementById(\"actOptionFormat\"+PUIDindex).onclick = function(){showConfirmFormat(PUIDindex);};\n\t\t\t\t\t\t$(\"#actOptionRebuild\"+PUIDindex).addClass(\"activityOption\");\n\t\t\t\t\t\tdocument.getElementById(\"actOptionRebuild\"+PUIDindex).onclick = function(){showConfirmRebuild(PUIDindex);};\n\t\t\t\t\t\t$(\"#actOptionResize\"+PUIDindex).addClass(\"activityOption\");\n\t\t\t\t\t\tdocument.getElementById(\"actOptionResize\"+PUIDindex).onclick = function(){showConfirmResize(PUIDindex);};\n\t\t\t\t\t\t$(\"#actOptionVerify\"+PUIDindex).addClass(\"activityOption\");\n\t\t\t\t\t\tdocument.getElementById(\"actOptionVerify\"+PUIDindex).onclick = function(){showConfirmVerify(PUIDindex);};\n\t\t\t\t\t\t$(\"#actOptionShare\"+PUIDindex).addClass(\"activityOption\");\n\t\t\t\t\t\tif ($(\"#actOptionShareUnshare\"+PUIDindex).html().trim() == \"Share\") {\n\t\t\t\t\t\t\tdocument.getElementById(\"actOptionShareUnshare\"+PUIDindex).onclick = function(){showConfirmShare(PUIDindex);};\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.getElementById(\"actOptionShareUnshare\"+PUIDindex).onclick = function(){showConfirmUnshare(PUIDindex);};\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\terrorMsg = parseErrorCode(cancelQueuedTaskRes.dwErrorCode);\n\t\t\t\t\t\t$(\"#partActError\"+PUIDindex).html(\"ErrorCode: 0x\" + Dw2HexString(cancelQueuedTaskRes.dwErrorCode) + \"&emsp;&emsp;\" + errorMsg.toUpperCase());\n\n\t\t\t\t\t\tconsole.log(\"cancelQueuedTaskRes.dwErrorCode=\"+cancelQueuedTaskRes.dwErrorCode);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase JS_RAID_SETTING_RES:\n\t\t\t\tconsole.log(\"get JS_RAID_SETTING_RES!\");\n\t\t\t\t//Read data and save it in \"RAIDSettingRes\"\n\t\t\t\tvar RAIDSettingRes = new ChangeRAIDSettingRes();\n\t\t\t\tRAIDSettingRes.Read(dv, MsgHeader.Size);\n\n\t\t\t\t//update on web interface\n\t\t\t\tif (RAIDSettingRes.dwErrorCode == 0) {\n\t\t\t\t\tif ($(\"#SyncSettingStr\").html() == \"ON\") {\n\t\t\t\t\t\t$(\"#SyncSettingStr\").html(\"OFF\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$(\"#SyncSettingStr\").html(\"ON\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\terrorMsg = parseErrorCode(RAIDSettingRes.dwErrorCode);\n\t\t\t\t\tdocument.getElementById(\"SyncSettingErrorMsg\").innerHTML = \" ErrorCode: 0x\" + Dw2HexString(RAIDSettingRes.dwErrorCode) + \"&emsp;&emsp;\" + errorMsg.toUpperCase();\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase JS_WRITE_COMPLETE_RES:\n\t\t\t\tconsole.log(\"get JS_WRITE_COMPLETE_RES!\");\n\t\t\t\t//Read data and save it in \"writeCompleteRes\"\n\t\t\t\tvar writeCompleteRes = new StorageWriteCompleteRes();\n\t\t\t\twriteCompleteRes.Read(dv, MsgHeader.Size);\n\n\t\t\t\t//update on Web Interface\n\t\t\t\tPUIDindex = getPUIDindex(writeCompleteRes.owPUID);\n\t\t\t\t//console.log(\"PUID:\"+writeCompleteRes.owPUID);\n\t\t\t\t//console.log(\"PUIDindex:\"+PUIDindex);\n\n\t\t\t\tif (writeCompleteRes.dwErrorCode == 0) {\n\t\t\t\t\tif ($(\"#uploadCancelFlag\"+PUIDindex).html()==\"on\") {\n\t\t\t\t\t\t$(\"#uploadProgArea\"+PUIDindex).css(\"visibility\",\"hidden\");\n\t\t\t\t\t\t$(\"#uploadProg\"+PUIDindex).html(\"\");\n\t\t\t\t\t\t$(\"#uploadProg\"+PUIDindex).width(\"0%\");\n\t\t\t\t\t\t$(\"#uploadFileStart\"+PUIDindex).html(0);\n\t\t\t\t\t\t$(\"#uploadOffset\"+PUIDindex).html(0);\n\t\t\t\t\t\t$(\"#uploadCancelFlag\"+PUIDindex).html(\"\");\n\t\t\t\t\t\tconsole.log(\"Upload cancelled!\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar uploadFiles = document.getElementById(\"uploadFiles\"+ PUIDindex).files;\n\t\t\t\t\t//var uploadFile = uploadFiles[0];\n\t\t\t\t\tvar uploadFileSize = parseInt($(\"#uploadFileSize\"+PUIDindex).html());\n\t\t\t\t\tvar start = parseInt($(\"#uploadFileStart\"+PUIDindex).html());\n\t\t\t\t\t//console.log(\"fileStart:uploadFileSize = \" + start + \":\" + uploadFileSize);\n\t\t\t\t\tpercentage = 100*start/uploadFileSize;\n\t\t\t\t\t$(\"#uploadProg\"+PUIDindex).html(\"Uploading \"+percentage.toFixed(2).slice(0,-3)+\"%\");\n\t\t\t\t\t$(\"#uploadProg\"+PUIDindex).width(percentage+\"%\");\n\n\t\t\t\t\tif ((start < uploadFileSize) && (uploadFiles.length != 0)) {\n\t\t\t\t\t\tsendFileChunk(PUIDindex);\n\t\t\t\t\t} else if (start == uploadFileSize) {\n\n\t\t\t\t\t\t$(\"#uploadProgArea\"+PUIDindex).css(\"visibility\",\"hidden\");\n\t\t\t\t\t\t$(\"#uploadProg\"+PUIDindex).html(\"\");\n\t\t\t\t\t\t$(\"#uploadProg\"+PUIDindex).width(\"0%\");\n\t\t\t\t\t\t$(\"#uploadFileStart\"+PUIDindex).html(0);\n\t\t\t\t\t\t$(\"#uploadOffset\"+PUIDindex).html(0);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.log(\"Error: uploadFiles.length=\"+uploadFiles.length);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t//error\n\t\t\t\t\tconsole.log(\"ErrorCode:\"+writeCompleteRes.dwErrorCode);\n\n\t\t\t\t\t$(\"#uploadProgArea\"+PUIDindex).css(\"visibility\",\"hidden\");\n\t\t\t\t\t$(\"#uploadProg\"+PUIDindex).html(\"\");\n\t\t\t\t\t$(\"#uploadProg\"+PUIDindex).width(\"0%\");\n\t\t\t\t\t$(\"#uploadFileStart\"+PUIDindex).html(0);\n\t\t\t\t\t$(\"#uploadOffset\"+PUIDindex).html(0);\n\n\t\t\t\t\terrorMsg = parseErrorCode(writeCompleteRes.dwErrorCode);\n\t\t\t\t\tdocument.getElementById(\"uploadErrorMsg\" + PUIDindex).innerHTML = \"Upload ErrorCode: 0x\" + Dw2HexString(writeCompleteRes.dwErrorCode) + \"&emsp;&emsp;\" + errorMsg.toUpperCase() + \"&emsp;\";\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase JS_READ_NETWORK_RES:\n\t\t\t\tconsole.log(\"get JS_READ_NETWORK_RES!\");\n\t\t\t\t//Read data and save it in \"readResponseNetwork\"\n\t\t\t\tvar readResponseNetwork = new ReadResponseNetwork();\n\t\t\t\treadResponseNetwork.Read(dv, MsgHeader.Size);\n\t\t\t\t//console.log(\"last:\"+readResponseNetwork.byLastReadFromPartition);\n\t\t\t\t//console.log(\"dwOffsetBySector:\"+readResponseNetwork.cNumOfSectors);\n\t\t\t\tvar isChrome = !!window.chrome && !!window.chrome.webstore;\n\t\t\t\tPUIDindex = getPUIDindex(readResponseNetwork.owPUID);\n\t\t\t\tif (readResponseNetwork.dwErrorCode == 0) {\n\t\t\t\t\tif ($(\"#downloadCancelFlag\"+PUIDindex).html()==\"on\") {\n\t\t\t\t\t\t$(\"#downloadProgArea\"+PUIDindex).css(\"visibility\", \"hidden\");\n\t\t\t\t\t\t$(\"#downloadProg\"+PUIDindex).html(\"\");\n\t\t\t\t\t\t$(\"#downloadProg\"+PUIDindex).width(\"0%\");\n\t\t\t\t\t\t$(\"#downloadOffset\"+PUIDindex).html(0);\n\t\t\t\t\t\tbinaryData = null;\n\t\t\t\t\t\t$(\"#downloadCancelFlag\"+PUIDindex).html();\n\t\t\t\t\t\tconsole.log(\"Download Cancelled!\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar offset = parseInt($(\"#downloadOffset\"+PUIDindex).html());\n\t\t\t\t\tvar AlignedImageSize = parseInt($(\"#partImageSize\"+PUIDindex).html()); //qwImageSizeInBytes is sector size alligned\n\n\t\t\t\t\t//Use upload file size to download file with actual size******************This is just for test purpose, backend should provide actual file size*****************\n\t\t\t\t\tvar imageSize = parseInt($(\"#uploadFileSize\"+PUIDindex).html()); //Actual file size in bytes but will be gone if refresh webpage!\n\n\t\t\t\t\tif (imageSize == 0) {\n\t\t\t\t\t\timageSize = AlignedImageSize;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar data = indata.subarray(48);//test code excludes this line\n\n\n\t\t\t\t\tif (imageSize-offset*SECTOR_SIZE_IN_BYTE<readResponseNetwork.cNumOfSectors*SECTOR_SIZE_IN_BYTE) {\n\t\t\t\t\t\tdata = indata.subarray(48,48+imageSize-offset*SECTOR_SIZE_IN_BYTE);\n\t\t\t\t\t}\n\t\t\t\t\t//************************************test code ends*************************************************************************************************************\n\n\n\t\t\t\t\tif (isChrome) {\n\t\t\t\t\t\t//File system API download*****************\n\t\t\t\t\t\tfileStore(PUIDindex, offset, readResponseNetwork.byLastReadFromPartition, data);\n\t\t\t\t\t\t//*************************************\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t//store data in one large blob\n\t\t\t\t\t\tif ( offset == 0) {\n\t\t\t\t\t\t\tbinaryData = new Blob([data],{type: 'application/octet-stream'});\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tbinaryData = new Blob([binaryData,data],{type: 'application/octet-stream'});\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (readResponseNetwork.byLastReadFromPartition == 1) {\n\t\t\t\t\t\t$(\"#downloadProgArea\"+PUIDindex).css(\"visibility\", \"hidden\");\n\t\t\t\t\t\t$(\"#downloadProg\"+PUIDindex).html(\"\");\n\t\t\t\t\t\t$(\"#downloadProg\"+PUIDindex).width(\"0%\");\n\t\t\t\t\t\tif (!isChrome) {\n\t\t\t\t\t\t\twindow.open(URL.createObjectURL(binaryData)); //download file as large blob\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$(\"#downloadOffset\"+PUIDindex).html(0);\n\t\t\t\t\t\tbinaryData = null;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tpercentage = 100*offset*SECTOR_SIZE_IN_BYTE/imageSize;\n\t\t\t\t\t\t$(\"#downloadOffset\"+PUIDindex).html(offset+readResponseNetwork.cNumOfSectors);\n\t\t\t\t\t\t$(\"#downloadProg\"+PUIDindex).html(\"Downloading \"+percentage.toFixed(2).slice(0,-3)+\"%\");\n\t\t\t\t\t\t$(\"#downloadProg\"+PUIDindex).width(percentage+\"%\");\n\t\t\t\t\t\tsendStorageReadNetworkReq(PUIDindex);\n\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t//error\n\t\t\t\t\tconsole.log(\"ErrorCode:\"+readResponseNetwork.dwErrorCode);\n\n\t\t\t\t\t$(\"#downloadProgArea\"+PUIDindex).css(\"visibility\", \"hidden\");\n\t\t\t\t\t$(\"#downloadProg\"+PUIDindex).html(\"\");\n\t\t\t\t\t$(\"#downloadProg\"+PUIDindex).width(\"0%\");\n\t\t\t\t\t$(\"#downloadOffset\"+PUIDindex).html(0);\n\n\t\t\t\t\terrorMsg = parseErrorCode(readResponseNetwork.dwErrorCode);\n\t\t\t\t\tdocument.getElementById(\"downloadErrorMsg\" + PUIDindex).innerHTML = \"Download ErrorCode: 0x\" + Dw2HexString(readResponseNetwork.dwErrorCode) + \"&emsp;&emsp;\" + errorMsg.toUpperCase();\n\t\t\t\t}\n\n\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\talert(\"Undefined command code number:\"+msgHeader.dwCommand);\n\n\t\t}\n\t};\n\tblobReader.readAsArrayBuffer(evt.data);\n}", "function handleData(data) {\n console.log(\"[Gateway] >>>>>>>>>>\", data);\n\n\t/** Parse Packet **/\n\t/** Packet format: \"mac_addr:seq_num:msg_id:payload\" **/\n\t// \"source_mac_addr:seq_num:msg_type:num_hops:payload\"\n\tvar components = data.split(':');\n\tif (components.length !== 5) {\n\t\tconsole.error(\"Invalid minimum packet length\");\n\t\treturn;\n\t}\n\tvar macAddress = parseInt(components[0]),\n\t msgId = parseInt(components[2]),\n\t payload = components[4];\n\n\tswitch(msgId) {\n\t\tcase OUTLET_SENSOR_MESSAGE:\n\t\t\treturn handleSensorDataMessage(macAddress, payload);\n\t\tcase OUTLET_ACTION_ACK_MESSAGE:\n\t\t\treturn handleActionAckMessage(macAddress, payload);\n\t\tdefault:\n\t\t\tconsole.error(`Unknown Message type: ${msgId}`);\n\t}\n}", "onTransportReceiveMsg(messageString) {\n const message = Parser.parseMessage(messageString, this.getLogger(\"sip.parser\"));\n if (!message) {\n this.logger.warn(\"Failed to parse incoming message. Dropping.\");\n return;\n }\n if (this.status === _UAStatus.STATUS_USER_CLOSED && message instanceof IncomingRequestMessage) {\n this.logger.warn(`Received ${message.method} request in state USER_CLOSED. Dropping.`);\n return;\n }\n // A valid SIP request formulated by a UAC MUST, at a minimum, contain\n // the following header fields: To, From, CSeq, Call-ID, Max-Forwards,\n // and Via; all of these header fields are mandatory in all SIP\n // requests.\n // https://tools.ietf.org/html/rfc3261#section-8.1.1\n const hasMinimumHeaders = () => {\n const mandatoryHeaders = [\"from\", \"to\", \"call_id\", \"cseq\", \"via\"];\n for (const header of mandatoryHeaders) {\n if (!message.hasHeader(header)) {\n this.logger.warn(`Missing mandatory header field : ${header}.`);\n return false;\n }\n }\n return true;\n };\n // Request Checks\n if (message instanceof IncomingRequestMessage) {\n // This is port of SanityCheck.minimumHeaders().\n if (!hasMinimumHeaders()) {\n this.logger.warn(`Request missing mandatory header field. Dropping.`);\n return;\n }\n // FIXME: This is non-standard and should be a configruable behavior (desirable regardless).\n // Custom SIP.js check to reject request from ourself (this instance of SIP.js).\n // This is port of SanityCheck.rfc3261_16_3_4().\n if (!message.toTag && message.callId.substr(0, 5) === this.options.sipjsId) {\n this.userAgentCore.replyStateless(message, { statusCode: 482 });\n return;\n }\n // FIXME: This should be Transport check before we get here (Section 18).\n // Custom SIP.js check to reject requests if body length wrong.\n // This is port of SanityCheck.rfc3261_18_3_request().\n const len = str_utf8_length(message.body);\n const contentLength = message.getHeader(\"content-length\");\n if (contentLength && len < Number(contentLength)) {\n this.userAgentCore.replyStateless(message, { statusCode: 400 });\n return;\n }\n }\n // Reponse Checks\n if (message instanceof IncomingResponseMessage) {\n // This is port of SanityCheck.minimumHeaders().\n if (!hasMinimumHeaders()) {\n this.logger.warn(`Response missing mandatory header field. Dropping.`);\n return;\n }\n // Custom SIP.js check to drop responses if multiple Via headers.\n // This is port of SanityCheck.rfc3261_8_1_3_3().\n if (message.getHeaders(\"via\").length > 1) {\n this.logger.warn(\"More than one Via header field present in the response. Dropping.\");\n return;\n }\n // FIXME: This should be Transport check before we get here (Section 18).\n // Custom SIP.js check to drop responses if bad Via header.\n // This is port of SanityCheck.rfc3261_18_1_2().\n if (message.via.host !== this.options.viaHost || message.via.port !== undefined) {\n this.logger.warn(\"Via sent-by in the response does not match UA Via host value. Dropping.\");\n return;\n }\n // FIXME: This should be Transport check before we get here (Section 18).\n // Custom SIP.js check to reject requests if body length wrong.\n // This is port of SanityCheck.rfc3261_18_3_response().\n const len = str_utf8_length(message.body);\n const contentLength = message.getHeader(\"content-length\");\n if (contentLength && len < Number(contentLength)) {\n this.logger.warn(\"Message body length is lower than the value in Content-Length header field. Dropping.\");\n return;\n }\n }\n // Handle Request\n if (message instanceof IncomingRequestMessage) {\n this.userAgentCore.receiveIncomingRequestFromTransport(message);\n return;\n }\n // Handle Response\n if (message instanceof IncomingResponseMessage) {\n this.userAgentCore.receiveIncomingResponseFromTransport(message);\n return;\n }\n throw new Error(\"Invalid message type.\");\n }", "static brokenMsgHandler (rawMsg, conContext) {\n /*\n * Extract the sequence number from the broken message and send a acknowledge message\n */\n KnxNetProtocolExtra.sendAck(KnxNetProtocolExtra.msgGetSeqnum(rawMsg), conContext)\n }", "onReceiveError( pdu ) {\n //console.log( 'JCOM1939 RX Error');\n this.rxErrors++;\n }", "function handleMsg(parsed) {\n // Check the type of this message.\n if (parsed.type === 'APP_MANIFEST_OK' || 'APP_MANIFEST_FAIL') {\n var dependencies = app.manifestCheck(parsed);\n verified = true;\n\n } else if (parsed.type === 'MSG_QUERY') {\n console.log('Query received');\n\n } else if (parsed.type === 'MSG_QUERY_SUCCESS') {\n console.log('Query successful');\n\n } else if (parsed.type === 'MSG_QUERY_FAIL') {\n console.error('Query Failed.');\n throw parsed.data.message;\n\n } else {\n console.log('Message Receieved');\n console.log(' - Type: ' + parsed.type);\n console.log(' - Message:' + JSON.stringify(parsed.data));\n }\n \n if (verified) {\n data = {\n text: \"Pickle Unicorns\",\n targetSpeaker: \"speakers\"\n }\n //app.query(client, 'tts', 'stream', data, ['text2speech'], 30);\n }\n \n if (dependencies) {\n \tif (dependencies.logger == 'up'){\n \t\tapp.up(client);\n \t}\n }\n}", "static rawMsgHandler (rawMsg, rawMsgJson, conContext) {\n /*\n * Check the type of the message - only TUNNELING_REQUESTs are relevant\n */\n if (rawMsgJson.service_type === KnxConstants.SERVICE_TYPE.TUNNELING_REQUEST) {\n /*\n * Check if this message sets of any custom handlers (see checkCallCustomMsgHandler() below)\n */\n CustomMsgHandlers.checkCallCustomMsgHandler(rawMsgJson, conContext)\n\n if (conContext.handlers) {\n if (conContext.handlers.rawMsgCb) {\n /*\n * Construct the raw bus message and pass it on along with rawMsgJson\n */\n conContext.handlers.rawMsgCb(KnxNetProtocolExtra.rebuildMessageBytes(rawMsg), rawMsgJson)\n }\n }\n }\n }", "receiveInput(input) {\n input = input.toString();\n if (input.length > 2) {\n throw new Error(\"Invalid input received\");\n } else if (Calc._isNumberInput(input)) {\n this._handleNumberInput(input);\n } else if (Calc._isEqualInput(input)) {\n this._handleEqual();\n } else if (Calc._isResetInput(input)) {\n this._handleReset();\n } else if (Calc._isOperationInput(input)) {\n this._handleOperationInput(input);\n } else {\n throw new Error(\"Invalid input received\");\n }\n }", "function handleMessage(msgEvent) {\n var ev, h;\n\n try {\n ev = JSON.parse(msgEvent.data);\n } catch (e) {\n $log.error('Message.data is not valid JSON', msgEvent.data, e);\n return null;\n }\n if (fs.debugOn('txrx')) {\n $log.debug(' << *Rx* ', ev.event, ev.payload);\n }\n\n if (h = handlers[ev.event]) {\n try {\n h(ev.payload);\n } catch (e) {\n $log.error('Problem handling event:', ev, e);\n return null;\n }\n } else {\n $log.warn('Unhandled event:', ev);\n }\n\n }", "function handler(buffer) {\n let chunks = buffer.toString().split(\"\\n\");\n\n for (let chunk of chunks) {\n chunk = chunk.replace(/(\\r\\n|\\n|\\r)/gm, \"\").trim();\n\n if (chunk == \"OK\") {\n // if end of message stop listner and return result\n this.removeListener(\"data\", handler);\n resolve(answer);\n\n // if line is busy or another but not error\n } else if (chunk == \"BUSY\" || chunk == \"NO DIAL TONE\" || chunk == \"NO CARRIER\") {\n resolve();\n\n } else if (chunk == \"ERROR\") {\n this.removeListener(\"data\", handler);\n reject(`ERROR result on command - ${command}. Answer - ${chunk}`);\n\n } else {\n // if message is not fully get add to result this chunk\n answer += chunk;\n };\n };\n }", "_handle(data) {\n // TODO: json-schema validation of received message- should be pretty straight-forward\n // and will allow better documentation of the API\n let msg;\n try {\n msg = deserialise(data);\n } catch (err) {\n this._logger.push({ data }).log('Couldn\\'t parse received message');\n this.send(build.ERROR.NOTIFY.JSON_PARSE_ERROR());\n }\n this._logger.push({ msg }).log('Handling received message');\n switch (msg.msg) {\n case MESSAGE.CONFIGURATION:\n switch (msg.verb) {\n case VERB.NOTIFY:\n case VERB.PATCH: {\n const dup = JSON.parse(JSON.stringify(this._appConfig)); // fast-json-patch explicitly mutates\n jsonPatch.applyPatch(dup, msg.data);\n this._logger.push({ oldConf: this._appConfig, newConf: dup }).log('Emitting new configuration');\n this.emit(EVENT.RECONFIGURE, dup);\n break;\n }\n default:\n this.send(build.ERROR.NOTIFY.UNSUPPORTED_VERB(msg.id));\n break;\n }\n break;\n default:\n this.send(build.ERROR.NOTIFY.UNSUPPORTED_MESSAGE(msg.id));\n break;\n }\n\n }", "function HandleData(data)\n{\n var avrNum = this.avrNum;\n if (avrNum == null) {\n Log('Data from unknown device!');\n return;\n }\n var str = data.toString();\n // wait for null at end of string\n var j = str.indexOf('\\0');\n if (j > -1) str = str.substr(0, j); // remove null\n // process each response separately\n var lines = str.split(\"\\n\");\n var id;\n for (j=0; j<lines.length; ++j) {\n var str = lines[j];\n if (!str.length) continue;\n if (str.length >= 4 && str.substr(1,1) == '.') {\n id = str.substr(0,1);\n str = str.substr(2);\n }\n if (id != 'e') {\n if (str.substr(0,2) != 'OK') {\n Log('AVR'+avrNum, 'Bad response:', str);\n continue;\n }\n str = str.substr(3);\n }\n // ignore truncated responses (may happen at startup if commands\n // were sent before AVR was fully initialized)\n if (!id) continue;\n avrOK[avrNum] = 1;\n avrNum = HandleResponse(avrNum, id, str);\n }\n}", "ondecoded(packet) {\n // the nextTick call prevents an exception in a user-provided event listener from triggering a disconnection due to a \"parse error\"\n nextTick(() => {\n this.emitReserved(\"packet\", packet);\n }, this.setTimeoutFn);\n }", "handleMessage(message) {\n console.log('lmsDemo2: message received:' + JSON.stringify(message));\n if(message.FromWhom == 'lmsdemo1'){\n this.msgrcvd = message.ValuePass;\n }\n }", "ondecoded(packet) {\n super.emit(\"packet\", packet);\n }", "ondecoded(packet) {\n super.emit(\"packet\", packet);\n }", "ondecoded(packet) {\n super.emit(\"packet\", packet);\n }", "function incoming(self, packet)\n{\n debug(\"INCOMING\", self.hashname, packet.id, \"packet from\", packet.from.address, packet.js, packet.body && packet.body.toString());\n\n // signed packets must be processed and verified straight away\n if(packet.js.sig) inSig(self, packet);\n\n // make sure any to is us (for multihosting)\n if(packet.js.to)\n {\n if(packet.js.to !== self.hashname) return warn(\"packet for\", packet.js.to, \"is not us\");\n delete packet.js.to;\n }\n\n // copy back their sender name if we don't have one yet for the \"to\" on answers\n if(!packet.from.hashname && dhash.isSHA1(packet.js.from)) packet.from.hashname = packet.js.from;\n\n // these are only valid when requested, no trust needed\n if(packet.js.popped) inPopped(self, packet);\n\n // new line creation\n if(packet.js.open) inOpen(self, packet);\n\n // incoming lines can happen out of order or before their open is verified, queue them\n if(packet.js.line)\n {\n // a matching line is required\n packet.line = packet.from = self.lines[packet.js.line];\n if(!packet.line) return queueLine(self, packet);\n packet.line.recvAt = Date.now();\n delete packet.js.line;\n }\n \n // must decrypt and start over\n if(packet.line && packet.js.cipher)\n {\n debug(\"deciphering!\")\n var aes = crypto.createDecipher(\"AES-128-CBC\", packet.line.openSecret);\n var deciphered = decode(Buffer.concat([aes.update(packet.body), aes.final()]));\n deciphered.id = packet.id + (packet.id * .2);\n deciphered.from = packet.from;\n deciphered.ciphered = true;\n return incoming(self, deciphered);\n }\n\n // any ref must be validated as someone we're connected to\n if(packet.js.ref)\n {\n var ref = seen(self, packet.js.ref);\n if(!ref.line) return warn(\"invalid ref of\", packet.js.ref, \"from\", packet.from);\n packet.ref = ref;\n delete packet.js.ref;\n }\n\n // process the who \"key\" responses since we know the sender best now\n if(packet.js.key) inKey(self, packet);\n\n // answer who/see here so we have the best from info to decide if we care\n if(packet.js.who) inWho(self, packet);\n if(packet.js.see) inSee(self, packet);\n\n // everything else must have some level of from trust!\n if(!packet.line && !packet.signed && !packet.ref) return inApp(self, packet);\n\n if(dhash.isSHA1(packet.js.seek)) inSeek(self, packet);\n if(packet.js.pop) inPop(self, packet);\n\n // now, only proceed if there's a line\n if(!packet.line) return inApp(self, packet);\n\n // these are line-only things\n if(packet.js.popping) inPopping(self, packet);\n\n // only proceed if there's a stream\n if(!packet.js.stream) return inApp(self, packet);\n\n // this makes sure everything is in sequence before continuing\n inStream(self, packet);\n\n}", "ondecoded(packet) {\n this.emitReserved(\"packet\", packet);\n }", "function handleMessage(event) {\r\n\t\t//console.log('Received message: ' + event.data);\r\n\t\tvar data = JSON.parse(event.data);\r\n\t\thandleReceiveData(data);\r\n\t}", "dataMessage () {\n if (this._fin) {\n const messageLength = this._messageLength;\n const fragments = this._fragments;\n\n this._totalPayloadLength = 0;\n this._messageLength = 0;\n this._fragmented = 0;\n this._fragments = [];\n\n if (this._opcode === 2) {\n var data;\n\n if (this._binaryType === 'nodebuffer') {\n data = toBuffer(fragments, messageLength);\n } else if (this._binaryType === 'arraybuffer') {\n data = toArrayBuffer(toBuffer(fragments, messageLength));\n } else {\n data = fragments;\n }\n\n this.onmessage(data);\n } else {\n const buf = toBuffer(fragments, messageLength);\n\n if (!Validation(buf)) {\n this.error(new Error('invalid utf8 sequence'), 1007);\n return;\n }\n\n this.onmessage(buf.toString());\n }\n }\n\n this._state = GET_INFO;\n }", "ondecoded(packet) {\n this.emitReserved(\"packet\", packet);\n }", "_onData (data) {\n try {\n const message = JSON.parse(data);\n if (typeof message !== 'object' || !message.type) {\n error('Malformed message:', message);\n return panic('Malformed message');\n }\n this._emit('message', message);\n } catch (e) {\n if (e instanceof SyntaxError) {\n error('Non JSON format:', data, e);\n return panic('Non JSON format');\n }\n throw e;\n }\n }", "function handleChangedValue(event) {\r\n \t let decoder = new TextDecoder('utf-8');\r\n \t let value = event.target.value\r\n \t var now = new Date()\r\n \t console.log('> ' + now.getHours() + ':' + now.getMinutes() + ':' + now.getSeconds() + ' Received message is: ' + decoder.decode(value) );\r\n\t mDebugMsg1(1,'> ' + now.getHours() + ':' + now.getMinutes() + ':' + now.getSeconds() + ' Received message is: ' + decoder.decode(value) );\r\n \t receivedValue=value;\r\n\t serial.onReceive(receivedValue);\r\n //\t MessageReceived = receivedValue;\r\n mDebugMsg1(1,\"CONNECTED, Acquiring data\");\r\n \t isBTConnected = true;\r\n }", "function handleTransmission(data)\n{\n var numMessages = data[0]\n var len = data.length\n var currentIndex = 0\n var currentTransmission = 0\n\n for (var index = 1; index < len; index++)\n {\n var dataItem = data[index]\n if (currentIndex == 0)\n {\n //address\n }\n\n else if (currentIndex == 1)\n {\n //data len\n\n }\n\n else\n {\n //data\n }\n\n }\n\n\n}", "dataMessage () {\n if (this.fin) {\n const messageLength = this.messageLength;\n const fragments = this.fragments;\n\n this.totalPayloadLength = 0;\n this.messageLength = 0;\n this.fragmented = 0;\n this.fragments = [];\n\n if (this.opcode === 2) {\n var data;\n\n if (this.binaryType === 'nodebuffer') {\n data = toBuffer(fragments, messageLength);\n } else if (this.binaryType === 'arraybuffer') {\n data = toArrayBuffer(toBuffer(fragments, messageLength));\n } else {\n data = fragments;\n }\n\n this.onmessage(data, { masked: this.masked, binary: true });\n } else {\n const buf = toBuffer(fragments, messageLength);\n\n if (!isValidUTF8(buf)) {\n this.error(new Error('invalid utf8 sequence'), 1007);\n return;\n }\n\n this.onmessage(buf.toString(), { masked: this.masked });\n }\n }\n\n this.state = GET_INFO;\n }", "function onMessageReceived(event){\n\t\ttry{\n\t\t\tvar message = event.data;\n\t\t\tvar json = JSON.parse(message);\n\t\t\t\n\t\t\tif(json.errorMessage){\n\t\t\t\tconsole.log(\"Error message received from server (control unit), error message was: \" + json.errorMessage);\n\t\t\t}else if(json.propertyName && json.propertyValue !== undefined){\n\t\t\t\tsetPropertyValue(json.propertyName, json.propertyValue);\n\t\t\t}else if(json.methodName && json.methodParameters){\n\t\t\t\tcallMethod(json.methodName, json.methodParameters);\n\t\t\t}else{\n\t\t\t\tconsole.log(\"Invalid incoming data from server, expected data to contain propertyName and propertyValue\");\n\t\t\t}\n\t\t}catch(e){\n\t\t\tconsole.log(\"onMessageReceived, Exception occured with message: \" + e.message);\n\t\t\tconsole.log(e.stack);\n\t\t}\n\t}", "function messageHandler (msg) {\n\ttry {\n\t var command = JSON.parse(msg.getData());\n\t switch (command.Name) {\n\t\tcase 'SetTemperature':\n\t\t var temperatura = command.Parameters.Temperatura;\n\t\t console.log (\"\")\n\t\t console.log (\">>>>>> Receiving command <SetTemperature>. Toggling the relay\");\n\t\t console.log (\"\")\n\t\t relayDevice.toggle ()\n\t\t client.complete(msg, printErrorFor('complete'));\n\t\t break;\n\t\tdefault:\n\t\t console.error('Unknown command: ' + command.Name);\n\t\t client.reject(msg, printErrorFor('complete'));\n\t\t break;\n\t }\n\t}\n\tcatch (err) {\n\t printErrorFor('parse received message')(err);\n\t client.reject(msg, printErrorFor('reject'));\n\t}\n}", "processSid() {\n let input = this.sid\n resetError(input)\n this.changed = true\n\n if (isEmpty(input)) {\n this.valid = false\n } else if (isNumber(input)) {\n this.valid = false\n } else if (exact(input, 10)) {\n this.valid = false\n } else {\n input.success = true\n this.valid = true\n }\n }", "handleMessage(e){\n\n console.log(\"received message with id: \", e.data.id, \"; message was: \", e);\n\n switch (e.data.id) {\n\n case \"quantization\":\n this._quantOpt = e.data.quantOpt;\n this._quantBits = e.data.quantBits;\n break;\n\n case \"reverseK\":\n this._reverseKOpt = e.data.reverseKOpt;\n break;\n\n case \"perfectSynth\":\n this._perfectSynthOpt = e.data.perfectSynthOpt;\n break;\n\n case \"resampling\":\n this._resamplingFactor = e.data.resampFactor;\n this._resampler.update(this._resamplingFactor);\n break;\n\n case \"voicedThreshold\":\n this._confidenceTonalThreshold = e.data.voicedThreshold;\n break;\n\n case \"pitchFactor\":\n this._pitchFactor = e.data.pitchFactor;\n break;\n\n case \"voiceMap\":\n // Voiced / Unvoiced Synthesis\n this._unvoicedMix = e.data.unvoicedMix;\n this._confidenceTonalThreshold = e.data.voicedThreshold;\n // Resampling (vocal tract length)\n if (e.data.vocalTractFactor != this._resamplingFactor){\n this._resamplingFactor = e.data.vocalTractFactor;\n this._resampler.update(this._resamplingFactor);\n }\n // Pitch modifier\n this._pitchFactor = e.data.pitchFactor;\n // Vibrato\n //e.data.vibratoEffect;\n break;\n\n case \"options\":\n // Receive all options\n this._perfectSynthOpt = e.data.perfectSynthOpt;\n this._quantOpt = e.data.quantOpt;\n this._quantBits = e.data.quantBits;\n this._reverseKOpt = e.data.reverseKOpt;\n if (e.data.vocalTractFactor != this._resamplingFactor){\n this._resamplingFactor = e.data.vocalTractFactor;\n this._resampler.update(this._resamplingFactor);\n }\n this._confidenceTonalThreshold = e.data.voicedThreshold;\n this._pitchFactor = e.data.pitchFactor;\n break;\n\n\n default: // any unknown ID: log the message ID\n console.log(\"unknown message received:\")\n console.log(e.data)\n }\n }", "_onData(data) {\n\n let me = this;\n\n me._rxData = me._rxData + data.toString();\n\n // If we are waiting for a response from the device, see if this is it\n if(this.requestQueue.length > 0) {\n\n let cmd = me.requestQueue[0];\n\n if(me._rxData.search(cmd.regex) > -1) {\n // found what we are looking for\n\n\n // Cancel the no-response timeout because we have a response\n if(cmd.timer !== null) {\n clearTimeout(cmd.timer);\n cmd.timer = null;\n }\n\n // Signal the caller with the response data\n if(cmd.cb) {\n cmd.cb(null, me._rxData);\n }\n\n // Remove the request from the queue\n me.requestQueue.shift();\n\n // discard all data (this only works because we only send one\n // command at a time...)\n me._rxData = '';\n }\n } else if(me.isReady) {\n\n let packets = me._rxData.split(';');\n\n if(packets.length > 0) {\n\n\n // save any extra data that's not a full packet for next time\n me._rxData = packets.pop();\n\n packets.forEach(function(packet) {\n\n let fields = packet.match(/:([SX])([0-9A-F]{1,8})N([0-9A-F]{0,16})/);\n\n if(fields) {\n\n let id = 0;\n let ext = false,\n data;\n\n try {\n\n data = Buffer.from(fields[3], 'hex');\n id = parseInt(fields[2], 16);\n\n if(fields[1] === 'X') {\n ext = true;\n }\n\n } catch (err) {\n // we sometimes get malformed packets (like an odd number of hex digits for the data)\n // I dunno why that is, so ignore them\n // console.log('onData error: ', fields, err);\n }\n\n if(id > 0) {\n // emit a standard (non-J1939) message\n me.push({\n id: id,\n ext: ext,\n buf: data\n });\n\n }\n\n }\n });\n }\n }\n }", "handler_DATA(command, callback) {\n if (!this.session.envelope.rcptTo.length) {\n this.send(503, 'Error: need RCPT command');\n return callback();\n }\n\n if (!this._parser) {\n return callback();\n }\n\n this._dataStream = this._parser.startDataMode(this._server.options.size);\n\n let close = (err, message) => {\n let i, len;\n\n this._server.logger.debug(\n {\n tnx: 'data',\n cid: this.id,\n bytes: this._parser.dataBytes,\n user: (this.session.user && this.session.user.username) || this.session.user\n },\n 'C: <%s bytes of DATA>',\n this._parser.dataBytes\n );\n\n if (typeof this._dataStream === 'object' && this._dataStream && this._dataStream.readable) {\n this._dataStream.removeAllListeners();\n }\n\n if (err) {\n if (this._server.options.lmtp) {\n // separate error response for every recipient when using LMTP\n for (i = 0, len = this.session.envelope.rcptTo.length; i < len; i++) {\n this.send(err.responseCode || 450, err.message);\n }\n } else {\n // single error response when using SMTP\n this.send(err.responseCode || 450, err.message);\n }\n } else if (Array.isArray(message)) {\n // separate responses for every recipient when using LMTP\n message.forEach(response => {\n if (/Error\\]$/i.test(Object.prototype.toString.call(response))) {\n this.send(response.responseCode || 450, response.message);\n } else {\n this.send(250, typeof response === 'string' ? response : 'OK: message accepted');\n }\n });\n } else if (this._server.options.lmtp) {\n // separate success response for every recipient when using LMTP\n for (i = 0, len = this.session.envelope.rcptTo.length; i < len; i++) {\n this.send(250, typeof message === 'string' ? message : 'OK: message accepted');\n }\n } else {\n // single success response when using SMTP\n this.send(250, typeof message === 'string' ? message : 'OK: message queued');\n }\n\n this._transactionCounter++;\n\n this._unrecognizedCommands = 0; // reset unrecognized commands counter\n this._resetSession(); // reset session state\n\n if (typeof this._parser === 'object' && this._parser) {\n this._parser.continue();\n }\n };\n\n this._server.onData(this._dataStream, this.session, (err, message) => {\n // ensure _dataStream is an object and not set to null by premature closing\n // do not continue until the stream has actually ended\n if (typeof this._dataStream === 'object' && this._dataStream && this._dataStream.readable) {\n this._dataStream.on('end', () => close(err, message));\n return;\n }\n close(err, message);\n });\n\n this.send(354, 'End data with <CR><LF>.<CR><LF>');\n callback();\n }", "messageReceived(participant, payload) {\n // Listen to E2E PING requests and responses from other participants\n // in the conference.\n if (payload.type === E2E_PING_REQUEST) {\n this.handleRequest(participant.getId(), payload);\n } else if (payload.type === E2E_PING_RESPONSE) {\n this.handleResponse(participant.getId(), payload);\n }\n }", "onDataReceived(data) {\n /*\n All received data is appended to a ReceiveBuffer.\n This makes sure that all the data we need is received before we attempt to process it.\n */\n this._receiveBuffer.append(data);\n // Process data that we have.\n this.processData();\n }", "function handleReceiveData(data) {\r\n\t\tif (\"orden\" in data) {\r\n\t\t\tif (data.orden == \"takeoff\") {\r\n\t\t\t\tarDrone.takeoff();\r\n\t\t\t} else if (data.orden == \"land\") {\r\n\t\t\t\tarDrone.land();\r\n\t\t\t} else {\r\n\t\t\t\tconsole.log(\"Orden no valida. \");\r\n\t\t\t}\r\n\t\t} else if (\"x\" in data) {\r\n\t\t\tarDrone.setXYValues(data.x, data.y);\r\n\t\t} else if (\"alt\" in data) {\r\n\t\t\tarDrone.setAltYaw(data.alt, data.yaw);\r\n\t\t} else {\r\n\t\t\tconsole.log(\"Dato invalido. \");\r\n\t\t}\t\t\r\n\t}", "function processMessage(node,msg) {\n var result = {};\n var f;\n f = msg.payload.trim();\n if (f) {\n try {\n result = processFragment(node,f);\n }\n catch (err) {\n result = {\"aisOriginal\": [f], \"errorInfo\": \"Javascript \"+err.name+\": \"+err.message};\n }\n if (result===null) {\n // Partial message\n msg.payload = undefined;\n msg.resultCode = 2;\n } else {\n if (result.errorInfo) {\n // Erroneous message\n msg.payload = undefined;\n msg.errorInfo = result.errorInfo;\n msg.originalAisMessage = result.aisOriginal;\n msg.resultCode = 3;\n } else {\n // Message decoded successfully\n msg.originalAisMessage = result.aisOriginal;\n delete result.aisOriginal;\n msg.payload = result;\n msg.payload.talkerId = msg.originalAisMessage[0].slice(1,3);\n msg.payload.sentenceId = msg.originalAisMessage[0].slice(3,6);\n msg.resultCode = 0;\n addTextFields(msg);\n }\n }\n } else {\n // Empty message\n msg.payload = undefined;\n msg.resultCode = 1;\n }\n node.send(msg);\n}", "_receiveMessage (peerId, incoming, callback) {\n this._log(`received MSG from ${peerId.toB58String()} ${incoming.hello.eth.toString()}`)\n this.notifications.receivedMsg(peerId, incoming)\n\n if (incoming.fragments.size === 0) {\n return callback()\n }\n\n const fragments = Array.from(incoming.fragments.values())\n each(fragments, (fragment, cb) => {\n // TODO process commands here.\n switch (fragment.type) {\n case 1:\n // command\n this._log(`received Command : ${fragment.payload.toString()}`)\n this._processCommand(peerId, fragment)\n break\n case 2:\n // response\n this._log(`received response ${fragment.tid.toString()} : ${fragment.payload.toString()}`)\n this._processResponse(peerId, fragment)\n break\n default:\n callback(new Error('unknown fragment type'))\n }\n\n cb()\n }, callback)\n }", "dataMessage () {\n\t if (this.fin) {\n\t const messageLength = this.messageLength;\n\t const fragments = this.fragments;\n\n\t this.totalPayloadLength = 0;\n\t this.messageLength = 0;\n\t this.fragmented = 0;\n\t this.fragments = [];\n\n\t if (this.opcode === 2) {\n\t var data;\n\n\t if (this.binaryType === 'nodebuffer') {\n\t data = toBuffer(fragments, messageLength);\n\t } else if (this.binaryType === 'arraybuffer') {\n\t data = toArrayBuffer(toBuffer(fragments, messageLength));\n\t } else {\n\t data = fragments;\n\t }\n\n\t this.onmessage(data, { masked: this.masked, binary: true });\n\t } else {\n\t const buf = toBuffer(fragments, messageLength);\n\n\t if (!isValidUTF8(buf)) {\n\t this.error(new Error('invalid utf8 sequence'), 1007);\n\t return;\n\t }\n\n\t this.onmessage(buf.toString(), { masked: this.masked });\n\t }\n\t }\n\n\t this.state = GET_INFO;\n\t }", "function Submit(UserNumber, MessageCoding, MessageContent, options) {\n\tif (arguments.length === 0) return; // it is for receiver to parse PDU only\n\tvar myOptions = {};\n\tmyOptions.__proto__ = defOptions;\n\n\tif (options) {\n\t\tif (!(options instanceof Array))\n\t\t\toptions = [options];\n\t\toptions.forEach(function(opt) {\n\t\t\tif (opt instanceof String) {\n\t\t\t\toverride2(myOptions, cannedOptions[opt]);\n\t\t\t} else if (typeof opt === 'object') {\n\t\t\t\toverride2(myOptions, opt);\n\t\t\t} else {\n\t\t\t\tthrow new Error('options must be cannedOptions ID or options name-value pair object!');\n\t\t\t}\n\t\t});\n\t}\n\tthis.options = myOptions;\n\n\tif (UserNumber instanceof Array) {\n\t\tthis.UserCount = UserNumber.length;\n\t\tthis.UserNumber = UserNumber;\n\t} else {\n\t\tthis.UserCount = 1;\n\t\tthis.UserNumber = [UserNumber];\n\t}\n\n\tthis.MessageCoding = MessageCoding; // todo: for digit id only or automatic detected, default to what ??\n\n\tif (MessageContent instanceof Buffer) {\n\t\tthis.MessageContent = MessageContent;\n\t} else {\n\t\tthis.MessageContentOrigin = MessageContent;\n\t\tswitch (MessageCoding) {\n\t\t\tcase 0: // acsii\n\t\t\t\tthis.MessageContent = new Buffer(MessageContent, 'ascii');\n\t\t\t\tbreak;\n\t\t\tcase 8: // ucs2\n\t\t\t\tvar bin = new Buffer(MessageContent, 'ucs2');\n\t\t\t\tfor (var i = 0, len = bin.length; i < len; i += 2) {\n\t\t\t\t\tbin.writeUInt16BE(bin.readUInt16LE(i), i);\n\t\t\t\t}\n\t\t\t\tthis.MessageContent = bin;\n\t\t\t\tbreak;\n\t\t\tcase 4: // binary\n\t\t\t\tthis.MessageContent = new Buffer(MessageContent, 'hex');\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Error('only encoding 0-ascii, 8-usc2, 4-binary(hex) is supported');\n\t\t}\n\t}\n\n\tvar msglen = this.MessageLength = this.MessageContent.length;\n\n\tif (msglen > 254) {\n\t\t// save original attributes\n\t\tthis.MessageContentLong = this.MessageContent;\n\t\tthis.MessageLengthLong = msglen;\n\n\t\tvar splits = this.splits = this.lackAckCnt = Math.ceil(msglen / (140 - 6));\n\t\tvar parts = this.MessageContentParts = new Buffer(msglen + 6 * splits);\n\t\tvar batchID = Math.random() * 256;\n\t\tfor (var i = 0; i < splits; i++) {\n\t\t\t(new Buffer([0x05, 0x00, 0x03, batchID, splits, i + 1])).copy(parts, i * 140);\n\t\t\tthis.MessageContentLong.slice(i * (140 - 6), Math.min((i + 1) * (140 - 6), msglen)).copy(parts, i * 140 + 6);\n\t\t}\n\n\t\t// set to first part\n\t\tthis.MessageLength = 140;\n\t\tthis.MessageContent = parts.slice(0, 140);\n\t\tthis.options['TP_udhi'] = 1;\n\t} else {\n\t\tthis.lackAckCnt = 1;\n\t}\n}", "function onData(d){\n var frame,\n generatedData,\n response;\n\n frame = TBus.parse(d);\n\n if(!frame.valid){\n console.log(\"Invalid frame received.\");\n return;\n }\n\n if(!Devices[frame.receiver[0]]){\n console.log(\"Device is not supported.\");\n }\n\n generatedData = Devices[frame.receiver[0]].randomData();\n response = TBus.prepareCommand(frame.sender, frame.receiver, generatedData);\n\n setTimeout(function(){\n /*\n var one,\n two;\n\n one = new Buffer(response.slice(0,5));\n two = new Buffer(response.slice(5,response.length));\n serialPort.write(one);\n setTimeout(function(){\n serialPort.write(two);\n },110);\n */\n serialPort.write(response);\n },0);\n}", "_parseEventForParameterNumber(event) {\n // To make it more legible\n const controller = event.message.dataBytes[0];\n const value = event.message.dataBytes[1]; // A. Check if the message is the start of an RPN (101) or NRPN (99) parameter declaration.\n\n if (controller === 99 || controller === 101) {\n this._nrpnBuffer = [];\n this._rpnBuffer = [];\n\n if (controller === 99) {\n // 99\n this._nrpnBuffer = [event.message];\n } else {\n // 101\n // 127 is a reset so we ignore it\n if (value !== 127) this._rpnBuffer = [event.message];\n } // B. Check if the message is the end of an RPN (100) or NRPN (98) parameter declaration.\n\n } else if (controller === 98 || controller === 100) {\n if (controller === 98) {\n // 98\n // Flush the other buffer (they are mutually exclusive)\n this._rpnBuffer = []; // Check if we are in sequence\n\n if (this._nrpnBuffer.length === 1) {\n this._nrpnBuffer.push(event.message);\n } else {\n this._nrpnBuffer = []; // out of sequence\n }\n } else {\n // 100\n // Flush the other buffer (they are mutually exclusive)\n this._nrpnBuffer = []; // 127 is a reset so we ignore it\n\n if (this._rpnBuffer.length === 1 && value !== 127) {\n this._rpnBuffer.push(event.message);\n } else {\n this._rpnBuffer = []; // out of sequence or reset\n }\n } // C. Check if the message is for data entry (6, 38, 96 or 97). Those messages trigger events.\n\n } else if (controller === 6 || controller === 38 || controller === 96 || controller === 97) {\n if (this._rpnBuffer.length === 2) {\n this._dispatchParameterNumberEvent(\"rpn\", this._rpnBuffer[0].dataBytes[1], this._rpnBuffer[1].dataBytes[1], event);\n } else if (this._nrpnBuffer.length === 2) {\n this._dispatchParameterNumberEvent(\"nrpn\", this._nrpnBuffer[0].dataBytes[1], this._nrpnBuffer[1].dataBytes[1], event);\n } else {\n this._nrpnBuffer = [];\n this._rpnBuffer = [];\n }\n }\n }", "function parseMessage(msg) {\n var json = JSON.parse(msg);\n\n if(json.phoneID != undefined) {\n // phoneID given, nice - let's go\n if(phoneId == null) { // only once, server may send id multiple times\n phoneId = json.phoneID;\n log('Step 1/3: PhoneID '+phoneId);\n\n sendSyncEnd();\n }\n\n // next step: end sync\n socket.onmessage = null;\n } else {\n //retryConnection();\n }\n}", "function handleUSSDRequest(request) {\n\t// Call processUSSDRequest to parse the data from the USSD input request\n\t// object\n\tvar inputObj = gateway.processUSSDRequest(request);\n\tif (!router.getRoutes()) {\n\t\trouter.addRoutes(routingRules);\n\t}\n\t// This is state machine code which will return the response\n\tvar routerData = router.handleRoute(inputObj.state, inputObj.input, inputObj);\n\t// From the state machine response prepare the final response based on the\n\t// gateway format and return\n\treturn gateway.buildUSSDResponse(routerData.nextState, routerData.message, inputObj, routerData.isEnd);\n}", "readFromDevice() {\n this.device.transferIn(5, 64).then(result => {\n const decoder = new TextDecoder();\n this.rstring += decoder.decode(result.data);\n // do a quick JSON smoketest (should do better with decoder/streaming)\n const startIdx = this.rstring.indexOf('{');\n if(startIdx > 0) this.rstring = this.rstring.substring(startIdx);\n const endIdx = this.rstring.indexOf('}');\n if(endIdx > -1) {\n const parseStr = this.rstring.substring(0, endIdx+1);\n this.rstring = this.rstring.substring(endIdx+1);\n try {\n const msg = JSON.parse(parseStr);\n this._handleMessage(msg);\n // this.dispatchEvent(new CustomEvent('ek-event', {detail:msg}), {bubbles: true});\n } catch(e) {\n console.log(\"NOT JSON:\",parseStr);\n }\n this.rstring = \"\";\n }\n this.readFromDevice();\n })\n .catch(error => { \n console.log(error);\n this.emitMessage(this.device.serialNumber, \"\");\n this.emitDisconnected(this.device.serialNumber);\n this.device = null;\n this.rstring = \"\";\n });\n }", "async handle(data) {\n return SMS.send({\n view: data.template,\n data: data.data,\n to: data.to,\n is_fast: data.is_fast\n })\n }", "function handleMessage(e) {\n\t\tif (!e.data) return;\n\n\t\tvar payload;\n\t\ttry {\n\t\t\tpayload = JSON.parse(e.data);\n\t\t} catch (e) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!payload) return;\n\n\t\tvar handler = handlers[payload.event];\n\t\tif (handler) {\n\t\t\thandler(e.source, payload);\n\t\t}\n\t}", "_dataReceived(data) {\n this._rawData = data;\n this._data = JSON.parse(this._rawData);\n try {\n this._initialise();\n } catch(e) {\n console.error(e.message);\n }\n }", "validate() {\n var _a;\n if (((_a = this.message) === null || _a === void 0 ? void 0 : _a.type) === message_1.MessageType.PersistentHarvestingDelegationMessage) {\n if (this.mosaics.length > 0) {\n throw new Error('PersistentDelegationRequestTransaction should be created without Mosaic');\n }\n else if (!/^[0-9a-fA-F]{264}$/.test(this.message.payload)) {\n throw new Error('PersistentDelegationRequestTransaction message is invalid');\n }\n }\n }", "function handleValidate ($node) {\n const validate = $node.validate\n if (!validate || !$node.hasProperty(\"oninput\")) return\n\n $node.addEventListener(\"input\", () => {\n $node.setCustomValidity(\"\")\n timeout(0).then(() => validateNodeValue($node, validate))\n })\n delete $node.validate\n}", "function handleMessage(request) {\n log.log('[' + id + '] handle message:', request, request.type);\n if (request.type == 'recording') {\n recording = request.value;\n } else if (request.type == 'params') {\n updateParams(request.value);\n } else if (request.type == 'wait') {\n checkWait(request.target);\n } else if (request.type == 'propertyReplacement') {\n\tpropertyReplacement(request);\n } else if (request.type == 'type') {\n\ttype(request);\n } else if (request.type == 'select') {\n\tselect(request);\n } else if (request.type == 'copy') {\n\tcopy(request);\n } else if (request.type == 'paste') {\n\tpaste(request);\n } else if (request.type == 'event') {\n simulate(request);\n } else if (request.type == 'snapshot') {\n port.postMessage({type: 'snapshot', value: snapshotDom(document)});\n } else if (request.type == 'reset') {\n reset();\n } else if (request.type == 'url') {\n port.postMessage({type: 'url', value: document.URL});\n }\n}", "dataMessage () {\n\t if (this._fin) {\n\t const messageLength = this._messageLength;\n\t const fragments = this._fragments;\n\n\t this._totalPayloadLength = 0;\n\t this._messageLength = 0;\n\t this._fragmented = 0;\n\t this._fragments = [];\n\n\t if (this._opcode === 2) {\n\t var data;\n\n\t if (this._binaryType === 'nodebuffer') {\n\t data = toBuffer(fragments, messageLength);\n\t } else if (this._binaryType === 'arraybuffer') {\n\t data = toArrayBuffer(toBuffer(fragments, messageLength));\n\t } else {\n\t data = fragments;\n\t }\n\n\t this.onmessage(data);\n\t } else {\n\t const buf = toBuffer(fragments, messageLength);\n\n\t if (!isValidUTF8(buf)) {\n\t this.error(new Error('invalid utf8 sequence'), 1007);\n\t return;\n\t }\n\n\t this.onmessage(buf.toString());\n\t }\n\t }\n\n\t this._state = GET_INFO;\n\t }", "dataMessage () {\n if (this._fin) {\n const messageLength = this._messageLength;\n const fragments = this._fragments;\n\n this._totalPayloadLength = 0;\n this._messageLength = 0;\n this._fragmented = 0;\n this._fragments = [];\n\n if (this._opcode === 2) {\n var data;\n\n if (this._binaryType === 'nodebuffer') {\n data = toBuffer(fragments, messageLength);\n } else if (this._binaryType === 'arraybuffer') {\n data = toArrayBuffer(toBuffer(fragments, messageLength));\n } else {\n data = fragments;\n }\n\n this.onmessage(data);\n } else {\n const buf = toBuffer(fragments, messageLength);\n\n if (!validation.isValidUTF8(buf)) {\n this.error(\n new Error('Invalid WebSocket frame: invalid UTF-8 sequence'),\n 1007\n );\n return;\n }\n\n this.onmessage(buf.toString());\n }\n }\n\n this._state = GET_INFO;\n }", "function receivedMessage(event) {\n messageHandler.handleMessage(event);\n }", "onPortMessage(msg) {\n var t = this;\n if (msg.startsWith(\"R \")) { // Received data\n if (msg.startsWith(\"R P\")) { // Partial\n t.frameReadBuffer += msg.substring(3);\n console.log(\"LoFi Rx partial\");\n } else {\n var fullRx = (t.frameReadBuffer + msg.substring(3));\n fullRx = t.phyUnescape(fullRx);\n if(false && fullRx.startsWith(\"10-4 XXX\"))\n t.testResp(fullRx); // TODO XXX\n else\n t.readQueue.unshift(fullRx);\n console.log(\"LoFi Rx: \" + fullRx);\n if(t.rxCallback)\n t.rxCallback();\n t.frameReadBuffer = \"\";\n }\n t.lastCmdSendMs = null;\n }\n else if (msg.startsWith(\"TS \")) {\n t.lastCmdSendMs = null;\n t.lastTxSuccess = true;\n // console.log(\"LoFi Tx was successfull\");\n }\n else if (msg.startsWith(\"TEF \")) {\n t.lastCmdSendMs = null;\n // console.log(\"LoFi Tx failed - channel full\")\n }\n else if (msg.startsWith(\"TE \")) {\n t.lastCmdSendMs = null;\n console.error(\"LoFi tx failed - UNKNOWN ERROR\");\n console.warn(\"Full error: \" + msg);\n } else {\n console.log(\"BT> \" + msg);\n }\n }", "function receiveMessage(event) {\n // Parse the message.\n var msg = JSON.parse(event.data);\n \n switch (msg.messageType) {\n case 1: // Add\n addModel(msg.modelHandle, msg.floatArrayData, msg.stringData);\n break;\n case 2: // Remove\n removeModel(msg.modelHandle);\n onCurrentModelChange();\n break;\n case 3: // Move\n moveModel(msg.modelHandle, msg.floatArrayData);\n break;\n case 4: // Rotate\n rotateModel(msg.modelHandle, msg.floatArrayData);\n break;\n case 5: // Scale\n scaleModel(msg.modelHandle, msg.floatArrayData);\n break;\n default: // Unknown message\n console.log(\"Invalid Message.\");\n }\n}", "rpcHandler (inData) {\n try {\n console.log('Data recieved by rpcHandler: ', inData)\n\n const jsonData = JSON.parse(inData)\n console.log('jsonData: ', jsonData)\n\n // _this.eventEmitter.emit('rpcData', jsonData)\n } catch (err) {\n console.error('Error in rpcHandler()')\n // Do not throw an error. This is a top-level function.\n }\n }", "function handleReceipt(stateObj, err, recpt) {\n var hash = stateObj.hash;\n\n // If error recorded, trigger update w that info (assumes web3 connection error)\n if (err) {\n this.setState({ error: err });\n\n // else if no data received from receipt, tx is not yet received in block, do nothing?\n } else if (!recpt || !recpt.transactionHash) {\n\n // If previous receipt exists, delete it\n if (stateObj.hash in this.state.receipts) this.setState({ receipts: _.omit(this.state.receipts, stateObj.hash) });\n\n // Can we assume that dropped transactions will not go back to pending state if still no receipt\n // If there was a fork...\n // => We can check if there was a fork by recording the last known block\n // If the last known block doesn't exist, then it's free-for-all\n\n // will save if stateObj not already pending (wouldn't have a receipt anyway)\n this.updateState(stateObj, \"pending\", false);\n\n // else, data was received\n } else {\n getTimestamp(recpt.blockHash || recpt.blockNumber, (function (err, block) {\n recpt.timestamp = block.timestamp;\n this.setState({ receipts: _.set(this.state.receipts, hash, recpt) });\n this.updateState(stateObj, \"received\", false); // implicitly saves the state of the receipt\n }).bind(this));\n }\n\n // No erros need to be recorded in handleReceipt?\n if (++dataCount == txs.length * methods.length && typeof callback === \"function\") callback(errors.length ? errors : null);\n }", "bus_rx(data) { this.send('bus-rx', data); }", "function Parse(input) {\n // Decode an incoming message to an object of fields.\n var b = bytes(atob(input.data));\n // use TTN decoder:\n var decoded = Decoder(b, input.fPort);\n // Update values in device properties\n status_update_device(decoded);\n return decoded;\n}", "validateMessageSignature() {\n //Set Default response \n let response = {\n success: \"false\",\n message: \"Address and signature required\"\n };\n this.server.route({\n method: 'POST',\n path: '/message-signature/validate',\n handler: (request, h) => {\n if(!(request.payload === null)){\n //Check to see if data specified in payload.\n if(request.payload.address && request.payload.signature) {\n //Get request from mempool and validate\n response = this.validateRequestbyWallet(request.payload.address, request.payload.signature); \n }\n }\n return response;\n }\n });\n }", "decode(message) {\n if (!message) return null;\n\n let fragments = message.split('|');\n if (fragments.length != 3) return null;\n\n const type = fragments[0];\n if (this.acceptTypes.indexOf(type) < 0) return null;\n\n const address = fragments[1];\n if ( ! this.ethAddressValidation.isAddress(address) && ! this.ethAddressValidation.isChecksumAddress(address)) return null;\n\n const data = fragments[2];\n if (type === 'INVOICE' || type === 'VOUCHER') {\n if (isNaN(data) || parseFloat(data) <= 0) return null;\n }\n\n return {\n type: type,\n address: address,\n data: data\n }\n }", "function handleSensorDataMessage(macAddress, payload) {\n\t// Parse sensor data, convert to ints\n var sensorValues = payload.split(',').map(value => parseInt(value));\n\n // We're expecting five values: power, temp, light, (eventually status).\n if (sensorValues.length !== 3) {\n throw new Error(`Not enough sensor values in packet: ${sensorValues}`);\n }\n\n // Get data values from payload.\n var power = sensorValues[0];\n temperature = sensorValues[1],\n light = sensorValues[2];\n\n // TODO: Trigger events as necessary.\n return saveSensorData(macAddress, power, temperature, light);\n}", "function HandleResponse(avrNum, responseID, msg)\n{\n switch (responseID) {\n case 'a': // a = get serial number\n var avr;\n avrs[avrNum].avrSN = msg; // save s/n in device object\n for (var i=0; i<avrSN.length; ++i) {\n if (msg == avrSN[i]) {\n avr = 'AVR' + i;\n if (avrNum < 2 || !avrs[avrNum]) {\n if (avrs[i] != avrs[avrNum]) {\n Log(avr, 'INTERNAL ERROR');\n } else {\n // could get here if we got a \"ser\" response\n // from an already identified AVR\n return avrNum; // (nothing to do)\n }\n } else {\n if (avrs[i]) {\n if (avrs[i] != avrs[avrNum]) {\n Log(avr, 'ERROR! Already exists!');\n }\n } else {\n ++foundAVRs;\n }\n // change the number of this AVR\n avrs[i] = avrs[avrNum];\n avrs[i].avrNum = i;\n avrs[i].interfaces[0].endpoints[0].avrNum = i;\n avrs[i].interfaces[0].endpoints[1].avrNum = i;\n avrs[avrNum] = null;\n avrOK[i] = 1;\n avrOK[avrNum] = 0;\n avrNum = i;\n }\n break;\n }\n }\n if (avr) {\n // enable watchdog timer\n avrs[avrNum].SendCmd('c.wdt 1\\n');\n if (avrNum == 0) {\n // enable pull-ups for limit switches\n avrs[avrNum].SendCmd('c.pa0-' + (kNumLimit-1) + ' ' +\n Array(kNumLimit+1).join('+') + '\\n');\n // set polarity of motor on sigals\n avrs[avrNum].SendCmd('c.m0 on +;m1 on +;m2 on +\\n');\n // turn on motors\n avrs[avrNum].SendCmd('c.m0 on 1;m1 on 1;m2 on 1\\n');\n }\n Log(avr, 'attached (s/n', msg + ')');\n } else {\n avrs[avrNum].SendCmd('z.wdt 0\\n'); // disable watchdog on unknown AVR\n Log('Unknown AVR'+avrNum, '(s/n', msg + ')');\n }\n break;\n\n case 'b': // b = log this response\n Log('AVR'+avrNum, msg);\n break;\n\n case 'c': // c = ignore this response\n break;\n\n case 'd': // d = (currently not used)\n break;\n\n case 'e': // e = manual AVR command\n Log('[AVR'+avrNum+']', msg);\n break;\n\n case 'f': { // f = motor speeds\n if (msg.length >= 8 && msg.substr(0,1) == 'm') {\n var n = msg.substr(1,1); // motor number\n var a = msg.split(' ');\n for (var i=0; i<a.length; ++i) {\n switch (a[i].substr(0,4)) {\n case \"SPD=\":\n motorSpd[n] = Number(a[i].substr(4));\n motorDir[n] = a[i].substr(4,1) == '-' ? 1 : 0;\n break;\n case \"POS=\":\n motorPos[n] = Number(a[i].substr(4));\n break;\n }\n }\n if (n==2) {\n // log a message if any of the motors turned on or off\n var changed = 0;\n for (var i=0; i<3; ++i) {\n if (!motorSpd[i] != !motorRunning[i]) {\n changed = 1;\n motorRunning[i] = motorSpd[i];\n }\n }\n if (changed) {\n var running = [];\n for (var i=0; i<3; ++i) {\n if (motorRunning[i]) running.push(i);\n }\n if (running.length) {\n LogToFile(\"Motors running:\", running.join(' '));\n } else {\n LogToFile(\"Motors stopped\");\n }\n }\n // inform clients periodically of current motor speeds\n if (fullPoll) {\n var newSpd = motorSpd.join(' ');\n if (lastSpd != newSpd) {\n PushData('E ' + newSpd);\n lastSpd = newSpd;\n }\n }\n }\n }\n } break;\n\n case 'g': { // g = poll limit switches\n var j = msg.indexOf('VAL=');\n if (j < 0 || msg.length - j < kNumLimit) {\n avrs[0].SendCmd(\"c.halt\\n\");\n Log(\"Poll error. Motors halted\");\n // safety fallback: assume we hit the limits\n for (var k=0; k<kNumLimit; ++k) {\n limitSwitch[k] = kHitLimit;\n }\n } else {\n for (var k=0; k<kNumLimit; ++k) {\n if (msg.substr(j+4+k, 1) == kNotLimit) {\n limitSwitch[k] = kNotLimit;\n } else {\n limitSwitch[k] = kHitLimit;\n var mot = Math.floor(k / 2);\n if (!motorSpd[mot]) continue;\n var isBottom = ((k & 0x01) == kBotLimit);\n if (isBottom) {\n // allow positive motor speed when at bottom limit\n if (motorSpd[mot] > 0) continue;\n } else {\n // allow negative motor speed when at top limit\n if (motorSpd[mot] < 0) continue;\n }\n avrs[0].SendCmd(\"c.m\" + mot + \" halt\\n\");\n var which = isBottom ? \"lower\" : \"upper\";\n Log(\"M\" + mot + \" halted! (hit \" + which + \" limit switch)\");\n }\n }\n }\n } break;\n\n case 'z': // z = disable watchdog timer\n // forget about the unknown AVR\n avrs[avrNum].interfaces[0].endpoints[0].device = avrs[avrNum];\n avrs[avrNum].interfaces[0].endpoints[0].on('end', HandleEnd);\n avrs[avrNum].interfaces[0].endpoints[0].stopPoll();\n avrs[avrNum] = null;\n break;\n\n default:\n Log('AVR'+avrNum, 'Unknown response:', msg);\n break;\n }\n return avrNum;\n}", "validateRequestByWallet(){\r\n this.server.route({\r\n method: 'POST',\r\n path: '/message-signature/validate',\r\n handler: async (request, h) => {\r\n //Validates payload\r\n if(!request.payload){\r\n throw Boom.badRequest(\"You should provide a valid JSON request\");\r\n }\r\n\r\n let address = request.payload.address;\r\n let signature = request.payload.signature;\r\n\r\n //validates address and signature\r\n if(!address || address.length==0 || !signature || signature.length==0){\r\n throw Boom.badRequest(\"You should provide a valid address and signature properties in the JSON request\");\r\n }\r\n\r\n //returns result of the signature validation\r\n return this.mempoolService.validateRequestByWallet(address,signature);\r\n }\r\n });\r\n }", "function MQTT_Process_Data(feedbackItem, matchedString) {\r\n\tCF.log(\"Receieved MQTT packet: \"+ matchedString + \" Started with: \" + matchedString.charCodeAt(0) + \" Length: \" + matchedString.length);\r\n\t// Append new message(s) to queue\r\n\tmessage_queue = message_queue + matchedString;\r\n\tCF.log(\"Message Queue :\" + message_queue);\r\n\tCF.log(\"Message Queue length is : \"+ message_queue.length);\r\n\t// Start processing. The queue length must be at least 2 characters (Command + remaining length)\r\n\twhile (message_queue.length>0) {\r\n\t\tif (message_queue.length < message_queue.charCodeAt(1)+2) {\r\n\t\t\t//CF.log(\"Too short packet. Need to wait for next packet\"); \r\n\t\t\treturn;\r\n\t\t}\r\n\t\t// Start parsing\r\n\t\tswitch (message_queue.charCodeAt(0)) {\t\t\r\n\t\t\tcase 0x30 : // PUBLISH Command \r\n\t\t\tcase 0x31 : //same PUBLISH Command with retained flag\r\n\t\t\t\t//CF.log(\"Received PUBLISH Message.\"); \r\n\t\t\t\tvar message_length = 2+message_queue.charCodeAt(1); // Calculate length\r\n\t\t\t\tvar message = message_queue.substr(0,message_length); // Extract message\r\n\t\t\t\t//CF.log(\"Extracted message with length: \" + message_length+ \" Message: \" + message);\r\n\t\t\t\t//Extracting topic and value\r\n\t\t\t\tvar total_length = message_queue.charCodeAt(1);\r\n\t\t\t\tvar topic_length = message.charCodeAt(3); \r\n\t\t\t\tvar topic = message.substr(4,topic_length);\r\n\t\t\t\tvar value = message.slice(4+topic_length);\r\n\t\t\t\tCF.log(\"Extracted Topic: \" + topic + \" Value: \" + value);\r\n\t\t\t\t// Sending extracted topic and value to loopback system in format Topic=Value \\x0D. \\x=0D is used as EOM Symbol.\r\n\t\t\t\t// In this way processing can be done by Loopback system Feedbacks\r\n\t\t\t\tCF.send(\"Loopback\", topic + '=' + value + ' \\x0D'); \r\n\t\t\t\t// Remove processed message from queue\r\n\t\t\t\tmessage_queue= message_queue.slice(message_length);\r\n\t\t\t\t//CF.log(\"Remaining queue length: \" + message_queue.length);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 0x00 :\r\n\t\t\t\tCF.log(\"Removing zero byte \" + message_queue.charCodeAt(0));\r\n\t\t\t\tmessage_queue= message_queue.slice(1);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault : \r\n\t\t\t\t// All noninteresting messages dropped here (CONACK, SUBACK, PING etc).\r\n\t\t\t\t//Thanks to MQTT Message format we can remove them without knowing what is it\r\n\t\t\t\tCF.log(\"Received unknown Message. \" + message_queue.charCodeAt(0)); \r\n\t\t\t\tvar message_length = 2+message_queue.charCodeAt(1);\r\n\t\t\t\tCF.log(\"Extracted message with length: \" + message_length);\r\n\t\t\t\tmessage_queue= message_queue.slice(message_length);\r\n\t\t\t\tCF.log(\"Remaining queue length: \" + message_queue.length);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n}", "function handleReceive() {\n console.log(\n '%c handle receive!!',\n 'font-size: 30px; color: purple'\n );\n }", "getInfo () {\n const buf = this.consume(2);\n if (buf === null) return;\n\n if ((buf[0] & 0x30) !== 0x00) {\n this.error(\n new RangeError('Invalid WebSocket frame: RSV2 and RSV3 must be clear'),\n 1002\n );\n return;\n }\n\n const compressed = (buf[0] & 0x40) === 0x40;\n\n if (compressed && !this._extensions[PerMessageDeflate.extensionName]) {\n this.error(\n new RangeError('Invalid WebSocket frame: RSV1 must be clear'),\n 1002\n );\n return;\n }\n\n this._fin = (buf[0] & 0x80) === 0x80;\n this._opcode = buf[0] & 0x0f;\n this._payloadLength = buf[1] & 0x7f;\n\n if (this._opcode === 0x00) {\n if (compressed) {\n this.error(\n new RangeError('Invalid WebSocket frame: RSV1 must be clear'),\n 1002\n );\n return;\n }\n\n if (!this._fragmented) {\n this.error(\n new RangeError('Invalid WebSocket frame: invalid opcode 0'),\n 1002\n );\n return;\n } else {\n this._opcode = this._fragmented;\n }\n } else if (this._opcode === 0x01 || this._opcode === 0x02) {\n if (this._fragmented) {\n this.error(\n new RangeError(\n `Invalid WebSocket frame: invalid opcode ${this._opcode}`\n ),\n 1002\n );\n return;\n }\n\n this._compressed = compressed;\n } else if (this._opcode > 0x07 && this._opcode < 0x0b) {\n if (!this._fin) {\n this.error(\n new RangeError('Invalid WebSocket frame: FIN must be set'),\n 1002\n );\n return;\n }\n\n if (compressed) {\n this.error(\n new RangeError('Invalid WebSocket frame: RSV1 must be clear'),\n 1002\n );\n return;\n }\n\n if (this._payloadLength > 0x7d) {\n this.error(\n new RangeError(\n `Invalid WebSocket frame: invalid payload length ` +\n `${this._payloadLength}`\n ),\n 1002\n );\n return;\n }\n } else {\n this.error(\n new RangeError(\n `Invalid WebSocket frame: invalid opcode ${this._opcode}`\n ),\n 1002\n );\n return;\n }\n\n if (!this._fin && !this._fragmented) this._fragmented = this._opcode;\n\n this._masked = (buf[1] & 0x80) === 0x80;\n\n if (this._payloadLength === 126) this._state = GET_PAYLOAD_LENGTH_16;\n else if (this._payloadLength === 127) this._state = GET_PAYLOAD_LENGTH_64;\n else this.haveLength();\n }", "_onControlSocketData(chunk) {\n this.log(`< ${chunk}`);\n // This chunk might complete an earlier partial response.\n const completeResponse = this._partialResponse + chunk;\n const parsed = (0, parseControlResponse_1.parseControlResponse)(completeResponse);\n // Remember any incomplete remainder.\n this._partialResponse = parsed.rest;\n // Each response group is passed along individually.\n for (const message of parsed.messages) {\n const code = parseInt(message.substr(0, 3), 10);\n const response = { code, message };\n const err = code >= 400 ? new FTPError(response) : undefined;\n this._passToHandler(err ? err : response);\n }\n }", "function processIncomingMessage( message, view ) {\n}", "function fromBER_raw(input_buffer, input_offset, input_length)\n {\n var incoming_offset = input_offset; // Need to store initial offset since \"input_offset\" is changing in the function\n\n // #region Local function changing a type for ASN.1 classes\n function local_change_type(input_object, new_type)\n {\n if(input_object instanceof new_type)\n return input_object;\n\n var new_object = new new_type();\n new_object.id_block = input_object.id_block;\n new_object.len_block = input_object.len_block;\n new_object.warnings = input_object.warnings;\n new_object.value_before_decode = util_copybuf(input_object.value_before_decode);\n\n return new_object;\n }\n // #endregion\n\n // #region Create a basic ASN.1 type since we need to return errors and warnings from the function\n var return_object = new in_window.org.pkijs.asn1.ASN1_block();\n // #endregion\n\n // #region Basic check for parameters\n if(check_buffer_params(input_buffer, input_offset, input_length) === false)\n {\n return_object.error = \"Wrong input parameters\";\n return {\n offset: (-1),\n result: return_object\n };\n }\n // #endregion\n\n // #region Getting Uint8Array from ArrayBuffer\n var int_buffer = new Uint8Array(input_buffer, input_offset, input_length);\n // #endregion\n\n // #region Initial checks\n if(int_buffer.length == 0)\n {\n this.error = \"Zero buffer length\";\n return {\n offset: (-1),\n result: return_object\n };\n }\n // #endregion\n\n // #region Decode indentifcation block of ASN.1 BER structure\n var result_offset = return_object.id_block.fromBER(input_buffer, input_offset, input_length);\n return_object.warnings.concat(return_object.id_block.warnings);\n if(result_offset == (-1))\n {\n return_object.error = return_object.id_block.error;\n return {\n offset: (-1),\n result: return_object\n };\n }\n\n input_offset = result_offset;\n input_length -= return_object.id_block.block_length;\n // #endregion\n\n // #region Decode length block of ASN.1 BER structure\n result_offset = return_object.len_block.fromBER(input_buffer, input_offset, input_length);\n return_object.warnings.concat(return_object.len_block.warnings);\n if(result_offset == (-1))\n {\n return_object.error = return_object.len_block.error;\n return {\n offset: (-1),\n result: return_object\n };\n }\n\n input_offset = result_offset;\n input_length -= return_object.len_block.block_length;\n // #endregion\n\n // #region Check for usign indefinite length form in encoding for primitive types\n if((return_object.id_block.is_constructed == false) &&\n (return_object.len_block.is_indefinite_form == true))\n {\n return_object.error = new String(\"Indefinite length form used for primitive encoding form\");\n return {\n offset: (-1),\n result: return_object\n };\n }\n // #endregion\n\n // #region Switch ASN.1 block type\n var new_asn1_type = in_window.org.pkijs.asn1.ASN1_block;\n\n switch(return_object.id_block.tag_class)\n {\n // #region UNIVERSAL\n case 1:\n // #region Check for reserved tag numbers\n if((return_object.id_block.tag_number >= 37) &&\n (return_object.id_block.is_hex_only == false))\n {\n return_object.error = \"UNIVERSAL 37 and upper tags are reserved by ASN.1 standard\";\n return {\n offset: (-1),\n result: return_object\n };\n }\n // #endregion\n\n switch(return_object.id_block.tag_number)\n {\n // #region EOC type\n case 0:\n // #region Check for EOC type\n if((return_object.id_block.is_constructed == true) &&\n (return_object.len_block.length > 0))\n {\n return_object.error = \"Type [UNIVERSAL 0] is reserved\";\n return {\n offset: (-1),\n result: return_object\n };\n }\n // #endregion\n\n new_asn1_type = in_window.org.pkijs.asn1.EOC;\n\n break;\n // #endregion\n // #region BOOLEAN type\n case 1:\n new_asn1_type = in_window.org.pkijs.asn1.BOOLEAN;\n break;\n // #endregion\n // #region INTEGER type\n case 2:\n new_asn1_type = in_window.org.pkijs.asn1.INTEGER;\n break;\n // #endregion\n // #region BITSTRING type\n case 3:\n new_asn1_type = in_window.org.pkijs.asn1.BITSTRING;\n break;\n // #endregion\n // #region OCTETSTRING type\n case 4:\n new_asn1_type = in_window.org.pkijs.asn1.OCTETSTRING;\n break;\n // #endregion\n // #region NULL type\n case 5:\n new_asn1_type = in_window.org.pkijs.asn1.NULL;\n break;\n // #endregion\n // #region OBJECT IDENTIFIER type\n case 6:\n new_asn1_type = in_window.org.pkijs.asn1.OID;\n break;\n // #endregion\n // #region ENUMERATED type\n case 10:\n new_asn1_type = in_window.org.pkijs.asn1.ENUMERATED;\n break;\n // #endregion\n // #region UTF8STRING type\n case 12:\n new_asn1_type = in_window.org.pkijs.asn1.UTF8STRING;\n break;\n // #endregion\n // #region TIME type\n case 14:\n new_asn1_type = in_window.org.pkijs.asn1.TIME;\n break;\n // #endregion\n // #region ASN.1 reserved type\n case 15:\n return_object.error = \"[UNIVERSAL 15] is reserved by ASN.1 standard\";\n return {\n offset: (-1),\n result: return_object\n };\n break;\n // #endregion\n // #region SEQUENCE type\n case 16:\n new_asn1_type = in_window.org.pkijs.asn1.SEQUENCE;\n break;\n // #endregion\n // #region SET type\n case 17:\n new_asn1_type = in_window.org.pkijs.asn1.SET;\n break;\n // #endregion\n // #region NUMERICSTRING type\n case 18:\n new_asn1_type = in_window.org.pkijs.asn1.NUMERICSTRING;\n break;\n // #endregion\n // #region PRINTABLESTRING type\n case 19:\n new_asn1_type = in_window.org.pkijs.asn1.PRINTABLESTRING;\n break;\n // #endregion\n // #region TELETEXSTRING type\n case 20:\n new_asn1_type = in_window.org.pkijs.asn1.TELETEXSTRING;\n break;\n // #endregion\n // #region VIDEOTEXSTRING type\n case 21:\n new_asn1_type = in_window.org.pkijs.asn1.VIDEOTEXSTRING;\n break;\n // #endregion\n // #region IA5STRING type\n case 22:\n new_asn1_type = in_window.org.pkijs.asn1.IA5STRING;\n break;\n // #endregion\n // #region UTCTIME type\n case 23:\n new_asn1_type = in_window.org.pkijs.asn1.UTCTIME;\n break;\n // #endregion\n // #region GENERALIZEDTIME type\n case 24:\n new_asn1_type = in_window.org.pkijs.asn1.GENERALIZEDTIME;\n break;\n // #endregion\n // #region GRAPHICSTRING type\n case 25:\n new_asn1_type = in_window.org.pkijs.asn1.GRAPHICSTRING;\n break;\n // #endregion\n // #region VISIBLESTRING type\n case 26:\n new_asn1_type = in_window.org.pkijs.asn1.VISIBLESTRING;\n break;\n // #endregion\n // #region GENERALSTRING type\n case 27:\n new_asn1_type = in_window.org.pkijs.asn1.GENERALSTRING;\n break;\n // #endregion\n // #region UNIVERSALSTRING type\n case 28:\n new_asn1_type = in_window.org.pkijs.asn1.UNIVERSALSTRING;\n break;\n // #endregion\n // #region CHARACTERSTRING type\n case 29:\n new_asn1_type = in_window.org.pkijs.asn1.CHARACTERSTRING;\n break;\n // #endregion\n // #region BMPSTRING type\n case 30:\n new_asn1_type = in_window.org.pkijs.asn1.BMPSTRING;\n break;\n // #endregion\n // #region DATE type\n case 31:\n new_asn1_type = in_window.org.pkijs.asn1.DATE;\n break;\n // #endregion\n // #region DATE-TIME type\n case 33:\n new_asn1_type = in_window.org.pkijs.asn1.DATETIME;\n break;\n // #endregion\n // #region default\n default:\n {\n var new_object;\n\n if(return_object.id_block.is_constructed == true)\n new_object = new in_window.org.pkijs.asn1.ASN1_CONSTRUCTED();\n else\n new_object = new in_window.org.pkijs.asn1.ASN1_PRIMITIVE();\n\n new_object.id_block = return_object.id_block;\n new_object.len_block = return_object.len_block;\n new_object.warnings = return_object.warnings;\n\n return_object = new_object;\n\n result_offset = return_object.fromBER(input_buffer, input_offset, input_length);\n }\n // #endregion\n }\n break;\n // #endregion\n // #region All other tag classes\n case 2: // APPLICATION\n case 3: // CONTEXT-SPECIFIC\n case 4: // PRIVATE\n default:\n {\n if(return_object.id_block.is_constructed == true)\n new_asn1_type = in_window.org.pkijs.asn1.ASN1_CONSTRUCTED;\n else\n new_asn1_type = in_window.org.pkijs.asn1.ASN1_PRIMITIVE;\n }\n // #endregion\n }\n // #endregion\n\n // #region Change type and perform BER decoding\n return_object = local_change_type(return_object, new_asn1_type);\n result_offset = return_object.fromBER(input_buffer, input_offset, (return_object.len_block.is_indefinite_form == true) ? input_length : return_object.len_block.length);\n // #endregion\n\n // #region Coping incoming buffer for entire ASN.1 block\n return_object.value_before_decode = util_copybuf_offset(input_buffer, incoming_offset, return_object.block_length);\n // #endregion\n\n return {\n offset: result_offset,\n result: return_object\n };\n }", "function messageHandler (msg) {\n console.log('Id: ' + msg.messageId + ' Body: ' + msg.data);\n client.complete(msg, printResultFor('completed'));\n}", "function messageHandler (msg) {\n console.log('Id: ' + msg.messageId + ' Body: ' + msg.data);\n client.complete(msg, printResultFor('completed'));\n}", "async handle (msg) {\n if (this.test(msg)) {\n this.run(msg)\n }\n }", "function handleMessage(evt) {\n\tvar message = JSON.parse(evt.data);\n\n\tif (!pc && (message.sessionDescription || message.candidate))\n\t\tstart(false);\n\n\tif (message.sessionDescription) {\n\t\tpc.setRemoteDescription(new RTCSessionDescription({\n\t\t\t\"sdp\": SDP.generate(message.sessionDescription),\n\t\t\t\"type\": message.type\n\t\t}), function () {\n\t\t\t// if we received an offer, we need to create an answer\n\t\t\tif (pc.remoteDescription.type == \"offer\")\n\t\t\t\tpc.createAnswer(localDescCreated, logError);\n\t\t}, logError);\n\t} else if (!isNaN(message.orientation) && remoteView) {\n\t\tvar transform = \"rotate(\" + message.orientation + \"deg)\";\n\t\tremoteView.style.transform = remoteView.style.webkitTransform = transform;\n\t} else {\n\t\tvar d = message.candidate.candidateDescription;\n\t\tmessage.candidate.candidate = \"candidate:\" + [\n\t\t\td.foundation,\n\t\t\td.componentId,\n\t\t\td.transport,\n\t\t\td.priority,\n\t\t\td.address,\n\t\t\td.port,\n\t\t\t\"typ\",\n\t\t\td.type,\n\t\t\td.relatedAddress && (\"raddr \" + d.relatedAddress),\n\t\t\td.relatedPort && (\"rport \" + d.relatedPort),\n\t\t\td.tcpType && (\"tcptype \" + d.tcpType)\n\t\t].filter(function (x) { return x; }).join(\" \");\n\t\tpc.addIceCandidate(new RTCIceCandidate(message.candidate), function () {}, logError);\n\t}\n}", "function handleMessage(evt) {\n var message = JSON.parse(evt.data);\n\n if (!pc && (message.sessionDescription || message.sdp || message.candidate))\n start(false);\n\n if (message.sessionDescription || message.sdp) {\n var desc = new RTCSessionDescription({\n \"sdp\": SDP.generate(message.sessionDescription) || message.sdp,\n \"type\": message.type\n });\n pc.setRemoteDescription(desc, function () {\n // if we received an offer, we need to create an answer\n if (pc.remoteDescription.type == \"offer\")\n pc.createAnswer(localDescCreated, logError);\n }, logError);\n } else if (!isNaN(message.orientation) && remoteView) {\n var transform = \"rotate(\" + message.orientation + \"deg)\";\n remoteView.style.transform = remoteView.style.webkitTransform = transform;\n } else {\n var d = message.candidate.candidateDescription;\n if (d && !message.candidate.candidate) {\n message.candidate.candidate = \"candidate:\" + [\n d.foundation,\n d.componentId,\n d.transport,\n d.priority,\n d.address,\n d.port,\n \"typ\",\n d.type,\n d.relatedAddress && (\"raddr \" + d.relatedAddress),\n d.relatedPort && (\"rport \" + d.relatedPort),\n d.tcpType && (\"tcptype \" + d.tcpType)\n ].filter(function (x) { return x; }).join(\" \");\n }\n pc.addIceCandidate(new RTCIceCandidate(message.candidate), function () {}, logError);\n }\n}", "handleDataRecieved(data){\n\t\tvar parsedData = JSON.parse(data.data);\n\n\t\tswitch(parsedData.dataType){\n\t\t\tcase \"0\"://parsedData.dataType.PLAYER\"\":\n\t\t\t\tthis.updateOtherPlayers(parsedData);\n\t\t\t\tbreak;\n\t\t\tcase \"1\":\n\t\t\t\tthis.updateServerEnemies(parsedData);\n\t\t\t\tbreak;\n\t\t\tcase \"2\":\n\t\t\t\tthis.updateOtherPlayerShots(parsedData);\n\t\t\t\tbreak;\n\t\t\tcase \"3\":\n\t\t\t\tthis.updateDropsInfo(parsedData);\n\t\t\t\tbreak;\n\t\t\tcase \"4\":\n\t\t\t\tthis.updateBrainInfo(parsedData);\n\t\t\t\tbreak;\n\t\t\tcase \"5\":\n\t\t\t\tthis.createNewEnemies(parsedData);\n\t\t\t\tbreak;\n\t\t\tcase \"6\":\n\t\t\t\tthis.checkIfResurrected(parsedData);\n\t\t\t\tbreak;\n\t\t\tcase \"11\":\n\t\t\t\tthis.updateRoundInfo(parsedData);\n\t\t\t\tbreak;\n\n\t\t}\n\n\t}", "getInfo () {\n if (!this.hasBufferedBytes(2)) return;\n\n const buf = this.readBuffer(2);\n\n if ((buf[0] & 0x30) !== 0x00) {\n this.error(new Error('RSV2 and RSV3 must be clear'), 1002);\n return;\n }\n\n const compressed = (buf[0] & 0x40) === 0x40;\n\n if (compressed && !this.extensions[PerMessageDeflate.extensionName]) {\n this.error(new Error('RSV1 must be clear'), 1002);\n return;\n }\n\n this.fin = (buf[0] & 0x80) === 0x80;\n this.opcode = buf[0] & 0x0f;\n this.payloadLength = buf[1] & 0x7f;\n\n if (this.opcode === 0x00) {\n if (compressed) {\n this.error(new Error('RSV1 must be clear'), 1002);\n return;\n }\n\n if (!this.fragmented) {\n this.error(new Error(`invalid opcode: ${this.opcode}`), 1002);\n return;\n } else {\n this.opcode = this.fragmented;\n }\n } else if (this.opcode === 0x01 || this.opcode === 0x02) {\n if (this.fragmented) {\n this.error(new Error(`invalid opcode: ${this.opcode}`), 1002);\n return;\n }\n\n this.compressed = compressed;\n } else if (this.opcode > 0x07 && this.opcode < 0x0b) {\n if (!this.fin) {\n this.error(new Error('FIN must be set'), 1002);\n return;\n }\n\n if (compressed) {\n this.error(new Error('RSV1 must be clear'), 1002);\n return;\n }\n\n if (this.payloadLength > 0x7d) {\n this.error(new Error('invalid payload length'), 1002);\n return;\n }\n } else {\n this.error(new Error(`invalid opcode: ${this.opcode}`), 1002);\n return;\n }\n\n if (!this.fin && !this.fragmented) this.fragmented = this.opcode;\n\n this.masked = (buf[1] & 0x80) === 0x80;\n\n if (this.payloadLength === 126) this.state = GET_PAYLOAD_LENGTH_16;\n else if (this.payloadLength === 127) this.state = GET_PAYLOAD_LENGTH_64;\n else this.haveLength();\n }", "function process_server_msg(client, json_data) {\n // If protocol has been aborted, then ignore subsequent messages\n if (protocol_state == PROTOCOL_STATE.ABORT) {\n return;\n }\n\n var data;\n try {\n data = JSON.parse(json_data);\n } catch (ex) {\n console.trace(ex);\n protocol_abort(client);\n return;\n }\n\n switch (data.type) {\n case PROTOCOL_MESSAGE_TYPE.CHALLENGE:\n if (protocol_state != PROTOCOL_STATE.START) {\n client_log('received challenge in bad state: ' +\n lib.reverse_lookup(PROTOCOL_STATE, protocol_state));\n protocol_abort(client);\n return;\n }\n client_log('received challenge: ' + data.message);\n protocol_state = PROTOCOL_STATE.CHALLENGE;\n\n var response = compute_response(data.message);\n\n lib.send_message(socket, PROTOCOL_MESSAGE_TYPE.RESPONSE, response, suid);\n client_log('sent response: ' + response);\n break;\n\n case PROTOCOL_MESSAGE_TYPE.SESSION_MESSAGE:\n if (protocol_state != PROTOCOL_STATE.SESSION) {\n client_log('received session message in bad state: ' +\n lib.reverse_lookup(PROTOCOL_STATE, protocol_state));\n protocol_abort(client);\n return;\n }\n client_log('received session message: ' + data.message);\n break;\n\n case PROTOCOL_MESSAGE_TYPE.SUCCESS:\n if (protocol_state != PROTOCOL_STATE.CHALLENGE) {\n client_log('received success message in bad state: ' +\n lib.reverse_lookup(PROTOCOL_STATE, protocol_state));\n protocol_abort(client);\n return;\n }\n protocol_state = PROTOCOL_STATE.SESSION;\n client_log('session established');\n client_log('your secret session message is ' + data.message);\n\n protocol_abort(client);\n\n break;\n\n case PROTOCOL_MESSAGE_TYPE.END:\n if (protocol_state != PROTOCOL_STATE.SESSION) {\n client_log('received end message in bad state: ' +\n lib.reverse_lookup(PROTOCOL_STATE, protocol_state));\n protocol_abort(client);\n return;\n }\n socket.removeListener('data', socket_data_handler);\n socket.end();\n protocol_state = PROTOCOL_STATE.END;\n client_log('session ended');\n break;\n\n default:\n client_log('received message of unknown type: ' + data.type);\n protocol_abort(client);\n return;\n }\n }", "function processSubcodeRequest( command, arguments, user ) {\n\t// return true if the command was handled or to prevent other plugins or Colloquy from handling it\n\treturn false;\n}", "function processMessagesCreatedEventWithHandler(handler, originalResponse, event, data) {\n\t\t// Check the event is well formed\n\t\tif (!data.id) {\n\t\t\tconsole.log(\"no message id, aborting...\");\n\t\t\toriginalResponse.status(500).json({'message': 'could not retreive the message contents, no message id there !'});\n\t\t\treturn;\n\t\t}\n\t\tvar messageId = data.id;\n\n\t\t// Retreive text for message id\n\t\tconsole.log(\"requesting message contents\");\n\t\tvar options = {\n\t\t\t\t\t\t'method': 'GET',\n\t\t\t\t\t\t'hostname': 'api.ciscospark.com',\n\t\t\t\t\t\t'path': '/v1/messages/' + messageId,\n\t\t\t\t\t\t'headers': {'authorization': 'Bearer ' + self.config.token}\n\t\t\t\t\t};\n\t\tvar req = https.request(options, function (response) {\n\t\t\tconsole.log('assembling message');\n\t\t\tvar chunks = [];\n\t\t\tresponse.on('data', function (chunk) {\n\t\t\t\tchunks.push(chunk);\n\t\t\t});\n\t\t\tresponse.on(\"end\", function () {\n\t\t\t\tif (response.statusCode != 200) {\n\t\t\t\t\tconsole.log(\"status code: \" + response.statusCode + \" when retreiving message with id: \" + messageId);\n\t\t\t\t\toriginalResponse.status(500).json({'message': 'status code: ' + response.statusCode + ' when retreiving message with id:' + messageId});\n\t\t\t\t\t\n\t\t\t\t\t// August 2016: 404 happens when the webhook has been created with a different token from the bot\n\t\t\t\t\tif (response.statusCode == 404) {\n\t\t\t\t\t\tconsole.log(\"WARNING: Did you create the Webhook: \" + event.id + \" with the same token you configured this bot with ? Not sure !\");\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t// Robustify\n\t\t\t\tif (!chunks) {\n\t\t\t\t\tconsole.log(\"unexpected payload: empty\");\n\t\t\t\t\t// let's consider this as a satisfying situation, it is simply a message structure we do not support\n\t\t\t\t\t// we do not want the webhook to resend us the message again and again \n\t\t\t\t\t// => 200 OK: got it and we do not process further \n\t\t\t\t\toriginalResponse.status(200).json({'message': 'unexpected payload for new message with id:' + messageId});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar payload = JSON.parse(Buffer.concat(chunks));\n\t\t\t\tvar message = validateMessage(payload);\n\t\t\t\tif (!message) {\n\t\t\t\t\tconsole.log(\"unexpected message format, aborting...\");\n\t\t\t\t\t// let's consider this as a satisfying situation, it is simply a message structure we do not support\n\t\t\t\t\t// we do not want the webhook to resend us the message again and again \n\t\t\t\t\t// => 200 OK: got it and we do not process further \n\t\t\t\t\toriginalResponse.status(200).json({'message': 'no content to process for new message with id:' + messageId});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// event is ready to be processed, let's respond to Spark without waiting whatever the processing outcome will be\n\t\t\t\toriginalResponse.status(200).json({'message': 'message is being processed by webhook'});\n\n\t\t\t\t// processing happens now\n\t\t\t\tconsole.log(\"calling handler to process 'Message/Created' event\");\n\t\t\t\t//console.log(\"now processing 'Messages/Created' event with contents: \" + JSON.stringify(message)); // for debugging purpose only\n\n\t\t\t\t// if we're a bot account and the message is emitted in a \"group\" room, the message contains the bot display name (or a fraction of it)\n\t\t\t\t// removing the bot name (or fraction) can help provide homogeneous behavior in direct & group rooms, as well as Outgoing integrations\n\t\t\t\tif (self.config.trimBotMention && (message.roomType == \"group\") && (self.accountType == \"BOT\")) {\n\t\t\t\t\tconsole.log(\"trying to homogenize message\");\n\t\t\t\t\tvar trimmed = trimBotName(message.text, self.account.displayName);\n\t\t\t\t\tmessage.originalText = message.text;\n\t\t\t\t\tmessage.text = trimmed;\n\t\t\t\t}\n\n\t\t\t\thandler(message);\n\t\t\t});\n\n\t\t});\n\t\treq.on('error', function(err) {\n \t\t\tconsole.log(\"cannot retreive message with id: \" + messageId + \", error: \" + err);\n\t\t\toriginalResponse.status(500).json({'message': 'could not retreive the text of the message with id:' + messageId});\n\t\t\treturn;\n\t\t});\n\t\treq.end();\n\t}", "function receiveMessage(msgheader, buf) {\n self.emit(\"data\", msgheader, buf);\n }", "processMsg(msg) {\n if (msg['scene_key'])\n msg = msg['msg'];\n\n let cmd = msg['cmd'];\n switch (cmd) {\n case 'GUARD_LOTTERY_START':\n if ((this.targets & Danmu.GUARD) === Danmu.GUARD)\n this.onGuard(msg);\n break;\n case 'TV_START':\n if ((this.targets & Danmu.GIFT) === Danmu.GIFT)\n this.onTV(msg);\n break;\n case 'RAFFLE_START':\n if ((this.targets & Danmu.GIFT) === Danmu.GIFT)\n this.onRaffle(msg);\n break;\n case 'SPECIAL_GIFT':\n if ((this.targets & Danmu.STORM) === Danmu.STORM)\n this.onSpecialGift(msg);\n break;\n case 'PK_LOTTERY_START':\n if ((this.targets & Danmu.PK) === Danmu.PK)\n this.onPkLottery(msg);\n break;\n case 'ANCHOR_LOT_START':\n if ((this.targets & Danmu.ANCHOR) === Danmu.ANCHOR)\n this.onAnchorLottery(msg);\n break;\n case 'NOTICE_MSG':\n this.onNoticeMsg(msg);\n break;\n case 'PREPARING':\n this.onPreparing(msg);\n break;\n case 'ROOM_CHANGE':\n this.onRoomChange(msg);\n break;\n case 'PREPARING':\n this.onPreparing(msg);\n break;\n case 'LIVE':\n this.onLive(msg);\n break;\n default:\n break;\n }\n }", "getInfo () {\n if (!this.hasBufferedBytes(2)) return;\n\n const buf = this.readBuffer(2);\n\n if ((buf[0] & 0x30) !== 0x00) {\n this.error(new Error('RSV2 and RSV3 must be clear'), 1002);\n return;\n }\n\n const compressed = (buf[0] & 0x40) === 0x40;\n\n if (compressed && !this._extensions[PerMessageDeflate_1.extensionName]) {\n this.error(new Error('RSV1 must be clear'), 1002);\n return;\n }\n\n this._fin = (buf[0] & 0x80) === 0x80;\n this._opcode = buf[0] & 0x0f;\n this._payloadLength = buf[1] & 0x7f;\n\n if (this._opcode === 0x00) {\n if (compressed) {\n this.error(new Error('RSV1 must be clear'), 1002);\n return;\n }\n\n if (!this._fragmented) {\n this.error(new Error(`invalid opcode: ${this._opcode}`), 1002);\n return;\n } else {\n this._opcode = this._fragmented;\n }\n } else if (this._opcode === 0x01 || this._opcode === 0x02) {\n if (this._fragmented) {\n this.error(new Error(`invalid opcode: ${this._opcode}`), 1002);\n return;\n }\n\n this._compressed = compressed;\n } else if (this._opcode > 0x07 && this._opcode < 0x0b) {\n if (!this._fin) {\n this.error(new Error('FIN must be set'), 1002);\n return;\n }\n\n if (compressed) {\n this.error(new Error('RSV1 must be clear'), 1002);\n return;\n }\n\n if (this._payloadLength > 0x7d) {\n this.error(new Error('invalid payload length'), 1002);\n return;\n }\n } else {\n this.error(new Error(`invalid opcode: ${this._opcode}`), 1002);\n return;\n }\n\n if (!this._fin && !this._fragmented) this._fragmented = this._opcode;\n\n this._masked = (buf[1] & 0x80) === 0x80;\n\n if (this._payloadLength === 126) this._state = GET_PAYLOAD_LENGTH_16;\n else if (this._payloadLength === 127) this._state = GET_PAYLOAD_LENGTH_64;\n else this.haveLength();\n }", "function handleMessage(event) {\n const { data } = event;\n const { type, payload } = data;\n\n switch (type) {\n case 'SANDBOX.DISPATCH.MODIFY':\n dispatch({ type: 'MODIFY', payload });\n break;\n case 'SANDBOX.STATE.REQUEST':\n postUpdate();\n break;\n case 'SANDBOX.DISPATCH.SELECT':\n dispatch({ type: 'SELECT', payload });\n break;\n default:\n console.log('WARNING: Unsupported message.');\n }\n }", "onMessageReceive() {}", "function onData(data) {\n\n // Attach or extend receive buffer\n _receiveBuffer = (null === _receiveBuffer) ? data : Buffer.concat([_receiveBuffer, data]);\n\n // Pop all messages until the buffer is exhausted\n while(null !== _receiveBuffer && _receiveBuffer.length > 3) {\n var size = _receiveBuffer.readInt32BE(0);\n\n // Early exit processing if we don't have enough data yet\n if((size + 4) > _receiveBuffer.length) {\n break;\n }\n\n // Pull out the message\n var json = _receiveBuffer.toString('utf8', 4, (size + 4));\n\n // Resize the receive buffer\n _receiveBuffer = ((size + 4) === _receiveBuffer.length) ? null : _receiveBuffer.slice((size + 4));\n\n // Parse the message as a JSON object\n try {\n var msgObj = JSON.parse(json);\n\n // emit the generic message received event\n _self.emit('message', msgObj);\n\n // emit an object-type specific event\n if((typeof msgObj.messageName) === 'undefined') {\n _self.emit('unknown', msgObj);\n } else {\n _self.emit(msgObj.messageName, msgObj);\n }\n }\n catch(ex) {\n _self.emit('exception', ex);\n }\n }\n }", "$onmessage(e) {\n if ( e.data instanceof ArrayBuffer ) {\n const bytes = new Uint8Array(e.data);\n try {\n const decoded = pb.sync.Packet.decode(bytes);\n if ( typeof this.onmessage === 'function' ) {\n this.onmessage(decoded);\n }\n } catch (e) {\n console.log(e);\n }\n }\n }", "function realHandler(data) {\n self.bytesReceived += data.length;\n self._receiver.add(data);\n }", "function realHandler(data) {\n self.bytesReceived += data.length;\n self._receiver.add(data);\n }", "function realHandler(data) {\n self.bytesReceived += data.length;\n self._receiver.add(data);\n }", "handleReceivedChange(e) {\n this.setState({ Received: e.target.value })\n }", "handleMessage(message){\n console.log(COMPONENT +' handleMessage()', message);\n if(message.TYPE === 'OrderItems' ){\n this.handleAddProduct(message.Array);\n }else if(message.TYPE === 'Confirmation'){\n this.disabled = true;\n\n /* Refresh record data. */\n refreshApex(this.getRecordResponse);\n }\n }", "function receive(frm, message) {\n message.from = frm;\n debug('message received: ' + JSON.stringify(message));\n commit('voteRecord', message);\n return true;\n}", "responseHandler(data) {\n if(this.build) {\n if(data.length + this.curResponse.accumulated > this.curResponse.size) {\n throw new Error('Ending response length did match reported size');\n } else {\n this.curResponse.data = Buffer.concat([this.curResponse.data, data]);\n this.curResponse.accumulated += data.length;\n }\n\n if(this.curResponse.accumulated === this.curResponse.size) {\n this.build = false;\n let correlationMethod = this.getCorrelation(this.curResponse.header.correlationId);\n correlationMethod(null, this.curResponse.data);\n }\n return;\n }\n\n var header, offset, size;\n\n [size, offset] = types.decodeInt32(data, 0);\n\n [header, offset] = parser.decode(Header.response, data, offset);\n\n if(this.requestCount < header.correlationId) {\n return this.onError(new Error('Unknown correlation id received from broker'));\n }\n\n let bufLength = data.length - types.INT32_SIZE;\n if(size !== bufLength) {\n this.build = true;\n this.curResponse = {\n header: header,\n size: size,\n accumulated: bufLength,\n data: data.slice(offset)\n };\n } else {\n this.build = false;\n let correlationMethod = this.getCorrelation(header.correlationId);\n correlationMethod(null, data.slice(offset));\n }\n }", "sendFormatDataResponsePDU() {\n\n const bufs = Buffer.from(this.content + '\\x00', 'ucs2');\n\n this.send(new type.Component({\n msgType: new type.UInt16Le(data.ClipPDUMsgType.CB_FORMAT_DATA_RESPONSE),\n msgFlags: new type.UInt16Le(0x01),\n dataLen: new type.UInt32Le(bufs.length),\n requestedFormatData: new type.BinaryString(bufs, { readLength: new type.CallableValue(bufs.length) })\n }));\n\n }", "_processMessage(message)\n{\n try\n {\n let data = JSON.parse(message);\n if (undefined === data.e)\n {\n return;\n }\n switch (data.e)\n {\n case 'depthUpdate':\n this._processOrderBookUpdate(data);\n return;\n case 'aggTrade':\n this._processTrades(data);\n return;\n case '24hrTicker':\n this._processTicker(data);\n return;\n case 'kline':\n this._processKline(data);\n return;\n }\n }\n catch (e)\n {\n logger.error(e.stack);\n return;\n }\n}", "getInfo () {\n\t if (!this.hasBufferedBytes(2)) return;\n\n\t const buf = this.readBuffer(2);\n\n\t if ((buf[0] & 0x30) !== 0x00) {\n\t this.error(new Error('RSV2 and RSV3 must be clear'), 1002);\n\t return;\n\t }\n\n\t const compressed = (buf[0] & 0x40) === 0x40;\n\n\t if (compressed && !this._extensions[PerMessageDeflate.extensionName]) {\n\t this.error(new Error('RSV1 must be clear'), 1002);\n\t return;\n\t }\n\n\t this._fin = (buf[0] & 0x80) === 0x80;\n\t this._opcode = buf[0] & 0x0f;\n\t this._payloadLength = buf[1] & 0x7f;\n\n\t if (this._opcode === 0x00) {\n\t if (compressed) {\n\t this.error(new Error('RSV1 must be clear'), 1002);\n\t return;\n\t }\n\n\t if (!this._fragmented) {\n\t this.error(new Error(`invalid opcode: ${this._opcode}`), 1002);\n\t return;\n\t } else {\n\t this._opcode = this._fragmented;\n\t }\n\t } else if (this._opcode === 0x01 || this._opcode === 0x02) {\n\t if (this._fragmented) {\n\t this.error(new Error(`invalid opcode: ${this._opcode}`), 1002);\n\t return;\n\t }\n\n\t this._compressed = compressed;\n\t } else if (this._opcode > 0x07 && this._opcode < 0x0b) {\n\t if (!this._fin) {\n\t this.error(new Error('FIN must be set'), 1002);\n\t return;\n\t }\n\n\t if (compressed) {\n\t this.error(new Error('RSV1 must be clear'), 1002);\n\t return;\n\t }\n\n\t if (this._payloadLength > 0x7d) {\n\t this.error(new Error('invalid payload length'), 1002);\n\t return;\n\t }\n\t } else {\n\t this.error(new Error(`invalid opcode: ${this._opcode}`), 1002);\n\t return;\n\t }\n\n\t if (!this._fin && !this._fragmented) this._fragmented = this._opcode;\n\n\t this._masked = (buf[1] & 0x80) === 0x80;\n\n\t if (this._payloadLength === 126) this._state = GET_PAYLOAD_LENGTH_16;\n\t else if (this._payloadLength === 127) this._state = GET_PAYLOAD_LENGTH_64;\n\t else this.haveLength();\n\t }", "handleInitialSocks5AuthenticationHandshakeResponse() {\n this.state = constants_1.SocksClientState.ReceivedAuthenticationResponse;\n const data = this._receiveBuffer.get(2);\n if (data[1] !== 0x00) {\n this._closeSocket(constants_1.ERRORS.Socks5AuthenticationFailed);\n }\n else {\n this.sendSocks5CommandRequest();\n }\n }", "function ValidateDevice() {\n var validDevice = ValidateDevices.validateDevice(request.httpParameterMap.card_reader_serial_number.stringValue, request.httpParameterMap.store_id.stringValue,\n request.httpParameterMap.tablet_serial_number.stringValue);\n if (validDevice.ErrorMessage) {\n ISML.renderTemplate('responses/eainvaliddevicejson', {\n outputStr : validDevice.ErrorMessage\n });\n } else {\n ISML.renderTemplate('responses/eavaliddevicejson');\n }\n}" ]
[ "0.5652895", "0.55782306", "0.5489844", "0.5383237", "0.52497417", "0.5247988", "0.51484007", "0.5133036", "0.5129151", "0.51179457", "0.5115272", "0.50902283", "0.5064763", "0.4984619", "0.49633747", "0.49563098", "0.49541304", "0.49541304", "0.4942457", "0.49421838", "0.49414855", "0.49182817", "0.49116346", "0.49076697", "0.49063158", "0.4869121", "0.4856443", "0.4842748", "0.48333922", "0.48326713", "0.481304", "0.48068988", "0.4789032", "0.47741526", "0.476733", "0.47620195", "0.4758582", "0.47521752", "0.47503233", "0.4748829", "0.47305557", "0.4730492", "0.47255775", "0.47077557", "0.4699339", "0.46888304", "0.4684293", "0.46838173", "0.4683437", "0.46758103", "0.46675012", "0.46481395", "0.46367607", "0.46338284", "0.4630326", "0.4616685", "0.46156412", "0.46138236", "0.46119958", "0.4602953", "0.46024424", "0.4601225", "0.4594459", "0.4590614", "0.4579419", "0.45598337", "0.4558954", "0.45508903", "0.4549937", "0.45496032", "0.45395488", "0.45293236", "0.45293236", "0.4529", "0.45284945", "0.45265412", "0.45206302", "0.45141184", "0.45135942", "0.4509162", "0.45033753", "0.4502552", "0.45001957", "0.4498716", "0.44936758", "0.44901615", "0.44858333", "0.44843936", "0.44841576", "0.44841576", "0.44841576", "0.44792694", "0.4460621", "0.4457839", "0.4457683", "0.44568902", "0.44526953", "0.44503558", "0.4446364", "0.44440895" ]
0.5923784
0
calculate 2s complement checksum over a buffer, starting with a byte index
checksum( buf, start, length ) { let sum = 0; for( var i = start; i < start+length; i++ ) { sum = sum + buf[i]; } return ((~sum)+1) & 0xFF; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function crc(buf){return(updateCrc(-1,buf,buf.length)^-1)>>>0;// u32\n}", "checksum_buf(com){\n\tvar cs=0;\n\tvar cl=com.length;\n\tfor(var b=0; b<cl-1; b++){\n\t var by=com.readUInt8(b);\n\t var csb = ~by & 0x7F;\n\t cs = cs ^ csb;\n\t}\n\tcom.writeUInt8(cs,cl-1);\n\treturn String.fromCharCode(cs);\n }", "function performTwosCompliment(buffer) {\n var carry = true;\n var i, newByte, value;\n for (i = buffer.length - 1; i >= 0; --i) {\n value = buffer.readUInt8(i);\n newByte = ~value & 0xff;\n if (carry) {\n carry = newByte === 0xff;\n buffer.writeUInt8(newByte + 1, i);\n } else {\n buffer.writeUInt8(newByte, i);\n }\n }\n}", "static checksumBuffer(buf, length) {\n let checksum = '';\n let checksum_hex = '';\n for (let i = 0; i < (buf.length / length); i++) {\n checksum_hex = this.read64LE(buf, i);\n checksum = this.sumHex64bits(checksum, checksum_hex).substr(-16);\n }\n return checksum;\n }", "function checksum(s)\n{\n\t// console.log(\"DEBUT CHECK\");\n\ts = s.replace(/^(.(..)*)$/, \"0$1\"); // add a leading zero if needed\n\n\tvar a = s.match(/../g); // split number in groups of two\n\n\tvar C1 = a[0].charAt(0);\n\tvar C2 = a[0].charAt(1);\n\tfor( var i=1; i<a.length;i++ )\n\t{\n\t\tC1 = xor (C1,a[i].charAt(0).toString(16));\n\t\tC2 = xor (C2,a[i].charAt(1).toString(16));\n\t}\n\t// console.log(\"result :\"+C1.toString(16)+C2.toString(16));\n\t// console.log(\"FIN CHECK\");\n\n\treturn ''+C1.toString(16)+C2.toString(16);\n}", "function checksum(text) {\n var a = 1, b = 0;\n for (var index = 0; index < text.length; ++index) {\n a = (a + text.charCodeAt(index)) % 65521;\n b = (b + a) % 65521;\n }\n return (b << 16) | a;\n }", "function updateCrc(crc,buf,len){for(let n=0;n<len;n++){crc=crc>>>8^crcTable[(crc^buf[n])&255]}return crc}", "function checksum(data) {\n\tvar result = 0;\n\n\tfor (var i = 0; i < 13; i++) {\n\t\tresult += parseInt(data[i]) * (3 - i % 2 * 2);\n\t}\n\n\treturn Math.ceil(result / 10) * 10 - result;\n}", "addChecksum(data) {\n var hash = this.computeChecksum(data)\n // Get first byte of sha256\n var firstChecksumByte = hash[0]\n\n // len() is in bytes so we divide by 4\n var checksumBitLength = data.length / 4\n\n // For each bit of check sum we want we shift the data one the left\n // and then set the (new) right most bit equal to checksum bit at that index\n // staring from the left\n var dataBigInt = new bn(data)\n\n for (var i = 0; i < checksumBitLength; i++) {\n dataBigInt = dataBigInt.mul(bigTwo)\n }\n\n // Set rightmost bit if leftmost checksum bit is set\n if (firstChecksumByte & (1 << (7 - i)) > 0) {\n dataBigInt = dataBigInt.or(bigOne)\n }\n return dataBigInt.toArray(\"be\")\n }", "function checksum(str){\n\tvar i, checksum = 0;\n\tvar coefficients = [1,7,3,11];\n\tfor(i = 0; i < str.length; i++){\n\t\tchecksum += (coefficients[i % coefficients.length] * str.charCodeAt(i));\n\t}\n\treturn checksum % 10000;\n}", "function computeChecksum(inString) {\n let MOD_ADLER = 65521;\n let a = 1;\n let b = 0;\n for (let i = 0; i < inString.length; i++) {\n a = (a + inString.charAt(i).charCodeAt()) % MOD_ADLER;\n b = (b + a) % MOD_ADLER;\n }\n return (b ^ a) % 100;\n }", "function checksum(s, type = 'i')\n{\n var chk = 0x5F378EA8;\n var len = s.length;\n for (var i = 0; i < len; i++) chk += (s.charCodeAt(i) * (i + 1));\n if(type === 's') return (chk & 0xffffffff).toString(16);\n else return (chk & 0xffffffff);\n}", "removeByteStuffing(buffer) {\n var ff = buffer.indexOf(0xFF, 0);\n if (ff === -1 || buffer[ff+1] !== 0)\n return buffer; /* Nothing to remove */\n var searchIndex = ff+2; /* Where to start next search for 0xFF */\n\n while (true) {\n var ff2 = buffer.indexOf(0xFF, searchIndex);\n\n if (ff2 == -1 || buffer[ff2+1] !== 0) {\n /* We are finished, just need to copy down any trailing bytes and trim buffer length */\n buffer.copy(buffer, ff+1, searchIndex);\n return buffer.slice(0, ff + buffer.length - searchIndex + 1);\n } else {\n /* Copy down the next range of good data, overwriting unwanted zero byte */\n buffer.copy(buffer, ff+1, searchIndex, ff2+1);\n }\n\n ff = ff + ff2 - searchIndex + 1; /* Position which 0xFF was just copied down to */\n searchIndex = ff2+2; /* Where next range of good bytes starts from */\n }\n }", "function calculateChecksum(payload) {\n var checksum = strkey_Buffer.alloc(2);\n checksum.writeUInt16LE(mjs.crc16xmodem(payload), 0);\n return checksum;\n}", "function checksumTZ(data) {\n\tlet crc = 0;\n\tfor (let b of data) {\n\t\tfor (let j = 0; j < 8; j++) {\n\t\t\tif (!((b ^ crc) & 1)) crc ^= 0x19;\n\t\t\tb >>= 1;\n\t\t\t// Rotate (shift right, move lost LSB to new MSB)\n\t\t\tcrc = ((crc & 1) << 7) | (crc >> 1);\n\t\t}\n\t}\n\treturn crc ^ 0xbf;\n}", "function checksum(number){\n\tvar result = 0;\n\n\tvar i;\n\tfor(i = 0; i < 7; i += 2){\n\t\tresult += parseInt(number[i]) * 3;\n\t}\n\n\tfor(i = 1; i < 7; i += 2){\n\t\tresult += parseInt(number[i]);\n\t}\n\n\treturn (10 - (result % 10)) % 10;\n}", "function checksum(number) {\n\tvar result = 0;\n\n\tvar i;\n\tfor (i = 1; i < 11; i += 2) {\n\t\tresult += parseInt(number[i]);\n\t}\n\tfor (i = 0; i < 11; i += 2) {\n\t\tresult += parseInt(number[i]) * 3;\n\t}\n\n\treturn (10 - result % 10) % 10;\n}", "function checksum(number) {\n\tvar result = 0;\n\n\tvar i;\n\tfor (i = 1; i < 11; i += 2) {\n\t\tresult += parseInt(number[i]);\n\t}\n\tfor (i = 0; i < 11; i += 2) {\n\t\tresult += parseInt(number[i]) * 3;\n\t}\n\n\treturn (10 - result % 10) % 10;\n}", "function checksum(number) {\n\tvar result = 0;\n\n\tvar i;\n\tfor (i = 0; i < 7; i += 2) {\n\t\tresult += parseInt(number[i]) * 3;\n\t}\n\n\tfor (i = 1; i < 7; i += 2) {\n\t\tresult += parseInt(number[i]);\n\t}\n\n\treturn (10 - result % 10) % 10;\n}", "computeDataCrc() {\n let crc = 0xFFFF;\n const index = this.dataIndex;\n const begin = index - 4;\n const end = index + this.getLength();\n for (let i = begin; i < end; i++) {\n crc = Crc16_1.CRC_16_CCITT.update(crc, this.getByte(i));\n }\n return crc;\n }", "function getFNVChecksum(str) {\n var sum = 0x811c9dc5;\n for (var i = 0; i < str.length; ++i) {\n sum ^= str.charCodeAt(i);\n sum += (sum << 1) + (sum << 4) + (sum << 7) + (sum << 8) + (sum << 24);\n }\n return ((sum >> 15) ^ sum) & 0x7fff;\n}", "function checksum(number) {\n\tvar result = 0;\n\n\tvar i;\n\tfor (i = 0; i < 12; i += 2) {\n\t\tresult += parseInt(number[i]);\n\t}\n\tfor (i = 1; i < 12; i += 2) {\n\t\tresult += parseInt(number[i]) * 3;\n\t}\n\n\treturn (10 - result % 10) % 10;\n}", "function sha256_S (X,n){return (X >>> n ) | (X << (32-n));}", "checkSum(char, characters) {\n let checksum = 0;\n for (let i = 0; i < char.length; i++) {\n let codeNumber = characters.indexOf(char[i]);\n checksum += codeNumber;\n }\n checksum = checksum % 43;\n return checksum;\n }", "function crc32(buf) {\n let crc = ~0;\n let leftLength = buf.byteLength;\n let bufPos = 0;\n while (leftLength >= 8) {\n crc ^= readU32(buf, bufPos);\n crc = TABLE8[0][buf[7 + bufPos]] ^\n TABLE8[1][buf[6 + bufPos]] ^\n TABLE8[2][buf[5 + bufPos]] ^\n TABLE8[3][buf[4 + bufPos]] ^\n TABLE8[4][(crc >>> 24) & 0xFF] ^\n TABLE8[5][(crc >>> 16) & 0xFF] ^\n TABLE8[6][(crc >>> 8) & 0xFF] ^\n TABLE8[7][crc & 0xFF];\n bufPos += 8;\n leftLength -= 8;\n }\n for (let byte = 0; byte < leftLength; byte++) {\n crc = TABLE[(crc & 0xFF) ^ buf[byte + bufPos]] ^ (crc >>> 8);\n }\n return ~crc;\n}", "function checksum(array) {\r\n\tvar MODULUS = 65535;\r\n\tvar sum = 0;\r\n\tfor (var i in array) {\r\n\t\tsum = (sum + i) % MODULUS;\r\n\t}\r\n\treturn sum;\r\n}", "function checksum() {\n const buf = this.buffer();\n if (buf.length !== 4340) {\n throw new Error('Can only checksum a save block');\n }\n\n // Exclude the existing checksum, then CRC the block\n const dbuf = new Buffer(4336);\n buf.copy(dbuf, 0, 4);\n this.set('checksum', ~crc.crc16ccitt(dbuf) & 0xFFFF);\n}", "getDataCrc() {\n // Bit endian.\n const index = this.dataIndex + this.getLength();\n return (this.getByte(index) << 8) + this.getByte(index + 1);\n }", "function checksum(creditCardNumber) {\n // console.log(creditCardNumber);\n\n // Iterate over the creditCardNumber\n creditCardNumber = reverseString(creditCardNumber.toString());\n let secondToLastSum = 0;\n for (var i = 0; i < creditCardNumber.length; i++) {\n if ((i + 1) % 2 === 0) {\n if ((parseInt(creditCardNumber[i]) * 2).toString().length === 2) {\n // console.log(parseInt(creditCardNumber[i]) * 2)\n secondToLastSum += sumOfString(parseInt(creditCardNumber[i]) * 2);\n } else {\n secondToLastSum += parseInt(creditCardNumber[i] * 2);\n }\n } else {\n secondToLastSum += parseInt(creditCardNumber[i]);\n }\n }\n // console.log(secondToLastSum)\n return secondToLastSum % 2 === 0;\n }", "function calculateChecksum(sval) {\n var checksum = 0;\n for (var i = 0; i < sval.length; ++i) {\n checksum += parseInt(sval.charAt(i)) * (ACCOUNT_NUMBER_LENGTH - i);\n }\n return checksum;\n }", "function read_buff(buff, offset, n) {\n\t\tvar i;\n\t\tfor (i = 0; i < n && deflate_pos < deflate_data.length; i++) {\n\t\t\tbuff[offset + i] = deflate_data[deflate_pos++] & 0xff;\n\t\t}\n\t\treturn i;\n\t}", "function hexBlock(offset, len, back){\n var res = '';\n var i;\n if(back)\n for(i = len - 1; i >= 0; i--)\n res += byte(buf[pos + offset + i].toString(16));\n else\n for(i = 0; i < len; i++)\n res += byte(buf[pos + offset + i].toString(16));\n return res;\n }", "function crc32ForByte(r) {\n for (let j = 0; j < 8; ++j) {\n r = (r & 1 ? 0 : 0xedb88320) ^ (r >>> 1);\n }\n return r ^ 0xff000000;\n}", "function xorBuffer(a, b) {\n var length = Math.max(a.length, b.length);\n var buffer = Buffer.allocUnsafe(length).fill(0);\n for (var i = 0; i < length; ++i) {\n if (i < a.length && i < b.length) {\n buffer[length - i - 1] = a[a.length - i - 1] ^ b[b.length - i - 1];\n }\n else if (i < a.length && i >= b.length) {\n buffer[length - i - 1] ^= a[a.length - i - 1];\n }\n else if (i < b.length && i >= a.length) {\n buffer[length - i - 1] ^= b[b.length - i - 1];\n }\n }\n // now need to remove leading zeros in the buffer if any\n var start = 0;\n var it = buffer.values();\n var value = it.next();\n while (!value.done && value.value === 0) {\n start++;\n value = it.next();\n }\n var buf2 = buffer.slice(start);\n return buf2;\n}", "function sha256_S(X, n) {\n\t return (X >>> n) | (X << (32 - n));\n\t }", "calcSimpleSum(data) {\n\t\tlet sum = 0;\n\t\tfor (let i = 0; i < (data.length >> 2) - 1; i++) {\n\t\t\tsum += Number(utils.bin2dec(data.slice(i * 4, (i + 1) * 4).reverse().join('')));\n\t\t}\n\t\treturn sum & 0xf;\n\t}", "function read16BitHexCode(body, position) {\n // readHexDigit() returns -1 on error. ORing a negative value with any other\n // value always produces a negative value.\n return (\n (readHexDigit(body.charCodeAt(position)) << 12) |\n (readHexDigit(body.charCodeAt(position + 1)) << 8) |\n (readHexDigit(body.charCodeAt(position + 2)) << 4) |\n readHexDigit(body.charCodeAt(position + 3))\n );\n}", "function adler32$2(adler, buf, len, pos) {\n\t var s1 = (adler & 0xffff) |0,\n\t s2 = ((adler >>> 16) & 0xffff) |0,\n\t n = 0;\n\n\t while (len !== 0) {\n\t // Set limit ~ twice less than 5552, to keep\n\t // s2 in 31-bits, because we force signed ints.\n\t // in other case %= will fail.\n\t n = len > 2000 ? 2000 : len;\n\t len -= n;\n\n\t do {\n\t s1 = (s1 + buf[pos++]) |0;\n\t s2 = (s2 + s1) |0;\n\t } while (--n);\n\n\t s1 %= 65521;\n\t s2 %= 65521;\n\t }\n\n\t return (s1 | (s2 << 16)) |0;\n\t}", "function summing(d)\n {\n var carry = 0;\n for (var i = 0; i < Sum.length; i++)\n {\n var sum = (Sum[i] & 0xff) + (d[i] & 0xff) + carry;\n\n Sum[i] = sum;\n\n carry = sum >>> 8;\n }\n }", "forward(buffer) {\n var n = this.bufferSize,\n spectrum = this.spectrum,\n x = this.trans,\n TWO_PI = 2 * Math.PI,\n sqrt = Math.sqrt,\n i = n >>> 1,\n bSi = 2 / n,\n n2, n4, n8, nn,\n t1, t2, t3, t4,\n i1, i2, i3, i4, i5, i6, i7, i8,\n st1, cc1, ss1, cc3, ss3,\n e,\n a,\n rval, ival, mag;\n\n this.reverseBinPermute(x, buffer);\n\n for (var ix = 0, id = 4; ix < n; id *= 4) {\n for (var i0 = ix; i0 < n; i0 += id) {\n //sumdiff(x[i0], x[i0+1]); // {a, b} <--| {a+b, a-b}\n st1 = x[i0] - x[i0 + 1];\n x[i0] += x[i0 + 1];\n x[i0 + 1] = st1;\n }\n ix = 2 * (id - 1);\n }\n\n n2 = 2;\n nn = n >>> 1;\n\n while ((nn = nn >>> 1)) {\n ix = 0;\n n2 = n2 << 1;\n id = n2 << 1;\n n4 = n2 >>> 2;\n n8 = n2 >>> 3;\n do {\n if (n4 !== 1) {\n for (i0 = ix; i0 < n; i0 += id) {\n i1 = i0;\n i2 = i1 + n4;\n i3 = i2 + n4;\n i4 = i3 + n4;\n\n //diffsum3_r(x[i3], x[i4], t1); // {a, b, s} <--| {a, b-a, a+b}\n t1 = x[i3] + x[i4];\n x[i4] -= x[i3];\n //sumdiff3(x[i1], t1, x[i3]); // {a, b, d} <--| {a+b, b, a-b}\n x[i3] = x[i1] - t1;\n x[i1] += t1;\n\n i1 += n8;\n i2 += n8;\n i3 += n8;\n i4 += n8;\n\n //sumdiff(x[i3], x[i4], t1, t2); // {s, d} <--| {a+b, a-b}\n t1 = x[i3] + x[i4];\n t2 = x[i3] - x[i4];\n\n t1 = -t1 * Math.SQRT1_2;\n t2 *= Math.SQRT1_2;\n\n // sumdiff(t1, x[i2], x[i4], x[i3]); // {s, d} <--| {a+b, a-b}\n st1 = x[i2];\n x[i4] = t1 + st1;\n x[i3] = t1 - st1;\n\n //sumdiff3(x[i1], t2, x[i2]); // {a, b, d} <--| {a+b, b, a-b}\n x[i2] = x[i1] - t2;\n x[i1] += t2;\n }\n } else {\n for (i0 = ix; i0 < n; i0 += id) {\n i1 = i0;\n i2 = i1 + n4;\n i3 = i2 + n4;\n i4 = i3 + n4;\n\n //diffsum3_r(x[i3], x[i4], t1); // {a, b, s} <--| {a, b-a, a+b}\n t1 = x[i3] + x[i4];\n x[i4] -= x[i3];\n\n //sumdiff3(x[i1], t1, x[i3]); // {a, b, d} <--| {a+b, b, a-b}\n x[i3] = x[i1] - t1;\n x[i1] += t1;\n }\n }\n\n ix = (id << 1) - n2;\n id = id << 2;\n } while (ix < n);\n\n e = TWO_PI / n2;\n\n for (var j = 1; j < n8; j++) {\n a = j * e;\n ss1 = Math.sin(a);\n cc1 = Math.cos(a);\n\n //ss3 = sin(3*a); cc3 = cos(3*a);\n cc3 = 4 * cc1 * (cc1 * cc1 - 0.75);\n ss3 = 4 * ss1 * (0.75 - ss1 * ss1);\n\n ix = 0; id = n2 << 1;\n do {\n for (i0 = ix; i0 < n; i0 += id) {\n i1 = i0 + j;\n i2 = i1 + n4;\n i3 = i2 + n4;\n i4 = i3 + n4;\n\n i5 = i0 + n4 - j;\n i6 = i5 + n4;\n i7 = i6 + n4;\n i8 = i7 + n4;\n\n //cmult(c, s, x, y, &u, &v)\n //cmult(cc1, ss1, x[i7], x[i3], t2, t1); // {u,v} <--| {x*c-y*s, x*s+y*c}\n t2 = x[i7] * cc1 - x[i3] * ss1;\n t1 = x[i7] * ss1 + x[i3] * cc1;\n\n //cmult(cc3, ss3, x[i8], x[i4], t4, t3);\n t4 = x[i8] * cc3 - x[i4] * ss3;\n t3 = x[i8] * ss3 + x[i4] * cc3;\n\n //sumdiff(t2, t4); // {a, b} <--| {a+b, a-b}\n st1 = t2 - t4;\n t2 += t4;\n t4 = st1;\n\n //sumdiff(t2, x[i6], x[i8], x[i3]); // {s, d} <--| {a+b, a-b}\n //st1 = x[i6]; x[i8] = t2 + st1; x[i3] = t2 - st1;\n x[i8] = t2 + x[i6];\n x[i3] = t2 - x[i6];\n\n //sumdiff_r(t1, t3); // {a, b} <--| {a+b, b-a}\n st1 = t3 - t1;\n t1 += t3;\n t3 = st1;\n\n //sumdiff(t3, x[i2], x[i4], x[i7]); // {s, d} <--| {a+b, a-b}\n //st1 = x[i2]; x[i4] = t3 + st1; x[i7] = t3 - st1;\n x[i4] = t3 + x[i2];\n x[i7] = t3 - x[i2];\n\n //sumdiff3(x[i1], t1, x[i6]); // {a, b, d} <--| {a+b, b, a-b}\n x[i6] = x[i1] - t1;\n x[i1] += t1;\n\n //diffsum3_r(t4, x[i5], x[i2]); // {a, b, s} <--| {a, b-a, a+b}\n x[i2] = t4 + x[i5];\n x[i5] -= t4;\n }\n\n ix = (id << 1) - n2;\n id = id << 2;\n\n } while (ix < n);\n }\n }\n\n while (--i) {\n rval = x[i];\n ival = x[n - i - 1];\n mag = bSi * sqrt(rval * rval + ival * ival);\n\n if (mag > this.peak) {\n this.peakBand = i;\n this.peak = mag;\n }\n\n spectrum[i] = mag;\n }\n\n spectrum[0] = bSi * x[0];\n\n return spectrum;\n }", "function flipBin(csum) {\n var cs = csum.split(\"\");\n var flip = \"\";\n for (var b in cs) {\n flip += parseInt(cs[b]) ? \"0\" : \"1\";\n }\n return flip;\n\n //return csum.split(\"\").reverse().join(\"\");\n}", "function CRC(payload) {\n var crc = 0;\n for(var i = 0; i < payload.length; ++i) {\n crc = _crctab[crc ^ payload[i]];\n }\n return crc;\n }", "function sha256_final() {\n var index = count[0] >> 3 & 0x3f;\n buffer[index++] = 0x80;\n\n if (index <= 56) {\n for (var i = index; i < 56; i++) {\n buffer[i] = 0;\n }\n } else {\n for (var i = index; i < 64; i++) {\n buffer[i] = 0;\n }\n\n sha256_transform();\n\n for (var i = 0; i < 56; i++) {\n buffer[i] = 0;\n }\n }\n\n buffer[56] = count[1] >>> 24 & 0xff;\n buffer[57] = count[1] >>> 16 & 0xff;\n buffer[58] = count[1] >>> 8 & 0xff;\n buffer[59] = count[1] & 0xff;\n buffer[60] = count[0] >>> 24 & 0xff;\n buffer[61] = count[0] >>> 16 & 0xff;\n buffer[62] = count[0] >>> 8 & 0xff;\n buffer[63] = count[0] & 0xff;\n sha256_transform();\n}", "function sha256_final() {\n var index = count[0] >> 3 & 0x3f;\n buffer[index++] = 0x80;\n\n if (index <= 56) {\n for (var i = index; i < 56; i++) {\n buffer[i] = 0;\n }\n } else {\n for (var _i = index; _i < 64; _i++) {\n buffer[_i] = 0;\n }\n\n sha256_transform();\n\n for (var _i2 = 0; _i2 < 56; _i2++) {\n buffer[_i2] = 0;\n }\n }\n\n buffer[56] = count[1] >>> 24 & 0xff;\n buffer[57] = count[1] >>> 16 & 0xff;\n buffer[58] = count[1] >>> 8 & 0xff;\n buffer[59] = count[1] & 0xff;\n buffer[60] = count[0] >>> 24 & 0xff;\n buffer[61] = count[0] >>> 16 & 0xff;\n buffer[62] = count[0] >>> 8 & 0xff;\n buffer[63] = count[0] & 0xff;\n sha256_transform();\n}", "function sha256_final() {\n var index = ((count[0] >> 3) & 0x3f);\n buffer[index++] = 0x80;\n if (index <= 56) {\n for (var i = index; i < 56; i++)\n buffer[i] = 0;\n } else {\n for (var i = index; i < 64; i++)\n buffer[i] = 0;\n sha256_transform();\n for (var i = 0; i < 56; i++)\n buffer[i] = 0;\n }\n buffer[56] = (count[1] >>> 24) & 0xff;\n buffer[57] = (count[1] >>> 16) & 0xff;\n buffer[58] = (count[1] >>> 8) & 0xff;\n buffer[59] = count[1] & 0xff;\n buffer[60] = (count[0] >>> 24) & 0xff;\n buffer[61] = (count[0] >>> 16) & 0xff;\n buffer[62] = (count[0] >>> 8) & 0xff;\n buffer[63] = count[0] & 0xff;\n sha256_transform();\n}", "at(index) {\n return this.bytes[index] & 0xff;\n }", "function adler32(adler,buf,len,pos){var s1=adler&0xffff|0,s2=adler>>>16&0xffff|0,n=0;while(len!==0){// Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n=len>2000?2000:len;len-=n;do{s1=s1+buf[pos++]|0;s2=s2+s1|0;}while(--n);s1%=65521;s2%=65521;}return s1|s2<<16|0;}", "bin2dec(b){\n\t\tlet i= 0;\n\t\tlet n = b.length;\n\t\tlet puissance=0;\n\t\tlet index = n -1;\n\t\twhile (index >= -n) {\n\t\t\tif (b[index] === 1)\n\t\t\t\ti= i + Math.pow(2,puissance)\n\t\t\tpuissance= puissance +1;\n\t\t\tindex=index-1;\n\t\t}\n\t\treturn i;\n\t}", "function SHA1(input) {\n\n // Initialize variables:\n let h0 = 0x67452301;\n let h1 = 0xEFCDAB89;\n let h2 = 0x98BADCFE;\n let h3 = 0x10325476;\n let h4 = 0xC3D2E1F0;\n\n const w = new Int32Array(80);\n let a, b, c, d, e;\n let f, k, temp;\n\n\n /** Currently only works for messages length < 2^32 bits. */\n function addDigest(/* ByteBuffer */ src) {\n\n // Process the message in successive 512-bit (64 byte) chunks:\n // break message into 512-bit (64 byte) chunks\n // Break chunk into sixteen 32-bit big-endian words w[i], 0 <= i <= 15.\n let i = 0;\n for (i = 0; i < 16; i++) {\n w[i] = src.getInt(i*4);\n }\n\n for (i = 16; i < 80; i++) {\n w[i] = 0;\n }\n\n // Compute/add 1 digest line.\n // Extend the sixteen 32-bit (4 byte) words into eighty 32-bit (4 byte) words:\n for (i = 16; i < 80; i++) {\n w[i] = Integer.rotateLeft(w[i-3] ^ w[i-8] ^ w[i-14] ^ w[i-16], 1);\n }\n\n // Initialize hash value for this chunk:\n f = k = temp = 0;\n a = h0;\n b = h1;\n c = h2;\n d = h3;\n e = h4;\n\n for (i = 0; i < 20; i++) {\n f = (b & c) | ((~b) & d);\n k = 0x5A827999;\n finishValues(i);\n }\n\n for (i = 20; i < 40; i++) {\n f = b ^ c ^ d;\n k = 0x6ED9EBA1;\n finishValues(i);\n }\n\n for (i = 40; i < 60; i++) {\n f = (b & c) | (b & d) | (c & d);\n k = 0x8F1BBCDC;\n finishValues(i);\n }\n\n for (i = 60; i < 80; i++) {\n f = b ^ c ^ d;\n k = 0xCA62C1D6;\n finishValues(i);\n }\n\n // Add this chunk's hash to result so far:\n h0 += a;\n h1 += b;\n h2 += c;\n h3 += d;\n h4 += e;\n checkNum(a, b, c, d, e);\n }\n\n function finishValues(/* int */ i) {\n console.log('finishValues: ', i, a, b, c, d, e, f, k)\n temp = Integer.rotateLeft(a, 5) + f + e + k + w[i];\n e = d;\n d = c;\n c = Integer.rotateLeft(b, 30);\n b = a;\n a = temp;\n }\n\n function pad(/* ByteBuffer */ src, /* long */ wholeMsgLength) {\n const /* ByteBuffer */ padded = new ByteBuffer(128);\n padded.put(src);\n padded.put(128);\n\n if (padded.position() < 56) {\n while (padded.position() < 56) {\n padded.put(0x0);\n }\n } else {\n while (padded.position() < 120) {\n padded.put(0x0);\n }\n }\n\n padded.putLong(wholeMsgLength);\n padded.flip();\n return padded;\n }\n\n const /* String */ ZEROS = \"00000000\";\n padStr = (s) => {\n console.log('padStr: ', s);\n if (s.length > 8) {\n return s.substring(0, 8); //(s.length - 8)\n }\n return ZEROS.substring(s.length) + s;\n }\n\n function toHexString(x) {\n if (isNaN(x)) {\n throw new Error('Is not a number: ', x);\n }\n return padStr(Integer.toHexString(x));\n }\n\n function getHash() {\n console.log(`Getting hash... h0(${h0}) h1(${h1}) h2(${h2}) h3(${h3}) h4(${h4})`);\n return toHexString(h0)\n + toHexString(h1)\n + toHexString(h2)\n + toHexString(h3)\n + toHexString(h4);\n }\n\n function process(/* ByteBuffer */ src) {\n if (src.limit() >= 64) {\n for (let i = 0, n = src.limit() / 64; i < n; i++) {\n const offset = i * 64;\n src.position(offset).limit(offset + 64);\n //addDigest(src);\n // break message into 512-bit (64 byte) chunks\n // Break chunk into sixteen 32-bit big-endian words w[i], 0 <= i <= 15.\n let j = 0;\n for (j = 0; j < 16; j++) {\n w[j] = src.getInt(j*4);\n }\n\n for (j = 16; j < 80; j++) {\n w[j] = 0;\n }\n\n // Compute/add 1 digest line.\n // Extend the sixteen 32-bit (4 byte) words into eighty 32-bit (4 byte) words:\n for (j = 16; j < 80; j++) {\n w[j] = Integer.rotateLeft(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1);\n }\n\n // Initialize hash value for this chunk:\n f = k = temp = 0;\n a = h0;\n b = h1;\n c = h2;\n d = h3;\n e = h4;\n\n for (j = 0; j < 20; j++) {\n f = (b & c) | ((~b) & d);\n k = 0x5A827999;\n finishValues(j);\n }\n\n for (j = 20; j < 40; j++) {\n f = b ^ c ^ d;\n k = 0x6ED9EBA1;\n finishValues(j);\n }\n\n for (j = 40; j < 60; j++) {\n f = (b & c) | (b & d) | (c & d);\n k = 0x8F1BBCDC;\n finishValues(j);\n }\n\n for (j = 60; j < 80; j++) {\n f = b ^ c ^ d;\n k = 0xCA62C1D6;\n finishValues(j);\n }\n\n // Add this chunk's hash to result so far:\n h0 += a;\n h1 += b;\n h2 += c;\n h3 += d;\n h4 += e;\n }\n }\n\n const /* ByteBuffer */ padded = pad(src, input.length * 8);\n addDigest(padded);\n if (padded.limit() == 128) {\n padded.position(64);\n addDigest(padded.slice());\n }\n return getHash();\n }\n\n return process(input);\n}", "function TwoSComplement(a)\n{\n //copy\n a = Array.from(a)\n\n //If zero, return 0 ..\n if(SignedBinToDecimal(a) == 0)\n {\n return a;\n }\n else\n {\n //NON\n let c = []\n for(i = 0; i < a.length; i++)\n {\n c[i] = !a[i]\n }\n\n //+1\n let one = Array(c.length)\n for(i = 0; i < one.length; i++)\n {\n one[i] = (i == 0 ? true : false)\n }\n\n //revserse it\n one = one.reverse()\n\n c = sumOfSignedIntegerBinaryValues(c, one)['res']\n return c\n }\n}", "function parse256 (buf) {\n // first byte MUST be either 80 or FF\n // 80 for positive, FF for 2's comp\n var positive\n if (buf[0] === 0x80) positive = true\n else if (buf[0] === 0xFF) positive = false\n else return null\n\n // build up a base-256 tuple from the least sig to the highest\n var tuple = []\n for (var i = buf.length - 1; i > 0; i--) {\n var byte = buf[i]\n if (positive) tuple.push(byte)\n else tuple.push(0xFF - byte)\n }\n\n var sum = 0\n var l = tuple.length\n for (i = 0; i < l; i++) {\n sum += tuple[i] * Math.pow(256, i)\n }\n\n return positive ? sum : -1 * sum\n}", "function parse256 (buf) {\n // first byte MUST be either 80 or FF\n // 80 for positive, FF for 2's comp\n var positive\n if (buf[0] === 0x80) positive = true\n else if (buf[0] === 0xFF) positive = false\n else return null\n\n // build up a base-256 tuple from the least sig to the highest\n var tuple = []\n for (var i = buf.length - 1; i > 0; i--) {\n var byte = buf[i]\n if (positive) tuple.push(byte)\n else tuple.push(0xFF - byte)\n }\n\n var sum = 0\n var l = tuple.length\n for (i = 0; i < l; i++) {\n sum += tuple[i] * Math.pow(256, i)\n }\n\n return positive ? sum : -1 * sum\n}", "function parse256 (buf) {\n // first byte MUST be either 80 or FF\n // 80 for positive, FF for 2's comp\n var positive\n if (buf[0] === 0x80) positive = true\n else if (buf[0] === 0xFF) positive = false\n else return null\n\n // build up a base-256 tuple from the least sig to the highest\n var tuple = []\n for (var i = buf.length - 1; i > 0; i--) {\n var byte = buf[i]\n if (positive) tuple.push(byte)\n else tuple.push(0xFF - byte)\n }\n\n var sum = 0\n var l = tuple.length\n for (i = 0; i < l; i++) {\n sum += tuple[i] * Math.pow(256, i)\n }\n\n return positive ? sum : -1 * sum\n}", "function parse256 (buf) {\n // first byte MUST be either 80 or FF\n // 80 for positive, FF for 2's comp\n var positive\n if (buf[0] === 0x80) positive = true\n else if (buf[0] === 0xFF) positive = false\n else return null\n\n // build up a base-256 tuple from the least sig to the highest\n var tuple = []\n for (var i = buf.length - 1; i > 0; i--) {\n var byte = buf[i]\n if (positive) tuple.push(byte)\n else tuple.push(0xFF - byte)\n }\n\n var sum = 0\n var l = tuple.length\n for (i = 0; i < l; i++) {\n sum += tuple[i] * Math.pow(256, i)\n }\n\n return positive ? sum : -1 * sum\n}", "function rsint8(buffer, endian, offset)\n{\n\tvar neg;\n\n\tif (endian === undefined)\n\t\tthrow (new Error('missing endian'));\n\n\tif (buffer === undefined)\n\t\tthrow (new Error('missing buffer'));\n\n\tif (offset === undefined)\n\t\tthrow (new Error('missing offset'));\n\n\tif (offset >= buffer.length)\n\t\tthrow (new Error('Trying to read beyond buffer length'));\n\n\tneg = buffer[offset] & 0x80;\n\tif (!neg)\n\t\treturn (buffer[offset]);\n\n\treturn ((0xff - buffer[offset] + 1) * -1);\n}", "function rsint8(buffer, endian, offset)\n{\n\tvar neg;\n\n\tif (endian === undefined)\n\t\tthrow (new Error('missing endian'));\n\n\tif (buffer === undefined)\n\t\tthrow (new Error('missing buffer'));\n\n\tif (offset === undefined)\n\t\tthrow (new Error('missing offset'));\n\n\tif (offset >= buffer.length)\n\t\tthrow (new Error('Trying to read beyond buffer length'));\n\n\tneg = buffer[offset] & 0x80;\n\tif (!neg)\n\t\treturn (buffer[offset]);\n\n\treturn ((0xff - buffer[offset] + 1) * -1);\n}", "function adler32(adler, buf, len, pos) {\n var s1 = (adler & 0xffff) |0,\n s2 = ((adler >>> 16) & 0xffff) |0,\n n = 0;\n \n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n \n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n \n s1 %= 65521;\n s2 %= 65521;\n }\n \n return (s1 | (s2 << 16)) |0;\n }", "function sha256_final() {\n var index = ((count[0] >> 3) & 0x3f);\n buffer[index++] = 0x80;\n if (index <= 56) {\n for (var i = index; i < 56; i++)\n buffer[i] = 0;\n } else {\n for (var i = index; i < 64; i++)\n buffer[i] = 0;\n sha256_transform();\n for (var i = 0; i < 56; i++)\n buffer[i] = 0;\n }\n buffer[56] = (count[1] >>> 24) & 0xff;\n buffer[57] = (count[1] >>> 16) & 0xff;\n buffer[58] = (count[1] >>> 8) & 0xff;\n buffer[59] = count[1] & 0xff;\n buffer[60] = (count[0] >>> 24) & 0xff;\n buffer[61] = (count[0] >>> 16) & 0xff;\n buffer[62] = (count[0] >>> 8) & 0xff;\n buffer[63] = count[0] & 0xff;\n sha256_transform();\n}", "function parseBinary(buf, index) {\n\n\t// Get the result as an integer\n\tvar num = buf.readUInt8(index);\n\n\t// Convert to a binary string\n\tvar binary = num.toString(2);\n\n\t// For each value\n\t_.times( 8 - binary.length, function() { binary = \"0\" + binary; });\n\n\t// Save the result\n\tvar results = {};\n\n\t// Loop each 8\n\t_.times(8, function(n) {\n\n\t\t// Save the result\n\t\tresults[n] = binary.substring( n + 1, n ) == \"1\" ? true : false;\n\n\t});\n\n\t// Return the result\n\treturn results;\n\n}", "function read_buf(strm,buf,start,size){var len=strm.avail_in;if(len>size){len=size;}if(len===0){return 0;}strm.avail_in-=len;// zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf,strm.input,strm.next_in,len,start);if(strm.state.wrap===1){strm.adler=adler32(strm.adler,buf,len,start);}else if(strm.state.wrap===2){strm.adler=crc32(strm.adler,buf,len,start);}strm.next_in+=len;strm.total_in+=len;return len;}", "function getInt16 (buffer, offset) {\n if ((buffer.length - offset) >= 2) {\n return (buffer[offset + 1] << 8) + buffer[offset];\n }\n return 0;\n}", "function adler32(adler, buf, len, pos) {\n let s1 = adler & 0xffff |0,\n s2 = adler >>> 16 & 0xffff |0,\n n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = s1 + buf[pos++] |0;\n s2 = s2 + s1 |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return s1 | s2 << 16 |0;\n}", "function addDigest(/* ByteBuffer */ src) {\n\n // Process the message in successive 512-bit (64 byte) chunks:\n // break message into 512-bit (64 byte) chunks\n // Break chunk into sixteen 32-bit big-endian words w[i], 0 <= i <= 15.\n let i = 0;\n for (i = 0; i < 16; i++) {\n w[i] = src.getInt(i*4);\n }\n\n for (i = 16; i < 80; i++) {\n w[i] = 0;\n }\n\n // Compute/add 1 digest line.\n // Extend the sixteen 32-bit (4 byte) words into eighty 32-bit (4 byte) words:\n for (i = 16; i < 80; i++) {\n w[i] = Integer.rotateLeft(w[i-3] ^ w[i-8] ^ w[i-14] ^ w[i-16], 1);\n }\n\n // Initialize hash value for this chunk:\n f = k = temp = 0;\n a = h0;\n b = h1;\n c = h2;\n d = h3;\n e = h4;\n\n for (i = 0; i < 20; i++) {\n f = (b & c) | ((~b) & d);\n k = 0x5A827999;\n finishValues(i);\n }\n\n for (i = 20; i < 40; i++) {\n f = b ^ c ^ d;\n k = 0x6ED9EBA1;\n finishValues(i);\n }\n\n for (i = 40; i < 60; i++) {\n f = (b & c) | (b & d) | (c & d);\n k = 0x8F1BBCDC;\n finishValues(i);\n }\n\n for (i = 60; i < 80; i++) {\n f = b ^ c ^ d;\n k = 0xCA62C1D6;\n finishValues(i);\n }\n\n // Add this chunk's hash to result so far:\n h0 += a;\n h1 += b;\n h2 += c;\n h3 += d;\n h4 += e;\n checkNum(a, b, c, d, e);\n }", "checksum(number){\n\t\tvar result = 0;\n\n\t\tvar i;\n\t\tfor(i = 1; i < 11; i += 2){\n\t\t\tresult += parseInt(number[i]);\n\t\t}\n\t\tfor(i = 0; i < 11; i += 2){\n\t\t\tresult += parseInt(number[i]) * 3;\n\t\t}\n\n\t\treturn (10 - (result % 10)) % 10;\n\t}", "function checksumL(filepath){\n\treturn getFileSizeBytes(filepath) % 10000;\n}", "function adler32(adler, buf, len, pos) {\n var s1 = adler & 0xffff | 0,\n s2 = adler >>> 16 & 0xffff | 0,\n n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = s1 + buf[pos++] | 0;\n s2 = s2 + s1 | 0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return s1 | s2 << 16 | 0;\n }", "function rsint16(buffer, endian, offset)\n{\n\tvar neg, val;\n\n\tif (endian === undefined)\n\t\tthrow (new Error('missing endian'));\n\n\tif (buffer === undefined)\n\t\tthrow (new Error('missing buffer'));\n\n\tif (offset === undefined)\n\t\tthrow (new Error('missing offset'));\n\n\tif (offset + 1 >= buffer.length)\n\t\tthrow (new Error('Trying to read beyond buffer length'));\n\n\tval = rgint16(buffer, endian, offset);\n\tneg = val & 0x8000;\n\tif (!neg)\n\t\treturn (val);\n\n\treturn ((0xffff - val + 1) * -1);\n}", "function rsint16(buffer, endian, offset)\n{\n\tvar neg, val;\n\n\tif (endian === undefined)\n\t\tthrow (new Error('missing endian'));\n\n\tif (buffer === undefined)\n\t\tthrow (new Error('missing buffer'));\n\n\tif (offset === undefined)\n\t\tthrow (new Error('missing offset'));\n\n\tif (offset + 1 >= buffer.length)\n\t\tthrow (new Error('Trying to read beyond buffer length'));\n\n\tval = rgint16(buffer, endian, offset);\n\tneg = val & 0x8000;\n\tif (!neg)\n\t\treturn (val);\n\n\treturn ((0xffff - val + 1) * -1);\n}", "function countZeros(buf) {\n\tvar o = 0,\n\t obit = 8;\n\twhile (o < buf.length) {\n\t\tvar mask = 1 << obit;\n\t\tif ((buf[o] & mask) === mask) break;\n\t\tobit--;\n\t\tif (obit < 0) {\n\t\t\to++;\n\t\t\tobit = 8;\n\t\t}\n\t}\n\treturn o * 8 + (8 - obit) - 1;\n}", "function digest() {\n // Pad\n write(0x80);\n if (offset > 14 || (offset === 14 && shift < 24)) {\n processBlock();\n }\n offset = 14;\n shift = 24;\n\n // 64-bit length big-endian\n write(0x00); // numbers this big aren't accurate in javascript anyway\n write(0x00); // ..So just hard-code to zero.\n write(totalLength > 0xffffffffff ? totalLength / 0x10000000000 : 0x00);\n write(totalLength > 0xffffffff ? totalLength / 0x100000000 : 0x00);\n for (var s = 24; s >= 0; s -= 8) {\n write(totalLength >> s);\n }\n\n // At this point one last processBlock() should trigger and we can pull out the result.\n return toHex(h0) +\n toHex(h1) +\n toHex(h2) +\n toHex(h3) +\n toHex(h4);\n }", "function digest() {\n // Pad\n write(0x80);\n if (offset > 14 || (offset === 14 && shift < 24)) {\n processBlock();\n }\n offset = 14;\n shift = 24;\n\n // 64-bit length big-endian\n write(0x00); // numbers this big aren't accurate in javascript anyway\n write(0x00); // ..So just hard-code to zero.\n write(totalLength > 0xffffffffff ? totalLength / 0x10000000000 : 0x00);\n write(totalLength > 0xffffffff ? totalLength / 0x100000000 : 0x00);\n for (var s = 24; s >= 0; s -= 8) {\n write(totalLength >> s);\n }\n\n // At this point one last processBlock() should trigger and we can pull out the result.\n return toHex(h0) +\n toHex(h1) +\n toHex(h2) +\n toHex(h3) +\n toHex(h4);\n }", "function digest() {\n // Pad\n write(0x80);\n if (offset > 14 || (offset === 14 && shift < 24)) {\n processBlock();\n }\n offset = 14;\n shift = 24;\n\n // 64-bit length big-endian\n write(0x00); // numbers this big aren't accurate in javascript anyway\n write(0x00); // ..So just hard-code to zero.\n write(totalLength > 0xffffffffff ? totalLength / 0x10000000000 : 0x00);\n write(totalLength > 0xffffffff ? totalLength / 0x100000000 : 0x00);\n for (var s = 24; s >= 0; s -= 8) {\n write(totalLength >> s);\n }\n\n // At this point one last processBlock() should trigger and we can pull out the result.\n return toHex(h0) +\n toHex(h1) +\n toHex(h2) +\n toHex(h3) +\n toHex(h4);\n }", "function parse256 (buf) {\n // first byte MUST be either 80 or FF\n // 80 for positive, FF for 2's comp\n let positive\n if (buf.get(0) === 0x80) positive = true\n else if (buf.get(0) === 0xFF) positive = false\n else return null\n\n // build up a base-256 tuple from the least sig to the highest\n let zero = false\n const tuple = []\n for (let i = buf.length - 1; i > 0; i--) {\n const byte = buf.get(i)\n if (positive) tuple.push(byte)\n else if (zero && byte === 0) tuple.push(0)\n else if (zero) {\n zero = false\n tuple.push(0x100 - byte)\n } else tuple.push(0xFF - byte)\n }\n\n let sum = 0\n const l = tuple.length\n for (let i = 0; i < l; i++) {\n sum += tuple[i] * Math.pow(256, i)\n }\n\n return positive ? sum : -1 * sum\n}", "function adler32(adler, buf, len, pos) {\n var s1 = adler & 0xffff | 0,\n s2 = adler >>> 16 & 0xffff | 0,\n n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = s1 + buf[pos++] | 0;\n s2 = s2 + s1 | 0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return s1 | s2 << 16 | 0;\n }", "function adler32(adler, buf, len, pos) {\n var s1 = adler & 0xffff | 0,\n s2 = adler >>> 16 & 0xffff | 0,\n n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = s1 + buf[pos++] | 0;\n s2 = s2 + s1 | 0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return s1 | s2 << 16 | 0;\n }", "function hash(buffer) {\n\tconst hash = crypto.createHash('sha256');\n\thash.update(buffer);\n\treturn hash.digest('hex');\n}", "function adler32(adler, buf, len, pos) {\n var s1 = (adler & 0xffff) |0\n , s2 = ((adler >>> 16) & 0xffff) |0\n , n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return (s1 | (s2 << 16)) |0;\n}", "function adler32(adler, buf, len, pos) {\n var s1 = (adler & 0xffff) |0\n , s2 = ((adler >>> 16) & 0xffff) |0\n , n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return (s1 | (s2 << 16)) |0;\n}", "function adler32(adler, buf, len, pos) {\n var s1 = (adler & 0xffff) |0\n , s2 = ((adler >>> 16) & 0xffff) |0\n , n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return (s1 | (s2 << 16)) |0;\n}", "function adler32(adler, buf, len, pos) {\n var s1 = (adler & 0xffff) |0\n , s2 = ((adler >>> 16) & 0xffff) |0\n , n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return (s1 | (s2 << 16)) |0;\n}", "function adler32(adler, buf, len, pos) {\n var s1 = (adler & 0xffff) |0\n , s2 = ((adler >>> 16) & 0xffff) |0\n , n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return (s1 | (s2 << 16)) |0;\n}", "function adler32(adler, buf, len, pos) {\n var s1 = (adler & 0xffff) |0\n , s2 = ((adler >>> 16) & 0xffff) |0\n , n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return (s1 | (s2 << 16)) |0;\n}", "function adler32(adler, buf, len, pos) {\n var s1 = (adler & 0xffff) |0\n , s2 = ((adler >>> 16) & 0xffff) |0\n , n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return (s1 | (s2 << 16)) |0;\n}", "function adler32(adler, buf, len, pos) {\n var s1 = (adler & 0xffff) |0\n , s2 = ((adler >>> 16) & 0xffff) |0\n , n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return (s1 | (s2 << 16)) |0;\n}", "function adler32(adler, buf, len, pos) {\n var s1 = (adler & 0xffff) |0\n , s2 = ((adler >>> 16) & 0xffff) |0\n , n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return (s1 | (s2 << 16)) |0;\n}", "function adler32(adler, buf, len, pos) {\n var s1 = (adler & 0xffff) |0\n , s2 = ((adler >>> 16) & 0xffff) |0\n , n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return (s1 | (s2 << 16)) |0;\n}", "function adler32(adler, buf, len, pos) {\n var s1 = (adler & 0xffff) |0\n , s2 = ((adler >>> 16) & 0xffff) |0\n , n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return (s1 | (s2 << 16)) |0;\n}", "function adler32(adler, buf, len, pos) {\n var s1 = (adler & 0xffff) |0\n , s2 = ((adler >>> 16) & 0xffff) |0\n , n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return (s1 | (s2 << 16)) |0;\n}", "function adler32(adler, buf, len, pos) {\n var s1 = (adler & 0xffff) |0\n , s2 = ((adler >>> 16) & 0xffff) |0\n , n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return (s1 | (s2 << 16)) |0;\n}", "function adler32(adler, buf, len, pos) {\n var s1 = (adler & 0xffff) |0\n , s2 = ((adler >>> 16) & 0xffff) |0\n , n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return (s1 | (s2 << 16)) |0;\n}", "function adler32(adler, buf, len, pos) {\n var s1 = (adler & 0xffff) |0\n , s2 = ((adler >>> 16) & 0xffff) |0\n , n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return (s1 | (s2 << 16)) |0;\n}", "function adler32(adler, buf, len, pos) {\n var s1 = (adler & 0xffff) |0\n , s2 = ((adler >>> 16) & 0xffff) |0\n , n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return (s1 | (s2 << 16)) |0;\n}", "function adler32(adler, buf, len, pos) {\n var s1 = (adler & 0xffff) |0\n , s2 = ((adler >>> 16) & 0xffff) |0\n , n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return (s1 | (s2 << 16)) |0;\n}", "function adler32(adler, buf, len, pos) {\n var s1 = (adler & 0xffff) |0\n , s2 = ((adler >>> 16) & 0xffff) |0\n , n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return (s1 | (s2 << 16)) |0;\n}", "checksum(number){\n\t\tvar result = 0;\n\n\t\tvar i;\n\t\tfor(i = 0; i < 12; i += 2){\n\t\t\tresult += parseInt(number[i]);\n\t\t}\n\t\tfor(i = 1; i < 12; i += 2){\n\t\t\tresult += parseInt(number[i]) * 3;\n\t\t}\n\n\t\treturn (10 - (result % 10)) % 10;\n\t}", "function beautifulBinaryString(b) {\n // Complete this function\n\n var changes = 0;\n\n while (b.indexOf(\"010\") !== -1) {\n //console.log(b, b.indexOf(\"010\"));\n b = b.replace(\"010\", \"011\");\n changes++;\n }\n\n return changes;\n}", "function adler32$1(adler, buf, len, pos) {\n\t var s1 = (adler & 0xffff) |0,\n\t s2 = ((adler >>> 16) & 0xffff) |0,\n\t n = 0;\n\n\t while (len !== 0) {\n\t // Set limit ~ twice less than 5552, to keep\n\t // s2 in 31-bits, because we force signed ints.\n\t // in other case %= will fail.\n\t n = len > 2000 ? 2000 : len;\n\t len -= n;\n\n\t do {\n\t s1 = (s1 + buf[pos++]) |0;\n\t s2 = (s2 + s1) |0;\n\t } while (--n);\n\n\t s1 %= 65521;\n\t s2 %= 65521;\n\t }\n\n\t return (s1 | (s2 << 16)) |0;\n\t}", "function createCrcInt32FromBytes(bytes) {\n // XXX do documentation\n // https://docs.microsoft.com/en-us/openspecs/office_protocols/ms-abs/06966aa2-70da-4bf9-8448-3355f277cd77\n // https://simplycalc.com/crc32-source.php\n var i = 0, l = bytes.length, crc32 = 0xFFFFFFFF|0, crcTable = [\n // generated with createCrcTableInt32ArrayFromPolynomial(0xEDB88320);\n 0x00000000, 0x77073096, -0x11f19ed4, -0x66f6ae46,\n 0x076dc419, 0x706af48f, -0x169c5acb, -0x619b6a5d,\n 0x0edb8832, 0x79dcb8a4, -0x1f2a16e2, -0x682d2678,\n 0x09b64c2b, 0x7eb17cbd, -0x1847d2f9, -0x6f40e26f,\n 0x1db71064, 0x6ab020f2, -0x0c468eb8, -0x7b41be22,\n 0x1adad47d, 0x6ddde4eb, -0x0b2b4aaf, -0x7c2c7a39,\n 0x136c9856, 0x646ba8c0, -0x029d0686, -0x759a3614,\n 0x14015c4f, 0x63066cd9, -0x05f0c29d, -0x72f7f20b,\n 0x3b6e20c8, 0x4c69105e, -0x2a9fbe1c, -0x5d988e8e,\n 0x3c03e4d1, 0x4b04d447, -0x2df27a03, -0x5af54a95,\n 0x35b5a8fa, 0x42b2986c, -0x2444362a, -0x534306c0,\n 0x32d86ce3, 0x45df5c75, -0x2329f231, -0x542ec2a7,\n 0x26d930ac, 0x51de003a, -0x3728ae80, -0x402f9eea,\n 0x21b4f4b5, 0x56b3c423, -0x30456a67, -0x47425af1,\n 0x2802b89e, 0x5f058808, -0x39f3264e, -0x4ef416dc,\n 0x2f6f7c87, 0x58684c11, -0x3e9ee255, -0x4999d2c3,\n 0x76dc4190, 0x01db7106, -0x672ddf44, -0x102aefd6,\n 0x71b18589, 0x06b6b51f, -0x60401b5b, -0x17472bcd,\n 0x7807c9a2, 0x0f00f934, -0x69f65772, -0x1ef167e8,\n 0x7f6a0dbb, 0x086d3d2d, -0x6e9b9369, -0x199ca3ff,\n 0x6b6b51f4, 0x1c6c6162, -0x7a9acf28, -0x0d9dffb2,\n 0x6c0695ed, 0x1b01a57b, -0x7df70b3f, -0x0af03ba9,\n 0x65b0d9c6, 0x12b7e950, -0x74414716, -0x03467784,\n 0x62dd1ddf, 0x15da2d49, -0x732c830d, -0x042bb39b,\n 0x4db26158, 0x3ab551ce, -0x5c43ff8c, -0x2b44cf1e,\n 0x4adfa541, 0x3dd895d7, -0x5b2e3b93, -0x2c290b05,\n 0x4369e96a, 0x346ed9fc, -0x529877ba, -0x259f4730,\n 0x44042d73, 0x33031de5, -0x55f5b3a1, -0x22f28337,\n 0x5005713c, 0x270241aa, -0x41f4eff0, -0x36f3df7a,\n 0x5768b525, 0x206f85b3, -0x46992bf7, -0x319e1b61,\n 0x5edef90e, 0x29d9c998, -0x4f2f67de, -0x3828574c,\n 0x59b33d17, 0x2eb40d81, -0x4842a3c5, -0x3f459353,\n -0x12477ce0, -0x65404c4a, 0x03b6e20c, 0x74b1d29a,\n -0x152ab8c7, -0x622d8851, 0x04db2615, 0x73dc1683,\n -0x1c9cf4ee, -0x6b9bc47c, 0x0d6d6a3e, 0x7a6a5aa8,\n -0x1bf130f5, -0x6cf60063, 0x0a00ae27, 0x7d079eb1,\n -0x0ff06cbc, -0x78f75c2e, 0x1e01f268, 0x6906c2fe,\n -0x089da8a3, -0x7f9a9835, 0x196c3671, 0x6e6b06e7,\n -0x012be48a, -0x762cd420, 0x10da7a5a, 0x67dd4acc,\n -0x06462091, -0x71411007, 0x17b7be43, 0x60b08ed5,\n -0x29295c18, -0x5e2e6c82, 0x38d8c2c4, 0x4fdff252,\n -0x2e44980f, -0x5943a899, 0x3fb506dd, 0x48b2364b,\n -0x27f2d426, -0x50f5e4b4, 0x36034af6, 0x41047a60,\n -0x209f103d, -0x579820ab, 0x316e8eef, 0x4669be79,\n -0x349e4c74, -0x43997ce6, 0x256fd2a0, 0x5268e236,\n -0x33f3886b, -0x44f4b8fd, 0x220216b9, 0x5505262f,\n -0x3a45c442, -0x4d42f4d8, 0x2bb45a92, 0x5cb36a04,\n -0x3d280059, -0x4a2f30cf, 0x2cd99e8b, 0x5bdeae1d,\n -0x649b3d50, -0x139c0dda, 0x756aa39c, 0x026d930a,\n -0x63f6f957, -0x14f1c9c1, 0x72076785, 0x05005713,\n -0x6a40b57e, -0x1d4785ec, 0x7bb12bae, 0x0cb61b38,\n -0x6d2d7165, -0x1a2a41f3, 0x7cdcefb7, 0x0bdbdf21,\n -0x792c2d2c, -0x0e2b1dbe, 0x68ddb3f8, 0x1fda836e,\n -0x7e41e933, -0x0946d9a5, 0x6fb077e1, 0x18b74777,\n -0x77f7a51a, -0x00f09590, 0x66063bca, 0x11010b5c,\n -0x709a6101, -0x079d5197, 0x616bffd3, 0x166ccf45,\n -0x5ff51d88, -0x28f22d12, 0x4e048354, 0x3903b3c2,\n -0x5898d99f, -0x2f9fe909, 0x4969474d, 0x3e6e77db,\n -0x512e95b6, -0x2629a524, 0x40df0b66, 0x37d83bf0,\n -0x564351ad, -0x2144613b, 0x47b2cf7f, 0x30b5ffe9,\n -0x42420de4, -0x35453d76, 0x53b39330, 0x24b4a3a6,\n -0x452fc9fb, -0x3228f96d, 0x54de5729, 0x23d967bf,\n -0x4c9985d2, -0x3b9eb548, 0x5d681b02, 0x2a6f2b94,\n -0x4bf441c9, -0x3cf3715f, 0x5a05df1b, 0x2d02ef8d\n ];\n for (; i < l; i = (i + 1)|0)\n crc32 = crcTable[(crc32 & 0xFF) ^ (bytes[i] & 0xFF)] ^ (crc32 >>> 8);\n return crc32 ^ 0xFFFFFFFF;\n }", "function getByte(idx) { return data.charCodeAt(idx); }", "function countZeros(buf) {\n\tvar o = 0, obit = 8;\n\twhile (o < buf.length) {\n\t\tvar mask = (1 << obit);\n\t\tif ((buf[o] & mask) === mask)\n\t\t\tbreak;\n\t\tobit--;\n\t\tif (obit < 0) {\n\t\t\to++;\n\t\t\tobit = 8;\n\t\t}\n\t}\n\treturn (o*8 + (8 - obit) - 1);\n}" ]
[ "0.71113706", "0.69702226", "0.69534045", "0.66330284", "0.6595845", "0.63730997", "0.6250073", "0.6237258", "0.6106878", "0.59434587", "0.5887493", "0.57834655", "0.57324564", "0.5727105", "0.57150084", "0.57025385", "0.5680195", "0.5680195", "0.566878", "0.56614137", "0.5640799", "0.56342435", "0.5594379", "0.55479515", "0.5519652", "0.55070525", "0.54711443", "0.54577315", "0.54380554", "0.54092425", "0.54002416", "0.5396839", "0.5353532", "0.5335794", "0.5328903", "0.53279305", "0.53185", "0.5308823", "0.52814263", "0.52763474", "0.52656466", "0.52632374", "0.525611", "0.52288884", "0.52212214", "0.5206972", "0.51965", "0.5162212", "0.51584643", "0.5156943", "0.51503855", "0.51503855", "0.51503855", "0.51503855", "0.5143268", "0.5143268", "0.51345956", "0.5133421", "0.5119711", "0.5118658", "0.5109805", "0.51061684", "0.510371", "0.5099261", "0.5093484", "0.5093077", "0.5088429", "0.5088429", "0.508787", "0.50816345", "0.50816345", "0.50816345", "0.5078842", "0.50739956", "0.50739956", "0.5072706", "0.5071325", "0.5071325", "0.5071325", "0.5071325", "0.5071325", "0.5071325", "0.5071325", "0.5071325", "0.5071325", "0.5071325", "0.5071325", "0.5071325", "0.5071325", "0.5071325", "0.5071325", "0.5071325", "0.5071325", "0.5071325", "0.5070823", "0.5069235", "0.5068189", "0.50647295", "0.5064526", "0.50641876" ]
0.77874213
0
Required function for a Transform. Called when a chunk of data arrives. we have no idea what data this is, or if it is even from a JCOM board.
_transform(chunk, encoding, cb) { var me = this; //console.log('Chunk: ', chunk ); // Concatenate any previous data, and split into an array of // encoded PDUs that start with a MSG_START byte let encodedPdus = this.splitBuffer( Buffer.concat([this.buffer, chunk]) ); // Now we look through each of the encoded PDUs (which have not // yet been validated for length or checksum) encodedPdus.forEach( function( encodedPdu, pduIndex ){ // Unstuff the PDU (remove escape codes) let pdu = me.decodePdu( encodedPdu ); if( pdu.length >= MIN_MSG_LEN ) { // it is at least long enough to possibly be complete let msgLength = pdu[1]*256 + pdu[2]; // If it's too long, truncate it. This shouldn't really happen // under normal circumstances, but no reason to keep extra bytes around. if(pdu.length + 3 > msgLength ) { pdu = pdu.slice(0, msgLength+3 ); } // If it (now) has the expected number of bytes... if( msgLength === pdu.length-3 ) { // check the checksum let checksum = me.checksum( pdu, 1, msgLength +1 ); if( checksum === pdu[ msgLength+2 ] ) { // Process the received PDU me.onReceive( pdu ); } else { // report an incorrect checksum me.onReceiveError( pdu ); } } else if( pduIndex === encodedPdu.length-1 ) { // if last PDU is incomplete, save it for later me.buffer = Buffer.from( encodedPdu ); } } else if( pduIndex === encodedPdu.length-1 ) { // if last PDU is incomplete, save it for later me.buffer = Buffer.from( encodedPdu ); } }); // notify the caller that we are done processing the chunk cb(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_onControlSocketData(chunk) {\n this.log(`< ${chunk}`);\n // This chunk might complete an earlier partial response.\n const completeResponse = this._partialResponse + chunk;\n const parsed = (0, parseControlResponse_1.parseControlResponse)(completeResponse);\n // Remember any incomplete remainder.\n this._partialResponse = parsed.rest;\n // Each response group is passed along individually.\n for (const message of parsed.messages) {\n const code = parseInt(message.substr(0, 3), 10);\n const response = { code, message };\n const err = code >= 400 ? new FTPError(response) : undefined;\n this._passToHandler(err ? err : response);\n }\n }", "onData(chunk) {\n this.chunks.push(chunk);\n }", "onData(chunk) {\n this.chunks.push(chunk);\n }", "_transform(chunk, encoding, callback) {\n // Still not enough bytes to emit a record after this chunk, just save it\n if (this._tmpbuf.length + chunk.length < this._reclen) {\n this._tmpbuf = Buffer.concat([this._tmpbuf, chunk]);\n return callback();\n }\n\n // Emit one data record, part of which may have been left over from the last chunk\n let chunkptr = this._reclen - this._tmpbuf.length;\n if (this._ptr > 0xFFFFFFFF) {\n return callback(new Error('Load address too wide'));\n }\n this.push(buildRecord(\n this._dtype(this._ptr), this._ptr,\n Buffer.concat([this._tmpbuf, chunk.slice(0, chunkptr)])\n ) + '\\n');\n this._cnt++;\n this._ptr += this._reclen;\n\n // Emit as many more full-length data records as possible from this chunk\n while (chunkptr + this._reclen <= chunk.length) {\n if (this._ptr > 0xFFFFFFFF) {\n return callback(new Error('Load address too wide'));\n }\n this.push(buildRecord(\n this._dtype(this._ptr), this._ptr,\n chunk.slice(chunkptr, chunkptr + this._reclen)\n ) + '\\n');\n this._cnt++;\n this._ptr += this._reclen;\n chunkptr += this._reclen;\n }\n\n // And save the remainder\n this._tmpbuf = chunk.slice(chunkptr);\n callback();\n }", "transform(chunk, encoding, callback) {\n output.NumberOfLines += chunk.toString().split('\\n').length;\n output.LengthInBytes += chunk.length;\n output.TimeElapsed = milliSeconds;\n this.push(output); // Pushes the calculated values into the object output\n callback(); // A function that needs to be called after we're done processing the data chunk\n }", "function handle_data_available(event) {\n if (event.data.size > 0) {\n recordedChunks.push(event.data);\n }\n}", "getChunkHandler() {\n var decoder = new TextDecoder();\n var partial = false;\n return (data) => {\n var currentTime = (new Date()).getTime();\n var elapsedMillis = currentTime - this.prevChunkRecvTime;\n this.prevChunkRecvTime = currentTime;\n\n if(data.done) {\n return true;\n }\n\n var chunk = decoder.decode(data.value || new Uint8Array, {stream: !data.done});\n var startIdx = 0, msg;\n if(partial) {\n var partialEnd = chunk.indexOf(\"}{\", startIdx);\n if(partialEnd == -1) {\n console.debug(\"Another partial received in entirety, skipping chunk\");\n startIdx = chunk.length;\n } else {\n console.debug(\"Partial dropped from the start of chunk\");\n startIdx = partialEnd + 1;\n }\n }\n\n if(startIdx < chunk.length) {\n if (chunk[startIdx] != '{') {\n throw new Error(\"Invalid chunk received, cannot process this request further\");\n }\n this.callback({type: \"stat_chunk\", msg: {elapsed: elapsedMillis}});\n \n while(true) {\n if(startIdx == chunk.length) {\n break;\n }\n var msgEnd = chunk.indexOf(\"}{\", startIdx);\n if(msgEnd == -1) {\n try {\n msg = JSON.parse(chunk.substring(startIdx));\n partial = false;\n this.callback({ type: \"data\", msg: this.transformer(msg)});\n } catch (err) {\n console.debug(\"Invalid JSON, partial received at the end. Dropping it\");\n partial = true;\n }\n startIdx = chunk.length;\n } else {\n try {\n msg = JSON.parse(chunk.substring(startIdx, msgEnd + 1));\n this.callback({ type: \"data\", msg: this.transformer(msg)});\n } catch (err) {\n throw new Error(\"Invalid JSON which was unexpected here: \" + err.message); \n }\n startIdx = msgEnd + 1;\n }\n }\n }\n return false;\n };\n }", "_transform(chunk,encoding,cb) {\n\n const uint8_view = new Uint8Array(chunk, 0, chunk.length);\n var dataView = new DataView(uint8_view.buffer);\n\n let iFloat = Array(this.sz*2);\n let asComplex = Array(this.sz);\n\n\n // for(let i = 0; i < this.sz*2; i+=1) {\n // iFloat[i] = dataView.getFloat64(i*8, true);\n // }\n\n for(let i = 0; i < this.sz*2; i+=2) {\n let re = dataView.getFloat64(i*8, true);\n let im = dataView.getFloat64((i*8)+8, true);\n\n asComplex[i/2] = mt.complex(re,im);\n\n iFloat[i] = re;\n iFloat[i+1] = im;\n\n // if( i < 16 ) {\n // console.log(re);\n // }\n\n }\n\n let iShort = mutil.IFloatToIShortMulti(iFloat);\n\n if( this.onFrameIShort !== null ) {\n this.onFrameIShort(iShort);\n }\n\n // console.log(\"iFloat length \" + iFloat.length);\n // console.log(iFloat.slice(0,16));\n\n // console.log(\"iShort length \" + iShort.length);\n // console.log(iShort.slice(0,16));\n\n\n this.handleDefaultStream(iFloat,iShort,asComplex);\n this.handleFineSync(iFloat,iShort,asComplex);\n this.handleAllSubcarriers(iFloat,iShort,asComplex);\n this.handleDemodData(iFloat,iShort,asComplex);\n\n\n // for(x of iFloat) {\n // console.log(x);\n // }\n\n\n this.uint.frame_track_counter++;\n cb();\n }", "function onData(chunk) {\n try {\n parse(chunk);\n } catch (err) {\n self.emit(\"error\", err);\n }\n }", "function onData (chunk) {\n debug('onData (chunk.length: %d)', chunk.length);\n if (!this._preprocessedDone) {\n // TODO: don't be lazy, buffer if needed...\n assert(chunk.length >= 3, 'buffer too small! ' + chunk.length);\n if (/icy/i.test(chunk.slice(0, 3))) {\n debug('got ICY response!');\n var b = new Buffer(chunk.length + HTTP10.length - 'icy'.length);\n var i = 0;\n i += HTTP10.copy(b);\n i += chunk.copy(b, i, 3);\n assert.equal(i, b.length);\n chunk = b;\n this._wasIcy = true;\n } else {\n this._wasIcy = false;\n }\n this._preprocessedDone = true;\n }\n this.emit('processedData', chunk);\n}", "_transform(chunk, encoding, callback) {\n var base, e;\n if (this.state.stop === true) {\n return;\n }\n // Chunk validation\n if (!(Array.isArray(chunk) || typeof chunk === 'object')) {\n this.state.stop = true;\n return callback(Error(`Invalid Record: expect an array or an object, got ${JSON.stringify(chunk)}`));\n }\n // Detect columns from the first record\n if (this.info.records === 0) {\n if (Array.isArray(chunk)) {\n if (this.options.header === true && !this.options.columns) {\n this.state.stop = true;\n return callback(Error('Undiscoverable Columns: header option requires column option or object records'));\n }\n } else {\n if ((base = this.options).columns == null) {\n base.columns = this.normalize_columns(Object.keys(chunk));\n }\n }\n }\n if (this.info.records === 0) {\n // Emit the header\n this.headers();\n }\n try {\n // Emit and stringify the record if an object or an array\n this.emit('record', chunk, this.info.records);\n } catch (error) {\n e = error;\n this.state.stop = true;\n return this.emit('error', e);\n }\n // Convert the record into a string\n if (this.options.eof) {\n chunk = this.stringify(chunk);\n if (chunk == null) {\n return;\n }\n chunk = chunk + this.options.record_delimiter;\n } else {\n chunk = this.stringify(chunk);\n if (chunk == null) {\n return;\n }\n if (this.options.header || this.info.records) {\n chunk = this.options.record_delimiter + chunk;\n }\n }\n // Emit the csv\n this.info.records++;\n this.push(chunk);\n return callback();\n }", "function handleDataAvailable(e) {\n console.log('video data available');\n recordedChunks.push(e.data);\n }", "_onData(data) {\n\n let me = this;\n\n me._rxData = me._rxData + data.toString();\n\n // If we are waiting for a response from the device, see if this is it\n if(this.requestQueue.length > 0) {\n\n let cmd = me.requestQueue[0];\n\n if(me._rxData.search(cmd.regex) > -1) {\n // found what we are looking for\n\n\n // Cancel the no-response timeout because we have a response\n if(cmd.timer !== null) {\n clearTimeout(cmd.timer);\n cmd.timer = null;\n }\n\n // Signal the caller with the response data\n if(cmd.cb) {\n cmd.cb(null, me._rxData);\n }\n\n // Remove the request from the queue\n me.requestQueue.shift();\n\n // discard all data (this only works because we only send one\n // command at a time...)\n me._rxData = '';\n }\n } else if(me.isReady) {\n\n let packets = me._rxData.split(';');\n\n if(packets.length > 0) {\n\n\n // save any extra data that's not a full packet for next time\n me._rxData = packets.pop();\n\n packets.forEach(function(packet) {\n\n let fields = packet.match(/:([SX])([0-9A-F]{1,8})N([0-9A-F]{0,16})/);\n\n if(fields) {\n\n let id = 0;\n let ext = false,\n data;\n\n try {\n\n data = Buffer.from(fields[3], 'hex');\n id = parseInt(fields[2], 16);\n\n if(fields[1] === 'X') {\n ext = true;\n }\n\n } catch (err) {\n // we sometimes get malformed packets (like an odd number of hex digits for the data)\n // I dunno why that is, so ignore them\n // console.log('onData error: ', fields, err);\n }\n\n if(id > 0) {\n // emit a standard (non-J1939) message\n me.push({\n id: id,\n ext: ext,\n buf: data\n });\n\n }\n\n }\n });\n }\n }\n }", "function dataHandler(chunk, numer)\n{\n var i;\n for (i = camz[numer].clients.length; i--;) {\n camz[numer].clients[i].write(chunk, 'binary');\n }\n}", "function handleDataAvailable(e) {\n console.log('video data available');\n recordedChunks.push(e.data);\n}", "function processedFFData() {\n\t\tthis.moteid = idMote;\n\t\tthis.sensorType = sensorType;\n\t\tthis.lastTimestamp = lastTimeStamp;\n\t\tthis.lastValue = lastValue;\n\t\tthis.arrayValuesDay = valuesDay;\n\t\tthis.populationDay = populationDay;\n\t\tthis.arrayValuesWeek = valuesWeek;\n\t\tthis.populationWeek = populationWeek;\n\t\tthis.platform = platform;\n\t\tthis.unit = unit;\n\t}", "function dataavailableCb(chunk) {\n var encoded = self._arrayBufferToBase64(chunk);\n console.log('Sending audio chunk to websocket for recordingId: ' +\n self._recordingId);\n self._session.call('nl.itslanguage.recording.write',\n [self._recordingId, encoded, 'base64']).then(\n // RPC success callback\n function(res) {\n // Wrote data.\n },\n // RPC error callback\n function(res) {\n self.logRPCError(res);\n _ecb(res);\n }\n );\n }", "_transform(chunk, encoding, callback) {\n const bg = concatgen([this._tmpbuf, chunk]);\n let recbytes = [];\n while (true) {\n // Get next byte, or save any incomplete record\n const b = bg.next();\n if (b.done) {\n this._tmpbuf = Buffer.from(recbytes);\n return callback();\n }\n recbytes.push(b.value);\n\n // Got enough bytes for a record\n if (recbytes.length === this._reclen) {\n // If last record crossed or ended on a 64KB boundary, output extended address\n if (this._needea) {\n const eabuf = Buffer.allocUnsafe(2);\n eabuf.writeInt16BE(this._ptr >> 16);\n this.push(buildRecord(4, 0, eabuf) + '\\n');\n this._needea = false;\n }\n this.push(buildRecord(0, this._ptr & 0xFFFF, Buffer.from(recbytes)) + '\\n');\n\n // Did that record cross or end on a 64KB boundary?\n if (this._ptr >> 16 !== (this._ptr + this._reclen) >> 16) {\n this._needea = true;\n }\n this._ptr += this._reclen;\n recbytes = [];\n }\n }\n }", "dataMessage () {\n if (this._fin) {\n const messageLength = this._messageLength;\n const fragments = this._fragments;\n\n this._totalPayloadLength = 0;\n this._messageLength = 0;\n this._fragmented = 0;\n this._fragments = [];\n\n if (this._opcode === 2) {\n var data;\n\n if (this._binaryType === 'nodebuffer') {\n data = toBuffer(fragments, messageLength);\n } else if (this._binaryType === 'arraybuffer') {\n data = toArrayBuffer(toBuffer(fragments, messageLength));\n } else {\n data = fragments;\n }\n\n this.onmessage(data);\n } else {\n const buf = toBuffer(fragments, messageLength);\n\n if (!Validation(buf)) {\n this.error(new Error('invalid utf8 sequence'), 1007);\n return;\n }\n\n this.onmessage(buf.toString());\n }\n }\n\n this._state = GET_INFO;\n }", "function dataLoaded(err,data,m){\n}", "processFileChunk({\n transfer_id: transfer_id,\n chunkNumber: chunkNum,\n totalChunks: totalChunks,\n data: data\n }) {\n console.log(\n `Processing file chunk ${transfer_id}, ${chunkNum}/${totalChunks}, length: ${\n data.length\n }`\n );\n this.addToBuffer(chunkNum, totalChunks, this.str2ab(data));\n\n this.chunksReceived += 1;\n\n this.sendSegmentAckIfApplicable();\n\n console.log(`Chunk Received ${this.chunksReceived}`);\n this.emit(FILE_TRANSFER_PROGRESS, {\n chunk: chunkNum + 1,\n total: totalChunks,\n correlationId: this.receiverId\n });\n\n if (chunkNum === totalChunks - 1 && this.allChunksDownloaded()) {\n let receivedFile = new window.Blob(this.receivedBuffer);\n this.emit(this.fileTransferCompleteEvent, {\n file: this.fileInfo,\n blob: receivedFile,\n correlationId: this.receiverId\n });\n\n // Remove any resources as the download is complete\n this.destructResources();\n }\n }", "function handleTransmission(data)\n{\n var numMessages = data[0]\n var len = data.length\n var currentIndex = 0\n var currentTransmission = 0\n\n for (var index = 1; index < len; index++)\n {\n var dataItem = data[index]\n if (currentIndex == 0)\n {\n //address\n }\n\n else if (currentIndex == 1)\n {\n //data len\n\n }\n\n else\n {\n //data\n }\n\n }\n\n\n}", "function serialEvent() {\n inData = Number(serial.read());\n}", "onReceive( pdu ) {\n\n // We push it to the Transform object, which spits it out\n // the Readable side of the stream as a 'data' event\n this.push( Buffer.from( pdu.slice(3, pdu.length-1 )));\n\n }", "onDataReceived(data) {\n /*\n All received data is appended to a ReceiveBuffer.\n This makes sure that all the data we need is received before we attempt to process it.\n */\n this._receiveBuffer.append(data);\n // Process data that we have.\n this.processData();\n }", "dataMessage () {\n\t if (this.fin) {\n\t const messageLength = this.messageLength;\n\t const fragments = this.fragments;\n\n\t this.totalPayloadLength = 0;\n\t this.messageLength = 0;\n\t this.fragmented = 0;\n\t this.fragments = [];\n\n\t if (this.opcode === 2) {\n\t var data;\n\n\t if (this.binaryType === 'nodebuffer') {\n\t data = toBuffer(fragments, messageLength);\n\t } else if (this.binaryType === 'arraybuffer') {\n\t data = toArrayBuffer(toBuffer(fragments, messageLength));\n\t } else {\n\t data = fragments;\n\t }\n\n\t this.onmessage(data, { masked: this.masked, binary: true });\n\t } else {\n\t const buf = toBuffer(fragments, messageLength);\n\n\t if (!isValidUTF8(buf)) {\n\t this.error(new Error('invalid utf8 sequence'), 1007);\n\t return;\n\t }\n\n\t this.onmessage(buf.toString(), { masked: this.masked });\n\t }\n\t }\n\n\t this.state = GET_INFO;\n\t }", "dataMessage () {\n if (this.fin) {\n const messageLength = this.messageLength;\n const fragments = this.fragments;\n\n this.totalPayloadLength = 0;\n this.messageLength = 0;\n this.fragmented = 0;\n this.fragments = [];\n\n if (this.opcode === 2) {\n var data;\n\n if (this.binaryType === 'nodebuffer') {\n data = toBuffer(fragments, messageLength);\n } else if (this.binaryType === 'arraybuffer') {\n data = toArrayBuffer(toBuffer(fragments, messageLength));\n } else {\n data = fragments;\n }\n\n this.onmessage(data, { masked: this.masked, binary: true });\n } else {\n const buf = toBuffer(fragments, messageLength);\n\n if (!isValidUTF8(buf)) {\n this.error(new Error('invalid utf8 sequence'), 1007);\n return;\n }\n\n this.onmessage(buf.toString(), { masked: this.masked });\n }\n }\n\n this.state = GET_INFO;\n }", "dataMessage () {\n\t if (this._fin) {\n\t const messageLength = this._messageLength;\n\t const fragments = this._fragments;\n\n\t this._totalPayloadLength = 0;\n\t this._messageLength = 0;\n\t this._fragmented = 0;\n\t this._fragments = [];\n\n\t if (this._opcode === 2) {\n\t var data;\n\n\t if (this._binaryType === 'nodebuffer') {\n\t data = toBuffer(fragments, messageLength);\n\t } else if (this._binaryType === 'arraybuffer') {\n\t data = toArrayBuffer(toBuffer(fragments, messageLength));\n\t } else {\n\t data = fragments;\n\t }\n\n\t this.onmessage(data);\n\t } else {\n\t const buf = toBuffer(fragments, messageLength);\n\n\t if (!isValidUTF8(buf)) {\n\t this.error(new Error('invalid utf8 sequence'), 1007);\n\t return;\n\t }\n\n\t this.onmessage(buf.toString());\n\t }\n\t }\n\n\t this._state = GET_INFO;\n\t }", "_transform( data, encoding, streamCallback )\n {\n // convert buffer to string\n const text = data.toString( this.stringEncoding )\n\n // split data at newline\n const lines = text.split( this.newlineCharacter )\n\n // prepend previously buffered data to first line\n lines[0] = this.lineBuffer + lines[0]\n\n // last \"line\" is probably not a complete line,\n // remove it from the processing array and store it for next time\n this.lineBuffer = lines.pop()\n\n // process and push data with adding newline back\n this.handleLines( streamCallback, this.transformCallback, lines, this.newlineCharacter )\n }", "function onSocketChunk(chunk) {\n var err = self.mach.handleChunk(chunk);\n if (err) {\n self.sendProtocolError('read', err);\n }\n }", "function onSocketData(chunk) {\n let data = _data.get(this);\n\n if (typeof data.buffer !== 'string') {\n data.buffer = '';\n }\n\n data.buffer += chunk;\n\n let delimiter = data.buffer.indexOf('\\n');\n\n while (delimiter >= 0) {\n let message;\n\n try {\n message = JSON.parse(data.buffer.substr(0, delimiter));\n } catch (err) {\n setImmediate(this.emit.bind(this, 'error', err));\n }\n\n if (message) {\n setImmediate(this.emit.bind(this, 'data', message));\n }\n\n data.buffer = data.buffer.substr(delimiter + 1);\n\n delimiter = data.buffer.indexOf('\\n');\n }\n\n _data.set(this, data);\n}", "_readData(buf) {\n this._streamBuffer = Buffer.concat([this._streamBuffer, buf]);\n // The new buffer might contain a complete packet, try to read to find out...\n this._readPacket();\n }", "function onData(data) {\n\n // Attach or extend receive buffer\n _receiveBuffer = (null === _receiveBuffer) ? data : Buffer.concat([_receiveBuffer, data]);\n\n // Pop all messages until the buffer is exhausted\n while(null !== _receiveBuffer && _receiveBuffer.length > 3) {\n var size = _receiveBuffer.readInt32BE(0);\n\n // Early exit processing if we don't have enough data yet\n if((size + 4) > _receiveBuffer.length) {\n break;\n }\n\n // Pull out the message\n var json = _receiveBuffer.toString('utf8', 4, (size + 4));\n\n // Resize the receive buffer\n _receiveBuffer = ((size + 4) === _receiveBuffer.length) ? null : _receiveBuffer.slice((size + 4));\n\n // Parse the message as a JSON object\n try {\n var msgObj = JSON.parse(json);\n\n // emit the generic message received event\n _self.emit('message', msgObj);\n\n // emit an object-type specific event\n if((typeof msgObj.messageName) === 'undefined') {\n _self.emit('unknown', msgObj);\n } else {\n _self.emit(msgObj.messageName, msgObj);\n }\n }\n catch(ex) {\n _self.emit('exception', ex);\n }\n }\n }", "function onData(data) {\n console.log(\"meteor onData: \" + data);\n // let dataArr = data.split(\",\");\n // console.log(dataArr);\n if (data >= 380) {\n console.log('number of #metoo: ' + count);\n console.log('arduino:' + data);\n //console.log('led');\n writeSerialData(count + '|');\n } else {\n console.log('stop');\n console.log('arduino:' + data);\n}\n}", "function processedGFData() {\n\t\tthis.moteid = idMote;\n\t\tthis.sensorType = sensorType;\n\t\tthis.lastTimestamp = lastTimeStamp;\n\t\tthis.lastValue = lastValue;\n\t\tthis.arrayValuesDay = valuesDay;\n\t\tthis.populationDay = populationDay;\n\t\tthis.arrayValuesWeek = valuesWeek;\n\t\tthis.populationWeek = populationWeek;\n\t\tthis.platform = platform;\n\t\tthis.unit= unit;\n\t}", "pushFromBuffer() {\n let stream = this.stream;\n let chunk = this.buffer.shift();\n // Stream the data\n try {\n this.shouldRead = stream.push(chunk.data);\n }\n catch (err) {\n this.emit(\"error\", err);\n }\n if (this.options.emit) {\n // Also emit specific events, based on the type of chunk\n chunk.file && this.emit(\"file\", chunk.data);\n chunk.symlink && this.emit(\"symlink\", chunk.data);\n chunk.directory && this.emit(\"directory\", chunk.data);\n }\n }", "dataMessage () {\n if (this._fin) {\n const messageLength = this._messageLength;\n const fragments = this._fragments;\n\n this._totalPayloadLength = 0;\n this._messageLength = 0;\n this._fragmented = 0;\n this._fragments = [];\n\n if (this._opcode === 2) {\n var data;\n\n if (this._binaryType === 'nodebuffer') {\n data = toBuffer(fragments, messageLength);\n } else if (this._binaryType === 'arraybuffer') {\n data = toArrayBuffer(toBuffer(fragments, messageLength));\n } else {\n data = fragments;\n }\n\n this.onmessage(data);\n } else {\n const buf = toBuffer(fragments, messageLength);\n\n if (!validation.isValidUTF8(buf)) {\n this.error(\n new Error('Invalid WebSocket frame: invalid UTF-8 sequence'),\n 1007\n );\n return;\n }\n\n this.onmessage(buf.toString());\n }\n }\n\n this._state = GET_INFO;\n }", "onPortMessage(msg) {\n var t = this;\n if (msg.startsWith(\"R \")) { // Received data\n if (msg.startsWith(\"R P\")) { // Partial\n t.frameReadBuffer += msg.substring(3);\n console.log(\"LoFi Rx partial\");\n } else {\n var fullRx = (t.frameReadBuffer + msg.substring(3));\n fullRx = t.phyUnescape(fullRx);\n if(false && fullRx.startsWith(\"10-4 XXX\"))\n t.testResp(fullRx); // TODO XXX\n else\n t.readQueue.unshift(fullRx);\n console.log(\"LoFi Rx: \" + fullRx);\n if(t.rxCallback)\n t.rxCallback();\n t.frameReadBuffer = \"\";\n }\n t.lastCmdSendMs = null;\n }\n else if (msg.startsWith(\"TS \")) {\n t.lastCmdSendMs = null;\n t.lastTxSuccess = true;\n // console.log(\"LoFi Tx was successfull\");\n }\n else if (msg.startsWith(\"TEF \")) {\n t.lastCmdSendMs = null;\n // console.log(\"LoFi Tx failed - channel full\")\n }\n else if (msg.startsWith(\"TE \")) {\n t.lastCmdSendMs = null;\n console.error(\"LoFi tx failed - UNKNOWN ERROR\");\n console.warn(\"Full error: \" + msg);\n } else {\n console.log(\"BT> \" + msg);\n }\n }", "function DataEmitter() {\n}", "function processDataChunk(data) {\n var lines = data.split('\\n');\n lines.sort(compareEventIds).forEach(function(message) {\n var parts = message.split('|');\n\n // switch on type\n switch(parts[1]) {\n case \"F\":\n // add 'from' client to 'to' client list\n Clients.addFollower(parts[3], parts[2], message);\n break;\n case \"U\": \n // no notification\n // remove 'from' client from 'to' client list\n Clients.removeFollower(parts[3], parts[2])\n break;\n case \"B\":\n Clients.broadcast(message);\n break;\n case \"P\":\n Clients.privateMessage(parts[3], message);\n break;\n case \"S\":\n // notify followers of 'from' client\n Clients.notifyStatus(parts[2], message);\n break;\n default: \n break;\n }\n\n });\n }", "function onPeek(e){\n //check for number of samples taken\n if (counter<noOfTakenSamples){\n if (inNoiseMon === true){\n console.log('Taking Sample'); \n xAxisArray.push(e.accel.x);\n yAxisArray.push(e.accel.y);\n zAxisArray.push(e.accel.z);\n console.log('SampleTaken');\n var deadlock = false;\n if (deadlock === false){\n deadlock = true;\n counter++;\n console.log(counter);\n insertCounterElements(); \n deadlock = false;\n }\n else{\n } \n }\n else{\n console.log(\"Stopped Reading\");\n CountScreen.hide();\n Accel.config({\n subscribe: false\n }); \n }\n }\n else{\n //stop events\n Accel.config({\n subscribe: false\n }); \n xAxisArray.sort();\n yAxisArray.sort();\n zAxisArray.sort(); \n insertEndScreenElements();\n //Return to Screen \n } \n \n}", "mrdataavailable (e) {\n\t\t\tthis.send_datavailable ();\n\t\t\tthis.statuslog(\"Handling on data available\");\n\t\t\tif (e.data.size > 0) {\n\t\t\t\tthis.recordedChunks.push(e.data);\n\t\t\t\tthis.statuslog(e.data);\n\t\t\t}\n\n\t\t\tif (this.shouldStop === true && this.stopped === false) {\n\t\t\t\tthis.mediaRecorder.stop();\n\t\t\t\tthis.stopped = true;\n\t\t\t\tthis.statuslog (\"clicked... and ... stopped\");\n\t\t\t}\n\t\t}", "processBuffer () {\n this.ready = true\n this._triggerBuffer()\n this.queue.waterfall(() => this.buffer.guardian)\n }", "function onData(d){\n var frame,\n generatedData,\n response;\n\n frame = TBus.parse(d);\n\n if(!frame.valid){\n console.log(\"Invalid frame received.\");\n return;\n }\n\n if(!Devices[frame.receiver[0]]){\n console.log(\"Device is not supported.\");\n }\n\n generatedData = Devices[frame.receiver[0]].randomData();\n response = TBus.prepareCommand(frame.sender, frame.receiver, generatedData);\n\n setTimeout(function(){\n /*\n var one,\n two;\n\n one = new Buffer(response.slice(0,5));\n two = new Buffer(response.slice(5,response.length));\n serialPort.write(one);\n setTimeout(function(){\n serialPort.write(two);\n },110);\n */\n serialPort.write(response);\n },0);\n}", "_transform(chunk, encoding, callback) {\n this.requestBuffer += chunk.toString();\n const headersEndFlag = '\\r\\n\\r\\n';\n\n let foundIndex;\n\n while((foundIndex = this.requestBuffer.indexOf(headersEndFlag)) !== -1) {\n const requestString = this.requestBuffer.slice(0, foundIndex + headersEndFlag.length);\n this.requestBuffer = this.requestBuffer.slice(foundIndex + headersEndFlag.length);\n this.requestHandler(requestString, this);\n }\n\n callback();\n }", "_transform(chunk, encoding, cb) {\n if (!this.started) {\n this.started = true;\n chunk = Buffer.concat([Buffer.from(this.prelude), chunk]);\n }\n cb(null, chunk);\n }", "function processedSFData() {\n\t\tthis.moteid = idMote;\n\t\tthis.sensorType = sensorType;\n\t\tthis.lastTimestamp = lastTimeStamp;\n\t\tthis.lastValue = lastValue;\n\t\tthis.arrayValuesDay = valuesDay;\n\t\tthis.populationDay = populationDay;\n\t\tthis.arrayValuesWeek = valuesWeek;\n\t\tthis.populationWeek = populationWeek;\n\t\tthis.platform = platform;\n\t\tthis.unit = unit;\n\t}", "function registerReadCallback(callback){\n\t\t\t\n\t\t\tserialPort.on('data', function(data){\n\t\t\t\n\t\t\t\t// TODO Write a new parser for SerialPort that converts directly to ArrayBuffer.\n\t\t\t\tcallback( UtilsService.str2ab(data) );\n\t\t\t});\n\t\t\t\n\t\t}", "async load() {\r\n\t\twhile (this.data.remainingBytes > 0) {\r\n\t\t\tconst chunkID = this.data.readUInt32LE();\r\n\t\t\tconst chunkSize = this.data.readUInt32LE();\r\n\t\t\tconst nextChunkPos = this.data.offset + chunkSize;\r\n\r\n\t\t\tconst handler = WMOChunkHandlers[chunkID];\r\n\t\t\tif (handler)\r\n\t\t\t\thandler.call(this, this.data, chunkSize);\r\n\t\r\n\t\t\t// Ensure that we start at the next chunk exactly.\r\n\t\t\tthis.data.seek(nextChunkPos);\r\n\t\t}\r\n\r\n\t\t// Drop internal reference to raw data.\r\n\t\tthis.data = undefined;\r\n\t}", "_read(sz){\n // console.log('sz ' + sz);\n // console.log('pushing');\n \n let ret = true;\n while(ret && this.count > 0) {\n\n\n let j = mt.complex(0,1);\n for(let i = 0; i < this.chunk; i++) {\n // console.log('' + this.factor + ' - ' + this.phase);\n let res = mt.exp(mt.multiply(j,this.phase));\n this.phase += this.factor;\n // cdata.push(res);\n\n\n this.float64_view[2*i] = res.re;\n this.float64_view[(2*i)+1] = res.im;\n\n // this.float64_view[2*i] = this.debug_count++;\n // this.float64_view[(2*i)+1] = 0;\n\n // combdata.push(res.re);\n // combdata.push(res.im);\n // data.push(Math.random()*100);\n }\n\n\n // seems like we need to copy the buffer here\n // because the code above uses the same buffer over and over for this class\n // if we allocated a new buffer above we could remove the slice here\n ret = this.push(this.uint8_view.slice(0));\n this.count--;\n\n\n }\n }", "function processDataCallback(data) {\n\t\t\t\n\t\t\tvar event = {};\n\t\t\t\n\t\t\tevent.deviceId = data.deviceId;\n\t\t\tevent.riderId = data.riderInformation.riderId != undefined ? data.riderInformation.riderId : 0;\n\t\t\tevent.distance = data.geographicLocation.distance != undefined ? Math.round(data.geographicLocation.distance) : 0;\n\t\t\tevent.lat = data.geographicLocation.snappedCoordinates.latitude != undefined ? data.geographicLocation.snappedCoordinates.latitude : 0;\n\t\t\tevent.long = data.geographicLocation.snappedCoordinates.longitude != undefined ? data.geographicLocation.snappedCoordinates.longitude : 0;\n\t\t\tevent.acceleration = data.riderStatistics.acceleration != undefined ? parseFloat(data.riderStatistics.acceleration.toFixed(2)) : 0;\n\t\t\tevent.time = data.time != undefined ? data.time : 0;\n\t\t\tevent.altitude = data.gps.altitude != undefined ? data.gps.altitude: 0;\n\t\t\tevent.gradient = data.geographicLocation.gradient != undefined ? data.geographicLocation.gradient: 0;\n\t\t\t\n\t\t\t//Add speed object\n\t\t\tvar speed = data.riderInformation.speedInd ? (data.gps.speedGps != undefined ? data.gps.speedGps : 0) : 0 ;\n\t\t\tevent.speed = {\n\t\t\t\t\t\"current\" : speed,\n\t\t\t\t\t\"avg10km\" : 0.0,\n\t\t\t\t\t\"avg30km\" : 0.0\n\t\t\t}\n\t\t\t\n\t\t\t//Add power object\n\t\t\tvar power = data.riderInformation.powerInd ? (data.sensorInformation.power != undefined ? data.sensorInformation.power : 0) : 0;\n\t\t\tevent.power = {\n\t\t\t\t\t\"current\" : getFeedValue(\"power\", power),\n\t\t\t\t\t\"avg10km\" : 0,\n\t\t\t\t\t\"avg30km\" : 0\n\t\t\t}\n\t\t\t\n\t\t\tevent.heartRate = data.riderInformation.HRInd ? (data.sensorInformation.heartRate != undefined ? getFeedValue(\"HR\", data.sensorInformation.heartRate) : 0) : 0;\n\t\t\tevent.cadence = data.riderInformation.cadenceInd ? (data.sensorInformation.cadence != undefined ? data.sensorInformation.cadence : 0) : 0;\n\t\t\tevent.bibNumber = data.riderInformation.bibNumber != undefined ? data.riderInformation.bibNumber: 0;\n\t\t\tevent.teamId = data.riderInformation.teamId != undefined ? data.riderInformation.teamId: 0;\n\t\t\t\n\t\t\tvar eventStageId = data.riderInformation.eventId + \"-\" + data.riderInformation.stageId;\t\t\n\t\t\tdataCallback(event, eventStageId + \"-rider\");\n\t\t}", "_write(chunk,encoding,cb){\n // let tag = Math.floor(Math.random() * 100);\n\n\n // let uint8 = binary.readUInt8(chunk, 0);\n\n // console.log()\n // console.log('t chunk ' + kindOf(chunk));\n // console.log('t2 ' + kindOf(uint8));\n\n // Uint32Array\n\n // console.log('' + this.id + ' got '+ chunk.length);\n\n // console.log(r[this.id].tx.state.theirs.writeCount);\n\n\n // sadly this does a buffer copy accorind to \n // https://nodejs.org/docs/latest/api/buffer.html#buffer_buffers_and_typedarray\n let uint8_view = new Uint8Array(chunk, 0, chunk.length);\n\n // let uint32_view = new Uint32Array(uint8_view);\n\n var dataView = new DataView(uint8_view.buffer);\n\n // console.log(uint8_view);\n // console.log(uint32_view);\n\n let writeAt = getWriteIndexFor(this.id);\n\n // console.log('' + this.id + ' writing to: ' + writeAt);\n\n for(let i = 0; i < chunk.length/8; i+=2) {\n // console.log(dataView.getFloat64(i*8, true));\n\n let cplx = mt.complex(\n dataView.getFloat64(i*8, true),\n dataView.getFloat64((i*8)+8, true) );\n\n datas[this.id][writeAt] = cplx;\n\n writeAt++;\n\n // console.log(cplx.toString());\n\n }\n\n r[this.id].tx.state.theirs.writeCount += chunk.length;\n\n // console.log(\"r\" + this.id + \" \" + r[this.id].tx.state.theirs.writeCount);\n\n // console.log('entered _write ' + tag + ' -> ' + JSON.stringify(chunk));\n // console.log('writableLength ' + this.writableLength);\n\n // we pass the cb function to this so that we can call all the cb()'s together once the received data\n // has been calculated. this form of pushback will guarentee that the write streams don't get too far ahead of\n // the read streams\n writeCompleted(this.id, cb);\n\n }", "_write(chunk,encoding,cb) {\n\n if(this.print) {\n console.log(\"len: \" + chunk.length + ' [' + JSON.parse(JSON.stringify(chunk)).data + ']' );\n }\n\n // console.log()\n // console.log('t chunk ' + kindOf(chunk));\n // console.log('t2 ' + kindOf(uint8));\n\n // Uint32Array\n // console.log('got '+ chunk.length);\n\n\n // sadly this does a buffer copy accorind to \n // https://nodejs.org/docs/latest/api/buffer.html#buffer_buffers_and_typedarray\n const uint8_view = new Uint8Array(chunk, 0, chunk.length);\n var dataView = new DataView(uint8_view.buffer);\n\n // console.log(uint8_view);\n // console.log(uint32_view);\n\n if( !this.disable ) {\n for(let i = 0; i < chunk.length/8; i++) {\n this.capture.push(dataView.getFloat64(i*8, true));\n }\n }\n\n cb();\n }", "_onRead(data) {\n\t this.valueBytes.write(data);\n\t }", "_readWebSocketData(buf) {\n this._streamWebSocketBuffer += buf;\n // The new buffer might contain a complete packet, try to read to find out...\n this._readWebSocketPacket();\n }", "function sendData(data) {\n /*\n if(this.port != null && this.parser != null){\n\n if(bufferData){\n port.write(Buffer.from(data.mx));\n console.log(data.mx);\n }else{\n port.write(data.mx);\n console.log(data.mx);\n }\n }\n */\n //port.write(\"X\" + toString(data.mx) \"Y\" + toString(data.my));\n port.write(\"X\" + data.mx.toString());\n //setInterval(port.write(\"X\" + data.mx.toString()), 1000);\n //console.log(data.mx.toString());\n\n}", "onData(data) {\n const callback = packet => {\n // if its the first message we consider the transport open\n if (\"opening\" === this.readyState && packet.type === \"open\") {\n this.onOpen();\n }\n // if its a close packet, we close the ongoing requests\n if (\"close\" === packet.type) {\n this.onClose({ description: \"transport closed by the server\" });\n return false;\n }\n // otherwise bypass onData and handle the message\n this.onPacket(packet);\n };\n // decode payload\n decodePayload(data, this.socket.binaryType).forEach(callback);\n // if an event did not trigger closing\n if (\"closed\" !== this.readyState) {\n // if we got data we're not polling\n this.polling = false;\n this.emitReserved(\"pollComplete\");\n if (\"open\" === this.readyState) {\n this.poll();\n }\n }\n }", "onDataReady() {\n switch (this.state) {\n case RPCServerState.InitHeader: {\n this.handleInitHeader();\n break;\n }\n case RPCServerState.InitHeaderKey: {\n this.handleInitHeaderKey();\n break;\n }\n case RPCServerState.ReceivePacketHeader: {\n this.currPacketHeader = this.readFromBuffer(8 /* I64 */);\n const reader = new ByteStreamReader(this.currPacketHeader);\n this.currPacketLength = reader.readU64();\n support_1.assert(this.pendingBytes == 0);\n this.requestBytes(this.currPacketLength);\n this.state = RPCServerState.ReceivePacketBody;\n break;\n }\n case RPCServerState.ReceivePacketBody: {\n const body = this.readFromBuffer(this.currPacketLength);\n support_1.assert(this.pendingBytes == 0);\n support_1.assert(this.currPacketHeader !== undefined);\n this.onPacketReady(this.currPacketHeader, body);\n break;\n }\n case RPCServerState.WaitForCallback: {\n support_1.assert(this.pendingBytes == 0);\n break;\n }\n default: {\n throw new Error(\"Cannot handle state \" + this.state);\n }\n }\n }", "start() {\n const that = this;\n this.transport.socket.on('data', (data) => {\n that.bufferQueue = Buffer.concat([that.bufferQueue, Buffer.from(data)]);\n if (that.bufferQueue.length > RTConst.PROTOCOL_HEADER_LEN) { // parse head length\n const packetLen = that.bufferQueue.readUInt32BE(0);\n const totalLen = packetLen + RTConst.PROTOCOL_HEADER_LEN;\n if (that.bufferQueue.length >= totalLen) {\n // it is a full packet, this packet can be parsed as message\n const messageBuffer = Buffer.alloc(packetLen);\n that.bufferQueue.copy(messageBuffer, 0, RTConst.PROTOCOL_HEADER_LEN, totalLen);\n that.incomeMessage(RTRemoteSerializer.fromBuffer(messageBuffer));\n that.bufferQueue = that.bufferQueue.slice(totalLen); // remove parsed message\n }\n }\n });\n }", "readChunk(chunk) {\n // reder FLV header\n this._chunk = mergeBuffer(this._chunk, chunk);\n\n chunk = null;\n\n let tmpData, ab, view;\n\n this._bufferLen = this._chunk.byteLength;\n this._readLen = 0;\n\n\n while (this._bufferLen - this._readLen > 11) {\n\n\n ab = new Uint8Array(this._chunk);\n\n\n // reader FLV File Header\n if (ab[0] === 0x46 && ab[1] === 0x4C && ab[2] === 0x56) {\n\n // reader FLV header\n tmpData = this._flvHeader(this._chunk.slice(0, 9));\n\n this._ISArray.push({\n buffer: tmpData.buffer,\n info: {\n type: tmpData.type,\n desc: tmpData.desc,\n version: tmpData.version,\n tagOffset: tmpData.tagOffset,\n hasAudio: tmpData.hasAudio,\n hasVideo: tmpData.hasVideo,\n }\n })\n\n\n this._readLen += 9;\n this._chunk = this._chunk.slice(9);\n\n\n continue;\n }\n\n\n // reader DataSize\n view = new DataView(this._chunk);\n\n // get the previous tag size\n // let prvDataSize = view.getUint32(0);\n\n this._readLen += 4; // add the 'previousTag' size\n\n if (this._bufferLen < 11 + this._readLen) {\n // confirm the dataSize is valid\n break;\n }\n let dataSize = view.getUint32(4) & 16777215;\n\n if (this._bufferLen - this._readLen < 11 + dataSize) {\n // when the remained data is not a complete tag, return;\n break;\n }\n\n // decode Flv tag\n tmpData = this._flvTag(this._chunk.slice(4));\n\n if (tmpData.desc === 'header') {\n // save the IS info\n this._ISArray.push({\n buffer: tmpData.buffer,\n info: {\n type: tmpData.type,\n desc: tmpData.desc,\n dataOffset: tmpData.dataOffset,\n dataSize: tmpData.dataSize,\n timeStamp: tmpData.timeStamp,\n tagLen: tmpData.tagLen\n }\n });\n\n } else {\n // save MS info\n this._MSArray.push({\n buffer: tmpData.buffer,\n info: {\n type: tmpData.type,\n desc: tmpData.desc,\n dataOffset: tmpData.dataOffset,\n dataSize: tmpData.dataSize,\n timeStamp: tmpData.timeStamp,\n tagLen: tmpData.tagLen\n }\n });\n }\n\n this._chunk = this._chunk.slice(tmpData.tagLen + 4); // prvTag size\n this._readLen += tmpData.tagLen;\n\n }\n\n /**\n * the type contain IS/MS:\n * IS: initial Segment\n * MS: media Segment\n * the server maybe return duplicated IS, like Header: scirpt + video + audio + video +....\n */\n if (this._ISArray.length >= this._ISLength) {\n console.warn('get IS info !!!!!!!!!!');\n this._emitter.emit(CHUNKEDSTREAM, this._ISArray, 'IS');\n\n this._ISArray = [];\n }\n\n // detect the arr is empty, then don't return\n if (this._MSArray.length) {\n\n this._emitter.emit(CHUNKEDSTREAM, this._MSArray, 'MS');\n\n this._MSArray = [];\n }\n\n\n\n }", "transform(chunk, encoding, callback) {\n compressChunk(compressor, encoding, chunk)\n .then(data => callback(null, data))\n .catch(callback);\n }", "function processData() {\n try {\n socket.send(JSON.stringify(lastData));\n \n if (!freeze) showData(lastData);\n } catch (err) {\n logError(err);\n }\n \n // Request function to run again when browser has a moment\n window.requestAnimationFrame(processData);\n}", "chunkComplete() {\n this.isChunkComplete = true;\n }", "chunkComplete() {\n this.isChunkComplete = true;\n }", "function onDownloadedChunk() {\n if (playback.downloadedAudio.value && playback.downloadedVideo.value) {\n playback.downloadedAudio.removeListener(onDownloadedChunk);\n playback.downloadedVideo.removeListener(onDownloadedChunk);\n _dlprestart();\n }\n }", "_read(size) {\n /*\n console.log(`read called with size ${size}`);\n for (let i = 0; i < this.streams.length; i++) {\n const currentStream = this.streams[i];\n let chunk = currentStream.read();\n if (Buffer.isBuffer(chunk)) {\n chunk = chunk.toString();\n console.log(`chunk for stream ${i}: ${chunk}`);\n }\n }\n */\n /*\n //this[kSource].fetchSomeData(size, (data, encoding) => {\n this.push(Buffer.from(data, encoding));\n console.log(`reading buffer: ${Buffer.from(data, encoding)}`);\n });\n */\n }", "_sendData() {\n\n }", "onCandleDataEvent(fn) {\n\n this.eventEmitter.on(settings.socket.candleDataEvent, (data) => {\n\n fn(data);\n\n });\n }", "function processData(buffer) {\n console.log(\"Status: \"+status);\n console.log('Read message: \"' + buffer + '\"');\n if (buffer.toString() == 'Ok!' && status == 0 && type !=1) {\n //Emepzamos el envio\n rqMsg = '';\n\n while ((pxInd < w * h) && (rqMsg.length < 256 - 12)) { //Bytes disponibles\n rqMsg += data[hexInd];\n pxInd += 4;\n hexInd++;\n }\n\n if (pxInd >= w * h) status++; \n\n const arr = new Uint16Array(2);\n\n buffIndCalc = (rqMsg.length + 12) / 2;\n const buffInd = Buffer.alloc(2);\n buffInd.writeUInt16LE(buffIndCalc);\n\n dSizeCalc += buffIndCalc;\n\n const dSize = Buffer.alloc(3);\n dSize.writeUInt16LE(dSizeCalc, 0, 3)\n\n\n var bufferToSend = Buffer.concat([Buffer.from('L', 'ascii'), buffInd, dSize, Buffer.from(rqMsg, 'hex')]);\n console.log(\"Buffer to send1: \" + bufferToSend.toString('hex'));\n\n\n epdCharacteristic.write(bufferToSend, function(err, bytesWritten) {\n if (err) console.log(err);\n console.log(\"wrote: L\");\n });\n } else if (buffer.toString() == 'Ok!' && status == 0 && type == 1) {\n //Emepzamos el envio pantalla a color\n rqMsg = '';\n\n while ((pxInd < w * h) && (rqMsg.length < 256 - 12)) { //Bytes disponibles\n rqMsg += data[hexInd];\n pxInd += 2; //cada pixel son 2 bits, por eso para cada hex tenemos avanzar 2 pixeles.\n hexInd++;\n }\n if (pxInd >= w * h) status++;\n\n const arr = new Uint16Array(2);\n\n buffIndCalc = (rqMsg.length + 12) / 2;\n const buffInd = Buffer.alloc(2);\n buffInd.writeUInt16LE(buffIndCalc);\n\n dSizeCalc += buffIndCalc;\n\n const dSize = Buffer.alloc(3);\n dSize.writeUInt16LE(dSizeCalc, 0, 3);\n\n\n var bufferToSend = Buffer.concat([Buffer.from('L', 'ascii'), buffInd, dSize, Buffer.from(rqMsg, 'hex')]);\n console.log(\"Buffer to send info: dSizeCalc\"+dSizeCalc+\" buffIndCalc: \"+buffIndCalc+\" pxInd: \"+pxInd);\n console.log(\"Buffer to send2: \" + bufferToSend.toString('hex'));\n\n\n epdCharacteristic.write(bufferToSend, function(err, bytesWritten) {\n if (err) console.log(err);\n console.log(\"wrote: L\");\n });\n } else if (buffer.toString() == 'Ok!' && status == 1 && type != 1) {\n //Hacemos el Show\n epdCharacteristic.write(Buffer.from('S', 'ascii'), function(err, bytesWritten) {\n if (err) console.log(err);\n console.log(\"wrote: S\");\n });\n status = 4;\n console.log(\"Desconectamos....\");\n clearTimeout(timeout);\n screenDisconect(false);\n return response.send({\n message: 'Success at updating the device: ' + macaddress,\n });\n } else if (buffer.toString() == 'Ok!' && status == 1 && type == 1) {\n //Hacemos el Next\n\n pxInd =0;\n hexInd = 0;\n\n epdCharacteristic.write(Buffer.from('N', 'ascii'), function(err, bytesWritten) {\n if (err) console.log(err);\n console.log(\"wrote: N\"); \n });\n status = 2;\n } else if (buffer.toString() == 'Ok!' && status == 2 && type == 1) {\n //Hacemos el Load del Next\n //let dataNext = req.body.dataNext;\n //Emepzamos el envio\n rqMsg = '';\n\n while ((pxInd < w * h) && (rqMsg.length < 256 - 12)) { //Bytes disponibles\n rqMsg += dataNext[hexInd];\n pxInd += 4; //en caso de rojo, cada pixel es un bit.\n hexInd++;\n }\n if (pxInd >= w * h) status = 3;\n\n const arr = new Uint16Array(2);\n\n buffIndCalc = (rqMsg.length + 12) / 2;\n const buffInd = Buffer.alloc(2);\n buffInd.writeUInt16LE(buffIndCalc);\n\n dSizeCalc += buffIndCalc;\n\n const dSize = Buffer.alloc(3);\n dSize.writeUInt16LE(dSizeCalc, 0, 3)\n\n\n var bufferToSend = Buffer.concat([Buffer.from('L', 'ascii'), buffInd, dSize, Buffer.from(rqMsg, 'hex')]);\n console.log(\"N_Buffer to send3: \" + bufferToSend.toString('hex'));\n\n\n epdCharacteristic.write(bufferToSend, function(err, bytesWritten) {\n if (err) console.log(err);\n console.log(\"wrote: L\");\n });\n } else if (buffer.toString() == 'Ok!' && status == 3 && type == 1) {\n console.log(\"Finalizamos...\");\n //Hacemos el Show\n epdCharacteristic.write(Buffer.from('S', 'ascii'), function(err, bytesWritten) {\n if (err) console.log(err);\n console.log(\"wrote: S\");\n });\n status = 4;\n console.log(\"Desconectamos....\");\n clearTimeout(timeout);\n screenDisconect(false);\n return response.send({\n message: 'Success at updating the device: ' + macaddress,\n });\n }\n trytoread();\n }", "preIngestData() {}", "_flush( streamCallback )\n {\n // anything remaining in line buffer?\n if ( this.lineBuffer != '' )\n {\n // pass remaining buffer contents as single line\n const lines = [ this.lineBuffer ]\n\n // process and push data\n this.handleLines( streamCallback, this.transformCallback, [ this.lineBuffer ], '' )\n }\n else\n {\n // otherwise run callback immediately\n streamCallback( null )\n }\n }", "function CameraCommand_Playback_ProcessData()\n{\n\t//assume all data ok, set state for action\n\tthis.State = __CAMERA_CMD_STATE_ACTION;\n\t//loop through all of our userdatas\n\tfor (var i = 0, c = this.Camera.CameraData.Action.UserDatas.length; i < c; i++)\n\t{\n\t\t//already tried this one?\n\t\tif (this.DataTestsAttempted[i])\n\t\t{\n\t\t\t//only one try\n\t\t\tcontinue\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//mark it as done\n\t\t\tthis.DataTestsAttempted[i] = true;\n\t\t}\n\n\t\t//get the userdata\n\t\tvar userData = this.Camera.CameraData.Action.UserDatas[i];\n\t\t//get its object\n\t\tvar intObject = __SIMULATOR.Interpreter.LoadedObjects[userData.InterpreterObjectId];\n\t\t//valid object?\n\t\tif (intObject)\n\t\t{\n\t\t\t//and its data\n\t\t\tvar objectData = null;\n\t\t\t//check object\n\t\t\tswitch (intObject.DataObject.Class)\n\t\t\t{\n\t\t\t\tcase __NEMESIS_CLASS_TREE_GRID:\n\t\t\t\t\t//valid data?\n\t\t\t\t\tif (!String_IsNullOrWhiteSpace(userData.ExtraData))\n\t\t\t\t\t{\n\t\t\t\t\t\t//use this to retrieve the cell object\n\t\t\t\t\t\tvar cellObject = TreeGrid_GetInterpreterTarget(intObject.HTML, [__TREEGRID_PLACEHOLDER, userData.ExtraData]);\n\t\t\t\t\t\tif (cellObject)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//get its data\n\t\t\t\t\t\t\tobjectData = cellObject.GetData();\n\t\t\t\t\t\t\t//break away\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//if we havent managed to get cell data, just do the default processing\n\t\t\t\t\tobjectData = intObject.GetData();\n\t\t\t\t\tbreak;\n\t\t\t\tcase __NEMESIS_CLASS_ULTRAGRID:\n\t\t\t\t\t//valid data?\n\t\t\t\t\tif (!String_IsNullOrWhiteSpace(userData.ExtraData))\n\t\t\t\t\t{\n\t\t\t\t\t\t//use this to retrieve the cell object\n\t\t\t\t\t\tvar cells = UltraGrid_GetCellsFromSetIds(intObject, userData.ExtraData);\n\t\t\t\t\t\t//found at least 1?\n\t\t\t\t\t\tif (cells.length > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//get the object data\n\t\t\t\t\t\t\tobjectData = cells[0].GetData();\n\t\t\t\t\t\t\t//break out\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//if we havent managed to get cell data, just do the default processing\n\t\t\t\t\tobjectData = intObject.GetData();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tobjectData = intObject.GetData();\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t//valid?\n\t\t\tif (!Event_ValidateUserData(userData, objectData))\n\t\t\t{\n\t\t\t\t//check again class\n\t\t\t\tswitch (intObject.DataObject.Class)\n\t\t\t\t{\n\t\t\t\t\tcase __NEMESIS_CLASS_TREE_GRID:\n\t\t\t\t\t\t//valid data?\n\t\t\t\t\t\tif (!String_IsNullOrWhiteSpace(userData.ExtraData))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//create data\n\t\t\t\t\t\t\tvar data = [__TREEGRID_PLACEHOLDER, userData.ExtraData];\n\t\t\t\t\t\t\t//ask for item\n\t\t\t\t\t\t\tvar result = intObject.GetHTMLTarget(__NEMESIS_EVENT_NOTHANDLED, data);\n\t\t\t\t\t\t\t//not valid?\n\t\t\t\t\t\t\tif (result == null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//create an action on it so that we open it to the end\n\t\t\t\t\t\t\t\tvar newAction = new CameraCommand_Action(this.Camera, intObject, __NEMESIS_EVENT_NOTHANDLED, data, null);\n\t\t\t\t\t\t\t\t//dont show the message, trigger lasers or overlays or trigger final message\n\t\t\t\t\t\t\t\tnewAction.bDisplayMessage = false;\n\t\t\t\t\t\t\t\tnewAction.bTriggerLaser = false;\n\t\t\t\t\t\t\t\tnewAction.bTriggerOverlay = false;\n\t\t\t\t\t\t\t\tnewAction.bTriggerFinalAction = false;\n\t\t\t\t\t\t\t\tnewAction.bScrollOnly = true;\n\t\t\t\t\t\t\t\t//add it to the command queue\n\t\t\t\t\t\t\t\tthis.Camera.Commands.push(newAction);\n\t\t\t\t\t\t\t\t//reset state to Data\n\t\t\t\t\t\t\t\tthis.State = __CAMERA_CMD_STATE_DATA;\n\t\t\t\t\t\t\t\t//we will retry this\n\t\t\t\t\t\t\t\tthis.DataTestsAttempted[i] = false;\n\t\t\t\t\t\t\t\t//come back later\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//action is on a cell?\n\t\t\t\t\t\t\telse if (result.InterpreterObject)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//modify the item\n\t\t\t\t\t\t\t\tintObject = result.InterpreterObject;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase __NEMESIS_CLASS_ULTRAGRID:\n\t\t\t\t\t\t//valid data?\n\t\t\t\t\t\tif (!String_IsNullOrWhiteSpace(userData.ExtraData))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//create data\n\t\t\t\t\t\t\tvar data = [userData.ExtraData, \"\"];\n\t\t\t\t\t\t\t//ask for item\n\t\t\t\t\t\t\tvar result = intObject.GetHTMLTarget(__NEMESIS_EVENT_NOTHANDLED, data);\n\t\t\t\t\t\t\t//not valid?\n\t\t\t\t\t\t\tif (result == null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//create an action on it so that we open it to the end\n\t\t\t\t\t\t\t\tvar newAction = new CameraCommand_Action(this.Camera, intObject, __NEMESIS_EVENT_NOTHANDLED, data, null);\n\t\t\t\t\t\t\t\t//dont show the message, trigger lasers or overlays or trigger final message\n\t\t\t\t\t\t\t\tnewAction.bDisplayMessage = false;\n\t\t\t\t\t\t\t\tnewAction.bTriggerLaser = false;\n\t\t\t\t\t\t\t\tnewAction.bTriggerOverlay = false;\n\t\t\t\t\t\t\t\tnewAction.bTriggerFinalAction = false;\n\t\t\t\t\t\t\t\tnewAction.bScrollOnly = true;\n\t\t\t\t\t\t\t\t//add it to the command queue\n\t\t\t\t\t\t\t\tthis.Camera.Commands.push(newAction);\n\t\t\t\t\t\t\t\t//reset state to Data\n\t\t\t\t\t\t\t\tthis.State = __CAMERA_CMD_STATE_DATA;\n\t\t\t\t\t\t\t\t//we will retry this\n\t\t\t\t\t\t\t\tthis.DataTestsAttempted[i] = false;\n\t\t\t\t\t\t\t\t//come back later\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//action is on a cell?\n\t\t\t\t\t\t\telse if (result.InterpreterObject.UltraGridCell || result.InterpreterObject.UltraGridHeader)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//modify the item\n\t\t\t\t\t\t\t\tintObject = result.InterpreterObject;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t//get the expected rule\n\t\t\t\tvar expectedRule = Event_GetUserDataExpectedRule(userData);\n\t\t\t\t//notify that the camera is going to playback a data check\n\t\t\t\t__SIMULATOR.NotifyLogEvent({ Type: __LOG_CAMERA_PLAY_USERDATA, UserData: userData, Rule: expectedRule });\n\t\t\t\t//reset the camera\n\t\t\t\tthis.Camera.DeactivateMiniActions();\n\t\t\t\t//ensure object is visible\n\t\t\t\tthis.Camera.ActivateMiniActions(intObject);\n\t\t\t\t//create a new action command and add it to the command queue\n\t\t\t\tthis.Camera.Commands.push(new CameraCommand_Action(this.Camera, intObject, __NEMESIS_EVENT_NOTHANDLED, expectedRule.Data, this.Camera.CameraData.State.Tut ? this.Camera.CameraData.State.GetMessage(expectedRule.MessageId) : null));\n\t\t\t\t//reset state to Data\n\t\t\t\tthis.State = __CAMERA_CMD_STATE_DATA;\n\t\t\t\t//end loop\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}", "function readSensorData() {\n \t bme280.readSensorData()\n .then((data) => {\n // temperature_C, pressure_hPa, and humidity are returned by default.\n temperature = data.temperature_C + 273.15;\n pressure = data.pressure_hPa * 100;\n humidity = data.humidity / 100;\n dewPoint = calculateDewpoint(data.temperature_C, humidity);\n\n //console.log(`data = ${JSON.stringify(data, null, 2)}`);\n\n // create message\n var delta = createDeltaMessage(temperature, humidity, pressure, dewPoint)\n\n // send temperature\n app.handleMessage(plugin.id, delta)\n\n })\n .catch((err) => {\n console.log(`BME280 read error: ${err}`);\n });\n }", "function serialEvent() {\n inData = serial.readLine();\n let splitData = split(inData, '|');\n if (splitData.length === 7) {\n b1 = int(trim(splitData[0]));\n b2 = int(trim(splitData[1]));\n slider = int(trim(splitData[2]));\n shaked = int(trim(splitData[3]));\n light = int(trim(splitData[4]));\n sound = int(trim(splitData[5]));\n temp = int(trim(splitData[6]));\n newValue = true;\n } else {\n newValue = false;\n }\n}", "_onMetaData (chunk) {\n this.emit('metadata', _parseMetadata(chunk));\n this._passthrough(this._icyMetaInt, this._onMetaSectionStart);\n }", "function load_cb(data_id, success) {\n\n if (!success) {\n console.log(\"b4w load failure\");\n return;\n }\n m_dummy_presents.init();\n m_dummy_bat.init();\n window.move_dummy = function(obj_name, obj_translation) {\n if(m_scs.check_object_by_name(obj_name)) {\n var obj = m_scs.get_object_by_name(obj_name);\n m_trans.set_translation_v(obj, obj_translation);\n }\n }\n\n\n var elapsed_sensor = m_ctl.create_elapsed_sensor();\n \n m_dummy_presents.setup_presents_generation(elapsed_sensor);\n m_dummy_bat.setup_bats_generation(elapsed_sensor);\n\n\n var object_camera = m_scs.get_active_camera();\n add_dummy_from_object_position(object_camera, \"MainCamera\", elapsed_sensor);\n\n var object_train = m_scs.get_object_by_name(\"character_collider\");\n add_dummy_from_object_position(object_train,\"character_collider\", elapsed_sensor);\n\n var object_land = m_scs.get_object_by_name(\"LandSurfaceOffsetEmpty\");\n add_dummy_from_object_position(object_land, \"LandSurfaceOffsetEmpty\", elapsed_sensor);\n var object_land_animate_y = m_scs.get_object_by_name(\"LandAnimateY\");\n add_dummy_from_object_position(object_land_animate_y, \"LandAnimateY\", elapsed_sensor);\n\n var object_sky = m_scs.get_object_by_name(\"SkyEmpty\");\n add_dummy_from_object_position(object_sky, \"SkyEmpty\", elapsed_sensor);\n\n var object_pointer_1 = m_scs.get_object_by_name(\"ControllerCube1\");\n add_dummy_from_object_position(object_pointer_1, \"ControllerCube1\", elapsed_sensor);\n var object_pointer_2 = m_scs.get_object_by_name(\"ControllerCube2\");\n add_dummy_from_object_position(object_pointer_2, \"ControllerCube2\", elapsed_sensor);\n/*\n */ \n \n\n\n \n\n //add_dummy_from_object_position(\"train_body\", elapsed_sensor);\n //add_dummy_from_object_position(\"MainCameraCube\", elapsed_sensor);\n //add_dummy_from_object_position(\"MainCamera\", elapsed_sensor);\n\n\n}", "whileLoading(data) {\n const position = data.secondsLoaded / data.duration\n this.updateLoadingProgressElement(position)\n if (typeof this.whileLoadingCallback === \"function\") {\n this.whileLoadingCallback(data)\n }\n this.log(\"track:whileLoading\", data)\n }", "async _transform (data,encoding,callback) {\n this.rowCount++;\n\tif (!Array.isArray(data)) {\n\t data = Object.values(data)\n\t}\n this.push({data:data.json})\n callback();\n }", "resolveData() {\n while (this.unresolvedLength >= this.bufferSize) {\n let buffer;\n if (this.incoming.length > 0) {\n buffer = this.incoming.shift();\n this.shiftBufferFromUnresolvedDataArray(buffer);\n }\n else {\n if (this.numBuffers < this.maxBuffers) {\n buffer = this.shiftBufferFromUnresolvedDataArray();\n this.numBuffers++;\n }\n else {\n // No available buffer, wait for buffer returned\n return false;\n }\n }\n this.outgoing.push(buffer);\n this.triggerOutgoingHandlers();\n }\n return true;\n }", "resolveData() {\n while (this.unresolvedLength >= this.bufferSize) {\n let buffer;\n if (this.incoming.length > 0) {\n buffer = this.incoming.shift();\n this.shiftBufferFromUnresolvedDataArray(buffer);\n }\n else {\n if (this.numBuffers < this.maxBuffers) {\n buffer = this.shiftBufferFromUnresolvedDataArray();\n this.numBuffers++;\n }\n else {\n // No available buffer, wait for buffer returned\n return false;\n }\n }\n this.outgoing.push(buffer);\n this.triggerOutgoingHandlers();\n }\n return true;\n }", "parseChunk(chunk) {\n this.write(chunk);\n }", "function gotData(data){\n console.log(\"Recieved from the serial port: \" + data);\n sph = data;\n}", "function onMessageArrived(message) {\r\n\r\n \r\n console.log(\"onMessageArrived: \" + message.payloadString);\r\n\r\n if(message.destinationName == \"IC.embedded/jhat/sensors/readings\"){\r\n var split_data = message.payloadString.split(\",\");\r\n\r\n \r\n var d = new Date();\r\n var h = 0;\r\n var m = 0;\r\n if(d.getHours() < 10){\r\n h = '0'+d.getHours();\r\n }\r\n else{\r\n h = d.getHours();\r\n }\r\n if(d.getMinutes() < 10){\r\n m = '0'+d.getMinutes();\r\n }\r\n else{\r\n m = d.getMinutes();\r\n }\r\n time = h + ':' + m;\r\n time_all = d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds();\r\n addData(LineChart0, time, parseInt(split_data[0]));\r\n addData(LineChart1, time, parseInt(split_data[1]));\r\n addData(LineChart2, time, parseInt(split_data[2]));\r\n addData(LineChart3, time, parseInt(split_data[3]));\r\n \r\n $('.circle .bar').circleProgress('value', parseFloat(split_data[5])/100);\r\n \r\n // document.getElementById(\"messages\").innerHTML += '<span>Topic: ' + message.destinationName + ' | ' + message.payloadString + '</span><br/>';\r\n document.getElementById(\"live-temp\").innerHTML = split_data[0] + '°';\r\n document.getElementById(\"live-hum\").innerHTML = split_data[1] + '%';\r\n document.getElementById(\"live-air\").innerHTML = split_data[3] + ' ppb';\r\n\r\n\r\n \r\n message_board(split_data[4], time, split_data[5])\r\n } \r\n else if(message.destinationName == \"IC.embedded/jhat/sensors/connect_ack\"){\r\n var split_data = message.payloadString.split(\",\");\r\n\r\n for(i=0; i<split_data.length; i=i+7){\r\n time = split_data[i+6]\r\n addData(LineChart0, time, parseInt(split_data[i]));\r\n addData(LineChart1, time, parseInt(split_data[i+1]));\r\n addData(LineChart2, time, parseInt(split_data[i+2]));\r\n addData(LineChart3, time, parseInt(split_data[i+3]));\r\n message_board(split_data[i+4], time, split_data[i+5])\r\n }\r\n\r\n $('.circle .bar').circleProgress('value', parseFloat(split_data[split_data.length-2])/100)\r\n\r\n document.getElementById(\"live-temp\").innerHTML = split_data[split_data.length-7] + '°';\r\n document.getElementById(\"live-hum\").innerHTML = split_data[split_data.length-6] + '%';\r\n document.getElementById(\"live-air\").innerHTML = split_data[split_data.length-4] + ' ppb';\r\n }\r\n}", "emitBuffered() {\n this.receiveBuffer.forEach((args) => this.emitEvent(args));\n this.receiveBuffer = [];\n this.sendBuffer.forEach((packet) => this.packet(packet));\n this.sendBuffer = [];\n }", "receiveFirstPieces(data) {\n\t\tthis.nextPiece = new Piece(data.nextPiece);\n\t\tthis.nextPieceBox.updatePiece(this.nextPiece);\n\t\tthis.piece = new Piece(data.piece);\n\t\tthis.statBox.updateCounts(this.piece.type);\n\t\tthis.stopwatch.start();\n\t}", "handleInboundMessage(syncData) {\n\n let syncEvents = this.networkTransmitter.deserializePayload(syncData).events;\n let syncHeader = syncEvents.find((e) => e.eventName === 'syncHeader');\n\n // emit that a snapshot has been received\n if (!this.gameEngine.highestServerStep || syncHeader.stepCount > this.gameEngine.highestServerStep)\n this.gameEngine.highestServerStep = syncHeader.stepCount;\n this.gameEngine.emit('client__syncReceived', {\n syncEvents: syncEvents,\n stepCount: syncHeader.stepCount,\n fullUpdate: syncHeader.fullUpdate\n });\n\n this.gameEngine.trace.info(() => `========== inbound world update ${syncHeader.stepCount} ==========`);\n\n // finally update the stepCount\n if (syncHeader.stepCount > this.gameEngine.world.stepCount + this.synchronizer.syncStrategy.STEP_DRIFT_THRESHOLDS.clientReset) {\n this.gameEngine.trace.info(() => `========== world step count updated from ${this.gameEngine.world.stepCount} to ${syncHeader.stepCount} ==========`);\n this.gameEngine.emit('client__stepReset', { oldStep: this.gameEngine.world.stepCount, newStep: syncHeader.stepCount });\n this.gameEngine.world.stepCount = syncHeader.stepCount;\n }\n }", "handlePositionChangeEvent(data) {\n console.log('in handlePositionChangeEvent method '+ JSON.stringify(data));\n let dataObj = data.data;\n this.calculateNewCoinDataSet(dataObj.playerType, dataObj.positionFrom,\n dataObj.positionTo, dataObj.coinId);\n this.changePlayerTurnToNextPlayer();\n }", "function callBuf(dataType, callback) {\r\n\tvar div;\r\n\tvar div2;\r\n\t\r\n\tswitch(dataType)\r\n\t{\r\n\tcase 'points':\r\n//\t \tsizeArray = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 200, 300, 400, 500, 600,\r\n//\t \t\t\t\t700, 800, 900, 1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10000,\r\n//\t \t\t\t\t20000, 30000];\r\n\t \tsizeArray = [10, 20, 30, 40, 50];\r\n\t \tdiv = document.getElementById(dataType);\r\n\t\tdiv.innerHTML = 'Processing';\r\n\t break;\r\n\tcase 'lines':\r\n//\t\tsizeArray = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 200, 300, 400, 500, 600,\r\n//\t\t 700, 800, 900, 1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10000,\r\n//\t\t \t\t\t20000, 30000];\r\n\t\tsizeArray = [10, 20, 30, 40, 50];\r\n\t\tdiv = document.getElementById(dataType);\r\n\t\tdiv.innerHTML = 'Processing';\r\n\t break;\r\n\tcase 'polygons':\r\n//\t\tsizeArray = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 200, 300, 400, 500, 600,\r\n//\t\t \t\t\t700, 800, 900, 1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000];\r\n\t\tsizeArray = [10, 20, 30, 40, 50];\r\n\t\tdiv = document.getElementById(dataType);\r\n\t\tdiv.innerHTML = 'Processing';\r\n\tbreak;\r\n\tdefault:\r\n\t console.log(\"switch statement blew up!\");\r\n\t}\r\n\t\r\n\tasync.eachSeries(Object.keys(sizeArray), function(item, done){\r\n\t\tvar geoprocess = \"Buffer\";\r\n\t\tvar id = sizeArray[item];\r\n\t\tdiv2 = document.getElementById(dataType +\"ID\");\r\n\t\tdiv2.innerHTML = id;\r\n\t\tmicroAjax(serverlocation +\"/rest/services/\" + dataType + \"/\" + id, function (data) {\r\n\t\t\tvar dataJSON = JSON.parse(data);\r\n\t\t\tvar dataTime = dataJSON.time;//Time, on server, to retrieve data from db\r\n\t\t\tvar wkt = dataJSON.wkt;\r\n\t\t\tresults = getResults(geoprocess, id, dataType, dataTime, wkt, null);//--> results.js\r\n\t\t\tasync.series([\r\n\t \t\tfunction(returnToProcess){\r\n\t \t\t\tstoreResults(results, returnToProcess);//--> data.js\r\n\t \t\t}\t\r\n\t \t]);\r\n\t\t\tdone();\r\n\t\t});\r\n\t\t\t\r\n\t}, function(err){\r\n\t\tconsole.log(err);\r\n\t\tdiv = document.getElementById(dataType);\r\n\t\tdiv.innerHTML = 'Complete!';\r\n\t\tcallback();\r\n\t});\r\n\r\n}", "function onDataWriteSuccess()\n\t\t{\n\t\t\t// Cyle Finish\n hyper.log(\"Remote Device Pos Written to Scratch\")\n hyper.log('---------------')\n\t\t\tsetTimeout(app.update,500);\n\t\t}", "processData() {\n // If we have enough data to process the next step in the SOCKS handshake, proceed.\n if (this._receiveBuffer.length >= this._nextRequiredPacketBufferSize) {\n // Sent initial handshake, waiting for response.\n if (this.state === constants_1.SocksClientState.SentInitialHandshake) {\n if (this._options.proxy.type === 4) {\n // Socks v4 only has one handshake response.\n this.handleSocks4FinalHandshakeResponse();\n }\n else {\n // Socks v5 has two handshakes, handle initial one here.\n this.handleInitialSocks5HandshakeResponse();\n }\n // Sent auth request for Socks v5, waiting for response.\n }\n else if (this.state === constants_1.SocksClientState.SentAuthentication) {\n this.handleInitialSocks5AuthenticationHandshakeResponse();\n // Sent final Socks v5 handshake, waiting for final response.\n }\n else if (this.state === constants_1.SocksClientState.SentFinalHandshake) {\n this.handleSocks5FinalHandshakeResponse();\n // Socks BIND established. Waiting for remote connection via proxy.\n }\n else if (this.state === constants_1.SocksClientState.BoundWaitingForConnection) {\n if (this._options.proxy.type === 4) {\n this.handleSocks4IncomingConnectionResponse();\n }\n else {\n this.handleSocks5IncomingConnectionResponse();\n }\n }\n else if (this.state === constants_1.SocksClientState.Established) {\n // do nothing (prevents closing of the socket)\n }\n else {\n this._closeSocket(constants_1.ERRORS.InternalError);\n }\n }\n }", "onPart (part) {\n part.addListener('data', packet => {\n // console.log('Packet received', packet.toString()) // Raw packet data\n // packet_a + packet_b + packet_c + ... = file data\n })\n // Handle part / file only if .mov is not included in filename\n if (part.filename && part.filename.indexOf('.mov') === -1) {\n form.handlePart(part)\n // Or if filename is not set\n } else if (!part.filename) {\n form.handlePart(part)\n }\n }", "function myBodyFrameCallback(data, sock) {\n // console.log(\"bodyFrame\", data);\n // console.log(\"bodyFrame\");\n bodyFrameNum++;\n //console.log(\"bodyFrame \"+bodyFrameNum);\n data.frameTime = getClockTime();\n data.bodyFrameNum = bodyFrameNum;\n data.frameNum = bodyFrameNum;\n mostRecentFrame = data;\n if (recordingJSON) {\n var posePath = \"bodyFrame\" + bodyFrameNum + \".json\";\n posePath = poseDir + \"/\" + posePath;\n saveJSON(posePath, data);\n //jsonRecs.push(data);\n }\n sock.emit('bodyFrame', data);\n sendStats(sock, 'bodyFrame');\n}", "processData(socket, data) {\n\n rideProcess.listen(socket, data);\n\n\n }", "_transform(chunk, encoding, done) {\n let lo = 0\n let hi = 0\n\n if (this.savedR) {\n if (chunk[0] !== 0x0a) { this.push(this.savedR) }\n this.savedR = null\n }\n\n const last = chunk.length - 1\n while (hi <= last) {\n if (chunk[hi] === 0x0d) {\n if (hi === last) {\n this.savedR = chunk.slice(last)\n break // Stop hi from incrementing, we want to skip the last byte.\n } else if (chunk[hi + 1] === 0x0a) {\n this.push(chunk.slice(lo, hi))\n lo = hi + 1\n }\n }\n hi += 1\n }\n\n if (hi !== lo) {\n this.push(chunk.slice(lo, hi))\n }\n\n done()\n }", "function process(Data) {\n source = context.createBufferSource(); // Create Sound Source\n context.decodeAudioData(Data, function (buffer) {\n console.log(buffer)\n source.buffer = buffer;\n source.connect(context.destination);\n source.start(context.currentTime);\n })\n }", "async function handleStream() {\n const signal = controller.signal;\n for await (const chunk of ipfs.cat(image.cid, { signal })) {\n setImgBuffer((oldBuff) => [...oldBuff, chunk]);\n }\n\n if (mode === modeType.scanlation) {\n let textBuffer = [];\n //will only begin loading translation data if component isn't unloading\n for await (const chunk of ipfs.cat(data.cid, { signal })) {\n textBuffer = [...textBuffer, chunk];\n }\n setTranslation(JSON.parse(Buffer.concat(textBuffer).toString()));\n }\n }", "onData(data) {\n debug(\"polling got data %s\", data);\n\n const callback = packet => {\n // if its the first message we consider the transport open\n if (\"opening\" === this.readyState && packet.type === \"open\") {\n this.onOpen();\n } // if its a close packet, we close the ongoing requests\n\n\n if (\"close\" === packet.type) {\n this.onClose();\n return false;\n } // otherwise bypass onData and handle the message\n\n\n this.onPacket(packet);\n }; // decode payload\n\n\n parser.decodePayload(data, this.socket.binaryType).forEach(callback); // if an event did not trigger closing\n\n if (\"closed\" !== this.readyState) {\n // if we got data we're not polling\n this.polling = false;\n this.emit(\"pollComplete\");\n\n if (\"open\" === this.readyState) {\n this.poll();\n } else {\n debug('ignoring poll - transport state \"%s\"', this.readyState);\n }\n }\n }", "function gotData() {\n var data = serial.readStringUntil(\"\\r\\n\");\n // console.log('new data:', currentString);\n if (data === '0') {\n polygonColor = 0;\n } else if (data === '1') {\n polygonColor = 255;\n }\n}", "ondecoded(packet) {\n // the nextTick call prevents an exception in a user-provided event listener from triggering a disconnection due to a \"parse error\"\n nextTick(() => {\n this.emitReserved(\"packet\", packet);\n }, this.setTimeoutFn);\n }", "emitChunk(i, j, socket = undefined) {\n\t\tif(socket == undefined) {\n\t\t\tio.to('room' + this.room).emit('map-chunk', {chunk: this.map[i][j].generateData(), pos: this.map[i][j].physics._pos});\n\t\t}\n\t\telse {\n\t\t\tsocket.emit('map-chunk', {chunk: this.map[i][j].generateData(), pos: this.map[i][j].physics._pos});\n\t\t}\n\t}" ]
[ "0.6130932", "0.60954756", "0.60954756", "0.60510135", "0.6021035", "0.60027194", "0.5997786", "0.59267116", "0.5899183", "0.5859819", "0.58546245", "0.5820652", "0.5782869", "0.577706", "0.575896", "0.57556176", "0.5725306", "0.57047975", "0.56978667", "0.56972957", "0.5682914", "0.5679826", "0.5675183", "0.5668467", "0.56654847", "0.5640774", "0.5637721", "0.5635827", "0.5623714", "0.560711", "0.55585486", "0.55448234", "0.5544549", "0.5523325", "0.5503763", "0.54845273", "0.5483918", "0.54820883", "0.54587597", "0.5447221", "0.5445467", "0.54422444", "0.5423789", "0.54159045", "0.54118574", "0.5381677", "0.5370388", "0.53700674", "0.5368852", "0.5366765", "0.5363935", "0.5363459", "0.5352007", "0.5351399", "0.5349112", "0.53461003", "0.5344734", "0.53350365", "0.5323541", "0.53224367", "0.53212595", "0.53204244", "0.5317692", "0.5317692", "0.5300085", "0.5293259", "0.5286305", "0.5286159", "0.52777475", "0.5266506", "0.52625", "0.52476305", "0.5234637", "0.52280575", "0.5225972", "0.5225412", "0.52089024", "0.5204646", "0.5195166", "0.5195166", "0.51913", "0.51900995", "0.5187413", "0.5185285", "0.5182287", "0.5168122", "0.51571363", "0.5155702", "0.5154839", "0.5152348", "0.5143446", "0.5136155", "0.5130353", "0.51289266", "0.5120191", "0.51191306", "0.51103586", "0.5109251", "0.51011765", "0.51002127" ]
0.5893429
9
range of parameters frequency : <=2000 MHz hb : l0m to 80m radius : lkm to 10 km
function SUI_old_MathLab(frequency, hb, hm, place, radius){ var d0 = 100 var Xrho = 6 var Y = function(i,hb) { var a = [0, 4.6, 4, 3.6] var b = [0, 0.0075, 0.0065, 0.005] var c = [0, 12.6, 17.1, 20] return a[i]-(b[i]*hb)+(c[i]/hb) } var PL = 20*Math.log10(4*Math.PI*d0*frequency/300) + 10*Y(place,hb)*Math.log10(radius/d0) + Xrho; return PL; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gettuning(){\r\n\tvar alf = ['C','C#','D','D#','E','F','F#','G','G#','A','A#','B'];\r\n\tfor(var j=0; j<11; j++){\r\n\t\tfor(var i=0; i<12; i++){\r\n\t\t\ttuning[ (alf[i]+j) ] = notetofreq( 261.6255653, (j-4)*12+i ); // C4 = 261.6255653 Hz\r\n\t\t}\r\n\t}\r\n}", "setFilterFrequency(y) {\n // min 40Hz\n let min = 40;\n // max half of the sampling rate\n let max = this.myAudioContext.sampleRate / 2;\n // Logarithm (base 2) to compute how many octaves fall in the range.\n let numberOfOctaves = Math.log(max / min) / Math.LN2;\n // Compute a multiplier from 0 to 1 based on an exponential scale.\n // let multiplier = Math.pow(2, numberOfOctaves * (((2 / this.surface.clientHeight) * (this.surface.clientHeight - y)) - 1.0));\n let multiplier = Math.pow(2, numberOfOctaves * (((2 / this.canvas.height/2) * (this.canvas.height - y)) - 1.0));\n // console.log(y,max*multiplier,multiplier);\n // Get back to the frequency value between min and max.\n return max * multiplier;\n }", "setFrequencyBounds(lower, upper) {\n\t\tthis.upperHz = upper\n\t\tthis.lowerHz = lower\n\n\t\tconst half = this._bufferSize/2\n\n\t\tthis._frequencies = new Float32Array(half)\n\t\tfor (let i = 0; i < half; i++) {\n\t\t\tthis._frequencies[i] = 2*Math.PI*(lower*(upper/lower)**(i/half))\n\t\t}\n\t\tthis.filterNode.frequency.set(this._frequencies[half-1])\n\t}", "function grs80_params() {\n axis = 6378137.0; // GRS 80.\n flattening = 1.0 / 298.257222101; // GRS 80.\n central_meridian = null;\n lat_of_origin = 0.0;\n}", "function regulateFrequency(value){ //FREQUENCY\n if(value<=250 && value>=50){\n var frequencyValue= (((value-50)*100 )); //Werte von 0 bis 20k in 100er Schritten\n filter.frequency.value=frequencyValue;\n console.log(\"frequencyValue: \"+filter.frequency.value+\" of Frequency\");\n }else{\n console.log(\"Falsche Werte bei Ausführung von regulateFrequency\");\n }\n}", "function hk(a){this.radius=a}", "function setParameters() {\n params.viscosity = 0.02;\n params.u0 = -amplitude;\n params.one36th = 1 / 36;\n params.one9th = 1 / 9;\n params.four9ths = 4 / 9;\n params.gridSize = 5;\n params.m = int(height / params.gridSize);\n params.n = int(width / params.gridSize);\n}", "function set(newb, newf, newintervals){\n\tb = newb\n\tintervals = newintervals\n\t//bottom_freq = new_bottom_freq\n\t//smallest_interval = Math.min.apply(null, newintervals); \n\t//f = bottom_freq / smallest_interval\n\tf = newf\n\tconsole.log(\"Fundamental\", f, \"hz\")\n\tconsole.log(\"Beat\", b, \"hz\")\n\n\tfor(let i=0; i<oscillators.length; i++){\n\t\tlet pan = i%2;\n\t\tlet interval = intervals[Math.floor(i/2)]; \n\t\to = oscillators[i]\n\t\tif(pan){\n\t\t\to.frequency.value = (f + b) * interval \n\t\t}else{\n\t\t\to.frequency.value = (f + 0) * interval\n\t\t}\n\t\tconsole.log(i, o.frequency.value)\n\t}\n\n}", "function mtof(m) {\n return Math.pow(2, (m - 69) / 12) * 440;\n}", "function hc(a){this.radius=a}", "function buildGauge(freq) {\n // Enter a speed between 0 and 9\n var level = (180/9) * freq; //Calculate frequency to match 180 degree\n // console.log(freq);\n // console.log(level);\n // Trig to calc meter point\n var degrees = 180 - level,\n radius = .3;\n var radians = degrees * Math.PI / 180;\n var x = radius * Math.cos(radians);\n var y = radius * Math.sin(radians);\n\n // Path: may have to change to create a better triangle\n var mainPath = 'M -.0 -0.025 L .0 0.025 L',\n pathX = String(x),\n space = ' ',\n pathY = String(y),\n pathEnd = ' Z';\n var path = mainPath.concat(pathX,space,pathY,pathEnd);\n\n var data = [{ type: 'scatter', x: [0], y:[0],\n marker: {size: 15, color:'850000'},\n showlegend: false,\n name: 'Frequency',\n text: freq,\n hoverinfo: 'text+name'},\n { values: [50/9, 50/9, 50/9, 50/9, 50/9, 50/9, 50/9, 50/9, 50/9, 50],\n rotation: 90,\n text: ['8-9', '7-8','6-7', '5-6', '4-5', '3-4', '2-3', '1-2', '0-1'],\n textinfo: 'text',\n textposition:'inside',\n marker: {colors:['rgb(14, 122, 14, .5)', 'rgb(16, 163, 16, .5)', 'rgba(14, 127, 0, .5)', 'rgba(110, 154, 22, .5)',\n 'rgba(170, 202, 42, .5)', 'rgba(202, 209, 95, .5)', 'rgba(210, 206, 145, .5)', 'rgba(232, 226, 202, .5)',\n 'rgb(242, 242, 242, .5)', 'rgba(255, 255, 255, 0)']},\n // labels: ['8-9', '7-8','6-7', '5-6', '4-5', '3-4', '2-3', '1-2', '0-1'],\n hoverinfo: \"none\",\n hole: .25,\n type: 'pie',\n showlegend: false\n }];\n\n var layout = {\n // hovermode: false,\n shapes:[{\n type: 'path',\n path: path,\n fillcolor: '850000',\n line: {\n color: '850000'\n }\n }],\n title: '<b>Belly Button Washing Frequency</b><br>Scrubs Per Week',\n height: 500,\n width: 500,\n xaxis: {zeroline:false, showticklabels:false, showgrid: false, range: [-1, 1]},\n yaxis: {zeroline:false, showticklabels:false, showgrid: false, range: [-1, 1]}\n };\n\n Plotly.newPlot('gauge', data, layout, {responsive: true});\n}", "function getFreq(key) {\n return Math.pow(2, (key-49)/12) * 440;\n }", "function MK5_rate(GFDI, w) {\n if((w>=4)&&(w<=6)) {\n // MK5 uses 0.14 to account for differences in observed values from different meters\n return (0.14*GFDI); \n } else if((w>=0)&&(w<4)) {\n return (0.06*GFDI);\n } else {\n // error has occurred\n }\n}", "function calculation () {\n omega = 2*Math.PI*ny; // Kreisfrequenz (1/s)\n if (dPhi == 0) i0 = u0/r; // Maximale Stromstärke (A, für Widerstand)\n else if (dPhi > 0) i0 = u0*omega*c; // Maximale Stromstärke (A, für Kondensator)\n else i0 = u0/(omega*l); // Maximale Stromstärke (A, für Spule)\n }", "function init() {\n this.a = 6377397.155;\n this.es = 0.006674372230614;\n this.e = Math.sqrt(this.es);\n if (!this.lat0) {\n this.lat0 = 0.863937979737193;\n }\n if (!this.long0) {\n this.long0 = 0.7417649320975901 - 0.308341501185665;\n }\n /* if scale not set default to 0.9999 */\n if (!this.k0) {\n this.k0 = 0.9999;\n }\n this.s45 = 0.785398163397448; /* 45 */\n this.s90 = 2 * this.s45;\n this.fi0 = this.lat0;\n this.e2 = this.es;\n this.e = Math.sqrt(this.e2);\n this.alfa = Math.sqrt(1 + (this.e2 * Math.pow(Math.cos(this.fi0), 4)) / (1 - this.e2));\n this.uq = 1.04216856380474;\n this.u0 = Math.asin(Math.sin(this.fi0) / this.alfa);\n this.g = Math.pow((1 + this.e * Math.sin(this.fi0)) / (1 - this.e * Math.sin(this.fi0)), this.alfa * this.e / 2);\n this.k = Math.tan(this.u0 / 2 + this.s45) / Math.pow(Math.tan(this.fi0 / 2 + this.s45), this.alfa) * this.g;\n this.k1 = this.k0;\n this.n0 = this.a * Math.sqrt(1 - this.e2) / (1 - this.e2 * Math.pow(Math.sin(this.fi0), 2));\n this.s0 = 1.37008346281555;\n this.n = Math.sin(this.s0);\n this.ro0 = this.k1 * this.n0 / Math.tan(this.s0);\n this.ad = this.s90 - this.uq;\n}", "function freqToDist(frequency){\n const percentFreq =\n (frequency - minFreq) / (maxFreq - minFreq);\n\n const distFromInner =\n ((outerRadius * 2 - innerRadius * 2) * percentFreq);\n\n return distFromInner + innerRadius;\n}", "function Params() {\n // Wave shape\n this.shape = 0;\n\n // Envelope\n this.attack = 0; // Attack time\n this.sustain = 0.3; // Sustain time\n this.punch = 0; // Sustain punch\n this.decay = 0.4; // Decay time\n\n // Tone\n this.freq = 0.3; // Start frequency\n this.freqLimit = 0; // Min frequency cutoff\n this.freqSlide = 0; // Slide (SIGNED)\n this.freqSlideDelta = 0; // Delta slide (SIGNED)\n // Vibrato\n this.vibDepth = 0; // Vibrato depth\n this.vibSpeed = 0; // Vibrato speed\n\n // Tonal change\n this.arpMod = 0; // Change amount (SIGNED)\n this.arpSpeed = 0; // Change speed\n\n // Square wave duty (proportion of time signal is high vs. low)\n this.duty = 0; // Square duty\n this.dutySweep = 0; // Duty sweep (SIGNED)\n\n // Repeat\n this.repeatSpeed = 0; // Repeat speed\n\n // Flanger\n this.flangerOffset = 0; // Flanger offset (SIGNED)\n this.flangerSweep = 0; // Flanger sweep (SIGNED)\n\n // Low-pass filter\n this.lpf = 1; // Low-pass filter cutoff\n this.lpfSweep = 0; // Low-pass filter cutoff sweep (SIGNED)\n this.lpfResonance = 0;// Low-pass filter resonance\n // High-pass filter\n this.hpf = 0; // High-pass filter cutoff\n this.hpfSweep = 0; // High-pass filter cutoff sweep (SIGNED)\n\n // Sample parameters\n this.vol = 0.5;\n }", "function MK34_rate(GFDI) { return (0.13*GFDI); }", "function init_kernel(resampling_flag, fileName, is_sorted, is_left){\n\n init_googlemap();\n update_color_bar(0);\n\n if(last_left_sorted == is_sorted && last_data == current_data && !resampling_flag){\n\n console.log(\"skip rs\");\n\n if(right_is_origin){\n\n var radius = parseFloat(document.getElementById(\"radius_input\").value);\n var tau = parseFloat(document.getElementById(\"tau_input\").value);\n\n getMax(radius, tau, STD);\n\n\n var x = 1.0;\n var y = (maxY-minY)/(maxX-minX);\n\n // left fill\n\n fill(0, radius, tau, 0.01, x, y, true);\n\n // right fill\n\n //right_fill(0, 101, 0.1, 0.01, x, y, true);\n }\n\n }else{\n\n d3.csv(fileName,function(data){\n\n console.log(\"init kernel!!!!!!!!!\");\n\n ken = [];\n var epsilon = parseFloat(document.getElementById(\"epsilon_input\").value);\n\n console.log(\"epsilon!!!!:\", epsilon);\n\n function getBaseLog(x, y) {\n return Math.log(y) / Math.log(x);\n }\n\n var size = Math.floor(1/(epsilon*epsilon)*Math.log(1000));\n\n var log_size = Math.ceil(getBaseLog(2, size));\n\n size = Math.pow(2, log_size);\n\n set_data_size(size);\n\n\n // mark data length.\n //data_length_mark = size;\n //percent = parseFloat(size)/parseFloat(full_size);\n\n var sampleList = [];\n\n var tmpMinX = 10000;\n var tmpMaxX = -10000;\n\n var tmpMinY = 10000;\n var tmpMaxY = -10000;\n\n if (!is_sorted){\n data.forEach(function(d,i){\n //nothing\n var tmpX;\n var tmpY;\n Object.values(d).forEach(function(item){\n var items = item.split(\" \");\n tmpX = parseFloat(items[0]);\n tmpY = parseFloat(items[1]);\n });\n\n if (tmpX < tmpMinX){\n tmpMinX = tmpX;\n }\n if (tmpX > tmpMaxX){\n tmpMaxX = tmpX;\n }\n\n if(tmpY < tmpMinY){\n tmpMinY = tmpY;\n }\n\n if(tmpY > tmpMaxY){\n tmpMaxY = tmpY;\n }\n\n\n if(i<size){\n sampleList.push(d);\n }else{\n var j = Math.floor((Math.random() * i));\n if(j<size){\n sampleList[j] = d;\n }\n }\n });\n\n console.log(\"x:\", tmpMinX, \" \", tmpMaxX);\n console.log(\"y:\", tmpMinY, \" \", tmpMaxY);\n sampleList.forEach(function(d){\n var cordinate = [];\n Object.values(d).forEach(function(item){\n var items = item.split(\" \");\n ken.push({'y':parseFloat(items[0]), 'x':parseFloat(items[1])});\n });\n });\n\n }else{\n /**\n * Use sorting sampling data\n **/\n\n //console.log(\"coreset!!!!!left!!!!\");\n for(var i=0; i<size; i++){\n var cordinate = [];\n Object.values(data[i]).forEach(function(item){\n var items = item.split(\" \");\n ken.push({'y':parseFloat(items[0]), 'x':parseFloat(items[1])});\n });\n }\n }\n\n full_data_length = ken.length;\n //getCore(is_left, STD, 101, 0.05);\n // var d1 = performance.now();\n // set_time((d1-d0)/1000);\n //map_update();\n //map_draw();\n //coreset();\n // if(is_left){\n // d3.select(\"#std-value\").text((STD).toFixed(4));\n // d3.select(\"#std\").property(\"value\", parseFloat(STD));\n // getCore(is_left, STD, 101, 0.15);\n // var d1 = performance.now();\n // console.log(\"full_data:\" + (d1-d0));\n // set_time((d1-d0)/1000);\n\n // draw_canvas(0);\n\n // }else{\n // d3.select(\"#std-value\").text((STD).toFixed(4));\n // d3.select(\"#std\").property(\"value\", parseFloat(STD));\n // getCore(is_left, STD, 101, 0.15);\n // console.log(\"im right!!!!!!!!\");\n // draw_full_canvas();\n // }\n\n if(right_is_origin){\n\n\n var radius = parseFloat(document.getElementById(\"radius_input\").value);\n var tau = parseFloat(document.getElementById(\"tau_input\").value);\n\n getMax(radius, tau, STD);\n\n\n var x = 1.0;\n var y = (maxY-minY)/(maxX-minX);\n\n // left fill\n\n fill(0, radius, tau, 0.01, x, y, true);\n\n // right fill\n\n //right_fill(0, 101, 0.1, 0.01, x, y, true);\n }\n //init_googlemap();\n });\n }\n\n last_left_sorted = is_sorted;\n}", "function highPassFreqLow() {\n\thighPassFilter.frequency.value = 110;\n}", "function highPassFreqLow() {\n\thighPassFilter.frequency.value = 110;\n}", "function crystal () {\"use strict\"; \n var antenna = Calc.calc ({\n name: \"antenna_loop\",\n input : {\n f : [1e3],\n d : [1e0],\n s : [1e0],\n w : [1e0],\n b : [1e-3],\n h : [1e0],\n N : [],\n design: [\"O\", \"[]\", \"[ ]\", \"[N]\"],\n wire_d : [1e-3],\n material : [\"Perfect\", \"Cu\", \"Al\"]\n },\n output : { \n // part 1\n lambda : [1e+0, 3],\n mu : [1e0, 1],\n g : [1e0, 2, \"exp\"], \n l : [1e0, 2],\n ll : [1e0, 2],\n ll0 : [1e0, 2],\n p : [1e0, 2],\n pl : [1e0, 2],\n S : [1e0, 2],\n \n W : [1e0, 2],\n\n D : [1e0, 2],\n G : [1e-1, 2],\n hg : [1e0, 2],\n RS : [1e0, 2, \"exp\"],\n R1 : [1e0, 2],\n Rl : [1e0, 2],\n Qa : [1e0, 2],\n C : [1e-12, 2],\n C0 : [1e-12, 2],\n L0 : [1e-6, 2],\n eta : [1e0, 2, \"exp\"], \n Za : [1e0, 2, \"complex\"],\n f0 : [1e6, 2],\n lambda0 : [1e0, 2]\n }\n }, function () { \n var KWH = 10;\n var KL = 0.14;\n \n this.check (this.f >= 1e3 && this.f <= 30e6, \"f\"); \n this.check ((this.w > this.h && this.w / this.h <= KWH) || (this.h > this.w && this.h / this.w <= KWH) || (this.h == this.w), \"wh\");\n this.check (this.wire_d > 0, \"wire_d\");\n \n this.lambda = Phys.C / this.f;\n \n // характеристики материала проводника\n var material = Materials [this.material];\n this.g = material.g;\n this.mu = material.mu;\n \n // непосредственно рамка\n if (this.design === \"O\") {\n \tthis.check (this.d > 0, \"d\");\n \t\n this.S = Math.PI * Math.pow (this.d / 2, 2);\n this.p = Math.PI * this.d;\n this.w = 0;\n this.h = 0;\n this.N = 1;\n } else if (this.design === \"[]\") {\n\t\t\tthis.check (this.s > 0, \"s\");\n\t\t\t\n this.S = Math.pow (this.s, 2);\n this.p = this.s * 4;\n this.w = this.s;\n this.h = this.s;\n this.d = 0;\n this.N = 1;\n } else if (this.design === \"[N]\") {\n this.check (this.N >= 2 && this.N <= 60, \"N\");\n this.check (this.b >= 5 * this.wire_d && this.b <= this.s / (5 * this.N), \"b\");\n this.check (this.s > 0, \"s\");\n \n this.S = Math.pow (this.s, 2);\n this.p = this.s * 4;\n this.w = this.s;\n this.h = this.s;\n this.d = 0;\n } else {\n \tthis.check (this.w > 0, \"w\");\n\t\t\tthis.check (this.h > 0, \"h\");\n\t\t\t\n this.S = this.h * this.w;\n this.p = (this.h + this.w) * 2;\n this.d = 0;\n this.N = 1;\n }\n \n var antenna = new MagneticLoop (this.d, this.w, this.h, this.wire_d, this.b, this.N, this.g, this.mu);\n this.antenna = antenna;\n \n var antennaAtLambda = this.antenna.fn (this.lambda);\n this.antennaAtLambda = antennaAtLambda;\n \n this.R1 = antennaAtLambda.R1;\n this.eta = antennaAtLambda.eta;\n this.RS = antennaAtLambda.RS;\n this.Rl = antennaAtLambda.Rl;\n this.Za = antennaAtLambda.Z;\n this.hg = antennaAtLambda.lg;\n this.D = antennaAtLambda.D; \n this.W = antennaAtLambda.W; \n this.Qa = antennaAtLambda.Q;\n this.S = antennaAtLambda.S;\n this.p = antennaAtLambda.p;\n this.l = antennaAtLambda.l;\n this.ll = this.l / this.lambda;\n this.pl = this.p / this.lambda;\n this.f0 = antennaAtLambda.f0;\n this.C0 = antennaAtLambda.C0;\n this.L0 = antennaAtLambda.L0;\n this.lambda0 = antennaAtLambda.lambda0;\n this.ll0 = this.lambda / this.lambda0;\n\n // ограничение на периметр 0,14 lambda (Кочержевский)\n this.suggest (this.p <= this.lambda * KL, \"pL\"); \n this.suggest (!isNaN (this.f0), \"f0\"); \n\n this.check (this.l <= this.lambda * KL || this.N === 1, \"lL\");\n this.check (this.p <= this.lambda, \"pl\"); \n this.check (this.wire_d <= this.p / 20, \"wire_d\"); \n \n // http://www.chipinfo.ru/literature/radio/200404/p67.html\n // this.Q = 3 * Math.log (this.d / this.wire_d) * Math.pow (this.lambda / this.p, 3) / Math.PI * this.eta; \n this.G = Math.log10 (this.D * this.eta);\n\n // fmax ограничиваем l = 0.14 * lambda\n this.band = Plots.band (this.f, KL * Phys.C / this.l);\n this.fnZ = function (freq) {\n return antenna.fn (Phys.C / freq).Z;\n };\n \n this.plot (Plots.impedanceResponseData (this.fnZ, this.band, 200), Plots.impedanceResponseAxes (this.band), 0);\n });\n \n var circuit = Calc.calc ({\n name: \"circuit\",\n input : {\n E : [1e-3],\n Ctype : [\"A12-495x1\", \"A12-495x2\", \"A12-495x3\", \"A12-365x1\", \"A12-365x2\", \"A12-365x3\", \n \"A4-15x1\", \"A4-15x2\", \n \"S5-270x1\", \"S5-270x2\", \"S5-180x1\", \"S5-180x2\"],\n R : [1e3],\n Cx : [1e-12],\n f : antenna.f\n },\n output : { \n C : [1e-12, 2],\n \n // part 2\n Pn : [1e0, 1, \"exp\"],\n Ea : [1e-3, 2],\n Ee : [1e-3, 2],\n Cmin : [1e-12, 2],\n Cmax : [1e-12, 2],\n Ct : [1e-12, 2],\n QC : [1e0, 3],\n rC : [1e0, 2],\n etaF : [1e0, 2, \"exp\"],\n Rn : [1e3, 2],\n KU : [1e-1, 2],\n Un : [1e-3, 2],\n Qn : [1e0, 2],\n dF : [1e3, 2]\n }\n }, function () { \n this.check (this.E <= 10 && this.E > 0, \"E\"); \n this.check (this.R > 0, \"R\");\n \n // -------------------------------------------------------\n var capacitor = Capacitors [this.Ctype];\n \n this.Ea = antenna.antennaAtLambda.fnE (this.E);\n this.QC = capacitor.Q;\n \n this.C = 1 / (2 * Math.PI * this.f * antenna.antennaAtLambda.Z.y); \n this.check (this.C >= 0, \"C\");\n this.C = this.C < 0 ? 0 : this.C;\n \n this.check (this.Cx >= 0, \"Cx\"); \n this.Ct = this.C - this.Cx;\n\n this.Cmin = capacitor.Cmin * capacitor.N + this.Cx;\n this.Cmax = capacitor.Cmax * capacitor.N + this.Cx;\n this.check (this.C >= this.Cmin, \"Cmin\");\n this.check (this.C <= this.Cmax, \"Cmax\");\n \n this.Ct = Math.clamp (this.Ct, this.Cmin - this.Cx, this.Cmax - this.Cx);\n this.CC = this.Ct + this.Cx;\n \n function fnCircuit (f, aerial, C, QC, R) {\n var result = [];\n \n result.zC = Phys.fnCapacitor (f, C, QC).Z;\n result.zRC = result.zC.par (new Complex (R, 0));\n result.z = aerial.Z.sum (result.zRC);\n result.fnU = function (E) {\n return new Complex (aerial.fnE (E), 0).div (result.z).mul (result.zRC);\n };\n \n return result;\n };\n\n this.fnCircuit = function (f) {\n var aerial = antenna.antenna.fn (Phys.C / f);\n return {\n x : fnCircuit (f, aerial, this.CC, this.QC, this.R),\n min : fnCircuit (f, aerial, this.Cmax, this.QC, this.R),\n max : fnCircuit (f, aerial, this.Cmin, this.QC, this.R)\n };\n }; \n \n var p0 = Math.pow (antenna.lambda * this.E / (2 * Math.PI), 2) / (4 * Phys.Z0 / Math.PI);\n var circuit = fnCircuit (this.f, antenna.antennaAtLambda, this.CC, this.QC, this.R);\n \n this.Ee = fnCircuit (this.f, antenna.antennaAtLambda, this.CC, this.QC, 1e12).fnU (this.E).mod ();\n this.rC = circuit.zC.x;\n // TODO: Точный расчет\n this.Qn = -circuit.zC.y / circuit.z.x;\n this.dF = this.f / this.Qn;\n this.Un = circuit.fnU (this.E).mod ();\n this.Rn = antenna.Za.par (circuit.zC).mod ();\n this.Pn = this.Un * this.Un / this.R;\n this.etaF = this.RS / (this.rC + antenna.Za.x);\n this.KU = Math.log10 (this.Pn / p0);\n \n var Ux = [];\n var Umin = [];\n var Umax = [];\n \n var fmin = antenna.band [0];\n var fmax = antenna.band [1];\n\n if (fmax > fmin) {\n for (var freq = fmin; freq <= fmax; freq += (fmax - fmin) / 200) {\n \tvar p0 = Math.pow (Phys.C / freq * this.E / (2 * Math.PI), 2) / (4 * Phys.Z0 / Math.PI);\n\n var circuit = this.fnCircuit (freq);\n \n\t\t\t\tvar px = Math.pow (circuit.x.fnU (this.E).mod (), 2) / this.R;\n\t\t\t\tvar pmin = Math.pow (circuit.min.fnU (this.E).mod (), 2) / this.R;\n\t\t\t\tvar pmax = Math.pow (circuit.max.fnU (this.E).mod (), 2) / this.R;\n \n\t\t\t\tUx.push ( [freq, 10 * Math.log10 (px / p0)]);\n\t\t\t\tUmin.push ( [freq, 10 * Math.log10 (pmin / p0)]);\n\t\t\t\tUmax.push ( [freq, 10 * Math.log10 (pmax / p0)]); \n }\n \n\t\t\tvar options1;\n\t\t\toptions1 = {\n\t\t\t\tseries : {\n\t\t\t\t\tlines : {\n\t\t\t\t\t\tshow : true,\n\t\t\t\t\t\tlineWidth : 2,\n\t\t\t\t\t\tzero : false\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\t\txaxis : Plots.linFx (),\n\t\t\t\tyaxes : [Plots.logDB ()],\n\t\t\t\tlegend : {\n\t\t\t\t\tshow : true,\n\t\t\t\t\tnoColumns : 1,\n\t\t\t\t\tposition : \"se\"\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.plot ( [{\n\t\t\t\tdata : Ux,\n\t\t\t\tcolor : \"#030\",\n\t\t\t\tlabel : \"При настройке на расчетную частоту\",\n\t\t\t\tshadowSize : 0\n\t\t\t}, {\n\t\t\t\tdata : Umin,\n\t\t\t\tcolor : \"#F00\",\n\t\t\t\tlabel : \"При максимальной ёмкости КПЕ\",\n\t\t\t\tshadowSize : 0\n\t\t\t}, {\n\t\t\t\tdata : Umax,\n\t\t\t\tcolor : \"#00F\",\n\t\t\t\tlabel : \"При минимальной ёмкости КПЕ\",\n\t\t\t\tshadowSize : 0\n\t\t\t}], options1, 0);\n } \n });\n}", "function Hc(a){this.radius=a}", "function getradius(magnitude){\n return magnitude*5;\n}", "function ck(a){this.radius=a}", "function getRadius(value){\n return value*30000\n}", "function boom(cfg) {\n\n // a band with two values\n const b = clubber.band({ \n template: [cfg.index, cfg.index], // we want to calculate the gradient so we use the same metric twice \n smooth: [0.1, -0.1], // with different smoothing\n from: cfg.from, // midi note low limit\n to: cfg.to, // midi note high limit\n low: cfg.low, // midi volume filter low limit\n high: cfg.high // midi volume filter high limit\n });\n\n const d = new Float32Array(2);\n let v = 0;\n \n return function () {\n b(d); // compute same metric with different smoothing levels\n\n // diff the smoothed values to get the gradient and scale appropriately\n v = mix(v, smoothstep(0, 0.16, Math.abs(d[0] - d[1])), cfg.smooth || 0.1); \n\n // v is a normalized float to use as a modulator for properties\n return v;\n }\n\n }", "overpressureToDistance(overPressurekPa)\n{\n const a1 = -0.214362789151;\n const b1 = 1.35034249993;\n const c01 = 2.78076916577;\n const c11 = -1.6958988741;\n const c21 = -0.154159376846;\n const c31 = 0.514060730593;\n const c41 = 0.0988554365274;\n const c51 = -0.293912623038;\n const c61 = -0.0268112345019;\n const c71 = 0.109097496421;\n const c81 = 0.001628467556311;\n const c91 = -0.0214631030242;\n const c101 = 0.0001456723382;\n const c111 = 0.00167847752266;\n \n //Tolerancia del cálculo\n const tolerance = 0.001;\n\n //Valor de inicio del calculo de dsitancia x a la de sobrepresion overPressureTNT;\n let xTNT = 0;\n \n //Presion inicial para el cálculo este numero es el maximo reportado por EPA en kPA\n var pres = 33000;\n \n //Calculo de Masa equivalente de TNT\n let masaEQTNT = (this.fe*this.hCombKJKG*this.mass)/DHCTNT;\n \n //Calculo de la distancia por iteracion\n for (xTNT = 1; pres > overPressurekPa; xTNT = xTNT + tolerance)\n {\n //Distancia Escalada (m/kg^1/3)\n const z = xTNT/Math.pow(masaEQTNT, 1.0/3.0);\n \n let ablog = a1+b1*Math.log10(z);\n let c = c01+c11*ablog+c21*Math.pow(ablog, 2)+c31*Math.pow(ablog, 3)+c41*Math.pow(ablog, 4)+c51*Math.pow(ablog, 5)+c61*Math.pow(ablog, 6)+c71*Math.pow(ablog, 7)+c81*Math.pow(ablog, 8)+c91*Math.pow(ablog, 9)+c101*Math.pow(ablog, 10)+c111*Math.pow(ablog, 11);\n pres = Math.pow(10, c);\n }\n return xTNT;\n\n}", "function generateFrequencies()\n{\n\tfor(var note = 0; note < 127; ++note)\n\t{\n\t\tconst a = Math.pow(2,1.0/12.0); // comments pls\n\t\tFREQUENCIES[note] = 440 * Math.pow(a, note - 81);\n\t}\n}", "function input () {\n ny = inputNumber(ipNy,3,false,0.1,100); // Frequenz (Hz)\n u0 = inputNumber(ipU0,3,false,0.1,100); // Maximale Spannung (V)\n if (dPhi == 0) r = inputNumber(ipRCL,3,false,10,1000); // Falls Widerstand, Eingabe in Ohm\n else if (dPhi > 0) // Falls Kondensator ...\n c = 1e-6*inputNumber(ipRCL,3,false,1,100); // ... Eingabe der Kapazität in Mikrofarad, Umrechnung in Farad\n else l = inputNumber(ipRCL,3,false,10,1000); // Falls Spule, Eingabe der Induktivität in Henry \n } // ---!", "function mapFreq(i){\n // var freq = i * SAMPLE_RATE / FFT_SIZE;\n var freq = i * SAMPLE_RATE / self.spectrum.length;\n return freq;\n }", "function get_samples_for_us (us)\n{\n\treturn ((us * get_srate()) / 1000000);\n}", "readRangeSingleMillimeters(){\n\n\t}", "function getRadius(value){\n return value*25000\n }", "function onR2Changed() {\n var val_str = document.getElementById(\"r2\").value;\n var val_good = check_unit( val_str, \"ohm\", \"r2\" );\n if (val_good) {\n setR2( math.unit( document.getElementById(\"r2\").value ).value ); \n } else {\n document.getElementById(\"r2\").value = math.unit(loop_filter.r2,\"ohm\").format(3);\n return;\n }\n\n simulatePll();\n\n}", "function msg_float(value)\r{\r\tif(inlet == 0)\r\t\tfrequency = value;\r\telse if(inlet == 1)\r\t\tq = value;\r\telse if(inlet == 2)\r\t\tgain = value;\r\t\r\tif(type == \"bandpass\")\r\t\tcalculate_bandpass_coefficients();\r\telse if (type == \"peaknotch\")\r\t\tcalculate_peaknotch_coefficients();\r}", "speed (prm) {\n try {\n\t return this.confmng(\"speed\", prm);\n } catch (e) {\n console.error(e.stack);\n throw e;\n }\n }", "function createMelFilterbank(lowFreq, highFreq, nFilter, fftSize, sampleRate) {\n // parameter check.\n if (lowFreq < 0 || highFreq > sampleRate / 2) {\n console.log('Low frequency must more or equal 0' +\n ' and high frequency must less than or equal half of sample rate.' +\n ' Process exiting');\n process.exit();\n }\n\n // set filterbank start and end. \n let lowMel = 2595 * Math.log10(1 + (lowFreq / 700));\n let highMel = 2595 * Math.log10(1 + (highFreq / 700));\n\n // Equally spaced in Mel scale.\n let mel = [];\n let step = (highMel - lowMel) / ((nFilter + 2) - 1);\n for (i = 0; i < nFilter + 2; i++) {\n mel.push(lowMel + (i * step));\n }\n\n // Convert back to frequency.\n let freq = [];\n freq = mel.map(x => 700 * (Math.pow(10, (x / 2595)) - 1));\n\n // Round frequencies to the nearest FFT bin.\n let bin = [];\n bin = freq.map(x => Math.floor(fftSize * x / sampleRate))\n\n // Model the filterbank.\n let fbank = [];\n for (i = 1; i < bin.length - 1; i++) { // nFilter\n let fLeft = bin[i - 1];\n let fCenter = bin[i];\n let fRight = bin[i + 1];\n\n let filter = new Float32Array(fftSize / 2);\n for (j = 0; j < filter.length; j++) {\n if (j < fLeft) filter[j] = 0;\n else if (j >= fLeft && j < fCenter) filter[j] = (j - fLeft) / (fCenter - fLeft);\n else if (j == fCenter) filter[j] = 1;\n else if (j <= fRight && j > fCenter) filter[j] = (fRight - j) / (fRight - fCenter);\n else if (j > fRight) filter[j] = 0;\n }\n fbank.push(filter);\n }\n\n return fbank;\n}", "function onFcChanged() {\n var val_str = document.getElementById(\"fc\").value;\n var val_good = check_unit( val_str, \"Hz\", \"fc\" );\n if (val_good) {\n setFc( math.unit( document.getElementById(\"fc\").value ).value ); \n } else {\n document.getElementById(\"fc\").value = math.unit(pll.fc,\"Hz\").toString();\n return;\n }\n\n synthPll();\n}", "function xb(a){this.radius=a}", "function calculoMagnitude(amplitude,intervalo){\n return Math.log10(amplitude) + 3 * Math.log10( 8* intervalo) - 2.92;\n }", "function lowPassFreqLow() {\n\tlowPassFilter.frequency.value = 10;\n}", "function lowPassFreqLow() {\n\tlowPassFilter.frequency.value = 10;\n}", "function init() {\n //this.R = 6370997; //Radius of earth\n this.R = this.a;\n}", "function init() {\n //this.R = 6370997; //Radius of earth\n this.R = this.a;\n}", "function getSinTheta() {\n var i;\n var point;\n var hitPeak = false;\n // var peaksInRange = [];\n var xList = [];\n var aList = [];\n // var newAmplitude = amplitude;\n var a, factor = 0;\n var sFactor;\n for (i = 0; i < config.doi.length; i++) {\n if (config.doi[i][\"val\"] < config.doiThreshold)\n continue;\n // console.log(config.doi[i]);\n point = config.doi[i][\"y\"];\n // current offset is within the range of a hill caused by this doi\n // hill width: +/-config.doiRange\n if (point - config.doiRange <= offset + config.doiSnappingPosition && offset + config.doiSnappingPosition <= point) { // uphill\n sFactor = isElementInViewport(config.doi[i][\"node\"]) ? config.slopeViewportFactor : config.slopeFactor;\n // console.log(\"UPHILL\", sFactor);\n a = 2 * config.doi[i][\"val\"] * sFactor / (config.doiRange * config.doiRange) * (offset + config.doiSnappingPosition - (point - config.doiRange));\n // peaksInRange.push(config.doi[i]);\n xList.push(a * (offset + config.doiSnappingPosition - (point - config.doiRange)));\n aList.push(a);\n // break;\n } else if (point < offset + config.doiSnappingPosition && offset + config.doiSnappingPosition <= point + config.doiRange) {\n sFactor = isElementInViewport(config.doi[i][\"node\"]) ? config.slopeViewportFactor : config.slopeFactor;\n // console.log(\"DOWNHILL\", sFactor);\n a = 2 * config.doi[i][\"val\"] * sFactor / (config.doiRange * config.doiRange) * ((point + config.doiRange) - (offset + config.doiSnappingPosition));\n // peaksInRange.push(config.doi[i]);\n xList.push(a * ((point + config.doiRange) - (offset + config.doiSnappingPosition)));\n aList.push(a);\n // break;\n }\n }\n\n // if multiple peaks, compute a for the peak with maximum value.\n var max = 0;\n var maxA;\n // TODO: for minus a value, pick the biggest absolute value\n for (i = 0; i < xList.length; i++) {\n if (max <= xList[i]) {\n max = xList[i];\n maxA = aList[i];\n }\n // if (max <= peaksInRange[i][\"val\"]) {\n // max = peaksInRange[i][\"val\"];\n // maxA = aList[i];\n // }\n }\n factor = Math.abs(maxA / Math.sqrt(maxA * maxA + 1));\n // console.log(factor, xList.length, \"peaks overlapping\", maxA, \"is chosen among\", aList, xList);\n return factor;\n }", "function Params() {\n return {\n // Wave shape\n wave_type: SQUARE,\n\n // Envelope\n env_attack: 0, // Attack time\n env_sustain: 0.3, // Sustain time\n env_punch: 0, // Sustain punch\n env_decay: 0.4, // Decay time\n\n // Tone\n base_freq: 0.3, // Start frequency\n freq_limit: 0, // Min frequency cutoff\n freq_ramp: 0, // Slide (SIGNED)\n freq_dramp: 0, // Delta slide (SIGNED)\n\n // Vibrato\n vib_strength: 0, // Vibrato depth\n vib_speed: 0, // Vibrato speed\n\n // Tonal change\n arp_mod: 0, // Change amount (SIGNED)\n arp_speed: 0, // Change speed\n\n // Duty (affects the timbre of SQUARE waves)\n duty: 0, // Square duty\n duty_ramp: 0, // Duty sweep (SIGNED)\n\n // Repeat\n repeat_speed: 0, // Repeat speed\n\n // Phaser\n pha_offset: 0, // Phaser offset (SIGNED)\n pha_ramp: 0, // Phaser sweep (SIGNED)\n\n // Low-pass filter\n lpf_freq: 1.0, // Low-pass filter cutoff\n lpf_ramp: 0, // Low-pass filter cutoff sweep (SIGNED)\n lpf_resonance: 0, // Low-pass filter resonance\n // High-pass filter\n hpf_freq: 0, // High-pass filter cutoff\n hpf_ramp: 0, // High-pass filter cutoff sweep (SIGNED)\n\n // Sample parameters\n sound_vol: 0.5,\n sample_rate: 44100,\n sample_size: 8\n };\n}", "function onFrequencySet() {\n // this function will return only minutes, the string format from text input \n // is 00:mm so we will only get the mm\n inputElements.frequency.value = inputElements.frequency.value.split(':')[1];\n data.time.frequency = parseInt(inputElements.frequency.value);\n}", "function getRadius(value){\n return value*25000\n }", "function EW_WriteParamValues(){\n if(state ==\"fixed_values\"){\n var index = cutoff_arr.length-1;\n var val = Number((cutoff_arr[index]).toFixed(2))\n // $(\"#graphparam1\").text(\"Max Ew: \"+max_ew);\n $(\"#graphparam2\").text(\"Cutoff Frequency: \"+val);\n }\n else if(state ==\"range_values\"){ \n // $(\"#graphparam1\").text(\"\");\n $(\"#graphparam2\").text(\"\");\n }\n}", "function notetofreq(basefreq,note){\r\n\tvar freq = basefreq || 440;\r\n\tif(note>=0){ \r\n\t\tfor(var i=0; i<note; i++){ freq *= harmconst; }\r\n\t\treturn freq; \r\n\t}else{\r\n\t\tfor(var i=0; i>note; i--){ freq /= harmconst; }\r\n\t\treturn freq; \r\n\t}\r\n}", "function Takeoff() {\n this.p = tombola.rangeFloat(-1,1);\n this.v = tombola.rangeFloat(-1,1)/sampleRate;\n}", "function circleParameter(r){\n//calc area = 2 * PI * r\n var circumference= 2 * Math.PI * r;\n//return the value\n return circumference;\n }", "function init$o() {\n //this.R = 6370997; //Radius of earth\n this.R = this.a;\n}", "function mapFreq( i ) {\n // var freq = i * SAMPLE_RATE / FFT_SIZE;\n var freq = i * self.SAMPLE_RATE / self.spectrum.length;\n return freq;\n }", "function radiusSize(magnitude) {\n return magnitude * 20000;\n }", "function getRadius(value){\n return value*60000\n}", "function getMapRadiusKM(){\n let mapBoundNorthEast = map.getBounds().getNorthEast();\n let mapDistance = mapBoundNorthEast.distanceTo(map.getCenter());\n return mapDistance/1000;\n}", "function onR4Changed() {\n var val_str = document.getElementById(\"r4\").value;\n var val_good = check_unit( val_str, \"ohm\", \"r4\" );\n if (val_good) {\n setR4( math.unit( document.getElementById(\"r4\").value ).value ); \n } else {\n document.getElementById(\"r4\").value = math.unit(loop_filter.r4,\"ohm\").format(3);\n return;\n }\n\n simulatePll();\n\n}", "function bandWidth(bits) {\n\tbits = bits* 1000;\n\tvar unit = 1000;\n\tif (bits < unit) return (bits % 1 === 0 ? bits : bits.toFixed(2)) + \"B\";\n\tvar exp = parseInt(Math.log(bits) / Math.log(unit));\n\tvar pre = \"KMGTPE\"[exp-1] + 'bps';\n\tvar n = bits / Math.pow(unit, exp);\n\treturn (n % 1 === 0 ? n : n.toFixed(2))+pre;\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 metersPerSecondToKnots(x){\n var knots = Math.round(x*1.94384);\n var endingString; \n if(knots == 1){\n endingString = \" Knot\";\n }\n else{\n endingString = \" Knots\";\n }\n return knots+endingString;\n}", "function nutazione(njd){\n // calcola i parametri da utilizzare per la nutazione\n\n var T=(njd-2415020.0)/36525;\n\n var L=279.6967+36000.7689*T+0.000303*T*T;\n var L1=270.4342+481267.8831*T-0.001133*T*T;\n var M=358.4758+ 35999.0498*T-0.000150*T*T;\n var M1=296.1046+477198.8491*T+0.009192*T*T;\n var LN=259.1833-1934.1420*T+0.002078*T*T;\n\n var DELTA_FI=-(17.2327+0.01737*T)*Math.sin(Rad(LN))\n -(1.2729+0.000130*T)*Math.sin(Rad(2*L))\n +0.2088*Math.sin(Rad(2*LN))\n -0.2037*Math.sin(Rad(2*L1))\n +(0.1261-0.00031*T)*Math.sin(Rad(M))\n +0.0675*Math.sin(Rad(M1))\n -(0.0497-0.00012*T)*Math.sin(Rad(2*L+M))\n -0.0342*Math.sin(Rad(2*L1-LN))\n -0.0261*Math.sin(Rad(2*L1+M1))\n +0.0214*Math.sin(Rad(2*L-M))\n -0.0149*Math.sin(Rad(2*L-2*L1+M1))\n +0.0124*Math.sin(Rad(2*L-LN))\n +0.0114*Math.sin(Rad(2*L1-M1));\n\n var DELTA_EP=(9.2100+0.00091*T)*Math.cos(Rad(LN))\n +(0.5522-0.00029*T)*Math.cos(Rad(2*L))\n -0.0904*Math.cos(Rad(2*LN))\n +0.0884*Math.cos(Rad(2*L1))\n +0.0216*Math.cos(Rad(2*L+M))\n +0.0183*Math.cos(Rad(2*L1-LN))\n +0.0113*Math.cos(Rad(2*L1+M1))\n -0.0093*Math.cos(Rad(2*L-M))\n -0.0066*Math.cos(Rad(2*L-LN));\n\n\n\nvar parametri=new Array (DELTA_FI,DELTA_EP);\n\nreturn parametri;\n\n}", "xDistanceToQTerm(radTermica) {\n\n //Tolerancia del cálculo\n const tolerance = 0.01;\n\n //Valor de inicio del calculo de dsitancia x;\n let x = 0;\n\n //Radiacion termica \n var qi = 60;\n\n //Calculo de la distancia por iteracion\n for (x = 1; qi > radTermica; x = x + tolerance) {\n qi = this.qTermToDistance(x)\n // console.log(`x ${x} qi ${qi}`)\n }\n return x;\n }", "function buildGauge(wfreq) {\n\n console.log(wfreq);\n\n\n var level = parseFloat(wfreq) * 20;\n var degrees = 180 - level;\n var textlevel = level / 20;\n\n var radius = 0.5;\n\n var radians = (degrees * Math.PI) / 180;\n var x = radius * Math.cos(radians);\n var y = radius * Math.sin(radians);\n\n var mainPath = \"M -.0 -0.05 L .0 0.05 L \";\n var pathX = String(x);\n var space = \" \";\n var pathY = String(y);\n var pathEnd = \" Z\";\n var path = mainPath.concat(pathX, space, pathY, pathEnd);\n\n var data = [\n {\n type: \"scatter\",\n x: [0],\n y: [0],\n marker: { size: 20, color: \"#f2096b\" },\n showlegend: false,\n name: \"Washing Frequency\",\n text: textlevel,\n hoverinfo: \"name\"\n },\n {\n values: [50 / 9, 50 / 9, 50 / 9, 50 / 9, 50 / 9, 50 / 9, 50 / 9, 50 / 9, 50 / 9, 50],\n rotation: 90,\n text: [\"8-9\", \"7-8\", \"6-7\", \"5-6\", \"4-5\", \"3-4\", \"2-3\", \"1-2\", \"0-1\", \"\"],\n textinfo: \"text\",\n textposition: \"inside\",\n \n marker: {\n colors: [\n \"#85b788\",\n \"#8bbf8f\",\n \"#8dc386\",\n \"#b7cf90\",\n \"#d5e79a\",\n \"#e5e9b0\",\n \"#eae8ca\",\n \"#f5f2e5\",\n \"#f9f3ec\",\n \"#ffffff\"\n ]\n \n },\n labels: [\"8-9\", \"7-8\", \"6-7\", \"5-6\", \"4-5\", \"3-4\", \"2-3\", \"1-2\", \"0-1\", \"\"],\n hoverinfo: \"label\",\n hole: 0.5,\n type: \"pie\",\n showlegend: false\n }\n ];\n\n var layout = {\n shapes: [\n {\n type: \"path\",\n path: path,\n fillcolor: \"#f2096b\",\n line: {\n color: \"#f2096b\"\n }\n }\n ],\n title: \"<b>Belly Button Washing Frequency</b> <br> Scrubs per Week\",\n height: 500,\n width: 500,\n xaxis: {\n zeroline: false,\n showticklabels: false,\n showgrid: false,\n range: [-1,1]\n },\n yaxis: {\n zeroline: false,\n showticklabels: false,\n showgrid: false,\n range: [-1, 1]\n }\n };\n\n Plotly.newPlot(\"gauge\", data, layout);\n}", "function onR3Changed() {\n var val_str = document.getElementById(\"r3\").value;\n var val_good = check_unit( val_str, \"ohm\", \"r3\" );\n if (val_good) {\n setR3( math.unit( document.getElementById(\"r3\").value ).value ); \n } else {\n document.getElementById(\"r3\").value = math.unit(loop_filter.r3,\"ohm\").format(3);\n return;\n }\n\n simulatePll();\n\n}", "function disableFreq() {\r\n $('#kmfreq').html(g_search_info_level2.kmfreq);\r\n var index = _kmfreq.indexOf(parseFloat($('#kmfreq').html()));\r\n if (index <= _kmfreq.indexOf(_rangefix)) {\r\n $('#kmfreq').prev().addClass('disabled');\r\n $('#kmfreq').html(_rangefix);\r\n g_search_info_level2.kmfreq = _rangefix;\r\n } else $('#kmfreq').prev().removeClass('disabled');\r\n if (index == _kmfreq.length - 1) $('#kmfreq').next().addClass('disabled');\r\n else $('#kmfreq').next().removeClass('disabled');\r\n }", "function getRangeofLonLat(lon, lat, kilometer){\n console.log(kilometer/110.574)\n var constant = kilometer/110.574;\n\n if(lon > 0){\n var minLongitude = lon + kilometer/(111.320*Math.cos((lat + constant)* (Math.PI/180)))\n var maxLongitude = lon - kilometer/(111.320*Math.cos((lat - constant)* (Math.PI/180)))\n }else{\n var minLongitude = lon - kilometer/(111.320*Math.cos((lat - constant)* (Math.PI/180)))\n var maxLongitude = lon + kilometer/(111.320*Math.cos((lat + constant)* (Math.PI/180)))\n }\n\n if(lat < 0){\n var minLatitude = lat + constant\n var maxLatitude = lat - constant\n }else{\n var minLatitude = lat - constant\n var maxLatitude = lat + constant\n }\n\n return {minLatitude: minLatitude,\n maxLatitude: maxLatitude,\n minLongitude: minLongitude,\n maxLongitude: maxLongitude\n}\n}", "function freq(slideValue) {\n var sliderDiv = document.getElementById(\"freq\");\n sliderDiv.innerHTML = slideValue + \" mHz\";\n f = slideValue;\n f = f*Math.pow(10, 6);\n // console.log(typeof(f));\n // document.getElementById(\"ans\").innerHTML = out.toFixed(3) + \"V\";\n}", "function init() {\n var t = Math.abs(this.lat0);\n if (Math.abs(t - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]) < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n this.mode = this.lat0 < 0 ? this.S_POLE : this.N_POLE;\n }\n else if (Math.abs(t) < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n this.mode = this.EQUIT;\n }\n else {\n this.mode = this.OBLIQ;\n }\n if (this.es > 0) {\n var sinphi;\n\n this.qp = Object(_common_qsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e, 1);\n this.mmf = 0.5 / (1 - this.es);\n this.apa = authset(this.es);\n switch (this.mode) {\n case this.N_POLE:\n this.dd = 1;\n break;\n case this.S_POLE:\n this.dd = 1;\n break;\n case this.EQUIT:\n this.rq = Math.sqrt(0.5 * this.qp);\n this.dd = 1 / this.rq;\n this.xmf = 1;\n this.ymf = 0.5 * this.qp;\n break;\n case this.OBLIQ:\n this.rq = Math.sqrt(0.5 * this.qp);\n sinphi = Math.sin(this.lat0);\n this.sinb1 = Object(_common_qsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e, sinphi) / this.qp;\n this.cosb1 = Math.sqrt(1 - this.sinb1 * this.sinb1);\n this.dd = Math.cos(this.lat0) / (Math.sqrt(1 - this.es * sinphi * sinphi) * this.rq * this.cosb1);\n this.ymf = (this.xmf = this.rq) / this.dd;\n this.xmf *= this.dd;\n break;\n }\n }\n else {\n if (this.mode === this.OBLIQ) {\n this.sinph0 = Math.sin(this.lat0);\n this.cosph0 = Math.cos(this.lat0);\n }\n }\n}", "function SfxrParams() {\n //--------------------------------------------------------------------------\n //\n // Settings String Methods\n //\n //--------------------------------------------------------------------------\n\n /**\n * Parses a settings array into the parameters\n * @param array Array of the settings values, where elements 0 - 23 are\n * a: waveType\n * b: attackTime\n * c: sustainTime\n * d: sustainPunch\n * e: decayTime\n * f: startFrequency\n * g: minFrequency\n * h: slide\n * i: deltaSlide\n * j: vibratoDepth\n * k: vibratoSpeed\n * l: changeAmount\n * m: changeSpeed\n * n: squareDuty\n * o: dutySweep\n * p: repeatSpeed\n * q: phaserOffset\n * r: phaserSweep\n * s: lpFilterCutoff\n * t: lpFilterCutoffSweep\n * u: lpFilterResonance\n * v: hpFilterCutoff\n * w: hpFilterCutoffSweep\n * x: masterVolume\n * @return If the string successfully parsed\n */\n this.setSettings = function(values)\n {\n for ( var i = 0; i < 24; i++ )\n {\n this[String.fromCharCode( 97 + i )] = values[i] || 0;\n }\n\n // I moved this here from the reset(true) function\n if (this['c'] < .01) {\n this['c'] = .01;\n }\n\n var totalTime = this['b'] + this['c'] + this['e'];\n if (totalTime < .18) {\n var multiplier = .18 / totalTime;\n this['b'] *= multiplier;\n this['c'] *= multiplier;\n this['e'] *= multiplier;\n }\n }\n}", "getFrequencyResponse(len = 128) {\n const freqValues = new Float32Array(len);\n for (let i = 0; i < len; i++) {\n const norm = Math.pow(i / len, 2);\n const freq = norm * (20000 - 20) + 20;\n freqValues[i] = freq;\n }\n const magValues = new Float32Array(len);\n const phaseValues = new Float32Array(len);\n this._filter.getFrequencyResponse(freqValues, magValues, phaseValues);\n return magValues;\n }", "function buildGauge(wfreq) {\n console.log(wfreq);\n // Enter the washing frequency between 0 and 180\n var level = parseFloat(wfreq)/5;\n \n // Trig to calc meter point\n var degrees = 180 - level;\n var radius = 0.5;\n var radians = (degrees * Math.PI) / 180;\n var x = radius * Math.cos(radians);\n var y = radius * Math.sin(radians);\n console.log(degrees);\n // Path: may have to change to create a better triangle\n var mainPath = \"M -.0 -0.05 L .0 0.05 L \";\n var pathX = String(x);\n var space = \" \";\n var pathY = String(y);\n var pathEnd = \" Z\";\n var path = mainPath.concat(pathX, space, pathY, pathEnd);\n \n var data = [\n {\n type: \"scatter\",\n x: [0],\n y: [0],\n marker: { size: 12, color: \"850000\" },\n showlegend: false,\n name: \"Calories\",\n text: level*5,\n hoverinfo: \"text+name\"\n },\n {\n values: [50 / 9, 50 / 9, 50 / 9, 50 / 9, 50 / 9, 50 / 9, 50 / 9, 50 / 9, 50 / 9, 50],\n rotation: 90,\n text: [\"800-900\", \"700-800\", \"600-700\", \"500-600\", \"400-500\", \"300-400\", \"200-300\", \"100-200\", \"0-100\", \"\"],\n textinfo: \"text\",\n textposition: \"inside\",\n marker: {\n colors: [\n \"rgba(160, 50, 50, .5)\",\n \"rgba(170, 70, 70, .5)\",\n \"rgba(180, 90, 90, .5)\",\n \"rgba(190, 110, 110, .5)\",\n \"rgba(200, 130, 130, .5)\",\n \"rgba(210, 150, 150, .5)\",\n \"rgba(220, 170, 170, .5)\",\n \"rgba(230, 195, 195, .5)\",\n \"rgba(240, 210, 210, .5)\",\n \"rgba(255, 255, 255, 0)\"\n ]\n },\n labels: [\"800-900\", \"700-800\", \"600-700\", \"500-600\", \"400-500\", \"300-400\", \"200-300\", \"100-200\", \"0-100\", \"\"],\n hoverinfo: \"label\",\n hole: 0.5,\n type: \"pie\",\n showlegend: false\n }\n ];\n \n var layout = {\n shapes: [\n {\n type: \"path\",\n startAngle:(-90 * (Math.PI/180)),\n endAngle:(90 * (Math.PI/180)),\n path: path,\n fillcolor: \"850000\",\n line: {\n color: \"850000\"\n }\n }\n ],\n title: \"<b>Calories</b> <br> Per 100 gram\",\n height: 500,\n width: 500,\n xaxis: {\n zeroline: false,\n showticklabels: false,\n showgrid: false,\n range: [-1, 1]\n },\n yaxis: {\n zeroline: false,\n showticklabels: false,\n showgrid: false,\n range: [-1, 1]\n }\n };\n \n var GAUGE = document.getElementById(\"bubble2\");\n Plotly.newPlot(GAUGE, data, layout);\n }", "Fsv(){\n if(this.Fyv == 60){\n return 32000\n }\n else{\n return 20000\n }\n }", "function createFrequencies(deviation, startfreq, stopfreq, mode) {\n // adder for \"arithmetic\" series in logarithmic frequency sequence (mode = 1)\n var adder = (10-1)/deviation;\n // multiplier for \"geometric\" series in logarithmic frequency sequence (mode = 0)\n var multiplr = Math.pow(10,(1/deviation));\n\n // calculate the exponent for the calculation stop frequency\n var k = 0;\n while (Math.pow(10,k) < stopfreq) {\n k = k + 1;\n }\n\n // X = array for frequency values\n var X = [];\n // f = frequency variable for generating a sequence of analysis frequencies\n var f = startfreq;\n var z = f;\n\n // create an array X[] of analysis frequency points \n for (j = 0; j <= k; j++) {\n var limit = Math.pow(10,(j+1)) - adder;\n var increment = adder*Math.pow(10,j);\n while (f <= limit && f <= stopfreq) {\n X.push(z);\n if (mode > 0) {\n f += increment;\n z = f;\n } else {\n f *= multiplr;\n z = Math.round(100000*f)/100000;\n }\n }\n }\n X.push(z);\n return X;\n}", "function getFrequency(value) {\n if (_context2.default.isFake) {\n return 0;\n }\n // get frequency by passing number from 0 to 1\n // Clamp the frequency between the minimum value (40 Hz) and half of the\n // sampling rate.\n var minValue = 40;\n var maxValue = _context2.default.sampleRate / 2;\n // Logarithm (base 2) to compute how many octaves fall in the range.\n var numberOfOctaves = Math.log(maxValue / minValue) / Math.LN2;\n // Compute a multiplier from 0 to 1 based on an exponential scale.\n var multiplier = Math.pow(2, numberOfOctaves * (value - 1.0));\n // Get back to the frequency value between min and max.\n return maxValue * multiplier;\n}", "function setParams() {\r\n \r\n for(Entry<String,Double> e : body.metabolicParameters.get(body.bodyState.state).get(BodyOrgan.BRAIN.value).entrySet()) {\r\n switch (e.getKey()) {\r\n case \"glucoseOxidized_\" : { glucoseOxidized_ = e.getValue(); break; }\r\n case \"glucoseToAlanine_\" : { glucoseToAlanine_ = e.getValue(); break; }\r\n case \"bAAToGlutamine_\" : { bAAToGlutamine_ = e.getValue(); break; }\r\n }\r\n }\r\n //System.out.println(\"glucoseOxidized: \" + glucoseOxidized_);\r\n }", "function realR(R)\n{\n\n\t//E96 1% Resistors\n\tif(led.RRES.value == \"0\")\n\t\tRstListStr = \"0,1.0,1.1,1.2,1.3,1.5,1.6,1.8,2.0,2.2,2.4,2.7,3.0,3.3,3.6,3.9,4.3,4.7,5.1,5.6,6.2,6.8,7.5,8.2,9.1,10.0\";\n\telse if (led.RRES.value == \"1\")\n\t\tRstListStr = \"0,1.00,1.02,1.05,1.07,1.10,1.13,1.15,1.18,1.21,1.24,1.27,1.30,1.33,1.37,1.40,1.43,1.47,1.50,1.54,1.58,1.62,1.65,1.69,1.74,1.78,1.82,1.87,1.91,1.96,2.00,2.05,2.10,2.15,2.21,2.26,2.32,2.37,2.43,2.49,2.55,2.61,2.67,2.74,2.80,2.87,2.94,3.01,3.09,3.16,3.24,3.32,3.40,3.48,3.57,3.65,3.74,3.83,3.92,4.02,4.12,4.22,4.32,4.42,4.53,4.64,4.75,4.87,4.99,5.11,5.23,5.36,5.49,5.62,5.76,5.90,6.04,6.19,6.34,6.49,6.65,6.81,6.98,7.15,7.32,7.50,7.68,7.87,8.06,8.25,8.45,8.66,8.87,9.09,9.31,9.53,9.76,10.00\";\n\n\tRstList = RstListStr.split(\",\");\n\n\tfor(j=0;j<=6;j++){\n\t\tTs = Math.pow(10,j);\n\t\tfor(i=1; i<(RstList.length-1);i++){\n\t\t\tRstDownRange = (parseFloat(RstList[i-1])+parseFloat(RstList[i]))*Ts / 2;\n\t\t\tRstUpRange = (parseFloat(RstList[i+1])+parseFloat(RstList[i]))*Ts / 2;\n\n\t\t\tif( (R > RstDownRange) && (R <= RstUpRange) ){\n\t\t\t\treturn parseFloat(RstList[i])*Ts;\n\t\t}\n\t}\n\n}\n\n\t//should never here..\n\treturn R;\n\n}", "function getRadius(value){\n return value*45000\n }", "getOsc2Freq() {\n var semitones = this.audioData.keys[0] + this.knobOsc2Val;\n return this.getFrequency(semitones) + this.getOsc1Freq();\n }", "function radius_detection(mag){\n r = mag*20000;\n return r;\n }", "constructor(direction, amplitude, frequency){\n super();\n\n this.direction = direction;\n this.amplitude = amplitude;\n this.frequency = frequency;\n }", "function calcPeriod(obj) {\n \tconst GM = 398600.4418;\n \tconst earthRadius = 6367.4447;\n \tconst altitude = obj.avgAlt;\n \tdelete obj.avgAlt;\n \t\n \t// semi-major axis\n \tlet a = altitude + earthRadius;\n \t\n \t// formula for an orbital period\n \tobj.orbitalPeriod = Math.sqrt(Math.pow(a, 3) / GM) * 2 * Math.PI;\n \t\n \t//console.log(Math.round(obj.orbitalPeriod));\n \tobj.orbitalPeriod = Math.round(obj.orbitalPeriod);\n \t\n \treturn obj;\n }", "function setFrequency(val)\r\n{\r\n\tfrequency = val;\r\n}", "function init$d() {\n var t = Math.abs(this.lat0);\n if (Math.abs(t - HALF_PI) < EPSLN) {\n this.mode = this.lat0 < 0 ? this.S_POLE : this.N_POLE;\n }\n else if (Math.abs(t) < EPSLN) {\n this.mode = this.EQUIT;\n }\n else {\n this.mode = this.OBLIQ;\n }\n if (this.es > 0) {\n var sinphi;\n\n this.qp = qsfnz(this.e, 1);\n this.mmf = 0.5 / (1 - this.es);\n this.apa = authset(this.es);\n switch (this.mode) {\n case this.N_POLE:\n this.dd = 1;\n break;\n case this.S_POLE:\n this.dd = 1;\n break;\n case this.EQUIT:\n this.rq = Math.sqrt(0.5 * this.qp);\n this.dd = 1 / this.rq;\n this.xmf = 1;\n this.ymf = 0.5 * this.qp;\n break;\n case this.OBLIQ:\n this.rq = Math.sqrt(0.5 * this.qp);\n sinphi = Math.sin(this.lat0);\n this.sinb1 = qsfnz(this.e, sinphi) / this.qp;\n this.cosb1 = Math.sqrt(1 - this.sinb1 * this.sinb1);\n this.dd = Math.cos(this.lat0) / (Math.sqrt(1 - this.es * sinphi * sinphi) * this.rq * this.cosb1);\n this.ymf = (this.xmf = this.rq) / this.dd;\n this.xmf *= this.dd;\n break;\n }\n }\n else {\n if (this.mode === this.OBLIQ) {\n this.sinph0 = Math.sin(this.lat0);\n this.cosph0 = Math.cos(this.lat0);\n }\n }\n}", "function guageChart(selectedID) {\n d3.json(dataFile).then(function (dataSample) {\n var dataObj = dataSample.metadata.filter(data => data.id.toString() === selectedID)[0];\n console.log(\"----- Guage -------\")\n console.log(dataObj);\n console.log(\"----- freq -------\")\n var wfreq = dataObj.wfreq;\n console.log(`wfreq: ${wfreq}`);\n console.log(\"-------------------\") \n\n // Set the attributes for the gauge needle\n var traceN = {\n type: 'scatter',\n x: [0], y:[0],\n marker: {size: 30, color:'850000'},\n showlegend: false,\n name: 'Frequency',\n hoverinfo: 'text+name'\n };\n\n // Set the attributes for the nine sections for the gauge\n var traceD = {\n type: \"pie\", \n showlegend: false,\n hole: 0.6,\n rotation: 90,\n values:[180/9, 180/9, 180/9, 180/9, 180/9, 180/9, 180/9, 180/9, 180/9, 180],\n text: [\"0-1\", \"1-2\", \"2-3\", \"3-4\", \"4-5\", \"5-6\", \"6-7\", \"7-8\", \"8-9\", \"\"],\n direction: \"clockwise\",\n textinfo: \"text\",\n textposition: \"inside\",\n hoverinfo: \"label\",\n marker: {\n colors: [\"rgba(220, 20, 20, 0.6)\", \"rgba(255, 165, 0, 0.6)\", \"rgba(255, 255, 0, 0.6)\", \n \"rgba(144, 238, 144, 0.6)\", \"rgba(154, 55, 180, 0.6)\",\"rgba(154, 90, 120, 0.6)\", \n \"rgba(4, 215, 120, 0.6)\", \"rgba(94, 225, 90, 0.6)\", \"rgba(24, 225, 5, 0.6)\", \"white\"]\n },\n };\n var freq = parseInt(wfreq);\n console.log(`'freq : ${wfreq}`)\n\n var degrees = 9-freq, radius = .5;\n var radians = degrees * Math.PI / 10;\n var x = radius * Math.cos(radians);\n var y = radius * Math.sin(radians);\n\n console.log(`degrees: ${degrees}`);\n console.log(`radians: ${radians}`);\n console.log(`x: ${x}`);\n console.log(`y: ${y}`);\n\n // var path = path = (degrees < 45 || degrees > 135) ? 'M -0.0 -0.025 L 0.0 0.025 L `X` `Y` Z' : 'M -0.025 -0.0 L 0.025 0.0 L `X` `Y` Z'\n // var path1 = (degrees < 45 || degrees > 135) ? 'M -0.0 -0.025 L 0.0 0.025 L ' : 'M -0.025 -0.0 L 0.025 0.0 L ';\n // Path: may have to change to create a better triangle\n var mainPath = \"M -0.0 -0.025 L 0.0 0.025 L \" // path1, \n // var mainPath = path1,\n pathX = String(x), \n space = ' ',\n pathY = String(y),\n pathEnd = ' Z';\n var path = mainPath.concat(pathX,space,pathY,pathEnd);\n\n console.log(`path: ${path}`);\n\n // Trig to calc meter point\n var layout = {\n height : 550,\n width: 550,\n shapes:[{\n type: 'path',\n path: path,\n fillcolor: '850000',\n line: {\n color: '850000',\n width: 8\n }\n }],\n title: `<b> Belly Button Washing Frequency </b> <br> Scrubs per week`,\n xaxis: {zeroline:false, showticklabels:false, showgrid: false, range: [-1, 1]},\n yaxis: {zeroline:false, showticklabels:false, showgrid: false, range: [-1, 1]}\n };\n\n // Define the data for the plot\n var data = [traceN, traceD];\n Plotly.newPlot(\"gauge\", data, layout);\n });\n}", "static normalizeKilo(param) {\n return this.normalizeMeas(param) + ' kg';\n }", "function te(b){this.radius=b}", "function getFrequency(value) {\n if (context.isFake) {\n return 0;\n }\n // get frequency by passing number from 0 to 1\n // Clamp the frequency between the minimum value (40 Hz) and half of the\n // sampling rate.\n const minValue = 40;\n const maxValue = context.sampleRate / 2;\n // Logarithm (base 2) to compute how many octaves fall in the range.\n const numberOfOctaves = Math.log(maxValue / minValue) / Math.LN2;\n // Compute a multiplier from 0 to 1 based on an exponential scale.\n const multiplier = Math.pow(2, numberOfOctaves * (value - 1.0));\n // Get back to the frequency value between min and max.\n return maxValue * multiplier;\n}", "windChill(temp, vol)\n{\n if (temp <= 50 && vol > 3 && vol < 120) \n {\n var w = 35.74 + 0.6215 * temp + (0.4275 * temp - 35.75) * Math.pow(vol, 0.16);//calculate.\n console.log(\"Windchill for temperature \" + temp + \" and wind speed \" + vol + \" is \" + w);\n } \n else \n {\n console.log(\"Wrong temperature or wind speed\");\n }\n}", "Fv(){\n return this.shearReinf ? Math.min(3*Math.pow(this.fm,0.5),150) : Math.min(Math.pow(this.fm,0.5),50)\n }", "function mtof(input) {\n const frequencyOfC0 = 8.17579891564;\n return frequencyOfC0 * Math.pow(SEMITONE_RATIO_IN_12_EDO, parseInt(input));\n}", "function priceParam () {\n if (flightSearchParams[5] === 1000 || flightSearchParams[5] === '1000') { return 'Up to ₹1000 per person' }\n else if (flightSearchParams[5] === '800') { return 'Up to ₹800 per person' }\n else if (flightSearchParams[5] === '600') { return 'Up to ₹600 per person' }\n else if (flightSearchParams[5] === '400') { return 'Up to ₹400 per person' }\n else { return 'Up to ₹200 per person' }\n }", "function init() {\n //double temp; /* temporary variable */\n\n /* Place parameters in static storage for common use\n -------------------------------------------------*/\n this.sin_p14 = Math.sin(this.lat0);\n this.cos_p14 = Math.cos(this.lat0);\n}", "function freq2bark(freq) {\n /* input: freq in hz output: barks */\n if (freq < 0)\n freq = 0;\n freq = freq * 0.001;\n return 13.0 * Math.atan(.76 * freq) + 3.5\n * Math.atan(freq * freq / (7.5 * 7.5));\n }", "function freq2bark(freq) {\n /* input: freq in hz output: barks */\n if (freq < 0)\n freq = 0;\n freq = freq * 0.001;\n return 13.0 * Math.atan(.76 * freq) + 3.5\n * Math.atan(freq * freq / (7.5 * 7.5));\n }", "function ub(a){this.radius=a}", "function ub(a){this.radius=a}", "calculateFrequency(x, y) {\n let noteValue = this.calculateNote(x);\n let volumeValue = this.calculateVolume(y);\n this.oscillator.frequency.value = noteValue;\n this.gainNode.gain.value = volumeValue;\n }", "function constructMelFilterBank(fftSize, nFilters, lowF, highF, sr) {\n var bins = [],\n fq = [],\n filters = [];\n \n var lowM = hzToMels(lowF),\n highM = hzToMels(highF),\n deltaM = (highM - lowM) / (nFilters+1);\n \n // Construct equidistant Mel values between lowM and highM.\n for (var i = 0; i < nFilters; i++) {\n // Get the Mel value and convert back to frequency.\n // e.g. 200 hz <=> 401.25 Mel\n fq[i] = melsToHz(lowM + (i * deltaM));\n \n // Round the frequency we derived from the Mel-scale to the nearest actual FFT bin that we have.\n // For example, in a 64 sample FFT for 8khz audio we have 32 bins from 0-8khz evenly spaced.\n bins[i] = Math.floor((fftSize+1) * fq[i] / (sr/2));\n }\n \n // Construct one cone filter per bin.\n // Filters end up looking similar to [... 0, 0, 0.33, 0.66, 1.0, 0.66, 0.33, 0, 0...]\n for (var i = 0; i < bins.length; i++)\n {\n filters[i] = [];\n var filterRange = (i != bins.length-1) ? bins[i+1] - bins[i] : bins[i] - bins[i-1];\n filters[i].filterRange = filterRange;\n for (var f = 0; f < fftSize; f++) {\n // Right, outside of cone\n if (f > bins[i] + filterRange) filters[i][f] = 0.0;\n // Right edge of cone\n else if (f > bins[i]) filters[i][f] = 1.0 - ((f - bins[i]) / filterRange);\n // Peak of cone\n else if (f == bins[i]) filters[i][f] = 1.0;\n // Left edge of cone\n else if (f >= bins[i] - filterRange) filters[i][f] = 1.0 - (bins[i] - f) / filterRange;\n // Left, outside of cone\n else filters[i][f] = 0.0;\n }\n }\n \n // Store for debugging.\n filters.bins = bins;\n \n // Here we actually apply the filters one by one. Then we add up the results of each applied filter\n // to get the estimated power contained within that Mel-scale bin.\n //\n // First argument is expected to be the result of the frequencies passed to the powerSpectrum\n // method.\n return filters;\n }" ]
[ "0.6157781", "0.5879051", "0.57531595", "0.5646891", "0.5584785", "0.5546938", "0.5502213", "0.5456374", "0.54341197", "0.5429051", "0.5425801", "0.5417713", "0.54076415", "0.5388575", "0.53035706", "0.5292342", "0.5277931", "0.5267409", "0.5265492", "0.52610594", "0.52610594", "0.5257201", "0.523543", "0.5230142", "0.5214396", "0.52143025", "0.52060926", "0.5174074", "0.5170401", "0.5168022", "0.51573384", "0.51551425", "0.5150581", "0.5138605", "0.5132411", "0.5132099", "0.5128993", "0.5124516", "0.5124449", "0.51240593", "0.512243", "0.5116721", "0.5116721", "0.5115151", "0.5115151", "0.5109851", "0.51085156", "0.50993407", "0.50920236", "0.50873744", "0.5081529", "0.5078426", "0.50763994", "0.50754964", "0.50734377", "0.50613564", "0.5043584", "0.5038743", "0.50368226", "0.50361127", "0.5021924", "0.5019685", "0.5019275", "0.5000963", "0.49979654", "0.49931937", "0.49872124", "0.4986941", "0.49799803", "0.49798137", "0.49774086", "0.4976967", "0.4975268", "0.4965259", "0.49608696", "0.49532834", "0.49424478", "0.49416414", "0.49311504", "0.49275717", "0.49269757", "0.4919991", "0.49199608", "0.49195793", "0.4919085", "0.49165618", "0.4914735", "0.4912095", "0.49091128", "0.4908855", "0.49067983", "0.49061608", "0.4904453", "0.4902116", "0.4898372", "0.4898372", "0.48982924", "0.48982924", "0.4896569", "0.4895798" ]
0.57203805
3
set the speed at which the cloud mesh rotates to give the illusions
function setWindSpeed(weather : int){ //create an array of weather types from the config script var weatherTypes = config.getListOfWeatherTypes(); //loop through the array and compare each value to the weather code (wCode) //returned from the config, if it matches assign the value to xSpeed for(var i = 0; i < weatherTypes.length; i++){ if(weatherTypes[i].weatherIndex == weather){ xSpeed = weatherTypes[i].windSpeed; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function speedUpdate() {\n\tvar r = this.rotation;\n\tif (r < 0) {\n\t\tspeed = 1+(r/150);\n\t} else {\n\t\tspeed = (r/25)+1;\n\t} \n\ttl.timeScale(speed.toFixed(2));\n}", "setSpeed(speed) {\r\n this.lottieAnimation.setSpeed(speed);\r\n }", "setSpeed(speed) {\n this.speed = speed;\n }", "function setSpeed(speed){\n for (m in motors){\n ms.setMotorSpeed(motors[m], speed);\n }\n //currentSpeed = speed;\n console.log(\"Speed set to\" + speed);\n }", "accelerate(){\n this.speed += 10;\n }", "setSimulationSpeed(speed) {\n this.speed = speed;\n }", "function setSpeed(\r\n speed_)\r\n {\r\n speed = speed_;\r\n }", "function turboSpeed() {\r\n\t \tdelta = 500;\r\n\t}", "setSpeed(value) {\n\t\tthis.moveSpeed = value;\n\t\tthis.speed = Math.round((6.66666666667 * GAME_SPEED) / this.moveSpeed);\n\t}", "function handleRotorSpeed(newValue)\n{\n rot = newValue;\n r = rot * 0.8;\t\n PIErender();\n}", "function _setAirSpeed(speed){\n\n var deg = 0;\n\n if (speed >= 0 && speed < 40) deg = speed * 0.9;\n if (speed >= 40 && speed <= 160) deg = speed * 1.8 - 36;\n if (speed > 70 && speed <= 160) deg = speed * 2 - 50;\n if (speed > 160) deg = speed + 110;\n if (speed > 200) deg = 311 + (speed % 2);\n\n placeholder.each(function(){\n $(this).find('div.instrument.airspeed div.airspeed')\n .css('transform', 'rotate(' + deg + 'deg)');\n \n }); \n\n }", "updateSpeed (speed) {\n this.speed = speed;\n }", "function set_speed() {\r\n frameRate(speed_box.value * 1);\r\n}", "function resetSpeed() {\n stepDelay = DEFAULT_DELAY;\n }", "function setSpeed(newSpeed) {\n\tnewSpeed = Math.max(newSpeed, 1);\n\tnewSpeed = Math.min(newSpeed, 999);\n\t\t\n\tspeed = newSpeed;\t\n}", "function _setTrueAirSpeed(speed){\n // Make me work!\n }", "static set acceleration(value) {}", "function setSpeed(speed) {\n if (globals.speed == null) {\n globals.speed = 0;\n }\n globals.speed = speed;\n}", "addSpeed(speedChange) {\n this.velocity.setMag(Math.max(0, this.velocity.mag() + speedChange));\n }", "function setSpeed(cameraHitbox,pressed,theta) {\n var speed = [0,0,0];\n if (pressed.w) {\n speed[0] += Math.sin(theta);\n speed[2] += Math.cos(theta);\n }\n\n if (pressed.s) {\n speed[0]+=-Math.sin(theta);\n speed[2]+=-Math.cos(theta);\n }\n\n if (pressed.a) {\n speed[0]+=Math.sin(theta+Math.PI/2);\n speed[2]+=Math.cos(theta+Math.PI/2);\n }\n\n if (pressed.d) {\n speed[0]+= Math.sin(theta-Math.PI/2);\n speed[2]+= Math.cos(theta-Math.PI/2);\n }\n\n if (pressed.jump) {\n if (Math.abs(cameraHitbox.getLinearVelocity().y) < 0.1) {\n speed[1]+=100;\n }\n }\n \n var norm = normalizePlane(speed);\n cameraHitbox.setLinearVelocity(new THREE.Vector3(\n 100*speed[0]/norm,\n speed[1] + cameraHitbox.getLinearVelocity().y,\n 100*speed[2]/norm\n ));\n}", "ChangeAlcaideSpeed(slow){\n this.alcaide.ChangeSpeed(slow);\n }", "setVelocity(direction, speed) {\n this.velocity = direction.normalize().mult(speed);\n this.speed = speed >= this.maxSpeed ? this.maxSpeed : speed;\n }", "faster(){\n if(this.body.angularVelocity <= 800){\n this.body.angularVelocity += 200;\n }\n this.setVelocityX(this.body.velocity.x + 40);\n this.setVelocityY(this.body.velocity.y - 40);\n }", "function setSpeed(speed) {\n ANIMATION_DUR = speed[0]\n CYCLE_DUR = speed[1]\n $(\"#speedText\").text(speed[2])\n EASING = speed[3]\n clearInterval(ANIMATE_INTERVAL)\n ANIMATE_INTERVAL = setInterval(\"animate()\", CYCLE_DUR)\n}", "accelerate(amount) {\n\t\tthis.speed += amount;\n\t}", "accelerate(amount) {\n\t\tthis.speed += amount;\n\t}", "constructor() {\n this.speed = 0;\n }", "accelerate(n) {\n this.gravity = n;\n }", "set targetSpeed(targetSpeed) {\n this._targetSpeed = targetSpeed;\n if (targetSpeed === this.speed) {\n this.acceleration = 0;\n }\n else {\n const direction = Math.sign(targetSpeed - this.speed);\n this.acceleration = direction * (targetSpeed === 0 ? MAX_DECEL : MAX_ACCEL);\n }\n }", "set Acceleration(value) {}", "set targetVelocity(value) {}", "function changeSpeed(speed) {\n var newSpeed = videoSpeed + speed;\n setSlider(newSpeed);\n }", "function setSpeed(speed){\r\n if(speed==0&&control==1)\r\n {\r\n clear();\r\n Interval(10);\r\n }\r\n if(speed==1&&control==1)\r\n {\r\n clear();\r\n Interval(5);\r\n }\r\n if(speed==2&&control==1)\r\n {\r\n clear();\r\n Interval(1);\r\n }\r\n}", "function setSpeed(_grow, _shrink) {\r\n speed.grow = _grow;\r\n speed.shrink = _shrink;\r\n }", "function set_speed(s) {\n\tspeed = s;\n}", "function setAnimationSpeedFactor(speed){\n if (speed >= 0.5 && speed <= 2){\n speedFactor = speed;\n }\n // Speed range to be within 0.5 to 2\n // Just a precaution\n else{\n console.log(\"Please set speed within 0.5 and 2\");\n }\n}", "function Update (){\n\ttransform.Rotate(Vector3(0,rotationSpeed * 10,0) * Time.deltaTime);\n}", "function changeSpeed() {\n\t\tcurrentSpeed = getSpeed();\n\t\tif (running) {\n\t\t\tclearInterval(currentInterval);\n\t\t\tcurrentInterval = setInterval(insertFrame, currentSpeed);\n\t\t}\n\t}", "update() {\n this.xsky -= this.speedSky;\n }", "function adjustSpeed(n) {\n\tsetSpeed(speed+n);\n}", "function Update () {\ntransform.Translate(0,eSpeed,0);\n}", "function updateMoleSpeed() {\n moveMoleInt = Math.max(100, Math.floor(moveMoleInt * 0.9));\n clearInterval(moveMoleIntId);\n moveMoleIntId = setInterval(moveMole, moveMoleInt);\n}", "increaseSpeed() {\n\n this.speed = Math.max(this.speed - Snake.SPEED_INCREMENT, Snake.MAX_SPEED);\n\n }", "setRandomSpeed() {\n const rand = Math.random();\n\n this.speed = rand > .5\n ? 1 + (rand / 2) // divide by two just so they don't get too far ahead\n : 1;\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 animate() {\n\t//console.debug(lumiere2.intensity);\n\tsky.rotation.y += 0.00015;\n\tlumiere2.position.y = 100 * Math.sin(suntime);\n\tlumiere2.position.z = 20 * Math.cos(suntime);\n\n\ttry {\n\t\tfor (var i = 0; i < idRotate.length; i++) {\n\t\t\tvar obj = scene.getObjectById(idRotate[i]);\n\t\t\tobj.rotation.y += ObjectRotSpeed;\n\t\t\tobj.position.y += Math.sin(ObjUpcpt += ObjUpDecay) / 500;\n\t\t}\n\t} catch (error) {\n\t\tconsole.log(\"Erreur non critique: Rotation\");\n\t}\n\n\tsuntime += sunspeed;\n\tnewlight();\n\n\tstats.update();\n\trender();\n\trequestAnimationFrame(animate);\n\t//\n\t//console.log(sprite.position);\n\t//\n\n\n}", "accelerate(amount) {\n // It's virtually impossible for this data to be\n // accidentally accessed.\n this.#speed += amount;\n this.#milesDriven += speed;\n }", "update() {\n //W = V / R\n let angular_init = this.ang_velocity;\n\n this.ang_velocity += (this.scene.speedFactor+2*this.scene.bird.speed)/2;\n this.rot_wings = (this.rot_wings + (2*this.ang_velocity * this.change_ang * (this.scene.delta_time/1000))) % Math.PI; \n \n //delta ang = W * delta_time\n if(this.rot_wings < -Math.PI/4){\n this.change_ang = 1;\n }\n\n \n if(this.rot_wings > Math.PI/4) {\n this.change_ang = -1;\n }\n \n this.ang_velocity = angular_init;\n\n }", "setVelocity(v) {\n\t\tif(!this.no_accelerations) {\n\t\t\tvar goal = 0;\n\t\t\tif(v >= 0) {\n\t\t\t\tgoal = Math.min(v, this.max_v)\n\t\t\t} else {\n\t\t\t\tgoal = Math.max(v, -this.max_v);\n\t\t\t}\n\n\t\t\tvar diff = goal - this.v;\n\t\t\tthis.a = diff*this.max_a;\n\t\t} else {\n\t\t\tthis.v = v;\n\t\t\tthis.a = 0;\n\t\t}\n\t\t\n\t}", "function resetSpeed()\n{\n\tMonsterIntervalSpeed = 4000;\n}", "addSpeed(speedChange) {\n this.kinematicQuantity.addSpeed(speedChange);\n }", "function setSpeed() {\n return (Math.random()*(400 - 60)) + 60;\n}", "setSpeed() {\n return Math.floor(Math.random() * 250) + 120;\n }", "rollSpeed() {\n this.xSpeed = Math.random() * (this.maxSpeed * 2) - this.maxSpeed;\n this.ySpeed = Math.random() * (this.maxSpeed * 2) - this.maxSpeed;\n }", "speed(theSpeed) {\n if (theSpeed < -100 || theSpeed > 100) {\n throw \"Speed must be between -100 and 100\"\n }\n this._speed = theSpeed;\n this._applySpeed();\n }", "moveForward() {\n this._currentLinearSpeed = this._linearSpeed;\n this._currentAngularSpeed = 0;\n }", "setSpeedDrop() {\n this.speedDrop = true;\n this.jumpVelocity = 1;\n }", "function setSpeed(speed_data){\r\n\tif(speed_data == 0)\r\n\t\tset_speed = 40;\r\n\telse if(speed_data == 1)\r\n\t\tset_speed = 25;\r\n\telse\r\n\t\tset_speed = 15;\r\n}", "update () {\n let max = this.maxSpeed * this.dt;\n // if (!isNaN(max) && this.steeringForce.length() > 0) {\n this.steeringForce = this.steeringForce.minimizeInPlaceFromFloats(max, max, max); // TODO: convert Three.js clampLength method to BABYLON\n // this.steeringForce.multiplyByFloats(1 / this.mass,1 / this.mass,1 / this.mass); // TODO: convert Three.js divedeScalar method to BABYLON\n /* this.steeringForce = */this.steeringForce/* .clone().normalize() */.scaleInPlace(1 / this.mass); // FIXME: mass > 1 not working\n this.velocity.addInPlace(this.steeringForce);\n this.velocity.y = 0;\n this.steeringForce.setAll(0, 0, 0);\n this.mesh.moveWithCollisions(this.velocity);\n // }\n }", "function moveT(){\n var t = timeStep / 1000;\n this.x += this.xSpeed * timeStep / 1000;\n this.y = this.y + this.ySpeed * timeStep / 1000;\n this.coll();\n}", "stop() {\r\n this.Speed = 0;\r\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 }", "movimientochamp()\n {\n \n if(this.disminuyendoVelocidad && this.speed > -this.limitspeed){\n this.speed -= this.aceleracion; //Disminuye Vel\n this.disminuyendoVelocidad = false;\n }\n\n if(this.aumentandoVelocidad){\n this.speed += this.aceleracion; //Aumenta vel.\n this.aumentandoVelocidad = false;\n }\n this.moverse();\n }", "function changeSpeed() {\n gameSpeed = (gameSpeed % 3) + 1;\n updateSpeedOption();\n}", "get unitAngleSpeed() { return this._unitAngleSpeed; }", "get unitAngleSpeed() { return this._unitAngleSpeed; }", "get unitAngleSpeed() { return this._unitAngleSpeed; }", "function SetSpeed(speed) {\n guiData.cursorSpeed = speed;\n}", "function inc_speed()\n{\n if(speed == speed_normal)\n speed = speed_fast;\t\n}", "function setSpeed() {\n\tvar baseSpeed = 25;\n\tvar raceMod = 0;\n\tif (race !== \"Gnome\" && race !== \"Halfling\" && race !== \"Dwarf\")\n\t\traceMod += 5;\n\tif (subrace + race == \"Wood Elf\")\n\t\traceMod += 5;\n\tspeed = baseSpeed + raceMod;\n\treturn \"Speed: \" + speed;\n}", "function setSpeed(speed) {\n timer = window.setInterval(() => {\n if (!isPaused) {\n if (winOrLose != \"Game Over\") {\n MoveTetrominoDown();\n }\n }\n }, 1000 / speed);\n}", "land() {\n this.velocity += 20; \n }", "function setSpeed() {\n if (isPause) {\n speedFactor = 0;\n return;\n }\n var val = inputSpeed.value;\n speedFactor = Math.pow(2, val);\n}", "function calculateSpeed() {\n var sp = valueWithVariance(script.api.speed);\n var incline = getRandom(0, 2*script.api.sprayAngle); // phi\n var curl = getRandom(0, 2*Math.PI); // theta\n var xzProj = sp*Math.sin(incline);\n return new vec3(xzProj*Math.sin(curl), sp*Math.cos(incline), xzProj*Math.cos(curl))\n}", "stop() {\n this._currentLinearSpeed = 0;\n this._currentAngularSpeed = 0;\n }", "accelerate(amount) {\n\t\tthis.speed += amount;\n\t\tthis.movement = true;\n\t}", "vel() {\n this.y += this.speed;\n }", "update(dt) {\n if (this.x > 480) {\n let min = 1;\n let max = 300;\n this.speed = Math.floor(Math.random() * (+max - +min)) + +min;\n }\n this.x = this.x + this.speed * dt;\n }", "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}", "animate(dSec,vrHelper){\n\n if( this.control ) {\n this.control.animate(dSec,vrHelper);\n }\n\n var limit = 5000.0;\n var min = new BABYLON.Vector3(-limit,-limit,-limit);\n var max = new BABYLON.Vector3(+limit,+limit,+limit);\n this.speedPosition = BABYLON.Vector3.Clamp(this.speedPosition,min,max);\n\n this.root.locallyTranslate(this.speedPosition.scale(dSec)); // relatige to ship OR: this.root.translate(this.speedPosition, 1 , Space.LOCAL); // relatige to ship\n\n this.root.rotate(BABYLON.Axis.Y, this.speedRotation.y*dSec, BABYLON.Space.LOCAL); // not .WORLD\n\n // Does the VR-Helper do the mouse rotation?\n // Is there a way to disable it?\n // We have to UNDO it: Does not work that nice!\n var euler = this.root.rotationQuaternion.toEulerAngles();\n this.root.rotationQuaternion = BABYLON.Quaternion.RotationYawPitchRoll(euler.y, 0, 0);\n\n // NO!: https://doc.babylonjs.com/resources/rotation_conventions#euler-angles-to-quaternions\n // thisroot.rotationQuaternion.addInPlace(BABYLON.Quaternion.RotationYawPitchRoll(speedRotation.y, speedRotation.x, speedRotation.z) );\n\n var cameraOffset = vrHelper.isInVRMode ? this.cameraOffset1 : this.cameraOffset3;\n\n var camPos = new BABYLON.AbstractMesh(\"camPos\");\n camPos.rotationQuaternion = this.root.rotationQuaternion;\n camPos.position = this.root.position.clone();\n camPos.locallyTranslate(cameraOffset);\n setCamera( camPos.position,\n camPos.rotationQuaternion,\n vrHelper );\n\n }", "changeBallSpeed(dx, dy){\n this.setDx(dx);\n this.setDy(dy);\n }", "function easeRotationSpeed( pos ) {\r\n\t\tvar sign = Math.sign(pos);\r\n\t\tpos = Math.min( Math.abs(pos)*3, 1 );\r\n\t\tpos -= 0.1;\r\n\t\tif ( pos < 0 ) pos = 0;\r\n\t\treturn Earth.Animation.Easing['in-quart']( pos ) * sign;\r\n\t}", "setSpeed() {\n const speedChoice = this.getRandom();\n const slow = 3;\n const medium = 6;\n const fast = 9;\n \n if (speedChoice < 4) {\n return slow;\n } else if (speedChoice < 7) {\n return medium;\n } else {\n return fast;\n }\n }", "forwards(speed) {\n if (speed === undefined) {\n this._speed = 100;\n } else {\n if (speed < 0 || speed > 100) {\n throw \"Speed must be between 0 and 100\"\n }\n this._speed = speed;\n }\n this._applySpeed();\n }", "slowDown() {\n this.mag -= 1;\n }", "function calculateRotSpeed() {\n var rsp = script.api.rotation[0].uniformScale(valueWithVariance([1, script.api.rotation[1]]));\n return script.api.rotMirrored ? rsp.mult(new vec3(getRandomSign(), getRandomSign(), getRandomSign())): rsp;\n}", "updateAcceleration() {\n //this.a = [0, -0.2 * gravity, 0];\n this.a = glMatrix.vec3.fromValues(0, -0.2 * gravity, 0);\n }", "function changeSpeed(s) {\n player.speed += s;\n}", "setSpeedCoeff(left, right) {\n this.leftWheel = this.servoStop + (this.servoSpeedSpread * left) * this.leftServoCoeff;\n this.rightWheel = this.servoStop + (this.servoSpeedSpread * right) * this.rightServoCoeff;\n }", "function setSpeed(speed) {\n timer = window.setInterval(() => {\n if (!isPaused) {\n if (winOrLose != \"Game Over\") {\n MoveTetrominoDown();\n }\n }\n }, 1000 / speed);\n}", "static _accelerate(car) { //turns the wheels faster and faster\n return function() {\n console.log(car._speed);\n if(car._speed < 2) {\n //turning the wheel\n car._speed += 0.02;\n car._carBody.animationSpeed = car._speed;\n if(!car._carBody.playing) car._carBody.gotoAndPlay(car._carBody.currentFrame);\n //firing the engine\n car._engine.animationSpeed = (car._speed < 0.6)? car._speed - 0.1 : 0.5\n }\n }\n }", "updateVelocity(time) {\n //acceleration factor to add to update the velocity vector\n var accelFactor = glMatrix.vec3.create();\n glMatrix.vec3.scale(this.v, this.v, Math.pow(this.drag, time));\n glMatrix.vec3.scale(accelFactor, this.a, time);\n glMatrix.vec3.add(this.v, this.v, accelFactor);\n }", "function stopGlobeRotation(){\n setTimeout(function() {\n globe.updateOptions(\n {...options,cameraAutoRotateSpeed: 0}\n )\n }, 1000)\n }", "function Update () {\n\t\n\tif(!manual){\n\t\ttransform.RotateAround( transform.position, Vector3.right, ySpeed * Time.deltaTime );\n\t\ttransform.RotateAround( transform.position, Vector3.up, xSpeed * Time.deltaTime );\n\t\ttransform.RotateAround( transform.position, Vector3.forward, zSpeed * Time.deltaTime );\n\t\tDebug.Log(xSpeed);\n\t}else{\n\t\tif( Input.GetAxis(\"Horizontal\") != 0 ){\n\t\t\ttransform.RotateAround( transform.position, Vector3.up, Input.GetAxis(\"Horizontal\")*xSpeed * Time.deltaTime );\n\t\t}\n\t\t\n\t\tif( Input.GetAxis(\"Vertical\") != 0 ){\n\t\t\ttransform.RotateAround( transform.position, Vector3.right, Input.GetAxis(\"Vertical\")*ySpeed * Time.deltaTime );\n\t\t}\n\t\t\n\t}\n\t\n}", "increaseSpeedFall(){\n\t\t// if(this.breakedLine >= NB_OF_LINES_TO_BREAK_TO_SPEED_UP){\n\t\t// \tthis.speedPoint++;\n\t\t// \tthis.breakedLine-= NB_OF_LINES_TO_BREAK_TO_SPEED_UP;\n\t\t// }\n\n\t\tthis.speedPoint = Math.trunc(this.breakedLine/NB_OF_LINES_TO_BREAK_TO_SPEED_UP);\n\n\t\ttrace(\"SPEED POINT\", this.speedPoint);\n\n\t\t//this.mvc.controller.tick = STARTING_TICK - (this.speedPoint*10);\n\n\t\tthis.mvc.controller.tick = STARTING_TICK * 1/(this.speedPoint + 1);\n\n\t\ttrace(\"this.mvc.controller.tick\", this.mvc.controller.tick);\n\t}", "getSpeed() { return this.speed; }", "function animate() {\r\n var timestep = Date.now() - last_time_update;\r\n console.log(\"Timestep: \", timestep); \r\n \r\n //Update position\r\n var tuning = 20;\r\n for(var i=0; i<num_spheres*3; i++){\r\n if(positionMatrix[i] <= 50 && positionMatrix[i] >= -50){\r\n positionMatrix[i] += velocityMatrix[i]*timestep/tuning;\r\n }\r\n else if(positionMatrix[i] > 50){\r\n velocityMatrix[i] *= -1*cor;\r\n positionMatrix[i] = 50;\r\n }\r\n else{ //positionMatrix[i] < -50\r\n velocityMatrix[i] *= -1*cor;\r\n positionMatrix[i] = -50;\r\n }\r\n }\r\n \r\n //Update velocity\r\n var gravity_constant = -.01;\r\n if(gravity_toggle && drag_toggle){\r\n for(var i=0; i<num_spheres*3; i++){\r\n velocityMatrix[i] *= 1-1/100*timestep/tuning;\r\n if(i%3 == 1){\r\n velocityMatrix[i] += timestep*gravity_constant;\r\n }\r\n }\r\n }\r\n else if(gravity_toggle){\r\n for(var i=0; i<num_spheres*3; i++){\r\n if(i%3 == 1){\r\n velocityMatrix[i] += timestep*gravity_constant;\r\n }\r\n } \r\n }\r\n else if(drag_toggle){\r\n for(var i=0; i<num_spheres*3; i++){\r\n velocityMatrix[i] *= 1-1/100*timestep/tuning;\r\n }\r\n }\r\n \r\n //Update last time used\r\n last_time_update = Date.now();\r\n}", "function recompute_speed() {\n // A good way to make the animation smooth is slow the speed down gradually.\n \n // since you have variables for both duration and MAX_DURATION, you can use\n // these variables to compute the percentage of the animation that is completed.\n // At the begining of the animation this percentage will be 0.\n // At the end the percentage will be 100.\n // You can use this percentage to decrease the annimation smoothly.\n // You can look online for other ideas as well.\n \n}", "function resetVelocity(){\r\n Joey.velocityY += 1\r\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}", "function setScrollingSpeed(value, type){\n setVariableState('scrollingSpeed', value, type);\n }" ]
[ "0.69495416", "0.68622595", "0.6854482", "0.678654", "0.6752351", "0.66771483", "0.66432995", "0.6567167", "0.65196073", "0.6512822", "0.6498465", "0.6483163", "0.6458865", "0.6434865", "0.6420968", "0.6418876", "0.6388937", "0.6385226", "0.63510114", "0.6288792", "0.62805206", "0.6258789", "0.62578255", "0.6256098", "0.62504673", "0.62504673", "0.6245679", "0.6244174", "0.62302184", "0.6215309", "0.62149507", "0.6214238", "0.62082267", "0.61917555", "0.6190894", "0.6184427", "0.6177599", "0.61703885", "0.6169722", "0.6122722", "0.60988456", "0.6090241", "0.6085445", "0.6060939", "0.60519755", "0.6043882", "0.6039359", "0.5964447", "0.59544533", "0.59440446", "0.59347403", "0.5917884", "0.5895465", "0.5893484", "0.5882978", "0.5873448", "0.5868762", "0.58666915", "0.5864299", "0.58614683", "0.5859984", "0.58539414", "0.58445185", "0.5835798", "0.5829094", "0.5829094", "0.5829094", "0.5828162", "0.5823601", "0.58101714", "0.57952166", "0.57941824", "0.57869637", "0.57781065", "0.5777615", "0.5776564", "0.5776266", "0.5771707", "0.57641876", "0.5764128", "0.57626075", "0.5754699", "0.5754593", "0.57477015", "0.572844", "0.57268006", "0.57224065", "0.57112604", "0.5710872", "0.5703495", "0.57026064", "0.57006854", "0.56887573", "0.568194", "0.56799394", "0.5674789", "0.5669262", "0.56690985", "0.5660566", "0.56586426", "0.5658023" ]
0.0
-1
update the rotation of the sky box everyframe based upon the value from config.js
function Update () { if(!manual){ transform.RotateAround( transform.position, Vector3.right, ySpeed * Time.deltaTime ); transform.RotateAround( transform.position, Vector3.up, xSpeed * Time.deltaTime ); transform.RotateAround( transform.position, Vector3.forward, zSpeed * Time.deltaTime ); Debug.Log(xSpeed); }else{ if( Input.GetAxis("Horizontal") != 0 ){ transform.RotateAround( transform.position, Vector3.up, Input.GetAxis("Horizontal")*xSpeed * Time.deltaTime ); } if( Input.GetAxis("Vertical") != 0 ){ transform.RotateAround( transform.position, Vector3.right, Input.GetAxis("Vertical")*ySpeed * Time.deltaTime ); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateForFrame() {\r\n rotatingComponents.rotation.y += rotateSpeed;\r\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 }", "function update() {\n\n let t = obj_ico.material.uniforms.uTime.value;\n\n obj_box.rotation.z = Math.sin ( t ) * 0.3;\n obj_box.rotation.x = Math.sin ( t * 1.1 ) * 0.3;\n obj_box.position.y = 8.0 + ( Math.sin ( t * 0.8 ) * 0.5 + 0.5 ) * 2.0;\n obj_box.position.x = 0.0 + ( Math.sin ( t * 0.6 ) * 0.5 + 0.5 ) * 2.0;\n obj_box.position.z = 0.0 + ( Math.sin ( t * 0.6 ) * 0.5 + 0.5 ) * 2.0;\n\n renderer.render ( scene, camera );\n\n obj_ico.material.uniforms.uTime.value += 0.01;\n\n requestAnimationFrame ( update );\n\n }", "onUpdateRotation() {\n this.wall.setRotationFromEuler(new THREE.Euler().setFromVector3(this.rotation.clone()));\n }", "animate() {\n this.graphics.rotation = this.rotateClockwise\n ? this.graphics.rotation + this.rotateSpeed\n : this.graphics.rotation - this.rotateSpeed\n }", "setRotation(angle){\n this.rotation = angle;\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}", "set wristRotation(value) { this._wristRotation = value; }", "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}", "function update()\n{\n\t//Schedule update call for next frame\n\trequestAnimationFrame(update);\n\n\tbox.rotation.x += 0.01;\n\tbox.rotation.y += 0.008;\n\n\t//Render scene to screen\n\trenderer.render(scene, camera);\n}", "function update() {\r\n\r\n\tthis.loop.rotation += 0.1;\r\n}", "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 }", "update() {\n //W = V / R\n let angular_init = this.ang_velocity;\n\n this.ang_velocity += (this.scene.speedFactor+2*this.scene.bird.speed)/2;\n this.rot_wings = (this.rot_wings + (2*this.ang_velocity * this.change_ang * (this.scene.delta_time/1000))) % Math.PI; \n \n //delta ang = W * delta_time\n if(this.rot_wings < -Math.PI/4){\n this.change_ang = 1;\n }\n\n \n if(this.rot_wings > Math.PI/4) {\n this.change_ang = -1;\n }\n \n this.ang_velocity = angular_init;\n\n }", "get rotation() {\n return this._boxRotation;\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}", "update()\n {\n // adding 2 degrees every frame to the angle of the taijitu logo\n this.logo.angle += 2;\n }", "function gameLoop() {\n stats.update();\n //cube.rotation.y += control.rotationSpeed;\n //sun.rotation.y+=control.rotationSpeed;\n fplanet.rotation.y += control.rotationSpeed * 3;\n moon.rotation.y += (control.rotationSpeed * 2);\n splanet.rotation.y += (control.rotationSpeed * 2);\n //rotation empty Object\n moonEmp.rotation.y += (control.rotationSpeed * 8);\n fistemptyRotation.rotation.y += (control.rotationSpeed);\n secondPlanet.rotation.y += (control.rotationSpeed * 2);\n thirdPlanet.rotation.y += control.rotationSpeed * 4;\n fourthPlanet.rotation.y += (control.rotationSpeed / 2);\n fifthPlanet.rotation.y += (control.rotationSpeed / 5);\n //cameraFollow.rotation.y+=control.rotationSpeed;\n // render using requestAnimationFrame\n requestAnimationFrame(gameLoop);\n // render the scene\n renderer.render(scene, camera);\n}", "setRotation(rotation) {\n this.rotation = rotation\n this.tModelToWorld.setRotation(rotation)\n }", "rotate() {\n\t\tthis.scene.rotate(-Math.PI / 2, 1, 0, 0);\n\t}", "applyRotation() {\n this.forwardFacing[0] = Math.sin(this.xzAngle) * Math.cos(this.yzAngle);\n this.forwardFacing[1] = Math.sin(this.yzAngle);\n this.forwardFacing[2] = Math.cos(this.xzAngle) * Math.cos(this.yzAngle);\n\n this.rightFacing[0] = Math.cos(this.xzAngle);\n this.rightFacing[1] = 0\n this.rightFacing[2] = -Math.sin(this.xzAngle);\n\n this.upFacing[0] = -Math.sin(this.xzAngle) * Math.sin(this.yzAngle);\n this.upFacing[1] = Math.cos(this.yzAngle);\n this.upFacing[2] = -Math.cos(this.xzAngle) * Math.sin(this.yzAngle);\n }", "_updateInitialRotation() {\n this.arNodeRef.getTransformAsync().then((retDict)=>{\n let rotation = retDict.rotation;\n let absX = Math.abs(rotation[0]);\n let absZ = Math.abs(rotation[2]);\n\n let yRotation = (rotation[1]);\n\n // If the X and Z aren't 0, then adjust the y rotation.\n if (absX > 1 && absZ > 1) {\n yRotation = 180 - (yRotation);\n }\n\n this.setState({\n markerRotation: [0,yRotation,0],\n shouldBillboard : false,\n });\n });\n }", "function updateScene() {\n if (canvas != null) {\n fixDpi();\n }\n \n if (animate) {\n objects.forEach(obj => {\n obj.rotation.y += .01\n });\n }\n}", "setRotation(r) {\n // console.log('setrotation', r)\n this.a = Math.cos(r)\n this.b = -Math.sin(r)\n this.d = Math.sin(r)\n this.e = Math.cos(r)\n // console.log(this)\n }", "function gameLoop() {\n stats.update();\n // Define Over Layers Rotation Speed \n sunOver.rotation.x += 0.001;\n sunOver.rotation.z -= 0.001;\n sunOver.rotation.y += 0.005;\n sunFakeGas1.rotation.x -= 0.001;\n sunFakeGas1.rotation.z += 0.001;\n sunFakeGas1.rotation.y -= 0.005;\n sunFakeGas2.rotation.x -= 0.009;\n sunFakeGas2.rotation.z += 0.008;\n sunFakeGas2.rotation.y += 0.006;\n styxOver.rotation.x += 0.002;\n styxOver.rotation.z -= 0.003;\n styxOver.rotation.y += 0.004;\n nikeOver.rotation.x += 0.003;\n nikeOver.rotation.z -= 0.002;\n nikeOver.rotation.y += 0.001;\n kratosOver.rotation.x += 0.004;\n kratosOver.rotation.z -= 0.004;\n kratosOver.rotation.y += 0.002;\n zelosOver.rotation.x += 0.0025;\n zelosOver.rotation.z -= 0.0015;\n zelosOver.rotation.y += 0.0045;\n biaOver.rotation.x += 0.0035;\n biaOver.rotation.z -= 0.0018;\n biaOver.rotation.y += 0.0054;\n alalaOver.rotation.x += 0.0012;\n alalaOver.rotation.z -= 0.0008;\n alalaOver.rotation.y += 0.0024;\n // Define Orbits Y-Rotation Speed \n praxidiceOrbit.rotation.y += 0.05;\n iokeOrbit.rotation.y += 0.07;\n hormesOrbit.rotation.y += 0.08;\n styxOrbit.rotation.y += 0.05;\n nikeOrbit.rotation.y += 0.02;\n kratosOrbit.rotation.y += 0.035;\n zelosOrbit.rotation.y += 0.015;\n biaOrbit.rotation.y += 0.01;\n alalaOrbit.rotation.y += 0.008;\n // Render using RequestAnimationFrame\n requestAnimationFrame(gameLoop);\n // Render the Scene\n renderer.render(scene, camera);\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 }", "get boxRotation() {\n return this._boxRotation;\n }", "function tipsRotationControl() {\n\n for (let i = 0; i < objectsToRotate.length; i++) {\n\n objectsToRotate[i].rotation.x = clock.getElapsedTime() * 2;\n objectsToRotate[i].rotation.y = clock.getElapsedTime() * 4;\n objectsToRotate[i].rotation.z = clock.getElapsedTime() * 8;\n\n }\n\n}", "set rot(value) {\n if (this._rot !== value) {\n const tmp = this.width;\n this.width = this.height;\n this.height = tmp;\n this._rot = value;\n this._dirty++;\n }\n }", "function updateBox( data ) {\n var pitch = Math.PI / 180 * data.pitch;\n var roll = Math.PI / 180 * data.roll;\n var yaw = -Math.PI / 180 * data.yaw;\n box.rotation.set( pitch, roll, yaw );\n\n\n // Experimental - acceleration arrow\n // chipRotation.set(pitch, roll, yaw);\n // accelDirection.set( data.ax, data.ay, data.az ).normalize();\n // accelDirection.set( data.ay, data.ax, data.az )\n // var l = accelDirection.length();\n // accelDirection.sub(chipRotation).normalize();\n // arrow.setDirection( accelDirection );\n // arrow.setLength( l, 0.2 * l, 0.04 * l );\n render();\n }", "set elbowRotation(value) { this._elbowRotation = value; }", "update(){\n\n // --------------------- CALCULATE ROTATION --------------------- //\n\n // get this origin and max displacement values for this frame.\n // currentmotion() allows a slow ramp from one set of values to another\n // when switching motions.\n let thisFrame = this.currentMotion();\n // get this frame's max displacement for each part\n let thighDisplacement = dude.vigor[dude.currentMoves] * thisFrame.thighDisplacement;\n let thighDisplacement2 = dude.vigor[dude.currentMoves] * thisFrame.thighDisplacement2;\n let kneeDisplacement = dude.vigor[dude.currentMoves] * thisFrame.kneeDisplacement;\n // get this frame's angle origin for each part\n // by adding together default origin and current origin\n let thighOrigin = this.thigh.origin + thisFrame.thighOrigin;\n let thighOrigin2 = this.thigh.origin2 + thisFrame.thighOrigin2;\n let kneeOrigin = this.knee.origin + thisFrame.kneeOrigin;\n\n // get current arm position from framecount and this limb's speed\n let currentPosition = radians(frameCount * velocity * this.speed);\n\n // get current angle of each part by mapping arm position to range defined\n // by origin and displacement\n\n // get thigh x-rotate range\n let min1 = thighOrigin - thighDisplacement;\n let max1 = thighOrigin + thighDisplacement;\n // map thigh x-rotate,\n this.thigh.angle = map( sin(currentPosition), -1*this.xflip, this.xflip, min1, max1 );\n\n // get thigh z-rotate range\n let min2 = thighOrigin2 + thighDisplacement2;\n let max2 = thighOrigin2 - thighDisplacement2;\n // map thigh z-rotate\n this.thigh.angle2 = map( cos(currentPosition), -1, 1, min2, max2 );\n\n // get knee x-rotate range\n let min3 = kneeOrigin - kneeDisplacement;\n let max3 = kneeOrigin + kneeDisplacement;\n // map knee x-rotate\n this.knee.angle = map( sin(currentPosition), -1*this.xflip, this.xflip, min3, max3 );\n\n // get the current height value.\n this.currentHeight = thisFrame.height;\n\n // constrain knee angle\n if(this.knee.constraint1!=0){\n this.knee.angle = constrain(\n this.knee.angle,\n this.knee.constraint1, this.knee.constraint2 )\n }\n\n // --------------------- CHECK OVERLAP --------------------- //\n // i'm not using this a whole lot, but this part allows me to trigger\n // events in sync with footstep rate\n // if this limb is a leg (not an arm)\n if(this.flip===-1){\n // check \"feet hit ground\" / leg overlap:\n // get current thigh angle from origin\n let angle = sin(this.thigh.angle-thighOrigin);\n // if thigh angle excedes 0,\n if(angle<0&& !this.legOverlap){\n // mark leg as having overlapped 0\n this.legOverlap = true;\n // change ground fill depending on if left/right leg\n if(this.xflip ===1) dude.groundFill = color(185, 45, 45, 205);\n if(this.xflip ===-1) dude.groundFill = color(45, 185, 45, 205);\n }\n // if thigh angle is less than 0, reset overlap marker.\n if(angle>0 && this.legOverlap){\n this.legOverlap = false;\n }\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 checkCamera(location) {\n\tif (location == '#loc3' || location == '#loc16' || location == '#loc17') {\n\t\tdocument.getElementById('skybox').setAttribute('rotation', '0 185 0');\n\t} else if (location == '#loc4') {\n\t\tdocument.getElementById('skybox').setAttribute('rotation', '0 80 0');\n\t} else if (location == '#loc5') {\n\t\tdocument.getElementById('skybox').setAttribute('rotation', '0 275 0');\n\t} else if (\n\t\tlocation == '#loc9' ||\n\t\tlocation == '#loc13' ||\n\t\tlocation == '#loc14' ||\n\t\tlocation == '#loc15' ||\n\t\tlocation == '#loc25'\n\t) {\n\t\tdocument.getElementById('skybox').setAttribute('rotation', '0 0 0');\n\t} else if (location == '#loc11' || location == '#loc26') {\n\t\tdocument.getElementById('skybox').setAttribute('rotation', '0 90 0');\n\t} else if (location == '#loc12' || location == '#loc19') {\n\t\tdocument.getElementById('skybox').setAttribute('rotation', '0 350 0');\n\t} else if (location == '#loc23') {\n\t\tdocument.getElementById('skybox').setAttribute('rotation', '0 170 0');\n\t} else {\n\t\tdocument.getElementById('skybox').setAttribute('rotation', '0 270 0');\n\t}\n}", "function updateData(){\n angle += 0.01 ;\n\n modelView.rotateX(0.1);\n}", "function update()\n {\n // Send time to shaders\n var delta = clock.getDelta();\n landscapeUniforms.time.value += delta;\n landscapeMaterial.needsUpdate = true;\n\n // Move\n controls.update();\n }", "set rot(value) {\n if (this._allowRotation === false)\n return;\n if (this._rot !== value) {\n const tmp = this.width;\n this.width = this.height;\n this.height = tmp;\n this._rot = value;\n this._dirty++;\n }\n }", "rotateClockwise()\r\n {\r\n this.rotation += Math.PI / 180;\r\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 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 }", "set baseRotation(value) { this._baseRotation = value; }", "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}", "function updateOrientation(e) {\n var a = Math.round(e.alpha); // Left and Right\n var g = Math.round(e.gamma);// Up and down\n // The below rules for fixing gamma and alpha were found by watching initial values and playing with the phone\n // Fix gamma so it doesn't jump\n if(g < 0)\n {\n g+=180;\n }\n\n g -= 90;\n g = g > CamMotion.verticalMax ? CamMotion.verticalMax : g;\n g = g < CamMotion.verticalMin ? CamMotion.verticalMin : g;\n \n // Fix alpha so it doesn't jump\n // There are different rules if gamma is more than or less than 0\n if(g > 0)\n {\n a -= 180; \n }\n else\n {\n if(a > 180)\n {\n a -= 360;\n }\n }\n a = a > CamMotion.horizontalMax ? CamMotion.horizontalMax : a;\n a = a < -CamMotion.horizontalMax ? -CamMotion.horizontalMax : a;\n \n // This may be useful for debugging other phones someday so leaving it here\n //$('#rotAlpha').text(a);\n //$('#rotBeta').text(b);\n //$('#rotGamma').text(g);\n \n CamMotion.vertical = -g;\n CamMotion.horizontal = -a;\n\n // Update the tilt display\n updateTiltDot();\n \n // Safely send the new info\n safeSendData();\n }", "update(frame) {\n let rotate = ButterflyTools.getWingRotationFromFrame(frame, this.parent.angle, this.parent.speed, this.side);\n mat4.multiply(this.pos, mat4.create(), rotate);\n }", "updateValues() {\n this.s = Math.cos(this.theta / 2);\n let angle = Math.sin(this.theta / 2);\n this.a.normalize();\n this.x = this.a.x * angle;\n this.y = this.a.y * angle;\n this.z = this.a.z * angle;\n this.updateMatrix();\n }", "setRotate(angle, x, y, z){\n let e, s, c, len, rlen, nc, xy, yz, zx, xs, ys, zs;\n\n angle = Math.PI * angle / 180;\n e = this.elements;\n\n s = Math.sin(angle);\n c = Math.cos(angle);\n\n if (0 !== x && 0 === y && 0 === z) {\n // Rotation around X axis\n if (x < 0) {\n s = -s;\n }\n e[0] = 1; e[4] = 0; e[ 8] = 0; e[12] = 0;\n e[1] = 0; e[5] = c; e[ 9] =-s; e[13] = 0;\n e[2] = 0; e[6] = s; e[10] = c; e[14] = 0;\n e[3] = 0; e[7] = 0; e[11] = 0; e[15] = 1;\n } else if (0 === x && 0 !== y && 0 === z) {\n // Rotation around Y axis\n if (y < 0) {\n s = -s;\n }\n e[0] = c; e[4] = 0; e[ 8] = s; e[12] = 0;\n e[1] = 0; e[5] = 1; e[ 9] = 0; e[13] = 0;\n e[2] =-s; e[6] = 0; e[10] = c; e[14] = 0;\n e[3] = 0; e[7] = 0; e[11] = 0; e[15] = 1;\n } else if (0 === x && 0 === y && 0 !== z) {\n // Rotation around Z axis\n if (z < 0) {\n s = -s;\n }\n e[0] = c; e[4] =-s; e[ 8] = 0; e[12] = 0;\n e[1] = s; e[5] = c; e[ 9] = 0; e[13] = 0;\n e[2] = 0; e[6] = 0; e[10] = 1; e[14] = 0;\n e[3] = 0; e[7] = 0; e[11] = 0; e[15] = 1;\n } else {\n // Rotation around another axis\n len = Math.sqrt(x*x + y*y + z*z);\n if (len !== 1) {\n rlen = 1 / len;\n x *= rlen;\n y *= rlen;\n z *= rlen;\n }\n nc = 1 - c;\n xy = x * y;\n yz = y * z;\n zx = z * x;\n xs = x * s;\n ys = y * s;\n zs = z * s;\n\n e[ 0] = x*x*nc + c;\n e[ 1] = xy *nc + zs;\n e[ 2] = zx *nc - ys;\n e[ 3] = 0;\n\n e[ 4] = xy *nc - zs;\n e[ 5] = y*y*nc + c;\n e[ 6] = yz *nc + xs;\n e[ 7] = 0;\n\n e[ 8] = zx *nc + ys;\n e[ 9] = yz *nc - xs;\n e[10] = z*z*nc + c;\n e[11] = 0;\n\n e[12] = 0;\n e[13] = 0;\n e[14] = 0;\n e[15] = 1;\n }\n\n return this;\n }", "setRotate(rq) {\nE3Vec.setRotateV3(this.xyz, rq.xyzw);\nreturn this;\n}", "function handleRotorSpeed(newValue)\n{\n rot = newValue;\n r = rot * 0.8;\t\n PIErender();\n}", "function changeRotation(obj) {\n polygonAngle = parseFloat(obj.value);\n if (polygonGraphic != null) {\n var origin = polygonGraphic.geometry.getCenterPoint();\n map.graphics.remove(polygonGraphic);\n polygonGraphic.geometry.rotate(polygonAngle, origin);\n map.graphics.add(polygonGraphic);\n }\n}", "function animate(){\n\trequestAnimationFrame(animate);\n\tsphere.rotation.y += .01;\n \tcontrols.update();\n\trenderer.render(scene, camera);\n}", "set rotation(value) {\n if (this._freezeRotation !== undefined) {\n this._freezeRotation = deg2rad(value);\n }\n if (this.isNone()) {\n this.target.rotation = value;\n } else {\n let pos = this._worldPosition.get();\n this.rigidBody.setRotation(deg2rad(value));\n this._worldPosition.setPoint(pos);\n }\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 }", "refresh() {\n this.x = Math.random()*x_canv;\n this.depth = -20;\n this.radius = Math.random()*30+10;\n }", "function rotateZAxis(angle) {\n // Store the current values in temporary buffers\n // so they can be used when calculating the new\n // values.\n var tempEyeX = Camera.eyeX;\n var tempEyeY = Camera.eyeY;\n var tempLookX = Camera.upX;\n var tempLookY = Camera.upY;\n\n // Update the camera's position.\n Camera.eyeX = (Math.cos(angle) * tempEyeX) - (Math.sin(angle) * tempEyeY);\n Camera.eyeY = (Math.sin(angle) * tempEyeX) + (Math.cos(angle) * tempEyeY);\n\n // Update the camera's up direction.\n Camera.upX = (Math.cos(angle) * tempLookX) - (Math.sin(angle) * tempLookY);\n Camera.upY = (Math.sin(angle) * tempLookX) + (Math.cos(angle) * tempLookY);\n}", "updateCarAngle(deltaTime) {\n this.angle += this.wheel_front.stir_angle * this.velocity * deltaTime * 0.4 ;\n }", "function MainLoopSetup(timer, gl) {\n var seconds = timer.getSeconds();\n var lus = timer.getLastUpdateSeconds();\n\n boxObject.rotation = [seconds*60,0,seconds*50];\n boxObject.position = [8.0*Math.sin(seconds/2),8.0*Math.sin(seconds/2),8.0*Math.cos(1.5*seconds/2)];\n scene.camera.target = boxObject.position;\n\n if (!mvc.mdown) scene.camera.trackTarget(boxObject.position,lus*2.0,2.0);\n}", "function animate() {\n\t//console.debug(lumiere2.intensity);\n\tsky.rotation.y += 0.00015;\n\tlumiere2.position.y = 100 * Math.sin(suntime);\n\tlumiere2.position.z = 20 * Math.cos(suntime);\n\n\ttry {\n\t\tfor (var i = 0; i < idRotate.length; i++) {\n\t\t\tvar obj = scene.getObjectById(idRotate[i]);\n\t\t\tobj.rotation.y += ObjectRotSpeed;\n\t\t\tobj.position.y += Math.sin(ObjUpcpt += ObjUpDecay) / 500;\n\t\t}\n\t} catch (error) {\n\t\tconsole.log(\"Erreur non critique: Rotation\");\n\t}\n\n\tsuntime += sunspeed;\n\tnewlight();\n\n\tstats.update();\n\trender();\n\trequestAnimationFrame(animate);\n\t//\n\t//console.log(sprite.position);\n\t//\n\n\n}", "function setKoiPositionWithSideRotations(time) {\n\n // things that get updated in this timestep\n koiPositionZ = aniParams.koiInitialZ - aniParams.koiVelocityZ * time\n animationState.koiPositionZ = koiPositionZ;\n\n // top and side fin movement with rotations\n finRotations.topY = Math.PI/16 * Math.sin(animationState.time)\n finRotations.side0Z = aniParams.koiInitialSideRotation0Z + Math.PI/8 * Math.sin(animationState.time)\n finRotations.side1Z = aniParams.koiInitialSideRotation1Z + Math.PI/8 * Math.sin(animationState.time)\n finRotations.side2Z = aniParams.koiInitialSideRotation2Z + Math.PI/8 * Math.sin(animationState.time)\n\n // doing a remove and remake in here to allow for side fin animation\n scene.remove(koi);\n koi = eqwangKoi(purpleScaleMaterial, sparkleMaterial, finRotations);\n koi.name = \"koi\";\n koi.position.set(animationState.koiPositionX, animationState.koiPositionY, animationState.koiPositionZ);\n koi.scale.set(.5, .5, .5);\n scene.add(koi);\n}", "set wristRotationDegree(value) { this._wristRotation = (value / 180.0 * Math.PI); }", "rotateCamera(){\n\t\tif(this.state.rotationIndex==1){\n\t\t\tdocument.getElementById('on1').setAttribute('set_bind','true');\n\t\t\tthis.setState({rotationIndex: 2, in: 87, out: 83, left: 65, right: 68});\n\t\t}else if(this.state.rotationIndex==2){\n\t\t\tdocument.getElementById('on2').setAttribute('set_bind','true');\n\t\t\tthis.setState({rotationIndex: 3, in: 65, out: 68, left: 83, right: 87});\n\t\t}else if(this.state.rotationIndex==3){\n\t\t\tdocument.getElementById('on3').setAttribute('set_bind','true');\n\t\t\tthis.setState({rotationIndex: 4, in: 83, out: 87, left: 68, right: 65});\n\t\t}else if(this.state.rotationIndex==4){\n\t\t\tdocument.getElementById('on4').setAttribute('set_bind','true');\n\t\t\tthis.setState({rotationIndex: 1, in: 68, out: 65, left: 87, right: 83});\n\t\t}\n\t}", "function updateSceneThree() {\n sphere.theta += 0.01;\n star.theta += 0.02;\n}", "updateAnimation() {\n\n this.modelMatrix.rotate(1,0,1,0)\n }", "function stopGlobeRotation(){\n setTimeout(function() {\n globe.updateOptions(\n {...options,cameraAutoRotateSpeed: 0}\n )\n }, 1000)\n }", "setRotations() {\n this.room2_wall_info_4.rotation = 3.14;\n this.room2_wall_info_5.rotation = 3.14;\n this.room2_wall_info_6.rotation = 3.14;\n this.leftArrow.setRotation(3.14);\n\tthis.returnDoor.angle = 270;\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 gameLoop() {\n stats.update();\n if (!control.helperAxis)\n axes.traverse(function (object) { object.visible = false; });\n else\n axes.traverse(function (object) { object.visible = true; });\n for (var i = 0; i < planets.children.length; i++) {\n planets.children[i].rotation.y += planetSpeeds[i]; //rotation around sun middle\n for (var j = 0; j < planets.children[i].children.length; j++) {\n planets.children[i].children[j].rotation.y += planetSpeeds[i];\n ; //rotation around planet middle\n if (planets.children[i].children[j].children[0] != null)\n planets.children[i].children[j].children[0].rotation.y += 0.035; //rotation around moon middle \n if (planets.children[i].children[j].children[2] != null)\n planets.children[i].children[j].children[2].rotation.z += 0.5; //rotation around moon middle\n if (planets.children[i].children[j].children[3] != null)\n planets.children[i].children[j].children[3].rotation.z += 0.5; //rotation around moon middle\n }\n }\n if (control.zoom != camera.zoom) {\n currentCamera.zoom = control.zoom;\n currentCamera.updateProjectionMatrix();\n }\n // render using requestAnimationFrame\n requestAnimationFrame(gameLoop);\n // render the scene\n renderer.render(scene, currentCamera);\n}", "function updateAnimationAngles(){\n\n if(animation){\n g_lightPos[0] = 15 * Math.cos(g_seconds);\n //g_lightPos[1] = 5* Math.cos(g_seconds);\n //g_lightPos[2] = 5* Math.cos(g_seconds);\n }\n \n\n\n // if(headAnimation){\n // head_Angle = (-10+10*(Math.sin(3*g_seconds)));\n // }\n\n // if(leftLegAnimation){\n // leftLeg_Angle = (20* (Math.cos(1.5*g_seconds)));\n // }\n // if(rightLegAnimation){\n // // rightLeg_Angle = (-20 + 45 * Math.abs(Math.cos(1.5*g_seconds)));\n // rightLeg_Angle = (-20* (Math.cos(1.5*g_seconds)));\n // }\n\n\n // if(leftTopArmAnimation){\n // leftTopArm_Angle = (-20+ 20 * (Math.abs(Math.sin(3*g_seconds))));\n // }\n // if(leftElbowAnimation){\n // leftElbow_Angle = ( -10 + 50 * (Math.sin(2*g_seconds)));\n // }\n\n // if(rightTopArmAnimation){\n // rightTopArm_Angle = (-20+ 20 * (Math.abs(Math.cos(3*g_seconds))));\n // }\n\n // if(rightElbowAnimation){\n // //rightElbow_Angle = (-90 * (Math.abs(Math.sin(3*g_seconds))));\n // rightElbow_Angle = ( -10 - 50 * (Math.sin(2*g_seconds)));\n // }\n}", "function updateClock() {\n let today = new Date();\n let hours = today.getHours() % 12;\n let mins = today.getMinutes();\n let secs = today.getSeconds();\n\n hourHand.groupTransform.rotate.angle = hoursToAngle(hours, mins);\n minHand.groupTransform.rotate.angle = minutesToAngle(mins);\n secHand.groupTransform.rotate.angle = secondsToAngle(secs);\n}", "function animate() {\n\t// update\n\tvar time = (new Date()).getTime();\n\tvar timeDiff = time - lastTime;\n\tvar angleChange = angularSpeed * timeDiff * 2 * Math.PI / 1000;\n\tcube.rotation.y += angleChange;\n\tlastTime = time;\n\n\t// render\n\trenderer.render(scene, camera);\n\n\t// request new frame\n\trequestAnimationFrame(function () {\n\t\tanimate();\n\t});\n}", "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 animate() {\n var timeNow = new Date().getTime();\n if (lastTime != 0) {\n var elapsed = timeNow - lastTime; \n rotAngle= (rotAngle+1.0) % 360;\n }\n var elapsed=timeNow-lastTime;\n lastTime = timeNow;\n \n //when framecount is less than 120, the effect is just rotation\n //when framecount is between 120 to 240, the effect is shaking from left to right\n //when framecount is between 240 to 360, the effect is enlarging from left to right\n //when framecount is between 360 to 480, the effect is shaking hands\n //when framecount is between 480 to 600, the effect is enlargeing from top to bottom\n //then repeat\n days=days+0.01;\n if(framecount>=120 && framecount <240){\n updateBuffers();\n \n } \n if(framecount>=240 && framecount <360) {\n updateBuffers1();\n updatecolor();\n\n }\n if(framecount>=360 && framecount <480){\n updateBuffers2();\n }\n if (framecount >=480 && framecount < 600) {\n \n updateBuffers3();\n updatecolor();\n \n }\n \n \n \n}", "updateAngle () {\n this.angleRadians = (this.data.angle / 180) * Math.PI\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 }", "handleOrientation(e) {\r\n let x = e.gamma;\r\n let y = e.beta;\r\n\r\n ball.setV(x / 3, y / 3);\r\n\r\n\r\n }", "function animate() {\n requestAnimationFrame( animate );\n if(scene.rotation.y >= -3.16){\n scene.rotation.y -= 100* Math.PI/180;\n }\n renderer.render( scene, camera );\n}", "rotate(rotateAmount) {\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 }", "_applyRotation() {\n this.quaternion.setFromVec3(this.rotation);\n // we should update the plane mvMatrix\n this._updateMVMatrix = true;\n }", "function angleOfProjectionChange(scope) {\n var bullet_case_tween = createjs.Tween.get(getChild(\"bullet_case\")).to({\n rotation: (-(scope.angle_of_projection))\n }, 500); /** Tween rotation of bullet case, with respect to the slider angle value */\n\tvar bullet_case_tween = createjs.Tween.get(getChild(\"case_separate\")).to({\n rotation: (-(scope.angle_of_projection))\n }, 500); /** Tween rotation of bullet case, with respect to the slider angle value */\n bullet_moving_theta = scope.angle_of_projection + 10; /** Bullet moving angle */\n calculation(scope); /** Value calculation function */\n scope.erase_disable = true; /** Disable the erase button */\n}", "updateAnimation() {\n \n this.modelMatrix.rotate(1,1,1,0)\n\n // Recommendations: While your cube will only need to be at the origin, I'd\n // recommend coding it so it spins in place when placed anywhere on your\n // canvas. Why? Because you might need to have more than one spinning cube\n // in different positions on a future assignment ;)\n //\n // Keep in mind that no rendering should be done here. updateAnimation()'s\n // purpose is to update the geometry's modelMatrix and any other variables\n // related to animation. It should be the case that after I call\n // updateAnimation() I should be able to call render() elsewhere and have my\n // geometry complete a frame of animation.\n }", "function setRotation(el, kvs){\n el.setAttribute('rotation', \n {\n x: parseInt(kvs['pitch']),\n y: parseInt(360 - kvs['compass']),\n z: parseInt(kvs['rotation'])\n });\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 rotate(){\n\n undraw();\n currentRotation++;\n\n if (currentRotation === currentShape.length)\n {\n currentRotation = 0;\n }\n\n currentShape = theShapes[randomShape][currentRotation];\n }", "update() {\n \n var centerX = this.radius;\n var centerY = this.radius;\n \n /** Update to the current date and time. */\n var now = new Date();\n \n /** Calculate the angles in degrees for the secons, minutes, and hours hands. */\n var secondsDegrees = 6*now.getSeconds();\n var minuteDegrees = 6*now.getMinutes();\n var hourDegrees = 30*(now.getHours()%12) + now.getMinutes()/2;\n \n /** Rotate the hands of the clock. */\n this.secondHand.setAttribute('transform', 'rotate(' + secondsDegrees + ' ' + centerX + ' ' + centerY + ')');\n this.minuteHand.setAttribute('transform', 'rotate(' + minuteDegrees + ' ' + centerX + ' ' + centerY + ')');\n this.hourHand.setAttribute('transform', 'rotate(' + hourDegrees + ' ' + centerX + ' ' + centerY + ')');\n \n var thisObj = this; // Can't just pass \"this\" to the setInterval function.\n var milliseconds = now.getMilliseconds();\n var newTimeout = 1000 - milliseconds;\n this.timeoutVariable = setTimeout((function(thisObj) { return function() { thisObj.update(); } })(this), newTimeout);\n }", "render({ time }) {\n controls.update();\n scene.rotation.x = time / 30;\n // scene.rotation.z = time / 50;\n renderer.render(scene, camera);\n }", "rotatingCraneVerticallyToCatchAtR() {\n\n if (this.catchingCarV1Fase == 1){\n let articulationAngle = this.arm1VerticalAngle + this.arm2angle;\n let X = (Math.cos(this.arm1VerticalAngle) * this.arm1length) - this.vehicle.height - this.magnet.height;\n let Y = (Math.cos(this.arm1VerticalAngle + this.arm2angle) * this.arm2length);\n let newAngle = Math.atan(X / Y);\n let angleToRotate = newAngle - articulationAngle;\n \n let abs = Math.abs(angleToRotate);\n if (abs > 0 && (abs > this.angleDec)) {\n if (angleToRotate > 0) {\n this.arm2angle += 0.5*this.angleDec;\n this.arm1VerticalAngle += (this.arm2length/this.arm1length) * this.angleDec;\n }\n else {\n this.arm2angle -= 0.5*this.angleDec;\n this.arm1VerticalAngle -= (this.arm2length/this.arm1length) * this.angleDec;\n }\n }\n else {\n //Crane will start to move car\n this.catchingCarV1Fase++;\n }\n }\n else {\n let angle1 = this.arm1VerticalAngle - this.defaultArm1VerticalAngle;\n let angle2 = this.arm2angle - this.defaultArm2Angle;\n\n if (angle1 > 0 || angle2 > 0){\n let oldZ = Math.cos(this.arm1VerticalAngle) * this.arm1length - Math.sin(this.arm2angle + this.arm1VerticalAngle) * this.arm2length;\n let oldY = Math.sin(this.arm1VerticalAngle) * this.arm1length + Math.cos(this.arm2angle + this.arm1VerticalAngle) * this.arm2length;\n\n if (angle2 > 0){\n this.arm2angle -= this.angleDec;\n }\n else if (angle1 > 0) {\n this.arm1VerticalAngle -= this.angleDec; \n }\n let newZ = Math.cos(this.arm1VerticalAngle) * this.arm1length - Math.sin(this.arm2angle + this.arm1VerticalAngle) * this.arm2length;\n let newY = Math.sin(this.arm1VerticalAngle) * this.arm1length + Math.cos(this.arm2angle + this.arm1VerticalAngle) * this.arm2length;\n this.vehicle.displayYCorrection += newY - oldY;\n this.vehicle.z += newZ - oldZ;\n }\n else {\n this.catchingCarV1Fase = 1;\n this.isMovingCar = true;\n this.vehicle.isAttached = true;\n }\n\n }\n\n }", "rotateFront(){\r\n let square1 = this.right.squares[0];\r\n let square2 = this.right.squares[3];\r\n let square3 = this.right.squares[6];\r\n this.right.squares[0] = this.up.squares[6];\r\n this.right.squares[3] = this.up.squares[7];\r\n this.right.squares[6] = this.up.squares[8];\r\n this.up.squares[6] = this.left.squares[8];\r\n this.up.squares[7] = this.left.squares[5];\r\n this.up.squares[8] = this.left.squares[2];\r\n this.left.squares[8] = this.down.squares[2];\r\n this.left.squares[5] = this.down.squares[1];\r\n this.left.squares[2] = this.down.squares[0];\r\n this.down.squares[2] = square1;\r\n this.down.squares[1] = square2;\r\n this.down.squares[0] = square3;\r\n this.front.spinCW();\r\n }", "set worldCamera(value) {}", "function animate(){\n requestAnimationFrame(animate); // like a \"game loop\"\n\n torus.rotation.x += 0.01;\n torus.rotation.y += 0.001;\n torus.rotation.z += 0.01;\n\n moon.rotation.y += 0.005;\n\n controls.update();\n\n renderer.render(scene,camera);\n}", "function animate() {\n\t// update\n\tcontrols.update();\n\tvar time = (new Date()).getTime();\n\tvar timeDiff = time - lastTime;\n\tvar angleChange = angularSpeed * timeDiff * 2 * Math.PI / 1000;\n\n\tcube.rotation.y += angleChange;\n\tlastTime = time;\n\t\n\t// render\n\trenderer.render(scene, camera);\n\t\n\t// request new frame\n\trequestAnimationFrame(function () {\n\t\tanimate();\n\t});\n}", "function init() {\r\n try {\r\n var canvas = document.getElementById(\"myGLCanvas\");\r\n gl = canvas.getContext(\"webgl\") || \r\n canvas.getContext(\"experimental-webgl\");\r\n if ( ! gl ) {\r\n throw \"Browser does not support WebGL\";\r\n }\r\n }\r\n catch (e) {\r\n document.getElementById(\"canvas-holder\").innerHTML =\r\n \"<p>Sorry, could not get a WebGL graphics context.</p>\";\r\n return;\r\n }\r\n\r\n try {\r\n initGL(); // initialize the WebGL graphics context\r\n }\r\n catch (e) {\r\n document.getElementById(\"canvas-holder\").innerHTML =\r\n \"<p>Sorry, could not initialize the WebGL graphics context:\" + e + \"</p>\";\r\n return;\r\n }\r\n\r\n document.getElementById(\"my_gl\").checked = false;\r\n document.getElementById(\"my_gl\").onchange = tick;\r\n \r\n rotator = new TrackballRotator(canvas, draw , 15);\r\n \r\n lightDeg = 0; \r\n carDeg = 0;\r\n sunDeg =0;\r\n wheelDeg = 0;\r\n \r\n \r\n \r\n draw();\r\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}", "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}", "function revolution()\r\n{\r\n sun.position.x = radius * Math.cos(theta * Math.PI/180);\r\n sun.position.z = radius * Math.sin(theta * Math.PI/180);\r\n\r\n theta = (theta + 0.4) % 360;\r\n \r\n sunmodel.position.copy(sun.position); \r\n \r\n moonmodel.position.x = mradius * Math.cos(mtheta * Math.PI/180) * -1;\r\n moonmodel.position.z = mradius * Math.sin(mtheta * Math.PI/180) * -1;\r\n \r\n mtheta = (mtheta + 0.3) % 360;\r\n}", "function update(){\n\tpositieGebruiker = $(\"#camera\").attr(\"position\");\n\trotatieGebruiker = $(\"#camera\").attr(\"rotation\");\n}", "update() {\n this.xsky -= this.speedSky;\n }", "rotate(angleInRadians) {\n this.rotation = angleInRadians;\n }", "function setClock() {\n const currentDate=new Date();\n const secondsRatio=currentDate.getSeconds()/60;\n const minutesRatio=(secondsRatio+currentDate.getMinutes())/60;\n const hoursRatio= (minutesRatio+currentDate.getHours())/12;\n // console.log(secondsRatio)\n setRotation(secondHand, secondsRatio);\n setRotation(minuteHand, minutesRatio);\n setRotation(hourHand, hoursRatio);\n\n}", "update () {\n this.updateAngle()\n\n const videoMesh = this.el.getObject3D('mesh')\n videoMesh.renderOrder = this.data.onTop ? 990 : undefined\n videoMesh.material.depthTest = this.data.onTop\n videoMesh.material.depthWrite = this.data.onTop\n }", "_rotate() {\n this.attachmentViewer.update({ angle: this.attachmentViewer.angle + 90 });\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 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.6966053", "0.667083", "0.661385", "0.65150744", "0.6345125", "0.63376653", "0.63134", "0.6274141", "0.6220295", "0.6199728", "0.6194611", "0.6165083", "0.61649996", "0.61605453", "0.6153311", "0.61508816", "0.6149095", "0.6132585", "0.6102875", "0.6077865", "0.60760814", "0.60713124", "0.60513246", "0.60368586", "0.6036042", "0.6026093", "0.6024713", "0.60112417", "0.60079443", "0.5987635", "0.59867144", "0.59786063", "0.59745425", "0.5970685", "0.59702706", "0.59689677", "0.5959113", "0.5957009", "0.59532386", "0.5949468", "0.5940829", "0.5922983", "0.5917285", "0.5916232", "0.59136736", "0.590126", "0.5887454", "0.58830065", "0.5880075", "0.58689874", "0.5855264", "0.58521074", "0.5842358", "0.584128", "0.58398086", "0.5836874", "0.5811202", "0.58052063", "0.57988733", "0.5795486", "0.57929033", "0.5788151", "0.57779086", "0.5771932", "0.5770663", "0.57667017", "0.5757181", "0.57554126", "0.57509494", "0.574715", "0.57425505", "0.5729068", "0.5717001", "0.57163215", "0.57134616", "0.5712891", "0.5706376", "0.57054204", "0.57037", "0.570129", "0.569598", "0.5693437", "0.5690109", "0.56870157", "0.56773573", "0.5664012", "0.5660679", "0.5659523", "0.5656174", "0.56537753", "0.5653408", "0.5650781", "0.56430334", "0.5641055", "0.56390744", "0.5631565", "0.5626673", "0.56084734", "0.56082875", "0.56028783", "0.5601605" ]
0.0
-1
Constructor Point // //
function Point (ax, ay) { // Auto instantiate the Point if (!(this instanceof Point)) return new Point (ax, ay); var p = Point.normalize (ax, ay); this.x = p.x; this.y = p.y; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Point() { }", "function Point() {}", "function Point() {}", "function Point(x,y){\n this.x = x;\n this.y = y;\n}", "function Point(x,y) {\n this.x = x;\n this.y = y;\n}", "function Point(x, y){\r\n\tthis.x = x;\r\n\tthis.y = y;\r\n}", "function point(x,y){\n this.x = x;\n this.y = y;\n}", "function Point(x, y) {\n this.x = x;\n this.y = y;\n}", "function Point(x, y) {\n this.x = x;\n this.y = y;\n}", "function Point (x,y) {\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n}", "function Point(x, y) { this.x = x; this.y = y; }", "function Point(x,y) {\n\tthis.x = x;\n\tthis.y = y;\n}", "function Point(x,y) {\n\tthis.x = x;\n\tthis.y = y;\n}", "function Point(x,y) { // By convetion, constructors start with capitals\n this.x = x; // this keyword is the new object being initialized\n this.y = y; // Store function arguments as object properties\n} // No return is necessary", "function Point(x, y) {\n this.x = x || 0;\n this.y = y || 0;\n}", "function Point(x, y) {\n\tthis.x = x;\n\tthis.y = y;\n}", "function Point(x, y) {\n\tthis.x = x || 0;\n\tthis.y = y || 0;\n}", "function Point (x, y) {\n\tthis.x = x;\n\tthis.y = y;\n}", "function Point(x, y) {\n\t this.x = x;\n\t this.y = y;\n\t}", "function Point(x, y) {\n\tvar self = this;\n\tthis.x = x;\n\tthis.y = y;\n}", "function Point(x, y) {\n\tthis.x = x;\n\tthis.y = y;\n\treturn this;\n}", "function Point1(x, y) {\n this.x = x;\n this.y = y;\n return this;\n}", "function pt(x, y) { \n return new Point(x, y);\n}", "function Point(x, y) {\n this.x = x;\n this.y = y;\n }", "function Legato_Structure_Point( X, Y )\r\n{\r\n\r\n\t// Store the passed in parameters.\r\n\tthis.X = X;\r\n\tthis.Y = Y;\r\n\r\n}", "function Point(x, y) {\n return {x: x, y: y}\n}", "function Point(x, y) {\n return {x: x, y: y};\n}", "function Point(x, y) {\n this.x = x;\n this.y = y;\n this.x = x;\n this.y = y;\n }", "function Point(x,y) {\n this.h = x;\n this.v = y;\n \n this.toString = pointToString;\n this.copy = pointCopy;\n // // // // console.log(\"Point\" + this.toString());\n}", "function coordonneesPoint(x,y)\n {\n this.x = x;\n this.y = y;\n }", "function Point(x, y, z) {\n this.x = x;\n this.y = y;\n this.z = z;\n}", "function Point(x, y)\n{\n\tthis.x = parseInt(x);\n\tthis.y = parseInt(y);\n}", "function Point(x, y, z) {\n this.x = x || 0;\n this.y = y || 0;\n this.z = z || 0;\n}", "function Point(x, y) {\n this.x = x;\n this.y = y;\n this.constraint = {};\n}", "function PointClass(_x, _y) {\n this._x = _x;\n this._y = _y;\n }", "constructor(x, y) {\n this.x = x;\n this.y = y;\n }", "constructor(x, y) {\n this.x = x;\n this.y = y;\n }", "constructor(x, y) {\n this.x = x;\n this.y = y;\n }", "function Point() {\n this.x = random(-1, 1);\n this.y = random(-1, 1);\n this.bias = 1;\n this.lineY = lineEqn(this.x);\n if (this.y > this.lineY) {\n this.label = 1;\n }\n else {\n this.label = -1;\n }\n this.px = map(this.x, -1, 1, 0, width);\n this.py = map(this.y, -1, 1, height, 0);\n}", "function Point (x, y) {\n this.x = x;\n this.y = y;\n Point.set().push(this);\n}", "function Point(/*float*/ x, /*float*/ y) {\n\tthis.X = x;\n\tthis.Y = y;\n}", "constructor(x, y) {\n\n super();\n this.x = x;\n this.y = y;\n\n }", "constructor(x,y) { // special function for constructor\r\n this.x = x;\r\n this.y = y;\r\n }", "function Point(x, y) {\n this.x = x;\n this.y = y;\n // this.x = x;\n // this.y = y;\n }", "constructor(x,y){\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}", "Point(x, y) {\n\t\treturn { x: x, y: y };\n\t}", "function Point(x_, y_) {\n\t\t\tthis.x = x_;\n\t\t\tthis.y = y_;\n\t\t}", "function Point(x_, y_) {\n\t\t\tthis.x = x_;\n\t\t\tthis.y = y_;\n\t\t}", "constructor(x,y) {\r\n this.x = x\r\n this.y = y\r\n }", "constructor(x, y) {\n this.x = x\n this.y = y\n }", "function Point(_x, y) {\n this._x = _x;\n this.y = y;\n }", "constructor(x, y) { //takes coordinates\n\t\tthis.set(x, y); // and set it here\n\t}", "function Point(x, y) {\n return {x, y}\n}", "function createPoint(x, y) {\n var point = new Object();\n point.x = parseInt(x);\n point.y = parseInt(y);\n \n return point;\n}", "function Point(px, py) {\n\t\tthis.x = px;\n\t\tthis.y = py;\n\t\treturn this;\n\t}", "function mousePoint(x,y) {\n this.x = x;\n this.y = y;\n}", "constructor() {\n super();\n if (arguments.length === 0) {\n this._constructorDefault();\n }\n else if (arguments.length === 2) {\n this._constructorValues(arguments[0], arguments[1]);\n }\n else if (arguments.length === 1) {\n this._constructorPoint(arguments[0]);\n }\n else {\n throw new Error('HPoint#constructor error: Invalid number of arguments.');\n }\n }", "function CreatePointInSpace(x, y, z){\n this.xPoint = x;\n this.yPoint = y;\n this.zPoint = z;\n}", "constructor(x, y, type) {\n this.x = x;\n this.y = y;\n this.type = type;\n }", "constructor(x, y, type) {\n this.x = x;\n this.y = y;\n this.type = type;\n }", "function Point (x,y) {\n this.x = x;\n this.y = y;\n\n this.set = function(x,y) {\n this.x = x;\n this.y = y;\n }\n this.offset = function(xi,yi) {\n return new Point(this.x+xi,this.y+yi);\n }\n this.invert = function() {\n return new Point(-this.x,-this.y);\n }\n this.scale = function(k) {\n return new Point(this.x*k,this.y*k);\n }\n this.getDifference = function(point) {\n return new Point(point.x-this.x,point.y-this.y);\n }\n\n}", "function Point(x, y) {\n\t\tthis.x = Math.round(parseFloat(x));\n\t\tthis.y = Math.round(parseFloat(y));\n\t}", "function Point(posX, posY, posZ) {\n this.x = posX;\n this.y = posY;\n this.z = posZ;\n }", "constructor(x, y) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}", "constructor(x, y) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}", "function Points(x, y) {\n this.x = x;\n this.y = y;\n this.x = x;\n this.y = y;\n }", "function ShapePoint(anchor, left, right) {\r\n this.anchor = anchor;\r\n this.left = left;\r\n this.right = right;\r\n}", "static PointOnLineParameter() {}", "Point( x, y ) {\n return { x, y }\n }", "function Point(x, y) {\n // 'use strict';\n this.x = x; // if 'use strict': TypeError: cannot set property of undefined\n this.y = y;\n}", "constructor(x = 0, y = 0) {\n this.x = x;\n this.y = y;\n }", "function fnewPoint(x,y){\r\n\tthis.points.push(new points(x,y));\r\n}", "constructor(sp, ep) {\r\n if (sp && ep) {\r\n this.sp = sp;\r\n this.ep = ep;\r\n } else {\r\n this.sp = new Point();\r\n this.ep = new Point();\r\n }\r\n }", "function point(x, y) {\n return { x, y };\n}", "constructor(x,y) {\n\t\tthis.x = x || 0;\n\t\tthis.y = y || 0;\n\t}", "constructor(x, y)// un seul constructor possible\n {\n this.x = x;// creations des variables de la classe\n this.y = y;\n }", "function Point() {\n Item.call(this);\n}", "constructor(x = 0, y = 0) {\n\n this.set(x, y);\n }", "constructor (center, radius) {\n if (!(center instanceof Point)) throw new Error('center is not instance of class Point')\n this.center = center\n this.radius = radius\n }", "static newCartesionPoint(x, y) {\n return new PointFM(x, y);\n }", "static newCartesionPoint(x, y) {\n return new PointFM(x, y);\n }", "constructor(pointValue) {\n var params = {\n 'name': 'Dont Come',\n 'pointValue': pointValue\n };\n super(params);\n }", "constructor(p1, p2, p3){\n \n if (typeof p2 == 'object')\n {\n console.log('two points given');\n this.p1 = p1;\n this.p2 = p2;\n this.halfWidth = (p2.x - p1.x)/2;\n this.halfHeight = (p2.y - p1.y)/2;\n this.center = new Point(p1.x + this.halfWidth, p1.y + this.halfHeight);\n return;\n }\n this.center = p1;\n this.halfWidth = p2;\n \n\n if (typeof p3 != 'undefined')\n {\n this.halfHeight = p3;\n } else {\n this.halfHeight = p2;\n }\n\n this.p1 = new Point(p1.x - this.halfWidth, p1.y - this.halfHeight);\n this.p2 = new Point(p1.x + this.halfWidth, p1.y + this.halfHeight);\n }", "constructor(x, y) {\n this.x = x;\n this.y = y;\n this.x = x;\n this.y = y;\n }", "function Punto(x, y) {\n this.x = x\n this.y = y\n}", "function Posn(x, y) {\n\tthis.x = x;\n \tthis.y = y;\n}", "constructor(x_, y_) {\n this.x = x_;\n this.y = y_;\n }", "function Pos(x,y)\r\n{\r\n this.x = x;\r\n this.y = y;\r\n}", "function Punto(x, y){\n\tthis.x = x;\n\tthis.y = y;\n}", "function Point(xAxix, yAxis) {\n this.xAxis = xAxix;\n this.yAxis = yAxis;\n}", "function pointv1(x, y) {\n return {\n getX: function () {\n return x;\n },\n \n setX: function (val) {\n x = val;\n },\n \n getY: function () {\n return y;\n },\n \n setY: function (val) {\n y = val;\n }\n };\n}", "function Point( x, y ) {\n this.x = x;\n this.y = y;\n\n this.key = [ x.key, y.key ];\n\n this.add = function( other ) {\n return new Point(\n this.x.add( other.x )\n , this.y.add( other.y )\n );\n };\n }", "constructor(x,y){\n super(x,y);\n }", "constructor(pointValue) {\n var params = {\n 'name': 'Come',\n 'pointValue': pointValue\n };\n super(params);\n }", "function createPoint(x, y) {\n\tif (isNaN(x) || isNaN(y)) {\n\t\treturn null;\n\t}\n\n\treturn {\n\t\tx: parseFloat(x),\n\t\ty: parseFloat(y),\n\t\ttoString: function() {\n\t\t\treturn '(' + this.x + ', ' + this.y + ')';\n\t\t}\n\t};\n}", "function Point(x, y) {\n //properties\n this.x = x;\n this.y = y;\n\n //Gets or sets the coordinates of the point\n this.coords = function (xy) {\n if (xy) {\n this.x = xy.x;\n this.y = xy.y;\n } else {\n return { x: this.x, y: this.y };\n }\n };\n\n this.equals = function (xy) {\n if (xy.x == this.x && xy.y == this.y) {\n return true;\n } else {\n return false;\n }\n }\n}", "function Point(x, y, z) {\r\n\tif (x === undefined) {\r\n\t\tthrow new ReferenceError('At least one dimension is required');\r\n\t}\r\n\tif (typeof x != 'number') {\r\n\t\tthrow new TypeError(\"Variable 'x' is nonnumerical\");\r\n\t} else if (y !== undefined && typeof y != 'number') {\r\n\t\tthrow new TypeError(\"Variable 'y' is nonnumerical\");\r\n\t} else if (z !== undefined && typeof z != 'number') {\r\n\t\tthrow new TypeError(\"Variable 'z' is nonnumerical\");\r\n\t}\r\n\r\n\tthis.x = x;\r\n\tthis.y = y;\r\n\tthis.z = z;\r\n}", "function Point(x, y) {\n var _this = this;\n this.drawPoint = function () {\n console.log('x: ' + _this.x + ', y: ' + _this.y);\n };\n this.getDistance = function (otherPoint) {\n return Math.sqrt(Math.pow(_this.x - _this.y, 2) + Math.pow(otherPoint.x - otherPoint.y, 2));\n };\n this.x = x;\n this.y = y;\n }", "function PT(x,y) {\n this.x=x;\n this.y=y;\n this.z=0.0;\n}", "constructor ()\n\t{\n\t\tthis.x = 0;\n\t\tthis.y = 0;\n\t}" ]
[ "0.87243503", "0.8684048", "0.8684048", "0.8326572", "0.8202281", "0.8180334", "0.81000197", "0.80835843", "0.8042891", "0.8021262", "0.8020421", "0.800725", "0.800725", "0.8001731", "0.7980481", "0.78866786", "0.78672385", "0.78351146", "0.78063434", "0.7773964", "0.7751798", "0.77513325", "0.76662743", "0.7656193", "0.76328546", "0.75582093", "0.75574905", "0.7530552", "0.75187635", "0.7503999", "0.74577", "0.745576", "0.7452268", "0.7429044", "0.7428649", "0.74281526", "0.74281526", "0.74281526", "0.74030054", "0.73929054", "0.7378632", "0.7330879", "0.7301133", "0.72966594", "0.72758657", "0.72712946", "0.72709364", "0.72709364", "0.72692966", "0.7261834", "0.7255149", "0.721975", "0.721384", "0.7199967", "0.7178839", "0.71716934", "0.71693707", "0.7167882", "0.7113816", "0.7113816", "0.7101973", "0.7091109", "0.7079653", "0.70746243", "0.70746243", "0.70267946", "0.69895804", "0.69801086", "0.69673586", "0.69473624", "0.6943734", "0.693079", "0.69294906", "0.69206667", "0.69155496", "0.6906195", "0.6905304", "0.68969923", "0.68968046", "0.6896368", "0.6896368", "0.6883961", "0.68821144", "0.6880478", "0.68681943", "0.68587166", "0.68549305", "0.68431103", "0.6842016", "0.6831022", "0.6829407", "0.6806079", "0.6793142", "0.6783346", "0.6778146", "0.67748713", "0.67699695", "0.6762587", "0.67608666", "0.6745065" ]
0.68212175
91
Puts file into S3.
static putFile (bucketName, objectKey, objectBody) { const s3 = Storage._getS3Instance(); const params = { Bucket: bucketName, Key: objectKey, Body: objectBody }; return new Promise((resolve, reject) => { s3.upload(params, (err, data) => err ? reject(err) : resolve(data.Location)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function uploadToS3(file_path, s3_file_path, cb)\n{\n\tconsole.log(\"Uploading to S3 file: \" + file_path, \"to: \" + s3_file_path);\n\n\theaders = {'x-amz-acl': 'public-read'};\n\ts3Client.putFile(file_path, s3_file_path, headers, function(err, s3Response) {\n\t if (err)\n \t{\n \t\tconsole.log(\"ERROR: \" + util.inspect(err));\n \t\tthrow err;\n \t}\n\t \n\t destUrl = s3Response.req.url;\n\n\t cb();\n\t});\n}", "function putS3File(bucketName, fileName, data, callback) {\n var expirationDate = new Date();\n // Assuming a user would not remain active in the same session for over 1 hr.\n expirationDate = new Date(expirationDate.setHours(expirationDate.getHours() + 1));\n var params = {\n Bucket: bucketName,\n Key: fileName,\n Body: data,\n ACL: 'public-read', // TODO: find way to restrict access to this lambda function\n Expires: expirationDate\n };\n s3.putObject(params, function (err, data) {\n callback(err, data);\n });\n}", "async function putS3(fileKey, data) {\n oLog.verbose(__filename, 'putS3');\n\n try {\n if (configs.aws.s3.active) {\n // set aws region:\n rAWS.config.update({\n region: configs.aws.s3.region\n });\n // bucket info:\n let s3Bucket = configs.aws.s3.s3bucket;\n let s3FileKey = fileKey;\n let s3Params = {\n Bucket: s3Bucket,\n Key: s3FileKey,\n Body: data\n };\n\n // get object and parse the JSON:\n return rS3.putObject(s3Params).promise();\n } else {\n // empty object if not active:\n return {};\n }\n } catch (error) {\n oLog.error(__filename, 'putS3', error);\n return error;\n }\n}", "function uploadFileIntoBucket(){\n // Create S3 service object\n s3 = new AWS.S3({apiVersion: '2006-03-01'});\n\n // call S3 to retrieve upload file to specified bucket\n var uploadParams = {Bucket: process.argv[2], Key: '', Body: ''};\n var file = process.argv[3];\n\n // Configure the file stream and obtain the upload parameters\n var fs = require('fs');\n var fileStream = fs.createReadStream(file);\n fileStream.on('error', function(err) {\n console.log('File Error', err);\n });\n\n uploadParams.Body = fileStream;\n var path = require('path');\n uploadParams.Key = path.basename(file);\n\n // call S3 to retrieve upload file to specified bucket\n s3.upload (uploadParams, function (err, data) {\n if (err) {\n console.log(\"Error\", err);\n } if (data) {\n console.log(\"Upload Success\", data.Location);\n }\n });\n}", "function uploadToS3(file) {\n let s3bucket = new AWS.S3({\n accessKeyId: ACCESS,\n secretAccessKey: SECRET,\n Bucket: BUCKET_NAME,\n });\n s3bucket.createBucket(function () {\n var params = {\n Bucket: BUCKET_NAME,\n Key: file.name,\n Body: file.data,\n };\n s3bucket.upload(params, function (err, data) {\n if (err) {\n console.log(\"error in callback\");\n console.log(err);\n }\n console.log(\"success\");\n console.log(data);\n });\n });\n}", "function saveToS3(fileName) {\n // load in file;\n let logDir = './logs';\n let directory =`${logDir}/${fileName}`;\n let myKey = fileName;\n var myBody;\n console.log(directory);\n\n // read then save to s3 in one step (so no undefined errors)\n fs.readFile(directory, (err, data) => {\n if (err) throw err;\n myBody = data;\n console.log(\"save to s3 data is \" + data);\n var params = {Bucket: myBucket, Key: myKey, Body: myBody, ContentType: 'text/plain'};\n s3.putObject(params, function(err, data) {\n if (err) {\n console.log(err)\n } else {\n console.log(\"Successfully uploaded data to myBucket/myKey\");\n }\n });\n\n });\n fs.unlink(directory);\n\n // the create bucket stuff started to cause problems (error: \"BucketAlreadyOwnedByYou: Your previous request to create the named bucket succeeded and you already own it.\")\n // so I pulled it all out\n}", "function uploadFileIntoFolderOfBucket(){\n // Create S3 service object\n s3 = new AWS.S3({apiVersion: '2006-03-01'});\n\n // call S3 to retrieve upload file to specified bucket\n var uploadParams = {Bucket: process.argv[2], Key: '', Body: ''};\n var file = process.argv[4];\n\n // Configure the file stream and obtain the upload parameters\n var fs = require('fs');\n var fileStream = fs.createReadStream(file);\n fileStream.on('error', function(err) {\n console.log('File Error', err);\n });\n\n uploadParams.Body = fileStream;\n var path = require('path');\n uploadParams.Key = process.argv[3]+\"/\"+path.basename(file);\n\n // call S3 to retrieve upload file to specified bucket\n s3.upload (uploadParams, function (err, data) {\n if (err) {\n console.log(\"Error\", err);\n } if (data) {\n console.log(\"Upload Success\", data.Location);\n }\n });\n}", "async function storeOnS3(file) {\n // list acutal files\n const files = await fileListAsync('./output/');\n // if size is reached, gzip, send and rotate file\n for (const file of files) {\n const body = fs.createReadStream(`./output/${file}`);\n\n await new Promise((resolve, reject) => {\n // http://docs.amazonaws.cn/en_us/AWSJavaScriptSDK/guide/node-examples.html#Amazon_S3__Uploading_an_arbitrarily_sized_stream__upload_\n s3.upload({\n Bucket: process.env.S3_BUCKET,\n Key: file,\n Body: body\n })\n //.on('httpUploadProgress', (evt) => { console.log(evt); })\n .send(function (err, data) {\n // console.log(err, data); \n if (err) {\n reject(err);\n }\n resolve(data);\n });\n });\n await removeAsync(`./output/${file}`);\n }\n}", "function saveObjToS3(data, fileName, bucket, callback){\n console.log(\"saveObjToS3\", data);\n //save data to s3 \n var params = {Bucket: bucket, Key: fileName, Body: data, ContentType: 'text/plain'};\n s3.putObject(params, function(err, data) {\n if (err) {\n console.log(\"saveObjToS3 err\", err);\n } else {\n callback();\n }\n });\n}", "function putObject(keyName) {\n const putObjectParams = {\n Bucket: bucket,\n Key: keyName,\n Metadata: {\n importance: 'very',\n ranking: 'middling',\n },\n Body: 'putMe',\n };\n s3Client.putObject(putObjectParams, (err, data) => {\n if (err) console.log('err:', err);\n else console.log('data:', data);\n });\n}", "function uploadFile(bucket, key, fileLocation, callback) {\n fs.readFile(fileLocation, function(err, data) {\n if (err) {\n return callback(err);\n }\n\n var params = {\n Bucket: bucket,\n Key: key + '.webm',\n Body: data\n };\n\n s3.putObject(params, callback);\n });\n}", "function uploadFileToS3(file) {\n const fileStream = fs.createReadStream(file.path)\n const uploadParams = {\n Bucket: 'week18',\n Body: fileStream,\n Key: file.filename\n }\n return s3.upload(uploadParams).promise()\n}", "function uploadS3File(bucketName, fileName, data, callback) {\n var params = {\n Bucket: bucketName,\n Key: fileName,\n Body: data,\n ACL: 'public-read', // TODO: find way to restrict access to this lambda function\n };\n s3.upload(params, function(err, data) {\n callback(err, data);\n });\n}", "function uploadFile(file) {\n const fileStream = fs.createReadStream(file.path);\n\n const uploadParams = {\n Bucket: bucketName,\n Body: fileStream,\n Key: Date.now() + file.originalname,\n };\n\n return s3.upload(uploadParams).promise();\n}", "function uploadFile(file) {\n const fileStream = fs.createReadStream(file.path);\n\n const uploadParams = {\n Bucket: bucketName,\n Body: fileStream,\n Key: file.filename,\n };\n\n return s3.upload(uploadParams).promise();\n}", "async uploadToS3(jsonFile) {\n const params = {\n Bucket: \"time-tracking-storage\",\n Key:\n TIME_PAGE_PREFIX +\n this.state.selectedFile.name.split(CSV_FILE_ATTACHMENT, 1).join(\"\"),\n ContentType: \"json\",\n Body: JSON.stringify(jsonFile),\n };\n\n s3.putObject(params, (err, data) => {\n if (data) {\n this.getListS3();\n } else {\n console.log(\"Error: \" + err);\n this.setState({ labelValue: params.Key + \" not uploaded.\" });\n }\n });\n\n this.setState({\n labelValue: params.Key + \" upload successfully.\",\n selectedFile: null,\n });\n }", "function uploadToS3 (file, infoId) {\n // var s3Credentials = appConfig.s3Credentials();\n // var POLICY = s3Credentials.POLICY\n // var SIGNATURE = s3Credentials.SIGNATURE\n // var ACCESS_KEY = s3Credentials.ACCESS_KEY\n var url = '//app.sitetheory.io:3000/?session=' +\n _.cookie('SITETHEORY') + (infoId ? ('&id=' + infoId) : '')\n\n return Upload.upload({\n url: url,\n method: 'POST',\n data: {\n // AWSAccessKeyId: ACCESS_KEY,\n key: file.name, // the key to store the file on S3, could be\n // file name or customized\n acl: 'private', // sets the access to the uploaded file in the\n // bucket: private, public-read, ...\n // policy: POLICY, // base64-encoded json policy\n // signature: SIGNATURE, // base64-encoded signature based on\n // policy string\n 'Content-Type': file.type !== ''\n ? file.type\n : 'application/octet-stream', // content type of the file\n // (NotEmpty)\n filename: file.name, // this is needed for Flash polyfill IE8-9\n file: file\n }\n })\n }", "async function uploadToS3(bucket, filePath) {\n let params = {\n Bucket: bucket,\n Body: fs.createReadStream(filePath),\n Key: path.basename(filePath)\n };\n\n //Converting async upload function to synchronous\n let s3Upload = Promise.promisify(s3.upload, { context: s3 });\n let uploadResult = await s3Upload(params);\n\n //Throw an error if the upload errored out \n if (!uploadResult.Location || uploadResult.Location.length === 0) {\n throw Error(uploadResult.err);\n }\n}", "function upload(file, remotePath) {\n\tvar deferred = q.defer();\n\tvar body = fs.createReadStream(file);\n\tvar params = {Bucket: bucketName, Key: remotePath, Body: body, ContentType: getContentTypeByFile(file)}\n\ts3.upload(params, function(err, data) {\n\t\tif (err) {\n\t\t\tbody.destroy();\n\t\t\tdeferred.reject(err);\n\t\t} else {\n\t\t\tbody.destroy();\n\t\t\tdeferred.resolve();\n\t\t}\n\t});\n\n\treturn deferred.promise;\n}", "function putObject(bucket, key, obkject) {\n\tif (bucket === null) {\n\t\tbucket = constants.defaultBucket;\n\t}\n\n\tvar params = {\n\t\tBucket : bucket, /* required */\n\t\tKey : key, /* required */\n\t\tBody : obkject\n\t};\n\tconsole.log(\"putObject for \" + JSON.stringify(obkject));\n\ts3.putObject(params, function(err, data) {\n\t\tif (err)\n\t\t\tconsole.log(err, err.stack); // an error occurred\n\t\telse\n\t\t\tconsole.log(data); // successful response\n\t});\n}", "async function uploadToBucket(userId, file, fileType) {\n if (![AUDIO_TYPE, IMAGE_TYPE].includes(fileType)) {\n throw Error(\"File type is invalid!\");\n }\n const params = {\n Bucket: BUCKET_NAME,\n Key: `${fileType}/${userId}/${file.filename}`,\n // I'm running windows so the replacement will be removed when on production\n Body: fs.createReadStream(file.path.replace(\"\\\\\", \"/\"))\n };\n await S3_CONTROL.upload(params).promise();\n fs.unlinkSync(file.path);\n}", "function storeToS3(env, data, callback){\n // get the investigators cached version from AWS.\n if (!isValidEnv(env)){\n callback(\"Invalid env passed into storeToS3()\");\n return;\n }\n // construct the filename from the env\n var filename = getS3FilePath(env);\n var params = {\n Bucket: AWS_BUCKET_NAME,\n Key: filename,\n Body: JSON.stringify(data)\n };\n // upload the file...\n console.log(\"Uploading list to s3...\");\n s3.upload(params, function(err, data){\n if (err){\n callback(\"storeToS3 S3: \" + err);\n } else {\n console.log(\"S3 upload success: s3://\" + AWS_BUCKET_NAME + '/' + filename);\n callback(null, data);\n }\n });\n}", "* put (path, contents, driverOpts={}) {\n return new Promise((resolve, reject) => {\n this.s3.upload(Object.assign({\n Bucket: this.disk.bucket,\n Key: path,\n Body: contents\n }, driverOpts), (err, data) => {\n if (err) return reject(err)\n return resolve(data.Location)\n })\n })\n }", "async function uploadFileToS3(file, getSignedUrl) {\n try {\n const {fileUrl, signedRequestUrl} = await getSignedUrl(file)\n const url = await makeS3Request(fileUrl, signedRequestUrl, file)\n\n return url\n } catch (e) {\n return alert('Could not upload file.')\n }\n}", "function uploadToS3(name, file, successCallback, errorCallback, progressCallback) {\n\n if (typeof successCallback != 'function') {\n Ti.API.error('successCallback() is not defined');\n return false;\n }\n\n if (typeof errorCallback != 'function') {\n Ti.API.error('errorCallback() is not defined');\n return false;\n }\n\n var AWSAccessKeyID = 'AKIAJHRVU52E4GKVARCQ';\n var AWSSecretAccessKey = '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';\n var AWSBucketName = 'snapps';\n var AWSHost = AWSBucketName + '.s3.amazonaws.com';\n\n var currentDateTime = formatDate(new Date(),'E, d MMM yyyy HH:mm:ss') + ' ' + getOffsetAsInteger();\n\n var xhr = Ti.Network.createHTTPClient();\n\n xhr.onsendstream = function(e) {\n\n if (typeof debugStartTime != 'number') {\n debugStartTime = new Date().getTime();\n }\n\n debugUploadTime = Math.floor((new Date().getTime() - debugStartTime) / 1000);\n\n var progress = Math.floor(e.progress * 100);\n Ti.API.info('uploading (' + debugUploadTime + 's): ' + progress + '%');\n\n // run progressCallback function when available\n if (typeof progressCallback == 'function') {\n progressCallback(progress);\n }\n\n };\n\n xhr.onerror = function(e) {\n Ti.API.error({ errorlocation: 'onload', error: e, responseText: xhr.responseText, headers: xhr.getResponseHeaders() });\n errorCallback(e);\n };\n\n xhr.onload = function() {\n if (this.status >= 200 && this.status < 300) {\n\n var responseHeaders = xhr.getResponseHeaders();\n\n var filename = name;\n var url = 'https://' + AWSHost + '/' + name;\n\n if (responseHeaders['x-amz-version-id']) {\n url = url + '?versionId=' + responseHeaders['x-amz-version-id'];\n }\n\n successCallback({ url: url });\n }\n else {\n Ti.API.error({ errorlocation: 'onload', error: e, responseText: xhr.responseText, headers: xhr.getResponseHeaders() });\n errorCallback();\n }\n };\n\n //ensure we have time to upload\n xhr.setTimeout(99000);\n\n // An optional boolean parameter, defaulting to true, indicating whether or not to perform the operation asynchronously.\n // If this value is false, the send() method does not return until the response is received. If true, notification of a\n // completed transaction is provided using event listeners. This must be true if the multipart attribute is true, or\n // an exception will be thrown.\n xhr.open('PUT', 'https://' + AWSHost + '/' + name, true);\n\n //var StringToSign = 'PUT\\n\\nmultipart/form-data\\n' + currentDateTime + '\\nx-amz-acl:public-read\\n/' + AWSBucketName + '/' + name;\n var StringToSign = 'PUT\\n\\n\\n' + currentDateTime + '\\nx-amz-acl:public-read\\n/' + AWSBucketName + '/' + name;\n var AWSSignature = b64_hmac_sha1(AWSSecretAccessKey, Utf8.encode(StringToSign));\n var AuthorizationHeader = 'AWS ' + AWSAccessKeyID + ':' + AWSSignature;\n\n xhr.setRequestHeader('Authorization', AuthorizationHeader);\n //xhr.setRequestHeader('Content-Type', 'multipart/form-data');\n xhr.setRequestHeader('X-Amz-Acl', 'public-read');\n xhr.setRequestHeader('Host', AWSHost);\n xhr.setRequestHeader('Date', currentDateTime);\n\n xhr.send(file);\n\n return xhr;\n}", "async function uploadFile(file) {\n const fileStream = fs.createReadStream(file.path);\n\n const uploadParams = {\n Bucket: AWS_BUCKET_NAME,\n Body: fileStream,\n Key: file.filename\n }\n\n return s3.upload(uploadParams).promise()\n}", "function uploadFile(file, signedRequest, url){\n const xhr = new XMLHttpRequest();\n xhr.open('PUT', signedRequest);\n xhr.setRequestHeader('Content-Type', \"text/csv\")\n xhr.onreadystatechange = () => {\n if(xhr.readyState === 4){\n if(xhr.status === 200){\n //console.log('upload to s3 success');\n }\n else{\n alert('Could not upload file.');\n }\n }\n };\n xhr.send(file);\n}", "function s3Upload(files, bucketName, objectKeyPrefix, iamUserKey, iamUserSecret, callback) {\n var s3 = new AWS.S3({\n bucket: bucketName,\n accessKeyId: iamUserKey,\n secretAccessKey: iamUserSecret,\n apiVersion: '2006-03-01',\n });\n\n // s3.abortMultipartUpload(params, function (err, data) {\n // if (err) console.log(err, err.stack); // an error occurred\n // else console.log(data); // successful response\n // });\n\n // Setup the objects to upload to S3 & map the results into files\n var results = files.map(function(file) {\n // Upload file to bucket with name of Key\n s3.upload({\n Bucket: bucketName,\n Key: objectKeyPrefix + file.originalname, // Prefix should have \".\" on each end\n Body: file.buffer,\n ACL: 'public-read' // TODO: CHANGE THIS & READ FROM CLOUDFRONT INSTEAD\n },\n function(error, data) {\n // TODO: Maybe refine this to show only data care about elsewhere\n if(error) {\n console.log(\"Error uploading file to S3: \", error);\n return {error: true, data: error};\n } else {\n console.log('File uploaded. Data is:', data);\n return {error: false, data: data};\n }\n });\n });\n\n callback(results); // Results could be errors or successes\n}", "async upload_file_toS3(filename, extension) {\n try {\n\n var username = await AsyncStorage.getItem(\"username\");\n var s3config = require(\"./config/AWSConfig.json\");\n var signedurl = await this.getsignedurl(s3config.s3bucketname, s3config.s3folder + \"/\" + username + \"/\" + filename + extension, \"put\");\n\n\n\n let dirs = RNFetchBlob.fs.dirs;\n\n const result = await RNFetchBlob.fetch('PUT', signedurl, {\n 'Content-Type': 'image/jpg',\n }, RNFetchBlob.wrap(dirs.DocumentDir + s3config.localimagestore + filename + extension));\n\n //alert(result.respInfo.status);\n if (result.respInfo.status == 200)\n return true;\n else\n return false;\n\n }\n catch (error) {\n return false;\n //alert(error.message);\n }\n\n }", "async function uploadS3(filePath, folderName, deleteFile, callback) {\n\n var s3 = new AWS.S3({useAccelerateEndpoint: true});\n //configuring parameters\n var params = {\n Bucket: 'docintact',\n Body: fs.createReadStream(filePath),\n Key: folderName + \"/\" + Date.now() + \"_\" + path.basename(filePath)\n };\n s3.upload(params, function(err, data) {\n //handle error\n if (err) {}\n //success\n if (data) {\n if (deleteFile)\n if (fs.existsSync(filePath)) fs.unlinkSync(filePath)\n if (callback) callback(data.Location);\n else return data.Location;\n }\n });\n}", "function upload(object, name) {\n var params = {\n localFile: object.path,\n s3Params: {\n Bucket: 'giscollective',\n Key: 'projectlinework/' + name + '.zip',\n ACL: 'public-read'\n },\n };\n var uploader = client.uploadFile(params);\n uploader.on('error', function(err) {\n console.error(\"unable to upload:\", err.stack);\n });\n uploader.on('progress', function() {\n console.log(\"progress\", uploader.progressMd5Amount, uploader.progressAmount, uploader.progressTotal);\n });\n uploader.on('end', function() {\n console.log(\"done uploading\");\n });\n}", "function uploadAndFetch (s3, stream, filename, bucket, key) {\n var deferred = when.defer();\n exports.getFileStream(filename)\n .pipe(stream)\n .on(\"error\", deferred.reject)\n .on(\"finish\", function () {\n deferred.resolve(exports.getObject(s3, bucket, key));\n });\n return deferred.promise;\n}", "async put(rawUrl, inputStream, headers, storageMetadata) {\n assert(rawUrl, 'must provide raw input url');\n assert(inputStream, 'must provide an input stream');\n assert(headers, 'must provide HTTP headers');\n assert(storageMetadata, 'must provide storage provider metadata');\n\n // We decode the key because the S3 library 'helpfully'\n // URL encodes this value\n let request = {\n Bucket: this.bucket,\n Key: rawUrl,\n Body: inputStream,\n ACL: 'public-read',\n Metadata: storageMetadata,\n };\n\n _.forEach(HTTPHeaderToS3Prop, (s3Prop, httpHeader) => {\n if (_.includes(DisallowedHTTPHeaders, httpHeader)) {\n throw new Error(`The HTTP header ${httpHeader} is not allowed`);\n } else if (_.includes(MandatoryHTTPHeaders, httpHeader)) {\n assert(headers[httpHeader], `HTTP Header ${httpHeader} must be specified`);\n }\n request[s3Prop] = headers[httpHeader];\n });\n\n let options = {\n partSize: this.partSize,\n queueSize: this.queueSize,\n };\n\n let upload = this.s3.upload(request, options);\n\n this.debug('starting S3 upload');\n let result = await wrapSend(upload);\n this.debug('completed S3 upload');\n return result;\n }", "function uploadFile(path, key) {\n\treturn new Promise((resolve, reject) => {\n\t\tfs.readFile(path, (ferr, data) => {\n\t\t\tif (!ferr) {\n\t\t\t\ts3.upload({\n\t\t\t\t\tKey: key,\n\t\t\t\t\tBody: data,\n\t\t\t\t\tACL: \"public-read\"\n\t\t\t\t}, (uerr, data) => {\n\t\t\t\t\tif (!uerr) {\n\t\t\t\t\t\tresolve(data);\n\t\t\t\t\t} else {\n\t\t\t\t\t\treject(`Unable to upload file: ${uerr}`);\n\t\t\t\t\t\tif (DEBUG) console.error(uerr);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\treject(`Unable to read file (${path}) for upload: ${ferr}`);\n\t\t\t\tif (DEBUG) console.error(ferr);\n\t\t\t}\n\t\t});\n\t});\n}", "function makeS3Request(fileUrl, signedRequestUrl, file) {\n return new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest()\n\n xhr.onreadystatechange = () => {\n if (xhr.readyState === 4) {\n if (xhr.status === 200) {\n resolve(fileUrl)\n } else {\n reject({\n status: xhr.status,\n statusText: xhr.statusText,\n })\n }\n }\n }\n\n xhr.open('PUT', signedRequestUrl)\n xhr.send(file)\n })\n}", "function toS3Upload(req, res){\n\n req.s3Key = uuid.v4();\n\n //Set important params for s3 bucket upload\n const s3Params = {\n Bucket: config.awsBucketName,\n Key: `${req.s3Key}-${req.imageType}`,\n Body: req.file.buffer\n }\n\n //Promise to see whether or not the image upload was a success\n return new Promise( (resolve, reject) => {\n return s3.upload(s3Params, (err, data) => {\n if (err) return reject(err);\n return resolve({\n //File was uploaded successfully\n status: \"Everything OK\"\n })\n })\n })\n}", "function uploadFile(file, key, folder) {\n\t\tvar s3,\n\t\t\tparams,\n\t\t\tstream,\n\t\t\tdeferred;\n\n\t\tdeferred = Q.defer();\n\n\t\tconsole.log(\"upload file\");\n\n\t\ts3 = new AWS.S3({ endpoint :'https://s3-eu-west-1.amazonaws.com'});\n\n\t\tstream = fs.createReadStream(file.path);\n\t\t\n\t\tparams = {\n\t\t\tBucket: folder,\n\t\t\tKey: key,\n\t\t\tBody: stream,\n\t\t\tContentType: file.type,\n\t\t\tContentLength: file.size,\n\t\t}\n\n\t\ts3.upload(params, function(err, data) {\n\t\t\tif(err) {\n\t\t\t\tconsole.log(err);\n\t\t\t\tdeferred.reject(err);\n\t\t\t}\n\n\t\t\tconsole.log('Successfully uploaded package. key:' + key);\n\t\t console.log(data);\n\t\t deferred.resolve(key);\n\t\t});\n\n\t\treturn deferred.promise;\n\t}", "async storeInCloudStorage(file) {\n await uploadFile(BUCKET_NAME, file);\n }", "async function upload_file(file_loc, key) {\n\n\treturn await new Promise((resolve, reject) => {\n\n\t\tlet uploadParams = { Bucket: 'fstraces', Key: key , Body: ''};\n\n\t\t// create a filestream for upload to S3\n\t\tconst fileStream = fs.createReadStream(file_loc);\n\t\tfileStream.on('error', function(err) {\n\t\t\treject(err);\n\t\t});\n\t\tuploadParams.Body = fileStream;\n\t\ts3.upload (uploadParams, function (err, data) {\n\t\t\tif (err) reject(err);\n\t\t\telse resolve(file_loc);\n\t\t});\n\t});\n\n}", "function fetchAndStoreObject(bucket, key, fn) {\n\tif (bucket === null) {\n\t\tbucket = constants.defaultBucket;\n\t}\n\tvar params = {\n\t\tBucket : bucket, /* required */\n\t\tKey : key\n\t/* required */\n\t};\n\tconsole.log(\"getObject for \" + JSON.stringify(params));\n\tvar file = fs.createWriteStream('/tmp/' + key);\n\ts3.getObject(params).on('httpData', function(chunk) {\n\t\tfile.write(chunk);\n\t\t// console.log(\"writing chunk in file.\"+key);\n\t}).on('httpDone', function() {\n\t\tfile.end();\n\t\tconsole.log(\"file end.\" + key);\n\t\tfn();\n\t}).send();\n}", "async function uploadImageToS3(imageUrl, idx) {\n\n const image = await readImageFromUrl(imageUrl, idx);\n\n const imagePath = imageUrl.split(`https://divisare-res.cloudinary.com/`)[1];\n const objectParams = {\n Bucket: 'bersling-divisaire',\n // i already created /aaa-testing, /testing and testing :)\n Key: `images6/${imagePath}`,\n Body: image,\n ContentType: 'image/jpg'\n };\n // Create object upload promise\n const uploadPromise = new AWS.S3({apiVersion: '2006-03-01', region: 'eu-central-1'})\n .putObject(objectParams)\n .promise();\n uploadPromise\n .then((data) => {\n // nothing to do...\n logger(`uploaded image...`);\n }).catch(err => {\n logger(\"ERROR\");\n logger(err);\n });\n return uploadPromise;\n\n\n}", "function putBucketAcl() {\n const putBucketAclParams = {\n Bucket: bucket,\n ACL: 'authenticated-read',\n };\n s3Client.putBucketAcl(putBucketAclParams, (err, data) => {\n if (err) console.log('err:', err);\n else console.log('data:', data);\n });\n}", "function upload_private_S3_resource(file, folder, cFunc) {\n\tvar xhr = new XMLHttpRequest();\n\t// var amz_sign_s3 is defined in script on HTML page\n\txhr.open(\"GET\", amz_sign_s3+\"?file_name=\"+file.name+\"&file_type=\"+file.type+\"&folder=\"+folder);\n\txhr.onreadystatechange = function(){\n\t\tif(xhr.readyState === 4){\n\t\t\tif(xhr.status === 200){\n\t\t\t\tvar response = JSON.parse(xhr.responseText);\n\t\t\t\tupload_file(file, response.signed_request, response.url, cFunc);\n\t\t\t}\n\t\t\telse{\n\t\t\t\talert(\"Could not get signed URL.\");\n\t\t\t}\n\t\t}\n\t};\n\txhr.send();\n}", "presignedPutObject(bucketName, objectName, expires, cb) {\n if (!isValidBucketName(bucketName)) {\n throw new errors.InvalidBucketNameError(`Invalid bucket name: ${bucketName}`)\n }\n if (!isValidObjectName(objectName)) {\n throw new errors.InvalidObjectNameError(`Invalid object name: ${objectName}`)\n }\n return this.presignedUrl('PUT', bucketName, objectName, expires, cb)\n }", "function awsUpload() {\n\n //configuring the AWS environment\n AWS.config.update({\n accessKeyId: \"AKIAIYOTGRTBNHAJOWKQ\",\n secretAccessKey: \"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\"\n });\n var s3 = new AWS.S3();\n var filePath = \"./images/\" + imageLocation;\n\n //Configuring Parameters\n var params = {\n Bucket: 'pricefinder-bucket',\n Body: fs.createReadStream(filePath),\n Key: \"images/\" + Date.now() + \"_\" + path.basename(filePath)\n };\n\n //Uploading to s3 Bucket\n s3.upload(params, function (err, data) {\n //if an error occurs, handle it\n if (err) {\n console.log(\"Error\", err);\n }\n if (data) {\n console.log();\n console.log(\"Uploaded in:\", data.Location);\n console.log();\n }\n });\n\n customVision();\n\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 }", "uploadImage(uploader, filename, file, encoding, mimeType, callback){\n if(mimeType.toLowerCase().indexOf(\"image\") >= 0){\n s3Client.upload({\n \"Bucket\" : \"purecloudkiosk\",\n \"Key\" : uploader.organization + \"/\" + uploader.personID + \"/\" + Date.now() + \"-\" + filename,\n \"Body\" : file,\n \"ContentEncoding\" : encoding,\n \"ContentType\" : mimeType\n }, callback);\n }\n else{\n callback({\"error\" : \"Incorrect Mimetype\"});\n }\n }", "async uploadFile(req,res){\n //let item = req.body;\n let keyName = uid.randomUUID(8);\n // check if there's already a file with this ID\n while(await retrieve(keyName)){\n keyName = uid.randomUUID(8);\n }\n\n try{\n const origName = req.files[0].originalname;\n fs.readFile(req.files[0].path,(err,data)=>{\n if(err)throw err;\n const params = {\n Key: keyName,\n Body: data\n };\n s3.upload(params,(err,data)=>{\n fs.unlink(req.files[0].path,(err)=>{\n if(err)return res.status(400).send('error');\n });\n return err ? \n res.status(400).send('error') :\n files.create({\n id: keyName,\n fileName: origName\n }).then(file => res.status(201).send(req.headers.host+req.originalUrl+'/'+keyName))\n .catch(err => res.status(400).send('error'));\n\n });\n }); // end of fs.readfile\n }catch(err){return res.status(400).send('error')}\n\n }", "fPutObject(bucketName, objectName, filePath, metaData, callback) {\n if (!isValidBucketName(bucketName)) {\n throw new errors.InvalidBucketNameError('Invalid bucket name: ' + bucketName)\n }\n if (!isValidObjectName(objectName)) {\n throw new errors.InvalidObjectNameError(`Invalid object name: ${objectName}`)\n }\n\n if (!isString(filePath)) {\n throw new TypeError('filePath should be of type \"string\"')\n }\n if (isFunction(metaData)) {\n callback = metaData\n metaData = {} // Set metaData empty if no metaData provided.\n }\n if (!isObject(metaData)) {\n throw new TypeError('metaData should be of type \"object\"')\n }\n\n // Inserts correct `content-type` attribute based on metaData and filePath\n metaData = insertContentType(metaData, filePath)\n\n fs.lstat(filePath, (err, stat) => {\n if (err) {\n return callback(err)\n }\n return this.putObject(bucketName, objectName, fs.createReadStream(filePath), stat.size, metaData, callback)\n })\n }", "uploadToS3(e) {\n this.setState({\n loading: true,\n serviceImageFlag: false\n });\n ReactS3.uploadFile(e.target.files[0], config)\n .then((response)=> {\n this.setState({\n image: response.location,\n loading: false,\n serviceImageFlag: true,\n imageHolder: \"\"\n })\n },\n )\n }", "putObject(bucketName, objectName, stream, size, metaData, callback) {\n if (!isValidBucketName(bucketName)) {\n throw new errors.InvalidBucketNameError('Invalid bucket name: ' + bucketName)\n }\n if (!isValidObjectName(objectName)) {\n throw new errors.InvalidObjectNameError(`Invalid object name: ${objectName}`)\n }\n\n // We'll need to shift arguments to the left because of size and metaData.\n if (isFunction(size)) {\n callback = size\n metaData = {}\n } else if (isFunction(metaData)) {\n callback = metaData\n metaData = {}\n }\n\n // We'll need to shift arguments to the left because of metaData\n // and size being optional.\n if (isObject(size)) {\n metaData = size\n }\n\n // Ensures Metadata has appropriate prefix for A3 API\n metaData = prependXAMZMeta(metaData)\n if (typeof stream === 'string' || stream instanceof Buffer) {\n // Adapts the non-stream interface into a stream.\n size = stream.length\n stream = readableStream(stream)\n } else if (!isReadableStream(stream)) {\n throw new TypeError('third argument should be of type \"stream.Readable\" or \"Buffer\" or \"string\"')\n }\n\n if (!isFunction(callback)) {\n throw new TypeError('callback should be of type \"function\"')\n }\n\n if (isNumber(size) && size < 0) {\n throw new errors.InvalidArgumentError(`size cannot be negative, given size: ${size}`)\n }\n\n // Get the part size and forward that to the BlockStream. Default to the\n // largest block size possible if necessary.\n if (!isNumber(size)) {\n size = this.maxObjectSize\n }\n\n size = this.calculatePartSize(size)\n\n // s3 requires that all non-end chunks be at least `this.partSize`,\n // so we chunk the stream until we hit either that size or the end before\n // we flush it to s3.\n let chunker = new BlockStream2({ size, zeroPadding: false })\n\n // This is a Writable stream that can be written to in order to upload\n // to the specified bucket and object automatically.\n let uploader = new ObjectUploader(this, bucketName, objectName, size, metaData, callback)\n // stream => chunker => uploader\n pipesetup(stream, chunker, uploader)\n }", "function create(files){\n\tvar AWS = require('aws-sdk');\n\n\tvar awsConfig = new AWS.Config({\n\t\taccessKeyId: config.accessKeyId, \n\t\tsecretAccessKey:config.secretAccessKey,\n\t\tregion: config.region\n\t});\n\n\tAWS.config=awsConfig;\n\n\tvar s3 = new AWS.S3( { params: {Bucket: config.s3BucketName} } );\t\n\n\tvar date = new Date();\n\tfiles.forEach(function(item){\n\t\tvar options={\n\t\t\tKey:item.filename,\n\t\t Body:new Buffer(item.data.replace(/^data:image\\/\\w+;base64,/, \"\"),'base64'),\n\t\t ContentEncoding: 'base64',\n\t\t ContentType: 'image/jpeg'\n\t\t};\n\n\t\ts3.putObject(options, function(err,data){\n\t\t\tif(err){\n\t\t\t\tconsole.log('~~error~',err);\n\t\t\t}else{\n\t\t\t\tconsole.log('~~success~'+date.toTimeString());\n\t\t\t}\n\t\t});\n\t});\n}", "function deleteFile(fileKey) {\n var params = {\n Bucket: bucketName,\n Key: fileKey,\n };\n\n s3.deleteObject(params, function (err, data) {\n if (err) console.log(err, err.stack);\n console.log('deleted!');\n });\n}", "function s3_upload_img(extension, file_in, try_in){\n var trynum = try_in;\n filename = file_in;\n var s3upload = new S3Upload({\n file_dom_selector: 'img_file',\n s3_sign_put_url: '/sign_s3_put/',\n s3_object_name: filename,\n onProgress: function(percent, message) {\n $('#img_status').text(\"Uploading: \" + percent + \"%\");\n },\n onFinishS3Put: function(url) {\n $(\"#id_img_url\").val(url);\n $('#image_preview').attr('src', url);\n enable_button();\n },\n onError: function(status) {\n if(trynum < 1){ //amount of tries\n console.log(\"upload error #\" + trynum + \" of type \" + status + \", retrying..\");\n trynum++;\n s3_upload_img(extension, file_in, trynum);\n }\n else{\n console.log(\"upload error #\" + trynum + \", giving up.\");\n $('#img_status').html('Upload error: ' + status);\n }\n }\n });\n}", "putObject(image, options) {\n const params = {\n Bucket: image.bucketName,\n Key: image.fileName,\n Body: image.data,\n Metadata: Object.assign({}, image.headers.Metadata, {\"cdn-processed\": \"true\"}),\n ContentType: image.headers.ContentType,\n CacheControl: (options.cacheControl !== undefined) ? options.cacheControl : image.headers.CacheControl,\n ACL: image.acl || \"private\"\n };\n\n console.log(\"Uploading to: \" + params.Key + \" (\" + params.Body.length + \" bytes)\");\n\n return this.client.putObject(params).promise();\n }", "put(file) {\n if (file.data.size > this.opts.maxFileSize) {\n return Promise.reject(new Error('File is too big to store.'));\n }\n\n return this.getSize().then(size => {\n if (size > this.opts.maxTotalSize) {\n return Promise.reject(new Error('No space left'));\n }\n\n return this.ready;\n }).then(db => {\n const transaction = db.transaction([STORE_NAME], 'readwrite');\n const request = transaction.objectStore(STORE_NAME).add({\n id: this.key(file.id),\n fileID: file.id,\n store: this.name,\n expires: Date.now() + this.opts.expires,\n data: file.data\n });\n return waitForRequest(request);\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}", "presignedPutObject(bucketName, objectName, expires) {\n if (!validateBucketName(bucketName)) {\n throw new errors.InvalidateBucketNameException('Invalid bucket name: ' + bucketName)\n }\n if (objectName === null || objectName.trim() === '') {\n throw new errors.InvalidObjectNameException('Object name cannot be empty')\n }\n var requestParams = {\n host: this.params.host,\n port: this.params.port,\n protocol: this.params.protocol,\n path: `/${bucketName}/${uriResourceEscape(objectName)}`,\n method: 'PUT',\n expires: expires\n }\n return presignSignatureV4(requestParams, this.params.accessKey, this.params.secretKey)\n }", "function createBucket(){\n // Create S3 service object\n s3 = new AWS.S3({apiVersion: '2006-03-01'});\n\n // Create the parameters for calling createBucket\n var bucketParams = {\n Bucket : process.argv[2],\n ACL : 'public-read'\n };\n\n // call S3 to create the bucket\n s3.createBucket(bucketParams, function(err, data) {\n if (err) {\n console.log(\"Error\", err);\n } else {\n console.log(\"Success\", data.Location);\n }\n });\n}", "getImageFromURL(URL, fileName, bucket, callback) {\n var options = {\n uri: URL,\n encoding: null\n };\n request(options, function (error, response, body) {\n if (error || response.statusCode !== 200) {\n console.log(\"failed to get image\", URL);\n console.log(error);\n if(response.statusCode !== 200){\n console.log(\"200 status not received for URL:\", options.uri);\n }\n } else {\n s3.putObject({\n Body: body,\n Key: fileName,\n Bucket: bucket\n }, function (error, data) {\n if (error) {\n console.log(\"error downloading image to s3\", fileName);\n } else {\n // console.log(\"body:\", body);\n // console.log(\"success uploading to s3\", fileName);\n }\n });\n }\n });\n }", "function combineObjectWithCachedS3File(config, upload, downloadDict, s3, key, newObj, callback) {\n var localFilename = config.workingDir + \"/\" + config.outBucket + \"/\" + key;\n var localDir = localFilename.substring(0, localFilename.lastIndexOf('/'));\n\n var inFlight = downloadDict[localFilename];\n if (inFlight) {\n //console.log(\"Download race condition avoided, queued\", key, newObj);\n inFlight.obj = tarasS3.combineObjects(newObj, inFlight.obj);\n inFlight.callbacks.push(callback);\n return; // we are done, our callback will get called as part of original inFlight request\n } else {\n downloadDict[localFilename] = inFlight = {'obj':newObj, 'callbacks':[callback]};\n }\n\n async.waterfall([\n // try to read file from local cache before we go to out to s3\n function (callback) {\n fs.readFile(localFilename, function (err, data) {\n function fallback() {\n var params = {'s3':s3, 'params':{'Bucket': config.outBucket, 'Key':key}};\n return tarasS3.S3GetObjectGunzip(params, function (err, data) {\n if (err) {\n // 404 on s3 means this object is new stuff\n if (err.statusCode == 404)\n return callback(null, {});\n else\n return callback(err);\n }\n callback(null, JSON.parse(data));\n })\n }\n // missing file or invalid json are both reasons for concern\n if (err) {\n return fallback()\n }\n var obj;\n try {\n obj = JSON.parse(data)\n }catch(e) {\n return fallback()\n }\n callback(null, obj);\n });\n },\n function (obj, callback) {\n inFlight.obj = tarasS3.combineObjects(inFlight.obj, obj);\n mkdirp.mkdirp(localDir, callback);\n },\n function(ignore, callback) {\n str = JSON.stringify(inFlight.obj);\n delete downloadDict[localFilename];\n upload(key, localFilename, str, callback);\n }\n ],function (err, data) {\n if (err)\n return callback(err);\n inFlight.callbacks.forEach(function (callback) {callback(null, key)});\n });\n}", "async function downloadFile(s3Object) {\n const getParams = {Bucket: bucketName, Key: s3Object.Key};\n const fileWriteStream = fs.createWriteStream(path.join(cryptoFolder, s3Object.Key));\n return new Promise((resolve, reject) => {\n s3.getObject(getParams).createReadStream()\n .on('end', () => {\n return resolve();\n }).on('error', (error) => {\n return reject(error);\n }).pipe(fileWriteStream)\n });\n}", "function upload(file, callback) {\n return request.post('images/s3/upload')\n .attach('imageFile', file)\n .set('Accept', 'application/json')\n .end((err, res) => {\n if (err) {\n console.log(err);\n }\n else {\n var imageKey = res.text\n callback(imageKey)\n }\n })\n}", "function uploadImage(image, project_id, idx) {\n fs.readFile(image.path, (err, imageBuffer) => {\n\n const params = {\n Bucket: process.env.AWS_BUCKET_NAME,\n Key: `${project_id}/${idx}.png`,\n Body: imageBuffer,\n };\n s3.putObject(params, () => {});\n });\n}", "putFile(folder, key, file) {\r\n throw \"putFile(folder,key,file) Not Implemented\";\r\n }", "function addS3bucket (req, res, next) {\n if (req.params.s3bucket) return next()\n req.params.s3bucket = [process.env.APP_NAME, req.params.appname].join('.')\n next()\n}", "function getS3File(bucketName, fileName, versionId, callback) {\n var params = {\n Bucket: bucketName,\n Key: fileName\n };\n if (versionId) {\n params.VersionId = versionId;\n }\n s3.getObject(params, function (err, data) {\n callback(err, data);\n });\n}", "function stream_to_s3(repo_name)\n{\n\t//\n\t// 1. Wrap the S3 upload() function with the node.js stream.PassThrough()\n\t// stream.\n\t//\n\tlet pass = new stream.PassThrough();\n\n\t//\n\t// 2. Create the file name to be used when saving the file.\n\t//\n\tlet file_name = repo_name + \".tgz\"\n\n\t//\n\t// 3. Prepare the action to be performed.\n\t//\n\tlet params = {\n\t\tBucket: \"repos.dev\",\n\t\tKey: file_name,\n\t\tACL: 'private',\n\t\tBody: pass,\n\t};\n\n\n\t//\n\t// 4. Upload data to Amazon S3.\n\t//\n\ts3.upload(params, function(res_error, data) {\n\n\t\t//\n\t\t// 1. Check for an error.\n\t\t//\n\t\tif(res_error)\n\t\t{\n\t\t\tthrow res_error;\n\t\t}\n\n\t});\n\n\t//\n\t// -> Pass the stream to the next pipe.\n\t//\n\treturn pass;\n}", "function uploadPhoto(photo, sender) {\n var photoName = generatePhotoName();\n var params = {\n Bucket: $rootScope.AWSS3Bucket,\n Key: KEY + photoName,\n Body: photo\n };\n $rootScope.s3.putObject(params, function (err, data) {\n if (err) {\n // There Was An Error With Your S3 Config\n console.log(\"There was an error with s3 config: \" + err.message);\n $rootScope.$broadcast(BROADCASTING_PREFIX + sender, {success: false, data: err.message});\n }\n else {\n console.log(\"Profile pic upload complete.\");\n $rootScope.dealer.photo = KEY + photoName;\n $rootScope.$broadcast(BROADCASTING_PREFIX + sender, {success: true, data: data});\n }\n });\n }", "async uploadIfChanged(data, props) {\n const s3 = await this.props.sdk.s3(this.props.environment.account, this.props.environment.region, credentials_1.Mode.ForWriting);\n const s3KeyPrefix = props.s3KeyPrefix || '';\n const s3KeySuffix = props.s3KeySuffix || '';\n const bucket = this.props.bucketName;\n const hash = archive_1.contentHash(data);\n const filename = `${hash}${s3KeySuffix}`;\n const key = `${s3KeyPrefix}${filename}`;\n const url = `s3://${bucket}/${key}`;\n logging_1.debug(`${url}: checking if already exists`);\n if (await objectExists(s3, bucket, key)) {\n logging_1.debug(`${url}: found (skipping upload)`);\n return { filename, key, hash, changed: false };\n }\n const uploaded = { filename, key, hash, changed: true };\n // Upload if it's new or server-side copy if it was already uploaded previously\n const previous = this.previousUploads[hash];\n if (previous) {\n logging_1.debug(`${url}: copying`);\n await s3.copyObject({\n Bucket: bucket,\n Key: key,\n CopySource: `${bucket}/${previous.key}`\n }).promise();\n logging_1.debug(`${url}: copy complete`);\n }\n else {\n logging_1.debug(`${url}: uploading`);\n await s3.putObject({\n Bucket: bucket,\n Key: key,\n Body: data,\n ContentType: props.contentType\n }).promise();\n logging_1.debug(`${url}: upload complete`);\n this.previousUploads[hash] = uploaded;\n }\n return uploaded;\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 deleteFileFromS3(key) {\n const deleteParams = {\n Bucket: 'week18',\n Key: key,\n }\n return s3.deleteObject(deleteParams).promise()\n}", "async function deleteFileFromFolder(){\n const params = {\n Bucket:process.argv[2],\n Key: process.argv[3] //if any sub folder-> path/of/the/folder.ext \n }\n s3=new AWS.S3({apiVersion: '2006-03-01'});\n try {\n await s3.headObject(params).promise()\n console.log(\"File Found in S3\")\n try {\n await s3.deleteObject(params).promise()\n console.log(\"file deleted Successfully\")\n }\n catch (err) {\n console.log(\"ERROR in file Deleting : \" + JSON.stringify(err))\n }\n } \n catch (err) {\n console.log(\"File not Found ERROR : \" + err.code)\n }\n\n}", "function upload(){\n const {Storage} = require('@google-cloud/storage');\n\n // Your Google Cloud Platform project ID\n const projectId = 'check-221407';\n\n // Creates a client\n const storage = new Storage({\n projectId: projectId,\n });\n\n /**\n * TODO(developer): Uncomment the following lines before running the sample.\n */\n const bucketName = 'cal_ballots';\n const filename = 'hint10.JPG';\n\n // Uploads a local file to the bucket\n await storage.bucket(bucketName).upload(filename, {\n // Support for HTTP requests made with `Accept-Encoding: gzip`\n gzip: true,\n metadata: {\n // Enable long-lived HTTP caching headers\n // Use only if the contents of the file will never change\n // (If the contents will change, use cacheControl: 'no-cache')\n cacheControl: 'public, max-age=31536000',\n },\n });\n\n console.log(`${filename} uploaded to ${bucketName}.`);\n}", "function before (s3, bucket, keys, done) {\n createBucket(s3, bucket)\n .then(function () {\n return when.all(\n // Swallow deleteObject errors here incase the files don't yet exist\n keys.map(function (key) { return deleteObject(s3, bucket, key).catch(function () {}); })\n )\n }).then(function () { done(); });\n}", "static deleteFile (bucketName, objectKey) {\n const s3 = Storage._getS3Instance();\n const params = {\n Bucket: bucketName,\n Key: objectKey\n };\n return new Promise((resolve, reject) => {\n s3.deleteObject(params, (err, data) => err ? reject(err) : resolve());\n });\n }", "putFile(path,data,callback) { this.engine.putFile(path,data,callback); }", "async syncDirectory() {\n const s3Bucket = this.serverless.variables.service.custom.s3Bucket;\n const args = ['s3', 'sync', 'build/', `s3://${s3Bucket}/`, '--delete'];\n const exitCode = await this.runAwsCommand(args);\n if (!exitCode) {\n this.serverless.cli.log('Successfully synced to the S3 bucket');\n } else {\n throw new Error('Failed syncing to the S3 bucket');\n }\n }", "function putFile(file, path) {\n filename = '/';\n if (path !== undefined && !path.startsWith('/')) {\n filename += path;\n }else if (path !== undefined && path.startsWith('/')) {\n filename = path;\n }else if(file.name !== undefined){\n filename = file.name.replace(/^.*?([^\\\\\\/]*)$/, '$1');\n\n }\n var url = 'https://content.dropboxapi.com/2/files/upload';\n var dropboxApiArg = {\n path: filename,\n mode: 'overwrite'\n };\n var fd = new FormData();\n fd.append('file', file, filename);\n return $.ajax({\n type: 'POST',\n url: url,\n data: fd,\n dataType: 'JSON',\n processData: false,\n contentType: false,\n beforeSend: function(request) {\n request.setRequestHeader(\"Authorization\", 'Bearer ' + access_token);\n request.setRequestHeader(\"Dropbox-API-Arg\", JSON.stringify(dropboxApiArg));\n request.setRequestHeader(\"Content-Type\", 'application/octet-stream');\n }\n });\n }", "function getPutSignedUrl(key) {\n const signedUrlExpireSeconds = 60 * 5;\n return exports.s3.getSignedUrl('putObject', {\n Bucket: config_1.config.aws_media_bucket,\n Key: key,\n Expires: signedUrlExpireSeconds,\n });\n}", "* url (path) {\n return `https://${this.disk.bucket}.s3.amazonaws.com/${path}`\n }", "async function copyFile() {\n // Copies the file to the other bucket\n await storage\n .bucket(srcBucket)\n .file(file.name)\n .copy(storage.bucket(finalBucket).file(fileName));\n\n }", "function verifyFileInS3(req, res) {\n function headReceived(err, data) {\n if (err) {\n res.status(500);\n console.log(err);\n res.end(JSON.stringify({error: \"Problem querying S3!\"}));\n }\n else if (expectedMaxSize != null && data.ContentLength > expectedMaxSize) {\n res.status(400);\n res.write(JSON.stringify({error: \"Too big!\"}));\n deleteFile(req.body.bucket, req.body.key, function(err) {\n if (err) {\n console.log(\"Couldn't delete invalid file!\");\n }\n\n res.end();\n });\n }\n else {\n res.end();\n }\n }\n\n callS3(\"head\", {\n bucket: req.body.bucket,\n key: req.body.key\n }, headReceived);\n}", "downloadFile(bucket, fileNameToDownload, fileNameToSaveAs) {\n return new Promise((resolve, reject) => {\n var download = this.client.downloadFile({\n localFile: fileNameToSaveAs,\n s3Params: {\n Bucket: bucket,\n Key: fileNameToDownload\n }\n });\n\n download.on('error', error => {\n reject(error);\n });\n\n download.on('end', () => {\n resolve();\n });\n });\n }", "syncDirectory() {\n const s3Bucket = this.serverless.variables.service.custom.s3Bucket;\n const args = [\n 's3',\n 'sync',\n 'app/',\n `s3://${s3Bucket}/`,\n '--delete',\n ];\n const { sterr } = this.runAwsCommand(args);\n if (!sterr) {\n this.serverless.cli.log('Successfully synced to the S3 bucket');\n } else {\n throw new Error('Failed syncing to the S3 bucket');\n }\n }", "static getFile (bucketName, objectKey) {\n const s3 = Storage._getS3Instance();\n const params = {\n Bucket: bucketName,\n Key: objectKey\n };\n return new Promise((resolve, reject) => {\n s3.getObject(params, (err, data) => {\n if (err) {\n reject(err);\n } else {\n resolve({\n content: data.Body, // buffer\n type: data.ContentType, // string\n encoding: data.ContentEncoding, // string\n size: data.ContentLength // integer\n });\n }\n });\n });\n }", "function insertBucket() {\n resource = {\n 'name': BUCKET\n };\n\n var request = gapi.client.storage.buckets.insert({\n 'project': PROJECT,\n 'resource': resource\n });\n executeRequest(request, 'insertBucket');\n}", "function S3Store(options) {\n options = options || {};\n\n this.options = extend({\n path: 'cache/',\n tryget: true,\n s3: {}\n }, options);\n\n\n // check storage directory for existence (or create it)\n if (!fs.existsSync(this.options.path)) {\n fs.mkdirSync(this.options.path);\n }\n\n this.name = 's3store';\n\n // internal array for informations about the cached files - resists in memory\n this.collection = {};\n\n // TODO: need implement!\n // fill the cache on startup with already existing files\n // if (!options.preventfill) {\n // this.intializefill(options.fillcallback);\n // }\n}", "function reqFilePut(file, requestId) {\r\n var transaction = db.transaction([\"reqfile\"], \"readwrite\");\r\n var objectStore = transaction.objectStore(\"reqfile\");\r\n\r\n\tvar data = {\r\n isSynced: false,\r\n\t\trequestId: requestId,\r\n\t\tfile: file\r\n\t}\r\n\r\n var putRequest = objectStore.put(data);\r\n putRequest.onsuccess = function(event) {\r\n console.log(\"success file put in db\")\r\n uploadFile(file, event.target.result, requestId)\r\n }\r\n\r\n putRequest.onerror = function(event) {\r\n console.log(\"putRequest.onerror fired in reqFileUpdate() - error code: \" + (event.target.error ? event.target.error : event.target.errorCode));\r\n }\r\n}", "function s3LogsToES(bucket, key, context, lineStream, recordStream) {\n // Note: The Lambda function should be configured to filter for .log files\n // (as part of the Event Source \"suffix\" setting).\n\n var s3Stream = s3.getObject({Bucket: bucket, Key: key}).createReadStream();\n\n // Flow: S3 file stream -> Log Line stream -> Log Record stream -> ES\n \n\tpostDocumentToES(key, context);\n \n\n s3Stream.on('error', function() {\n\n console.log(\n 'Error getting object \"' + key + '\" from bucket \"' + bucket + '\". ' +\n 'Make sure they exist and your bucket is in the same region as this function.');\n context.fail();\n });\n}", "function uploadFile(err, url){\n\n instance.publishState('created_file', url);\n instance.triggerEvent('has_created_your_file')\n\n if (err){\n\n console.log('error '+ err);\n\n }\n\n }", "function sendMessage(messageJSON){\n var s3 = new AWS.S3();\n\n var params = {\n Bucket : config.bucket,\n Key : config.key,\n Body : JSON.stringify(messageJSON)\n }\n\n return new Promise (function (resolve, cat) {\n s3.putObject(params, function(err, data) {\n if (!err) { resolve(); }\n else { cat(); }\n });\n });\n}", "function deleteObject() {\n const deleteParams = {\n Bucket: bucket,\n Key: key,\n };\n s3Client.deleteObject(deleteParams, (err, data) => {\n if (err) console.log('err:', err);\n else console.log('data:', data);\n });\n}", "function deleteFileInAFolder(file_key,req,res,operation)\n{\n const params = {\n Bucket:GlobalVar.AWS_BUCKET_NAME,\n Key: file_key //if any sub folder-> path/of/the/folder.ext \n }\n s3.headObject(params).promise()\n .then(()=>{\n console.log(\"File Found in S3\");\n s3.deleteObject(params).promise()\n .then(()=>{\n console.log(\"file deleted Successfully\");\n res.json('Bug '+ operation + ' with file_key: '+file_key);\n }).catch((err)=>{\n console.log(\"ERROR in file \" + operation+ \"ing : \" + JSON.stringify(err));\n res.status(400).json('Error: '+err);\n })\n }).catch((err)=>{\n console.log(\"File not Found ERROR : \" + err.code);\n res.status(400).json('Error: '+err);\n })\n}", "put (url, data) {\n }", "function fileUpload(getData, response) {\n\ttry {\n\t\tAWS.config.update({\"accessKeyId\": process.env.AWS_ACCESS_KEY_ID, \"secretAccessKey\": process.env.AWS_SECRET_KEY, \"region\": \"us-east-1\"});\n\t\tvar s3 = new AWS.S3();\n\t\tvar file = \"./courseDetails.txt\";\n\t\tvar details = \"subject=\" + getData['subject'] + \" courseID=\"+getData['courseID']+\" section=\"+getData['section'];\n\t\tvar bucket = 'ke_bucket';\n\t\tvar S3_Info = '';\n\n\t\tvar fileCounter;\n\t\tvar params = {\n \t\t\tBucket: bucket,\n\t\t};\n\t\t//get correct number of file to upload\n\t\ts3.listObjects(params, function(err, data) {\n \t\t\tif (err) console.log(err, err.stack);\n \t\t\telse fileCounter = data.Contents.length;\t\n\t\t\tfileCounter++;\n\t\t\tvar currentFile = \"courseDetails\" + String(fileCounter) + \".txt\";\n\t\t\t//write file to server\n\t\t\tfs.writeFile(file, details,function(err){\n\t\t\t\tif(err){throw err;}\n\t\t\t\tvar file2 = \"./courseDetails.txt\";\n\t\t\t\t//read file again and put the data into S3 params\n\t\t\t\tfs.readFile(file2, function(err, data) {\n\t\t\t\t\tif(err) {throw err;}\n\t\t\t\t\tvar params = {\n \t\t\t\t\t\tBucket: bucket,\n \t\t\t\t\t\tKey: currentFile,\n \t\t\t\t\t\tBody: data,\n\t\t\t\t\t}\n\t\t\t\t\t//Add object to S3 with the given params\n\t\t\t\t\ts3.putObject(params, function(err, data) {\n \t\t\t\t\t\tif (err) console.log(err, err.stack);\n \t\t\t\t\t\t//beginning building html\n \t\t\t\t\t\tS3_Info += '<h1>S3 Information</h1>' +\n\t\t\t\t\t\t'<p>File: ' + currentFile + ' put into Bucket: ' + bucket + '</p>';\n\t\t\t\t\t\tS3_Info += '<p>Bucket: ' + bucket + ' currently contains ';\t\t\t \n \t\t\t\t\t\tvar params = {\n \t\t\t\t\t\tBucket: bucket,\n \t\t\t\t\t\t};\n \t\t\t\t\t\t//list objects in bucket, add to html\n \t\t\t\t\t\ts3.listObjects(params, function(err, data) {\n \t\t\t\t\t\tif (err) console.log(err, err.stack);\n \t\t\t\t\t\telse {\n \t\t\t\t\t\t\tfor (var i=0; i<data.Contents.length; i++) {\n \t\t\t\t\t\t\tS3_Info += String(data.Contents[i].Key) + ', ';\n \t\t\t\t\t\t\t} \n \t\t\t\t\t\t}\n \t\t\t\t\t\t//get access control policy on current bucket, add to html\n \t\t\t\t\t\tS3_Info += '</p><p>Bucket: ' + bucket + ' is owned by ';\n \t\t\t\t\t\ts3.getBucketAcl(params, function(err, data) {\n \t\t\t\t\t\t\tif (err) console.log(err, err.stack);\n \t\t\t\t\t\t\telse {\n \t\t\t\t\t\t\tS3_Info += data.Owner.DisplayName + ' with permissions: ' + data.Grants[0].Permission + '</p>';\n \t\t\t\t\t\t}\n \t\t\t\t\t\t\tvar headers = {};\n \t\t\t\t\t\t\t\theaders[\"Content-Type\"] = \"text/html\";\n \t\t\t\t\t\t\t\theaders[\"Access-Control-Allow-Origin\"] = \"*\";\n\t\t\t\t\t\t\t\tresponse.writeHead(200, headers);\n\t\t\t\t\t\t\t\tresponse.write(S3_Info);\n\t\t\t\t\t\t\t\tresponse.end();\n \t\t\t\t\t\t});\n \t\t\t\t\t\t});\t \n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t}\n\tcatch(err) {}\t\n}", "async save(config) {\r\n this._logger.info(\"===> AmazonStorageConfigProvider::save\");\r\n if (objectHelper_1.ObjectHelper.isEmpty(this._credentials)) {\r\n throw new storageError_1.StorageError(\"The serviceAccountKey must be set for save operations\");\r\n }\r\n if (objectHelper_1.ObjectHelper.isEmpty(config)) {\r\n throw new storageError_1.StorageError(\"The config parameter can not be empty\");\r\n }\r\n const filename = `/${this._bucketName}/${this._configName}.json`;\r\n const content = JSON.stringify(config);\r\n const request = {\r\n service: \"s3\",\r\n region: this._region,\r\n method: \"PUT\",\r\n path: filename,\r\n headers: {\r\n \"Content-Type\": \"application/json\",\r\n \"Content-Length\": content.length.toString(),\r\n \"x-amz-acl\": \"public-read\"\r\n },\r\n body: content\r\n };\r\n const requestSigner = new amazonRequestSigner_1.AmazonRequestSigner(request, this._credentials);\r\n const signedRequest = requestSigner.sign();\r\n const networkEndpoint = new networkEndPoint_1.NetworkEndPoint(\"https\", signedRequest.hostname, 443);\r\n const networkClient = networkClientFactory_1.NetworkClientFactory.instance().create(\"default\", networkEndpoint, this._logger);\r\n await networkClient.doRequest(\"PUT\", content, filename, signedRequest.headers);\r\n this._logger.info(\"<=== AmazonStorageConfigProvider::save\");\r\n }", "function after (s3, bucket, keys, done) {\n when.all(\n // Swallow deleteObject errors here incase the files don't yet exist\n keys.map(function (key) { return deleteObject(s3, bucket, key).catch(function() {}); })\n ).then(function () { done(); });\n}", "async setFile({path, data, contentType, encoding, sensitivity, credentials}) {\n credentials = credentials || this.credentials\n await this.ensureIndexLoaded()\n this.ensurePermission({path, credentials, write: true})\n\n path = u.packKeys(path)\n\n // Generate fileID, store it on the index, set nodetype\n let fileID = u.uuid()\n this.index.setNodeType(path, u.NT_S3REF)\n this.index.setNodeProperty(path, 'fileID', fileID)\n this.index.setDontDelete(path, true)\n \n // Write the file to s3, write the url to the node\n let ref = await this.s3Client.write({key: fileID, body: data, contentType, encoding})\n let attributes = {}\n attributes[path] = ref\n await this.set({attributes, sensitivity})\n return ref\n }", "function pushFileToJive(filePath, filename, place) {\n logger.info(\"Pushing file \" + filePath);\n var fileGuid = jive.util.guid();\n var fileObj = {\n fileDirectoryPath: place.containerPath + \"/\" + filename\n };\n var versionObj = {\n fileName: filename,\n contentType: 'TBD'\n };\n\n // Create the ESF REST API url:\n // http://{jive url}/api/core/v3/exstorage/containers/{containerID}/files\n var pushFileUrl = place.jiveUrl + place.containerApiSuffix + \"files\";\n\n var tempFile;\n jive.util.fsGetSize(filePath)\n .then(function (size) {\n tempFile = {\n name: filename,\n path: filePath,\n size: size\n };\n return jive.util.fsexists(fileObj.fileDirectoryPath);\n })\n .then(function (exists) {\n if (!exists) {\n return jive.util.fsmkdir(fileObj.fileDirectoryPath);\n } else {\n return q.fcall(function () { });\n }\n })\n .then(function () {\n return handleFileVersion(fileGuid, fileObj, versionObj, tempFile);\n })\n .then(function (reqPayload) {\n var headers = {\n \"Content-Type\": \"application/json\",\n \"Authorization\": \"Bearer \" + place.oauth.access_token\n };\n\n // Perform a POST request to upload the file\n return jive.util.buildRequest(pushFileUrl, \"POST\", reqPayload, headers);\n })\n .then(function () {\n logger.info(\"done pushing file.\")\n })\n .catch(function (err) {\n logger.error(err);\n });\n}" ]
[ "0.7673945", "0.75913644", "0.7589262", "0.7492384", "0.7367182", "0.736684", "0.70898944", "0.7041086", "0.7035906", "0.70140254", "0.69770247", "0.6970791", "0.6788525", "0.67842907", "0.67517614", "0.67470556", "0.6729776", "0.66821146", "0.6642838", "0.66102046", "0.6527294", "0.6435616", "0.64006567", "0.6360663", "0.6311978", "0.6284017", "0.6245678", "0.6227041", "0.61865157", "0.6156699", "0.6097767", "0.6076599", "0.60444707", "0.59766924", "0.596153", "0.5941875", "0.59119946", "0.5878873", "0.585316", "0.5837828", "0.5808974", "0.5802356", "0.5795236", "0.5752471", "0.57094705", "0.5688903", "0.56816083", "0.56746554", "0.56623954", "0.5622008", "0.5610167", "0.5603355", "0.5528736", "0.55285263", "0.5522552", "0.5488274", "0.54877865", "0.54803133", "0.5477632", "0.5470383", "0.5450016", "0.5415856", "0.5409808", "0.53561455", "0.5342838", "0.53412944", "0.53370106", "0.53306234", "0.5313365", "0.5309186", "0.5296203", "0.5287359", "0.5283784", "0.5282029", "0.527483", "0.5263262", "0.5259993", "0.5253929", "0.5243445", "0.5235782", "0.5220928", "0.5187444", "0.5169762", "0.5160908", "0.51489013", "0.51355857", "0.5101939", "0.50984985", "0.5091171", "0.50903946", "0.50883", "0.50863075", "0.50764644", "0.5071522", "0.50680095", "0.5064216", "0.5061776", "0.50615025", "0.50613475", "0.5048384" ]
0.69167966
12
Gets file from S3.
static getFile (bucketName, objectKey) { const s3 = Storage._getS3Instance(); const params = { Bucket: bucketName, Key: objectKey }; return new Promise((resolve, reject) => { s3.getObject(params, (err, data) => { if (err) { reject(err); } else { resolve({ content: data.Body, // buffer type: data.ContentType, // string encoding: data.ContentEncoding, // string size: data.ContentLength // integer }); } }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getFile(params) {\n try {\n console.log(\"s3.getObject Params: \", params);\n var s3 = new this.AWS.S3();\n let file = await s3.getObject(params).promise();\n return (file);\n } catch (error) {\n console.error('S3.getObject error: ', error);\n return (error);\n }\n }", "function getObjFromS3(fileName, bucket, callback){\n let params = {Bucket: bucket, Key:fileName};\n s3.getObject(params, function(err, data){\n if(err){\n console.error(\"getObjFromS3 err\",err);\n } else {\n callback(data.Body.toString('utf-8'));\n }\n \n });\n\n}", "function fetchFromS3(env, callback){\n // get the investigators cached version from AWS.\n if (!isValidEnv(env)){\n callback(\"Invalid env passed into fetchFromS3()\");\n return;\n }\n // construct the filename from the env\n var filename = getS3FilePath(env);\n var params = {\n Bucket: AWS_BUCKET_NAME,\n Key: filename\n };\n // get the file\n console.log(\"Calling s3....\");\n s3.getObject(params, function(err,data){\n if (err){\n callback(\"InvestigatorService S3: \" + err.code);\n } else {\n var text = data.Body.toString('ascii');\n callback(null, text);\n }\n });\n}", "* get (path) {\n return new Promise((resolve, reject) => {\n this.s3.getObject({\n Bucket: this.disk.bucket,\n Key: path\n }, (err, data) => {\n if (err) return reject(err)\n return resolve(data.Body)\n })\n })\n }", "function getFileStream(fileKey) {\n const downloadParams = {\n Key: fileKey,\n Bucket: bucketName\n }\n var object = s3.getObject(downloadParams).createReadStream().on('error', (err) => console.log(err + 'ERROR GET FILE FROM 3S'))\n return object\n}", "function getS3File(bucketName, fileName, versionId, callback) {\n var params = {\n Bucket: bucketName,\n Key: fileName\n };\n if (versionId) {\n params.VersionId = versionId;\n }\n s3.getObject(params, function (err, data) {\n callback(err, data);\n });\n}", "* getStream (path) {\n return this.s3.getObject({\n Bucket: this.disk.bucket,\n Key: path\n }).createReadStream()\n }", "async function fetchInputFromS3(s3URL) {\n const tmpDir = await tmp.dir({ dir: \"/tmp\" });\n const parsedS3URL = url.parse(s3URL);\n const localFile = path.join(tmpDir.path, path.basename(parsedS3URL.path));\n console.log(`Downloading ${s3URL} to ${localFile}...`);\n\n const params = {\n Bucket: parsedS3URL.host,\n Key: parsedS3URL.path.slice(1),\n };\n const s3 = new AWS.S3();\n const readStream = s3.getObject(params).createReadStream();\n await new Promise((resolve, reject) => {\n readStream.on(\"error\", reject);\n readStream.on(\"end\", resolve);\n const file = fs.createWriteStream(localFile);\n readStream.pipe(file);\n });\n return localFile;\n}", "download(fName){\n let client = this.s3Client;\n\n return new Promise((resolve, reject) => {\n client.getFile(fName, (err, res) => {\n if(err) reject(err);\n resolve(res);\n }); \n });\n }", "function getFileStream(key) {\n const downloadParams = {\n Key: key,\n Bucket: 'week18'\n }\n return s3.getObject(downloadParams).createReadStream()\n}", "function getFileStream(fileKey) {\n const downloadParams = {\n Key: fileKey,\n Bucket: bucketName,\n };\n\n return s3.getObject(downloadParams).createReadStream();\n}", "function get_s3_resource(element, signature_view_url) {\n\tvar resource_url = element.src;\n\tvar xhr = new XMLHttpRequest();\n\txhr.open(\"GET\", signature_view_url+\"?resource_url=\"+resource_url);\n\txhr.onreadystatechange = function() {\n\t\tif(xhr.readyState === 4) {\n\t\t\tif(xhr.status === 200) {\n\t\t\t\tvar response = JSON.parse(xhr.responseText);\n\t\t\t\telement.src = response.signed_request;\n\t\t\t}\n\t\t\telse {\n\t\t\t\talert(\"Could not get signed URL.\");\n\t\t\t}\n\t\t}\n\t};\n\txhr.send();\n}", "downloadFile(bucket, fileNameToDownload, fileNameToSaveAs) {\n return new Promise((resolve, reject) => {\n var download = this.client.downloadFile({\n localFile: fileNameToSaveAs,\n s3Params: {\n Bucket: bucket,\n Key: fileNameToDownload\n }\n });\n\n download.on('error', error => {\n reject(error);\n });\n\n download.on('end', () => {\n resolve();\n });\n });\n }", "async function downloadFile(s3Object) {\n const getParams = {Bucket: bucketName, Key: s3Object.Key};\n const fileWriteStream = fs.createWriteStream(path.join(cryptoFolder, s3Object.Key));\n return new Promise((resolve, reject) => {\n s3.getObject(getParams).createReadStream()\n .on('end', () => {\n return resolve();\n }).on('error', (error) => {\n return reject(error);\n }).pipe(fileWriteStream)\n });\n}", "function getFileStream(fileKey) {\n const downloadParams = {\n Key: fileKey,\n Bucket: AWS_BUCKET_NAME\n }\n\n return s3.getObject(downloadParams).createReadStream()\n}", "function getFile (params) {\n return new Promise((resolve,reject) => s3.getObject(params, function(err, data) {\n if (err) {\n reject(err);\n // file does not exist\n var attachment = {}\n attachment.text = params[\"Key\"]\n attachment.color = \"#FF0000\"\n attachment.title = \"File Missing!\"\n missingFilesArry.push(attachment)\n }\n else {\n resolve(data);\n //file exists\n receivedFilesArry.push(params[\"Key\"])\n }\n }))\n}", "function fetchAndStoreObject(bucket, key, fn) {\n\tif (bucket === null) {\n\t\tbucket = constants.defaultBucket;\n\t}\n\tvar params = {\n\t\tBucket : bucket, /* required */\n\t\tKey : key\n\t/* required */\n\t};\n\tconsole.log(\"getObject for \" + JSON.stringify(params));\n\tvar file = fs.createWriteStream('/tmp/' + key);\n\ts3.getObject(params).on('httpData', function(chunk) {\n\t\tfile.write(chunk);\n\t\t// console.log(\"writing chunk in file.\"+key);\n\t}).on('httpDone', function() {\n\t\tfile.end();\n\t\tconsole.log(\"file end.\" + key);\n\t\tfn();\n\t}).send();\n}", "async get(){\n try {\n let objectResult = await s3.getObject({\n Bucket: this.bucket,\n Key: this.key\n }).promise();\n \n let creds = JSON.parse(objectResult.Body);\n return creds;\n } catch(ex){\n if(ex.code === 'NoSuchKey'){\n return null;\n }\n console.error(ex);\n throw ex;\n }\n }", "function uploadAndFetch (s3, stream, filename, bucket, key) {\n var deferred = when.defer();\n exports.getFileStream(filename)\n .pipe(stream)\n .on(\"error\", deferred.reject)\n .on(\"finish\", function () {\n deferred.resolve(exports.getObject(s3, bucket, key));\n });\n return deferred.promise;\n}", "* url (path) {\n return `https://${this.disk.bucket}.s3.amazonaws.com/${path}`\n }", "function getS3(awsAccessKey, awsSecretKey) {\n return new AWS.S3({\n accessKeyId: awsAccessKey,\n secretAccessKey: awsSecretKey\n });\n}", "function getFiles(bucketName) {\n if (!bucketName) {\n return Promise.reject({ message: 'Bucket name required to get objects' });\n }\n return new Promise(function (resolve, reject) {\n s3.listObjects({ Bucket: bucketName }, function (err, data) {\n if (err) {\n console.log(\"Error:\", err);\n reject(err);\n } else {\n console.log(\"[getFiles] listObjects returned:\", data);\n resolve(data);\n }\n });\n });\n}", "getBucket() {\n const headers = {\n Date: this._buildDateHeader(),\n };\n\n const authHeader = this._buildAuthHeader('GET', '', {}, headers);\n const fetchOptions = {\n method: 'GET',\n headers: {\n Authorization: authHeader,\n },\n };\n\n return new Promise((resolve, reject) => {\n fetch(this.bucketBaseUrl, fetchOptions)\n .then(res => resolve(res))\n .catch(err => reject(err));\n });\n }", "static _getS3Instance () {\n s3instance = s3instance || new AWS.S3({ apiVersion: S3_API_VERSION });\n return s3instance;\n }", "async function getImage(media_key) {\n const data = s3.getObject({\n Bucket: 'twitterimagesoth',\n Key: media_key\n }\n\n ).promise();\n return data;\n }", "async function uploadFileToS3(file, getSignedUrl) {\n try {\n const {fileUrl, signedRequestUrl} = await getSignedUrl(file)\n const url = await makeS3Request(fileUrl, signedRequestUrl, file)\n\n return url\n } catch (e) {\n return alert('Could not upload file.')\n }\n}", "function getSignedUrl(filename, filetype, foldername, operation) {\n const folderName = foldername;\n const params = {\n Bucket: 'gsg-image-uploads',\n Key: `${folderName}/` + filename,\n Expires: 604800\n };\n if(operation==='putObject'){\n params['ContentType'] = filetype;\n }\n return new Promise((resolve, reject) => {\n s3.getSignedUrl(operation, params, function(err, data) {\n if (err) {\n console.log(\"Error\",err);\n reject(err)\n } else {\n resolve(data)\n }\n });\n });\n}", "getImageFromURL(URL, fileName, bucket, callback) {\n var options = {\n uri: URL,\n encoding: null\n };\n request(options, function (error, response, body) {\n if (error || response.statusCode !== 200) {\n console.log(\"failed to get image\", URL);\n console.log(error);\n if(response.statusCode !== 200){\n console.log(\"200 status not received for URL:\", options.uri);\n }\n } else {\n s3.putObject({\n Body: body,\n Key: fileName,\n Bucket: bucket\n }, function (error, data) {\n if (error) {\n console.log(\"error downloading image to s3\", fileName);\n } else {\n // console.log(\"body:\", body);\n // console.log(\"success uploading to s3\", fileName);\n }\n });\n }\n });\n }", "async function retrieveFile(file_name){\n let error = null\n let file = null\n try{\n file = await getFileAsync({\n Bucket: config.bucket_name,\n Key: file_name\n })\n }catch(err){error=err}\n\n return new Promise((resolve, reject)=>{\n if(error) {reject(error)}\n else {resolve(file)}\n })\n}", "function handleGetObject(httpResponse, s3ResultData) {\n let buffer;\n s3ResultData.Body.on('data', chunk => {\n buffer = Buffer.concat([chunk]);\n });\n\n s3ResultData.Body.on('end', () => {\n httpResponse.send({\n status: 'ok',\n result: Buffer.from(buffer).toString()\n });\n });\n}", "function upload_private_S3_resource(file, folder, cFunc) {\n\tvar xhr = new XMLHttpRequest();\n\t// var amz_sign_s3 is defined in script on HTML page\n\txhr.open(\"GET\", amz_sign_s3+\"?file_name=\"+file.name+\"&file_type=\"+file.type+\"&folder=\"+folder);\n\txhr.onreadystatechange = function(){\n\t\tif(xhr.readyState === 4){\n\t\t\tif(xhr.status === 200){\n\t\t\t\tvar response = JSON.parse(xhr.responseText);\n\t\t\t\tupload_file(file, response.signed_request, response.url, cFunc);\n\t\t\t}\n\t\t\telse{\n\t\t\t\talert(\"Could not get signed URL.\");\n\t\t\t}\n\t\t}\n\t};\n\txhr.send();\n}", "function makeS3Request(fileUrl, signedRequestUrl, file) {\n return new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest()\n\n xhr.onreadystatechange = () => {\n if (xhr.readyState === 4) {\n if (xhr.status === 200) {\n resolve(fileUrl)\n } else {\n reject({\n status: xhr.status,\n statusText: xhr.statusText,\n })\n }\n }\n }\n\n xhr.open('PUT', signedRequestUrl)\n xhr.send(file)\n })\n}", "function s3(req, res) {\r\n console.log(\"[HEAD] head_s3 called\");\r\n res.json({});\r\n}", "function getS3PreSignedUrl(s3ObjectKey) {\n\n const bucketName = process.env.S3_PERSISTENCE_BUCKET;\n \n const s3PreSignedUrl = s3SigV4Client.getSignedUrl('getObject', {\n Bucket: bucketName,\n Key: s3ObjectKey,\n Expires: 60*1 // the Expires is capped for 1 minute\n });\n\n console.log(`Util.s3PreSignedUrl: ${s3ObjectKey} URL ${s3PreSignedUrl}`); // you can see those on CloudWatch\n\n return s3PreSignedUrl;\n}", "function downloadList(url, callback) {\n var params = {\n Bucket: 'wr.io',\n Key: url\n };\n s3.getObject(params, callback);\n}", "function getImage(fileKey, cb) {\n var fileKey;\n console.log('Trying to download file', fileKey);\n var options = {\n Bucket: consts.AWS_QRCODE_BUCKET,\n Key: fileKey,\n };\n\n res.attachment(fileKey);\n var fileStream = s3.getObject(options).createReadStream();\n fileStream.pipe(res);\n}", "function listS3Files(connection) {\n return S3.files({\n bucket: connection.bucket,\n accessKeyId: connection.accessKeyId,\n secretAccessKey: connection.secretAccessKey\n });\n}", "function getSignedRequest(file){\n const xhr = new XMLHttpRequest();\n xhr.open('GET', `/sign-s3?file-name=${file.name}&file-type=${file.type}`);\n xhr.onreadystatechange = () => {\n if(xhr.readyState === 4){\n if(xhr.status === 200){\n const response = JSON.parse(xhr.responseText);\n uploadFile(file, response.signedRequest, response.url);\n }\n else{\n alert('Could not get signed URL.');\n }\n }\n };\n xhr.send();\n}", "getObject(bucketName, objectName, cb) {\n if (!validateBucketName(bucketName)) {\n throw new errors.InvalidateBucketNameException('Invalid bucket name: ' + bucketName)\n }\n\n if (objectName === null || objectName.trim() === '') {\n throw new errors.InvalidObjectNameException('Object name cannot be empty')\n }\n this.getPartialObject(bucketName, objectName, 0, 0, cb)\n }", "function getImageStream(project_id, idx) {\n return s3.getObject({\n Bucket: process.env.AWS_BUCKET_NAME,\n Key: `${project_id}/${idx}.png`,\n }).createReadStream();\n}", "function listS3Files(connection) {\n return getDatastoreClient(connection).listS3Files(connection);\n}", "function getFile(url){\n var req = request.get(url, function(err, res){\n if (err) throw err;\n console.log('Response ok:', res.ok);\n console.log('Response text:', res.text);\n return res.text;\n });\n}", "getObjects(req,res){\n // first check if there exists a file with this id\n return files.findById(req.params.keyname)\n .then(file =>{\n if(!file){\n // no file exists with this id\n return res.status(404).send('File Not Found')\n }\n // there is a file with this id\n //check if file is expired\n if(!file.complete){\n // not expired\n // update complete from false to true\n return file.update({\n complete: true, // set this to false when debugging\n }).then(()=>{\n // fetch file from s3\n const params = {Bucket: defBucketName,Key: req.params.keyname};\n s3.getObject(params,(err,data)=>{\n if(err){\n return res.status(400).send(err);\n }\n // return the file\n res.attachment(file.fileName);\n res.status(200).send(data.Body);\n // delete file from bucket\n s3.deleteObject(params,(err,data)=>{});\n });\n })\n .catch(err => res.status(400).send(err));\n\n }\n else{\n // return expired\n res.status(410).send('Expired');\n }\n }).catch(err => res.status(400).send(err));\n }", "function getSignedRequest(file) {\n const xhr = new XMLHttpRequest();\n const fileName = encodeURIComponent(file.name);\n const fileType = encodeURIComponent(file.type);\n xhr.open(\"GET\", `/api/s3?file-name=${fileName}&file-type=${fileType}`);\n xhr.onreadystatechange = () => {\n if (xhr.readyState === 4) {\n if (xhr.status === 200) {\n const response = JSON.parse(xhr.responseText);\n uploadFile(file, response.signedRequest, response.url);\n resolve(response.url);\n } else {\n reject(\"Could not get signed URL.\");\n }\n }\n };\n xhr.send();\n }", "get(id, cb){\n this.bucket.get(id, (err, res) => {\n if(err) return cb(err);\n cb(null, res.value);\n });\n }", "async function getBucketFiles(res, fileType, key) {\n const params = {\n Bucket: BUCKET_NAME,\n Prefix: `${fileType}/${key}`\n };\n const data = await S3_CONTROL.listObjectsV2(params).promise();\n const fileInfoParams = {\n Bucket: BUCKET_NAME,\n };\n for (const fileInfo of data.Contents) {\n fileInfoParams.Key = fileInfo.Key;\n const file = await S3_CONTROL.getObject(fileInfoParams).promise();\n fs.createReadStream(file.Body)\n .pipe(res);\n }\n}", "mfGet_LabradorAwsS3ImageUrlDownload(key){\n\t\treturn mf.modeGet_LabradorAwsS3ImageUrlDownload(this,key);\n\t}", "function getBucket() {\n var request = gapi.client.storage.buckets.get({\n 'bucket': BUCKET\n });\n executeRequest(request, 'getBucket');\n}", "function getSignedRequest(file) {\n const xhr = new XMLHttpRequest();\n xhr.open('GET', `/sign-s3?file-name=${file.name}&file-type=${file.type}`);\n xhr.onreadystatechange = () => {\n if (xhr.readyState === 4) {\n if (xhr.status === 200) {\n const response = JSON.parse(xhr.responseText);\n uploadFile(file, response.signedRequest, response.url);\n } else {\n alert('Could not get signed URL.');\n }\n }\n };\n xhr.send();\n }", "async function ListObject(bucketName, prefix) {\n let response;\n var params = {\n Bucket: bucketName,\n Delimiter: '/',\n MaxKeys: 1,\n Prefix: prefix\n };\n\n try {\n response = await S3.listObjectsV2(params).promise();\n }\n catch (error) {\n console.log(\"list error:\", error);\n }\n\n return response;\n}", "function getSignedRequest(file){\n const xhr = new XMLHttpRequest();\n //xhr.setRequestHeader('Content-Type', \"text/csv\")\n xhr.open('GET', `/sign-s3?file-name=${file.name}&file-type=${file.type}`);\n xhr.onreadystatechange = () => {\n if(xhr.readyState === 4){\n if(xhr.status === 200){\n const response = JSON.parse(xhr.responseText);\n uploadFile(file, response.signedRequest, response.url);\n }\n else{\n alert('Could not get signed URL.');\n }\n }\n };\n xhr.send();\n}", "function verifyFileInS3(req, res) {\n function headReceived(err, data) {\n if (err) {\n res.status(500);\n console.log(err);\n res.end(JSON.stringify({error: \"Problem querying S3!\"}));\n }\n else if (expectedMaxSize != null && data.ContentLength > expectedMaxSize) {\n res.status(400);\n res.write(JSON.stringify({error: \"Too big!\"}));\n deleteFile(req.body.bucket, req.body.key, function(err) {\n if (err) {\n console.log(\"Couldn't delete invalid file!\");\n }\n\n res.end();\n });\n }\n else {\n res.end();\n }\n }\n\n callS3(\"head\", {\n bucket: req.body.bucket,\n key: req.body.key\n }, headReceived);\n}", "async function getFile(url){\n const response = await fetch(url);\n // blobs are usuually any files, like images or other files.\n const data = await response.blob();\n return new File([data], 'test.jpg', {type: 'image/jpeg'});\n }", "function getPhoto(key, dealerID, sender) {\n $rootScope.s3.getObject(\n {Bucket: $rootScope.AWSS3Bucket, Key: key, ResponseContentType: \"image/jpg\"},\n function (error, data) {\n var message;\n if (error != null) {\n message = \"Failed to download dealer's dealer pic\" + dealerID + \":\" + error.message;\n $rootScope.$broadcast('downloaded-' + sender + '-dealer-pic-' + dealerID, {\n success: false,\n message: message\n });\n } else {\n message = \"Downloaded dealer's dealer pic successfully!\";\n var blob = new Blob([data.Body], {'type': 'image/png'});\n var url = URL.createObjectURL(blob);\n $rootScope.$broadcast('downloaded-' + sender + '-dealer-pic-' + dealerID, {\n success: true,\n data: url\n });\n }\n }\n );\n }", "function getObjectStream(_a) {\n var bucket = _a.bucket, key = _a.key, client = _a.client;\n return __awaiter(this, void 0, void 0, function () {\n var stream;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0: return [4 /*yield*/, client.getObject(bucket, key)];\n case 1:\n stream = _b.sent();\n return [2 /*return*/, stream.pipe(gunzip_maybe_1.default()).pipe(maybeTarball())];\n }\n });\n });\n}", "async getListS3() {\n s3.listObjectsV2(s3Params, (err, data) => {\n if (err) {\n console.log(err, err.stack);\n } else {\n let listFiles = data[\"Contents\"].map(({ Key }) => ({ key: Key }));\n this.setState({ listFiles: listFiles });\n }\n });\n }", "async function deleteFileFromFolder(){\n const params = {\n Bucket:process.argv[2],\n Key: process.argv[3] //if any sub folder-> path/of/the/folder.ext \n }\n s3=new AWS.S3({apiVersion: '2006-03-01'});\n try {\n await s3.headObject(params).promise()\n console.log(\"File Found in S3\")\n try {\n await s3.deleteObject(params).promise()\n console.log(\"file deleted Successfully\")\n }\n catch (err) {\n console.log(\"ERROR in file Deleting : \" + JSON.stringify(err))\n }\n } \n catch (err) {\n console.log(\"File not Found ERROR : \" + err.code)\n }\n\n}", "function parseS3Url(url) {\n const [bucket, ...keyFragments] = url.replace(S3_PROTOCOL_PREFIX, '').split('/');\n return { bucket, key: keyFragments.join('/') };\n}", "function deleteFileFromS3(key) {\n const deleteParams = {\n Bucket: 'week18',\n Key: key,\n }\n return s3.deleteObject(deleteParams).promise()\n}", "static deleteFile (bucketName, objectKey) {\n const s3 = Storage._getS3Instance();\n const params = {\n Bucket: bucketName,\n Key: objectKey\n };\n return new Promise((resolve, reject) => {\n s3.deleteObject(params, (err, data) => err ? reject(err) : resolve());\n });\n }", "async function getFile() {\n\n const myFile = await fleekStorage.get({\n apiKey: 'my-key',\n apiSecret: 'my-secret', \n key: 'filename-on-fleek',\n getOptions: [\n 'data',\n 'bucket',\n 'key',\n 'hash',\n 'publicUrl'\n ],\n })\n\nconsole.log('myFile', myFile)\n\n}", "async exportFromS3(params) {\n s3.getObject(params, function (err, data) {\n const convertJsonToCsv = (json) => {\n let fields = Object.keys(json[0]);\n const replacer = (key, value) => (value === null ? \"\" : value);\n let csv = json.map((row) =>\n fields.map((field) => JSON.stringify(row[field], replacer)).join(\",\")\n );\n csv.unshift(fields.join(\",\"));\n csv = csv.join(\"\\r\\n\");\n return csv;\n };\n\n if (data) {\n let json = JSON.parse(data.Body.toString());\n let csv = convertJsonToCsv(json);\n let filename = \"\";\n if (params.Key.includes(\"time/\")) {\n filename = params.Key.replace(\"time/\", \"\");\n } else {\n filename = params.Key.replace(\"sprint/\", \"\");\n }\n\n let blob = new Blob([csv], {\n type: \"\",\n });\n FileSaver.saveAs(blob, filename + CSV_FILE_ATTACHMENT);\n } else {\n console.log(\"Error: \" + err);\n }\n });\n }", "function getGetSignedUrl(key) {\n const signedUrlExpireSeconds = 60 * 5;\n return exports.s3.getSignedUrl('getObject', {\n Bucket: config_1.config.aws_media_bucket,\n Key: key,\n Expires: signedUrlExpireSeconds,\n });\n}", "function getFile(json, url) {\n\n try { \n\treturn fs.readFileSync(\".\" + url.pathname);\n } catch (err) {\n\t//Don't do anything\n\tconsole.log(\"Coudnt read file\" + err);\n }\n}", "function getListObjects(Prefix){\n const params = {\n Bucket: 'gsg-image-uploads',\n Prefix:Prefix, //Limits the response that begin with the specified prefix.\n //MaxKeys: 2 //(Integer) Sets the maximum number of keys returned in the response.\n };\n return new Promise((resolve, reject)=>{\n s3.listObjectsV2(params, function(err, data){\n if (err) {\n console.log(err, err.stack);\n reject(err)\n } else {\n const bucketContents = data.Contents;\n var temp = {};\n bucketContents.map(({Size, Key})=>{\n if(Size>0)\n {\n const urlParams = {Bucket: 'gsg-image-uploads', Key};\n s3.getSignedUrl('getObject',urlParams, function(err, url){\n temp[Key]= url;\n });\n }\n });\n resolve(temp);\n }\n });\n })\n\n}", "presignedGetObject(bucketName, objectName, expires) {\n if (!validateBucketName(bucketName)) {\n throw new errors.InvalidateBucketNameException('Invalid bucket name: ' + bucketName)\n }\n if (objectName === null || objectName.trim() === '') {\n throw new errors.InvalidObjectNameException('Object name cannot be empty')\n }\n var requestParams = {\n host: this.params.host,\n port: this.params.port,\n protocol: this.params.protocol,\n path: `/${bucketName}/${uriResourceEscape(objectName)}`,\n method: 'GET',\n expires: expires\n }\n return presignSignatureV4(requestParams, this.params.accessKey, this.params.secretKey)\n }", "async getPhoneFromToken(token) {\n let data = null\n const s3key = this.s3prefixTokens + token\n try {\n const s3 = new AWS.S3()\n data = await s3.getObject({\n Bucket: this.s3bucket,\n Key: s3key\n }).promise()\n }\n catch (err) {\n if (err.code == 'NoSuchKey') {\n let msg = `Tried looking up phone for a non-existent user token ${s3key}`\n logger.error(msg)\n throw err\n } else {\n let msg = `Error reading user token at s3://${this.s3bucket}/${s3key}: ${err}`\n logger.error(msg)\n throw err\n }\n }\n logger.debug(`Retrieved user token at s3://${this.s3bucket}/${s3key}`)\n return data.Body.toString()\n }", "async getFileURLSigned(url) {\n const path = await this.getPathFromUrl(url);\n const result = await this.doRequest({\n path,\n method: \"GET\",\n params: {\n noRedirect: true,\n },\n });\n return result;\n }", "function getS3Artifact(artifact) {\n return artifact.location.split(':')[5]\n}", "function headObject() {\n const headObjectParams = {\n Bucket: bucket,\n Key: key,\n };\n s3Client.headObject(headObjectParams, (err, data) => {\n if (err) console.log('err:', err);\n else console.log('data:', data);\n });\n}", "function get_file(url) {\n\tconst request = new XMLHttpRequest()\n\t// This throws a warning about synchronous requests being deprecated\n\trequest.open('GET',url,false)\n\trequest.send()\n\treturn request.responseText\n}", "function getFile(url) {\n const groupPattern = /~\\d+\\/nth\\/\\d+\\//;\n const uploaded = url.startsWith(CDN_BASE_URL) && !groupPattern.test(url);\n return _uploadcareWidget.default.fileFrom(uploaded ? 'uploaded' : 'url', url);\n}", "static get(path, successHandler, failureHandler) {\r\n // returns URL\r\n Storage.get(path).then((url) => {\r\n log&&console.log(\"Storage successfully retrieved file! URL = \" + url);\r\n if (successHandler) { successHandler(url); }\r\n }).catch((error) => {\r\n err&&console.error(\"Storage failed to retrieve file with path = \" + path + \"... Error: \" + error);\r\n if (failureHandler) { failureHandler(error); }\r\n });\r\n }", "function getObjectUrl({\n cosInstance,\n bucket: Bucket,\n region: Region,\n key: Key,\n origin = \"\",\n}) {\n const url = cosInstance.getObjectUrl({\n Bucket,\n Region,\n Key,\n Sign: false,\n });\n const { protocol, host } = new URL(url);\n return url.replace(`${protocol}//${host}`, origin);\n}", "function getVersion (bucket, key, back, callback) {\n bucket = bucket.toLowerCase();\n var s3 = new AWS.S3();\n var version_params = {\n Bucket: bucket, /* required */\n KeyMarker: key,\n MaxKeys: back\n };\n s3.listObjectVersions(version_params, function(err, data) {\n if (err) {\n console.log(err, err.stack); // an error occurred\n console.log('bucket: '+bucket+ 'key: '+key+' back: '+back+' lastVersion: '+lastVersion);\n } else {\n\n if (data.Versions.length < back-1) {\n console.log('only one version');\n callback(null);\n return;\n }\n\n if (data.Versions[back-1].Key != key+'/store.json') {\n console.log('only one version, key mismatch: '+key+ ' vs '+data.Versions[back-1].Key);\n callback(null);\n return;\n }\n //console.log(data);\n var lastVersion = data.Versions[back-1].VersionId;\n //console.log('got last version for path: '+key+' id: '+lastVersion);\n //console.log(JSON.stringify(data, null, 4));\n var get_params = {\n Bucket: bucket,\n Key: key+'/store.json',\n VersionId: lastVersion\n }\n\n s3.getObject(get_params, function(err, data) {\n if (err) {\n console.log(err, err.stack); // an error occurred\n console.log('bucket: '+bucket+ 'key: '+key+' back: '+back+' lastVersion: '+lastVersion);\n } else {\n //console.log(data);\n callback(data.Body);\n }\n });\n }\n });\n}", "function getSignedRequest(file){\n const xhr = new XMLHttpRequest();\n xhr.open('GET', api()+`/sign-s3?file-name=${file.name}&file-type=${file.type}`);\n xhr.onreadystatechange = () => {\n if(xhr.readyState === 4){\n if(xhr.status === 200){\n const response = JSON.parse(xhr.responseText);\n component.setState({imageFile:file,imageResponse:response,url:response.url,signedRequest:response.signedRequest})\n document.getElementById('preview').src = response.url; //dont confuse this url for the response.url\n }\n else{\n alert('Could not get signed URL.');\n }\n }\n };\n xhr.send();\n }", "function getS3FilePath(env){\n var prefix = env + \"/RD013/\";\n var filename = prefix + \"investigators.json\";\n return filename;\n}", "function getBucketAcl() {\n const getBucketAclParams = {\n Bucket: bucket,\n };\n s3Client.getBucketAcl(getBucketAclParams, (err, data) => {\n if (err) console.log('err:', err);\n else console.log('data:', JSON.stringify(data));\n });\n}", "function uploadFileIntoBucket(){\n // Create S3 service object\n s3 = new AWS.S3({apiVersion: '2006-03-01'});\n\n // call S3 to retrieve upload file to specified bucket\n var uploadParams = {Bucket: process.argv[2], Key: '', Body: ''};\n var file = process.argv[3];\n\n // Configure the file stream and obtain the upload parameters\n var fs = require('fs');\n var fileStream = fs.createReadStream(file);\n fileStream.on('error', function(err) {\n console.log('File Error', err);\n });\n\n uploadParams.Body = fileStream;\n var path = require('path');\n uploadParams.Key = path.basename(file);\n\n // call S3 to retrieve upload file to specified bucket\n s3.upload (uploadParams, function (err, data) {\n if (err) {\n console.log(\"Error\", err);\n } if (data) {\n console.log(\"Upload Success\", data.Location);\n }\n });\n}", "static isS3URL(url) {\n const s3Host =\n game.data.files.s3 &&\n game.data.files.s3 &&\n game.data.files.s3.endpoint &&\n game.data.files.s3.endpoint.host\n ? game.data.files.s3.endpoint.host\n : \"\";\n\n if (s3Host === \"\") return false;\n\n const regex = new RegExp(\"http[s]?://([^.]+)?.?\" + s3Host + \"(.+)\");\n const matches = regex.exec(url);\n\n const activeSource = matches ? \"s3\" : null; // can be data or remote\n const bucket = matches && matches[1] ? matches[1] : null;\n const current = matches && matches[2] ? matches[2] : null;\n\n if (activeSource === \"s3\") {\n return {\n activeSource,\n bucket,\n current,\n };\n } else {\n return false;\n }\n }", "async function downloadFile(bucketName, filename) {\n const destination = path.join(__dirname, 'public/ajax-loader.gif', );\n const res = await storage\n .bucket(bucketName)\n .file(filename)\n .download({destination});\n \n debug('res', res, `file downloaded to \"${destination}\"`);\n}", "static putFile (bucketName, objectKey, objectBody) {\n const s3 = Storage._getS3Instance();\n const params = {\n Bucket: bucketName,\n Key: objectKey,\n Body: objectBody\n };\n return new Promise((resolve, reject) => {\n s3.upload(params, (err, data) => err ? reject(err) : resolve(data.Location));\n });\n }", "function defaultGetResponseData(content, xhr) {\n const opts = this; // If no response, we've hopefully done a PUT request to the file\n // in the bucket on its full URL.\n\n if (!isXml(content, xhr)) {\n if (opts.method.toUpperCase() === 'POST') {\n if (!warnedSuccessActionStatus) {\n uppy.log('[AwsS3] No response data found, make sure to set the success_action_status AWS SDK option to 201. See https://uppy.io/docs/aws-s3/#POST-Uploads', 'warning');\n warnedSuccessActionStatus = true;\n } // The responseURL won't contain the object key. Give up.\n\n\n return {\n location: null\n };\n } // responseURL is not available in older browsers.\n\n\n if (!xhr.responseURL) {\n return {\n location: null\n };\n } // Trim the query string because it's going to be a bunch of presign\n // parameters for a PUT request—doing a GET request with those will\n // always result in an error\n\n\n return {\n location: xhr.responseURL.replace(/\\?.*$/, '')\n };\n }\n\n return {\n // Some S3 alternatives do not reply with an absolute URL.\n // Eg DigitalOcean Spaces uses /$bucketName/xyz\n location: resolveUrl(xhr.responseURL, getXmlValue(content, 'Location')),\n bucket: getXmlValue(content, 'Bucket'),\n key: getXmlValue(content, 'Key'),\n etag: getXmlValue(content, 'ETag')\n };\n }", "function getAccountData(uName){\n console.log(\"Searching for account: \", uName);\n return new Promise(function(resolve, reject){\n var params = {\n Key: uName\n }\n //Attempt to get corresponding account data\n s3bucket.getObject(params, function(err, data){\n if(err && err.code == 'NoSuchKey'){\n console.log(\"Account does not exist\");\n resolve(null);\n }\n else if(err){\n reject(err);\n }\n else{\n console.log(\"Account found\");\n resolve(JSON.parse(data.Body.toString()));\n }\n });\n });\n}", "async function storeOnS3(file) {\n // list acutal files\n const files = await fileListAsync('./output/');\n // if size is reached, gzip, send and rotate file\n for (const file of files) {\n const body = fs.createReadStream(`./output/${file}`);\n\n await new Promise((resolve, reject) => {\n // http://docs.amazonaws.cn/en_us/AWSJavaScriptSDK/guide/node-examples.html#Amazon_S3__Uploading_an_arbitrarily_sized_stream__upload_\n s3.upload({\n Bucket: process.env.S3_BUCKET,\n Key: file,\n Body: body\n })\n //.on('httpUploadProgress', (evt) => { console.log(evt); })\n .send(function (err, data) {\n // console.log(err, data); \n if (err) {\n reject(err);\n }\n resolve(data);\n });\n });\n await removeAsync(`./output/${file}`);\n }\n}", "function uploadFileToS3(file) {\n const fileStream = fs.createReadStream(file.path)\n const uploadParams = {\n Bucket: 'week18',\n Body: fileStream,\n Key: file.filename\n }\n return s3.upload(uploadParams).promise()\n}", "function getSignedUrl(urlData) {\n var params = { Bucket: urlData.bucket, Key: urlData.key };\n return new Promise(function (resolve, reject) {\n s3.getSignedUrl(urlData.action, params, function (err, url) {\n if (err) {\n console.log('Error getting signed url:', err);\n reject(err);\n } else {\n console.log('The URL is', url);\n resolve(url);\n }\n });\n });\n}", "function getSignedRequest(file){\n xhttp.onreadystatechange = function(){\n if(this.readyState == 4 && this.status == 200){\n var name_image = this.responseText + `.${(file.type).split('/')[1]}`; \n xhttp.open('GET', `/sign-s3?file-name=${name_image}&file-type=${file.type}`);\n xhttp.onreadystatechange = () => {\n if(xhttp.readyState === 4){\n if(xhttp.status === 200){\n const response = JSON.parse(xhttp.responseText);\n uploadFile(file, response.signedRequest, response.url);\n }\n else{\n alert('Could not get signed URL.');\n }\n }\n };\n xhttp.send();\n }\n }\n xhttp.open(\"get\", \"/get_image_name\", true);\n xhttp.send();\n }", "function getPublicUrl (filename,bucketName) {\n return `https://storage.googleapis.com/${bucketName}/${filename}`;\n}", "function combineObjectWithCachedS3File(config, upload, downloadDict, s3, key, newObj, callback) {\n var localFilename = config.workingDir + \"/\" + config.outBucket + \"/\" + key;\n var localDir = localFilename.substring(0, localFilename.lastIndexOf('/'));\n\n var inFlight = downloadDict[localFilename];\n if (inFlight) {\n //console.log(\"Download race condition avoided, queued\", key, newObj);\n inFlight.obj = tarasS3.combineObjects(newObj, inFlight.obj);\n inFlight.callbacks.push(callback);\n return; // we are done, our callback will get called as part of original inFlight request\n } else {\n downloadDict[localFilename] = inFlight = {'obj':newObj, 'callbacks':[callback]};\n }\n\n async.waterfall([\n // try to read file from local cache before we go to out to s3\n function (callback) {\n fs.readFile(localFilename, function (err, data) {\n function fallback() {\n var params = {'s3':s3, 'params':{'Bucket': config.outBucket, 'Key':key}};\n return tarasS3.S3GetObjectGunzip(params, function (err, data) {\n if (err) {\n // 404 on s3 means this object is new stuff\n if (err.statusCode == 404)\n return callback(null, {});\n else\n return callback(err);\n }\n callback(null, JSON.parse(data));\n })\n }\n // missing file or invalid json are both reasons for concern\n if (err) {\n return fallback()\n }\n var obj;\n try {\n obj = JSON.parse(data)\n }catch(e) {\n return fallback()\n }\n callback(null, obj);\n });\n },\n function (obj, callback) {\n inFlight.obj = tarasS3.combineObjects(inFlight.obj, obj);\n mkdirp.mkdirp(localDir, callback);\n },\n function(ignore, callback) {\n str = JSON.stringify(inFlight.obj);\n delete downloadDict[localFilename];\n upload(key, localFilename, str, callback);\n }\n ],function (err, data) {\n if (err)\n return callback(err);\n inFlight.callbacks.forEach(function (callback) {callback(null, key)});\n });\n}", "function uploadRequest(file){\n var xhr = new XMLHttpRequest();\n xhr.open('GET', `/sign-s3?file-name=${file.name}&file-type=${file.type}`);\n console.log(xhr)\n xhr.onreadystatechange = () => {\n if(xhr.readyState === 4){\n if(xhr.status === 200){\n var res = JSON.parse(xhr.responseText);\n uploadFile(file, res.signedRequest, res.url);\n }\n else{\n alert('Could not get signed URL.');\n }\n }\n };\n xhr.send();\n }", "function deleteFileInAFolder(file_key,req,res,operation)\n{\n const params = {\n Bucket:GlobalVar.AWS_BUCKET_NAME,\n Key: file_key //if any sub folder-> path/of/the/folder.ext \n }\n s3.headObject(params).promise()\n .then(()=>{\n console.log(\"File Found in S3\");\n s3.deleteObject(params).promise()\n .then(()=>{\n console.log(\"file deleted Successfully\");\n res.json('Bug '+ operation + ' with file_key: '+file_key);\n }).catch((err)=>{\n console.log(\"ERROR in file \" + operation+ \"ing : \" + JSON.stringify(err));\n res.status(400).json('Error: '+err);\n })\n }).catch((err)=>{\n console.log(\"File not Found ERROR : \" + err.code);\n res.status(400).json('Error: '+err);\n })\n}", "* exists (path) {\n return new Promise((resolve, reject) => {\n this.s3.headObject({\n Bucket: this.disk.bucket,\n Key: path\n }, (err, data) => {\n if (err) {\n if (err.code === 'NotFound') {\n return resolve(false)\n }\n return reject(err)\n }\n return resolve(true)\n })\n })\n }", "function getSignedRequest([file]) {\n setIsUploading(true);\n // We are creating a file name that consists of a random string, and the name of the file that was just uploaded with the spaces removed and hyphens inserted instead. \n //This is done using the .replace function with a specific regular expression. This will ensure that each file uploaded has a unique name which will prevent files from overwriting other files due to duplicate names.\n const fileName = `${randomString()}-${file.name.replace(/\\s/g, '-')}`;\n // We will now send a request to our server to get a \"signed url\" from Amazon. We are essentially letting AWS know that we are going to upload a file soon. \n //We are only sending the file-name and file-type as strings. We are not sending the file itself at this point.\n axios\n .get(\"/sign-s3\", {\n params: {\n 'file-name': fileName,\n 'file-type': file.type\n }\n })\n .then(response => {\n const {signedRequest, url} = response.data;\n uploadFile(file, signedRequest, url);\n })\n .catch(err => {\n console.log(err)\n });\n }", "async function downloadAudio(S3Url) {\n\n download(S3Url).then(data => {\n fs.writeFileSync('audioFolder/audioFile.mp3', data);\n });\n\n}", "async function getFile(fileId) {\n return await $.ajax({\n url: domain + \"/file/\" + encodeURIComponent(fileId),\n method: \"GET\",\n });\n }", "get bucketUrl() {\n return this.urlForObject();\n }", "function getFile(url, callback) {\n\tvar xhr = new XMLHttpRequest();\n\txhr.open('GET', url, true);\n\txhr.responseType = 'blob';\n\txhr.onload = function(e) {\n\t\tif (this.status == 200) {\n\t\t\tcallback(this.response);\n\t\t}\n\t};\n\txhr.send();\n}", "async function getStorage (url) {\n return await fetch(url, {\n method: 'GET',\n credentials: 'same-origin',\n headers: {\n 'Content-Type': 'application/json'\n },\n })\n}", "async function putS3(fileKey, data) {\n oLog.verbose(__filename, 'putS3');\n\n try {\n if (configs.aws.s3.active) {\n // set aws region:\n rAWS.config.update({\n region: configs.aws.s3.region\n });\n // bucket info:\n let s3Bucket = configs.aws.s3.s3bucket;\n let s3FileKey = fileKey;\n let s3Params = {\n Bucket: s3Bucket,\n Key: s3FileKey,\n Body: data\n };\n\n // get object and parse the JSON:\n return rS3.putObject(s3Params).promise();\n } else {\n // empty object if not active:\n return {};\n }\n } catch (error) {\n oLog.error(__filename, 'putS3', error);\n return error;\n }\n}" ]
[ "0.78079504", "0.7776254", "0.7768614", "0.7666587", "0.75503224", "0.7482117", "0.7363299", "0.7182902", "0.7181803", "0.688952", "0.6852944", "0.6791557", "0.67521936", "0.6731061", "0.6689846", "0.6646522", "0.6614215", "0.6455275", "0.64538085", "0.64111936", "0.6358914", "0.6263799", "0.62049276", "0.6166563", "0.6159789", "0.61393505", "0.61264753", "0.60913664", "0.6066956", "0.60619855", "0.60424143", "0.6011061", "0.5974987", "0.5967754", "0.59214437", "0.59193915", "0.58991015", "0.58699846", "0.58611125", "0.5829018", "0.5818602", "0.579261", "0.5769418", "0.5747361", "0.57378113", "0.571705", "0.57017475", "0.5668338", "0.56599337", "0.56594145", "0.5647732", "0.5643547", "0.56416154", "0.5629093", "0.5625422", "0.5621695", "0.55920696", "0.558479", "0.5579664", "0.55693036", "0.55595165", "0.5556621", "0.55513287", "0.55402493", "0.5538702", "0.5536921", "0.55340743", "0.55318826", "0.55267406", "0.55168", "0.55072653", "0.55000085", "0.5495596", "0.5493815", "0.548887", "0.5487506", "0.5480085", "0.5441223", "0.5434482", "0.54229236", "0.5420324", "0.54195887", "0.54151934", "0.5414371", "0.5409742", "0.54059255", "0.5384015", "0.53718925", "0.53598756", "0.5353412", "0.5350507", "0.53357506", "0.5320456", "0.5315266", "0.5311291", "0.53110427", "0.5308219", "0.52944714", "0.5288889", "0.5287162" ]
0.78494304
0
Deletes file from S3.
static deleteFile (bucketName, objectKey) { const s3 = Storage._getS3Instance(); const params = { Bucket: bucketName, Key: objectKey }; return new Promise((resolve, reject) => { s3.deleteObject(params, (err, data) => err ? reject(err) : resolve()); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteFile(fileKey) {\n var params = {\n Bucket: bucketName,\n Key: fileKey,\n };\n\n s3.deleteObject(params, function (err, data) {\n if (err) console.log(err, err.stack);\n console.log('deleted!');\n });\n}", "function deleteFileFromS3(key) {\n const deleteParams = {\n Bucket: 'week18',\n Key: key,\n }\n return s3.deleteObject(deleteParams).promise()\n}", "function deleteObject() {\n const deleteParams = {\n Bucket: bucket,\n Key: key,\n };\n s3Client.deleteObject(deleteParams, (err, data) => {\n if (err) console.log('err:', err);\n else console.log('data:', data);\n });\n}", "async deleteInS3(params) {\n s3.deleteObject(params, function (err, data) {\n if (data) {\n console.log(params.Key + \" deleted successfully.\");\n } else {\n console.log(\"Error: \" + err);\n }\n });\n }", "async function deleteFileFromFolder(){\n const params = {\n Bucket:process.argv[2],\n Key: process.argv[3] //if any sub folder-> path/of/the/folder.ext \n }\n s3=new AWS.S3({apiVersion: '2006-03-01'});\n try {\n await s3.headObject(params).promise()\n console.log(\"File Found in S3\")\n try {\n await s3.deleteObject(params).promise()\n console.log(\"file deleted Successfully\")\n }\n catch (err) {\n console.log(\"ERROR in file Deleting : \" + JSON.stringify(err))\n }\n } \n catch (err) {\n console.log(\"File not Found ERROR : \" + err.code)\n }\n\n}", "function deleteFileInAFolder(file_key,req,res,operation)\n{\n const params = {\n Bucket:GlobalVar.AWS_BUCKET_NAME,\n Key: file_key //if any sub folder-> path/of/the/folder.ext \n }\n s3.headObject(params).promise()\n .then(()=>{\n console.log(\"File Found in S3\");\n s3.deleteObject(params).promise()\n .then(()=>{\n console.log(\"file deleted Successfully\");\n res.json('Bug '+ operation + ' with file_key: '+file_key);\n }).catch((err)=>{\n console.log(\"ERROR in file \" + operation+ \"ing : \" + JSON.stringify(err));\n res.status(400).json('Error: '+err);\n })\n }).catch((err)=>{\n console.log(\"File not Found ERROR : \" + err.code);\n res.status(400).json('Error: '+err);\n })\n}", "async function gcsDelete(bucket, file) {\n // console.log('Deleting file: '+file);\n storage.bucket(bucket).file(file).delete()\n .catch(function (error) {\n console.error(\"!!!!!!!!!!!! Failed to delete a file: \" + error);\n });\n}", "mfDelete_LabradorAwsS3Images(file){\n\t\treturn mf.modeDelete_LabradorAwsS3Images(this,file)\n\t}", "function removeImageFromS3(imageKey) {\n s3.deleteObject(\n {\n Bucket: bucketName,\n Key: imageKey,\n },\n function (err, data) {\n winston.log(\n \"error\",\n `Error removing image ${imageKey} from S3 bucket ${bucketName}`,\n err\n );\n }\n );\n winston.info(`Removed image ${imageKey} from S3 bucket ${bucketName}`);\n}", "async function deleteBucketFile(fileType, userId, fileName) {\n const params = {\n Bucket: BUCKET_NAME,\n Key: `${fileType}/${userId}/${fileName}`\n };\n await S3_CONTROL.deleteObject(params);\n}", "function deleteFile(url){\n\t\t\treturn getFileEntry(url).then(doDeletion);\n\t\t}", "function after (s3, bucket, keys, done) {\n when.all(\n // Swallow deleteObject errors here incase the files don't yet exist\n keys.map(function (key) { return deleteObject(s3, bucket, key).catch(function() {}); })\n ).then(function () { done(); });\n}", "async purge(rawUrl) {\n this.debug(`purging ${rawUrl} from ${this.bucket}`);\n await this.s3.deleteObject({\n Bucket: this.bucket,\n Key: rawUrl,\n }).promise();\n this.debug(`purged ${rawUrl} from ${this.bucket}`);\n }", "async rm (filepath) {\n try {\n await this._unlink(filepath);\n } catch (err) {\n if (err.code !== 'ENOENT') throw err\n }\n }", "deleteObject(image) {\n const params = {\n Bucket: image.bucketName,\n Key: image.fileName\n };\n\n console.log(\"Delete original object: \" + params.Key);\n\n return this.client.deleteObject(params).promise();\n }", "async rm(filepath) {\n try {\n await this._unlink(filepath);\n } catch (err) {\n if (err.code !== 'ENOENT') throw err\n }\n }", "function deleteFile({ _id: _id, filename: filename }) {\n const getToken = localStorage.getItem('token');\n const getUserid = localStorage.getItem('userId');\n\n axios.delete(\"/api/delete\", {\n headers: {\n 'accept': 'application/json',\n 'Authorization': `Bearer ${getToken}`\n },\n params: {\n filename: filename,\n id: _id,\n userID: getUserid\n }\n })\n .then(function (response) {\n\n getStorageData();\n resetFields();\n history.push(\"/gameover\");\n })\n .catch(function (error) {\n console.log(error);\n });\n }", "function deleteFile(location) {\n console.log(\"DELETING \", location, \"!\");\n fs.unlink(location, function(err) {\n if (err) return console.log(err);\n console.log(\"file deleted successfully\");\n });\n}", "function del_Face(){\n\t\t\t\t// The name of the bucket to access, e.g. \"my-bucket\"\n\t\t\t\tvar bucketName = 'smartmirrortest'\n\n\t\t\t\t// The name of the file to delete, e.g. \"file.txt\"\n\t\t\t\t const filename = formatted+'face.jpg';\n\n\t\t\t\t// Instantiates a client\n\t\t\t\n\n\t\t\t\t// Deletes the file from the bucket\n\t\t\t\tgcs\n\t\t\t\t .bucket(bucketName)\n\t\t\t\t .file(filename)\n\t\t\t\t .delete()\n\t\t\t\t .then(() => {\n\t\t\t\t\tconsole.log(`gs://${bucketName}/${filename} deleted.`);\n\t\t\t\t })\n\t\t\t\t .catch((err) => {\n\t\t\t\t\tconsole.error('ERROR:', err);\n\t\t\t\t });\n\t\t\t}", "deleteFile(url){\n const file = url.split(env.files.uploadsUrl)[1]\n if(file != 'system/default.png'){\n fs.unlinkSync(env.files.uploadsPath+file)\n }\n }", "function DeleteBucket(filePath) {\n const bucket = functions.config().firebase.storageBucket\n const myBucket = gcs.bucket(bucket);\n const file = myBucket.file(filePath);\n console.log(`${myBucket},${filePath}, ${file}`)\n if (file.exists()){\n return file.delete();\n }\n else {\n return;\n }\n\n}", "async function uploadS3(filePath, folderName, deleteFile, callback) {\n\n var s3 = new AWS.S3({useAccelerateEndpoint: true});\n //configuring parameters\n var params = {\n Bucket: 'docintact',\n Body: fs.createReadStream(filePath),\n Key: folderName + \"/\" + Date.now() + \"_\" + path.basename(filePath)\n };\n s3.upload(params, function(err, data) {\n //handle error\n if (err) {}\n //success\n if (data) {\n if (deleteFile)\n if (fs.existsSync(filePath)) fs.unlinkSync(filePath)\n if (callback) callback(data.Location);\n else return data.Location;\n }\n });\n}", "function deleteFile (imageUrl) {\n if (!imageUrl) return\n // Recherche du nom du fichier de l'image\n const filename = imageUrl.split('/images/')[1]\n // Utilisation de 'file system' pour supprimer le fichier du dossier 'images'\n fs.unlink(`images/${filename}`, () => {})\n}", "function deleteObject() {\n var request = gapi.client.storage.objects.delete({\n 'bucket': BUCKET,\n 'object': object\n });\n executeRequest(request, 'deleteObject');\n}", "function deleteFile(avatar_path) {\n if (avatar_path) {\n let del = path.join(localBase, avatar_path);\n if (fs.existsSync(del)) {\n fs.unlinkSync(del);\n }\n }\n}", "async function deleteFile(fileId) {\n return await $.ajax({\n url: domain + \"/file/\" + encodeURIComponent(fileId),\n method: \"DELETE\",\n });\n }", "async function emptyAndDeleteFolderOfBucket() {\n s3=new AWS.S3({apiVersion: '2006-03-01'});\n const listParams = {\n Bucket:process.argv[2],\n Prefix:process.argv[3]\n };\n\n const listedObjects = await s3.listObjectsV2(listParams).promise();\n\n if (listedObjects.Contents.length === 0) return;\n\n const deleteParams = {\n Bucket: process.argv[2],\n Delete: { Objects: [] }\n };\n\n listedObjects.Contents.forEach(({ Key }) => {\n deleteParams.Delete.Objects.push({ Key });\n });\n\n await s3.deleteObjects(deleteParams).promise();\n\n if (listedObjects.IsTruncated) await emptyAndDeleteFolderOfBucket(process.argv[2], process.argv[3]);\n}", "function deleteBucket() {\n var request = gapi.client.storage.buckets.delete({\n 'bucket': BUCKET\n });\n executeRequest(request, 'deleteBucket');\n}", "function deleteFile(filePath) {\n if(!filePath.startsWith('/')){\n filePath = '/' + filePath;\n }\n var data = {\n path: filePath\n };\n return _operation('delete', data);\n }", "delete(directory, fileName, callback) {\n const theFilePath = getDataStoragePath(directory, fileName);\n fs.unlink(theFilePath, err => {\n if (err) return callback(new Error(`Failed to delete file!`), 500);\n callback(null);\n });\n }", "async destroyImage(file) {\n // const date = new Date();\n // const timestamp = date.getTime();\n // const hash = crypto.createHash('sha1');\n // const sign = hash.update(`public_id=${file}&timestamp=${timestamp}${CLOUDINARY_API_SECRET}`).digest('hex');\n //\n // const fd = new FormData();\n // fd.append('public_id', file);\n // fd.append('api_key', CLOUDINARY_API_KEY);\n // fd.append('timestamp', timestamp);\n // fd.append('signature', sign);\n //\n // try {\n // await axios.post(\n // CLOUDINARY_DELETE_URL,\n // fd\n // );\n // } catch (error) {\n // this.handleUpdateError(error);\n // }\n }", "function verifyFileInS3(req, res) {\n function headReceived(err, data) {\n if (err) {\n res.status(500);\n console.log(err);\n res.end(JSON.stringify({error: \"Problem querying S3!\"}));\n }\n else if (expectedMaxSize != null && data.ContentLength > expectedMaxSize) {\n res.status(400);\n res.write(JSON.stringify({error: \"Too big!\"}));\n deleteFile(req.body.bucket, req.body.key, function(err) {\n if (err) {\n console.log(\"Couldn't delete invalid file!\");\n }\n\n res.end();\n });\n }\n else {\n res.end();\n }\n }\n\n callS3(\"head\", {\n bucket: req.body.bucket,\n key: req.body.key\n }, headReceived);\n}", "function removeFile(fileName) {\n fs.unlink(fileName, function (err) {\n if (err) {\n console.error(err);\n }\n console.log('File has been Deleted');\n }); \n}", "static deleteFile(filePath) {\n if (Utilities.fileExists(filePath)) {\n console.log(`Deleting: ${filePath}`);\n fsx.unlinkSync(filePath);\n }\n }", "function deleteZip(filename) {\n\tlet path = './zips/' + filename;\n\n\tif (fs.existsSync(path)) {\n\t\tfs.unlinkSync(path);\n\t}\n}", "function deleteObject(oci, bucket, object) {\n return oci.request(bucket + object, {\n method: 'DELETE'\n }).then(() => console.log(`DELETE Success: ${object}`));\n}", "function deleteFile(file_id, cb) {\n\t\t$.ajax({\n\t\t\turl: '/api/v1/files/' + file_id + '/delete',\n\t\t\tmethod: 'delete',\n\t\t\tcache: false,\n\t\t\tsuccess: function(data) {\n\t\t\t\tif(data.status !== 'success') {\n\t\t\t\t\t$('#delete_file_modal .error-msg').text(data.message);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif(typeof cb === 'function') cb(data);\n\t\t\t\t}\n\t\t\t},\n\t\t\terror: function(err) {\n\t\t\t\tif(typeof ShopifyApp !== 'undefined') ShopifyApp.flashError(err.message);\n\t\t\t}\n\t\t});\n\t}", "function removeFileOfUploads(old_file_name) {\n cloudinaryApi.v2.uploader.destroy(old_file_name, function (result) { console.log(result) });\n}", "function deleteItem(item) {\n console.log(item);\n Firebase.database().ref(`/items/${item}`).remove();\n\n var desertRef = storage.ref(`images/${item.image}`);\n\n // Delete the file\n desertRef\n .delete()\n .then(function () {\n // File deleted successfully\n })\n .catch(function (error) {\n // Uh-oh, an error occurred!\n });\n }", "delete(fileID) {\n return this.ready.then(db => {\n const transaction = db.transaction([STORE_NAME], 'readwrite');\n const request = transaction.objectStore(STORE_NAME).delete(this.key(fileID));\n return waitForRequest(request);\n });\n }", "function deleteFile(filePath, message = '') {\n let fileNameSplit = filePath.split('\\\\');\n let fileName = fileNameSplit[fileNameSplit.length - 1];\n logger.silly(`Deleteing: ${fileName}`);\n try {\n if (fs.existsSync(filePath)) {\n fs.unlink(filePath, err => {\n if (err) {\n throw err;\n }\n logger.debug(message);\n });\n }\n } catch (err) {\n logger.error(`File: ${filePath} not deleted!`);\n logger.error(err.message);\n throw err;\n }\n}", "_removeFile(req, file, cb) { }", "function DeleteFile(oFSO, strFile)\n{\n\ttry\n\t{\n\t\tif (oFSO.FileExists(strFile))\n\t\t{\n\t\t\tvar oFile = oFSO.GetFile(strFile);\n\t\t\toFile.Delete();\n\t\t}\n\t}\n\tcatch(e)\n\t{ \n\t\tthrow e;\n\t}\n}", "function deleteFolderOfImages(project_id) {\n const listObjectsParams = {\n Bucket: process.env.AWS_BUCKET_NAME,\n Prefix: `${project_id}/`,\n };\n s3.listObjects(listObjectsParams, (err, data) => {\n\n const deleteObjectsParams = {\n Bucket: process.env.AWS_BUCKET_NAME,\n Delete: { Objects: [] },\n };\n for (const content of data.Contents) {\n deleteObjectsParams.Delete.Objects.push({ Key: content.Key });\n }\n s3.deleteObjects(deleteObjectsParams, () => {});\n });\n}", "function DeleteLocalFile(deleteFile) {\n fs.unlink('./test/' + deleteFile, function(error) {\n if (error) {\n throw error;\n }\n console.log('Deleted ' + deleteFile + '!!');\n });\n}", "async function deleteFile(user, fileName) {\n // File to delete\n const fileRef = storageRef.child(user + '/' + fileName);\n\n // Delete the file\n fileRef.delete().then(() => {\n location.reload();\n }).catch((error) => {\n // Uh-oh, an error occurred!\n console.log(error);\n });\n}", "async function deleteFile(fileID) {\n var path = await getActualPath(fileID);\n // remove from disk\n fs.unlink(path, function (error) {\n if (error) {\n console.error(error.stack);\n return;\n }\n });\n // remove from db\n db.deleteData('file', { id: fileID });\n\n console.log(`${fileID} deleted`);\n}", "deleteFile(path,callback) { this.engine.deleteFile(path,callback); }", "function deleteFile(fileName) {\n return $http({\n method: 'DELETE',\n url: '/api/Upload/DeleteFile',\n params: { fileName: fileName }\n });\n }", "function deleteImage(image) {\n fs.unlink(image, (err) => {\n if (err) {\n console.log(err);\n } else {\n console.log(\"Imagem apagada\");\n }\n });\n}", "removeObject(bucketName, objectName, cb) {\n if (!validateBucketName(bucketName)) {\n throw new errors.InvalidateBucketNameException('Invalid bucket name: ' + bucketName)\n }\n\n if (objectName === null || objectName.trim() === '') {\n throw new errors.InvalidObjectNameException('Object name cannot be empty')\n }\n this.objectRequest('DELETE', bucketName, objectName, cb)\n }", "deleteFile(name) {\n let auth = this.auth;\n const drive = google.drive({ version: 'v3', auth });\n this.db.collection(\"filesCollection\").findOne({\"name\": name}).then(file => {\n console.log(`Deleting file ${name} with id ${file.fileId} and keyId ${file.keyId}`);\n drive.files.delete({\n 'fileId': file.fileId\n }).then(fileDeleteRes => {\n drive.files.delete({\n 'fileId': file.keyId\n }).then(keyDeleteRes => {\n this.db.collection(\"filesCollection\").deleteOne({\"name\": name}).then(res => console.log(\"File in the database deleted\"));\n });\n });\n });\n }", "function deleteFile(filename) {\n return new Promise((resolve, reject) => {\n fs.unlink(filename, err => {\n if (err) {\n reject(err);\n } else {\n resolve();\n }\n })\n })\n}", "function deleteFileObs(filePath) {\n filePath = (0, path_2.normalizeTilde)(filePath);\n return _deleteFile(filePath);\n}", "async function remove(req, res, next) {\n const { mobile } = req.user;\n const { id } = req.params;\n Post.destroy({ where: { id, mobile } })\n .then(async () => {\n await emptyS3Directory(mobile, id);\n res.json(httpStatus[\"204_MESSAGE\"]);\n })\n .catch((err) => next(err));\n}", "function before (s3, bucket, keys, done) {\n createBucket(s3, bucket)\n .then(function () {\n return when.all(\n // Swallow deleteObject errors here incase the files don't yet exist\n keys.map(function (key) { return deleteObject(s3, bucket, key).catch(function () {}); })\n )\n }).then(function () { done(); });\n}", "function onDelete() {\n setFileURL(false)\n console.log(\"delete file\");\n }", "async function deleteImages(filename) {\n const fileUri = imageSettings.fileUri;\n const directory = imageSettings.directory;\n const dirPath = `${fileUri}/${directory}`;\n const files = fs.readdirSync(dirPath);\n\n files.forEach(function (name) {\n if (name.startsWith(filename)) {\n try {\n const filePath = dirPath + \"/\" + name;\n console.log(\"filePath: \", filePath);\n fs.unlinkSync(filePath);\n //file removed\n } catch (err) {\n console.error(err);\n }\n } else {\n console.log(\"don't delete: \", name);\n }\n });\n}", "function deleteFile(auth, param) {\n var fileId = param;\n if (typeof fileId === 'undefined') {\n console.error(\"Please type the id of the file as an argument\");\n return;\n }\n const drive = google.drive({ version: 'v3', auth });\n console.log(`Deleting file ${fileId}`);\n drive.files.delete({\n 'fileId': fileId\n });\n}", "async deleteLocalFile(path){\n const response = fs.promises.rm(path).then(async (msg) => {\n return true;\n }).catch(error => {\n Logger.log(error);\n return false;\n });\n\n return response;\n }", "function destroyFromGCS(storageFilePath) {\n let promise = new Promise((resolve, reject) => {\n const bucket = admin.storage().bucket();\n const file = bucket.file(storageFilePath);\n\n // storage.bucket(bucketName).file(storageFilePath).delete();\n file.delete().then(() => {\n // Deleted\n resolve();\n }).catch(err => {\n reject(err);\n });\n });\n return promise;\n}", "function deleteCsv(fileName) {\n const fs = require(\"fs\");\n fs.unlink(fileName, function (err) {\n if (err) throw err;\n //if no error, file has been deleted\n console.log(\"File deleted!\");\n })\n}", "static deleteFile(filePath, options) {\n FileSystem._wrapException(() => {\n options = Object.assign(Object.assign({}, DELETE_FILE_DEFAULT_OPTIONS), options);\n try {\n fsx.unlinkSync(filePath);\n }\n catch (error) {\n if (options.throwIfNotExists || !FileSystem.isNotExistError(error)) {\n throw error;\n }\n }\n });\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}", "function OnDelete(meta) {\n log('deleting document', meta.id);\n delete dst_bucket[meta.id]; // DELETE operation\n}", "function deleteThisFile () {\n // only hide the file\n $thisFile.hide();\n // trigger a file deletion operations\n self.emit('_deleteFile', $thisFile.find(ps).text(), function(err) {\n // show back the file on error or remove on success\n if (err) {\n $thisFile.fadeIn();\n } else {\n $thisFile.remove();\n }\n });\n }", "async destroy({ params, request, response }) {\n const category = await Category.find(params.id);\n const oldCategory = category;\n if (!category) {\n return response.status(404).json({ status: 0 });\n }\n\n const oldPicture = Helpers.publicPath(\"uploads\") + \"/\" + category.cover;\n fs.unlink(oldPicture, function(err) {\n if (err) response.status(400).json({ status: 0, error: err });\n });\n\n await category.delete();\n return response.status(200).json({\n status: 1,\n data: oldCategory\n });\n }", "downloadFile(bucket, fileNameToDownload, fileNameToSaveAs) {\n return new Promise((resolve, reject) => {\n var download = this.client.downloadFile({\n localFile: fileNameToSaveAs,\n s3Params: {\n Bucket: bucket,\n Key: fileNameToDownload\n }\n });\n\n download.on('error', error => {\n reject(error);\n });\n\n download.on('end', () => {\n resolve();\n });\n });\n }", "function saveToS3(fileName) {\n // load in file;\n let logDir = './logs';\n let directory =`${logDir}/${fileName}`;\n let myKey = fileName;\n var myBody;\n console.log(directory);\n\n // read then save to s3 in one step (so no undefined errors)\n fs.readFile(directory, (err, data) => {\n if (err) throw err;\n myBody = data;\n console.log(\"save to s3 data is \" + data);\n var params = {Bucket: myBucket, Key: myKey, Body: myBody, ContentType: 'text/plain'};\n s3.putObject(params, function(err, data) {\n if (err) {\n console.log(err)\n } else {\n console.log(\"Successfully uploaded data to myBucket/myKey\");\n }\n });\n\n });\n fs.unlink(directory);\n\n // the create bucket stuff started to cause problems (error: \"BucketAlreadyOwnedByYou: Your previous request to create the named bucket succeeded and you already own it.\")\n // so I pulled it all out\n}", "async function deleteFile(file) {\n const fileId = file._id\n\n // if AnnDataExperience clusterings need to be handled differently\n if (isAnnDataExperience && file.data_type === 'cluster') {\n annDataClusteringFragmentsDeletionHelper(file)\n } else if (isAnnDataExperience && file.status === 'new' && file.file_type === 'Cluster') {\n updateFile(fileId, { isDeleting: true })\n\n // allow a user to delete an added clustering that hasn't been saved\n deleteFileFromForm(fileId)\n } else {\n if (file.status === 'new' || file?.serverFile?.parse_status === 'failed') {\n deleteFileFromForm(fileId)\n } else {\n updateFile(fileId, { isDeleting: true })\n try {\n await deleteFileFromServer(fileId)\n deleteFileFromForm(fileId)\n Store.addNotification(successNotification(`${file.name} deleted successfully`))\n } catch (error) {\n Store.addNotification(failureNotification(<span>{file.name} failed to delete<br />{error.message}</span>))\n updateFile(fileId, {\n isDeleting: false\n })\n }\n }\n }\n }", "function removeFile(fileLocation) {\n fs.unlink(fileLocation, (err) => {\n if (err) throw err;\n });\n}", "function cleanUpFile(file_name)\n{\n\tconsole.log(\"Cleaning up\");\n\t\n\tdeleteFile(file_name + \".wav\");\n\tdeleteFile(file_name + \".mp3\");\n\n\tconsole.log(\"Done cleaning up\");\n}", "deleteRecord() {\n this._super(...arguments);\n const gist = this.gist;\n if(gist) {\n gist.registerDeletedFile(this.id);\n\n // Following try/catch should not be necessary. Bug in ember data?\n try {\n gist.get('files').removeObject(this);\n } catch(e) {\n /* squash */\n }\n }\n }", "function deleteFile(path) {\n return new Promise((res, rej) => {\n fs.unlink(path, err => {\n if (err) {\n console.log(err.stack);\n return rej(new Error(errorMessages.IO_ERROR(path)));\n }\n return res();\n })\n });\n}", "async function deleteFile(userIdIn, fileIdIn) {\n var db = await MongoClient.connect(process.env.PROD_MONGODB);\n await db.collection('files').deleteOne(\n {_id: new ObjectID(fileIdIn)}\n );\n await db.close();\n}", "function removeFile(file) {\n if (file.hash ===\n crypto\n .createHash(file.hashType)\n .update(file.name + 'LOG_FILE' + file.date)\n .digest('hex')) {\n try {\n if (fs.existsSync(file.name)) {\n fs.unlinkSync(file.name);\n }\n }\n catch (e) {\n debug(new Date().toLocaleString(), '[FileStreamRotator] Could not remove old log file: ', file.name);\n }\n }\n}", "function deleteFile(file, elem) {\n var order = 'filename=' + file;\n\n // POST request\n $.post(\"delete.php\", order, function(response, status, xhr) {\n if (status == \"success\") {\n console.log(response);\n }\n else if (status == \"error\") {\n alert('File could not be deleted.'); \n }\n });\n\n // Remove file row\n $(elem).closest(\"tr\").remove();\n}", "function deleteFile(req, res, next) {\n var generateResponse = Api_Response(req, res, next);\n var riskId = req.params.risk_id;\n var fileId = req.params.file_id;\n\n Risk.update(\n {\n _id: riskId\n },\n {\n $pull: {\n _files : {\n _id: fileId\n }\n }\n },\n function (error) {\n if (error) {\n return generateResponse(error);\n }\n\n Risk\n .findById(riskId)\n .exec(function (error, risk) {\n if (error) {\n return;\n }\n\n var activity = new Activity({\n action: 'activityFeed.deleteFileFromRisk',\n project: risk.project,\n user: req.user._id,\n risk: risk._id,\n riskName: risk.name\n });\n activity.save(function (error) {});\n\n // Send socket.io message.\n socket.deleteFileFromRisk(risk, fileId, req.user._id);\n });\n\n generateResponse(null);\n }\n );\n}", "function removeAudioFile() {\n var audioFile = Ti.Filesystem.getFile(res.data.filePath);\n audioFile.deleteFile();\n }", "deleteFile(path) {\r\n // Get the path\r\n path = this.getAbsoluteDataPath(path);\r\n // Make sure the path exists\r\n if (!FS_1.FS.existsSync(path))\r\n return false;\r\n // Remove the file\r\n FS_1.FS.unlinkSync(path);\r\n return true;\r\n }", "async delete(path) {\n await this.contentsManager.delete(path);\n }", "function deleteFile(id) {\n chrome.runtime.sendMessage({\n type: \"remove\",\n id: id\n });\n}", "function eliminarArchivo(path) {\n console.log(path)\n if (fs.existsSync(path)) {\n fs.unlinkSync(path);\n }\n}", "function deleteFile(fileName) {\n\n fs.unlink(fileName, function(error) {\n if (error) {\n console.warn(error)\n return false;\n } else {\n console.log(`Deleted file ${fileName} !`)\n return true;\n }\n });\n}", "function deleteFileIfItExists(fullPath) {\n if (fs.existsSync(fullPath)) {\n fs.unlinkSync(fullPath);\n }\n}", "delete(fileId, callback){\n throw new Error('delete is not implemented');\n }", "function deleteImageOnServer(imagePath){\n fs.unlink(imagePath,(err)=>{\n if(err){\n console.log(err);\n return;\n } \n console.log(\"Image\" + imagePath + \"successfully removed from server\");\n });\n}", "async handleDelete(fileName) {\n console.log(fileName);\n await axios.delete('/api/delete-email', { data: { fileName } });\n }", "function deleteFile(deletedFilePath, timestamp) {\n\n //if this should be ignored due to the st-ignore.json file \n if(!ignoreThisFileOrDir(deletedFilePath)) {\n \n //get the file id based on the file path\n var deletedFileId = getIdFromFilePath(deletedFilePath);\n \n //if the file is being tracked\n if(deletedFileId) {\n\n //delete the mapping from the old file path \n removeFilePathToIdMap(deletedFilePath);\n \n //update the file in the collection of all files\n allFiles[deletedFileId].isDeleted = true;\n\n //create a delete file event\n var deleteFileEvent = {\n id: \"ev_\" + branchId + \"_\" + autoGeneratedEventId, \n timestamp: timestamp,\n type: \"Delete File\",\n fileId: deletedFileId,\n fileName: allFiles[deletedFileId].currentName,\n parentDirectoryId: allFiles[deletedFileId].parentId,\n createdByDevGroupId: currentDeveloperGroup.id\n };\n \n //increase the id so the next event has a unique id\n autoGeneratedEventId++;\n \n //add the event to the collection of all events\n codeEvents.push(deleteFileEvent);\t\n }\n }\n}", "deleteFile(filename, folder) {\n let filePath = path_1.default.join(process.cwd(), folder, filename);\n return new Promise((resolve, reject) => {\n fs_1.default.unlink(filePath, (err) => {\n if (err) {\n return reject({ message: \"failed to delete file\" });\n }\n else {\n return resolve({ message: \"file deleted successfully\" });\n }\n });\n });\n }", "static deleteEntry(path) {\n Databases.fileMetaDataDb.remove({path: path}, (err, numDeleted) => {\n if (err) {\n console.log(err);\n }\n });\n }", "function deleteFile(file, path) {\n\treturn new Promise((resolve, reject) => {\n\t\tconst files = _.isArray(file) ? file : [file];\n\t\tvar filesRemaining = files.length;\n\t\tfiles.forEach(file => {\n\t\t\tdebug(`deleting ${file.name}`);\n\n\t\t\tvar filePath = `${path}/${file.path}`;\n\t\t\tfilesRemaining--;\n\n\t\t\tfs.unlink(filePath, err => {\n\t\t if (err) reject(err);\n\t\t });\n\n\t\t if (!filesRemaining) resolve(file);\t\n\t\t});\t\n });\n}", "removeFile(file) {\n if (file.status === $3ed269f2f0fb224b$export$2e2bcd8739ae039.UPLOADING) this.cancelUpload(file);\n this.files = $3ed269f2f0fb224b$var$without(this.files, file);\n this.emit(\"removedfile\", file);\n if (this.files.length === 0) return this.emit(\"reset\");\n }", "function removeFilesOfUploads(res,file_path,message){\n\tfs.unlink(file_path,(err)=>{\n\t\treturn res.status(200).send({message})\n\t})\n}", "remove(fileKey, cb) {\n const absPath = path.resolve(path.join(this.options.path, fileKey));\n fs.unlink(absPath, err => {\n if (err) {\n return void cb(err);\n }\n\n cb();\n });\n }", "static removeFile(directory,fileName){\n\n\t\tlet filesdr = this.cleanSpace(fileName);\n\t\tlet successMessage = \"Successfully Removed : \" + directory + fileName;\n\n\t\texec(`rm ${directory}${filesdr}`, (err) => {\n\t\t\tthis.errHandler(err,successMessage);\n\n\t\t});\n\t}", "function deleteSuccessfulDownload(downloadItem){\n chrome.downloads.removeFile(downloadItem.id, function(){\n if(chrome.runtime.lastError){\n console.log(chrome.runtime.lastError.message);\n }\n\n chrome.downloads.erase({\"id\" : downloadItem.id}, function(){});\n });\n}", "async function storeOnS3(file) {\n // list acutal files\n const files = await fileListAsync('./output/');\n // if size is reached, gzip, send and rotate file\n for (const file of files) {\n const body = fs.createReadStream(`./output/${file}`);\n\n await new Promise((resolve, reject) => {\n // http://docs.amazonaws.cn/en_us/AWSJavaScriptSDK/guide/node-examples.html#Amazon_S3__Uploading_an_arbitrarily_sized_stream__upload_\n s3.upload({\n Bucket: process.env.S3_BUCKET,\n Key: file,\n Body: body\n })\n //.on('httpUploadProgress', (evt) => { console.log(evt); })\n .send(function (err, data) {\n // console.log(err, data); \n if (err) {\n reject(err);\n }\n resolve(data);\n });\n });\n await removeAsync(`./output/${file}`);\n }\n}", "function putS3File(bucketName, fileName, data, callback) {\n var expirationDate = new Date();\n // Assuming a user would not remain active in the same session for over 1 hr.\n expirationDate = new Date(expirationDate.setHours(expirationDate.getHours() + 1));\n var params = {\n Bucket: bucketName,\n Key: fileName,\n Body: data,\n ACL: 'public-read', // TODO: find way to restrict access to this lambda function\n Expires: expirationDate\n };\n s3.putObject(params, function (err, data) {\n callback(err, data);\n });\n}", "remove(bucket, key) {\n return this.store.del(`${bucket}${DELIM}${key}`);\n }" ]
[ "0.81347305", "0.7730284", "0.7537082", "0.7485254", "0.7221009", "0.6973603", "0.66631436", "0.6617493", "0.6594941", "0.65811527", "0.63809514", "0.630079", "0.6252118", "0.62352514", "0.62222856", "0.6163191", "0.61492425", "0.61306375", "0.605849", "0.6029425", "0.6025653", "0.6015356", "0.6004345", "0.5974961", "0.59706306", "0.5938166", "0.5901237", "0.58932", "0.5886996", "0.5871528", "0.58254266", "0.58002853", "0.5793985", "0.5762042", "0.5753901", "0.57456094", "0.5721758", "0.5713338", "0.5679907", "0.56724715", "0.56707203", "0.5643649", "0.5625222", "0.5614598", "0.55768484", "0.55738574", "0.55712736", "0.5565635", "0.55642927", "0.5559934", "0.5540279", "0.5539272", "0.55095255", "0.55090815", "0.5486687", "0.5473603", "0.546003", "0.5450434", "0.5448553", "0.5444884", "0.5438948", "0.5429025", "0.5418954", "0.54161197", "0.540879", "0.5398853", "0.539259", "0.538681", "0.53839386", "0.53824407", "0.5378854", "0.5372591", "0.5358532", "0.53564894", "0.53544277", "0.5353501", "0.5341473", "0.5339597", "0.5337992", "0.53378814", "0.531669", "0.53036326", "0.53000355", "0.5281862", "0.5277954", "0.52685183", "0.5262467", "0.52614087", "0.5254496", "0.5242062", "0.5224554", "0.5223972", "0.52147174", "0.52137834", "0.52093506", "0.5186181", "0.5179769", "0.51777714", "0.5172017", "0.516447" ]
0.7448886
4
Gets the single S3 instance.
static _getS3Instance () { s3instance = s3instance || new AWS.S3({ apiVersion: S3_API_VERSION }); return s3instance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getS3(awsAccessKey, awsSecretKey) {\n return new AWS.S3({\n accessKeyId: awsAccessKey,\n secretAccessKey: awsSecretKey\n });\n}", "async get(){\n try {\n let objectResult = await s3.getObject({\n Bucket: this.bucket,\n Key: this.key\n }).promise();\n \n let creds = JSON.parse(objectResult.Body);\n return creds;\n } catch(ex){\n if(ex.code === 'NoSuchKey'){\n return null;\n }\n console.error(ex);\n throw ex;\n }\n }", "function getObjFromS3(fileName, bucket, callback){\n let params = {Bucket: bucket, Key:fileName};\n s3.getObject(params, function(err, data){\n if(err){\n console.error(\"getObjFromS3 err\",err);\n } else {\n callback(data.Body.toString('utf-8'));\n }\n \n });\n\n}", "async getFile(params) {\n try {\n console.log(\"s3.getObject Params: \", params);\n var s3 = new this.AWS.S3();\n let file = await s3.getObject(params).promise();\n return (file);\n } catch (error) {\n console.error('S3.getObject error: ', error);\n return (error);\n }\n }", "function get_s3_resource(element, signature_view_url) {\n\tvar resource_url = element.src;\n\tvar xhr = new XMLHttpRequest();\n\txhr.open(\"GET\", signature_view_url+\"?resource_url=\"+resource_url);\n\txhr.onreadystatechange = function() {\n\t\tif(xhr.readyState === 4) {\n\t\t\tif(xhr.status === 200) {\n\t\t\t\tvar response = JSON.parse(xhr.responseText);\n\t\t\t\telement.src = response.signed_request;\n\t\t\t}\n\t\t\telse {\n\t\t\t\talert(\"Could not get signed URL.\");\n\t\t\t}\n\t\t}\n\t};\n\txhr.send();\n}", "* get (path) {\n return new Promise((resolve, reject) => {\n this.s3.getObject({\n Bucket: this.disk.bucket,\n Key: path\n }, (err, data) => {\n if (err) return reject(err)\n return resolve(data.Body)\n })\n })\n }", "function getFileStream(fileKey) {\n const downloadParams = {\n Key: fileKey,\n Bucket: bucketName\n }\n var object = s3.getObject(downloadParams).createReadStream().on('error', (err) => console.log(err + 'ERROR GET FILE FROM 3S'))\n return object\n}", "static getFile (bucketName, objectKey) {\n const s3 = Storage._getS3Instance();\n const params = {\n Bucket: bucketName,\n Key: objectKey\n };\n return new Promise((resolve, reject) => {\n s3.getObject(params, (err, data) => {\n if (err) {\n reject(err);\n } else {\n resolve({\n content: data.Body, // buffer\n type: data.ContentType, // string\n encoding: data.ContentEncoding, // string\n size: data.ContentLength // integer\n });\n }\n });\n });\n }", "function fetchFromS3(env, callback){\n // get the investigators cached version from AWS.\n if (!isValidEnv(env)){\n callback(\"Invalid env passed into fetchFromS3()\");\n return;\n }\n // construct the filename from the env\n var filename = getS3FilePath(env);\n var params = {\n Bucket: AWS_BUCKET_NAME,\n Key: filename\n };\n // get the file\n console.log(\"Calling s3....\");\n s3.getObject(params, function(err,data){\n if (err){\n callback(\"InvestigatorService S3: \" + err.code);\n } else {\n var text = data.Body.toString('ascii');\n callback(null, text);\n }\n });\n}", "function S3Store(options) {\n options = options || {};\n\n this.options = extend({\n path: 'cache/',\n tryget: true,\n s3: {}\n }, options);\n\n\n // check storage directory for existence (or create it)\n if (!fs.existsSync(this.options.path)) {\n fs.mkdirSync(this.options.path);\n }\n\n this.name = 's3store';\n\n // internal array for informations about the cached files - resists in memory\n this.collection = {};\n\n // TODO: need implement!\n // fill the cache on startup with already existing files\n // if (!options.preventfill) {\n // this.intializefill(options.fillcallback);\n // }\n}", "* getStream (path) {\n return this.s3.getObject({\n Bucket: this.disk.bucket,\n Key: path\n }).createReadStream()\n }", "static getOrCreate(scope) {\n const stack = core_1.Stack.of(scope);\n const id = 'com.amazonaws.cdk.custom-resources.s3file-provider';\n const x = constructs_1.Node.of(stack).tryFindChild(id) || new S3FileProvider(stack, id);\n return x.provider.serviceToken;\n }", "function getS3File(bucketName, fileName, versionId, callback) {\n var params = {\n Bucket: bucketName,\n Key: fileName\n };\n if (versionId) {\n params.VersionId = versionId;\n }\n s3.getObject(params, function (err, data) {\n callback(err, data);\n });\n}", "static instance() {\n if (!singleton) {\n singleton = new Cart()\n }\n return singleton\n }", "function getS3PreSignedUrl(s3ObjectKey) {\n\n const bucketName = process.env.S3_PERSISTENCE_BUCKET;\n \n const s3PreSignedUrl = s3SigV4Client.getSignedUrl('getObject', {\n Bucket: bucketName,\n Key: s3ObjectKey,\n Expires: 60*1 // the Expires is capped for 1 minute\n });\n\n console.log(`Util.s3PreSignedUrl: ${s3ObjectKey} URL ${s3PreSignedUrl}`); // you can see those on CloudWatch\n\n return s3PreSignedUrl;\n}", "function getBucket() {\n var request = gapi.client.storage.buckets.get({\n 'bucket': BUCKET\n });\n executeRequest(request, 'getBucket');\n}", "async function fetchInputFromS3(s3URL) {\n const tmpDir = await tmp.dir({ dir: \"/tmp\" });\n const parsedS3URL = url.parse(s3URL);\n const localFile = path.join(tmpDir.path, path.basename(parsedS3URL.path));\n console.log(`Downloading ${s3URL} to ${localFile}...`);\n\n const params = {\n Bucket: parsedS3URL.host,\n Key: parsedS3URL.path.slice(1),\n };\n const s3 = new AWS.S3();\n const readStream = s3.getObject(params).createReadStream();\n await new Promise((resolve, reject) => {\n readStream.on(\"error\", reject);\n readStream.on(\"end\", resolve);\n const file = fs.createWriteStream(localFile);\n readStream.pipe(file);\n });\n return localFile;\n}", "static isS3URL(url) {\n const s3Host =\n game.data.files.s3 &&\n game.data.files.s3 &&\n game.data.files.s3.endpoint &&\n game.data.files.s3.endpoint.host\n ? game.data.files.s3.endpoint.host\n : \"\";\n\n if (s3Host === \"\") return false;\n\n const regex = new RegExp(\"http[s]?://([^.]+)?.?\" + s3Host + \"(.+)\");\n const matches = regex.exec(url);\n\n const activeSource = matches ? \"s3\" : null; // can be data or remote\n const bucket = matches && matches[1] ? matches[1] : null;\n const current = matches && matches[2] ? matches[2] : null;\n\n if (activeSource === \"s3\") {\n return {\n activeSource,\n bucket,\n current,\n };\n } else {\n return false;\n }\n }", "function getCloudWatch(awsAccessKey, awsSecretKey) {\n return new AWS.CloudWatch({\n accessKeyId: awsAccessKey,\n secretAccessKey: awsSecretKey\n });\n}", "constructor (id, s3) {\n this.s3Prefix = process.env.S3_PREFIX // 'scores-bot'\n this._store = s3\n this.id = id\n this.touch(true)\n this.setDefaultState()\n }", "async load() {\r\n this._logger.info(\"===> AmazonStorageConfigProvider::load\");\r\n const networkEndpoint = new networkEndPoint_1.NetworkEndPoint(\"https\", `s3.${this._region}.amazonaws.com`, 443);\r\n const networkClient = networkClientFactory_1.NetworkClientFactory.instance().create(\"default\", networkEndpoint, this._logger);\r\n // Use a cache bust when we are doing admin\r\n const cacheBust = objectHelper_1.ObjectHelper.isEmpty(this._credentials) ? \"\" : `?cachebust=${Date.now()}`;\r\n let config;\r\n try {\r\n config = await networkClient.json(undefined, \"GET\", `${this._bucketName}/${this._configName}.json${cacheBust}`);\r\n }\r\n catch (exc) {\r\n let emptyConfig = false;\r\n if (objectHelper_1.ObjectHelper.isType(exc, networkError_1.NetworkError)) {\r\n emptyConfig = true;\r\n }\r\n if (!emptyConfig) {\r\n throw exc;\r\n }\r\n }\r\n this._logger.info(\"<=== AmazonStorageConfigProvider::load\", config);\r\n return config;\r\n }", "function uploadAndFetch (s3, stream, filename, bucket, key) {\n var deferred = when.defer();\n exports.getFileStream(filename)\n .pipe(stream)\n .on(\"error\", deferred.reject)\n .on(\"finish\", function () {\n deferred.resolve(exports.getObject(s3, bucket, key));\n });\n return deferred.promise;\n}", "presignedGetObject(bucketName, objectName, expires) {\n if (!validateBucketName(bucketName)) {\n throw new errors.InvalidateBucketNameException('Invalid bucket name: ' + bucketName)\n }\n if (objectName === null || objectName.trim() === '') {\n throw new errors.InvalidObjectNameException('Object name cannot be empty')\n }\n var requestParams = {\n host: this.params.host,\n port: this.params.port,\n protocol: this.params.protocol,\n path: `/${bucketName}/${uriResourceEscape(objectName)}`,\n method: 'GET',\n expires: expires\n }\n return presignSignatureV4(requestParams, this.params.accessKey, this.params.secretKey)\n }", "function fetchAndStoreObject(bucket, key, fn) {\n\tif (bucket === null) {\n\t\tbucket = constants.defaultBucket;\n\t}\n\tvar params = {\n\t\tBucket : bucket, /* required */\n\t\tKey : key\n\t/* required */\n\t};\n\tconsole.log(\"getObject for \" + JSON.stringify(params));\n\tvar file = fs.createWriteStream('/tmp/' + key);\n\ts3.getObject(params).on('httpData', function(chunk) {\n\t\tfile.write(chunk);\n\t\t// console.log(\"writing chunk in file.\"+key);\n\t}).on('httpDone', function() {\n\t\tfile.end();\n\t\tconsole.log(\"file end.\" + key);\n\t\tfn();\n\t}).send();\n}", "constructor() {\n if(! Storage.instance){\n Storage.instance = this;\n }\n\n return Storage.instance;\n }", "getBucket() {\n const headers = {\n Date: this._buildDateHeader(),\n };\n\n const authHeader = this._buildAuthHeader('GET', '', {}, headers);\n const fetchOptions = {\n method: 'GET',\n headers: {\n Authorization: authHeader,\n },\n };\n\n return new Promise((resolve, reject) => {\n fetch(this.bucketBaseUrl, fetchOptions)\n .then(res => resolve(res))\n .catch(err => reject(err));\n });\n }", "function getKinesis() {\n let params = {\n apiVersion: '2013-12-02',\n region: 'us-east-2',\n };\n\n return new aws.Kinesis(params);\n}", "get bucketUrl() {\n return this.urlForObject();\n }", "mfGetItems_LabradorAwsS3Images(){\n\t\treturn mf.modeGetItems_LabradorAwsS3Images(this)\n\t}", "getInstance() {\n if (!instance) instance = init();\n\n return instance;\n }", "function headObject() {\n const headObjectParams = {\n Bucket: bucket,\n Key: key,\n };\n s3Client.headObject(headObjectParams, (err, data) => {\n if (err) console.log('err:', err);\n else console.log('data:', data);\n });\n}", "getProviderName() {\n return AWSS3Provider.PROVIDER_NAME;\n }", "function getImageStream(project_id, idx) {\n return s3.getObject({\n Bucket: process.env.AWS_BUCKET_NAME,\n Key: `${project_id}/${idx}.png`,\n }).createReadStream();\n}", "function createS3(regionName) {\n var config = { apiVersion: '2006-03-01' };\n \n if (regionName != null)\n config.region = regionName;\n\n var s3 = new AWS.S3(config);\n return s3;\n}", "constructor(fileSystem, s3Object) {\n this.fileSystem = fileSystem;\n this.s3Object = s3Object;\n }", "function s3(req, res) {\r\n console.log(\"[HEAD] head_s3 called\");\r\n res.json({});\r\n}", "function getObjectUrl({\n cosInstance,\n bucket: Bucket,\n region: Region,\n key: Key,\n origin = \"\",\n}) {\n const url = cosInstance.getObjectUrl({\n Bucket,\n Region,\n Key,\n Sign: false,\n });\n const { protocol, host } = new URL(url);\n return url.replace(`${protocol}//${host}`, origin);\n}", "static Create(opts, cb) {\n new S3FileSystem(opts, cb)\n }", "async function getImage(media_key) {\n const data = s3.getObject({\n Bucket: 'twitterimagesoth',\n Key: media_key\n }\n\n ).promise();\n return data;\n }", "function getEC2(awsAccessKey, awsSecretKey, region) {\n return new AWS.EC2({\n accessKeyId: awsAccessKey,\n secretAccessKey: awsSecretKey,\n region: region\n });\n}", "function getFileStream(fileKey) {\n const downloadParams = {\n Key: fileKey,\n Bucket: bucketName,\n };\n\n return s3.getObject(downloadParams).createReadStream();\n}", "function parseS3Url(url) {\n const [bucket, ...keyFragments] = url.replace(S3_PROTOCOL_PREFIX, '').split('/');\n return { bucket, key: keyFragments.join('/') };\n}", "getCategory() {\n return AWSS3Provider.CATEGORY;\n }", "get(id, cb){\n this.bucket.get(id, (err, res) => {\n if(err) return cb(err);\n cb(null, res.value);\n });\n }", "function getAWSSettings() {\n if (!awsSettings.accessKeyId || !awsSettings.secret || !awsSettings.region || !awsSettings.bucket) {\n $.alert('danger', 'Access to AWS is not configured');\n return null;\n }\n\n return awsSettings;\n}", "static getInstance(){\n return this.instance\n }", "get instance() {\n\t\treturn this.__instance;\n\t}", "static get instance() {\n if (!this[_scriptsSingleton]) {\n this[_scriptsSingleton] = new ScriptsSingleton(_scriptsSingleton);\n }\n\n return this[_scriptsSingleton];\n }", "download(fName){\n let client = this.s3Client;\n\n return new Promise((resolve, reject) => {\n client.getFile(fName, (err, res) => {\n if(err) reject(err);\n resolve(res);\n }); \n });\n }", "function getInstance () {\r\n let contractAddress = document.querySelector (\"#contractAddress\").value;\r\n if (contractAddress === \"\") {\r\n console.error (\"no contract address set\");\r\n }\r\n let factory = web3.eth.contract (window.abi);\r\n let instance = factory.at (contractAddress);\r\n return instance;\r\n}", "getObject(bucketName, objectName, cb) {\n if (!validateBucketName(bucketName)) {\n throw new errors.InvalidateBucketNameException('Invalid bucket name: ' + bucketName)\n }\n\n if (objectName === null || objectName.trim() === '') {\n throw new errors.InvalidObjectNameException('Object name cannot be empty')\n }\n this.getPartialObject(bucketName, objectName, 0, 0, cb)\n }", "function getFileStream(fileKey) {\n const downloadParams = {\n Key: fileKey,\n Bucket: AWS_BUCKET_NAME\n }\n\n return s3.getObject(downloadParams).createReadStream()\n}", "get bucketName() {\n return artifactAttribute(this, 'BucketName');\n }", "static getWeb3Instance() {\n const wallet = this.getWallet();\n\n const engine = new ProviderEngine();\n\n engine.addProvider(new WalletSubprovider(wallet, {}));\n engine.addProvider(new ProviderSubprovider(this.getWeb3HTTPProvider()));\n\n engine.start();\n\n const web3 = new Web3(engine);\n\n web3.eth.defaultAccount = wallet.getAddressString();\n\n return web3;\n }", "function _retrieveInstance(objName) {\r\n\t\tvar _instance = null;\r\n\t\tinstances.forEach(function(obj) {\r\n\t\t\t\tif(!!obj && obj.name == objName) {\r\n\t\t\t\t\t_instance = obj.instance;\r\n\t\t\t\t}\r\n\t\t});\r\n\t\treturn _instance;\r\n\t}", "static getInstance() {\n /**\n * Check if singleton is not exist, this will initailze the new one\n * and return if it existed\n *\n * When initalize successful, default configuration will be step up here\n */\n\n if (!AxiosSingleton.instance) {\n AxiosSingleton.instance = axios.create();\n const ACCESS_TOKEN = getLocalStorage('accessToken');\n AxiosSingleton.instance.defaults.headers.common[\n 'Authorization'\n ] = `Bearer ${ACCESS_TOKEN}`;\n // AxiosSingleton.instance.defaults.timeout = 2500;\n }\n\n return AxiosSingleton.instance;\n }", "static get instance() {\n if (!this[_contentLoaderSingleton]) {\n this[_contentLoaderSingleton] = new ContentLoaderSingleton(_contentLoaderSingleton);\n }\n\n return this[_contentLoaderSingleton];\n }", "get(bucket, key) {\n return this.store.get(`${bucket}${DELIM}${key}`);\n }", "function Singleton3(){\n if(!Singleton3.instance){\n Singleton3.instance = this;\n }\n this.toString = function(){\n return \"Singleton3\";\n };\n return Singleton3.instance;\n}", "function get(url) {\n return resourceCache[url];\n }", "function get(url) {\n return resourceCache[url];\n }", "function get(url) {\n return resourceCache[url];\n }", "function get(url) {\n return resourceCache[url];\n }", "function S3ObjectClass(configuration, createUploadRequestNamesFunction, redisClient)\n{\n\tvar self = this;\n\n\t//grab bucketname from config file\n\tvar bucketName = configuration.bucket;\n\tvar uploadExpiration = configuration.expires || 15*60;\n\n\tself.s3 = new AWS.S3({params: {Bucket: bucketName}, computeChecksums: false});\n\n\t//example for outside use or testing -- helpful if i forget my function logic later--or someone checking around from the outside\n\tself.requestFunctionExample = exampleUploadRequestFunction;\n\tself.createUploadRequests = createUploadRequestNamesFunction;\n\n\tself.uploadErrors = {\n\t\tnullUploadKey : 0,\n\t\tredisError : 1,\n\t\theadCheckUnfulfilledError : 2,\n\t\theadCheckMissingError : 3,\n\t\tredisDeleteError : 4\n\t}\n\n\n\tself.generateObjectAccess = function(fileLocations)\n\t{\n\n\t\t//we create a map of signed URLs\n\t\tvar fileAccess = {};\n\n\t\tfor(var i=0; i < fileLocations.length; i++)\n\t\t{\n\t\t\tvar fLocation = fileLocations[i];\n\n\t\t\tvar signedURLReq = {\n\t\t\t\tBucket: bucketName, \n\t\t\t\tKey: fLocation,\n\t\t\t\tExpires: uploadExpiration,\n\t\t\t};\n\n\t\t\tvar signed = self.s3.getSignedUrl('getObject', signedURLReq);\n\n\t\t\tfileAccess[fLocation] = signed;\n\t\t}\n\n\t\treturn fileAccess;\n\t}\n\n\t//in case the upload properties are failures\n\tself.asyncConfirmUploadComplete = function(uuid)\n\t{\n\t\tvar defer = Q.defer();\n\n\t\tvar isOver = false;\n\n\t\t//we have the uuid, lets fetch the existing request\n\t\tasyncRedisGet(uuid)\n\t\t\t.then(function(val)\n\t\t\t{\n\t\t\t\t//if we don't have a value -- the key doesn't exist or expired -- either way, it's a failure!\n\t\t\t\tif(!val)\n\t\t\t\t{\n\t\t\t\t\t//we're all done -- we didn't encounter an error, we just don't exist -- time to resubmit\n\t\t\t\t\tdefer.resolve({success: false, error: self.uploadErrors.nullUploadKey});\n\t\t\t\t\tisOver = true;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t//so we have our object\n\t\t\t\tvar putRequest = JSON.parse(val);\n\n\t\t\t\t//these are all the requests we made\n\t\t\t\tvar allUploads = putRequest.uploads;\n\n\t\t\t\t//we have to check on all the objects\n\t\t\t\tvar uploadConfirmPromises = [];\n\n\t\t\t\tfor(var i=0; i < allUploads.length; i++)\n\t\t\t\t{\n\t\t\t\t\tvar req = allUploads[i].request;\n\n\t\t\t\t\tvar params = {Bucket: req.Bucket, Key: req.Key};\n\n\t\t\t\t\tuploadConfirmPromises.push(asyncHeadRequest(params));\n\t\t\t\t}\n\n\t\t\t\treturn Q.allSettled(uploadConfirmPromises);\n\t\t\t})\n\t\t\t.then(function(results)\n\t\t\t{\n\t\t\t\tif(isOver)\n\t\t\t\t\treturn;\n\n\t\t\t\t//check for existance\n\t\t\t\tvar missing = [];\n\n\t\t\t\t//now we have all the results -- we verify they're all fulfilled\n\t\t\t\tfor(var i=0; i < results.length; i++)\n\t\t\t\t{\n\t\t\t\t\tvar res = results[i];\n\t\t\t\t\tif(res.state !== \"fulfilled\")\n\t\t\t\t\t{\n\t\t\t\t\t\t// console.log(\"Results:\".red,results);\n\n\t\t\t\t\t\tdefer.resolve({success: false, error: self.uploadErrors.headCheckUnfulfilledError});\n\t\t\t\t\t\tisOver = true;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t//if one is false, we're all false\n\t\t\t\t\tif(!res.value.exists)\n\t\t\t\t\t\tmissing.push(i);\n\n\t\t\t\t}\n\n\t\t\t\t//are we missing anything???\n\t\t\t\tif(missing.length)\n\t\t\t\t{\n\t\t\t\t\tdefer.resolve({success: false, error: self.uploadErrors.headCheckMissingError, missing: missing});\n\t\t\t\t\tisOver = true;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t//we're all confirmed, we delete the upload requests now\n\t\t\t\t//however, this is not a major concern -- it will expire shortly anyways\n\t\t\t\t//therefore, we resolve first, then delete second\n\n\t\t\t\tisOver = true;\n\t\t\t\tdefer.resolve({success: true});\n\n\t\t\t\t//if we're here, then we all exist -- it's confirmed yay!\n\t\t\t\t//we need to remove the key from our redis client -- but we're not too concerned -- they expire when they expire\n\t\t\t\treturn;//asyncRedisDelete(uuid);\n\t\t\t})\n\t\t\t.catch(function(err)\n\t\t\t{\n\t\t\t\tif(isOver)\n\t\t\t\t\treturn;\n\n\t\t\t\tdefer.reject(err);\n\t\t\t});\n\n\t\treturn defer.promise;\n\t}\n\n\tfunction asyncHeadRequest(params)\n\t{\n\t\tvar defer = Q.defer();\n\n\t\tself.s3.headObject(params, function (err, metadata) { \n\t\t\tif (err)\n\t\t\t{\n\t\t\t\t//error code is not found -- it doesn't exist!\n\t\t\t\tif(err.code === 'NotFound') { \n\t\t\t \t// Handle no object on cloud here \n\t\t\t\t\tdefer.resolve({exists: false});\n\t\t\t\t} \n\t\t\t\t//straight error -- reject\n\t\t\t\telse \n\t\t\t\t\tdefer.reject(err);\n\n\t\t\t}else { \n\t\t\t\tdefer.resolve({exists: true});\n\t\t\t}\n\t\t});\n\n\t\treturn defer.promise;\n\t}\n\n\n\tself.asyncInitializeUpload = function(uploadProperties)\n\t{\t\n\t\t//we promise to return\n\t\tvar defer = Q.defer();\n\n\t\t//create a unique ID for this upload\n\t\tvar uuid = cuid();\n\n\t\t//we send our upload properties onwards\n\t\tvar requestUploads = self.createUploadRequests(uploadProperties);\n\n\t\t//we now have a number of requests to make\n\t\t//lets process them and get some signed urls to put the objects there\n\t\tvar fullUploadRequests = [];\n\n\t\t//these will be everything we need to make a signed URL request\n\t\tfor(var i=0; i < requestUploads.length; i++)\n\t\t{\n\n\t\t\t//\n\t\t\tvar upReqName = requestUploads[i];\n\n\t\t\tvar signedURLReq = {\n\t\t\t\tBucket: bucketName, \n\t\t\t\tKey: upReqName.prepend + uuid + upReqName.append, \n\t\t\t\tExpires: uploadExpiration,\n\t\t\t\t// ACL: 'public-read'\n\t\t\t};\n\n\t\t\tvar signed = self.s3.getSignedUrl('putObject', signedURLReq);\n\n\t\t\t//store the requests here\n\t\t\tfullUploadRequests.push({url: signed, request: signedURLReq});\n\t\t}\n\n\t\t//now we have our full requests\n\t\t//let's store it in REDIS, then send it back\n\n\t\tvar inProgress = {\n\t\t\tuuid: uuid,\n\t\t\tstate : \"pending\",\n\t\t\tuploads: fullUploadRequests\n\t\t};\n\n\t\t//we set the object in our redis location\n\t\tasyncRedisSetEx(uuid, uploadExpiration, JSON.stringify(inProgress))\n\t\t\t.catch(function(err)\n\t\t\t{\n\t\t\t\tdefer.reject(err);\n\t\t\t})\n\t\t\t.done(function()\n\t\t\t{\n\t\t\t\tdefer.resolve(inProgress);\n\t\t\t});\n\n\t\t//promise for now -- return later\n\t\treturn defer.promise;\n\t}\n\n\tfunction asyncRedisSetEx(key, expire, val)\n\t{\n\t\tvar defer = Q.defer();\n\n\t\tredisClient.setex(key, expire, val, function(err)\n\t\t{\n\t\t\tif(!err)\n\t\t\t\tdefer.resolve();\n\t\t\telse\n\t\t\t\tdefer.reject(err);\n\t\t});\n\n\t\treturn defer.promise;\n\t}\n\n\tfunction asyncRedisGet(key, val)\n\t{\n\t\tvar defer = Q.defer();\n\n\t\tredisClient.get(key, function(err, val)\n\t\t{\n\t\t\tif(!err)\n\t\t\t\tdefer.resolve(val);\n\t\t\telse\n\t\t\t\tdefer.reject(err);\n\t\t});\n\n\t\treturn defer.promise;\n\t}\n\n\tfunction asyncRedisDelete(key, val)\n\t{\n\t\tvar defer = Q.defer();\n\n\t\tredisClient.del(key, function(err, reply)\n\t\t{\n\t\t\tif(!err)\n\t\t\t\tdefer.resolve();\n\t\t\telse\n\t\t\t\tdefer.reject(err);\n\t\t});\n\n\t\treturn defer.promise;\n\t}\n\n\treturn self;\n}", "function deleteObject() {\n const deleteParams = {\n Bucket: bucket,\n Key: key,\n };\n s3Client.deleteObject(deleteParams, (err, data) => {\n if (err) console.log('err:', err);\n else console.log('data:', data);\n });\n}", "function getGetSignedUrl(key) {\n const signedUrlExpireSeconds = 60 * 5;\n return exports.s3.getSignedUrl('getObject', {\n Bucket: config_1.config.aws_media_bucket,\n Key: key,\n Expires: signedUrlExpireSeconds,\n });\n}", "function getObjectStream(_a) {\n var bucket = _a.bucket, key = _a.key, client = _a.client;\n return __awaiter(this, void 0, void 0, function () {\n var stream;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0: return [4 /*yield*/, client.getObject(bucket, key)];\n case 1:\n stream = _b.sent();\n return [2 /*return*/, stream.pipe(gunzip_maybe_1.default()).pipe(maybeTarball())];\n }\n });\n });\n}", "* url (path) {\n return `https://${this.disk.bucket}.s3.amazonaws.com/${path}`\n }", "function getFileStream(key) {\n const downloadParams = {\n Key: key,\n Bucket: 'week18'\n }\n return s3.getObject(downloadParams).createReadStream()\n}", "static getInstance() {\n if (!Singleton.instance) {\n Singleton.instance = new Singleton();\n }\n return Singleton.instance;\n }", "_storage() {\n return getStorage(get(this, '_storageType'));\n }", "function get(url) {\n return resourceCache[url];\n }", "function get(url) {\r\n return resourceCache[url];\r\n }", "async deleteInS3(params) {\n s3.deleteObject(params, function (err, data) {\n if (data) {\n console.log(params.Key + \" deleted successfully.\");\n } else {\n console.log(\"Error: \" + err);\n }\n });\n }", "mfGet_LabradorAwsS3ImageUrlUpload(replace=false){\n\t\treturn mf.modeGet_LabradorAwsS3ImageUrlUpload(this,replace)\n\t}", "function getS3Artifact(artifact) {\n return artifact.location.split(':')[5]\n}", "async function ListObject(bucketName, prefix) {\n let response;\n var params = {\n Bucket: bucketName,\n Delimiter: '/',\n MaxKeys: 1,\n Prefix: prefix\n };\n\n try {\n response = await S3.listObjectsV2(params).promise();\n }\n catch (error) {\n console.log(\"list error:\", error);\n }\n\n return response;\n}", "function getObject(key) {\n\tvar storage = window.localStorage;\n\tvar value = storage.getItem(key);\n\treturn value && JSON.parse(value);\n}", "function getInstance(objName, objClass) {\r\n\t\tvar instance = _retrieveInstance(objName);\r\n\t\tif(!instance) {\r\n\t\t\treturn _createInstance(objName, objClass, util.args.list(arguments, 2));\r\n\t\t} else {\r\n\t\t\treturn instance;\r\n\t\t}\r\n\t}", "function getSingleObject(objid) {\r\n var foundObject = getObject(objid, true);\r\n return foundObject;\r\n}", "function getInstances(opts) {\n if (!opts) {\n opts = {};\n }\n if (!opts.version) {\n opts.version = utilities.getVersion();\n }\n return pulumi.runtime.invoke(\"aws:ssoadmin/getInstances:getInstances\", {}, opts);\n}", "defaultAccount() {\n return functions_1.cached(this, CACHED_ACCOUNT, async () => {\n try {\n const creds = await this.defaultCredentials();\n const accessKeyId = creds.accessKeyId;\n if (!accessKeyId) {\n throw new Error('Unable to resolve AWS credentials (setup with \"aws configure\")');\n }\n return await new sdk_1.SDK(creds, this.defaultRegion, this.sdkOptions).currentAccount();\n }\n catch (e) {\n logging_1.debug('Unable to determine the default AWS account:', e);\n return undefined;\n }\n });\n }", "static get Instance() {\n return this._instance || (this._instance = new this());\n }", "async getPhoneFromToken(token) {\n let data = null\n const s3key = this.s3prefixTokens + token\n try {\n const s3 = new AWS.S3()\n data = await s3.getObject({\n Bucket: this.s3bucket,\n Key: s3key\n }).promise()\n }\n catch (err) {\n if (err.code == 'NoSuchKey') {\n let msg = `Tried looking up phone for a non-existent user token ${s3key}`\n logger.error(msg)\n throw err\n } else {\n let msg = `Error reading user token at s3://${this.s3bucket}/${s3key}: ${err}`\n logger.error(msg)\n throw err\n }\n }\n logger.debug(`Retrieved user token at s3://${this.s3bucket}/${s3key}`)\n return data.Body.toString()\n }", "async function uploadFileToS3(file, getSignedUrl) {\n try {\n const {fileUrl, signedRequestUrl} = await getSignedUrl(file)\n const url = await makeS3Request(fileUrl, signedRequestUrl, file)\n\n return url\n } catch (e) {\n return alert('Could not upload file.')\n }\n}", "async function putS3(fileKey, data) {\n oLog.verbose(__filename, 'putS3');\n\n try {\n if (configs.aws.s3.active) {\n // set aws region:\n rAWS.config.update({\n region: configs.aws.s3.region\n });\n // bucket info:\n let s3Bucket = configs.aws.s3.s3bucket;\n let s3FileKey = fileKey;\n let s3Params = {\n Bucket: s3Bucket,\n Key: s3FileKey,\n Body: data\n };\n\n // get object and parse the JSON:\n return rS3.putObject(s3Params).promise();\n } else {\n // empty object if not active:\n return {};\n }\n } catch (error) {\n oLog.error(__filename, 'putS3', error);\n return error;\n }\n}", "function getPutSignedUrl(key) {\n const signedUrlExpireSeconds = 60 * 5;\n return exports.s3.getSignedUrl('putObject', {\n Bucket: config_1.config.aws_media_bucket,\n Key: key,\n Expires: signedUrlExpireSeconds,\n });\n}", "mfGet_LabradorAwsS3ImageUrlDownload(key){\n\t\treturn mf.modeGet_LabradorAwsS3ImageUrlDownload(this,key);\n\t}", "function makeS3Request(fileUrl, signedRequestUrl, file) {\n return new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest()\n\n xhr.onreadystatechange = () => {\n if (xhr.readyState === 4) {\n if (xhr.status === 200) {\n resolve(fileUrl)\n } else {\n reject({\n status: xhr.status,\n statusText: xhr.statusText,\n })\n }\n }\n }\n\n xhr.open('PUT', signedRequestUrl)\n xhr.send(file)\n })\n}", "get(prefix, name) {\n let resourceName = resources[prefix + name];\n if(!instances[prefix + name]) {\n instances[prefix + name] = new resourceName();\n }\n return instances[prefix + name];\n }", "function getSignedUrl(filename, filetype, foldername, operation) {\n const folderName = foldername;\n const params = {\n Bucket: 'gsg-image-uploads',\n Key: `${folderName}/` + filename,\n Expires: 604800\n };\n if(operation==='putObject'){\n params['ContentType'] = filetype;\n }\n return new Promise((resolve, reject) => {\n s3.getSignedUrl(operation, params, function(err, data) {\n if (err) {\n console.log(\"Error\",err);\n reject(err)\n } else {\n resolve(data)\n }\n });\n });\n}", "function _getInstance(that)\n{\n var ws = that.ws ? that.ws : GLOBAL;\n\n var k = sockets.indexOf(ws);\n if (k < 0) {\n logger.info(\"ROV Module: _getInstance() failed!\");\n return ({});\n }\n\n return (instances[k]);\n}", "function getVersion (bucket, key, back, callback) {\n bucket = bucket.toLowerCase();\n var s3 = new AWS.S3();\n var version_params = {\n Bucket: bucket, /* required */\n KeyMarker: key,\n MaxKeys: back\n };\n s3.listObjectVersions(version_params, function(err, data) {\n if (err) {\n console.log(err, err.stack); // an error occurred\n console.log('bucket: '+bucket+ 'key: '+key+' back: '+back+' lastVersion: '+lastVersion);\n } else {\n\n if (data.Versions.length < back-1) {\n console.log('only one version');\n callback(null);\n return;\n }\n\n if (data.Versions[back-1].Key != key+'/store.json') {\n console.log('only one version, key mismatch: '+key+ ' vs '+data.Versions[back-1].Key);\n callback(null);\n return;\n }\n //console.log(data);\n var lastVersion = data.Versions[back-1].VersionId;\n //console.log('got last version for path: '+key+' id: '+lastVersion);\n //console.log(JSON.stringify(data, null, 4));\n var get_params = {\n Bucket: bucket,\n Key: key+'/store.json',\n VersionId: lastVersion\n }\n\n s3.getObject(get_params, function(err, data) {\n if (err) {\n console.log(err, err.stack); // an error occurred\n console.log('bucket: '+bucket+ 'key: '+key+' back: '+back+' lastVersion: '+lastVersion);\n } else {\n //console.log(data);\n callback(data.Body);\n }\n });\n }\n });\n}", "function StorageObject() {}", "function StorageObject() {}", "function StorageObject() {}", "function StorageObject() {}", "function StorageObject() {}", "function cfnInstanceStorageConfigS3ConfigPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnInstanceStorageConfig_S3ConfigPropertyValidator(properties).assertSuccess();\n return {\n BucketName: cdk.stringToCloudFormation(properties.bucketName),\n BucketPrefix: cdk.stringToCloudFormation(properties.bucketPrefix),\n EncryptionConfig: cfnInstanceStorageConfigEncryptionConfigPropertyToCloudFormation(properties.encryptionConfig),\n };\n}", "static existingInstance(id) {\n return this.instances[id];\n }" ]
[ "0.6656993", "0.6265979", "0.59003764", "0.5823779", "0.57539546", "0.5641354", "0.5605176", "0.5571959", "0.5543661", "0.5536765", "0.54907435", "0.54037434", "0.5251508", "0.52197915", "0.5178293", "0.51291525", "0.5107308", "0.50706774", "0.50539833", "0.50228333", "0.49909058", "0.49852946", "0.49837705", "0.4981952", "0.49649644", "0.4962448", "0.49600095", "0.4938793", "0.49190295", "0.4913765", "0.48915967", "0.4883577", "0.4871412", "0.48475635", "0.48424205", "0.48170143", "0.4811485", "0.4805022", "0.480264", "0.4795187", "0.47920045", "0.47684628", "0.47669443", "0.47579113", "0.47564322", "0.47427747", "0.47224563", "0.4713015", "0.47088557", "0.47009325", "0.47002965", "0.4695881", "0.46788234", "0.46736932", "0.46673387", "0.46565825", "0.4656199", "0.46488816", "0.4644448", "0.46441057", "0.46441057", "0.46441057", "0.46441057", "0.46394426", "0.46339083", "0.4623698", "0.4621325", "0.46186477", "0.46162826", "0.46005118", "0.4597984", "0.4593881", "0.45929283", "0.4574257", "0.4568761", "0.45615864", "0.4544777", "0.45391423", "0.45340893", "0.45220777", "0.45030323", "0.4502281", "0.44934958", "0.44917032", "0.44892886", "0.4482888", "0.4480406", "0.44728002", "0.44707865", "0.44633445", "0.44599688", "0.44592416", "0.44553128", "0.4454511", "0.4454511", "0.4454511", "0.4454511", "0.4454511", "0.44542977", "0.4449627" ]
0.8515359
0
! vuex v3.6.2 (c) 2021 Evan You
function r(e){var t=Number(e.version.split(".")[0]);if(t>=2)e.mixin({beforeCreate:r});else{var n=e.prototype._init;e.prototype._init=function(e){void 0===e&&(e={}),e.init=e.init?[r].concat(e.init):r,n.call(this,e)}}function r(){var e=this.$options;e.store?this.$store="function"===typeof e.store?e.store():e.store:e.parent&&e.parent.$store&&(this.$store=e.parent.$store)}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getFieldVuex() {\n return store.getters.dataField;\n }", "getProfileVuex() {\n return store.getters.dataProfile;\n }", "function vuexInit(){var options=this.$options;// store injection\n\tif(options.store){this.$store=options.store;}else if(options.parent&&options.parent.$store){this.$store=options.parent.$store;}}", "function U(He){Le&&(He._devtoolHook=Le,Le.emit('vuex:init',He),Le.on('vuex:travel-to-state',function(Ne){He.replaceState(Ne)}),He.subscribe(function(Ne,je){Le.emit('vuex:mutation',Ne,je)}))}", "function vuexInit() {\n\t var options = this.$options;\n\t var store = options.store;\n\t var vuex = options.vuex;\n\t // store injection\n\t\n\t if (store) {\n\t this.$store = store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t // vuex option handling\n\t if (vuex) {\n\t if (!this.$store) {\n\t console.warn('[vuex] store not injected. make sure to ' + 'provide the store option in your root component.');\n\t }\n\t var state = vuex.state;\n\t var getters = vuex.getters;\n\t var actions = vuex.actions;\n\t // handle deprecated state option\n\t\n\t if (state && !getters) {\n\t console.warn('[vuex] vuex.state option will been deprecated in 1.0. ' + 'Use vuex.getters instead.');\n\t getters = state;\n\t }\n\t // getters\n\t if (getters) {\n\t options.computed = options.computed || {};\n\t for (var key in getters) {\n\t defineVuexGetter(this, key, getters[key]);\n\t }\n\t }\n\t // actions\n\t if (actions) {\n\t options.methods = options.methods || {};\n\t for (var _key in actions) {\n\t options.methods[_key] = makeBoundAction(this.$store, actions[_key], _key);\n\t }\n\t }\n\t }\n\t }", "function vuexlocal() {\n return store => {\n // 判断是否有本地缓存如果有就取本地缓存的如果没有就取自身初始值\n let local = JSON.parse(localStorage.getItem('myVuex')) || store.replaceState(state)\n store.replaceState(local); // 替换state的数据\n store.subscribe((mutation,state) => { // 监听\n // 替换之前先取一次防止数据丢失\n let newstate = JSON.parse(JSON.stringify(state))\n localStorage.setItem('myVuex',JSON.stringify(newstate))\n })\n }\n}", "function vuexInit () {\n\t var options = this.$options;\n\t // store injection\n\t if (options.store) {\n\t this.$store = options.store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t }", "function vuexInit () {\n\t var options = this.$options;\n\t // store injection\n\t if (options.store) {\n\t this.$store = options.store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t }", "function vuexInit () {\n\t var options = this.$options;\n\t // store injection\n\t if (options.store) {\n\t this.$store = options.store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t }", "function vuexInit () {\n\t var options = this.$options\n\t // store injection\n\t if (options.store) {\n\t this.$store = options.store\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store\n\t }\n\t }", "users() {\n return this.$store.getters.users\n }", "function vuexInit () {\n\t var options = this.$options;\n\t // store injection\n\t if (options.store) {\n\t this.$store = typeof options.store === 'function'\n\t ? options.store()\n\t : options.store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t }", "getTokenVuex() {\n return store.getters.jwt;\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\r\n var options = this.$options;\r\n // store injection\r\n if (options.store) {\r\n this.$store = typeof options.store === 'function'\r\n ? options.store()\r\n : options.store;\r\n } else if (options.parent && options.parent.$store) {\r\n this.$store = options.parent.$store;\r\n }\r\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ? options.store() : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ? options.store() : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ? options.store() : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ? options.store() : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ? options.store() : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }" ]
[ "0.6759831", "0.67032593", "0.6644306", "0.62890977", "0.6276258", "0.6252346", "0.6231344", "0.6231344", "0.6231344", "0.6225691", "0.6143966", "0.6115739", "0.6100471", "0.6061475", "0.6061475", "0.6061475", "0.6061475", "0.6061475", "0.6060739", "0.6055024", "0.60186625", "0.5966318", "0.5966318", "0.5966318", "0.5966318", "0.5966318", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504", "0.59404504" ]
0.0
-1
! vuerouter v3.5.2 (c) 2021 Evan You
function r(e,t){0}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "function jj(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"source.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function version(){ return \"0.13.0\" }", "function TM(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function BO(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "private internal function m248() {}", "function Es(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function Uk(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function yh(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"graticule.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function Qw(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "vampireWithName(name) {\n \n }", "function iP(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"source.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function fyv(){\n \n }", "function Bv(e){let{basename:t,children:n,window:r}=e,l=X.exports.useRef();l.current==null&&(l.current=gv({window:r}));let o=l.current,[i,u]=X.exports.useState({action:o.action,location:o.location});return X.exports.useLayoutEffect(()=>o.listen(u),[o]),X.exports.createElement(Fv,{basename:t,children:n,location:i.location,navigationType:i.action,navigator:o})}", "function cO(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function ow(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function Wx(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function vT(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"layer.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function Ak(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "upgrade() {}", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "function Hr(e,t){\"undefined\"!==typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "function PD(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function dp(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function Rb(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function Ek(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function JV(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "transient private internal function m185() {}", "function jx(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function SigV4Utils() { }", "function vI(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"style.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "transient final protected internal function m174() {}", "function hA(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function __vue_normalize__(a,b,c,d,e){var f=(\"function\"==typeof c?c.options:c)||{};// For security concerns, we use only base name in production mode.\nreturn f.__file=\"/Users/hadefication/Packages/vue-chartisan/src/components/Pie.vue\",f.render||(f.render=a.render,f.staticRenderFns=a.staticRenderFns,f._compiled=!0,e&&(f.functional=!0)),f._scopeId=d,f}", "function VI(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"layer.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function $S(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "protected internal function m252() {}", "updated() {}", "install(Vue, options) {\n Vue.VERSION = 'v0.0.1';\n\n let userOptions = {...defaultOptions, ...options};\n // console.log(userOptions)\n\n // create a mixin\n Vue.mixin({\n // created() {\n // console.log(Vue.VERSION);\n // },\n\n\n });\n Vue.prototype.$italicHTML = function (text) {\n return '<i>' + text + '</i>';\n }\n Vue.prototype.$boldHTML = function (text) {\n return '<b>' + text + '</b>';\n }\n\n // define a global filter\n Vue.filter('preview', (value) => {\n if (!value) {\n return '';\n }\n return value.substring(0, userOptions.cutoff) + '...';\n })\n\n Vue.filter('localname', (value) => {\n if (!value) {\n return '';\n }\n var ln = value;\n if(value!= undefined){\n if ( value.lastIndexOf(\"#\") != -1) { ln = value.substr(value.lastIndexOf(\"#\")).substr(1)}\n else{ ln = value.substr(value.lastIndexOf(\"/\")).substr(1) }\n ln = ln.length == 0 ? value : ln\n }\n return ln\n })\n\n // add a custom directive\n Vue.directive('focus', {\n // When the bound element is inserted into the DOM...\n inserted: function (el) {\n // Focus the element\n el.focus();\n }\n })\n\n }", "function uf(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"layer.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function comportement (){\n\t }", "function Eu(t,e){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "function Vt(){this.__data__=[]}", "static get tag(){return\"hal-9000\"}", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }" ]
[ "0.57978964", "0.5790024", "0.57673717", "0.57367384", "0.57008004", "0.5652785", "0.5652413", "0.5597215", "0.55714834", "0.5547185", "0.5527301", "0.5518198", "0.55119205", "0.5460645", "0.54499424", "0.5382621", "0.53720886", "0.5364847", "0.53620136", "0.5353226", "0.53531384", "0.53531384", "0.53531384", "0.53531384", "0.53531384", "0.53531384", "0.53531384", "0.53531384", "0.53531384", "0.53531384", "0.53531384", "0.53531384", "0.53531384", "0.53531384", "0.53531384", "0.53531384", "0.53531384", "0.53531384", "0.53531384", "0.53531384", "0.53531384", "0.53531384", "0.53531384", "0.53531384", "0.53531384", "0.53531384", "0.53531384", "0.53531384", "0.53531384", "0.53531384", "0.53531384", "0.53531384", "0.53531384", "0.53531384", "0.53531384", "0.53531384", "0.53531384", "0.53342104", "0.5333475", "0.5328564", "0.5322236", "0.5315497", "0.53061616", "0.5292517", "0.5271219", "0.52707195", "0.52660376", "0.52500767", "0.52413577", "0.5238621", "0.5222373", "0.5213017", "0.5189953", "0.5153337", "0.5143059", "0.51271224", "0.5121101", "0.5120216", "0.5114904", "0.5106561", "0.5104166", "0.5104166", "0.5104166", "0.5104166", "0.5104166", "0.5104166", "0.5104166", "0.5104166", "0.5104166", "0.5104166", "0.5104166", "0.5104166", "0.5104166", "0.5104166", "0.5104166", "0.5104166", "0.5104166", "0.5104166", "0.5104166", "0.5104166", "0.5104166" ]
0.0
-1
post errors to error / warning div
function postErrorsAndResetErrorMessage(){ $("#errors").html(errorMessage); $("#errors").show(); // errorMessage = ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onerror(e){\n\t\t$('#errors').text(e.message);\n\t}", "function puterrors(error) {\n\tvar errBox = document.getElementById(\"reg-body\");\n\t// set the error box border to solid (from unset/hidden)\n\terrBox.style.borderStyle = \"solid\";\n\t// create a br (line break) element\n\tvar br = document.createElement(\"br\");\n\tvar br2 = document.createElement(\"br\");\n\t//check if there have been any previous errors. If not, create a \"Errors:\" headlines\n\tvar check = document.getElementById(\"errHead\");\n\tif (!check) {\n\t\tvar h4 = document.createElement(\"h4\");\n\t\th4.id = \"errHead\";\n\t\tvar errText = document.createTextNode(\"Errors:\");\n\t\th4.appendChild(errText);\n\t\terrBox.appendChild(h4);\n\t\t//add a line break after the headline\n\t\terrBox.appendChild(br);\n\t}\n\t//create a text node for the error message\n\tvar textNode = document.createTextNode(error);\n\t//add the error message to the error box\n\terrBox.appendChild(textNode);\n\t//add a line break after each error\n\terrBox.appendChild(br2);\n}", "function writeToErrorDiv(message){\n document.getElementById('errorDiv').innerHTML = message;\n}", "function displayError (errMsg) {\n $(\"#error-msg\").text(errMsg);\n $(\"#url-form,#loading,#content\").hide();\n $(\"#error\").show();\n}", "function ajax_error() {\n $(\"#error\").html(\"An error occurred -- try refreshing the page. If the problem persists, please contact the webmaster or try again later :(\").parents(\".alert\").slideDown(\"fast\");\n}", "function displayError(msg) {\n $(\"#error-message\").html(msg);\n $(\"#error-wrapper\").show();\n $(\"#results-wrapper\").hide();\n}", "function displayDisplayErrors(errors){\n displayErrors(errors, closeDisplayErrorEntry);\n resizeContent();\n}", "function onError(err) {\n $('#err').html(err);\n}", "function onError(){\n\t\n\t$('#erro').show();\n\t$('#sombra').show();\n\t$('#fechar_erro').show();\n\t\n}", "function error(message) {\r\n\t$('#error').html(message);\r\n\t$('#swatches').hide();\r\n}", "function placeErrorMessages () {\n\n // Error Message for no text entered\n const enterError = $(\"<div></div>\").addClass(\"tooltip\").text(\n \"Please enter an email address\");\n\n // Error message for incorrect formatting\n const formatError = $(\"<div></div>\").addClass(\"tooltip\").text(\n \"Emails should be formatted in the form ___@___.abc\");\n\n // Adds error messages to the HTML file\n $(\"#mail\").after(enterError, formatError);\n}", "function error() {\r\n\r\n \t$('#ir-anim-container').addClass('error');\r\n\t\t$('#ir-anim-container #congrats h1').text('Sorry, there was an error');\r\n\t\t$('#ir-anim-container #congrats p').text('Please, try again later');\r\n\t\t$('#ir-anim-container #gift-copy').remove();\r\n\t\t$('#ir-anim-container #gift-image').remove();\r\n\t\t$('#ir-anim-container #congrats').append('<img src=\"img/prize-error.png\" alt=\"Sorry, there was an error\" width=\"200\" height=\"190\" />');\r\n }", "function error(err) {\r\n notificationElement.style.display = \"block\"\r\n notificationElement.innerHTML = `<p>${err.message}</p>`\r\n}", "function posterror() { alert( \"There was an error. TODO: Prompt to resubmit here.\" ); }", "function displayError(errors, input) {\n\n errors.forEach(function (error) {\n $(input).after('<div style=\"color: red\" class=\"error\"><strong>' + error.message + '</strong></div>');\n });\n}", "function displayErrorMsg(error) {\n $(\".errorOverlay\", selector).text(tr(error));\n $(selector).addClass(\"error\");\n }", "function displayError() {\n if(originalError instanceof ValidationError) {\n $(\".validation-message--error\").text(`Validation Error: ${originalError.message}`);\n }\n else if(originalError instanceof LocationError) {\n $(\".validation-message--error\").text(`Location Error: ${originalError.message}`);\n }\n else {\n $(\".validation-message--error\").text(`Error: ${originalError.message}`);\n }\n }", "function handle_error() {\n\tvar snackbar = document.createElement('div');\n\tsnackbar.innerText = 'There was an error processing your request =(';\n\tsnackbar.setAttribute('id', 'snackbar');\n\tdocument.querySelector('.container-fluid').prepend(snackbar);\n\tsetTimeout(function() {\n\t\tdocument.querySelector('.container-fluid').removeChild(document.querySelector('#snackbar'));\n\t}, 5000);\n}", "function mdm_error(message) { document.getElementById(\"error\").innerHTML = 'try again'; }", "function edropx_display_error(element_id, message) {\n\n\t$(\"#\" + element_id).html(\"<div class=\\\"alert alert-danger\\\"><strong>Error:</strong>\" + message + \"</div>\");\n\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 updateUiError() {\n showElements(statusMessage);\n statusMessage.textContent =\n \"Sorry you have entered invalid value, please try again!\";\n statusMessage.classList.remove(\"success\");\n statusMessage.classList.add(\"error\");\n}", "function setError(errors, windowName) {\n $('.rentalbikes-' + windowName + '-window .rentalbikes-ajaxlogin-error')\n .text('');\n $('.rentalbikes-' + windowName + '-window .rentalbikes-ajaxlogin-error')\n .hide();\n var errorArr = new Array();\n errorArr = errors.split(',');\n var length = errorArr.length - 1;\n\n for (var i = 0; i < length; i++) {\n var errorText = $('.ytmpa-' + errorArr[i]).text();\n\n $('.rentalbikes-' + windowName + '-window .err-' + errorArr[i])\n .text(errorText);\n }\n $('.rentalbikes-' + windowName + '-window .rentalbikes-ajaxlogin-error')\n .fadeIn();\n }", "function errorMessage() {\n\t\n\t$loader.html('<span class=\"error typeIt2\">Purrrlease make a selection...... You can do that right meoewwwwermmmm thanks.</span>');\n\n\t//typeIt effect\n\t$('.typeIt2').typeIt({\n\t\tcursor: false,\n\t});\n\n}", "function setError(msg) {\n $('form:visible .error').text(msg).show();\n window.clearInterval(window.progressTimer );\n}", "function renderErrorPage() {\n var page = $('.error');\n page.addClass('visible');\n }", "function displayError() {\n\t\t// Hide loading animations\n\t\tdocument.getElementById(\"loadingmeaning\").style.display = \"none\";\n\t\tdocument.getElementById(\"loadinggraph\").style.display = \"none\";\n\t\tdocument.getElementById(\"loadingcelebs\").style.display = \"none\";\n\t\t\n\t\t// Display error at bottom of the page\n\t\tdocument.getElementById(\"errors\").innerHTML =\n\t\t\t\"Sorry, but an error occured during your server request.\";\n\t}", "insertErrorMessage(){\n\t\t$(this.element + \"Error\").html(this.errorMessage);\n\t}", "function display_ajax_alert_error(index, value, mfvid)\r\n{\r\n\tif (index === '__all__'){\r\n\t\t$('div.nonfield-ajax-error').remove();\r\n\t\t$(mfvid).prepend('<div class=\"alert callout nonfield-ajax-error\">'+value[0].message+'</div>');\r\n\t\tdocument.querySelector('.alert.callout.nonfield-ajax-error').scrollIntoView({ \r\n\t\t behavior: 'smooth' \r\n\t\t});\r\n\t}else{\r\n\t\t$(\"[name=\"+index+\"] + small.error\").remove();\t \t\t\t\t\t\r\n\t\t$(\"[name=\"+index+\"]\").after('<small class=\"error\">'+value[0].message+'</small>');\r\n\t}\r\n}", "error() {\n $(\".content\").html(\"Failed to load content!\");\n }", "error() {\n $(\".content\").html(\"Failed to load content!\");\n }", "error() {\n $(\".content\").html(\"Failed to load content!\");\n }", "function error(err) {\n $('.progress').hide();\n $('#error').show();\n console.log('ERROR(' + err.code + '): ' + err.message);\n}", "function handleErrors(errType, cbTag) {\n var errWrapper = Object(_interfaces_sxc_controller_in_page__WEBPACK_IMPORTED_MODULE_0__[\"$jq\"])('<div class=\"dnnFormMessage dnnFormWarning sc-element\"></div>');\n var msg = '';\n var toolbar = Object(_interfaces_sxc_controller_in_page__WEBPACK_IMPORTED_MODULE_0__[\"$jq\"])(\"<ul class='sc-menu'></ul>\");\n if (errType === 'DataIsMissing') {\n msg =\n 'Error: System.Exception: Data is missing - usually when a site is copied but the content / apps have not been imported yet - check 2sxc.org/help?tag=export-import';\n toolbar.attr('data-toolbar', '[{\\\"action\\\": \\\"zone\\\"}, {\\\"action\\\": \\\"more\\\"}]');\n }\n errWrapper.append(msg);\n errWrapper.append(toolbar);\n Object(_interfaces_sxc_controller_in_page__WEBPACK_IMPORTED_MODULE_0__[\"$jq\"])(cbTag).append(errWrapper);\n}", "function do_error(message) {\n $('#approveButton').prop('disabled', false);\n $('#statusDiv').html('');\n\n $('#error-box').show();\n $('#error-box').html('<p>Failed. Reload page and try again or contact support.</p> ');\n if (message) {\n console.log('server: '+message);\n $('#error-box').append('<p>System response: '+message+'</p>');\n }\n}", "function showError(errors)\n{ \n var mes = '';\n for (var key in errors) {\n mes += '<p>' + errors[key] + '</p>';\n }\n $('#mes-error').innerHTML = mes;\n}", "function show_error(message) {\n\t\t$(\"#error_msg\").text(message);\n}", "function displayCallErrors(error) {\n $('#errorDiv').show();\n $('#errorOutput').html(error);\n}", "function showWarnings(errors) {\n errors.forEach(error => {\n $(`#${error}`).addClass(\"invalid-group\");\n });\n}", "function showError() {}", "function errorDisplay() {\n $('#errorMsg').fadeIn(10);\n $('#errorMsg').html(\"WRONG !\");\n $('#errorMsg').fadeOut(900);\n}", "function revealErrors(location)\n\t\t\t\t\t{\n\t\t\t\t\t\t//If subject input has error...\n\t\t\t\t\t\tif(jQuery.inArray('subject',location)!=-1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsubject.parent().parent().addClass('error');\t\t\t\t\t\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\t//If content input has error...\n\t\t\t\t\t\tif(jQuery.inArray('content',location)!=-1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent.parent().parent().addClass('error');\t\t\t\t\t\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\t//If category input has error...\n\t\t\t\t\t\tif(jQuery.inArray('category',location)!=-1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcategory.parent().parent().addClass('error');\t\t\t\t\t\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\t//If signature input has error...\n\t\t\t\t\t\tif(jQuery.inArray('signature',location)!=-1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsignature.parent().parent().addClass('error');\t\t\t\t\t\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}", "function error() {\n $(\".content\").html(\"Failed to load content!\");\n }", "function error() {\n $(\".content\").html(\"Failed to load content!\");\n }", "function error(msg) {\n\t\t$(\"<div class=\\\"alert alert-danger alert-dismissible\\\" role=\\\"alert\\\">\" +\n\t\t\t\"<button type=\\\"button\\\" class=\\\"close\\\" data-dismiss=\\\"alert\\\" aria-label=\\\"Close\\\">\" +\n\t\t\t\"<span aria-hidden=\\\"true\\\">&times;</span></button>\" +\n\t\t\t\"<strong>Error!</strong> \" + msg + \"</div>\"\n\t\t).prependTo(\"#alerts\").hide().slideDown().delay(ERROR_TIMEOUT).slideUp(function () {$(this).remove();});\n\t}", "function errorHandler(data, errorCode, errorMessage) {\n document.getElementById(\"ErrorMessage\").innerText =\n \"Error occurred while retireving information. \" + errorMessage;\n }", "function setError(success, errormsg = \"\")\n{\n\tif (success)\n\t{\n\t\t// Ideally I want a clean look to the page, so the errorbar will only be used when an error occurs.\n\t\tdocument.getElementById(\"error\").innerHTML = \"\";\n\t}\n\telse\n\t{\n\t\tdocument.getElementById(\"error\").innerHTML = errormsg;\n\t\tconsole.log(errormsg);\n\t}\n}", "function error() {\r\n $(\"#city\").html(\"There has been an error.</br>Try again later!\");\r\n $(\"#description\").html(\"\");\r\n}", "function errorMessage(message) {\r\n\t$(\"#errorMessageContent\").text(message);\r\n\t$(\"#errorMessage\").css(\"display\", \"flex\");\r\n}", "function addErrorAlert(errorMessage) {\n // Duplicate the base alert\n var alertDiv = $(\"div.base-alert\").clone();\n \n // Set the alert message\n alertDiv.find(\"span.message\").text(errorMessage);\n \n // Insert the alert into the DOM and animate it into existence\n $(\"div.suggestion-form\").prepend(alertDiv);\n alertDiv.show(300);\n }", "function showError() {\n showStatus('error');\n}", "submitError(){\n\t\tif(!this.isValid()){\n\t\t\tthis.showErrorMessage();\n\t\t}\n\t}", "function returnErrorMessage() {\n $('.result-line').text(\"That is not a valid response\");\n }", "function show_message(res, container){\n if (res.status == 0 ) {\n $(container).addClass('error');\n } else {\n $(container).removeClass('error');\n }\n $(container).show().html(res.message);\n }", "function error(s, obj)\n{\n if ($(\"#error\").length == 0) {\n const div = $(\"<div></div>\");\n div.addClass(\"error\");\n div.attr(\"id\",\"error\");\n let errorTextSpan = makeSpan();\n errorTextSpan.attr(\"id\", \"error-text\");\n setHTML(errorTextSpan,s);\n const button = makeButton(\"OK\");\n button.click(function() {\n errorOkHandler(this);\n });\n div.append(errorTextSpan);\n div.append(\" \");\n div.append(button);\n obj.append(div);\n }\n else\n {\n let errorTextSpan = $(\"#error-text\");\n setHTML(errorTextSpan,s);\n }\n}", "function displayerr(){\n\t\t \tif(!document.querySelector(\"#loginerror\"))\n\t\t \t{\n\t\t\t \tvar invalid = document.createElement(\"p\");\n\t\t\t \tinvalid.innerHTML =\"Invalid Username or Password!\";\n\t\t\t \tinvalid.setAttribute('id', \"loginerror\");\n\t\t\t \tinvalid.setAttribute('class',\"error\");\n\t\t\t \tdocument.querySelector(\"#userdiv\").appendChild(invalid);\n\t\t \t}\n\t\t }", "function error() {\n $(\".content\").html(\"Failedtoloadcontent!\");\n }", "function showError(html, returnedData) {\n if (typeof(returnedData) != \"undefined\") {\n if (returnedData.responseText) {\n html += \"<br/>The SuccessWhale API reported the following error:<br/>\" + JSON.parse(returnedData.responseText).error\n }\n }\n $('#errorbox').html(html);\n $('#errorbox').show('slow', function hideLater() {\n setTimeout(function() {\n $('#errorbox').hide('slow');\n }, 5000);\n });\n}", "function errorView() {\n\t// The view for initial landing and error page\n\t$(\"#main\").css(\"grid-column\", \"1 / span 3\");\n\t$(\"#sidebar\").addClass(\"hidden\");\n\t$(\"#info\").removeClass(\"hidden\");\n}", "function showErr(err){\n\tconst outputElem = $('#results');\n\tconst errMsg = (\n\t\t\t`<p class=font>No results found.</p>`\n\t\t);\n\toutputElem.html(errMsg);\n}", "function errorMessage(err){\n const h2 = document.createElement('h2');\n h2.className = 'error';\n h2.textContent = \"There was an error loading the users. Try refreshing the page\";\n bodyDiv.appendChild(h2);\n console.log(err);\n}", "function error() {\r\n\t\tlet error = document.createElement(\"h3\");\r\n\t\terror.innerHTML = \"Sorry there are no recipes with \"+errorName+\", try again!\";\r\n\t\tdocument.getElementById(\"error\").appendChild(error);\r\n\t}", "function handleError(err) {\n id(\"home\").classList.add(\"hidden\");\n id(\"post\").classList.add(\"hidden\");\n id(\"new\").classList.add(\"hidden\");\n id(\"error\").textContent = err;\n id(\"error\").classList.remove(\"hidden\");\n id(\"search-btn\").disabled = true;\n id(\"home-btn\").disabled = true;\n id(\"new-btn\").disabled = true;\n }", "function error_dis(error) {\n if (error !== undefined) {\n var err = document.createElement(\"div\");\n err.className = \"err\";\n var err_mes = \"Error! \" + error;\n err.innerHTML = err_mes;\n error_display.appendChild(err);\n } else return;\n\n }", "function go_to_error(titu,msg,html){\n\t\t$('#err_back_title').html(titu); \n\t\t$('#err_back_msg').html(msg); \n\t\t$('#err_back_msg_red').html(html); \t\t\n\t\tchange_to('err_and_back');\t\n}", "function showError(error){\n\t\thideFilters();\n\t\t\n\t\t$('.selections').show();\n\t\t$('.picker').hide();\n\t\t$('.show-another').hide();\n\t\t$('.heading').html(`<span>${error}</span><a href = \"index2.html\"><br><div style = \"margin-top: 50px\" class = \"button\">Try Again</div></a>`);\n\t}", "function showError(type, text) {}", "function printFormError(obj , message){\n //if this object has an error message than print a new message\n if ($('#' + obj + '_error').length > 0){\n $('#' + obj + '_error_message').text(message);\n $('#' + obj + '_error').fadeIn('fast', function(){\n setTimeout(\"$('#\" + obj + \"_error').fadeOut('normal');\",5000);\n });\n return;\n }\n \n //if we got here we have no object than we need to create a new one\n var html = '';\n html = '<div class=\"formerror\" id=\"'+ obj + '_error\">';\n html+='<img src=\"/img/Error.png\" />';\n html+='<span class=\"formerror_message\" id=\"' + obj + '_error_message\">';\n html+=message;\n html+='</span>';\n html+='</div>';\n $('body').append(html);\n \n //get the location top and left\n var top , left;\n top = $('#' + obj).offset().top+ $('#' + obj).outerHeight() - $('#' + obj).height() - 15;//$('#' + obj).position().top;\n left = $('#' + obj).offset().left + $('#' + obj).outerWidth();//$('#' + obj).position().left + $('#' + obj).width() + 10;\n \n //we created the object now it's time to make it appear and disappear in the correct location\n $('#' + obj + '_error').css(\"top\" , top);\n $('#' + obj + '_error').css(\"left\" , left);\n //$('#' + obj + '_error').css('display', 'block');\n $('#' + obj + '_error').fadeIn('normal' , function(){\n setTimeout(\"$('#\" + obj + \"_error').fadeOut('normal');\",5000);\n });\n \n}", "function draw_error() {\n\tdocument.getElementById(\"raw_output\").innerHTML = \"ERROR!\";\n}", "function show_errors() {\n if (window.errors.length > 0) {\n $(\"html, body\").animate({ scrollTop: 0 }, \"fast\");\n log(window.errors.length + \" validation errors found\");\n $(\"#errors\").toggleClass(\"error\");\n $(\"#errors\").append(msgval(\"error_problems\") + \"<ul>\");\n for (var i = 0; i < window.errors.length; i++) {\n log(window.errors[i].id + \": \" + window.errors[i].msg);\n $(\"#errors\").append(\"<li>\" + msgval(window.errors[i].msg) + \"</li>\");\n $(window.errors[i].id).addClass(\"error\");\n $(\".error\").animate({\n opacity: 1\n }, 250);\n }\n $(\"#errors\").append(\"</ul>\");\n return false;\n } else {\n log(\"no errors found\");\n return true;\n }\n}", "function showErrorMessage() {\n\t$(\"#flash-message\").html(\"<br>Something went wrong. Please refresh the page and try again.<br>\");\n\t$(\"#flash-message\").show();\n}", "function handleErr(err) {\n console.log(\"error \" + err.responseJSON);\n // $(\"#alert .msg\").text(err.responseJSON);\n // $(\"#alert\").fadeIn(500);\n }", "function setError(text) {\n\t$(\"#errorStatus\")\n\t\t.show()\n\t\t.text(text)\n\t\t.css(\"background-color\",\"red\");\n}", "function throw_error(el,msg){\n \t$(el).addClass('error');\n \t$(el).parent().find('.error_box').html(msg).addClass('error');\n }", "function error() {\n\t//Checking for the presence of error div inside container, if so remove the error div\n\t\tif(document.querySelector('.error')) {\n\t\t\tdocument.querySelector('.error').parentElement.removeChild(document.querySelector('.error'));\n\t\t}\n\t\t\n\t\t//creating and adding error prompt\n\t\tconst errorPrompt = document.createElement('div');\n\t\terrorPrompt.className = 'error';\n\t\terrorPrompt.innerHTML = '<p>Enter something that you want to finish</p>'\n\t\t\t\t\t\n\t\tconst body = document.querySelector('.container');\n\t\tconst inputDiv = document.querySelector('.input');\n\t\tbody.insertBefore(errorPrompt, inputDiv);\n\t\t\t\n\t\t// Prompt will disapper after 3 seconds\n\t\tsetTimeout(() => {\n\t\t\terrorPrompt.style.display = 'None';\n\t\t\tinputElem.focus();\n\t\t}, 3000);\n}", "function error() {\n\t//Checking for the presence of error div inside container, if so remove the error div\n\t\tif(document.querySelector('.error')) {\n\t\t\tdocument.querySelector('.error').parentElement.removeChild(document.querySelector('.error'));\n\t\t}\n\t\t\n\t\t//creating and adding error prompt\n\t\tconst errorPrompt = document.createElement('div');\n\t\terrorPrompt.className = 'error';\n\t\terrorPrompt.innerHTML = '<p>Enter something that you want to finish</p>'\n\t\t\t\t\t\n\t\tconst body = document.querySelector('.container');\n\t\tconst inputDiv = document.querySelector('.input');\n\t\tbody.insertBefore(errorPrompt, inputDiv);\n\t\t\t\n\t\t// Prompt will disapper after 3 seconds\n\t\tsetTimeout(() => {\n\t\t\terrorPrompt.style.display = 'None';\n\t\t\tinputElem.focus();\n\t\t}, 3000);\n}", "function failPosition(error) {\n\t//change time box to show updated message\n\t$('#time').val(\"Error getting data: \" + error);\n\t\n}", "function failPosition(error) {\n\t//change time box to show updated message\n\t$('#time').val(\"Error getting data: \" + error);\n\t\n}", "function errorDiv(textError) {\n var div = document.getElementById('error');\n if (textError != '') {\n div.innerHTML = textError;\n div.style.display = 'block';\n } else if (div.style.display != 'none') {\n div.style.display = 'none';\n }\n}", "function showError(field,message){\r\n\t\t$(\"#error_\"+field).text(message);\r\n\t//\t$(\"#\"+field).css(\"background-color\", \"#ff9999\");\r\n\t\treturn false;\r\n}", "function errorHtml(data){\n var success = 'success';\n if (!data.success) {\n success = 'error';\n }\n return '<div class=\"message-'+success+' alert-'+success+'\">'+\n '<div class=\"message\"> <i class=\"icon\"></i> <span>'+data.message+'</span>'+\n '</div>';\n\n }", "function renderGeneralErrorAlert(error_message) {\r\n /**\r\n * hide any existings alerts\r\n */\r\n $('.alert_wrapper').addClass('d-none');\r\n\r\n /**\r\n * render the alert\r\n */\r\n $('#general_error_alert_wrapper').removeClass('d-none');\r\n $('#general_error').html('We encountered the following error: ' + error_message);\r\n}", "function error(message) {\n jsav.umsg(message, {\"color\" : \"red\"});\n jsav.umsg(\"<br />\");\n }", "function showError(error) {\n errorElement.innerText = error;\n\n //check for the username field\n if (!username.value) {\n username.classList = 'username invalid';\n } else {\n username.classList = 'username';\n }\n\n //check for the password field\n if (!password.value) {\n password.classList = 'password invalid';\n } else {\n password.classList = 'password';\n }\n\n //check for the mail field\n if (!mail.value) {\n mail.classList = 'mail invalid';\n } else {\n mail.classList = 'mail';\n }\n}", "function error() {\r\n id(\"error-text\").classList.remove(\"hidden\");\r\n id(\"error-text\").innerText = \"Something went wrong with the request. Please try again later.\";\r\n }", "function showError() {\n transitionSteps(getCurrentStep(), $('.demo-error'));\n }", "function showError(arr) {\n\t\n\tfor(var index in arr) {\n\t\t\n\t\tvar id = arr[index].id;\n\t\tvar message = arr[index].message;\n\t\tvar fieldName = arr[index].fieldName;\n\t\t\n\t\tif($(\"#\" + id + \"_err_msg\").length > 0) {\n\t\t\t\n\t\t\t// 1. Build the container for error message\n\t\t\t$(\"#\" + id + \"_err_msg\").html(buildErrorContainer());\n\t\t\t\n\t\t\t// 2. Remove display-none from the DIV\n\t\t\t$(\"#\" + id + \"_err_msg\").removeClass(\"display-none\");\n\t\t\t\n\t\t\t// 3. Add error message in the error container\n\t\t\t$(\"#\" + id + \"_err_msg span\").html(message);\n\t\t\t\n\t\t\t/*// Name filed\n\t\t\tif(fieldName === \"name\") {\n\t\t\t\t\n\t\t\t\t$(\"#\" + id + \"_err_msg span\").html(message);\n\t\t\t}\n\t\t\t\n\t\t\t// Email field\n\t\t\tif(fieldName === \"email\") {\n\t\t\t\t\n\t\t\t\t$(\"#\" + id + \"_err_msg span\").html(message);\n\t\t\t}\n\t\t\t\n\t\t\t// Password field\n\t\t\tif(fieldName === \"password\") {\n\t\t\t\t\n\t\t\t\t$(\"#\" + id + \"_err_msg span\").html(message);\n\t\t\t}\n\t\t\t\n\t\t\t// Company Name field\n\t\t\tif(fieldName === \"companyName\") {\n\t\t\t\t\n\t\t\t\t$(\"#\" + id + \"_err_msg span\").html(message);\n\t\t\t}\n\t\t\t\n\t\t\t// Common Message\n\t\t\tif(fieldName === \"commonMsg\") {\n\t\t\t\t\n\t\t\t\t$(\"#\" + id + \"_err_msg span\").html(message);\n\t\t\t}*/\n\t\t}\n\t\t\n\t\t// 4. Add red border line to the input fields\n\t\tif($(\"#\" + id).length > 0) {\n\t\t\t$(\"#\" + id).addClass(\"error-input-border\");\n\t\t}\n\t}\n}", "function showNetError(){\n var msgDivLength = jQuery(\".fixedAlert\").length;\n if(msgDivLength == 0){\n jQuery('.bot-div-page').prepend('<div class=\"fixedAlert\"></div>');\n jQuery(\".fixedAlert\").prepend('<div class=\"alert alert-danger\"><strong>Error! </strong>No Internet Connection!</div>');\n }\n }", "function showError(message) {\n errorDiv = document.querySelector(\"#error\");\n errorDiv.innerHTML += \"<p>\" + message + \"</p>\";\n}", "function processErrors(data){\n \n}", "function handleError(errorMsg) {\n hideProgressBar();\n showErrorScreen();\n }", "function affiche_error_connexion(ERROR){\n\t$(\".msg_error\").html(ERROR);\n}", "function error(err) {\n myAlertOnValium.show({\n type: 'danger',\n title: 'Upload failed',\n content: err || ''\n });\n }", "error() {\n $(\".content\").html(\"Failed to load the sidebar!\");\n }", "sendErrors(connection) {\r\n Object.keys(this._messages).forEach(message => {\r\n connection.window.showErrorMessage(message);\r\n });\r\n }", "sendErrors(connection) {\r\n Object.keys(this._messages).forEach(message => {\r\n connection.window.showErrorMessage(message);\r\n });\r\n }", "function upload_error() {\n $('#post_error').text(\"Upload se nezdařil (chyba serveru).\");\n}", "function failPosition(error) {\n\t//change time box to show updated message\n\t$('#time').val(\"Error getting data: \" + error);\n\n}", "function displayError(error) {\n console.log('displayError ran');\n $('.js-results').html(`<h3 class=\"error\">Something went wrong: ${error}</h3>`)\n $('.loading').addClass('hidden');\n $('.js-results').removeClass('hidden')\n}", "function error(msg) {\n\t\t// Update the status DOM object with the error message\n\t\tstatus.innerHTML = typeof msg === 'string' ? msg : 'Failed!';\n\t\tstatus.className = 'alert alert-error';\n\t}" ]
[ "0.7345106", "0.7003722", "0.70031124", "0.69754785", "0.6937411", "0.6910826", "0.69068384", "0.6904859", "0.6883177", "0.6868487", "0.6841011", "0.68354553", "0.6824967", "0.6816095", "0.67859614", "0.67851627", "0.6778072", "0.67690885", "0.6754595", "0.6752317", "0.67335397", "0.6719894", "0.6669534", "0.66694206", "0.6669338", "0.6651689", "0.66505146", "0.661412", "0.66039115", "0.65995765", "0.65995765", "0.65995765", "0.65987486", "0.65976775", "0.657542", "0.65742636", "0.6571645", "0.6570764", "0.65637183", "0.65452117", "0.6535724", "0.65325844", "0.6530628", "0.6530628", "0.6525485", "0.65236145", "0.6512742", "0.6508606", "0.6499185", "0.6486461", "0.6474018", "0.6473033", "0.6468063", "0.64634967", "0.6462543", "0.64620596", "0.645962", "0.644539", "0.64453095", "0.64447737", "0.64379334", "0.64235663", "0.6416023", "0.64141214", "0.64076865", "0.640086", "0.6399441", "0.63989186", "0.63974714", "0.63971746", "0.63956857", "0.638319", "0.63829315", "0.63803834", "0.6376212", "0.6376212", "0.63721156", "0.63721156", "0.6366928", "0.63608444", "0.63605773", "0.63558245", "0.6350528", "0.63499475", "0.634263", "0.63391155", "0.6336684", "0.6334124", "0.6332482", "0.63218266", "0.6320861", "0.6320035", "0.63170564", "0.6316112", "0.63156265", "0.63156265", "0.6315537", "0.63062507", "0.6304872", "0.63040257" ]
0.7158374
1
function for progress bar
function ProgressBar({ session, focusDuration, breakDuration }) { //calculations for progress bar for focus duration const focusDurationSec = focusDuration * 60; const focusDecimal = 1 - session?.timeRemaining / focusDurationSec; const focusPercentage = focusDecimal * 100 || 0; //calculations for progress bar for break duration const breakDurationSec = breakDuration * 60; const breakDecimal = 1 - session?.timeRemaining / breakDurationSec; const breakPercentage = breakDecimal * 100; //return jsx for progress bar return ( <> <div className="col"> <div className="progress" style={{ height: "20px" }}> <div className="progress-bar" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow={ session?.label === "Focusing" ? focusPercentage : breakPercentage } // TODO: Increase aria-valuenow as elapsed time increases style={{ width: session?.label === "Focusing" ? focusPercentage + "%" : breakPercentage + "%", }} // TODO: Increase width % as elapsed time increases /> </div> </div> </> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateBar(){\n var bar = $('#progress');\n\tif (variables.progress < 100){\n\t\tvariables.progress += 5;\n\t\tbar.width(variables.progress + '%');\n\t} else {\n\t\tvariables.progress = 0;\n\t\tvariables.videos += 1;\n\t\tbar.width(\"0%\");\n\t\tclearKeys();\n\t\tloadRound();\n\t}\n}", "function progress($element) {\n \t$this=$element;\n \tprWidth = $(this).data(\"value\")* $element.width() / 100;\n \t$this.find('.bar_filling').each(function(){\n \t\tvar progressBarVal = $(this).find('.bar_value').data('value');\n \t\t$(this).find('.bar_value').text(progressBarVal + \"% \");\n\n \t\tvar progressBarWidth = progressBarVal*$element.width()/100;\n \t\t$(this).animate({ width: progressBarWidth }, progressBarWidth*5); /* change 'progressBarWidth*5' to 2500 (for example) if we want constant speed */ \n \t}) \t\n }", "function progressBar(elem){\n $elem = elem;\n //build progress bar elements\n buildProgressBar();\n //start counting\n start();\n }", "function progressBar(elem){\n $elem = elem;\n //build progress bar elements\n buildProgressBar();\n //start counting\n start();\n }", "function progressBar(elem){\n $elem = elem;\n //build progress bar elements\n buildProgressBar();\n //start counting\n start();\n }", "function progressBar(elem){\n $elem = elem;\n //build progress bar elements\n buildProgressBar();\n //start counting\n start();\n }", "function progressBar( elem ) {\n jQueryelem = elem;\n // build progress bar elements\n buildProgressBar();\n // start counting\n start();\n }", "function progressBar(elem){\r\n $elem = elem;\r\n //build progress bar elements\r\n buildProgressBar();\r\n //start counting\r\n start();\r\n }", "function updateProgress (event) {\r\n var elem = document.getElementById(\"bar\"); \r\n var width = 0;\r\n if (event.lengthComputable) {\r\n var percentComplete = event.loaded / event.total;\r\n width = parseInt(100 * percentComplete);\r\n elem.style.width = Math.max(4, width) + '%'; \r\n elem.innerHTML = '&nbsp;' + Math.max(1, width) + '%';\r\n } else {\r\n\t\t\t// Unable to compute progress information since the total size is unknown\r\n console.log(\"no progress indication available\");\r\n } // end if else length\r\n } // end function updateProgress (event) ", "function progressBar(elem){\n $elem = elem;\n //build progress bar elements\n buildProgressBar();\n //start counting\n start();\n }", "onprogress() {}", "function callbackProgress( progress, result ) {\n\treturn;\n\tvar bar = 250;\n\tif ( progress.total ){\n\t\tbar = Math.floor( bar * progress.loaded / progress.total );\n\t}\n\tvar curBarWidth = document.getElementById( \"bar\" ).style.width;\n\tdocument.getElementById( \"bar\" ).style.width = bar + \"px\";\n}", "function progressBar(elem) {\n $elem = elem;\n //build progress bar elements\n buildProgressBar();\n //start counting\n start();\n }", "increaseProgressBar() {\n this.width += 100 / this.nbSecond * this.intervalTime / 1000; // calcul de la vitesse d'incrémentation en fonction du nombre de secondes total attendu\n $('#progress-bar').width(`${this.width}%`); // définition de la width\n if (this.width >= 100) {\n this.stopTimer(false);\n }\n this.timeSpent += this.intervalTime;\n }", "function set_progress(percent)\n{\n\tconsole.log(\"XDDD\");\n\tdocument.getElementById(\"bar\").style.width=percent+\"%\";\n}", "function startBar() {\n if (i == 0) {\n i = 1;\n width = 0;\n var id = setInterval(tick, 10);\n\n // 1 tick function of progress bar 1 tick = 100ms and\n function tick() {\n if (width >= 100 ) {\n clearInterval(id);\n i = 0;\n checkEndGame();\n } else {\n adjustWidth();\n }\n\n // adjust width of progress bar and % displayed each tick\n function adjustWidth() {\n width += 0.0166666666666667;\n bar.style.width = width + \"%\";\n bar.innerHTML = width.toFixed(1) + \"%\";\n\n // set width value to a var\n barWidth = width;\n }\n\n }\n }\n }", "function progressBar(elem) {\n $elem = elem;\n // build progress bar elements\n buildProgressBar();\n // start counting\n start();\n }", "function onLoadProgress(pct) {\n}", "onProgress(percentage, count) {}", "function progressBarFull() {\n\t$(\"#progress-bar-yellow\").css(\"width\",\"100%\");\n\tprogressBarPoint = 100;\n}", "function moveProgressBar() {\n\n\tvar status = document.querySelector('#status');\n\ttime = 0;\n\n\tprogress = setInterval(green, 20);\n\n\tfunction green() {\n\t\tif (time >= 100) {\n\t\t\tclearInterval(progress);\n\t\t\texitGame();\n\t\t} else if (score >= 10) {\n\t\t\ttime +=1;\n\t\t} else {\n\t\t\ttime +=0.5;\n\t\t} status.style.width = time + \"%\";\n\t}\n}", "function progress(step, nbSteps, stepLabel) {\n var percent = (step/(nbSteps+1))*100;\n $(\"#progress .progress-bar\").attr('aria-valuenow', step).attr('aria-valuemax', nbSteps+1).attr('style','width:'+percent.toFixed(2)+'%').find(\"span\").html(step + \"/\" + nbSteps);\n $(\"#progressStep\").html(stepLabel);\n}", "function setProgressBar() {\n monthlyProgress = daysMetGoal/daysInMonth;\n monthlyProgress = Math.round(monthlyProgress * 100, 0);\n var barLength = 1;\n if(statIndex == 1){\n if(monthlyProgress > 0){\n\t\tbarLength = monthlyProgress * .9; //divide by 9/10 since the progress bar is only 90 pixels wide\n\t}\n \tstatDisplay.setCursor(90, 55);\n\tstatDisplay.writeString(font, 1, '| ' + monthlyProgress + '%', 1, true);\n }\n else if (statIndex == 0){\n\tif(progress > 0) {\n\t\tbarLength = progress * .9;\n\t}\n\tstatDisplay.setCursor(90, 55);\n \tstatDisplay.writeString(font, 1, '| ' + progress + '%', 1, true);\n }\n barLength = Math.round(barLength);\n if(barLength > 90){ //if over 90 pixels, max out at 90 to prevent overwriting pixels\n barLength = 90;\n }\n statDisplay.setCursor(1,1);\n statDisplay.drawLine(1, 55, barLength, 55, 1);\n statDisplay.drawLine(1, 56, barLength, 56, 1);\n statDisplay.drawLine(1, 57, barLength, 57, 1);\n statDisplay.drawLine(1, 58, barLength, 58, 1);\n statDisplay.drawLine(1, 59, barLength, 59, 1);\n statDisplay.drawLine(1, 60, barLength, 60, 1);\n statDisplay.drawLine(1, 61, barLength, 61, 1);\n}", "function updateProgress() {\n $(\"#progressBar\").css(\"width\", _progress + \"%\");\n }", "function setProgressBar(curStep){\n var percent = parseFloat(50 / steps) * curStep;\n percent = percent.toFixed();\n $(\".barrapedido1\")\n .css(\"width\",percent+\"%\")\n .html(percent+\"%\"); \n }", "async function ProgressBar(timer) {\r\n var div = 100 / timer;\r\n percent = 0;\r\n\r\n var counterBack = setInterval(function () {\r\n percent += div;\r\n if (percent <= 100) {\r\n document.getElementById(\"PBar\").style.width = 0 + percent + \"%\";\r\n document.getElementById(\"PBar\").innerHTML = \"Scansione in corso\";\r\n } else {\r\n clearTimeout(counterBack);\r\n document.getElementById(\"PBar\").style.width = 0;\r\n }\r\n\r\n }, 1000);\r\n}", "launchprogressbar() {\n\t\tlet percent = this.progressbar.attr(\"data-percent\"); // récupère le data 100% de l\"élément\n this.progressbar.animate( {\n \twidth: percent // on passe de 0% à 100%\n },this.timeout, \"linear\", () => {\n \tthis.progressbar.css(\"width\", 0); // une fois l'animation complète, on revient à 0\n });\n }", "function setProgressBar(curStep){\n var percent = parseFloat(50 / steps) * curStep;\n percent = percent.toFixed();\n $(\".barrafinal\")\n .css(\"width\",percent+\"%\")\n .html(percent+\"%\"); \n }", "function updateProgressBar() {\n pbValue+=10;\n $('.progress-bar').css('width', pbValue+'%').attr('aria-valuenow', pbValue);\n $('.progress-bar').text(pbValue + \"%\");\n }", "function updateProgressBar(){ \r\n\tdocument.getElementById('progress').style.width = [count+1]/30*100+'%'; \r\n}", "function progress() {\n $(\"#progressbar\").slider('value', Math.floor((100 / audio.duration) * audio.currentTime));\n $(\"#duration\").text(getTime(audio.currentTime) + \" / \" + getTime(audio.duration));\n }", "function updateProgressBar(){\n // Update the value of our progress bar accordingly.\n $('#progress-bar').val((r.getCurrentTime() / r.getDuration()) * 100);\n}", "function $updateProgressBar(percent, complete){\r\n\tconsole.log(\"Recalculating progress bar - \" + percent + \"% initial data returned\");\r\n\tif (percent < 100) {\r\n\t\t\t$(\".meter > span\").each(function() {\r\n\t\t\t$(this).css('width', percent + \"%\");\r\n\t\t\t$(this).removeClass().addClass('orange');\r\n\t\t});\t\t\r\n\t}\t\r\n\tif (complete){\r\n\t\t$(\".meter > span\").each(function() {\r\n\t\t \t$(this).removeClass().addClass('green').css('width', '100%');\r\n\t\t});\t\t\t\r\n\t}\r\n}", "function updateProgress (){\n\tprogress.value += 30;\n}", "_progress() {\n\tconst currentProgress = this.state.current * ( 100 / this.state.questionsCount );\n this.progress.style.width = currentProgress + '%';\n\n\t// update the progressbar's aria-valuenow attribute\n this.progress.setAttribute('aria-valuenow', currentProgress);\n }", "function updateProgressInfo() {\n\tif (!div_progress_info) {\n\t\tdiv_progress_info = document.getElementById('progress_info');\n\t}\n\tif (!div_progress_bar) {\n\t\tdiv_progress_bar = document.getElementById('progress_bar');\n\t}\n\tif (!div_progress_info && !div_progress_bar) {\n\t\treturn;\n\t}\n\n\tvar percentage = Math.floor(100.0*blamedLines/totalLines);\n\n\tif (div_progress_info) {\n\t\tdiv_progress_info.firstChild.data = blamedLines + ' / ' + totalLines +\n\t\t\t' (' + padLeftStr(percentage, 3, '\\u00A0') + '%)';\n\t}\n\n\tif (div_progress_bar) {\n\t\t//div_progress_bar.setAttribute('style', 'width: '+percentage+'%;');\n\t\tdiv_progress_bar.style.width = percentage + '%';\n\t}\n}", "function renderProgress(val, perc, message) {\n\t\tbar.style.width = perc + \"%\";\n\n renderMessage(message);\n\t}", "function addProgress() {\n var progressValue = (100 * parseFloat($('#progressBarOne').css('width')) / parseFloat($('#progressBarOne').parent().css('width'))) + '%';\n var progressValueNum = parseFloat(progressValue);\n if (progressValueNum < 99) {\n var finalValue = (progressValueNum + 16.6);\n $('#progressBarOne').css('width', finalValue + \"%\");\n $(\"#progressBarOne\").text(finalValue.toFixed(0) + \"%\");\n\n }\n else {\n $('#progressBarOne').css('width', \"100%\");\n $(\"#progressBarOne\").text(\"100%\");\n\n }\n\n if (finalValue >= 95) {\n $('#progressBarOne').css('background-color', '#56a773')\n }\n}", "function progress(piece, nbPieces, page, nbPages, doc, nbDocs) {\n var percent = (piece/nbPieces)*100;\n $(\"#progress .progress-bar\").attr('aria-valuenow', percent).attr('style','width:'+percent.toFixed(2)+'%').find(\"span\").html(percent.toFixed(0) + \"%)\");\n $(\"#progressPiece\").html(\"Piece \" + piece + \"/\" + nbPieces);\n $(\"#progressPage\").html((page && nbPages) ? \"Page \" + page + \"/\" + nbPages : \"\");\n $(\"#progressDoc\").html((doc && nbDocs) ? \"Document \" + doc + \"/\" + nbDocs : \"\");\n}", "updateProgressBar() {\n let revealRange = 103 - 24; //See css comment (progressBox). \n let revealPercent = this.points / this.pointsNeeded; //Current percent of points needed.\n this.baseProgressMargin = -24; //Margin value: Progress box hides bar.\n this.progressMargin = this.baseProgressMargin - revealPercent * revealRange; //New margin value\n document.getElementById(\"progress\").style.marginTop = this.progressMargin + \"vh\"; //Reveal percent of glowing border as level progress indicator.\n }", "function updateProgress() {\n\t var percentage = (progressBar.hideEta - new Date().getTime()) / progressBar.maxHideTime * 100;\n\t progressElement.style.width = percentage + '%';\n\t }", "function photoProgressBar(progress, length) {\n\n var elem = document.getElementById(\"photo_progress\");\n var speed = 20 * length; // integer determines speed of progress bar draw\n var id = setInterval(frame, speed);\n\n function frame() {\n\n if (width >= progress) {\n clearInterval(id);\n } else {\n width++;\n elem.style.width = width + '%';\n elem.innerHTML = width * 1 + '%';\n if (width === 100) { \n uploadStatus(length); // message once all photos uploaded\n }\n }\n }\n }", "function progress(newWidth){\n\t$(\"#PBar\").css({width: newWidth + \"%\"});\n\t$(\"#PBar\").val(newWidth + \"%\");\n}", "function progressBar(){\n //window.pageYOffset -> amount scrolled\n //document.body.scrollHeight -> total page height\n //window.innerHeigh -> window height\n document.getElementById('progress-bar').style.width = Math.min((101 * window.pageYOffset / (document.body.scrollHeight - window.innerHeight)), 100) + '%';\n}", "function slideProgress() {\n let perc = (video.currentTime/video.duration)*100;\n progressbar.style.width = perc.toString()+'%';\n }", "function progressbar(){\n\tvar time = $(\"#wholetime\").text();\n\tvar seconds = timetoSeconds(time);\n\n\tvar startPSeconds = Number($(\"#P_set\").text())*60;\n\tvar startBSeconds = Number($(\"#B_set\").text())*60;\n\n\tif(current_timer === \"pomodoro\"){\n\t\tvar progress = (1-(seconds / startPSeconds).toFixed(4)); //保留4位\n\t\t$('#progress1').attr('class',\"P_progress\"); //change the background color to pomodoro style\n\t}\n\telse if(current_timer === \"break\"){\n\t\tvar progress = (1-(seconds / startBSeconds).toFixed(4)); //保留4位\n\t\t$('#progress1').attr('class',\"B_progress\"); //change the background color to break style\n\t}\n\tvar progressbar1 = {'width': progress*100+\"%\" };\n\t$('#progress1').animate(progressbar1,1000);\n}", "function onUploadProgress(e) {\r\n\tif (e.lengthComputable) {\r\n\t\tvar percentComplete = parseInt((e.loaded + totalUploaded) * 100 / totalFileLength);\r\n\t\tvar bar = document.getElementById('bar');\r\n\t\tbar.style.width = percentComplete + '%';\r\n\t\tbar.innerHTML = percentComplete + ' % complete';\r\n\t\tconsole.log(\" bar prog \" + percentComplete)\r\n\r\n\t\tpercentage = percentComplete;\r\n\r\n\t\tconsole.log(\" percentage prog \" + percentage)\r\n\t} else {\r\n\t\tdebug('unable to compute');\r\n\t}\r\n}", "function updateProgress ( current, total ){\n $(\".progress .currentProgress\").css('width', ((current - 1) / total) * 100 +'%');\n $(\".progress .progresstext\").html('Frage '+ current + ' von ' + (total))\n }", "function init_progressBar(duration) {\n $('.progress').each(function() {\n var value = $(this).find('.progress__bar').attr('data-level');\n var result = value + '%';\n if(duration) {\n $(this).find('.progress__current').animate({width : value + '%'}, duration);\n }\n else {\n $(this).find('.progress__current').css({'width' : value + '%'});\n }\n \n });\n }", "function updateProgress(percentage) {\n document.getElementById(\"pbar_innerdiv\").style.width = percentage + \"%\";\n}", "function progressBarCarousel() {\n $bar.css({width:percent+'%'});\n percent = percent +0.5;\n if (percent>=100) {\n percent=0;\n $crsl.carousel('next');\n }\n }", "_setProgress(v) {\n\t\tconst w = PROGRESSBAR_WIDTH * v;\n\t\tthis._fg.tilePositionX = w;\n\t\tthis._fg.width = PROGRESSBAR_WIDTH- w;\n\t}", "function progressBars() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar $progressBarsOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : 'bottom-in-view';\r\n\t\t\t\t\t$($fullscreenSelector + '.nectar-progress-bar').parent().each(function () {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar $that = $(this),\r\n\t\t\t\t\t\twaypoint \t= new Waypoint({\r\n\t\t\t\t\t\t\telement: $that,\r\n\t\t\t\t\t\t\thandler: function () {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif ($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('completed')) {\r\n\t\t\t\t\t\t\t\t\twaypoint.destroy();\r\n\t\t\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif ($progressBarsOffsetPos == '100%') {\r\n\t\t\t\t\t\t\t\t\t$that.find('.nectar-progress-bar .bar-wrap').css('opacity', '1');\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$that.find('.nectar-progress-bar').each(function (i) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tvar percent = $(this).find('span').attr('data-width'),\r\n\t\t\t\t\t\t\t\t\t$endNum \t\t= parseInt($(this).find('span strong i').text()),\r\n\t\t\t\t\t\t\t\t\t$that \t\t\t= $(this);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$that.find('span').delay(i * 90).transition({\r\n\t\t\t\t\t\t\t\t\t\t'width': percent + '%'\r\n\t\t\t\t\t\t\t\t\t}, 1050, 'easeInOutQuint', function () {});\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\tvar countOptions = {\r\n\t\t\t\t\t\t\t\t\t\t\tuseEasing: false\r\n\t\t\t\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\t\t\t\tvar $countEle = $that.find('span strong i')[0];\r\n\t\t\t\t\t\t\t\t\t\tvar numAnim = new CountUp($countEle, 0, $endNum, 0, 1, countOptions);\r\n\t\t\t\t\t\t\t\t\t\tnumAnim.start();\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t$that.find('span strong').transition({\r\n\t\t\t\t\t\t\t\t\t\t\t'opacity': 1\r\n\t\t\t\t\t\t\t\t\t\t}, 550, 'easeInCirc');\r\n\t\t\t\t\t\t\t\t\t}, (i * 90));\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t////100% progress bar \r\n\t\t\t\t\t\t\t\t\tif (percent == '100') {\r\n\t\t\t\t\t\t\t\t\t\t$that.find('span strong').addClass('full');\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$that.addClass('completed');\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\twaypoint.destroy();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\toffset: $progressBarsOffsetPos\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t});\r\n\t\t\t\t}", "function updateProgress(percentage){\n\tvar elem = document.getElementById('progress-bar');\n\tvar width = 1;\n\t\n\twidth = percentage;\n\tif(width > 1) width = 1;\n\telem.style.width = percentage*100 + '%';\n\n\t\n}", "function progressBar(progress) {\r\n ctx.save(); // save the unclipped state\r\n\r\n ctx.beginPath(); // create the clip path\r\n ctx.rect(0,0, width * progress, height);\r\n ctx.clip();\r\n\r\n ctx.fillStyle = progressColor(startColor, endColor, progress);\r\n\r\n ctx.beginPath(); // draw all bars as one\r\n var x = 0;\r\n while (x < width * progress) {\r\n ctx.rect(x, 0, barWidth, height);\r\n x += barSpacing;\r\n }\r\n ctx.fill(); // draw that bars\r\n\r\n ctx.restore(); // restore unclipped state\r\n}", "function progressUpdate() {\r\n loadingProgress = Math.round(progressTl.progress() * 100);\r\n $(\".txt-perc\").text(loadingProgress + '%');\r\n}", "function updateProgressBar(){\n // Update the value of our progress bar accordingly.\n $('#progress-bar').val((player.getCurrentTime() / player.getDuration()) * 100);\n }", "function setProgress(currstep) {\n var percent = parseFloat(100 / widget.length) * currstep;\n percent = percent.toFixed();\n $(\".progress-bar\").css(\"width\", percent + \"%\").html(percent + \"%\");\n }", "function updateProgress (evt) {\n\n if (evt.lengthComputable) {\n var percentComplete = Math.floor((evt.loaded / evt.total) * 100),\n percentIntegrated = (percentComplete / 100) * options.width;\n\n // Display progress status\n if(options.progress != false) {\n $(options.progress).text(percentComplete); \n }\n\n // Convert 'percentComplete' to preloader element's width\n $(options.gazer).stop(true).animate({\n width: percentIntegrated\n }, function() {\n options.done.call();\n });\n\n } else {\n // when good men do nothing \n }\n }", "function calcProgressBar() {\n $('.progress-bar .progress').css('width', `${((officialQuestionCount)/questionTotal)*100}%`)\n\n $({value: ((officialQuestionCount-1)/questionTotal)*100}).animate({value: ((officialQuestionCount)/questionTotal)*100}, {\n duration: 500,\n easing:'swing',\n step: function() {\n $('.progress-bar .progress .value').text(`${Math.round(this.value)}%`);\n }\n });\n}", "function updateProgressBar() {\n let progressBar = document.getElementById(\"progress\");\n let percent = bodyArray.length * 2;\n let percentFullDisplay = document.getElementById(\"percent-full-value-display\");\n progressBar.style.width = percent + \"%\";\n percentFullDisplay.innerText = percent + \"%\";\n\n }", "static finish() {\n this.progress = 100;\n setTimeout(() => {\n this.bar.style.width = `${this.progress}%`;\n }, 100);\n setTimeout(() => {\n this.parent.style.height = '0px';\n }, 1000);\n }", "function updateProgress() {\n var progress = 0,\n currentValue = $scope.curVal,\n maxValue = $scope.maxVal,\n // recompute overall progress bar width inside the handler to adapt to viewport changes\n progressBarWidth = progressBarBkgdElement.prop('clientWidth');\n\n if ($scope.maxVal) {\n // determine the current progress marker's width in pixels\n progress = Math.min(currentValue, maxValue) / maxValue * progressBarWidth;\n }\n\n // set the marker's width\n progressBarMarkerElement.css('width', progress + 'px');\n }", "function setProgress(percent) {\n $('#progressBar .progress-bar').css({width: percent + '%'});\n $('#percent').text(percent + '%');\n}", "function setProgressBar(curStep){\n var percent = parseFloat(100 / steps) * curStep;\n percent = percent.toFixed();\n $(\".progress-bar-1\")\n .css(\"width\",percent+\"%\")\n .html(percent+\"%\"); \n }", "function bar (prog) {\n var r = prog.progress/prog.total\n var s = '\\r', M = 50\n for(var i = 0; i < M; i++)\n s += i < M*r ? '*' : '.'\n\n return s + ' '+prog.progress+'/'+prog.total+' '//+':'+prog.feeds\n}", "function updateProgress() {\n \"use strict\";\n //Gestion progress bar\n $('#quiz-progress').css('width', function () {\n var current = $('#question-number').text(), total = $('#question-total').val();\n return ((current / total) * 100).toString() + \"%\";\n });\n}", "function PopulatePercentage(value) {\n loadProgressBar(value);\n}", "function thememascot_progress_bar() {\n $('.progress-bar').appear();\n $(document.body).on('appear', '.progress-bar', function() {\n $('.progress-bar').each(function() {\n if (!$(this).hasClass('appeared')) {\n var percent = $(this).data('percent');\n var barcolor = $(this).data('barcolor');\n $(this).append('<span class=\"percent\">' + percent + '%' + '</span>');\n $(this).css('background-color', barcolor);\n $(this).css('width', percent + '%');\n $(this).addClass('appeared');\n }\n });\n });\n $('.progress-bar-aa').each(function() {\n if (!$(this).hasClass('appeared')) {\n var percent = $(this).data('percent');\n var barcolor = $(this).data('barcolor');\n $(this).append('<span class=\"percent\">' + percent + '%' + '</span>');\n $(this).css('background-color', barcolor);\n $(this).css('width', percent + '%');\n $(this).addClass('appeared');\n }\n });\n\n }", "function usar_update_progress_bar( percentage, speed ) {\n\t\tif ( typeof speed == 'undefined' ) {\n\t\t\tspeed = 150;\n\t\t}\n\t\t$( '.usar-progress' ).animate({\n\t\t\twidth: percentage\n\t\t}, speed );\n\t}", "function progressBar(progressBefore, scoreAfter) {\n\tprogressBarPoint = Math.floor((scoreAfter / fullPoints * 100) % 100);\n\tif (progressBarPoint < progressBefore) {\n\t\t$(\"#progress-bar-yellow\").animate({ width: '100%'});\n\t\t// Change stars from gray to yellow\n\t\tfor (let i=0; i < ($(\".stars-achievement\").length); i++) {\n\t\t\t$(\"#progress-bar-stars img:first\").remove();\n\t\t\t$(\"#progress-bar-stars\").append('<img src=\"assets/images/star.png\">');\n\t\t\t$(\"#progress-bar-stars img\").addClass(\"stars-achievement\");\n\t\t}\t\n\t} else {\n\t\tincrementWidth = Math.floor(progressBarPoint - progressBefore);\n\t\t$(\"#progress-bar-yellow\").animate({ width: '+=(incrementWidth)'});\n\t}\n}", "function move(e) {\n \n var mainDiv = getClosest(e.target, \"div\");//get the outer div (ie the div with class of col-)\n var h = mainDiv.querySelector('h3');//get the title \n var myProgress = mainDiv.querySelector('.myProgress');//get the div containing the progress bar\n if (myProgress.currentStyle) {//get the display property of myProgress\n var displayStyle = myProgress.currentStyle.display;\n } else if (window.getComputedStyle) {\n var displayStyle = window.getComputedStyle(myProgress, null).getPropertyValue(\"display\");\n }\n if(displayStyle == 'none'){//if myProgress is hidden, display it and start filling the progress bar\n myProgress.style.display=\"block\";\n var myBar = myProgress.querySelector('.myBar');//get the bar filler \n var label = myProgress.querySelector('.label');//get the label\n var value = label.getAttribute(\"data-value\");//get the value to wich the scrollbar should be filled\n var width = 10;\n function frame() {//function that allows to achieve animated progression of the bar filling\n if (width >= value) {\n //bar is completed so stop the animation \n clearInterval(id);\n } else {\n width++; \n myBar.style.width = width + '%'; \n label.innerHTML = width + '%';\n }\n }\n var id = setInterval(frame, 10);//interval at wich the frame function is called (10).\n \n }\n else {//the progress bar is already displayed so hide it\n myProgress.style.display=\"none\";\n }\n \n}", "function progressBarCarousel() {\n\t\t$bar.css({width:percent+'%'});\n\t\tpercent = percent +0.5;\n\t\tif (percent>=100) {\n\t\t\tpercent=0;\n\t\t\t$crsl.carousel('next');\n\t\t}\n\t}", "function progressBarCarousel() {\n\t\t$bar.css({width:percent+'%'});\n\t\tpercent = percent +0.5;\n\t\tif (percent>=100) {\n\t\t\tpercent=0;\n\t\t\t$crsl.carousel('next');\n\t\t}\n\t}", "function update_progress() {\n let tot = open + closed;\n\n $(\"#progress_open\").css(\"width\", (open * 100 / tot) + \"%\");\n $(\"#progress_close\").css(\"width\", (closed * 100 / tot) + \"%\");\n}", "updateProgressBar(percentage) {\n let $progressBar = document.getElementById(\"progress-bar\");\n this.progressBarObj.value = Math.min(\n 100,\n this.progressBarObj.value + percentage\n );\n $progressBar.style.width = this.progressBarObj.value + \"%\";\n $progressBar.valuenow = this.progressBarObj.value;\n $progressBar.innerText = this.progressBarObj.value + \"%\";\n }", "animateProgressBar() {\n const\n cardLen = this.props.cards.length, // get cardsLength\n current = this.state.current, // get current\n calcPer = (lg, sm) => lg && sm ? (sm / lg) * 100 : 0, // create func that return precentage\n currPer = calcPer(cardLen, current), // current percentage\n nextPer = calcPer(cardLen, current + 1), // percentage of the next step\n progres = document.getElementById(\"run-test__progress\"), // the progress bar element\n oneStep = (nextPer - currPer) / 10; // the amount progress bar goes in one step (10 step anim)\n\n let counter = 0,\n currWidth = currPer;\n\n // create a timer for progressbar width grow\n const progressTimer = setInterval(() => {\n currWidth += oneStep; // increase width by 1 unit\n\n progres.style.width = currWidth + \"%\"; // set width\n\n if (++counter === 9) clearInterval(progressTimer); // increment and clear \n }, 150); // end of progressTimer\n }", "function updateProgressbarDisplay() {\n if (progressBarProgressionElement) {\n updateStep(progressBarProgressionElement)\n updateCounter()\n }\n }", "function setProgressBar(curStep){\n var percent = parseFloat(100 / steps) * curStep;\n percent = percent.toFixed();\n $(\".progress-bar\")\n .css(\"width\",percent+\"%\")\n .html(percent+\"%\");\n }", "function progressbar(){\n\tvar c = $(\"[data-progressbar2]\");\n\tvar val = $(\"[data-progressbar2-val]\");\n\tvar qny = $(\"[data-progressbar2-qny]\");\n\tvar qny2 = $(\"[data-progressbar2-qny-2]\");\n\tvar i = 0;\n\tvar dpe;\n\tvar pr = 0.05;\n\tvar wth;\n\tvar e = $(\"[data-progressbar2-e]\");\n\tvar e_w = e.outerWidth();\n\tvar a = $(\"[data-progressbar2-img-2]\");\n\tvar a_w = a.outerWidth();\n\tqny.html(qny.attr(\"data-progressbar2-qny\"));\n\twhile(val.length > i){\n\t\t\n\t\tif($(val.get(i+1)).length){\n\t\t\t\n\t\t\tif($(val.get(i)).data(\"progressbar2-val\") <= qny.data(\"progressbar2-qny\")\n\t\t\t\t&&\n\t\t\t\t$(val.get(i+1)).data(\"progressbar2-val\") > qny.data(\"progressbar2-qny\"))\n\t\t\t{\n\t\t\t\tvar qny2_n = $(val.get(i+1)).data(\"progressbar2-val\")-qny.attr(\"data-progressbar2-qny\");\n\t\t\t\tqny2.attr(\"data-progressbar2-qny-2\",qny2_n);\n\t\t\t\tqny2.html(qny2_n);\n\t\t\t\t$(val.get(i)).closest(\"[data-progressbar2-e]\").find(\".progressbar2\").addClass(\"act\");\n\t\t\t\t$(\".progressbar2.act\").closest(\"[data-progressbar2-e]\").prevAll(\"[data-progressbar2-e]\").find(\".progressbar2\").addClass(\"fill\");\n\t\t\t\tdpe = $(val.get(i+1)).data(\"progressbar2-val\") - $(val.get(i)).data(\"progressbar2-val\");\n\t\t\t\twth = ((qny.data(\"progressbar2-qny\")-$(val.get(i)).data(\"progressbar2-val\"))/dpe)*(e_w-a_w);\n\t\t\t\tif(wth === 0){\n\t\t\t\t\twth = 0.1;\n\t\t\t\t}\n\t\t\t\t$(val.get(i)).closest(\"[data-progressbar2-e]\").prevAll(\".progressbar2\").removeClass(\"act\");\n\t\t\t\t$(val.get(i)).closest(\"[data-progressbar2-e]\").find(\"[data-progressbar2-td-1]\").css(\"width\",wth+\"px\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t$(val.get(i)).closest(\"[data-progressbar2-e]\").find(\".progressbar2\").addClass(\"act\");\n\t\t\t$(\".progressbar2.act\").closest(\"[data-progressbar2-e]\").prevAll(\"[data-progressbar2-e]\").find(\".progressbar2\").addClass(\"fill\");\n\t\t\twth = e_w-a_w;\n\t\t\t$(val.get(i)).closest(\"[data-progressbar2-e]\").find(\"[data-progressbar2-td-1]\").css(\"width\",wth+\"px\");\n\t\t}\n\t\ti++;\n\t}\n}", "function updateProgressBar(){\n progressBarTimer += 5; // percentage\n \n var progressString = String(progressBarTimer) + \"%\";\n $(\"#progressBar\").css( \"width\", progressString);\n if (progressBarTimer === 100) {\n //stop timer\n clearInterval( localInterval);\n $(\"#progressBar\").css( \"width\", \"0%\");\n }\n}", "function Progress(el){\n $(el).circleProgress({fill: {color:'navy'},animation:{duration:10000, easing:'circleProgressEasing'},animationStartValue: 1.0,reverse:true})\n }", "progressHandler(file, progress) {\n const filename = file.name\n const percentage = parseFloat(progress.bytesUploaded / progress.bytesTotal * 100).toFixed(2)\n const sizeUploaded = (progress.bytesUploaded / 1024 / 1024).toFixed(3)\n const sizeTotal = (progress.bytesUploaded / 1024 / 1024).toFixed(3)\n\n const bar = document.createElement('div')\n bar.innerHTML = \"~=\".repeat(200)\n bar.style.cssText = `position: absolute; left: 0; bottom: 0; width: ${percentage}%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`\n\n if (parseInt(percentage) == 100) {\n this.infoTarget.innerHTML = `Upload finished<br>${file.id}`\n } else {\n this.infoTarget.innerHTML = `${sizeUploaded}&thinsp;/&thinsp;${sizeTotal} MB, ${percentage}%<br>uploading ${file.id}`\n this.infoTarget.appendChild(bar)\n }\n }", "function DrawProgressBar(sProgress, sTitle)\n{\n\trite('<!-- ========================= PROGRESS BAR =========================== -->');\n rite('<center>');\n rite('<span class=\"ProgressTitle\"> ' + sTitle + ' </span>');\n rite('<table cellpadding=0 cellspacing=0 class=\"ProgressTable\">');\n rite('<tr>');\n\t\n\tif (sProgress == \"0% \")\n\t\t{rite(' <td width=\"5%\">');}\n\telse if (sProgress == \"100\")\n\t\t{rite(' <td width=\"100%\">');}\n\telse // (sProgress between 0% and 100%)\n\t\t{rite(' <td width=\"' + sProgress + '\">');}\n \n rite(' <table cellpadding=0 cellspacing=0 border=0 width=\"100%\">');\n rite(' <tr>');\n\t\n\tif (sProgress == \"0% \")\n\t\t{rite(' <td class=\"ProgressBarZero\"><center> 0% ');}\n\telse if (sProgress == \"100\")\n\t\t{rite(' <td class=\"ProgressBar\"><center> 100% ');}\n\telse // (sProgress between 0% and 100%)\n\t\t{rite(' <td class=\"ProgressBar\"><center>' + sProgress);}\n \n rite(' </center></td>');\n rite(' </tr>');\n rite(' </table>');\n rite(' </td>');\n if (sProgress==\"100\")\n\t\trite(' <td>');\n\telse\n\t\trite(' <td> &nbsp; ');\n rite(' </td>');\n rite('</tr>');\n rite('</table>');\n rite('</center>');\n rite('<br>');\n} // drawprogressbar", "function updateProgressBar(progress) {\n\n if (!progress) {\n progress = 0;\n }\n\n // get progress bar\n var progress_div = document.getElementById(\"training-progress\");\n\n if (!progress_div) {\n console.warn(\"Missing progress-bar element!\");\n return;\n }\n\n // update progress bar status\n var progress_str = String(progress) + \"%\";\n progress_div.style.width = progress_str;\n //progress_div.setAttribute(\"aria-valuenow\", String(progress));\n progress_div.innerHTML = progress_str;\n\n if (progress >= 100) {\n progress_div.classList.add(\"progress-bar-success\");\n progress_div.classList.add(\"progress-bar-striped\");\n }\n else {\n progress_div.setAttribute(\"class\", \"progress-bar\");\n }\n}", "updateProgress() {\n this._Onprogress(this.state.CSVProgress * 100);\n }", "function progressBarCarousel() {\n bar.css({ width: percent + \"%\" });\n percent = percent + 0.5;\n if (percent >= 100) {\n percent = 0;\n crsl.carousel(\"next\");\n }\n }", "function handleProgress(e){\n if(e.lengthComputable){\n var percent = e.loaded / e.total * 100;\n $('.progress-bar').attr({value:e.loaded,max:e.total});\n $('.progress-bar').css('width', percent + '%');\n }\n }", "function progress(percent, element) { // load progress-bar\n var progressBarWidth = percent * element.width() / 100;\n\n element.find('.loading').animate({ width: progressBarWidth }, 500);\n element.find('.interest').html(percent + \"%\");\n\n}", "function progressBar(current, max, legend, title) {\n var bar, barLegend, body, step;\n if (current == 0) {\n $('.user-interface').show();\n // Add the progress bar\n bar = $('<div class=\"progress-bar\"></div>');\n barLegend = $('<div class=\"bar-legend\">' + legend + '</div>');\n body = $('.interface-body');\n body.empty();\n if (title == undefined) {\n body.append('<div class=\"bar-title\">Executing...</div>').append(bar).append(barLegend);\n } else {\n body.append('<div class=\"bar-title\">' + title + '</div>').append(bar).append(barLegend);\n }\n } else {\n bar = $('.progress-bar');\n barLegend = $('.bar-legend');\n }\n while (current >= bar.children().length) {\n step = $('<div class=\"progress-step\"></div>').width(bar.width() / max);\n bar.append(step);\n barLegend.html(legend);\n }\n}", "function progress(percent, $element) {\n\t var progressBarWidth = percent * $element.width() / 100;\n\t $element.find('div').animate({ width: progressBarWidth }, 1000).html(percent + \"% \");\n\t}", "showProgressBar() {\n // Get the progress bar filler texture dimensions.\n const {\n width: w,\n height: h\n } = this.textures.get('progress-bar').get();\n\n // Place the filler over the progress bar of the splash screen.\n const img = this.add.sprite(100, 350, 'progress-bar').setOrigin(0).setScale(0.9);\n\n // Crop the filler along its width, proportional to the amount of files\n // loaded.\n this.load.on('progress', v => img.setCrop(0, 0, Math.ceil(v * w), h));\n }", "function showProgress() {\n var bar = document.getElementById(\"bar\");\n var width = parseInt(bar.style.width = (6 + (totalClicks / 15 * 100)) + '%');\n bar.innerText = '';\n var percent = document.createElement('p');\n if (totalClicks == 15) {\n bar.style.width = '0%';\n var progress = document.getElementById(\"progress\");\n progress.style.width = '0%';\n } else {\n percent.innerText = width + '%';\n bar.appendChild(percent);\n }\n}", "function _getProgress(){// Steps are 0 indexed\nvar currentStep=parseInt(this._currentStep+1,10);return currentStep/this._introItems.length*100;}", "function _updateProgressBar(oldReferenceLayer){oldReferenceLayer.querySelector(\".introjs-progress .introjs-progressbar\").style.cssText=\"width:\".concat(_getProgress.call(this),\"%;\");oldReferenceLayer.querySelector(\".introjs-progress .introjs-progressbar\").setAttribute(\"aria-valuenow\",_getProgress.call(this));}", "function progress(percent, element) {\n var progressBarWidth = percent * element.width() / 100;\n $(element).find('div').animate({\n width: progressBarWidth\n }, 500);\n }", "function autoProgress() {\n\tvar elem = document.getElementById(\"progressbar\");\n\tvar width = 0;\n\tvar id = setInterval(frame, 100);\n\tfunction frame(){\n\t\tif(width == 100){\n\t\t\tclearInterval(id);\n\t\t}else{\n\t\t\twidth++;\n\t\t\telem.style.width = width + '%';\n\t\t\telem.innerHTML = width * 1 + '%';\n\t\t}\n\t}\n}", "function metaProgress() {\n\t$('#metabar').css(\"width\", function() {\n\t\treturn $(this).attr(\"aria-valuenow\") + \"%\";\n\t});\n}", "totaluploadprogress () {\n }", "function $animateProgressBar(){\r\n\t$(\".meter > span\").each(function() {\r\n\t $(this)\r\n\t .data(\"origWidth\", $(this).width())\r\n\t .width(0)\r\n\t .animate({\r\n\t width: $(this).data(\"origWidth\") // or + \"%\" if fluid\r\n\t }, 1200);\r\n\t});\t\r\n}", "function changeProgressBar(qCount) {\n\n progress.innerHTML = \"Question \" + (qCount+1) + \" of 10\";\n tracker = id(\"num\" + (qCount+1));\n tracker.style.backgroundColor = \"orange\";\n\n}" ]
[ "0.77998906", "0.7763853", "0.77528125", "0.77528125", "0.77528125", "0.77528125", "0.77430546", "0.77279574", "0.7724621", "0.77222145", "0.77161944", "0.76999706", "0.7697292", "0.762673", "0.76198626", "0.76121026", "0.75798887", "0.756265", "0.7535744", "0.7533914", "0.7531309", "0.7522222", "0.7521538", "0.75138164", "0.74875003", "0.74841726", "0.7435919", "0.7428031", "0.741501", "0.7410843", "0.73978925", "0.7380066", "0.73635346", "0.7356552", "0.7341381", "0.7333275", "0.73239917", "0.7318399", "0.7314264", "0.7311657", "0.7309697", "0.73075503", "0.7284248", "0.7278989", "0.72769576", "0.72765785", "0.727542", "0.72682047", "0.72666526", "0.7262198", "0.72589594", "0.7258411", "0.72528654", "0.72483844", "0.72474015", "0.72421414", "0.7239213", "0.7239194", "0.7238807", "0.7223367", "0.72218347", "0.71932954", "0.71929", "0.718846", "0.71813154", "0.7175635", "0.7175109", "0.71728927", "0.71600837", "0.7141704", "0.7128211", "0.7127514", "0.7125459", "0.7125459", "0.71244895", "0.71225345", "0.7110421", "0.71093005", "0.70959544", "0.70951813", "0.7093862", "0.7092964", "0.7087892", "0.70846236", "0.70786", "0.70762306", "0.70726395", "0.7071689", "0.70598847", "0.70576334", "0.7055262", "0.7054436", "0.7048045", "0.7036067", "0.70356077", "0.70345134", "0.70341694", "0.7031261", "0.7007534", "0.700745", "0.7001674" ]
0.0
-1
import private key with type = P2PKH or P2SH, default P2PKH
static importPrivateWallet(options) { if (!options.privateKey) { throw new Error(`Invalid privateKey=${options.privateKey}`); } return new PrivateWallet(options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor (p2pKey: P2PSigningPrivateKey) { // eslint-disable-line no-undef\n this._key = p2pKey\n this.publicKey = new PublicSigningKey(p2pKey.public)\n }", "static import(publicKey, privateKey) {\n return Promise.resolve().then(() => {\n if (!(publicKey instanceof ArrayBuffer) && !(publicKey instanceof Uint8Array))\n throw new Error('The publicKey is expected to be an ArrayBuffer.');\n\n if (publicKey.byteLength != PUBLIC_KEY_BYTES)\n throw new Error('The publicKey is expected to be ' + PUBLIC_KEY_BYTES + ' bytes.');\n\n const publicBuffer = new Uint8Array(publicKey);\n if (publicBuffer[0] != 0x04)\n throw new Error('The publicKey is expected to start with an 0x04 byte.');\n\n let jwk = {\n kty: 'EC',\n crv: 'P-256',\n x: uint8ArrayToBase64Url(publicBuffer, 1, 33),\n y: uint8ArrayToBase64Url(publicBuffer, 33, 65),\n ext: true\n };\n\n let privatePromise = Promise.resolve(null);\n let publicPromise = crypto.subtle.importKey('jwk', jwk, { name: 'ECDH', namedCurve: 'P-256' },\n true /* extractable */, []);\n\n if (privateKey) {\n if (!(privateKey instanceof ArrayBuffer) && !(privateKey instanceof Uint8Array))\n throw new Error('The privateKey is expected to be an ArrayBuffer.');\n\n if (privateKey.byteLength != PRIVATE_KEY_BYTES) {\n throw new Error('The privateKey is expected to be ' + PRIVATE_KEY_BYTES +' bytes.');\n }\n\n jwk.d = uint8ArrayToBase64Url(new Uint8Array(privateKey));\n\n privatePromise = crypto.subtle.importKey('jwk', jwk, { name: 'ECDH', namedCurve: 'P-256' },\n true /* extractable */, ['deriveBits']);\n }\n\n return Promise.all([ publicPromise, privatePromise ]);\n\n }).then(([publicKey, privateKey]) => new KeyPair(publicKey, privateKey));\n }", "constructor (p2pKey: P2PSigningPublicKey) { // eslint-disable-line no-undef\n this._key = p2pKey\n }", "constructor(k,p){\n this.privatekey = k;\n this.publickey = p;\n}", "constructor(publickey,privatekey){\n this.publickey = p\n this.privatekey = k\n\n}", "generatePrivateKey() {\n var key = Buffer.alloc(95)\n require('libp2p-pnet').generate(key)\n this.node.logger.silly(`Generate private key: ${key}`)\n return key\n }", "function usePrivateKey(pem) {\n createLinkToDownloadPrivateKey(pem);\n pemToPrivateKey(pem).then((privateKey) => {\n myPrivateKey = privateKey;\n });\n}", "function get_key_pair()\n{\n\tvar privKey = chance.string(\n {\n length: 64,\n pool: '0123456789abcdef'\n });\n var pubKey = lib.straight_hex(lib.curve25519_to8bitString(lib.curve25519(lib.curve25519_from8bitString(h2s(privKey)), lib.curve25519_nine())));\n\tvar key_pair = {\n\t\tprivateKey: privKey,\n\t\tpublicKey: pubKey,\n\t};\n\treturn key_pair;\n}", "constructor(pri,pub){\n this.privatekey=pri;\n this.publickey=pub;\n}", "function keyFromPrivate(indutnyCurve, priv) {\n const keyPair = indutnyCurve.keyPair({ priv: priv });\n return keyPair;\n}", "getKeyPair () {\n // Generate new random private key\n const master = bcoin.hd.generate();\n const key = master.derivePath('m/44/0/0/0/0');\n const privateKey = key.privateKey;\n\n // Derive public key from private key\n const keyring = bcoin.KeyRing.fromPrivate(privateKey);\n const publicKey = keyring.publicKey;\n\n return {\n publicKey: publicKey,\n privateKey: privateKey\n };\n }", "function generateKeyPair() {\n window.crypto.subtle.generateKey(\n {\n name: \"RSA-OAEP\",\n modulusLength: 2048,\n publicExponent: new Uint8Array([1, 0, 1]),\n hash: \"SHA-256\",\n },\n true,\n [\"encrypt\", \"decrypt\"]\n ).then(async (keyPair) => {\n const privateKeyPem = await exportPrivateKey(keyPair.privateKey);\n savePrivateKeyToLocalStorage(privateKeyPem);\n usePrivateKey(privateKeyPem);\n const publicKeyPem = await exportPublicKey(keyPair.publicKey);\n savePublicKeyToLocalStorage(publicKeyPem);\n usePublicKey(publicKeyPem);\n });\n}", "generatePrivatePublicKeys () {\n const key = new NodeRSA().generateKeyPair(2048, 65537)\n const privateKey = key.exportKey('pkcs1-private')\n const publicKey = key.exportKey('pkcs1-public')\n\n return { private: privateKey, public: publicKey }\n }", "function rsaPrivatePublicKey(){\r\n var crypt = new JSEncrypt({ default_key_size: 1024 });\r\n return crypt.getKey();\r\n}", "fromPrivateKey() {\n\n\t\tlet keystoreFromPrivateKey = async (_private, _passwd ) => {\n\t\t\n\t\t\t/*\n\t\t\t\tInitialize private key. Note \"Wallet.default\" for [email protected]^\n\t\t\t*/\n\t\t\tconst privateKeyBuffer = EthUtil.toBuffer(_private);\n\n\t\t\tconst wallet = Wallet.default.fromPrivateKey(privateKeyBuffer);\n\t\t\t\n\t\t\tconst address = wallet.getAddressString();\n\n\t\t\t/*\n\t\t\t\tWe need the async block because of this function\n\t\t\t*/\n\t\t\tconst json = await wallet.toV3String(_passwd)\n\t\t\n\t\t\tfs.writeFile( this.path + address + \".json\" , json, (err) => {\n\t\t\t\tif (err) {\n\t\t\t\t\tthrow err;\n\t\t\t\t}\n\t\t\t\tconsole.log( \"OK: \" + address )\n\t\t\t})\n\t\t}\t\n\n\t\t/*\n\t\t\tCreate a schema for user entry \n\t\t*/\n\t\tvar schema = {\n\t\t\t\n\t\t\tproperties: {\n\t\t\t\n\t\t\t\tprivate : { description: 'PASTE your private key', hidden: true, required: true },\n\n\t\t\t\tpasswd \t: { description: 'ENTER your password', hidden: true, required: true },\n\n\t\t\t\tverify \t: { description: 'RE-ENTER your password', hidden: true, required: true }\n\t\t\t}\n\t\t};\n\n\t\t/*\n\t\t\tStart prompt. The user inputs desired private key, followed by password\n\t\t*/\n\t\tprompt.start();\n\n\t\tprompt.get(schema, function (err, result) {\n\n\t\t\tif (err) { return onErr(err); }\n\n\t\t\t/*\n\t\t\t\tCheck to see if password is correct\n\t\t\t*/\n\t\t\tif ( result.passwd == result.verify ){\n\n\t\t\t\tconsole.log( \"OK: generating keystore\")\n\n\t\t\t\tkeystoreFromPrivateKey( result.private, result.passwd );\n\n\t\t\t\t/*\n\t\t\t\t\tClear private key from clipboard\n\t\t\t\t*/\n\t\t\t\tclipboardy.writeSync(\" \");\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\tconsole.log( \"ERROR: passwords do not match ... exiting.\")\n\t\t\t}\n\n\t\t});\n\n\t\tfunction onErr(err) {\n\t\t\tconsole.log(err);\n\t\t\treturn 1;\n\t\t}\n\t}", "function PrivateKey() {\r\n this.conn = null;\r\n this.createPrivateKeyBox();\r\n}", "function generateKeyPair() {\n return node_forge_1.pki.rsa.generateKeyPair();\n}", "marshalPrivKey () {\n if (this.privKey) {\n return crypto.keys.marshalPrivateKey(this.privKey)\n }\n }", "marshalPrivKey () {\n if (this.privKey) {\n return crypto.keys.marshalPrivateKey(this.privKey)\n }\n }", "marshalPrivKey () {\n if (this.privKey) {\n return crypto.keys.marshalPrivateKey(this.privKey)\n }\n }", "marshalPrivKey () {\n if (this.privKey) {\n return cryptoKeys.marshalPrivateKey(this.privKey)\n }\n }", "function create( label, privateKey ){\n\treturn new KeyPair(label, privateKey);\n}", "function keyPair(p, g) {\n p = p || P_NIST;\n g = g || G_NIST;\n\n var secret = genSecret(p);\n var public = g.powm(secret, p);\n\n return { secretKey: secret, publicKey: public };\n}", "exportPrivateKey() {\n return crypto.subtle.exportKey('jwk', this.privateKey_).then(jwk =>\n base64UrlToUint8Array(jwk.d));\n }", "initializeClientKeys(priv){\n\t\tthis._privateKey = new ECKey(priv, 'pem');\n\t\tthis._publicKey = this._privateKey.asPublicECKey();\n\t}", "function importKey(format, data, algorithm, extractable, usage) {\n return Promise.resolve()\n .then(function(){\n return cryptoSubtle.importKey(format, data, algorithm, extractable, usage);\n })\n .catch(function(e) {\n if (format !== 'spki' && format !== 'pkcs8') {\n throw e;\n }\n var alg = ASN1.webCryptoAlgorithmToJwkAlg(algorithm);\n var keyOps = ASN1.webCryptoUsageToJwkKeyOps(usage);\n var jwkObj = ASN1.rsaDerToJwk(data, alg, keyOps, extractable);\n if (!jwkObj) {\n throw new Error(\"Could not make valid JWK from DER input\");\n }\n var jwk = JSON.stringify(jwkObj);\n return cryptoSubtle.importKey('jwk', utf8$getBytes(jwk), algorithm, extractable, usage)\n });\n }", "function loadClientCertificatePrvKey(certPath, prvkeyPath) {\n\tvar certPEM = cert_util.generateCertPEMFromPath(certPath);\n\t// console.log(certPEM);\n\tvar keyObj = rs.KEYUTIL.getKey(cert_util.generateCertPEMFromPath(prvkeyPath));\n\t// console.log(keyObj);\n\tvar keyPair = { cert: certPEM, prvKey: keyObj.prvKeyHex};\n\treturn keyPair;\n}", "function generateAndSetKeypair() {\n var keys = peerId.create({\n bits: opts.bits\n });\n config.Identity = {\n PeerID: keys.toB58String(),\n PrivKey: keys.privKey.bytes.toString('base64')\n };\n\n writeVersion();\n }", "marshalPrivKey() {\n if (this.privKey) {\n return cryptoKeys.marshalPrivateKey(this.privKey);\n }\n }", "getPrivateKey () {\n return this.privKey\n }", "async readPrivateKey(privateKey) {\n this.wallet = await ethers.Wallet(privateKey);\n this.wallet = this.wallet.connect(this.provider);\n }", "function getKey( token ){ \n \tif( token instanceof KeyPair ){\n\t\treturn new Promise( \n\t\t\tfunction( resolve, reject ){ resolve( token ); } );\n \t}\n \ttry{\n \t\tvar keyPair = new KeyPair( undefined, token );\n\t\treturn new Promise( \n\t\t\tfunction( resolve, reject ){ resolve( keyPair ); } );\n \t}\n \tcatch(err){\n\t\treturn sha256( token )\n\t\t\t.catch( function(err){ \n\t\t\t\tif( err.code && err.code == new Err.FileSystemError().code ) throw new Err.ArgumentError(\"argument '\"+token+\"' is not a private key, readable file or wif\", token); \n\t\t\t\telse throw err;\n\t\t\t});\n \t}\n}", "function serializePrivateKey(priv){\n return sjcl.codec.base64.fromBits(priv.get());\n}", "function importPublicKey(key){\n return new Promise(function (resolve, rej) {\n crypto.importKey(\"raw\", converterWrapper.base64StringToArrayBuffer(key),\n {\n name: \"AES-CBC\"\n },\n false, //whether the key is extractable (i.e. can be used in exportKey)\n [\"encrypt\", \"decrypt\"] //can be \"encrypt\", \"decrypt\", \"wrapKey\", or \"unwrapKey\"\n ).then(function (cryptKey) {\n resolve(cryptKey);\n });\n });\n }", "function getPriKeyObjectFromLocalStorage() {\n var userMeta = loadLocalStore('userMeta');\n var pri_key = userMeta.pri_key;\n // creates an openpgp private key object from the private key text\n var pri_key_object = convertPGPPKeyTextToKeyObject(pri_key);\n pri_key_object.decrypt(PARSELTONGUE_DEFAULT_PASSWORD);\n return pri_key_object;\n}", "function generateKey(passphrase, appWiseSalt) {\n const passphraseKey = encoder.encode(passphrase);\n const salt = encoder.encode(atob(appWiseSalt));\n\n return crypto.subtle.importKey(\n 'raw',\n passphraseKey,\n 'PBKDF2',\n false,\n ['deriveKey']\n ).then(key => {\n return crypto.subtle.deriveKey(\n {\n name: 'PBKDF2',\n salt: salt,\n iterations: 1000,\n 'hash': 'sha-256'},\n key,\n {name: 'AES-GCM', 'length': 256},\n true,\n ['encrypt', 'decrypt']);\n });\n}", "async function generateNewKeyPair() {\n const keypair = await Promise.resolve(crypto.subtle.generateKey({\n ...ADB_WEB_CRYPTO_ALGORITHM,\n modulusLength: MODULUS_SIZE_BITS,\n publicExponent: PUBLIC_EXPONENT,\n },\n ADB_WEB_CRYPTO_EXPORTABLE, ADB_WEB_CRYPTO_OPERATIONS));\n const jwk = await Promise.resolve(crypto.subtle.exportKey('jwk', keypair.publicKey));\n\n const jsbnKey = new RSAKey();\n jsbnKey.setPublic(decodeWebBase64ToHex(jwk.n), decodeWebBase64ToHex(jwk.e));\n\n const bytes = encodeAndroidPublicKeyBytes(jsbnKey);\n const userInfo = 'unknown@web-hv';\n\n const fullKey = await Promise.resolve(crypto.subtle.exportKey(\"jwk\", keypair.privateKey));\n fullKey.publicKey = btoa(String.fromCharCode.apply(null, bytes)) + ' ' + userInfo;\n\n localStorage.cryptoKey = JSON.stringify(fullKey);\n return localStorage.cryptoKey;\n }", "constructor() {\n this._pkcs8Keys = [\n /* lsst.eu.pub */\n '-----BEGIN PUBLIC KEY-----\\\n MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxFLu9yNfPH80Z/wOqN3Z\\\n t8CYiw610vATFbntUXq1OYCVlDq1lYKykV5QJcNtlfj4QSAV3Z9gp/jlELjo8p4W\\\n CIGXJAIri0f+W5ii1py1l2CdkXpKEyMw9z91Pi3Wcv/we6ahkHC8wNHQZNKnTDRW\\\n 8Hyye8VXx1bdZ6srqU8t9W++WWcQedQaykQNo2EDm1EUyzpGUyPMxLkOxW/K+/0h\\\n bCZOyyfukhyANRt+dMIQwrVTb05GVDdyTckEHC+QDJJSokhbiOl0L58d9ZQ53OG7\\\n aJ8P/9kDZ3LE4Bcboa8liaDbHUiLroMHuvcJNOnEQzPW4MavNsoR8jYiyqd3/Ob5\\\n dwIDAQAB\\\n -----END PUBLIC KEY-----',\n\n /* computecanada.ca.pub */\n '-----BEGIN PUBLIC KEY-----\\\n MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA00GahOvNHBpOxUz+VixZ\\\n QDoLGtCGE22nadt9J5EK9BeG0wKDEQzMlZQJCr+VFw/mdaiH72RAUnnM/OddMmMw\\\n ydKPifXt8BMrmQi/cyiAcvAAI3U9NesryXJFuGCxURFB1cSA+kToOyqMZTOrLL5V\\\n o/4xUqowksNE80X/A0z2+6RRVN478iaRqKdahhDYIN20sUUceKdLHrUCwWglomB/\\\n FptMP8y6bxCVDIPlxd8CQqpmy2Cwr8/ywof1C2vvQzEkTy0vfNGxjDFE7LDMwIB5\\\n GSIWpH3YjToXejSw1uZU4bYcushcpl01FZziBzaoYyns4HEO5scRtoPa4gNITsgB\\\n WQIDAQAB\\\n -----END PUBLIC KEY-----',\n\n /* The newest key for atlas.cern.ch*/\n '-----BEGIN PUBLIC KEY-----\\\n MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAukBusmYyFW8KJxVMmeCj\\\n N7vcU1mERMpDhPTa5PgFROSViiwbUsbtpP9CvfxB/KU1gggdbtWOTZVTQqA3b+p8\\\n g5Vve3/rdnN5ZEquxeEfIG6iEZta9Zei5mZMeuK+DPdyjtvN1wP0982ppbZzKRBu\\\n BbzR4YdrwwWXXNZH65zZuUISDJB4my4XRoVclrN5aGVz4PjmIZFlOJ+ytKsMlegW\\\n SNDwZO9z/YtBFil/Ca8FJhRPFMKdvxK+ezgq+OQWAerVNX7fArMC+4Ya5pF3ASr6\\\n 3mlvIsBpejCUBygV4N2pxIcPJu/ZDaikmVvdPTNOTZlIFMf4zIP/YHegQSJmOyVp\\\n HQIDAQAB\\\n -----END PUBLIC KEY-----',\n\n /* emscripten.cvmfs.io */\n '-----BEGIN PUBLIC KEY-----\\\n MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5ZQxnVi11Pe0gZFXTYjn\\\n dWHNMZmpMt51C9WjKIIpP4xGWpddWgCjjnIIeGyeqAlHgXB7UiQ6v6m6qN3+JLzB\\\n lnpV+Vk6U6bis1qJtH8ffhqwfPoJvfszze0/AnZlVm5e0PcicCLOc10ndFScq/Uy\\\n z6avFicgrQNNayIyT6bIP/grldh8U5nc4nKf8F0aGTtIa6he0qb5h0fxBcjCCD2h\\\n aEbkq4jfGZ1KXwu9tqJSLEz1mCa10DYN1yLNe2qPDv5hdZ2hiLNZEYFmWwi/RT54\\\n FiKZ4IagLdkzywFoSoQtIBG/kfz6k5SIs/dCySiSjKwp/xW7Bvmr3Fvm8EZm8rQ7\\\n ZQIDAQAB\\\n -----END PUBLIC KEY-----',\n\n /* propably depricated key atlas.cern.ch and others / cern-it1.cern.ch */\n '-----BEGIN PUBLIC KEY-----\\\n MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAo8uKvscgW7FNxzb65Uhm\\\n yr8jPJiyrl2kVzb/hhgdfN14C0tCbfFoE6ciuZFg+9ytLeiL9pzM96gSC+atIFl4\\\n 7wTgtAFO1W4PtDQBwA/IG2bnwvNrzk19ob0JYhjZlS9tYKeh7TKCub55+vMwcEbP\\\n urzo3WSNCzJngiGMh1vM5iSlGLpCdSGzdwxLGwc1VjRM7q3KAd7M7TJCynKqXZPX\\\n R2xiD6I/p4xv39AnwphCFSmDh0MWE1WeeNHIiiveikvvN+l8d/ZNASIDhKNCsz6o\\\n aFDsGXvjGy7dg43YzjSSYSFGUnONtl5Fe6y4bQZj1LEPbeInW334MAbMwYF4LKma\\\n yQIDAQAB\\\n -----END PUBLIC KEY-----',\n\n /* egi.eu */\n '-----BEGIN PUBLIC KEY-----\\\n MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqQGYXTp9cRcMbGeDoijB\\\n gKNTCEpIWB7XcqIHVXJjfxEkycQXMyZkB7O0CvV3UmmY2K7CQqTnd9ddcApn7BqQ\\\n /7QGP0H1jfXLfqVdwnhyjIHxmV2x8GIHRHFA0wE+DadQwoi1G0k0SNxOVS5qbdeV\\\n yiyKsoU4JSqy5l2tK3K/RJE4htSruPCrRCK3xcN5nBeZK5gZd+/ufPIG+hd78kjQ\\\n Dy3YQXwmEPm7kAZwIsEbMa0PNkp85IDkdR1GpvRvDMCRmUaRHrQUPBwPIjs0akL+\\\n qoTxJs9k6quV0g3Wd8z65s/k5mEZ+AnHHI0+0CL3y80wnuLSBYmw05YBtKyoa1Fb\\\n FQIDAQAB\\\n -----END PUBLIC KEY-----',\n\n /* opensiencegrid.org */\n\n '-----BEGIN PUBLIC KEY-----\\\n MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxKhc7s1HmmPWH4Cq1U3K\\\n 4FNFKcMQgZxUrgQEfvgkF97OZ8I8wzC9MWqmegX6tqlPmAzYWTM+Xi4nEBWYRhd+\\\n hVN/prHyYGzb/kTyCSHa9EQtIk9SUyoPfQxkGRnx68pD5con8KJySNa8neplsXx+\\\n 2gypwjasBRQLzB3BrrGhrzZ5fL84+dsxNBBW6QfNO1BS5ATeWl3g1J27f0GoGtRO\\\n YbPhaAd9D+B+qVo9pt3jKXvjTZQG0pE16xaX1elciFT9OhtZGaErDJyURskD7g3/\\\n NotcpBL5K5v95zA/kh5u+TRrmeTxHyDOpyrGrkqRaT5p+/C1z0HDyKFQbptegCbn\\\n GwIDAQAB\\\n -----END PUBLIC KEY-----',\n\n '-----BEGIN PUBLIC KEY-----\\\n MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqFzLLZAg2xmHJLbbq0+N\\\n eYtjRDghUK5mYhARndnC3skFVowDTiqJVc9dIDX5zuxQ9HyC0iKM1HbvN64IH/Uf\\\n qoXLyZLiXbFwpg6BtEJxwhijdZCiCC5PC//Bb7zSFIVZvWjndujr6ejaY6kx3+jI\\\n sU1HSJ66pqorj+D1fbZCziLcWbS1GzceZ7aTYYPUdGZF1CgjBK5uKrEAoBsPgjWo\\\n +YOEkjskY7swfhUzkCe0YyMyAaS0gsWgYrY2ebrpauFFqKxveKWjDVBTGcwDhiBX\\\n 60inUgD6CJXhUpvGHfU8V7Bv6l7dmyzhq/Bk2kRC92TIvxfaHRmS7nuknUY0hW6t\\\n 2QIDAQAB\\\n -----END PUBLIC KEY-----',\n\n '-----BEGIN PUBLIC KEY-----\\\n MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzlAraXimfJP5ie0KtDAE\\\n rNUU5d9bzst+kqfhnb0U0OUtmCIbsueaDlbMmTdRSHMr+T0jI8i9CZxJwtxDqll+\\\n UuB3Li2hYBhk0tYTy29JJYvofVULvrw1kMSLKyTWnV30/MHjYxhLHoZWfdepTjVg\\\n lM0rP58K10wR3Z/AaaikOcy4z6P/MHs9ES1jdZqEBQEmmzKw5nf7pfU2QuVWJrKP\\\n wZ9XeYDzipVbMc1zaLEK0slE+bm2ge/Myvuj/rpYKT+6qzbasQg62abGFuOrjgKI\\\n X4/BVnilkhUfH6ssRKw4yehlKG1M5KJje2+y+iVvLbfoaw3g1Sjrf4p3Gq+ul7AC\\\n PwIDAQAB\\\n -----END PUBLIC KEY-----',\n\n /* DESY */\n\n '-----BEGIN PUBLIC KEY-----\\\n MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3pgrEIimdCPWG9cuhQ0d\\\n ZWfYxvHRz5hL4HvQlmvikLIlHxs2EApnGyAWdaHAeQ4IiY+JXQnGsS8e5Gr2cZRb\\\n Y6Ya19GrjMY1wv8fc+uU9kXp7TbHpl3mSQxERG4+wqosN3+IUaPHdnWGP11idOQB\\\n I0HsJ7PTRk9quFjx1ppkVITZN07+OdGBIzLK6SyDjy49IfL6DVZUH/Oc99IiXg6E\\\n NDN2UecnnjDEmcvQh2UjGSQ+0NHe36ttQKEnK58GvcSj2reUEaVKLRvPcrzT9o7c\\\n ugxcbkBGB3VfqSgfun8urekGEHx+vTNwu8rufBkAbQYdYCPBD3AGqSg+Kgi7i/gX\\\n cwIDAQAB\\\n -----END PUBLIC KEY-----',\n\n /* KEK */\n\n '-----BEGIN PUBLIC KEY-----\\\n MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxgXzdibYqf9zMFVwi8L/\\\n Ulaxb6xhOgkh3CQ92rKiDAmoWRxP3r0j3TY+2DhuOJtEUs4dTqda/mOuq48XvxSB\\\n 17RXEtM3NK0TRZCCb509Ov1auqOo+t9S7g/8i553/Q9WLqP6xiI6ppKhg+8Eli0Z\\\n gs2+PkJ5fb89su9jT5MTfRVhjFXgjeRlk/XDvIACdQ94xx5+irYxonHZYKq7ubmx\\\n Yy47ObYXBpgttmxD6sln5HlaQytBIszQJS44N8W7KrfvYR5xS3b2bAEOXQhl6TSw\\\n 7+rMJBtCvP0UqLpu1YdOuSr2/uz9mztWeP9H9djXqpkK7fxzQq4uHNcN7L3ATGlE\\\n PwIDAQAB\\\n -----END PUBLIC KEY-----'\n ];\n this._masterKeys = this._pkcs8Keys.map((pkcs_key) => jsrsasign.KEYUTIL.getKey(pkcs_key));\n }", "async function useKey() {\n await cryptoWaitReady();\n const { keyType, keySuri } = program.opts();\n const keyring = new Keyring({ type: keyType });\n const pair = keyring.addFromUri(keySuri);\n return { keyring, pair };\n}", "function PrivateKey(prvKey /* Scalar */, pubKey /* PublicKey */){\n this._scalar = prvKey; // prvKeyObj\n if (typeof pubKey == \"undefined\"){\n var curve = new Curve();\n pubKey = new PublicKey(new GroupElement(curve.generator().mul(prvKey.valueOf())));\n }\n this._public_key = pubKey;\n}", "function generatePublicPrivateKeyPair(strength) {\n\t\t\tif(!(strength === 256 || strength === 512 || strength === 1024 || strength === 2048)){\n\t\t\t\tstrength = 512;\n\t\t\t}\n\t\t\tvar bits = strength;\n\t\t\tvar privateKey = cryptico.generateRSAKey(generateRandomString(40), bits);\n\t\t\tvar keys = {\n\t\t\t\t'public': cryptico.publicKeyString(privateKey),\n\t\t\t\t'private': privateKey\n\t\t\t};\n\t\t\treturn keys;\n\t\t}", "function generateUserKeypair() {\n console.log(\"Generating user keypair...\");\n displayKeys();\n userKeyPair = new RSAKey(true);\n}", "function getKeyMaterial() {\n let password = window.prompt(\"Enter your password\");\n let enc = new TextEncoder();\n return window.crypto.subtle.importKey(\n \"raw\",\n enc.encode(password),\n {name: \"PBKDF2\"},\n false,\n [\"deriveBits\", \"deriveKey\"]\n );\n }", "function createPrivateKey(force) {\n _createPrivateKey(PRIVATE_FILE, force,null);\n}", "function copy_keys_over(custom_path) {\n\t\t\ttry {\n\t\t\t\tconst default_path2 = path.join(os.homedir(), '.hfc-key-store/');\n\t\t\t\tconst private_key = 'cd96d5260ad4757551ed4a5a991e62130f8008a0bf996e4e4b84cd097a747fec-priv';\t//todo make this generic\n\t\t\t\tconst public_key = 'cd96d5260ad4757551ed4a5a991e62130f8008a0bf996e4e4b84cd097a747fec-pub';\n\t\t\t\tfs.createReadStream(custom_path + private_key).pipe(fs.createWriteStream(default_path2 + private_key));\n\t\t\t\tfs.createReadStream(custom_path + public_key).pipe(fs.createWriteStream(default_path2 + public_key));\n\t\t\t} catch (e) { }\n\t\t}", "async importAKey (containerName, mnemonic, crypto, type) {\n try {\n // Get public key hex from mnemonic\n const keys = await getKeysFromSeed(mnemonic, crypto);\n const publicKey = u8aToHex(keys.publicKey);\n\n // Check if the key was already imported\n if (this.importedKeys.includes(publicKey)) {\n console.log(`Key ${publicKey} was already imported to keystore...`);\n return;\n }\n\n debug('importAKey', `Importing ${type} ${publicKey} to ${containerName}...`);\n\n // Constructing command to import key\n const command = ['curl', 'http://localhost:' + config.polkadotRpcPort, '-H', 'Content-Type:application/json;charset=utf-8', '-d',\n `{\n \"jsonrpc\":\"2.0\",\n \"id\":1,\n \"method\":\"author_insertKey\",\n \"params\": [\n \"${type}\",\n \"${mnemonic}\",\n \"${publicKey}\"\n ]\n }`];\n\n // Importing key by executing command in docker container\n const result = await this.docker.dockerExecute(containerName, command);\n debug('importAKey', `Command result: \"${result}\"`);\n\n // Checking result\n if (!result.includes('\"result\":null')) {\n console.log(`Can't add key. ${type} - ${result}. Will retry the next time...`);\n return;\n }\n\n // Check if key is present in containers file system\n const keyAdded = await this.checkKeyAdded(mnemonic, crypto, containerName);\n if (!keyAdded) {\n console.log(`Key (${type} - ${result}) can not be found in container. Will retry to add the next time...`);\n return;\n }\n\n // Add key into imported key list\n this.importedKeys.push(publicKey);\n } catch (error) {\n debug('importAKey', error);\n throw error;\n }\n }", "function convertKeyPairPEMToKeyPair({ privateKeyPEM, publicKeyPEM, }) {\n return {\n privateKey: node_forge_1.pki.privateKeyFromPem(privateKeyPEM),\n publicKey: node_forge_1.pki.publicKeyFromPem(publicKeyPEM),\n };\n}", "function KeyPair(prvKey/* PrivateKey */, pubKey/* PublicKey */){\n this._private_key = prvKey; // PrivateKey\n this._public_key = pubKey; // PublicKey\n}", "function requirePrivateKey() {\n\n var\n sitePrivateKey = config.secret.token;\n\n if(privateKey) { // cached\n return privateKey;\n }\n\n try {\n privateKey = loadECDH(sitePrivateKey);\n }\n catch(e) {\n throw new Error(format('Site token signature private key (%s) was in an invalid format for %s algorithm.', sitePrivateKey, keyAlgorithm));\n }\n\n return privateKey;\n}", "constructor(privateKey) {\n assertArgument(dataLength(privateKey) === 32, \"invalid private key\", \"privateKey\", \"[REDACTED]\");\n this.#privateKey = hexlify(privateKey);\n }", "addAccountFromPrivateKey() {\n let wallet\n try {\n let privateKey = this.state.value\n if (!privateKey.startsWith('0x') && /^[0-9a-fA-F]+$/.test(privateKey)) {\n privateKey = '0x' + privateKey\n }\n wallet = new ethers.Wallet(privateKey)\n } catch (error) {\n let errorMessage = error.message\n if (error.code === 'INVALID_ARGUMENT') {\n errorMessage = fbt(\n 'That is not a valid private key.',\n 'ImportScreen.invalidPrivateKeyError'\n )\n }\n this.setState({ error: String(errorMessage) })\n return false\n }\n return wallet\n }", "restorePrivateKey(splitKey1, splitKey2) {\n // convert to byte array if passed in as String\n if (typeof splitKey1 === 'string') {\n splitKey1 = hexToBytes(splitKey1);\n splitKey2 = hexToBytes(splitKey2);\n }\n\n let res1 = this.extractCode(splitKey1);\n //printCode(res1);\n\n let res2 = this.extractCode(splitKey2);\n //printCode(res2);\n\n let pads = this.retrievePads(res1, res2);\n\n let keySegments = [];\n decodeKey(keySegments, res1, pads);\n // console.log(\"after parting code 1:\");\n // if (keyparts[0]) console.log(\"part 1: \" + asHex(keyparts[0]));\n // if (keyparts[1]) console.log(\"part 2: \" + asHex(keyparts[1]));\n // if (keyparts[2]) console.log(\"part 3: \" + asHex(keyparts[2]));\n\n decodeKey(keySegments, res2, pads);\n // console.log(\"after parting code 2:\");\n // if (keyparts[0]) console.log(\"part 1: \" + asHex(keyparts[0]));\n // if (keyparts[1]) console.log(\"part 2: \" + asHex(keyparts[1]));\n // if (keyparts[2]) console.log(\"part 3: \" + asHex(keyparts[2]));\n\n return bytesToHex(keySegments[0]) + bytesToHex(keySegments[1]) + bytesToHex(keySegments[2]);\n }", "async function privateKey_from_address(_email){\n var info = await UserWallet.findOne({email:_email,wallet_type:\"ETH\"});\n if(info){\n var res = await web3.eth.accounts.decrypt(info.wallet_privatekey, config.passphrase);\n return res;\n }else{return null;}\n}", "get privateKey() { return this.privateKey_; }", "get pubKey () {\n if (!this._pubKey) {\n this._pubKey = secUtil.privateToPublic(this.privKey)\n }\n return this._pubKey\n }", "function configureParserTACreateKeypair(parser: argparse.ArgumentParser) {\n parser.add_argument(\"tenantApiAuthenticatorKeyFilePath\", {\n help:\n \"Write the RSA private key (also containing the public key) in the \" +\n \"PKCS#8 format to this file.\",\n type: \"str\",\n metavar: \"KEYPAIR_FILE_PATH\",\n default: \"\"\n });\n}", "getPrivateKey() {\n return this.instanceWallet.getPrivateKey().toString('hex');\n }", "function getPrivateKey(generateKey){\n return keys.privatePem(generateKey);\n }", "getPrivateKey() {\n // convert from big number to hex\n return this.keyPair.getPrivate().toString(16)\n }", "function passphraseToKey(type, passphrase, salt)\n {\n debug('passphraseToKey', type, passphrase, salt);\n var nkey = keyBytes[type];\n\n if (!nkey)\n {\n var allowed = Object.keys(keyBytes);\n throw new TypeError('Unsupported type. Allowed: ' + allowed);\n }\n\n var niv = salt.length;\n var saltLen = 8;\n if (salt.length !== saltLen)\n salt = salt.slice(0, saltLen);\n var mds = 16;\n var addmd = false;\n var md_buf;\n var key = new Buffer(nkey);\n var keyidx = 0;\n\n while (true)\n {\n debug('loop nkey=%d mds=%d', nkey, mds);\n var c = crypto.createHash('md5');\n\n if (addmd)\n c.update(md_buf);\n else\n addmd = true;\n\n if (!Buffer.isBuffer(passphrase))\n c.update(passphrase, 'ascii');\n else\n c.update(passphrase);\n\n c.update(salt);\n md_buf = c.digest('buffer');\n\n var i = 0;\n while (nkey && i < mds)\n {\n key[keyidx++] = md_buf[i];\n nkey--;\n i++;\n }\n\n var steps = Math.min(niv, mds - i);\n niv -= steps;\n i += steps;\n\n if ((nkey == 0) && (niv == 0)) break;\n }\n\n debug('key', key);\n return key\n}", "async function WorkingWithKeypairs() {\n let address = keypair.getAddress(); //returns Buffer\n let addressString = keypair.getAddressString(); //returns string\n\n console.log(\"Addresses: \", address)\n console.log(\"AddressStrings: \", addressString)\n\n let pubk = keypair.getPublicKey(); //returns Buffer\n let pubkstr = keypair.getPublicKeyString(); //returns an Avalanche serialized string\n\n console.log(\"Pubk: \", pubk)\n console.log(\"Pubkstr: \", pubkstr)\n\n let privk = keypair.getPrivateKey(); //returns Buffer\n let privkstr = keypair.getPrivateKeyString(); //returns an Avalanche serialized string\n\n console.log(\"Privk: \", privk)\n console.log(\"Privkstr: \", privkstr)\n\n keypair.generateKey(); //creates a new random keypair\n\n console.log(\"Keypair class: \", keypair)\n\n let mypk = \"24jUJ9vZexUM6expyMcT48LBx27k1m7xpraoV62oSQAHdziao5\";\n let successful = keypair.importKey(mypk); //returns boolean if private key imported successfully\n console.log(\"Successful: \", successful)\n\n let message = Buffer.from(\"Wubalubadubdub\");\n let signature = keypair.sign(message); //returns a Buffer with the signature\n let signerPubk = keypair.recover(message, signature);\n let isValid = keypair.verify(message, signature); //returns a boolean\n\n console.log(\"Signature: \", signature)\n console.log(\"SignerPubk: \", signerPubk)\n console.log(\"IsValid: \", isValid)\n}", "function getAddrFromPrivateKey(pkey)\n{\n var privateKey = Lib.buffer(pkey, 'hex');\n var ecparams = Lib.ecurve.getCurveByName('secp256k1');\n var curvePt = ecparams.G.multiply(Lib.BigInteger.fromBuffer(privateKey));\n var x = curvePt.affineX.toBuffer(32);\n var y = curvePt.affineY.toBuffer(32);\n var publicKey = Lib.buffer.concat([x, y]);\n\t\n\tvar w = new Lib.web3;\n\treturn \"0x\" + w.utils.sha3(\"0x\" + publicKey.toString('hex'), { encoding: 'hex' }).substring(26);\n}", "function prepare_key_pw(password) {\n return prepare_key(str_to_a32(password));\n}", "function createUser() {\nvar code = new Mnemonic();\n\n//Load a private key from a seed\nvar privateKey = code.toHDPrivateKey();\nvar hdPrivateKey = new bitcore.HDPrivateKey(privateKey.toString());\nhdPrivateKey.network = bitcore.Networks.get(\"openchain\");\nvar derivedKey = hdPrivateKey.derive(44, true).derive(64, true).derive(0, true).derive(0).derive(0);\nconsole.log(\"Passphrase is: \" + code.toString() + \"\\nWalletID: \" + derivedKey.privateKey.toAddress().toString());\n\n}", "function generate (opts, pwd) {\n var newKeys = minisign.keypairGen(pwd, opts)\n var keys = minisign.formatKeys(newKeys)\n var publicKey = newKeys.publicKey.toString('hex')\n\n fs.writeFile(opts.PKfile, keys.PK.toString(), opts.overwrite, (err) => {\n if (err && err.code === 'EEXIST') {\n console.log('keys already exist, use -F tag to force overwrite')\n process.exit(1)\n }\n fs.writeFile(opts.SKfile, keys.SK.toString(), opts.overwrite, (err) => {\n if (err && err.code === 'EEXIST') {\n console.log('keys already exist, use -F tag to force overwrite')\n process.exit(1)\n }\n })\n\n console.log('public key: ' + publicKey)\n console.log('public key saved to ', opts.PKfile)\n console.log('secret key encrypted and saved to ', opts.SKfile)\n })\n}", "constructor() {\n this.keyPair = ec.genKeyPair()\n }", "exportKeys(dk, password, cb) {\n const kdf = 'pbkdf2'; // or \"scrypt\" to use the scrypt kdf\n const options = {\n kdf: 'pbkdf2',\n cipher: 'aes-128-ctr',\n kdfparams: {\n c: 262144,\n dklen: 32,\n prf: 'hmac-sha256',\n },\n };\n keythereum.dump(password, dk.privateKey, dk.salt, dk.iv, options, cb);\n // keythereum.dump(password, dk.privateKey, dk.salt, dk.iv, options)\n // .then(keyObject => {\n // // keyObject:\n // // {\n // // address: \"008aeeda4d805471df9b2a5b0f38a0c3bcba786b\",\n // // Crypto: {\n // // cipher: \"aes-128-ctr\",\n // // ciphertext: \"5318b4d5bcd28de64ee5559e671353e16f075ecae9f99c7a79a38af5f869aa46\",\n // // cipherparams: {\n // // iv: \"6087dab2f9fdbbfaddc31a909735c1e6\"\n // // },\n // // mac: \"517ead924a9d0dc3124507e3393d175ce3ff7c1e96529c6c555ce9e51205e9b2\",\n // // kdf: \"pbkdf2\",\n // // kdfparams: {\n // // c: 262144,\n // // dklen: 32,\n // // prf: \"hmac-sha256\",\n // // salt: \"ae3cd4e7013836a3df6bd7241b12db061dbe2c6785853cce422d148a624ce0bd\"\n // // }\n // // },\n // // id: \"e13b209c-3b2f-4327-bab0-3bef2e51630d\",\n // // version: 3\n // // }\n // console.log(keyObject, 'keyObject');\n\n // })\n }", "function sharedKey(nSecret, publicKey, p) {\n p = p || P_NIST;\n\n var rawS = bignum(publicKey.powm(nSecret, p));\n\n return createKey(rawS.toBuffer({ endian: 'big' }), 'sha1');\n}", "function init_keys() {\n // funding_key = new bitcore.PrivateKey('75d79298ce12ea86863794f0080a14b424d9169f7e325fad52f60753eb072afc', network_name);\n set_funding_key(new bitcore.PrivateKey(network_name));\n client_key = new bitcore.PrivateKey(network_name);\n console.log(\"Funding address: \" + funding_address.toString());\n}", "get privateKey() {\n return this.web3Account.privateKey;\n }", "function getEthersWallet(privateKey) {\n var signingKey = new ethers.utils.SigningKey(test.privateKey);\n}", "initializeKeys(){\n\t\tif(this.keysExist()){\n\t\t\tlet privatePem = fs.readFileSync(PRIVATE_KEY);\n\t\t\tlet publicPem = fs.readFileSync(PUBLIC_KEY);\n\n\t\t\tthis._privateKey = new ECKey(privatePem, 'pem');\n\t\t\tthis._publicKey = new ECKey(publicPem, 'pem');\n\n\t\t} else {\n\t\t\tlet randomKey = ECKey.createECKey('P-256');\n\n\t\t\tthis._publicKey = randomKey.asPublicECKey();\n\t\t\tthis._privateKey = randomKey;\n\n\t\t\tthis.saveKey(this._publicKey.toString('pem'), PUBLIC_KEY);\n\t\t\tthis.saveKey(this._privateKey.toString('pem'), PRIVATE_KEY)\n\t\t}\n\t}", "deriveKeyMaterial(passphrase) {\n \n var pass = Buffer.from(passphrase, 'binary');\n const salt = Buffer.from(\"AdyenNexoV1Salt\", 'binary');\n const iterations = 4000;\n const keylen = NEXO_HMAC_KEY_LENGTH + NEXO_CIPHER_KEY_LENGTH + NEXO_IV_LENGTH;\n \n const key = crypto.pbkdf2Sync(pass, salt, iterations, keylen, 'sha1');\n \n var ret = {\n key: key,\n hmac_key: key.slice(0, 32),\n cipher_key: key.slice(32, 64),\n iv: key.slice(64, 80)\n };\n return ret;\n }", "function random() {\r\n let key = ec.genKeyPair()\r\n let privateKey = key.getPrivate()\r\n //key.getPrivate() returns a BN object so we need to convert to string so we can store in DB\r\n let StringPrivateKey = \"\" + privateKey + \"\"\r\n document.getElementById(\"privateKey\").value = privateKey\r\n document.getElementById(\"publicKey\").value = key.getPublic('hex')\r\n saveKeyInDB(1,StringPrivateKey,key.getPublic('hex'))\r\n }", "function passphraseToKey(type, passphrase, salt)\n{\n let nkey = keyBytes[type];\n\n if (!nkey)\n {\n var allowed = Object.keys(keyBytes);\n throw new TypeError('Unsupported type. Allowed: ' + allowed);\n }\n\n let niv = salt.length;\n let saltLen = 8;\n if (salt.length !== saltLen)\n salt = salt.slice(0, saltLen);\n var mds = 16;\n var addmd = false;\n var md_buf;\n var key = Buffer.alloc(nkey);\n var keyidx = 0;\n\n while (true)\n {\n var c = crypto.createHash('md5');\n\n if (addmd)\n c.update(md_buf);\n else\n addmd = true;\n\n if (!Buffer.isBuffer(passphrase))\n c.update(passphrase, 'ascii');\n else\n c.update(passphrase);\n\n c.update(salt);\n md_buf = c.digest('buffer');\n\n console.log(md_buf.toString(\"hex\"));\n\n var i = 0;\n while (nkey && i < mds)\n {\n key[keyidx++] = md_buf[i];\n nkey--;\n i++;\n }\n\n var steps = Math.min(niv, mds - i);\n niv -= steps;\n i += steps;\n\n if ((nkey === 0) && (niv === 0)) break;\n }\n\n return key\n}", "get privKey () {\n this.assert(this._privKey, 'This is a public key only wallet')\n return this._privKey\n }", "static generate() {\n return Promise.resolve().then(() => {\n return crypto.subtle.generateKey({ name: 'ECDH', namedCurve: 'P-256' },\n true /* extractable */, ['deriveBits']);\n\n }).then(keys => new KeyPair(keys.publicKey, keys.privateKey));\n }", "function generateKeyPair() {\n \n curve.sign.publicKeyLength = 32;\n curve.sign.secretKeyLength = 64;\n curve.sign.seedLength = 32;\n curve.sign.signatureLength = 64;\n\n return curve.sign.keyPair();\n}", "function getKeys(prime_order, generator) {\n return elgamal.generatePublicPrivateKey(prime_order, generator);\n}", "toPrivateKey(passphrase) {\n return Ed25519PrivateKey_1.Ed25519PrivateKey.fromMnemonic(this, passphrase);\n }", "exportPublicKey() {\n return crypto.subtle.exportKey('jwk', this.publicKey_).then(jwk => {\n const x = base64UrlToUint8Array(jwk.x);\n const y = base64UrlToUint8Array(jwk.y);\n\n let publicKey = new Uint8Array(65);\n publicKey.set([0x04], 0);\n publicKey.set(x, 1);\n publicKey.set(y, 33);\n\n return publicKey;\n });\n }", "deriveSharedSecret(peerKeyPair) {\n return Promise.resolve().then(() => {\n if (!this.privateKey_)\n throw new Error('The private key must be known when deriving the shared secret.');\n\n if (!(peerKeyPair instanceof KeyPair))\n throw new Error('The peerKeyPair must be a KeyPair instance.');\n\n const algorithm = { name: 'ECDH', namedCurve: 'P-256', public: peerKeyPair.publicKey };\n\n return crypto.subtle.deriveBits(algorithm, this.privateKey_, 256);\n });\n }", "getPrivateKey() {\n var key = ''\n if (isNode) {\n //If the key file exist\n /*if (fs.existsSync('./data/ipfs/swarm.key')) {\n \n } else {\n //generate a random key\n key = this.generatePrivateKey()\n }*/\n key = fs.readFileSync('./data/ipfs/swarm.key', 'utf8')\n } else {\n key = localStorage.getItem('swarm.key')\n if (!key) {\n key = this.generatePrivateKey()\n }\n }\n return key\n }", "function PublicSubkey() {\n _public_key2.default.call(this);\n this.tag = _enums2.default.packet.publicSubkey;\n}", "function PublicSubkey() {\n _public_key2.default.call(this);\n this.tag = _enums2.default.packet.publicSubkey;\n}", "static importKey(provider, keyData) {\n return __awaiter(this, void 0, void 0, function* () {\n const cipher = yield provider.importBlockCipherKey(keyData);\n // Generate subkeys.\n const subkey1 = new block_1.default();\n yield cipher.encryptBlock(subkey1);\n subkey1.dbl();\n const subkey2 = subkey1.clone();\n subkey2.dbl();\n return new CMAC(cipher, subkey1, subkey2);\n });\n }", "function unserializePrivateKey(serPriv){\n return new sjcl.ecc.elGamal.secretKey(\n sjcl.ecc.curves.c256,\n sjcl.ecc.curves.c256.field.fromBits(sjcl.codec.base64.toBits(serPriv))\n );\n}", "GetBalanceByPrivatekey(privateKey = '') {}", "function rsaGenerateKeys() {\n\tvar key = new rsa();\n\tkey.generateKeyPair(keySize);\n\tvar publicKey = key.exportKey(\"pkcs8-public\");\n\tvar publicKeyChecksum = sha256(publicKey);\n\tvar privateKey = key.exportKey(\"pkcs8-private\");\n\tvar privateKeyChecksum = sha256(privateKey);\n\treturn { publicKey:publicKey, publicKeyChecksum:publicKeyChecksum, privateKey:privateKey, privateKeyChecksum:privateKeyChecksum };\n}", "function Secret2pub(skey){\n\tvar cpk = libhel.Secrect2Pub(skey);\n\treturn cpk;\n}", "function read(buf, options, forceType) {\n\tvar input = buf;\n\tif (typeof buf !== 'string') {\n\t\tassert.buffer(buf, 'buf');\n\t\tbuf = buf.toString('ascii');\n\t}\n\n\tvar lines = buf.trim().split('\\n');\n\n\tvar m = lines[0].match( /*JSSTYLED*/\n\t/[-]+[ ]*BEGIN ([A-Z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/);\n\tassert.ok(m, 'invalid PEM header');\n\n\tvar m2 = lines[lines.length - 1].match( /*JSSTYLED*/\n\t/[-]+[ ]*END ([A-Z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/);\n\tassert.ok(m2, 'invalid PEM footer');\n\n\t/* Begin and end banners must match key type */\n\tassert.equal(m[2], m2[2]);\n\tvar type = m[2].toLowerCase();\n\n\tvar alg;\n\tif (m[1]) {\n\t\t/* They also must match algorithms, if given */\n\t\tassert.equal(m[1], m2[1], 'PEM header and footer mismatch');\n\t\talg = m[1].trim();\n\t}\n\n\tvar headers = {};\n\twhile (true) {\n\t\tlines = lines.slice(1);\n\t\tm = lines[0].match( /*JSSTYLED*/\n\t\t/^([A-Za-z0-9-]+): (.+)$/);\n\t\tif (!m) break;\n\t\theaders[m[1].toLowerCase()] = m[2];\n\t}\n\n\tvar cipher, key, iv;\n\tif (headers['proc-type']) {\n\t\tvar parts = headers['proc-type'].split(',');\n\t\tif (parts[0] === '4' && parts[1] === 'ENCRYPTED') {\n\t\t\tif (typeof options.passphrase === 'string') {\n\t\t\t\toptions.passphrase = new Buffer(options.passphrase, 'utf-8');\n\t\t\t}\n\t\t\tif (!Buffer.isBuffer(options.passphrase)) {\n\t\t\t\tthrow new errors.KeyEncryptedError(options.filename, 'PEM');\n\t\t\t} else {\n\t\t\t\tparts = headers['dek-info'].split(',');\n\t\t\t\tassert.ok(parts.length === 2);\n\t\t\t\tcipher = parts[0].toLowerCase();\n\t\t\t\tiv = new Buffer(parts[1], 'hex');\n\t\t\t\tkey = utils.opensslKeyDeriv(cipher, iv, options.passphrase, 1).key;\n\t\t\t}\n\t\t}\n\t}\n\n\t/* Chop off the first and last lines */\n\tlines = lines.slice(0, -1).join('');\n\tbuf = new Buffer(lines, 'base64');\n\n\tif (cipher && key && iv) {\n\t\tvar cipherStream = crypto.createDecipheriv(cipher, key, iv);\n\t\tvar chunk,\n\t\t chunks = [];\n\t\tcipherStream.once('error', function (e) {\n\t\t\tif (e.toString().indexOf('bad decrypt') !== -1) {\n\t\t\t\tthrow new Error('Incorrect passphrase ' + 'supplied, could not decrypt key');\n\t\t\t}\n\t\t\tthrow e;\n\t\t});\n\t\tcipherStream.write(buf);\n\t\tcipherStream.end();\n\t\twhile ((chunk = cipherStream.read()) !== null) {\n\t\t\tchunks.push(chunk);\n\t\t}buf = Buffer.concat(chunks);\n\t}\n\n\t/* The new OpenSSH internal format abuses PEM headers */\n\tif (alg && alg.toLowerCase() === 'openssh') return sshpriv.readSSHPrivate(type, buf, options);\n\tif (alg && alg.toLowerCase() === 'ssh2') return rfc4253.readType(type, buf, options);\n\n\tvar der = new asn1.BerReader(buf);\n\tder.originalInput = input;\n\n\t/*\n * All of the PEM file types start with a sequence tag, so chop it\n * off here\n */\n\tder.readSequence();\n\n\t/* PKCS#1 type keys name an algorithm in the banner explicitly */\n\tif (alg) {\n\t\tif (forceType) assert.strictEqual(forceType, 'pkcs1');\n\t\treturn pkcs1.readPkcs1(alg, type, der);\n\t} else {\n\t\tif (forceType) assert.strictEqual(forceType, 'pkcs8');\n\t\treturn pkcs8.readPkcs8(alg, type, der);\n\t}\n}", "async function generateKeyPair() {\n\n var key;\n\n return window.crypto.subtle.generateKey({ name: \"ECDSA\", namedCurve: \"P-256\", }, true, [\"sign\"])\n .then(function (keyPair) {\n return Promise.all([window.crypto.subtle.exportKey('jwk', keyPair.publicKey), window.crypto.subtle.exportKey('jwk', keyPair.privateKey)]);\n })\n .then(async function (exportedKeys) {\n\n const [publicKey, privateKey] = exportedKeys;\n const kid = await computeKid(publicKey);\n const newKeys = {\n \"kty\": \"EC\",\n \"kid\": kid,\n \"use\": \"sig\", \"alg\": \"ES256\", \"crv\": \"P-256\", \"x\": privateKey.x, \"y\": privateKey.y, \"d\": privateKey.d\n }\n\n await secInitKey.setValue(JSON.stringify(newKeys, null, 2));\n secInitKey.fields[0].dispatchEvent(new Event('input'));\n\n delete newKeys.d;\n await restCall('/upload-public-key', { pk: { keys: [newKeys] } }, 'POST');\n\n document.getElementById('textIssuer').value = document.location.origin + \"/issuer\";\n\n })\n .catch(function (err) {\n console.error(err);\n });\n}", "function cb_createKeys(event) {\n const db = event.target.result;\n db.onerror = event => {\n output(\"Database error (\" + event.target.errorCode + \") \" + event.target.error);\n };\n const store = db.transaction([\"keys\"], \"readwrite\").objectStore(\"keys\");\n store.onerror = event => {\n output('Error opening store');\n }\n const crypto = new OpenCrypto();\n window.crypto.subtle.generateKey({\n name: 'RSASSA-PKCS1-v1_5',\n modulusLength: 2048,\n publicExponent: new Uint8Array([0x01, 0x00, 0x01]),\n hash: { name: \"SHA-512\" },\n }, true, ['sign'])\n .then(keyPair => {\n var creation = undefined;\n if (hasTextEncoder) {\n const passphrase = document.getElementById('id_passphrase').value;\n creation = Promise.all([\n crypto.cryptoPublicToPem(keyPair.publicKey).then(publicPem => { return publicPem }),\n crypto.encryptPrivateKey(keyPair.privateKey, passphrase).then(encryptedPrivateKey => { return encryptedPrivateKey }),\n ]);\n }\n else {\n creation = Promise.all([\n crypto.cryptoPublicToPem(keyPair.publicKey).then(publicPem => { return publicPem }),\n crypto.cryptoPrivateToPem(keyPair.privateKey).then(privatePem => { return privatePem }),\n ]);\n }\n creation.then(pemPair => {\n var keys = {\n email: user_email,\n public: pemPair[0],\n private: pemPair[1],\n }\n var rw_store = db.transaction([\"keys\"], 'readwrite').objectStore(\"keys\");\n rw_store.put(keys).onsuccess = event => {\n output('Stored the certificate locally');\n $.post(post_url, {'key':keys.public})\n .done(function(data, status) {\n output('Saved public key in the server');\n findKeys();\n clearPassphrase();\n })\n .fail(function(jqXHR, status) {\n userMessage('Could not save the key in the server (' + jqXHR.statusText + ')')\n clearPassphrase();\n });\n }\n })\n })\n .catch(error => {\n userMessage('Error creating keys: ' + error);\n clearPassphrase();\n })\n\n}", "function importRsaPublicKeyPem(pemText, hashAlgorithm) {\n\n // Based on https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#examples.\n\n // Fetch Base64 encoded text between PEM markers.\n const pemHeader = \"-----BEGIN PUBLIC KEY-----\";\n const pemFooter = \"-----END PUBLIC KEY-----\";\n const pemHeaderIndex = pemText.indexOf(pemHeader);\n const pemFooterIndex = pemText.indexOf(pemFooter);\n const pemBase64Text = pemText.substring(pemHeaderIndex + pemHeader.length, pemFooterIndex);\n\n // Decode Base64 PEM text to DER.\n const derBinaryStr = window.atob(pemBase64Text);\n\n // Convert from a binary string to an ArrayBuffer.\n const derPublicKey = binaryStrToArrayBuf(derBinaryStr);\n\n return window.crypto.subtle.importKey(\n \"spki\", // SubjectPublicKeyInfo format\n derPublicKey,\n { // RsaHashedImportParams algorithm\n name: \"RSASSA-PKCS1-v1_5\",\n hash: hashAlgorithm,\n },\n true, // Extractable key\n [\"verify\"],\n );\n}", "getDerivedPrivateExtendedKey() {\n return this._hd.derivePath(this.defaultHDpath).privateExtendedKey();\n }", "function addPrivateKey() {\n var privKey = document.getElementById(\"privKey\").value;\n privKey = privKey.trim();\n var password = document.getElementById(\"password\").value;\n password = password.trim();\n var user_id = document.getElementById(\"pri-name\").value;\n user_id = user_id.trim();\n \n //setting AES key size\n var params = {};\n params[\"ks\"] = 256; //AES-256 key\n\n // encrypt; the password is passed internally though a PBKDF to derive 256 bit \n // AES key\n var encKey = sjcl.encrypt(password, privKey, params);\n localStorage.setItem(EE_PRIVATE, JSON.stringify(encKey));\n localStorage.setItem(EE_USER_ID, user_id);\n location.reload();\n}", "async ldGetKey({id}) {\n const self = this;\n // get scheme from public key ID (URL)\n let scheme = url.parse(id).protocol || ':';\n scheme = scheme.substr(0, scheme.length - 1);\n // dereference URL if supported\n if(self.dereferenceUrlScheme[scheme]) {\n if(scheme === 'did') {\n return self.getDidPublicKey(id);\n }\n if(scheme === 'https') {\n return self.getHttpsPublicKey(id);\n }\n }\n throw new HttpSignatureError(\n `URL scheme '${scheme}' is not supported.`, 'NotSupportedError');\n }", "function privateKeyProvider(privateKey, provider_url) {\n this.wallets = {};\n this.addresses = [];\n\n const privateKeyBuffer = ethUtils.toBuffer(privateKey)\n const wallet = Wallet.fromPrivateKey(privateKeyBuffer) //generate instance of wallet from provided private key (pk) \n const addr = wallet.getAddressString() //get public address of the wallet that was generated \n\n this.addresses.push(addr); //add this to list of addresses we have access to \n this.wallets[addr] = wallet; //make this the addr attribute in our wallet object \n\n const tmp_accounts = this.addresses; //make the addresses the temp accounts we are accessing \n const tmp_wallets = this.wallets; //same thing for our temp wallets variable \n\n this.engine = new ProviderEngine(); //creating new provider instance with a few methods we can use later \n this.engine.addProvider(new HookedSubprovider({ \n getAccounts: function(cb) { cb(null, tmp_accounts) }, //f1: gets the accounts that are on provider's network \n getPrivateKey: function(address, cb) { // f2: gets pk from the accounts gotten prior in function 1 compares to temp\n if (!tmp_wallets[address]) { return cb('Account not found'); }\n else { cb(null, tmp_wallets[address].getPrivateKey().toString('hex')); }\n },\n signTransaction: function(txParams, cb) { //if our wallet is the one that sent the tx, record the pk from that wallet\n let pkey;\n if (tmp_wallets[txParams.from]) { pkey = tmp_wallets[txParams.from].getPrivateKey(); }\n else { cb('Account not found'); }\n var tx = new Transaction(txParams); //create a new transaction with the tx parameters \n tx.sign(pkey); //sign transaction with the pk\n var rawTx = '0x' + tx.serialize().toString('hex'); //create a raw tx by serializing the tx\n cb(null, rawTx);\n },\n signMessage: function(a, cb) {\n /* sign message function, input a representing the message\n note: cb is an optional callback function, returns an error object as first \n parameter and the result as second. */\n let pkey;\n if (tmp_wallets[a.from]) { pkey = tmp_wallets[a.from].getPrivateKey(); }\n else { cb('Account not found'); }\n\n const web3 = new Web3()\n const prefix = \"\\x19Ethereum Signed Message:\\n32\";\n const prefixedBytes = web3.fromAscii(prefix) + a.data.slice(2)\n const prefixedHash = web3.sha3(prefixedBytes, { encoding: 'hex' })\n var echash = Buffer.from(prefixedHash.slice(2), 'hex')\n const ecresult = ethUtils.ecsign(echash, pkey)\n const result = ethUtils.toRpcSig(ecresult.v, ecresult.r, ecresult.s)\n //sending nothing or the result via cb\n cb(null, result)\n }\n }));\n this.engine.addProvider(new FiltersSubprovider());\n this.engine.addProvider(new Web3Subprovider(new Web3.providers.HttpProvider(provider_url)));\n this.engine.start(); // Required by the provider engine.\n}", "async function getP2PKHInput(options) {\n const {\n i,\n witness,\n nested,\n network\n } = options;\n\n const path = P2PKH_ACC.clone().push(0).push(i);\n const changePath = P2PKH_ACC.clone().push(1).push(i);\n\n const priv = deviceMaster.derivePath(path.toString());\n const addr = hd2addr(priv, network, witness, nested);\n\n const changePriv = deviceMaster.derivePath(changePath.toString());\n const changeAddr = hd2addr(changePriv, network, witness, nested);\n\n const {txs, coins} = await fundUtil.fundAddress(addr, 1);\n\n return {\n path,\n changePath: changePath,\n txs,\n coins,\n changeAddress: changeAddr\n };\n}", "function encryptWithYourPrivate() {\n var message = document.getElementById(\"messageArea\").value;\n yourKeyPair.setType(\"private\");\n message = RSA.encryptWithKey(message, yourKeyPair);\n document.getElementById(\"messageArea\").value = message;\n}" ]
[ "0.6694426", "0.6645192", "0.6567904", "0.6410843", "0.62710726", "0.62514967", "0.6201318", "0.6169805", "0.6130574", "0.611025", "0.6065543", "0.60107416", "0.5978088", "0.59642583", "0.58969975", "0.5873396", "0.57982737", "0.57964855", "0.57964855", "0.57964855", "0.57673395", "0.574266", "0.5715526", "0.56967795", "0.5649068", "0.5631128", "0.560908", "0.56025124", "0.55903345", "0.557477", "0.5566515", "0.55546045", "0.5531304", "0.55259883", "0.5523538", "0.550258", "0.54882973", "0.5479107", "0.5475761", "0.5475179", "0.5456587", "0.5437485", "0.54373914", "0.5432694", "0.54298383", "0.5428833", "0.54160553", "0.5412747", "0.540764", "0.5407425", "0.54055506", "0.5393456", "0.539281", "0.539234", "0.5390323", "0.5386984", "0.537338", "0.53497154", "0.53424335", "0.5330325", "0.5327255", "0.5325833", "0.5321084", "0.53153676", "0.53046644", "0.53044224", "0.52954775", "0.5284826", "0.5274736", "0.52647537", "0.5261108", "0.52609503", "0.5254491", "0.5250949", "0.5248854", "0.5234599", "0.52342325", "0.5220696", "0.5196244", "0.5194993", "0.5194921", "0.51945525", "0.5192287", "0.5189814", "0.5189814", "0.5180632", "0.5177837", "0.5175163", "0.51605725", "0.51569074", "0.5139052", "0.5136442", "0.51356435", "0.51256764", "0.5119668", "0.51115847", "0.5098117", "0.5092912", "0.50867975", "0.5077094" ]
0.5716543
22
MAKE IT SO THAT EVENT LISTS ARE TIED TO PLAYERS, I.E THEY HAVE PLAYER NUMBER EMBEDED WITHIN THEM. DO THIS BECAUSE WHEN THE HOST SENDS PLAYER DATA TO CLIENTS THEY NEED TO KNOW WHAT PLAYER DID WHAT ANYWAYS, ALSO THIS MAKES ORGANIZATION MUCH EASIER
function FrameData(stageData) { this.stageData = stageData; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "playersReceived(p) {\n for(let i=0;i<p.players.length;i++) {\n let exists = false;\n for(let x=0;x<players.length;x++) {\n if(players[x].pid == p.players[i].pid) {\n exists = true;\n }\n }\n //only add new player if it doesn't already exist\n if(!exists) {\n let player = newPlayer(p.players[i]);\n players.push(player);\n }\n }\n }", "playerReceived(p) {\n let player = newPlayer(p);\n players.push(player);\n }", "function playerEventChecker() {\n for (var i = 0; i < AMNTofPlayers; i++) {\n playerChecked.push(1);\n }\n for (var i = 0; i < AMNTofPlayers; i++) {\n var playerid = i;\n var playerAlive = playerAlive[playerid];\n if (cycle % 2 == 1) {\n if (Math.floor(Math.random() * 10) + gameSpeed >= 8) {\n violentDayEvent(playerid);\n } else {\n peacefulDayEvent(playerid);\n }\n } else {\n if (Math.floor(Math.random() * 10) + gameSpeed >= 8) {\n violentNightEvent(playerid);\n } else {\n peacefulNightEvent(playerid);\n }\n }\n }\n cycle++;\n}", "serverSidePlayerJoined (ev) {\n const plates = this.world.queryObjects({ instanceType: Plate })\n\n let joined = false\n\n plates.filter(p => p.playerId === 0).forEach(plate => {\n if (joined) {\n return\n }\n\n if (plate.playerId === 0) {\n plate.playerId = ev.playerId\n\n joined = true\n }\n })\n }", "sendPos()\n {\n for(const playerId in this.players)\n {\n const data = []\n const player = this.players[playerId]\n data.push({\n name: player.name,\n color: player.color,\n position: player.engineObject.position,\n musicInfo: player.musicInfo\n })\n for(const nearPlayer of player.getNearPlayers(300))\n {\n data.push({\n id: nearPlayer.id,\n name: nearPlayer.name,\n color: nearPlayer.color,\n position: nearPlayer.engineObject.position,\n musicInfo: nearPlayer.musicInfo,\n energy: nearPlayer.energy\n })\n }\n player.socket.emit('updatePlayer', data)\n }\n }", "newPlayer(data1) {\n\n\t\tlet TLC = thing;\n\n\t\tif (online == true) {\n\t\t\tlet RC = Random(255);\n\t\t\tlet player0 = {\n\t\t\t\ttype: 'player',\n\t\t\t\tpos: {\n\t\t\t\t\tx: TLC.pos.x + data1.x,\n\t\t\t\t\ty: TLC.pos.y + data1.y,\n\t\t\t\t},\n\t\t\t\tid: data1.id,\n\t\t\t\tcolor: 'red',\n\t\t\t\tdirection: 'UP',\n\t\t\t\tHP: 300,\n\t\t\t}\n\t\t\tlet player0BR = {\n\t\t\t\tname: 'BR',\n\t\t\t\ttype: 'player',\n\t\t\t\tpos: {\n\t\t\t\t\tx: TLC.pos.x + data1.x,\n\t\t\t\t\ty: TLC.pos.y + data1.y,\n\t\t\t\t},\n\t\t\t\tid: data1.id,\n\t\t\t\tcolor: 'red',\n\t\t\t}\n\t\t\tlet player0BL = {\n\t\t\t\tname: 'BL',\n\t\t\t\ttype: 'player',\n\t\t\t\tpos: {\n\t\t\t\t\tx: TLC.pos.x + data1.x - 1,\n\t\t\t\t\ty: TLC.pos.y + data1.y,\n\t\t\t\t},\n\t\t\t\tid: data1.id,\n\t\t\t\tcolor: 'red',\n\t\t\t}\n\t\t\tlet player0TR = {\n\t\t\t\tname: 'TR',\n\t\t\t\ttype: 'player',\n\t\t\t\tpos: {\n\t\t\t\t\tx: TLC.pos.x + data1.x,\n\t\t\t\t\ty: TLC.pos.y + data1.y - 1,\n\t\t\t\t},\n\t\t\t\tid: data1.id,\n\t\t\t\tcolor: 'red',\n\t\t\t}\n\t\t\tlet player0TL = {\n\t\t\t\tname: 'TL',\n\t\t\t\ttype: 'player',\n\t\t\t\tpos: {\n\t\t\t\t\tx: TLC.pos.x + data1.x - 1,\n\t\t\t\t\ty: TLC.pos.y + data1.y - 1,\n\t\t\t\t},\n\t\t\t\tid: data1.id,\n\t\t\t\tcolor: 'red',\n\t\t\t}\n\t\t\tplayerList.push(player0);\n\t\t\tentities.push(player0BR);\n\t\t\tentities.push(player0BL);\n\t\t\tentities.push(player0TR);\n\t\t\tentities.push(player0TL);\n\t\t}\n\t}", "allPlayers() {\n let client = this;\n this.socket.on('allplayers', function(data) {\n if (client.ID != null) {\n for (var i = 0; i < data.length; i++) {\n addNewPlayer(data[i].id, data[i].x, data[i].y);\n }\n client.move();\n }\n });\n }", "playersAdressed() {\n let senderID = parseFloat(this.transfer.senderID);\n let players = [];\n if (!isNaN(senderID)) {\n players = this.bank.players.filter(p => p.id !== senderID);\n }\n\n return players.sort((a, b) => a.name.localeCompare(b.name));\n }", "static setupPlayers (number) {\n\t\tfor(let i=0;i<number;i++) {\n\t\t\t// add players\n\t\t\tconst player = new this('player' + i);\n\t\t\t// set them to 'go'\n\t\t\tplayer.placeOnBoard(Board.go);\n\t\t\t// also add them player list\n\t\t\tBoard.addPlayer(player);\n\t\t}\n\t}", "function onNewPlayer(data)\n{\n playerList = data;\n\n console.log(data[0].id);\n \n for (i = 0; i < playerList.length; i++)\n {\n var existingPlayer = new Player(playerList[i].id, playerList[i].username, playerList[i].chips, playerList[i].index);\n if (existingPlayer.getUsername() != \"INVALID_USER\")\n {\n if (existingPlayer.getUsername() == currentPlayer.getUsername())\n {\n currentPlayer = existingPlayer;\n playerAmount(currentPlayer.getUsername(), currentPlayer.getChips());\n console.log(\"Found the current player. His username is \" + currentPlayer.getUsername() + \" and his tableIndex is \" + currentPlayer.getTableIndex());\n }\n currentPlayers[existingPlayer.getTableIndex()] = existingPlayer;\n }\n }\n\n console.log(currentPlayers);\n\n var localIndex;\n \n localIndex = currentPlayer.getTableIndex();\n console.log(\"The player tableIndex is: \" + currentPlayer.getTableIndex());\n var nextPlayerIndex;\n var nextPlayerIterator = 0;\n\n for (i = 0; i< maxPlayers - 1; i++)\n {\n\t// Increase the Iterator by one to indicate the next Player\n nextPlayerIterator++;\n\t// modulo with the current length of players\n nextPlayerIndex = (localIndex + nextPlayerIterator) % currentPlayers.length;\n\tconsole.log(\"The nextPlayerIndex is: \" + nextPlayerIndex);\n //console.log(currentPlayers)\n //console.log(currentPlayers[nextPlayerIndex].getUsername() != \"INVALID_USER\");\n if (currentPlayers[nextPlayerIndex].getUsername() != \"INVALID_USER\")\n {\n console.log(\"got thru\" + nextPlayerIndex + \" fdsfds\" + i);\n drawPlayerAt(nextPlayerIndex, i);\n }\n }\n \n numPlayers++;\n}", "function sendPlayers() {\r\n if (!SINGLE) {\r\n process.send({ type: \"players\", count: roomInstance.player_count });\r\n }\r\n}", "function ready(){\n\n var keys = getKeys( PEERS ),\n\n list = [],\n\n peer;\n\n list[ PLAYER.pos ] = PLAYER;\n\n for ( var i = 0, l = keys.length; i < l; i++ ) {\n\n peer = PEERS[ keys[i] ];\n\n list[ peer.pos ] = peer;\n }\n\n\n var entry = getKeys( TODO ).pop();\n\n if ( entry ) {\n\n var transport = TODO[ entry ];\n\n delete TODO[ entry ];\n\n CURRENT = null;\n\n return MANAGER.check( entry, transport );\n }\n\n /** sort + emit users in order & prevent multiple trigger **/\n order();\n\n for ( i = 0, l = list.length; i < l; i++ ) {\n\n setTimeout( invoke, DELAY, list[i] );\n }\n\n\n function invoke ( peer ) {\n\n if ( READY[ peer.id ] ) return;\n\n READY[ peer.id ] = true;\n\n WATCH.emit( 'connection' , peer );\n if ( ROOM ) ROOM.emit( 'enter', peer );\n }\n }", "getAllOtherPlayersList(allPlayers) {\n console.log(\"all players: \" + allPlayers);\n var output = [];\n allPlayers.forEach((player) => {\n if (player.Id != this.socket.id) {\n output.push(player);\n }\n });\n console.log(\"all other players: \" + output);\n return output;\n }", "playerUpdate() {\n this.players.forEach((player) => {\n let a = [];\n a = a.concat(this.currentquestion.a);\n a.push(this.currentquestion.correct);\n //TODO: shuffle a\n player.socket.emit('question', {\n q: this.currentquestion.q,\n a: shuffle(a)\n });\n });\n }", "function updatePlayers(listOfPlayers) {\n allPlayers = listOfPlayers;\n}", "set_listener_on_caract(list)\n\t{\n\t\tfor (var i in list.Player_Def.caract) {\n\t\t\tif (list.Player_Def.caract.hasOwnProperty(i)) {\n\t\t\t\tlet tmp = null;\n\n\t\t\t\ttmp = jQuery(\"#\" + i);\n\t\t\t\ttmp.data(\"owner\", i);\n\t\t\t\ttmp.on('change', () => {\n\t\t\t\t\tlist.Player.caract[tmp.data(\"owner\")] = -1 * (list.Player_Def.caract[tmp.data(\"owner\")] - $(\"#\" + tmp.data(\"owner\")).val());\n\t\t\t\t\tif (list.Player.caract[tmp.data(\"owner\")] == 0)\n\t\t\t\t\t\tlist.Player.caract[tmp.data(\"owner\")] = 0;\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}", "function getPlayers() {\n try {\n const sockets = {\n US: new WebSocket(\"wss://d0.drednot.io:4000\"),\n Poland: new WebSocket(\"wss://d1.drednot.io:4000\"),\n Test: new WebSocket(\"wss://t0.drednot.io:4000\"),\n Singapore: new WebSocket(\"wss://s2.drednot.io:4000\")\n };\n for(let i in sockets) {\n sockets[i].addEventListener(\"open\", (e) => {\n sockets[i].send(\"yo\");\n });\n sockets[i].addEventListener(\"message\", (e) => {\n cache.dredplayers[i] = JSON.parse(e.data);\n });\n sockets[i].onerror = (e) => {\n cachelog.error(e);\n }\n }\n } catch(err) {\n cachelog.critical(\"PLAYERCOUNT FAIL (Server offline)\");\n }\n}", "function addToPlayoffCount(){\n let inPlayoffs = [LEAGUE[6].playerName,LEAGUE[7].playerName, LEAGUE[8].playerName, LEAGUE[9].playerName];\n for (let i=0; i< PLAYOFFS.length; i++) \n { \n if (LEAGUE[6].playerName === PLAYOFFS[i].playerName) {\n PLAYOFFS[i].playoffCount += 1;\n } else \n if (LEAGUE[7].playerName === PLAYOFFS[i].playerName) {\n PLAYOFFS[i].playoffCount += 1;\n } else \n if (LEAGUE[8].playerName === PLAYOFFS[i].playerName) {\n PLAYOFFS[i].playoffCount += 1;\n } else \n if (LEAGUE[9].playerName === PLAYOFFS[i].playerName) {\n PLAYOFFS[i].playoffCount += 1;}\n } \n}", "function onNewplayer (data) {\r\n\r\n\tvar newPlayer = new Player(data.x, data.y,this,data);\r\n\t\r\n\t//create an instance of player body \r\n\t/*playerBody = new p2.Body ({\r\n\t\tmass: 0,\r\n\t\tposition: [0,0],\r\n\t\tfixedRotation: true\r\n\t});*/\r\n\t\r\n\tconsole.log(\"created new player with id \" + this.id);\r\n\tnewPlayer.id = this.id;\r\n\r\n\tthis.emit('create_player', {\r\n\t\tx:data.x,\r\n\t\ty:data.y,\r\n\t\thealth:newPlayer.health\r\n\t});\r\n\t\r\n\t//information to be sent to all clients except sender\r\n\tvar current_info = {\r\n\t\tid: newPlayer.id,\r\n\t\tx: newPlayer.position[0],\r\n\t\ty: newPlayer.position[1],\r\n\t\thealth:newPlayer.health\r\n\t}; \r\n\t\r\n\t//send to the new player about everyone who is already connected. \t\r\n\tfor (i = 0; i < player_lst.length; i++) {\r\n\t\texistingPlayer = player_lst[i];\r\n\t\tvar player_info = {\r\n\t\t\tid: existingPlayer.id,\r\n\t\t\tx: existingPlayer.position[0],\r\n\t\t\ty: existingPlayer.position[1],\r\n\t\t\thealth: existingPlayer.health\r\n\t\t};\r\n\t\tconsole.log(\"pushing other players \");\r\n\t\t//send message to the sender-client only\r\n\t\tthis.emit(\"new_enemyPlayer\", player_info);\r\n\t}\r\n\t\r\n\t//Tell the client to make foods that are exisiting\r\n\tfor (j = 0; j < game_instance.food_pickup.length; j++) {\r\n\t\tvar food_pick = game_instance.food_pickup[j];\r\n\t\tthis.emit('item_update', food_pick); \r\n\t}\r\n\r\n\t//send message to every connected client except the sender\r\n\tthis.broadcast.emit('new_enemyPlayer', current_info);\r\n\r\n\tconsumablesManager.updateAllConsumables(this);\r\n\t\r\n\tplayer_lst.push(newPlayer); \r\n}", "static sendQue(socket) {\n var playerNames = Player.updateNames()\n for(var i in Player.list){\n var socket = SOCKET_LIST[i];\n //socket.emit('Players', socket.name, playerNames)\n console.log(playerNames)\n socket.emit('Players', socket.name, playerNames)\n }\n }", "function getAllPlayers(data) {\n var room = io.sockets.adapter.rooms[data.gameId];\n var playersInRoom = [];\n\n for(var i = 0; i < players.length; i++) {\n if(room.sockets[players[i].socketId]==true) {\n playersInRoom.push(players[i]);\n }\n }\n var imgSubmitted;\n this.emit('playersInRoom', playersInRoom);\n this.broadcast.to(data.gameId).emit('newPlayerEntered', data);\n this.broadcast.to(data.gameId).emit('timerIs', data.timer);\n \n}", "getDisqualifiedPlayerIds() {}", "async onPlayerAdded(player) {}", "addPlayer(sock) {\n const socket = sock;\n\n // prevent adding the player twice\n if (socket.player.curRoom === this.hash) {\n return;\n }\n\n if (this.players.p1 === undefined) {\n this.players.p1 = socket;\n } else if (this.players.p2 === undefined) {\n this.players.p2 = socket;\n }\n\n socket.leave('lobby');\n socket.join(this.hash);\n socket.player.curRoom = this.hash;\n socket.player.reset();\n\n if (this.players.p1 !== undefined && this.players.p2 !== undefined) {\n this.state = 'preparing';\n this.setupTimer = 0;\n\n this.players.p1.emit('matchPreparing', new Message('matchPreparing', {\n maxTime: this.maxSetupTimer,\n p1: this.players.p1.player,\n p2: this.players.p2.player,\n }));\n\n this.players.p2.emit('matchPreparing', new Message('matchPreparing', {\n maxTime: this.maxSetupTimer,\n p1: this.players.p1.player,\n p2: this.players.p2.player,\n }));\n } else {\n socket.emit('matchWaiting', new Message('waitStart', new Date().getTime()));\n }\n }", "function connectWithNearbyPlayers() {\n const x = localPlayer.x;\n const y = localPlayer.y;\n\n for (let id in players) {\n const px = positions[id].x\n const py = positions[id].y\n\n if (abs(x - px) < 50 && abs(y - py) < 50 ) {\n if (videos[id].paused) {\n videos[id].play();\n videoGrid.append(videos[id]);\n }\n } else if (!videos[id].paused) {\n videos[id].pause();\n videos[id].remove();\n }\n }\n}", "function Room(number, is_channel) {\n\n this.users = {}; //holds User objects, index is sess id\n //this.events = new Array(); //holds Event objects\n\n this.is_channel = (is_channel === true);\n if(this.is_channel) {\n this.id = number;\n this.channel_info = CHANNELS[this.id];\n this.title = this.channel_info.title;\n this.video_queue = [];\n this.video_queue_index = 0;\n this.curr_fetch_i = 0; //current index on the fetch param\n this.curr_fetch_num = 0; //current number of videos fetched from this source\n this.channel_ready = false;\n this.channel_next_timeout_id = null;\n this.queue_skipped_videos = 0; //number of videos that arent embeddable\n } else {\n taken_rooms[number] = true;\n this.number = number;\n this.id = room_num2id(number);\n this.title = \"\";\n }\n this.num_users = 0;\n this.user_with_remote = -1; //sess id of user with the remote\n this.last_event_time = gettime(); //the last time a user has done anything to this room\n this.event_buffer = [];\n\n //video information\n this.video = null;\n this.video_start_time = 0; //time when video was started since beginning of play, or since it was last paused\n this.video_title = \"\";\n this.video_duration = -1;\n this.video_prev_elapsed_time = 0; //time the video has played since it was paused\n this.video_paused = false;\n\n this.client_info_interval_id = setInterval(this.client_info_func, ROOM_CLIENT_INFO_INTERVAL, this);\n\n if(this.is_channel)\n this.channel_init();\n}", "function setOpponents() {\n\n // get the count of users waiting\n var users_waiting = getUsersWaiting();\n // if number of users waiting for game >= 2 then assign the game\n if (users_waiting >= 2) {\n\n var max_two = 1;\n for (var socket_id in users_pool) {\n\n if (users_pool[socket_id] == 0) {\n\n users_pool[socket_id] = 1;\n if (max_two == 1) {\n\n var user_1 = socket_id;\n } else if (max_two == 2) {\n\n var user_2 = socket_id;\n break;\n }\n\n max_two++;\n }\n }\n\n // assign users to each other. TODO : refactor\n user_games[user_1] = user_2;\n user_games[user_2] = user_1;\n }\n\n // if client's socket id found in user_games then user has been\n // assigned with opponent and game can be started.\n if (user_games[socket.id]) {\n\n var from = socket.id;\n var to = user_games[socket.id];\n var start_data = {\n 'turn': 0,\n 'sign': 'X', // cross\n 'masterBit': 1\n };\n io.sockets.socket(to).emit('start_game_data', start_data);\n start_data['turn'] = 1;\n start_data['sign'] = '0'; // zero\n start_data['masterBit'] = 0;\n io.sockets.socket(from).emit('start_game_data', start_data);\n // run the timer as soon as opponents are connected\n timer();\n }\n\n }", "function updateRoomPlayersList(room) {\n _room.in(room.id).emit('update-player-list', room);\n}", "function PlayerDaemon() {\n\tvar pub = {}; \n\tfunction getPlayer(obj) {\n\t\tvar id = obj.id;\n\t\tvar max = PlayerList.length;\n\t\tfor(var i=0; i< max; i++) {\n\t\t\tif(PlayerList[i].id == id) {\n\t\t\t\treturn(PlayerList[i]);\n\t\t\t}\n\t\t}\n\t}\n\tpub.init = function(obj) {\n\t\tgetPlayer(obj).init();\n\t}\n\tpub.cue = function(obj) {\n\t\tgetPlayer(obj).cue();\n\t}\n\tpub.play = function(obj) {\n\t\tvar player = getPlayer(obj);\n\t\tplayer.play();\n\t}\n\tpub.pause = function(obj) {\n\t\tgetPlayer(obj).pause();\n\t}\n\tpub.stop = function(obj) {\n\t\tgetPlayer(obj).stop();\n\t}\n\tpub.seek = function(obj, seconds) {\n\t\tgetPlayer(obj).seek(seconds);\n\t}\n\tpub.mute = function(obj) {\n\t\tgetPlayer(obj).mute();\n\t}\n\tpub.setTime = function(obj) {\n\t\tgetPlayer(obj).setTime(obj);\n\t}\n\t\n\tpub.volUp = function(obj) {\n\t\tgetPlayer(obj).volUp(obj);\n\t}\n\tpub.volDown = function(obj) {\n\t\tgetPlayer(obj).volDown(obj);\n\t}\n\tpub.setState = function(obj) {\n\t\tgetPlayer(obj).setState(obj);\n\t}\n\t//convert YouTubes state response into an object before sending it on to the player\n\tpub.setYTState = function(state, playerId) {\n\t\tvar obj = {};\n\t\tobj.id = playerId;\n\t\tswitch(state) {\n\t\tcase -1: //unstarted\n\t\t\tobj.newstate = \"IDLE\";\n\t\t\tbreak;\n\t\tcase 0: //ended\n\t\t\tobj.newstate = \"COMPLETED\";\n\t\t\tbreak;\n\t\tcase 1: //playing\n\t\t\tobj.newstate = \"PLAYING\";\n\t\t\tbreak;\n\t\tcase 2: //paused\n\t\t\tobj.newstate = \"PAUSED\";\n\t\t\tbreak;\n\t\tcase 3: //buffering\n\t\t\tobj.newstate = \"BUFFERING\";\n\t\t\tbreak;\n\t\tcase 5: //video cued\n\t\t\tobj.newstate = \"IDLE\";\n\t\t\tbreak;\n\t\t}\n\t\tpub.setState(obj);\n\t}\n\tpub.getCurrentTime = function(obj) {\n\t\treturn getPlayer(obj).getCurrentTime();\n\t}\n\tpub.getDuration = function(obj) {\n\t\treturn getPlayer(obj).getDuration();\n\t}\n\tpub.setBytes = function(obj) {\n\t\tgetPlayer(obj).setBytes(obj);\n\t}\n\tpub.getBytesLoaded = function(obj) {\n\t\treturn getPlayer(obj).getBytesLoaded();\n\t}\n\tpub.getBytesTotal = function(obj) {\n\t\treturn getPlayer(obj).getBytesTotal(obj);\n\t}\n\treturn pub;\n}", "function setEvents(arrayin) {\r\n\r\n console.log('setEvents');\r\n\r\n\r\n window.player = document.getElementById('player_select').value;\r\n console.log(window.player);\r\n\r\n console.log(window.runningBoard[from]);\r\n\r\n [ '01','02','03','04','05','06','07','08',\r\n '09','10','11','12','13','14','15','16',\r\n '17','18','19','20','21','22','23','24',\r\n 'b1','b2','k1','k2'].forEach(setEventsFunction);\r\n\r\n \r\n// console.log(document.getElementById('from').innerText )\r\n // document.player has the currently selected \r\n // player. Positive is black, negative is white \r\n // \r\n\r\n console.log('player :',window.player,' from:',\r\n document.getElementById('from').innerText) ;\r\n\r\n}", "everyoneDraws(gameID) {\n let players = Array.from(Connection.all.values())\n for (let player of players) {\n if (player.gameID == gameID) {\n let card = new Card(player);\n let message = { op: \"draw\" , player: {name: player.name}, card, gameID}\n this.addToMoveListAndBroadcast(message, gameID) \n }\n }\n }", "function emitPlayersAlreadyInRoom(request, player)\n {\n var gamers = [];\n for (var index in all_players_list)\n {\n if (all_players_list[index] && (all_players_list[index].diff_lvl == player.diff_lvl))\n {\n gamers.push( { player_tag: all_players_list[index].player_tag, points: all_players_list[index].points } );\n }\n }\n request.io.emit('gamers_already_in_room', {leaders: gamers} );\n console.log('EMIT (' + player.player_tag + '): gamers_already_in_room'); \n }", "function onNewPlayer (data) {\n \n}", "function sendLobbyPlayerlistUpdate() {\n if (!g_IsController || !Engine.HasXmppClient()) return;\n\n // Extract the relevant player data and minimize packet load\n let minPlayerData = [];\n for (let playerID in g_GameAttributes.settings.PlayerData) {\n if (+playerID == 0) continue;\n\n let pData = g_GameAttributes.settings.PlayerData[playerID];\n\n let minPData = { Name: pData.Name, Civ: pData.Civ };\n\n if (g_GameAttributes.settings.LockTeams) minPData.Team = pData.Team;\n\n if (pData.AI) {\n minPData.AI = pData.AI;\n minPData.AIDiff = pData.AIDiff;\n minPData.AIBehavior = pData.AIBehavior;\n }\n\n if (g_Players[playerID].offline) minPData.Offline = true;\n\n // Whether the player has won or was defeated\n let state = g_Players[playerID].state;\n if (state != \"active\") minPData.State = state;\n\n minPlayerData.push(minPData);\n }\n\n // Add observers\n let connectedPlayers = 0;\n for (let guid in g_PlayerAssignments) {\n let pData =\n g_GameAttributes.settings.PlayerData[g_PlayerAssignments[guid].player];\n\n if (pData) ++connectedPlayers;\n else\n minPlayerData.push({\n Name: g_PlayerAssignments[guid].name,\n Team: \"observer\"\n });\n }\n\n Engine.SendChangeStateGame(\n connectedPlayers,\n playerDataToStringifiedTeamList(minPlayerData)\n );\n}", "updatePlayersList(players) {\n if (players.length > 0) {\n const updatedPlayersList = [];\n players.forEach(player => {\n updatedPlayersList.push(player);\n });\n this.PLAYERS_LIST = updatedPlayersList;\n } else {\n this.PLAYERS_LIST = null;\n }\n }", "function loadPlayerList() {\n playerArray.forEach(addPlayerToUIList);\n }", "onReady(socket, lobbyId, playerName) {\r\n // Controls used for the lobby chatting\r\n const chatContainer = document.getElementById(\"lobby-chat-container\");\r\n const chatInput = document.getElementById(\"lobby-chat-input\");\r\n const postButton = document.getElementById(\"lobby-chat-submit\");\r\n\r\n // Elements used to display users in lobby and\r\n // the participant list\r\n const userList = document.getElementById(\"user-list\");\r\n const participantListContainer = document.getElementById(\"lobby-participant-list\");\r\n\r\n // Controls to control starting and advancing the Lip Sync performance\r\n const startPerformanceButton = document.getElementById(\"start-performance-button\");\r\n const nextPerformerButton = document.getElementById(\"next-performer-button\");\r\n const nowPerformingDisplay = document.getElementById(\"now-performing-display\");\r\n\r\n // Hidden input for the lobby id in the register team form\r\n let lobbyIdInput = document.getElementById(\"hidden-lobby-id\");\r\n lobbyIdInput.value = lobbyId;\r\n\r\n let lobbyChannel = socket.channel(`lobby:${lobbyId}`, () => {\r\n return playerName \r\n ? {username: playerName}\r\n : {username: \"anon\" + Math.floor(Math.random() * 1000)};\r\n });\r\n\r\n let presence = new Presence(lobbyChannel);\r\n\r\n presence.onSync(() => {\r\n userList.innerHTML = presence.list((id, metas) => {\r\n return `<li>${this.esc(id)}</li>`;\r\n }).join(\"\");\r\n });\r\n \r\n // Send chat message to the server.\r\n postButton.addEventListener(\"click\", e => {\r\n let payload = {message: chatInput.value};\r\n lobbyChannel.push(\"new_msg\", payload)\r\n .receive(\"error\", e => e.console.log(e));\r\n chatInput.value = \"\";\r\n });\r\n\r\n // Test to send a new video ID for the player and update it\r\n lobbyChannel.on(\"update_video\", (resp) => {\r\n if (Player.player != null) {\r\n Player.player.loadVideoById(resp.new_id);\r\n nowPerformingDisplay.value = resp.team_name;\r\n }\r\n });\r\n\r\n // Start the Lip Sync performance\r\n startPerformanceButton.addEventListener(\"click\", e => {\r\n lobbyChannel.push(\"start_performance\", {})\r\n .receive(\"error\", e => e.console.log(e));\r\n\r\n startPerformanceButton.setAttribute(\"disabled\", \"disabled\");\r\n });\r\n\r\n // Advance the Lip Sync queue to the next performing team\r\n nextPerformerButton.addEventListener(\"click\", e => {\r\n lobbyChannel.push(\"next_performer\", {})\r\n .receive(\"error\", e => e.console.log(e));\r\n });\r\n\r\n // Receive and render a new chat message.\r\n lobbyChannel.on(\"new_msg\", (resp) => {\r\n this.renderAnnotation(chatContainer, resp);\r\n });\r\n\r\n // Receive updated list of Lip Sync participants\r\n lobbyChannel.on(\"participant_list\", (resp) => {\r\n this.renderParticipantList(participantListContainer, resp);\r\n });\r\n\r\n // Receive update that the performance ended\r\n lobbyChannel.on(\"performance_end\", (resp) => {\r\n startPerformanceButton.removeAttribute(\"disabled\");\r\n });\r\n\r\n // Join the lobby chat channel.\r\n lobbyChannel.join()\r\n .receive(\"ok\", () => {\r\n return;\r\n })\r\n .receive(\"error\", reason => console.log(\"join failed\", reason));\r\n }", "_updatePlayerList (players) {\n // add all new players, including host, to playersData\n Object.keys(players).forEach(playerId => {\n if (!this.playersData[playerId]) {\n players[playerId].name = playerId;\n players[playerId].color = this.playerColorCodes.shift();\n\n let playerDetails = new Player(players[playerId]);\n this.playersData[playerId] = playerDetails;\n\n this.uiService.updatePlayerList(playerDetails);\n }\n });\n }", "function Werewolf(position,game){\n var werewolves = game.players.filter(card=>card.action == Werewolf);\n if(werewolves.length > 1){\n var where = [];\n for(var ww of werewolves){\n if(game.players.indexOf(ww) == position)continue;\n where.push(game.players.indexOf(ww));\n }\n return [game.play({position,action:\"show\",players:where})];\n }\n return [1,2,3].map(i=>game.play({position,action:\"show\",discard:[i]},1/3));\n}", "static giveAPlayerATurn() {\n for (let i = 0; i < this.players.length; i++) {\n if (!this.hasPlayerHadTurn(i)) {\n this.playTurn(i);\n return;\n }\n }\n }", "who(currentPlayer, channel){\n let map = this.maps[currentPlayer.position]\n let nearbyPlayers = new Array()\n this.players.forEach(player => {\n if(player !== currentPlayer && player.position === currentPlayer.position){\n nearbyPlayers.push(player)\n }\n })\n return nearbyPlayers\n }", "StunPlayer(time){\nthis.player.getStunned(time);\n }", "function determineStartingPlayer()\n{\n // @TODO: Random laten bepalen welke speler aan de beurt is of mag beginnen\n \n}", "static updateNames() {\n var playerNames = [];\n for (var i in Player.list) {\n playerNames.push(SOCKET_LIST[i].name);\n }\n ;\n return playerNames;\n }", "subscriberNewPlayer(EventName, data){\n this.setState((prevState)=> ({\n players: prevState.players.concat(data),\n currentPlayer : data\n }))\n }", "function connectPlayerOther(data) {\n let player = components.PlayerRemote();\n player.initialize(data);\n playerOthers[data.clientId] = player;\n activePlayerCount++;\n }", "function onNewPlayer(data) {\n // Create a new player\n //var newPlayer = new Player(data.x, data.y);\n //newPlayer.id = this.id;\n\n // Broadcast new player to connected socket clients\n this.broadcast.to(data.roomId).emit(\"new player\", data.gameData);\n\n // send existing player to new player\n if (socket.sockets.clients(data.roomId).length == 2)\n this.emit(\"new player\", {gameData: players[socket.sockets.clients(data.roomId)[1].id]});\n\n // console.log(\"Hello. New player connected: \"+data.id);\n // urlString = \"battle.html?id=\" + data.id;\n //document.getElementById(\"linkPlaceholder\").innerHTML = \"Invite your friend to <a href=\" +urlString + \">\" + urlString\n // + \"</a>\";\n //rooms[this.id] = new Room(this.id);\n //this.emit(\"new room\", {id: this.id});\n // Send existing players to the new player\n /* var i, existingPlayer;\n /for (i = 0; i < players.length; i++) {\n existingPlayer = players[i];\n this.emit(\"new player\", {id: existingPlayer.id, x: existingPlayer.getX(), y: existingPlayer.getY()});\n };*/\n\n // Add new player to the players array\n players[this.id] = data.gameData;\n}", "addFolded(player) {\n this.folded.push(player);\n }", "update() {\n for (var i in Player.list) {\n this.takenByEnemy(Player.list[i]);\n }\n }", "async fillSportListAndTick() {\n this.sport_list = await League.find({ isActive: true });\n this.tick();\n this.ctr = this.ctr + 1;\n }", "function matchUp() {\n if(searching.length > 1){\n var p2 = searching.pop();\n var p1 = searching.pop()\nmatched[p1.playerID] = makeStartState(p2.playerID,true)\nmatched[p2.playerID] = makeStartState(p1.playerID,false)\n p1.tosend.send({ \n \"playerID\": p1.playerID,\n \"oppID\": p2.playerID,\n \"youFirst\": true,\n \"success\": true,\n \"levelIndex\": randomIndex\n })\n p2.tosend.send({ \n \"playerID\": p2.playerID,\n \"oppID\": p1.playerID,\n \"youFirst\": false,\n \"success\": true,\n \"levelIndex\": randomIndex\n })\n}\n }", "function _gameStartedCallback() {\n\t // 2. get peerIds from the smart-contract\n\t \n\t // 3. establish the connection with each peerId and subscribe for events\n\n\t function _getPeerRandomNumberCallback() {\n\t\t\n\t\t// save result\n\t\t// if all peers have provided a number:\n\t\t// calculate result and define the winner\n\t\t// \n\t }\t \n\t}", "function loadPlayerList() {\n Player_v.all({order: 'id'}, function(err, results) {\n var players = [];\n var player = {};\n player.player_name = 'Not Selected';\n player.id = \"\";\n players[0] = player;\n\n if(results.length > 0) {\n for (var i = 0; i < results.length; i++) {\n // create a brand new instance of player object for every record. One cannot reuse the same player variable.\n var player = { player_name: results[i].first_name + \" \" + results[i].last_name + \"-\" + results[i].city + \"/\" + results[i].state_or_province,\n id: results[i].id};\n players.push(player);\n }\n } // end of if.\n\n this.player_list = players;\n\n next(); // process the next tick.\n }.bind(this));\n}", "function searchForPlayers() {\n searchingForGame = true;\n views.setSeachingPlayers();\n socket.emit('lookingForGame', authId);\n console.log(\"waiting for game \" + authId)\n socket.on('startMatch', (otherId) => {\n startMultiPlayer(otherId);\n });\n}", "function ProcessPlayer() {\n\n}", "playerLeft(departedPlayerClientId) {\n // Adapted from Stack Overflow: https://stackoverflow.com/questions/4755005/how-to-get-the-index-of-an-object-inside-an-array-of-objects\n // Finds the index of the player object in the players array, based on the clientId inside it.\n function getIndex(playersArray, clientId) {\n const index = playersArray.map(function(e) { return e.clientId; }).indexOf(clientId);\n return index;\n }\n\n this.players.splice(getIndex(this.players, departedPlayerClientId), 1);\n this.broadcastScoreboard();\n }", "function playerById(socketid) {\r\n var remotePlayers = main.session.getRemotePlayers();\r\n for (var i = 0; i < remotePlayers.length; i++) {\r\n if (remotePlayers[i].getSocketID() == socketid)\r\n // HACKY SOLUTION RETURN LASERS HERE\r\n return {players:remotePlayers[i],roomID: main.session.getRoomID(), lasers: [0,0]};\r\n }\r\n\r\n\r\n return false;\r\n}", "onPlayerAdded(playerName, instanceName) {\n if (this.instances[instanceName] === undefined) {\n return;\n }\n this.instances[instanceName].currentlyPlaying += 1;\n }", "setupLives() {\n if (!this.lives) {\n this.lives = [];\n }\n\n while (this.lives.filter(e => !!e).length < PLAYER_LIVES) {\n //console.log();\n this.addLives();\n }\n }", "function playerswitch() {}", "function onNewplayer (data) {\r\n\tconsole.log(data);\r\n\t//new player instance\r\n\tvar newPlayer = new Player(data.x, data.y, data.angle);\r\n\t\r\n\t//create an instance of player body \r\n\tnewPlayer.body = new p2.Body ({\r\n\t\tmass: 0,\r\n\t\tposition: [0,0],\r\n\t\tfixedRotation: true\r\n\t});\r\n\tworld.addBody(newPlayer.body);\r\n\t\r\n\tconsole.log(\"created new player with id \" + this.id);\r\n\tnewPlayer.id = this.id; \t\r\n\t//information to be sent to all clients except sender\r\n\tvar current_info = {\r\n\t\tid: newPlayer.id, \r\n\t\tx: newPlayer.x,\r\n\t\ty: newPlayer.y,\r\n\t\tangle: newPlayer.angle,\r\n\t}; \r\n\t\r\n\t//send to the new player about everyone who is already connected. \t\r\n\tfor (i = 0; i < player_lst.length; i++) {\r\n\t\texistingPlayer = player_lst[i];\r\n\t\tvar player_info = {\r\n\t\t\tid: existingPlayer.id,\r\n\t\t\tx: existingPlayer.x,\r\n\t\t\ty: existingPlayer.y, \r\n\t\t\tangle: existingPlayer.angle,\t\t\t\r\n\t\t};\r\n\t\tconsole.log(\"pushing player\");\r\n\t\t//send message to the sender-client only\r\n\t\tthis.emit(\"new_enemyPlayer\", player_info);\r\n\t}\r\n\t\r\n\t//send message to every connected client except the sender\r\n\tthis.broadcast.emit('new_enemyPlayer', current_info);\r\n\t\r\n\r\n\tplayer_lst.push(newPlayer); \r\n}", "start(playerOneName, playerTwoName) {\n this.players.push(new Player(playerOneName));\n this.players.push(new Player(playerTwoName));\n let d = new Deck();\n d.createDeck();\n d.shuffleDeck(); \n this.players[0].playerCards = d.cards.splice(0, 2);\n this.players[1].playerCards = d.cards.splice(0, 2);\n this.cardsInMiddle = d;\n this.players[0].playerChips = 2;\n this.players[1].playerChips = 2;\n }", "set_listener_on_stat(list)\n\t{\n\t\tfor (var i in list.Player_Def.stat) {\n\t\t\tif (list.Player_Def.stat.hasOwnProperty(i)) {\n\t\t\t\tlet tmp = null;\n\n\t\t\t\ttmp = jQuery(\"#\" + i);\n\t\t\t\ttmp.data(\"owner\", i);\n\t\t\t\ttmp.on('change', () => {\n\t\t\t\t\tlist.Player.stat[tmp.data(\"owner\")] = -1 * (list.Player_Def.stat[tmp.data(\"owner\")] - $(\"#\" + tmp.data(\"owner\")).val());\n\t\t\t\t\tif (list.Player.stat[tmp.data(\"owner\")] == 0)\n\t\t\t\t\t\tlist.Player.stat[tmp.data(\"owner\")] = 0;\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}", "function playerHandler(payload) {\n var musician = JSON.parse(payload)\n console.log(\"handling : \"+ payload);\n \n var foundMusician = activePlayer.find(function (x) {\n // si on a trouvé on update le timestamp dans la deuxieme condition\n return x.uuid == musician.uuid && updateTimeStamp(x);\n });\n \n if(typeof foundMusician === 'undefined') {\n // il est pas encore dans le tableau\n musician.timestamp = moment();\n musician.activeSince = musician.timestamp;\n musician.instrument = instruments.get(musician.sound)\n activePlayer.push(musician);\n } \n}", "getPlayersPIDs() {\n\t\treturn this.lobbyPlayers.map(player => player.pid);\n\t}", "onEvent(type){\n if(type === \"Reset\"){\n this.added = false;\n }\n if(type === \"Entity Added\" && !this.added){\n this.added = true;\n for(let playerId in this.players){\n let player = this.players[playerId];\n this.world.addEntity(player);\n }\n }\n }", "function NextPlayer(socket){\n\tsocket.PlayerActive = 0;\n\t\t\tsocket.KaufButton = 0;\n\t\t\tif(BenutzerReihenFolgeMax.length == SpielerAnzahl){\n\t\t\t\tdelete BenutzerReihenFolgeMax; // array ausgabe ist falsch\n\t\t\t\tBenutzerReihenFolgeMax = [];\n\t\t\t}\n\t\t\tio.sockets.emit('ServerMessege', 'Spieler '+socket.nickname+' beendet seinen Zug.');\n\t\t\t\t\t\t//Wirf den ersten Spieler in ein neuen Array\n\t\t\tBenutzerReihenFolge.push(socket.nickname);\n\t\t\t//Durchsuche das array nach den Spielern\n\t\t\tconsole.log(BenutzerReihenFolge.indexOf(Spieler1));\n\t\t\t\tif(BenutzerReihenFolge.indexOf(Spieler1) == -1){\n\t\t\t\t\tOnlineUsers[Spieler1].PlayerActive = 1;\n\t\t\t\t\tOnlineUsers[Spieler1].WuerfelAnzahl = 1;\n\t\t\t\t\tvar AktiverSpieler = Spieler1;\n\t\t\t\t\tif(BenutzerReihenFolgeMax.length < SpielerAnzahl){\n\t\t\t\t\t\tBenutzerReihenFolgeMax.push(Spieler1);\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}else if(BenutzerReihenFolge.indexOf(Spieler2) == -1){\n\t\t\t\t\tOnlineUsers[Spieler2].PlayerActive = 1;\n\t\t\t\t\tOnlineUsers[Spieler2].WuerfelAnzahl = 1;\n\t\t\t\t\tvar AktiverSpieler = Spieler2;\n\t\t\t\t\tif(BenutzerReihenFolgeMax.length < SpielerAnzahl){\n\t\t\t\t\t\tBenutzerReihenFolgeMax.push(Spieler2);\n\t\t\t\t\t}\n\t\t\t\t}//erweitern falls mehr spieler dazu kommen, maybe noch for schleife\n\t\t\t//Wenn Max Spiler Anzahl erreicht ist setze array zurück\n\t\t\tvar Umrechnung = BenutzerReihenFolge.length + 1;\n\t\t\t\tconsole.log(Umrechnung + \" Array Anzahl 1 or 2\");\n\t\t\t\tconsole.log(SpielerAnzahl + \" SpielerAnzahl\");\n\t\t\tif(Umrechnung >= SpielerAnzahl){\n\t\t\t\tdelete BenutzerReihenFolge;\n\t\t\t\tBenutzerReihenFolge = [];\n\t\t\t}\n\t\t\t\t\n\t\t\t//Meldung ausgeben\n\t\t\tio.sockets.emit('ServerMessege' , 'Der Spieler '+ AktiverSpieler +' ist an der Reihe.');\n\t\t\tconsole.log(SpielerAnzahl);\n\t}", "addToMoveListAndBroadcast(move, gameID) {\n let moves = Connection.games.get(gameID)\n move.id = moves.length + 1\n this.broadcast(move, gameID)\n moves.push(move) \n }", "function Tournament(json) {\r\n\r\n this.tournament = JSON.parse(json);\r\n this.name = this.tournament.tournament.name;\r\n this.year = this.tournament.tournament.year;\r\n this.award = this.tournament.tournament.award;\r\n this.yardage = this.tournament.tournament.yardage; \r\n this.par = this.tournament.tournament.par;\r\n this.round = this.tournament.tournament.round;\r\n this.play = [];\r\n \r\n for(var i=0; i<this.tournament.tournament.players.length; i++){\r\n var ep = new Players(this.tournament.tournament.players[i].lastname,this.tournament.tournament.players[i].firstinitial, this.tournament.tournament.players[i].score, this.tournament.tournament.players[i].hole);\r\n this.play[i] = ep;\r\n }\r\n \r\n var ref = this;\r\n // Setting the Event listener\r\n mevents.on(\"up_score\", function(){\r\n\r\n var isFinished = ref.play.every(player => player.hole ==\"finished\");\r\n\r\n if(isFinished){\r\n // For Fourth(final) round\r\n if(ref.round == 4){\r\n var tournw = new Tournament('{\"tournament\":' + ref.leaderboard()+'}');\r\n ref.getWinner = function(){\r\n return ref.winner.lastname; \r\n }\r\n var position = 1;\r\n tournw.play.forEach(function (p2) {\r\n var winner = ref.play.find(function (p1) {\r\n if(p1.lastname == p2.lastname && p1.firstinitial == p2.firstinitial)\r\n return true;\r\n else\r\n return false; \r\n });\r\n if(position == 1){\r\n ref.winner = winner;\r\n winner.winnings = ref.award * 0.5;\r\n }\r\n else if(position == 2){\r\n winner.winnings = ref.award * 0.3;\r\n }\r\n else if(position == 3){\r\n winner.winnings = ref.award * 0.2;\r\n }\r\n else\r\n return;\r\n position += 1;\r\n });\r\n }\r\n // For Rounds one t(w)o three\r\n else{\r\n ref.play.forEach(function (p) {\r\n p.hole = 0;\r\n })\r\n ref.round += 1; \r\n } \r\n }\r\n });\r\n}", "function update() {\n for(var i=0;i<bullet_array.length;i++) {\n var bullet = bullet_array[i];\n bullet.x += bullet.speed_x;\n bullet.y += bullet.speed_y;\n\n // Check if this bullet is close enough to hit any player\n for(var id in players) {\n if(bullet.owner_id != id) {\n // And your own bullet shouldn't kill you\n var dx = players[id].x - bullet.x;\n var dy = players[id].y - bullet.y;\n var dist = Math.sqrt(dx * dx + dy * dy);\n\n if(dist < 70) {\n // x: Math.floor(Math.random() * 700) + 50,\n // y: Math.floor(Math.random() * 500) + 50,\n // io.emit('disconnect',id);\n io.emit('player-hit',id); // Tell everyone this player got hit\n players[id].x = Math.floor(Math.random() * config.phaser.width);\n players[id].y = Math.floor(Math.random() * config.phaser.height);\n io.emit('update_players_shot', players,bullet.owner_id,id);\n\n // io.broadcast.emit('playerMoved', players[id]);\n io.emit('playerMoved', players[id]);\n // io.emit('currentPlayers', players);\n\n // socket.emit('currentPlayers', players);\n // io.broadcast.emit('newPlayer', players[socket.id]);\n updateKD(players[bullet.owner_id].username, players[id].username,bullet.owner_id,id);\n }\n }\n }\n // Remove if it goes too far off screen\n if(bullet.x < -10 || bullet.x > 1000 || bullet.y < -10 || bullet.y > 1000) {\n bullet_array.splice(i,1);\n i--;\n }\n }\n // Tell everyone where all the bullets are by sending the whole array\n io.emit(\"bullets-update\",bullet_array);\n}", "function getListPlayer(listUsers){\r\n dbPlayer = listUsers;\r\n}", "function fillListPlayers(){\n\t\tlistPlayers.push(playerOne);\n\t\tlistPlayers.push(playerTwo);\n\t}", "newMove(data) {\n\t\tlet found = false;\n\n\t\tlet TLC = thing;\n\n\t\tfunction moveP(element, data) {\n\t\t\tif (data.xy == 'x') {\n\t\t\t\tif (data.PM == 'P') {\n\t\t\t\t\telement.pos.x++;\n\t\t\t\t} else if (data.PM == 'M') {\n\t\t\t\t\telement.pos.x--;\n\t\t\t\t}\n\t\t\t} else if (data.xy == 'y') {\n\t\t\t\tif (data.PM == 'P') {\n\t\t\t\t\telement.pos.y++;\n\t\t\t\t} else if (data.PM == 'M') {\n\t\t\t\t\telement.pos.y--;\n\t\t\t\t}\n\t\t\t} else if (data.xy == undefined) {\n\t\t\t\telement.pos.x = element.pos.x;\n\t\t\t\telement.pos.y = element.pos.y;\n\t\t\t}\n\t\t\t//console.log(element);\n\t\t}\n\n\t\t//checks playerList for the id of incoming player data\n\t\tplayerList.forEach(function(ele) {\n\t\t\tif (ele.id == data.id) {\n\t\t\t\tentities.forEach(function(element) {\n\t\t\t\t\tif (element.id == data.id) {\n\t\t\t\t\t\tmoveP(element, data);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tfound = true;\n\t\t\t\tmoveP(ele, data);\n\t\t\t\tele.direction = data.direction;\n\t\t\t}\n\t\t\tif (ele.id == undefined) {\n\t\t\t\tplayerList = ArrayRemove(playerList, ele);\n\t\t\t}\n\t\t});\n\n\t\t//if no player with the id is found then it creates one\n\t\tif (found == false) {\n\t\t\t//console.log(`socket ${data.id} not found`);\n\t\t\t//console.log(`adding ${data.id} to player list`);\n\t\t\tlet player1 = {\n\t\t\t\ttype: 'player',\n\t\t\t\tpos: {\n\t\t\t\t\tx: TLC.pos.x + data.x,\n\t\t\t\t\ty: TLC.pos.y + data.y,\n\t\t\t\t},\n\t\t\t\tid: data.id,\n\t\t\t\tcolor: 'red',\n\t\t\t\tHP: 300,\n\t\t\t}\n\t\t\tlet player1BR = {\n\t\t\t\tname: 'BR',\n\t\t\t\ttype: 'player',\n\t\t\t\tpos: {\n\t\t\t\t\tx: TLC.pos.x + data.x,\n\t\t\t\t\ty: TLC.pos.y + data.y,\n\t\t\t\t},\n\t\t\t\tid: data.id,\n\t\t\t\tcolor: 'red',\n\t\t\t}\n\t\t\tlet player1BL = {\n\t\t\t\tname: 'BL',\n\t\t\t\ttype: 'player',\n\t\t\t\tpos: {\n\t\t\t\t\tx: TLC.pos.x + data.x - 1,\n\t\t\t\t\ty: TLC.pos.y + data.y,\n\t\t\t\t},\n\t\t\t\tid: data.id,\n\t\t\t\tcolor: 'red',\n\t\t\t}\n\t\t\tlet player1TR = {\n\t\t\t\tname: 'TR',\n\t\t\t\ttype: 'player',\n\t\t\t\tpos: {\n\t\t\t\t\tx: TLC.pos.x + data.x,\n\t\t\t\t\ty: TLC.pos.y + data.y - 1,\n\t\t\t\t},\n\t\t\t\tid: data.id,\n\t\t\t\tcolor: 'red',\n\t\t\t}\n\t\t\tlet player1TL = {\n\t\t\t\tname: 'TL',\n\t\t\t\ttype: 'player',\n\t\t\t\tpos: {\n\t\t\t\t\tx: TLC.pos.x + data.x - 1,\n\t\t\t\t\ty: TLC.pos.y + data.y - 1,\n\t\t\t\t},\n\t\t\t\tid: data.id,\n\t\t\t\tcolor: 'red',\n\t\t\t}\n\t\t\tplayerList.push(player1);\n\t\t\tentities.push(player1BR);\n\t\t\tentities.push(player1BL);\n\t\t\tentities.push(player1TR);\n\t\t\tentities.push(player1TL);\n\t\t\t//console.log(playerList);\n\t\t}\n\t}", "function pingClients() {\n\tvar length = players.length;\n\tfor(var i = 0; i < length; i++) {\n\t\tif (players[i].id) {\n\t\t\tpings[players[i].id] = { time: Date.now(), ping: 0 };\n\t\t\t//console.log('Ping? '+ players[i].id); //log filler\n\t\t\tgame.sockets[players[i].id].emit('ping');\n\t\t}\n\t}\n}", "function loadPlayers(match) {\n\tconsole.log(match);\n\tloadJSON(EVENT_URL + match.match_id + \".json\")\n\t\t.then(events => {\n\t\t\t// starting event (id = 35): Indicates the players in the starting 11, their position and the team’s formation.\n\t\t\tconst startingEvent = events.filter(event => event.type.id === 35);\n\t\t\tconsole.log(\"starting event\");\n\t\t\tconsole.log(startingEvent);\n\t\t\tlet homeTeamInfo, awayTeamInfo;\n\t\t\tif (startingEvent[0].team.id === match.home_team.home_team_id) {\n\t\t\t\thomeTeamInfo = startingEvent[0];\n\t\t\t\tawayTeamInfo = startingEvent[1];\n\t\t\t} else {\n\t\t\t\thomeTeamInfo = startingEvent[1];\n\t\t\t\tawayTeamInfo = startingEvent[0];\n\t\t\t}\n\t\t\tconst homeFormation = homeTeamInfo.tactics.formation.toString().split(\"\")\n\t\t\t\t.reduce((acc, char) => acc + char + \"-\", \"\").slice(0, -1);\n\t\t\t$(\"#home-formation\").html(homeFormation);\n\t\t\tconst awayFormation = awayTeamInfo.tactics.formation.toString().split(\"\")\n\t\t\t\t.reduce((acc, char) => acc + char + \"-\", \"\").slice(0, -1);\n\t\t\t$(\"#away-formation\").html(awayFormation);\n\n\t\t\t[homeTeamInfo, awayTeamInfo].forEach((teamInfo, index) => {\n\t\t\t\t// let optgroup = $('<optgroup/>')\n\t\t\t\t// \t.attr('label', teamInfo.team.name)\n\t\t\t\t// \t.appendTo($(playerHtmlSelect));\n\t\t\t\t$(\"#players-heading\" + index).html(`\n\t\t\t\t\t<input type=\"checkbox\" class=\"all-players-checkbox\" value=\"all-` + index + `\">\n\t\t\t\t\tAll players - <strong>` + teamInfo.team.name + `</strong>\n\t\t\t\t`);\n\t\t\t\tconst players = teamInfo.tactics.lineup;\n\t\t\t\tpositions[index] = [\n\t\t\t\t\t{position: \"G\", players: players.filter(p => p.position.id == 1)},\n\t\t\t\t\t{position: \"D\", players: players.filter(p => p.position.id >= 2 && p.position.id <= 8)},\n\t\t\t\t\t{position: \"M\", players: players.filter(p => (p.position.id >= 9 && p.position.id <= 16) || p.position.id >= 18 && p.position.id <= 20)},\n\t\t\t\t\t{position: \"S\", players: players.filter(p => p.position.id == 17 || p.position.id >= 21)}\n\t\t\t\t];\n\t\t\t\tconsole.log(positions[index]);\n\t\t\t\tlet currentTrElement;\n\t\t\t\tpositions[index].forEach(position => {\n\t\t\t\t\tcurrentTrElement = $(\"#\" + position.position + \"-checkbox\" + index);\n\t\t\t\t\tposition.players.forEach(player => {\n\t\t\t\t\t\tcurrentTrElement.after(`\n\t\t\t\t\t\t\t<tr id=\"tr-` + player.player.id + index + `\">\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<div class=\"checkbox player\">\n\t\t\t\t\t\t\t\t\t\t<label data-toggle=\"tooltip\" title=\"` + POSITIONS_GUIDE[player.position.id].name + `\">\n\t\t\t\t\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"player\" \n\t\t\t\t\t\t\t\t\t\t\tvalue=\"` + position.position + `P\" \n\t\t\t\t\t\t\t\t\t\t\tplayerId=\"` + player.player.id + `\">\n\t\t\t\t\t\t\t\t\t\t\t\t` + player.jersey_number + \" - \" + player.player.name + \" (\" + POSITIONS_GUIDE[player.position.id].abbreviation + \")\" + `\n\t\t\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t`);\n\t\t\t\t\t\tcurrentTrElement = $(\"#tr-\" + player.player.id + index);\n\t\t\t\t\t});\n\t\t\t\t});\n\n\t\t\t\tconst playersEventsData = events.filter(event => event.location && event.player);\n\t\t\t\taddCheckboxesListeners(index, playersEventsData);\n\t\t\t});\n\n\t\t\t$(\"#players-tabs\").show();\n\t\t});\n}", "function BroadcastParty(party_index, action) {\n if (Parties[party_index]) {\n console.log(Parties[party_index]);\n\n var party = {\n 'id' : Parties[party_index].id,\n 'name' : Parties[party_index].name,\n 'index' : Parties[party_index].index,\n 'host' : Parties[party_index].host,\n 'open' : Parties[party_index].open,\n 'nbRound' : Parties[party_index].nbRound,\n 'token' : Parties[party_index].token,\n 'players' : [],\n 'rolled' : Parties[party_index].rolled,\n };\n var playersList = [];\n\n Parties[party_index].players.forEach(function (player) {\n if (player.name !== ''){\n playersList.push(player.getId());\n }\n });\n\n party.players = playersList;\n\n var message = JSON.stringify({\n 'action' : action,\n 'data' : party\n });\n\n Parties[party_index].players.forEach(function (player) {\n player.connection.sendUTF(message);\n });\n }\n}", "function ghostTargeting(){\r\n\t\tvar numberOfPlayersPlaying = 0;\r\n\t\t\r\n\t\tfor(var x=0;x< Players.length;x++)\r\n\t\t\tif(Players[x] != null && PlayersTables[Players[x].position].status == \"Still Playing\")\r\n\t\t\t\tnumberOfPlayersPlaying++;\r\n\t\t\t\r\n\t\tvar target= Math.floor(Math.random()*numberOfPlayersPlaying-1)+1;\r\n\t\tvar position = 0, count = 0;\t\t\r\n\t\t\r\n\t\tfor(var x=0;x< Players.length;x++)\r\n\t\t\tif(Players[x] != null && PlayersTables[Players[x].position].status == \"Still Playing\"){\r\n\t\t\t\tcount++;\r\n\t\t\t\t\r\n\t\t\t\tif(count == target) return Players[x].position\r\n\t\t\t\telse position = Players[x].position;\r\n\t\t\t}\r\n\t\treturn position;\r\n\t}", "function hasWon(playerData){\r\n if(winnerExist(playerData)) { //check if there is a winner and if aq least 10 cards have been moved in order not to trigger when the game is not initialized(he blitz pile is a this time empty)\r\n let a=[[1,0, playerData.player1Data.name],[2,0, playerData.player2Data.name],[3,0, playerData.player3Data.name],[4,0, playerData.player4Data.name]];\r\n for (let i = 1; i < 5; i++) {\r\n a[i-1][1]=count(playerData,i)\r\n }\r\n //classify the table of player according to their results\r\n a.sort(compare);\r\n\r\n playerData.winner.exist=true;\r\n playerData.winner.list=a;\r\n }\r\n}", "player_declared(args) {\n\n }", "function onPlayerReady(event) {\n player.loadPlaylist(viewmodel.Hindivideolist());\n player.setShuffle(true);\n player.setLoop(true);\n //event.target.playVideo();\n}", "function makeMainPlayerIDs(snapshot){\n\t\tvar data = Object.keys(snapshot.val());\n\t\t console.log(data);\n\t\t players = [];\n\t\t for( var i = 0; i < 2; i++) {\n\t\t \t// \"?\" = value-if-true, \":\" value-if-false\n\t\t name = data[i]\n\t\t //console.log(name);\n\t\t if (i == 0) {\n\t\t \tPlayer1 = name;\n\t\t \tconsole.log(\"Player1 ID: \" + Player1);\n\t\t \tplayers.push(Player1)\n\t\t \tconsole.log(\"Player array: \" + players)\n\t\t } else if ( i === 1){\n\t\t \tPlayer2 = name;\n\t\t \tconsole.log(\"Player2 ID: \" + Player2);\n\t\t \tplayers.push(Player2)\n\t\t \tconsole.log(\"Player array: \" + players)\n\t\t }\t \n\t\t\t}\n\t}", "function buildPlayerList(){\n playerArray.forEach(function(player){\n if (player.Team === vm.teamKey) {\n vm.currentPlayerArray.push(player);\n };\n });\n vm.currentPlayerArray.forEach(function(player){\n player.Name = player.Name.toUpperCase();\n player.lastName = player.lastName.toUpperCase();\n });\n vm.maxScore = vm.currentPlayerArray.length;\n vm.gameStarted = true;\n vm.isTimeLeft = true\n vm.displayTimer();\n }", "function onPlayerStateChange(event) {\n if (event.data === YT.PlayerState.ENDED) {\n socket.emit('remove vid');\n $('#videoQ li').eq(0).remove();\n if(vidArr.length == 0){\n first = 0;\n socket.on('suggest video', function (data) {\n //$('#videoQ').append($('<li>fg').text(data.suggestedvideo));\n socket.emit('change video', vidArr);\n });\n }\n else{\n console.log(\"should play next vid\");\n player.loadVideoById(vidArr[0]);\n $('#videoQ li').eq(0).remove();\n vidArr.shift();\n }\n }\n else if(event.data === YT.PlayerState.PLAYING){\n console.log('Playing');\n socket.emit('PlayVideo', player.getCurrentTime());\n\n }\n else if(event.data === YT.PlayerState.PAUSED){\n console.log('Paused');\n socket.emit('PauseVideo', player.getCurrentTime());\n }\n else if (event.data === onError){\n\n }\n}", "function updateOtherPlayers(p, t, n)\n{\n\tconsole.log(\"update other players except \" + p + \" for \" + n + \" \" + t);\n\tfor(var i = 0; i < Np; i++)\t// iterate through players array\n\t{\n\t\tif(i != p)\t// if index is not equal to the player to be excluded\n\t\t{\n\t\t\tvar noPlayer = players[i];\n\t\t\tif(t == \"suspect\")\n\t\t\t{\n\t\t\t\tif(removeElement(noPlayer.suspects.maybe,n))\t// remove from maybe & if card is in maybe array\n\t\t\t\t\tnoPlayer.suspects.no.push(n);\t// add to no vector\n\t\t\t\t\tremoveElement(noPlayer.suspects.maybeGuessed,n);\t// remove from maybeGuessed array\n\t\t\t}\n\t\t\telse if(t == \"weapon\")\n\t\t\t{\n\t\t\t\tif(removeElement(noPlayer.weapons.maybe,n))\t// remove from maybe\n\t\t\t\t\tnoPlayer.weapons.no.push(n);\t// add to no vector\n\t\t\t\t\tremoveElement(noPlayer.weapons.maybeGuessed,n);\n\t\t\t}\n\t\t\telse if(t == \"room\")\n\t\t\t{\n\t\t\t\tif(removeElement(noPlayer.rooms.maybe,n))\t// remove from maybe\n\t\t\t\t\tnoPlayer.rooms.no.push(n);\t// add to no vector\n\t\t\t\t\tremoveElement(noPlayer.rooms.maybeGuessed,n);\n\t\t\t}\n\t\t}\n\t}\n}", "function addedPlayerData() { return {\n}}", "function addedPlayerData() { return {\n}}", "function OnTeamPlayerListChanged()\n{\n\t//$.Msg(\"function OnTeamPlayerListChanged()\")\n\tvar unassignedPlayersContainerNode = $( \"#UnassignedPlayersContainer\" );\n\tif ( unassignedPlayersContainerNode === null )\n\t\treturn;\t\n\t\n\t// Move all existing player panels back to the unassigned player list\n\tfor ( var i = 0; i < g_PlayerPanels.length; ++i )\n\t{\n\t\tvar playerPanel = g_PlayerPanels[ i ];\n\t\tplayerPanel.SetParent( unassignedPlayersContainerNode );\n\t}\n\t\t\n\t// Make sure all of the unassigned player have a player panel \n\t// and that panel is a child of the unassigned player panel.\n\tvar unassignedPlayers = Game.GetUnassignedPlayerIDs();\n\tfor ( var i = 0; i < unassignedPlayers.length; ++i )\n\t{\t\t\n\t\tvar playerId = unassignedPlayers[ i ];\n\t\tFindOrCreatePanelForPlayer( playerId, unassignedPlayersContainerNode );\n\t}\n\n\t// Update all of the team panels moving the player panels for the\n\t// players assigned to each team to the corresponding team panel.\n\tfor ( var i = 0; i < g_TeamPanels.length; ++i )\n\t{\n\t\tUpdateTeamPanel( g_TeamPanels[ i ] )\n\t}\n\n\t// Set the class on the panel to indicate if there are any unassigned players\n\t$( \"#GameAndPlayersRoot\" ).SetHasClass( \"unassigned_players\", unassignedPlayers.length != 0 );\n\t$( \"#GameAndPlayersRoot\" ).SetHasClass( \"no_unassigned_players\", unassignedPlayers.length == 0 );\n\n\tSetup_RefreshTeamsInfo()\n}", "function assignPlayers() {\n // if there isn't a player1\n if (!guests.find((p) => p.role === \"player1\")) {\n console.log(\"need player1\");\n // find the first observer\n const o = guests.find((p) => p.role === \"observer\");\n console.log(\"found\", o, me, o === me);\n // if thats me, take the role\n if (o === me) o.role = \"player1\";\n }\n if (!guests.find((p) => p.role === \"player2\")) {\n const o = guests.find((p) => p.role === \"observer\");\n if (o === me) o.role = \"player2\";\n }\n}", "playerReceivedDeal(position) {\n var player = this.players[position];\n if (player) { player.handSize++; }\n }", "checkPlayersOverlapping() {\n // if no power-up is on the screen, abort\n if (this.powerup == null)\n return;\n\n for (let player of this.players)\n this.game.physics.arcade.overlap(player, this.powerup, this._take, null, this)\n }", "function SeenPlayer()\r\n{\r\n\tseenPlayer=true;\r\n\tnearbyEnemies.AlertEnemiesNearBy();\t\t//Sent from EnemiesNear script to alert other nearby enemies.\r\n}", "function damangePlayer (obj) {\n // Decrement player health\n hero.health--\n \n // Set iframes on player\n hero.justHit = true\n setTimeout(iframes, 1500)\n \n // Set particle emitter to player's location\n emitParticles(hero.x + (hero.width/2), hero.y + (hero.height/2), 'hotpink', 'black', 20, 40)\n \n // push that loser\n pushObject(obj, hero, 4, 10, 100)\n}", "init() {\n\t\tthis.players.forEach( player => {\n\t\t\tplayer.isReady = false;\n\t\t\t//player.socket.removeAllListeners();\n\t\t});\n\t\tthis.results = [];\n\t\tthis.io.to(this.roomID).emit('can-play-again', );\n\t\tconsole.log('ready to play new game');\n\t}", "function notifyUpdate(){\n var update = {}\n //get the opponent's id\n for(var i = 0;i<connections.length;++i){\n /**\n * Look for the player opposite that of the one\n * sending the ID.\n */\n\n if(connections[i].id !== connections[index].id){\n console.log(\"Opposite found\");\n console.log(\"This id :\" + connections[i].id);\n console.log(\"other id:\" + connections[index].id);\n\n update[\"id\"] = connections[index].id;\n update[\"event\"] = \"opponentupdate\";\n update[\"data\"] = connections[i];\n }\n }\n console.log(\"Notifying opponent of \" + JSON.stringify(update));\n ws.send(JSON.stringify(update));\n }", "function getParticipants() {\n\tdocument.getElementById(\"acceptQuest\").style.display = \"inline\";\n\tvar serverMsg = document.getElementById('serverMsg');\n\tserverMsg.value += \"\\n> please accept/decline quest by clicking below\"\n\tif (isAI) {\n\t\tvar data = JSON.stringify({\n\t\t\t'AICommand' : \"AskToParticipateQuest\"\n\t\t})\n\t\tsetTimeout(function(){ socketConn.send(data); }, 1000);\n\t\tdocument.getElementById(\"acceptQuest\").style.display = \"none\";\n\t\tserverMsg.value += \"\\n> wait for other players...\";\n\t}\n\tgetCurrHand();\n\tfor(var i=0; i<handCardSRC.length; i++) {\n\t\tif(handCardSRC[i].includes(\"Merlin\")) {\n\t\t\tdocument.getElementById(\"merlin\").style.display = \"block\";\n\t\t\tdocument.getElementById(\"merlinPrompt\").innerText = \"You have Merlin in hand, preview stage?\";\n\t\t\tvar data = JSON.stringify({\n\t\t\t\t'hasMerlin' : 0,\n\t\t\t\t'name' : PlayerName\n\t\t\t})\n\t\t\tsocketConn.send(data);\n\t\t}\n\t}\n}", "update() {\n this.frameCount++;\n if (this.frameCount % (60 * Consts.DAY_NIGHT_TIME) === 0) {\n this.night = !this.night;\n for (let [id, player] of this.players) {\n this.sockets.get(id).emit(\"night\", this.night);\n }\n }\n if (this.frameCount % 300 === 0 && Object.keys(this.obsticals).length < 5) {\n let obstical = {\n id: ID(),\n x: Math.random() * Consts.MAP_WIDTH,\n y: Math.random() * Consts.MAP_HEIGHT,\n r: Math.random() * 75 + 50\n }\n this.pack.ADD.OBSTICALS.push(obstical);\n this.obsticals[obstical.id] = obstical;\n // console.log(obstical.id)\n }\n\n // food\n if (Object.keys(this.foods).length < Consts.MAX_FOOD_SPAN_PER_PLAYER * this.players.size && Object.keys(this.foods).length < Consts.MAX_FOOD_TOTAL) {\n if (Math.random() < (Consts.FOOD_SPAN_RATE_PER_PLAYER * this.players.size)) {\n let food = {\n id: ID(),\n x: Math.random() * Consts.MAP_WIDTH,\n y: Math.random() * Consts.MAP_HEIGHT\n }\n this.pack.ADD.FOODS.push(food);\n this.foods[food.id] = food;\n }\n }\n\n this.sendPackage();\n }", "function PlayerManager() {\n this.opponents_ = new Array();\n this.seats_ = new Array(false,false,false,false,false,false,false);\n \n this.AddOpponent = function(name,id) {\n console.log(\"-c:adding opponent\");\n var opponent = new Opponent(name, id);\n opponent.SetPosition(this.FindSeat());\n this.opponents_.push(opponent);\n }\n \n this.FindSeat = function() {\n for(var i=0;i<7;i++)\n {\n if(!this.seats_[i])\n {\n this.seats_[i] = true;\n return i;\n }\n }\n }\n\n this.RemoveOpponent = function(id) {\n for(var i=this.opponent.length;i>=0;i--) {\n if(this.opponents_[i].id == id) {\n this.seats_[i] = false;\n this.opponents_.splice(i,1);\n }\n }\n }\n\n this.DrawOpponentCard = function() {\n\tvar len = this.opponents_.length;\n for(var i=0;i<len;i++) {\n this.opponents_[i].Draw();\n }\n } \n\n}", "function onPlayerStateChange(event) { \n\t//Let us accept the player which was massaged\n\t//by the mousey hands of woman or man\n\tvar videoURL = event.target.getVideoUrl();\n\t//We must strip from it, the true identity\n\tvar regex = /v=(.+)$/;\n\tvar matches = videoURL.match(regex);\n\tvideoID = matches[1];\n\t//and prepare for it's true title\n\tthisVideoTitle = \"\";\n\t//we look through all the array\n\t//which at first glance may seem unfocused\n\t//but tis the off kilter response\n\t//from the magical moore json\n\t//which belies this approach\n\t//Tis a hack? A kludge?\n\t//These are fighting words, sir!\n\tfor (j=0; j<videoArray.length; j++) {\n\t\t//tis the video a match?\n\t if (videoArray[j]==videoID) {\n\t\t\t//apply the true title!\n\t thisVideoTitle = videoTitle[j]||\"\";\n\t\t\tconsole.log(thisVideoTitle);\n\t\t\t//should we have a title, alas naught else\n\t\t\tif(thisVideoTitle.length>0){\n\t\t\t\tif(showTitle==3){\n\t\t\t\t\tthisVideoTitle = thisVideoTitle + \" | \" + videoID;\n\t\t\t\t}else if(showTitle==2){\n\t\t\t\t\tthisVideoTitle = videoID;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tthisVideoTitle = videoID;\n\t\t\t}\n\t\t\t//Should the video rear it's head\n if (event.data == YT.PlayerState.PLAYING) {\n\t\t\t\t_gaq.push(['_trackEvent', 'Videos', 'Play', thisVideoTitle]); \n \t //ga('send', 'event', 'Videos', 'Play', thisVideoTitle);\n\t\t\t\t//thy video plays\n\t\t\t\t//reaffirm the pausal beast is not with us\n \t\tpauseFlagArray[j] = false;\n \t} \n\t\t\t//should the video tire out and cease\n \tif (event.data == YT.PlayerState.ENDED){\n\t\t\t\t_gaq.push(['_trackEvent', 'Videos', 'Watch to End', thisVideoTitle]); \n \t\t//ga('send', 'event', 'Videos', 'Watch to End', thisVideoTitle);\n \t} \n\t\t\t//and should we tell it to halt, cease, heal.\n\t\t\t//confirm the pause has but one head and it flies not its flag\n\t\t\t//lo the pause event will spawn a many headed monster\n\t\t\t//with events overflowing\n \tif (event.data == YT.PlayerState.PAUSED && pauseFlagArray[j] != true){\n\t\t\t\t_gaq.push(['_trackEvent', 'Videos', 'Pause', thisVideoTitle]); \n \t\t//ga('send', 'event', 'Videos', 'Pause', thisVideoTitle);\n\t\t\t\t//tell the monster it may have\n\t\t\t\t//but one head\n \t\tpauseFlagArray[j] = true;\n \t}\n\t\t\t//and should the monster think, before it doth play\n\t\t\t//after we command it to move\n \tif (event.data == YT.PlayerState.BUFFERING){\n\t\t\t\t_gaq.push(['_trackEvent', 'Videos', 'Buffering', thisVideoTitle]); \n \t\t//ga('send', 'event', 'Videos', 'Buffering', thisVideoTitle);\n \t}\n\t\t\t//and should it cue\n\t\t\t//for why not track this as well.\n \tif (event.data == YT.PlayerState.CUED){\n\t\t\t\t_gaq.push(['_trackEvent', 'Videos', 'Cueing', thisVideoTitle]); \n \t\t//ga('send', 'event', 'Videos', 'Cueing', thisVideoTitle);\n \t}\n\n\t }\n\t}\n}", "function updatePlayerOther(data) {\n if (playerOthers.hasOwnProperty(data.clientId)) {\n playerOthers[data.clientId].updateGoal(data);\n\n if (\n data.health <= 0 &&\n !deadPlayers.hasOwnProperty(playerOthers[data.clientId].username)\n ) {\n activePlayerCount--;\n deadPlayers[playerOthers[data.clientId].username] = true;\n }\n }\n }", "fetchPlayers() {\n if(this.players.length === 0) { return []; }\n return this.players.map((value) => value._player);\n }", "userReceived(p) {\n let player = newUser(p);\n players.push(player);\n requestPlayers();\n }" ]
[ "0.68262", "0.62577367", "0.62517947", "0.617915", "0.596874", "0.5946202", "0.59154826", "0.59124744", "0.58594", "0.5856943", "0.583706", "0.58368593", "0.5819056", "0.5796714", "0.57942486", "0.579394", "0.57818526", "0.57740915", "0.57698494", "0.57602006", "0.5748225", "0.5730783", "0.5716661", "0.571651", "0.57066935", "0.5695493", "0.56866854", "0.56835735", "0.56811315", "0.5674056", "0.5668207", "0.5666282", "0.56585395", "0.5650742", "0.56428015", "0.5631992", "0.5621609", "0.56159246", "0.56033564", "0.56028485", "0.55989164", "0.55950236", "0.55815035", "0.5569685", "0.55628675", "0.55612653", "0.5536582", "0.5532151", "0.5530158", "0.5524964", "0.5524042", "0.5524004", "0.5523902", "0.5514012", "0.55117154", "0.55110973", "0.55085385", "0.55066186", "0.55056465", "0.54997134", "0.5491221", "0.54830486", "0.54814106", "0.54813045", "0.54735297", "0.54731894", "0.5470855", "0.54696214", "0.54632765", "0.5461957", "0.5459436", "0.5442097", "0.5440243", "0.5433726", "0.54237425", "0.5418667", "0.5417805", "0.54162914", "0.5412221", "0.5410904", "0.5410491", "0.54095936", "0.5409081", "0.5408138", "0.5405064", "0.5405064", "0.5404716", "0.53938216", "0.539323", "0.53876835", "0.5384772", "0.5383465", "0.537443", "0.53689426", "0.536311", "0.53619957", "0.53592217", "0.53551954", "0.5351959", "0.53455406", "0.534547" ]
0.0
-1
We will consider a, e, i, o, and u as vowels for this Kata. The input string will only consist of lower case letters and/or spaces.
function getCount(str) { var vowelsCount = 0; let pos = { A : str.indexOf("a"), E : str.indexOf("e"), I : str.indexOf("i"), O : str.indexOf("o"), U : str.indexOf("u") } while ( pos.A != -1 ) { vowelsCount++; pos.A = str.indexOf( "a", pos.A + 1 ); } while ( pos.E != -1 ) { vowelsCount++; pos.E = str.indexOf( "e", pos.E + 1 ); } while ( pos.I != -1 ) { vowelsCount++; pos.I = str.indexOf( "i", pos.I + 1 ); } while ( pos.O != -1 ) { vowelsCount++; pos.O = str.indexOf( "o", pos.O + 1 ); } while ( pos.U != -1 ) { vowelsCount++; pos.U = str.indexOf( "u", pos.U + 1 ); } return vowelsCount; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function vowels(string) {\n var stringArr = string.split('');\n var newString = \"\";\n for(var i =0; i < stringArr.length; i ++) {\n if(stringArr[i] === \"a\" || stringArr[i] === \"e\" || stringArr[i] === \"i\" || stringArr[i] === \"o\" || stringArr[i] === \"u\") {\n newString = newString + stringArr[i];\n }\n } console.log(newString);\n}", "function isVowel(input){\n if( input === \"a\" || input === \"A\" || input === \"e\" || input === \"E\" ||\n input === \"i\" || input === \"I\" || input === \"o\" ||input === \"O\" ||\n input === \"u\" ||input === \"U\" ){\n return true;\n }\n else return false;\n}", "function isVowel(str) {\r\n\r\n \r\n checkForVowel = str;\r\n\r\n var count = 0;\r\n\r\n for (var i = 0; i < checkForVowel.length; i++) {\r\n\r\n switch (checkForVowel[i]) {\r\n \r\n case 'a':\r\n count++;\r\n break;\r\n \r\n case 'e':\r\n count++;\r\n break;\r\n\r\n case 'i':\r\n count++;\r\n break;\r\n\r\n case 'o':\r\n count++;\r\n break;\r\n\r\n case 'u':\r\n count++;\r\n break;\r\n \r\n }\r\n\r\n }\r\n\r\n if (count > 0) {\r\n return true;\r\n } else {\r\n return false\r\n }\r\n \r\n}", "function isVowel(char){\n var string='char'[length 0];\n if (string === 'a'){\n return true;\n } \n else if (string === 'e'){\n return true;\n }\n else if (string === 'i'){\n return true;\n }\n else if (string === 'o'){\n return true;\n }\n else if (string === 'u'){\n return true;\n }\n else {\n return false;\n }\n}", "function isVowel(x) {\n if (x === \"a\") {\n return true\n } if (x === \"e\") {\n return true\n } if (x === \"i\") {\n return true\n } if (x === \"o\") {\n return true\n } if (x === \"u\") {\n return true\n } {\n return false\n }\n}", "function isVowel(x) {\n var result;\nresult = x == \"A\" || x == \"E\" || x == \"I\" || x == \"O\" || x == \"U\"\nreturn result;\n\n}", "function disemvowel(str) {\n let new_arr = str.split('');\n new_arr.filter(function(char) {\n return char;\n })\n let result_arr = []\n for(let i = 0; i < new_arr.length; i++) {\n if(new_arr[i] == 'a' || new_arr[i] == 'A') {\n continue;\n } else if(new_arr[i] == 'e' || new_arr[i] == 'E') {\n continue;\n } else if(new_arr[i] == 'i' || new_arr[i] == 'I') {\n continue;\n } else if(new_arr[i] == 'o' || new_arr[i] == 'O') {\n continue;\n } else if(new_arr[i] == 'u' || new_arr[i] == 'U') {\n continue;\n } else {\n result_arr.push(new_arr[i]);\n }\n }\n return result_arr.join('');\n}", "function disemvowel (a) {\n return a.split('a').join('').split('e').join('').split('i').join('').split('o').join('').split('u').join('')\n}", "function isVowel(char){\n if(char === \"a\") {\n return true\n } else if(char === \"e\") {\n return true\n } else if(char === \"i\") {\n return true\n } else if(char === \"o\") {\n return true\n } else if(char === \"u\") {\n return true\n } else if(char === \"y\") {\n return true\n } else {\n return false\n }\n}", "function isVowel(char){\n // Your answer here\n return ['a', 'e', 'i', 'o', 'u', 'y'].indexOf(char.toLowerCase()) !== -1\n}", "function isVowel(char) {\n if(char == \"a\"||char== \"e\"|| char == \"i\"|| char == \"o\"|| char == \"u\"){\n return true\n }else{\n\n return false}\n\n}", "function isVowel(string) {\n if ((string.length == 1) && (string === \"a\" || string === \"o\" ||\n string === \"i\" || string === \"e\" || string === \"u\")) {\n return true;\n } else {\n return false;\n }\n}", "function disemvowel(str) {\n let newStr = '';\n for(let i = 0; i < str.length; i++){\n if (str[i].toLowerCase() !== 'a' && str[i].toLowerCase() !== 'e' && str[i].toLowerCase() !== 'i' && str[i].toLowerCase() !== 'o' && str[i].toLowerCase() !== 'u'){\n newStr += str[i];\n }\n }\n return newStr;\n}", "function vowels(a)\n{\n switch(a)\n {\n case 'a','A':\n console.log(`The given alphabet is a vowel`);\n break;\n case 'e','E':\n console.log(`The given alphabet is a vowel`);\n break;\n case 'i','I':\n console.log(`The given alphabet is a vowel`);\n break;\n case 'o','O':\n console.log(`The given alphabet is a vowel`);\n break;\n case 'u','U':\n console.log(`The given alphabet is a vowel`);\n break;\n default:\n console.log(`The given alphabet is not a vowel`)\n }\n}", "function isVowel(char){\n if (char == 'a'|'i'|'u'|'e'|'o') {\n return true\n } else {\n return false\n }\n}", "function checkvowels(str)\n {\n var vowels = \"aeiouAEIOU\";\n var vowelAlpha = \"\";\n var vowelIndex = \"\";\n for (i = 0; i < str.length; i++) \n {\n for (j = 0; j < vowels.length; j++) \n {\n if (str[i] == vowels[j])\n {\n vowelAlpha = vowelAlpha + str[i] + \" \";\n vowelIndex = vowelIndex + i + \" \";\n }\n }\n }\n if (vowelIndex.length == 0) \n {\n console.log(\"no vowels\");\n } else \n {\n var output = vowelAlpha + vowelIndex;\n console.log(str + \" \" + output);\n }\n }", "function findVowels(str) {\n str.toLowerCase();\n const inArr = str.split('');\n const vowels = inArr.filter(item => item === \"a\" || item === \"e\" || item === \"i\" || item === \"o\" || item === \"u\");\n return vowels.length;\n}", "function isVowel(string){\n var text;\n var string=string.toLowerCase();\n var vowels=(['a','e','i','o','u','y']);\n\n for(var i=0; i <=vowels.length; i++){\n if(string != vowels[i]){\n continue;\n }\n return true;\n }\n return false;\n\n }", "function vowel(letter) {\r\n letter = letter.toLowerCase();\r\n if (letter === 'a' || letter === 'e' || letter === 'i' || letter === 'o' || letter === 'u') {\r\n return true;\r\n }\r\n else\r\n return false;\r\n}", "function isVowel(char) {\n if (char === 'a') {\n return true;\n }\n if (char === 'e') {\n return true;\n }\n if (char === 'i') {\n return true;\n }\n if (char === 'o') {\n return true;\n }\n if (char === 'u') {\n return true;\n }\n \n return false;\n}", "function replaceVowel(word){\n word = word.toLowerCase();\n return word\n .replace(/a/g,\"1\")\n .replace(/e/g,\"2\")\n .replace(/i/g,\"3\")\n .replace(/o/g,\"4\")\n .replace(/u/g,\"5\");\n \n}", "function isVowel(char){\n if (char === 'a' || char === 'e' || char === 'i' || char === 'o' || char === 'u') {\n return 'true';\n }\n else {\n return 'false';\n }\n}", "function absentVowel(x) {\n if (x.indexOf(\"a\") === -1) {\n return 0;\n } else if (x.indexOf(\"e\") === -1) {\n return 1;\n } else if (x.indexOf(\"i\") === -1) {\n return 2;\n } else if (x.indexOf(\"o\") === -1) {\n return 3;\n } else if (x.indexOf(\"u\") === -1) {\n return 4;\n }\n}", "function isVowel(char) {\n if (char === 'a') {\n return true;\n }\n if (char === 'e') {\n return true;\n }\n if (char === 'i') {\n return true;\n }\n if (char === 'o') {\n return true;\n }\n return false;\n}", "function isVowel(char){\n if (char === 'a' || char === 'e' || char === 'i' || char === 'o' || char === 'u'){\n return 'true';\n } else {\n return 'false';\n }\n}", "function countVowels(str)\r\n {\r\n for (var i = 0; i < str.length; i++)\r\n if (isVowel(str[i]))\r\n \r\n // Check for vowel\r\n console.log(str[i]);\r\n console.log(str);\r\n return str;\r\n }", "function isVowel(char){\n var character = char;\n if ( char === 'a'||char ==='e'||char ==='i'||char ==='o'||char ==='u'){\n return true;\n }else{\n return false;\n }\n}", "function vowels(inputString) {\n const vowelListStr = 'aeiou';\n\n inputString = inputString.toLowerCase();\n\n const stringArr = inputString.split('');\n\n const vowels = stringArr.filter(char => vowelListStr.includes(char));\n return vowels.length;\n}", "function disemvowel(test) {\r\n return test.replace(/\"|a|u|i|o|e|\"/gi,\"\");\r\n }", "function isVowel( char ) {\n switch (char) {\n case 'a':\n return true;\n break;\n case 'e':\n return true;\n break;\n case 'i':\n return true;\n break;\n case 'o':\n return true;\n break;\n case 'u':\n return true;\n break;\n default:\n return false;\n break;\n }\n}", "function vowels(a) {\n var i;\n var counter = 0;\n for (i = 0; i < a.length; i++)\n if (a[i] == \"a\" || a[i] == \"e\" || a[i] == \"o\" || a[i] == \"i\" || a[i] == \"u\" || a[i] == \"A\" || a[i] == \"E\" || a[i] == \"O\" || a[i] == \"I\" || a[i] == \"U\") {\n\n counter++;\n }\n\n return counter;\n\n}", "function isVowel(str) {\n if (str.includes(\"a\", \"e\", \"i\", \"o\", \"u\")) {\n return true;\n }\n else{\n return false;\n }\n}", "function disemvowel(str) {\n new_str = \"\"\n for (let char of str) {\n if (char !== 'a' | char !== 'e' | char !== 'i' | char !== 'o' | char !== 'u') {\n new_str += char;\n }\n }\n return new_str;\n}", "function disemvowel(str) {\n const vowels = ['a', 'e', 'i', 'o', 'u']\n \n let Newstr = str.split('').reduce( (acc, letter) => {\n if(vowels.includes(letter.toLowerCase())){\n return acc\n }\n else{\n acc.push(letter)\n }\n \n return acc\n }, []).join('')\n \n\n return Newstr;\n}", "function vowels1(a)\n{\n var str = \"a e i o u A E I O U\";\n var n = str.includes(a);\n if (n===true)\n {\n console.log(`The given alphabet is a vowel`);\n }\n else\n {\n console.log(`The given alphabet is not a vowel`);\n }\n}", "function startsAndEndsWithVowel(input){\n //charAt returns a new string consisting of the single UTF-16 code unit located at the specified offset into the string.\n var input1 = input.charAt(0);\n var input2 = input.charAt(input.length - 1);// grab last letter\n if((input2 === 'a' || input2 === 'e' || input2 === 'i' || input2 === 'o' || input2 === 'u')\n && (input1 === 'a' || input1 === 'e' || input1 === 'i' || input1 === 'o' || input1 === 'u')){\n return true; // if end of word has a vowel once we split it\n } else {\n return false;\n }\n}", "function isVowel(letter){\n if (letter ==='a' || letter ==='i'|| letter ==='e'|| letter ==='u'|| letter ==='o'|| letter ==='y'){\n return true;\n }\n}", "function startsWithVowel(str) {\n if (typeof str !== 'string') return;\n var init = str[0].toLowerCase();\n return (init=='a' || init=='e' || init=='i' || init=='o' || init=='u' || init=='y');\n //OR:\n switch (init) {\n case a:\n case e:\n case i:\n case o:\n case u: return true;\n default: return false;\n }\n}", "function isVowel(letter){\n if(letter === 'a'||letter === 'e'||letter === 'i'||letter === 'o'||letter === 'u'){\n return true;\n }else{\n return false;\n }\n}", "function vowels(str) {\n let counter = 0;\n for (let char of str.toLowerCase()) {\n if (char === \"a\" || char === \"e\" || char === \"i\" || char === \"o\" || char === \"u\") {\n counter++\n }\n }\n return counter\n}", "function moveVowel(input) {\n\n // input: string\n // output: string\n \n // algo:\n // [] look at the string\n // [] pull out vowels\n // [] move vowels to end in the same order\n\n let consonants = \"\";\n let vowels = \"\";\n for(var i = 0; i < input.length; i++){\n if(/[aeiou]/.test(input[i])){\n vowels += input[i];\n } else {\n consonants += input[i];\n }\n }\n return(consonants.concat('', vowels));\n }", "function isVowel(char) {\n if (\n char === 'a' ||\n char === 'e' ||\n char === 'i' ||\n char === 'o' ||\n char === 'u'\n ) {\n return true;\n } else {\n return false;\n }\n }", "function isVowel(letter) {\n return (\n letter === \"a\" ||\n letter === \"e\" ||\n letter === \"i\" ||\n letter === \"o\" ||\n letter === \"u\"\n );\n}", "function isVowel(char){\n \"use strict\";\n return char === 'a' || char === 'e' || char === 'i' || char === 'o' || char === 'u' || false;\n}", "function disemvowel(str) {\n let withoutVowel = \"\";\n for (let i = 0; i < str.length; i++) {\n if (str[i] !== \"a\" && str[i] !==\"e\" && str[i] !==\"i\" && str[i] != \"o\" && str[i] !== \"u\") {\n withoutVowel += str[i];\n }\n }\n return withoutVowel;\n}", "function isVowel(value)\n{\n\t\n\t\t if (value === \"a\" ||\n\t value === \"e\" ||\n\t value === \"i\" ||\n\t value === \"o\" ||\n\t value === \"u\")\n\n\n\t\t\t{\n\t\t\t\tx = true;\n\t\t\t} \n\t\t\telse \n\t\t\t{\n\t\t\t\tx = false;\n\t\t\t}\n\t\t\t\n\t\t\t\treturn x;\n \n}", "function strVowel(str) {\n var vowel = 0\n for (i=0; i<= str.length; i++) {\n if (str.charAt(i) === 'a' || str.charAt(i) === 'e' || str.charAt(i) === 'i' || str.charAt(i) === 'o' || str.charAt(i) === 'u' ){\n vowel +=1\n }\n }\n return vowel\n}", "function vowelCount(str){\n let count = 0\n str = str.toLowerCase()\n //return(console.log(str.length))\n if(str.length==0){\n return 'Empty String'\n }\n for(let i = 0; i<=str.length; i++){\n //console.log(str[i])\n //let stringLower = str[i]\n if((str[i]=='a') || str[i]=='e' || str[i]=='i' || str[i]=='o' || str[i]=='u'){\n count = count + 1\n }\n}\nreturn count\n}", "function disemvowel(str){\n result = ''\n for (let i=0; i < str.length; i++){\n if (str[i] !== 'a' && str[i] !== 'e' && str[i] !== 'i' && str[i] !== 'o' && str[i] !== 'u' && str[i] !== 'A' && str[i] !== 'E' && str[i] !== 'I' && str[i] !== 'O' && str[i] !== 'U'){\n result += str[i];\n }\n }\n console.log(result);\n str = result;\n return str;\n}", "function vowels(str) {\n\tlet arr = str.split('')\n\tlet newArr = []\n\tlet count = 0\n\n\tlet vowelObj = { a: true, e: true, i: true, o: true, u: true}\n\n\tfor (let i = 0; i < arr.length; i++) {\n\t\t// vowelObj['a']\n\t\tif (vowelObj[arr[i]]) {\n\t\t\tcount += 1\n\t\t} \n\t}\n\n\t// for (let i = 0; i < arr.length; i++) {\n\t// \t// includes\n\t// \tif (vowelArr.includes(arr[i])) {\n\t// \t\tnewArr.push(arr[i])\n\t// \t}\n\t// }\n\treturn count\n}", "function countVowels1(str) {\n\n\tlet sum = 0;\n\tlet letters = str.split('');\n\n\tfor (let i = 0; i < letters.length; i++) {\n\n\t\tconst l = letters[i];\n\n\t\tif (l === 'a' || l === 'e' || l === 'i' || l === 'o' || l === 'u') {\n\n\t\t\tsum++;\n\t\t}\n\t}\n\n\treturn sum;\n}", "function LetterChanges(str) {\r\n let strArr = str.toLowerCase().split(\"\");\r\n strArr = strArr.map(x => {\r\n // if((x >= 'a' && x <= 'z') || (x >= 'A' && x <= 'Z')){\r\n if (\r\n (x.charCodeAt() >= 65 && x.charCodeAt() <= 90) ||\r\n (x.charCodeAt() >= 97 && x.charCodeAt() <= 122)\r\n ) {\r\n if (x === \"z\") {\r\n return \"a\";\r\n }\r\n return String.fromCharCode(x.charCodeAt() + 1);\r\n }\r\n return x;\r\n });\r\n\r\n let vowel = \"aeiou\";\r\n\r\n let result = strArr\r\n .map(x => (vowel.includes(x) ? x.toUpperCase() : x))\r\n .join(\"\");\r\n\r\n // code goes here\r\n return result;\r\n}", "function vowels2(str) {\n const matches = str.match(/[aeiou]/gi);//g is for continue the search and i is case-insensitive \n return matches ? matches.length : 0;\n}", "function isVowel(character){\n const ar = new Array(\"a\",\"e\",\"i\",\"o\",\"u\");\n return ar.includes(character.toLowerCase());\n }", "function translateWordsStartingWithVowel(str) {\n return str.replace(/(^[aeiou])(.*)/,\"$1$2way\");\n }", "function vowelTest(char) {\n return (/^[aeiou]$/i).test(char);\n}", "function vowelConsonant(char){\n if(char==='a'||char==='e'||char==='i'||char==='o'||char==='u'||char==='A'||char==='E'||char==='I'||char==='O'||char==='U')\n return true;\n else \n return false; \n}", "function isVowel(char) {\n \"use strict\";\n //...\n var x = char;\n\n switch (x.toLowerCase()) {\n case \"a\":\n return true;\n break;\n case \"e\":\n return true;\n break;\n case \"i\":\n return true;\n break;\n case \"o\":\n return true;\n break;\n case \"u\":\n return true;\n break;\n default:\n return false;\n break;\n }\n}", "function isVowel(a) {\n if (a.match(/[aeiouAIUEO]/)) {\n return true;\n }\n return false;\n}", "function vowels2(str) {\n /* RegEx tips:\n g -> make sure we don't stop at the first match\n i -> case insensitive\n */\n const matches = str.match(/[aeiou]/gi)\n return matches ? matches.length : 0\n}", "function isCharacterAVowel(x) {\n if (x == 'a' || x=='A' || x=='E' || x =='e'\n || x=='O' || x =='o' ||x =='U' || x =='u') {\n return 'vowel';\n }else {\n return 'consonant';\n }\n}", "function isVowel(char){\n \"use strict\";\n\n var outcome;\n\n if(char == 'a' || char == 'e' || char == 'i' || char == 'o' || char == 'u') {\n outcome = true;\n } else {\n outcome = false;\n }\n return outcome;\n }", "function vowelBonusScore(word) {\n \tword = word.toUpperCase();\n let points = 0;\n for(i=0; i<word.length; i++){\n if (word.slice(i, i+1)==='A' || word.slice(i, i+1)==='E'|| word.slice(i, i+1)==='I' || word.slice(i, i+1)==='O' || word.slice(i, i+1)==='U'){\n points = points + 3;\n }\n else {\n points = points + 1;\n }\n }\n //console.log(points);\n return points;\n}", "function isVowel(letter) {\n switch(letter) {\n case 'a':\n case 'e':\n case 'i':\n case 'o':\n case 'u': return true;\n default: return false;\n }\n}", "function vowels(str) {\n let count = 0;\n let checker = \"aeiou\"; // or we have give it as an array = ['a','e','i','o','u'] \n for (let char of str.toLowerCase()) {\n if (checker.includes(char)) {\n count++\n }\n\n }\n return count;\n}", "function isVowel(vow){\n if (vow === 'a'|| vow === 'e'|| vow === 'i'|| vow === 'o'|| vow === 'u'||\n vow === 'A'|| vow === 'E'|| vow === 'I'|| vow === 'O'|| vow === 'U'){\n return true;\n } else {\n return false;\n }\n}", "function isCharacterAVowel(x) {\n if (x.toLowerCase() === \"a\" || x.toLowerCase() === \"e\" || x.toLowerCase() === \"i\" || x.toLowerCase() === \"o\" || x.toLowerCase() === \"u\") {\n return true;\n }else{\n return false;\n }\n}", "function isVowel(char){\n return \"a e i o u\".indexOf(letter) != -1;\n}", "function is_Vowel(char){\r\n //define an array containing all the vowels\r\n var vowels = new Array(\"a\",\"e\",\"i\",\"o\",\"u\",\"A\",\"E\",\"I\",\"O\",\"U\");\r\n //return typeof(char);\r\n //check the entered character is in the vowels array\r\n var is_vowel = vowels.indexOf(char);\r\n //If character not found in array return false else true\r\n if(is_vowel == -1){\r\n return false;\r\n }else{\r\n return true;\r\n }\r\n}", "function vowels(str) {\n //match takes in regular expression that checks to see if what's passed in as arg matches str\n //returns arr of all matches found, if str has any char included between []\n //if no match found, will return null\n //2 options added to regex: g-> makes sure we don't stop at first match we find inside str; i-> \"case insensitive\"\n const matches = str.match(/[aeiou]/gi);\n return matches ? matches.length : 0;\n}", "function isVowel(letter){\n return ['a','e','i','o','u'].includes(letter) \n }", "function vowelCounter(string) {\n var vowelCount = 0;\n var input = string.toLowerCase();\n //loop throught string as an array\n for (var i=0; i < input.length; i++) {\n if (input[i] === 'a' || input[i] === 'e' || input[i] === 'i' || input[i] === 'o' || input[i] === 'u' ) {\n vowelCount++\n }\n }\n return vowelCount;\n }", "function isVowel(char){\n\treturn char === ‘a’ || char === ‘e’ || char === ‘i’ || char === ‘o’ || char === ‘u’ || false;\n}", "function ifVowel(string) {\n if (string.length === 1) {\n string = string + \"ay\";\n return string;\n } else if (string.length > 1) {\n string = string + \"yay\";\n return string;\n }\n}", "function count(string) {\n let vowels = 0; \n let lowerCaseString = string.toLowerCase(); \n for (let i = 0; i < lowerCaseString.length; i++) {\n if (lowerCaseString[i] === 'a') {\n vowels = vowels +1; \n }else if (lowerCaseString[i] === 'e') {\n vowels = vowels +1; \n }else if (lowerCaseString[i] === 'i') {\n vowels = vowels +1; \n }else if (lowerCaseString[i] === 'o') {\n vowels = vowels +1; \n }else if (lowerCaseString[i] === 'u') {\n vowels = vowels +1; \n }\n }\n return vowels; \n}", "function isCharaterAVowel(N){\n N = N.toLowerCase()\n if (N == \"a\" || N == \"e\"|| N == \"i\"|| N == \"o\"|| N == \"u\" ){\n return(\"Its A Vowel Woohoo\");}\n else {return(\"Oops Not a Vowel!\")};\n}", "function VowelCount(str) {\n var newStr = str.toLowerCase().split('');\n var vowelCounter = 0;\n for(var i = 0; i<newStr.length; i++) {\n if(newStr[i] === 'a' || newStr[i] === 'e' || newStr[i] === 'i' || newStr[i] === 'o' || newStr[i] === 'u')\n {vowelCounter += 1;}\n }\n return vowelCounter;\n}", "function vowels(str) {\n //create an array that will hold all Vowels\n const vowels = [];\n //convert the string into an array\n const string = str.toLowerCase();\n //find the vowels using regex\n let check = string.match(/[aeiou]/g);\n if (!check){\n //if nothing is found, return 0\n return 0;\n } else {\n for (var i = 0; i< check.length; i++){\n vowels.push(check[i]);\n }\n //else return the length of the array\n return vowels.length;\n }\n}", "function isVowel(char){\n var vowels ='aeiou';\n if (vowels.indexOf(char)!== -1) {\n return true;\n } \n return false;\n }", "function translatePigLatin(str) {\n if(str.match(/^[aeiou]/)){\n return str + 'way'\n } else if (str.match(/[^aeiou]+$/gi)){\n console.log('a') \n } \n let newArr = []\n let arr = str.split(/([aeiou].*)/)\n newArr.push(arr[1], arr[0] + 'ay')\n str = newArr.join('')\n return str\n}", "function VowelCount(str) { \n let count = 0;\n for (let i = 0; i < str.length; i++) {\n if (str[i] === 'a' || str[i] === 'e' || str[i] === 'i' || str[i] === 'o' || str[i] === 'u') {\n count++;\n }\n }\n return count;\n}", "function disemvowel(string){\n\tvar result = \"\";\n\tvar vowels = [\"b\",\"c\",\"d\",\"f\",\"g\",\"h\",\"j\",\"k\",\"l\",\"m\",\"n\",\"p\",\"q\",\"r\",\"s\",\"t\",\"v\",\"w\",\"x\",\"z\",\"y\"];\n\tfor(var i=0; i<string.length; i++){\n\t\tfor(var j=0; j<vowels.length; j++){\n\t\t\tif(string.charAt(i) == vowels[j]){\n\t\t\t\tresult += string.charAt(i);\n\t\t\t}\n\t\t}\n\t}\n\treturn result;\n}", "function vowelCount(str){\n var result = 0;\n str = str.split(\"\");\n str.forEach(function(letter){\n if(/[aeiou]/i.test(letter)){\n result ++;\n }\n });//end of forEach\n return result;\n}", "function isCharAVowel(char) {\nif (char.toLowerCase() == 'a' || char.toLowerCase() == 'e' || char.toLowerCase() == 'i' || char.toLowerCase() == 'o' || char.toLowerCase() == 'u') {\n return true\n } else {\n return false\n }\n}", "function translatePigLatin(str) {\n let regex = /[aeiou]/ig;\n let notVowel = /^[^aeiou]+/ig\n \n\n // if first letter is a vowel then add \"way\" at the end of the string\n if (regex.test(str[0])) {\n return str + \"way\";\n }\n // if the string doesn't contain any vowels add \"ay\" at the end \n if (regex.test(str) === false) {\n return str + \"ay\";\n }\n // if the string contains vowels and the first letter isn't a vowel, return the collection\n // of cononants plus \"ay\" at the end of the string\n let firstConsonants = str.match(notVowel).join(\"\");\n \n return str.replace(firstConsonants, \"\") + firstConsonants + \"ay\";\n}", "function isVowel(char){\n if (char === ['a', 'e', 'i', 'o', 'u']) {\n return true\n }\n else {\n return false\n }\n}", "function translatePigLatin(str) {\n\n let vowels = /[aeiou]/;\n let consts = /[^aeiou]/;\n\n\n //if statement acts as an error prevention when using match.index, without it match.index finds a null value in words without vowels.\n if (str.includes(\"a\") || str.includes(\"e\")|| str.includes(\"i\")|| str.includes(\"o\")|| str.includes(\"u\")){\n //matches index of first vowel\n var index = str.match(vowels).index;\n //if the first letter of the word is not a vowel\n if (index !== 0) {\n //slice beginning from start of word UP TO first vowel\n let sliced = str.slice(0, index);\n console.log(sliced);\n //slice from first vowel to end, add letters before the vowel and add \"ay\"\n return str.slice(index) + sliced + 'ay';\n } else {\n //if first letter is a vowel, just add way to end\n return str + \"way\"\n } \n } else {\n //if no vowel is in word, add ay to end\n return str + \"ay\"\n }\n }", "function disemvowel(string) {\n // your code here...\n //let splitString = string.split('');\n let vowels = ['a', 'e', 'i', 'o', 'u'];\n let disemvoweledString = [];\n \n for (var i = 0; i < splitString.length; i++) {\n if (vowels.indexOf(splitString[i]) === -1) {\n disemvoweledString.push(splitString[i]);\n }\n }\n return disemvoweledString.join('');\n}", "function vowels(str) {\n const regex = /[aeiouAEIOU]/\n return [...str].reduce((acc, curr) => {\n curr.match(regex) ? acc += 1 : null\n return acc\n }, 0)\n}", "function vowelCounter(str) {\n var count = 0;\n for (var i = 0; i < str.length; i++) {\n var l = str.charAt(i).toLowerCase();\n if (l === 'a' || l === 'e' || l === 'i' || l === 'o' || l === 'u') {\n count++;\n }\n }\n return count;\n}", "isAVowel(character){\n var vowels = ['a', 'e', 'i', 'o', 'u'];\n var isAVowel = false;\n\n vowels.forEach(function(vowel){\n if(character === vowel){\n isAVowel = true;\n }\n });\n\n return isAVowel;\n }", "function countVowels(string) {\n if (string.length === 0) {\n return 0;\n }\n if (string.slice(0, 1).toUpperCase() === \"A\" || string.slice(0, 1).toUpperCase() === \"E\" \n || string.slice(0, 1).toUpperCase() === \"I\" || string.slice(0, 1).toUpperCase() === \"O\" \n || string.slice(0, 1).toUpperCase() === \"U\") {\n return increment(countVowels(string.slice(1)));\n }\n return countVowels(string.slice(1))\n}", "function isVowel(letter){\n return ['a', 'e', 'i', 'o', 'u'].indexOf(letter.toLowerCase()) !== -1\n}", "function LetterChanges(str) { \n\n // code goes here \n \n let expectedRes = str.split('')\n let res = [];\n let regExp = ''; \n let vowels = 'aeiou'\n \n expectedRes.forEach(function(item, index){\n if (item.match('^[a-zA-Z]')){\n res[index] = String.fromCharCode(item.charCodeAt()+1)\n regExp += vowels.includes(res[index].toLowerCase()) ? res[index].toUpperCase(): res[index]\n }else{\n res[index] = item\n regExp += item\n }\n \n })\n \n return regExp; \n \n }", "function isCharacterAVowel(char) {\n //const check = \"a, e, i , o , u\";\n if (char === \"a\" || char === \"e\" || char === \"i\" || char === \"o\" || char === \"u\") {\n console.log(\"true\");\n }else console.log(\"false\");\n}", "function isVowel (char, idx, s) {\n expect(s[idx]).toBe(char);\n\n return ~\"aeiouAEIOU\".indexOf(char);\n }", "function isVowel(char){\n \"use strict\";\n var vowel = [\"a\", \"e\", \"i\", \"o\", \"u\"];\n for (var i = 0; i < vowel.length; i++){\n if(char === vowel[i]){\n return true;\n }\n\n }\n return false;\n}", "function Vowels(str5) {\n var sliptString = str5.split(\"\");\n var vowels = [\"a\", \"e\", \"i\", \"o\", \"u\", \"y\"];\n return sliptString.reduce(function(acc, next) {\n if (vowels.indexOf(next) !== -1) {\n acc += 1;\n }\n return acc;\n }, 0)\n}", "function allSameVowels (input) {\n return input.every(function(val){\n return (typeof val === 'string') && vowelCheck(val);\n });\n}", "function i_am_making_wordsStartsWithVowel_bolder() {\n var str = \"what ever i am writing here or have wrote this is all my (first) imagination (second) creation, words with all 5 vowels, which i got from dictionary one by one page, i think all will enjoy and increase knowledge thats my education.\";\n var s = '';\n var spaceFlag = 0;\n var capitalFlag = 0;\n for (var i = 0; i < str.length; i++) {\n if (spaceFlag == 1 || i == 0) {\n if (str[i].toLowerCase() == 'a' ||\n str[i].toLowerCase() == 'e' ||\n str[i].toLowerCase() == 'i' ||\n str[i].toLowerCase() == 'o' ||\n str[i].toLowerCase() == 'u') {\n capitalFlag = 1;\n }\n }\n if (str[i] == \" \" && spaceFlag == 0) {\n spaceFlag = 1;\n capitalFlag = 0;\n }\n else if (str[i] != \" \") {\n spaceFlag = 0;\n }\n if (capitalFlag == 1) {\n s += str[i].toUpperCase();\n }\n\n else {\n s += str[i];\n }\n\n }\n return s;\n}", "function isVowel(ch){\n \"use strict\";\n return [\"a\", \"e\", \"i\", \"o\", \"u\"].indexOf(ch.toLowerCase()) !== -1;\n}" ]
[ "0.7497796", "0.7387954", "0.7287353", "0.7276527", "0.7273266", "0.72594506", "0.7253078", "0.7246158", "0.7206349", "0.7148782", "0.7117476", "0.70991534", "0.708415", "0.7076679", "0.70739627", "0.70650125", "0.7055043", "0.7050538", "0.7039139", "0.70216256", "0.7006375", "0.70057565", "0.70054954", "0.700133", "0.6982904", "0.6976701", "0.69698405", "0.6969451", "0.6961504", "0.6956063", "0.69523543", "0.6947856", "0.693573", "0.693563", "0.69304603", "0.69261855", "0.6906358", "0.68982947", "0.6892423", "0.6888645", "0.68878233", "0.6886273", "0.6882923", "0.68787426", "0.68666935", "0.68619514", "0.68394405", "0.6831215", "0.6817048", "0.6813857", "0.6810326", "0.68023187", "0.6799551", "0.6795372", "0.6795145", "0.6793752", "0.6784012", "0.6783232", "0.678005", "0.6772028", "0.6767788", "0.67575836", "0.6748096", "0.674662", "0.67446125", "0.6744489", "0.6742914", "0.6735088", "0.67209697", "0.6701195", "0.67011243", "0.66966176", "0.6693801", "0.6682924", "0.6675902", "0.6673935", "0.6672105", "0.6664814", "0.6663477", "0.6660874", "0.66579044", "0.6656374", "0.6654602", "0.6651702", "0.6651653", "0.6650081", "0.66493237", "0.6646216", "0.6634941", "0.663416", "0.6633104", "0.6631619", "0.66315025", "0.66217864", "0.66207093", "0.6617734", "0.6614119", "0.66134226", "0.6606222", "0.6601521", "0.6580421" ]
0.0
-1
mask cpf event => object return void
cpf(event){ let isObj = typeof event == 'object', isEmpty = event.target.value.length <= 0; event.target.setAttribute('maxLength', 14); if(!isObj || isEmpty){ throw new Error('Bad format object'); } let v = event.target.value; event.target.value = v .replace(/\D/g, '') .replace(/(\d{3})(\d)/, '$1.$2') .replace(/(\d{3})(\d)/, '$1.$2') .replace(/(\d{3})(\d{1,2})/, '$1-$2') .replace(/(-\d{2})\d+?$/, '$1'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "cancelEvent() {\n }", "off(event) { // TODO\n\n }", "off(event) { // TODO\n\n }", "_evtChange(event) { }", "pcBindEvent(){ return false }", "handleEvent() {}", "handleEvent() {}", "onEvent() {\n \n }", "function calibrationEvent(event){}", "ignoreEvent(event) { return true; }", "function markTouch(event) {\n event && (event.zrByTouch = true);\n} // function markTriggeredFromLocal(event) {", "function markTouch(event) {\n event && (event.zrByTouch = true);\n} // function markTriggeredFromLocal(event) {", "filterEvent(event) {\n return false;\n }", "function dumbListener2(event) {}", "function dumbListener2(event) {}", "function ev_canvas (ev) {\n if (ev.layerX || ev.layerY == 0) {\n ev._x = ev.layerX;\n ev._y = ev.layerY;\n } \n\n // Chama o manipulador de eventos da ferramenta.\n var func = ferramenta[ev.type];\n if (func) {\n func(ev);\n }\n }", "function MascaraCPF(cpf, event){\n if(mascaraInteiro(cpf, event)==false){\n event.returnValue = false;\n return false;\n } \n return formataCampo(cpf, '000.000.000-00', event);\n}", "function InternalEvent() {}", "cancelByEventTypeMask(eventTypeMask) {\n this.events = this.events.filter(e => !e.matchesEventTypeMask(eventTypeMask));\n }", "function De(e){e.prototype.on=function(e,t){ni(this,e,t)},e.prototype.off=function(e,t){ke(this,e,t)}}", "function mask_cpfcnpj(obj, event)\n{\n if ( obj.value.length > 14 )\n MascaraCNPJ(obj, event);\n else\n MascaraCPF(obj, event);\n}", "function InternalEvent() { }", "function InternalEvent() { }", "function InternalEvent() { }", "function InternalEvent() { }", "function InternalEvent() { }", "function SaveCmapEventHandler(sender){this.sender=sender;}", "oqnEvent () {\n this.skipInfect = 1\n }", "function voidfunct(e){\r\n mp.trigger(\"CallActionCEFtoClient\", function_ret[e.currentTarget.dataset.descriptor], 1);\r\n \r\n //alert(\"choix : \"+function_ret[e.currentTarget.dataset.descriptor]);\r\n}", "function constroiEventos(){}", "hook(evt) {\n if (clipboard.intercept) {\n evt.preventDefault(); // prevents copying highlighted section into clipboard\n evt.clipboardData.setData(\"text/html\", clipboard.data);\n\n // reset when done\n clipboard.intercept = false;\n clipboard.data = \"\";\n }\n }", "cancel(e) { }", "_evtClick(event) { }", "function Eventable()\n{\n\n}", "handleEvents() {\n }", "function signalDOMEvent(cm, e, override) {\n\t\t if (typeof e == \"string\")\n\t\t e = {type: e, preventDefault: function() { this.defaultPrevented = true; }};\n\t\t signal(cm, override || e.type, cm, e);\n\t\t return e_defaultPrevented(e) || e.codemirrorIgnore;\n\t\t }", "_onChange() {\n void this._debouncer.invoke();\n }", "_noopInputHandler() {\n // no-op handler that ensures we're running change detection on input events.\n }", "function C(){F.forEach(function(e){var t=e.eventType,n=e.handler;Q.reference.removeEventListener(t,n)})}", "function signalDOMEvent(cm, e, override) {\n\t\t if (typeof e == \"string\")\n\t\t { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n\t\t signal(cm, override || e.type, cm, e);\n\t\t return e_defaultPrevented(e) || e.codemirrorIgnore\n\t\t }", "Interrupt() {\n\n }", "function Event() { }", "function Event() { }", "onStoreAfterRequest(event) {\n if (this.activeMask && !event.exception) {\n this.unmaskBody();\n }\n }", "nameBlur(e) {\n\n }", "function filterEventHandler(e) {\n var copyData = canvasInstance.getCopyData();\n if (!copyData) {\n return alert(\"Please select an image first.\");\n }\n var imageData = canvasInstance.getImageData();\n var context = canvasInstance.getContext();\n var data = imageData.data;\n restore(data, copyData); \n var map = filterMapInstance.getMyFilterMap();\n var key = parseInt(e.target.id);\n \n var tempData = map.get(key)(data, imageData.width, imageData.height); //respective filter handled\n \n canvasInstance.setFilterData(tempData);\n restore(data, tempData);\n context.putImageData(imageData, 0, 0);\n MainApp.getInstance().resetSliders();\n }", "end(event) {\n\n }", "handleEventChange() {\n }", "nonMaskableInterrupt() {\n this.interrupt(false);\n }", "function EventState(mask,skipNextObservers){if(skipNextObservers===void 0){skipNextObservers=false;}this.initalize(mask,skipNextObservers);}", "function unwireEvents() {\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].remove(this.element, 'keydown', maskInputKeyDownHandler);\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].remove(this.element, 'keypress', maskInputKeyPressHandler);\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].remove(this.element, 'keyup', maskInputKeyUpHandler);\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].remove(this.element, 'input', maskInputHandler);\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].remove(this.element, 'focus', maskInputFocusHandler);\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].remove(this.element, 'blur', maskInputBlurHandler);\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].remove(this.element, 'paste', maskInputPasteHandler);\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].remove(this.element, 'cut', maskInputCutHandler);\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].remove(this.element, 'mousedown', maskInputMouseDownHandler);\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].remove(this.element, 'mouseup', maskInputMouseUpHandler);\n if (this.formElement) {\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].remove(this.formElement, 'reset', resetFormHandler);\n }\n}", "pointercancel(payload) {\n domEventSequences.pointercancel(node, payload);\n }", "function on(e){vt(e.curOp,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;sn(e)})}", "stopEvent(event) {\n return false;\n }", "function handler() {\n applyFishEye(\n sig.mousecaptor.mouseX,\n sig.mousecaptor.mouseY\n );\n }", "action(type, px, py, evt) { console.log('Action callback'); }", "function cancelHandler(event) {\n event.cancelBubble = true;\n\n if (event.stopPropagation) {\n event.stopPropagation();\n }\n } // This handler ignores the current event in the InfoBox and conditionally prevents", "function callCB(event) {\n console.log('SimpleCTI.callCB | event: ', event);\n }", "function signal(event) {\n return event;\n }", "maskableInterrupt() {\n if (this.regs.iff1 !== 0) {\n this.interrupt(true);\n }\n }", "function FsEventsHandler() {}", "function handleEvent(event) {\n\n }", "forecastEvent () {\n // Eeeesh :/\n }", "off() {\r\n throw new Error('Abstract method \"off\" must be implemented');\r\n }", "function signal(event) {\n return event;\n}", "function handler() {\n applyFishEye(\n sig.mousecaptor.mouseX,\n sig.mousecaptor.mouseY\n );\n }", "if (event.defaultPrevented) {\n return;\n }", "function signalDOMEvent(cm, e, override) {\n\t if (typeof e == \"string\")\n\t e = {type: e, preventDefault: function() { this.defaultPrevented = true; }};\n\t signal(cm, override || e.type, cm, e);\n\t return e_defaultPrevented(e) || e.codemirrorIgnore;\n\t }", "function signalDOMEvent(cm, e, override) {\n\t if (typeof e == \"string\")\n\t e = {type: e, preventDefault: function() { this.defaultPrevented = true; }};\n\t signal(cm, override || e.type, cm, e);\n\t return e_defaultPrevented(e) || e.codemirrorIgnore;\n\t }", "function signalDOMEvent(cm, e, override) {\n\t if (typeof e == \"string\")\n\t e = {type: e, preventDefault: function() { this.defaultPrevented = true; }};\n\t signal(cm, override || e.type, cm, e);\n\t return e_defaultPrevented(e) || e.codemirrorIgnore;\n\t }", "function MaskMarkerVisitor() {\n}", "static set EVENT( value ) {\n overtakenAdaptEvent = value;\n }", "onModifyAtk() {}", "onCapture(event) {\n if (event === null) {\n } else {\n this.onDecode(event.result);\n }\n }", "function callback_C(e, C_) {\n C = C_;\n update_and_publish();\n }", "acceptCancel() {}", "function OnClipBoardAlert()\n{\n}", "_cancel() {\n this.dispatchEvent(new CustomEvent('cancel', {\n composed: true\n }));\n }", "_beforeChange () {\n // nop\n }", "_beforeChange () {\n // nop\n }", "removeEvents() {\n }", "onGhostPointerMove(e) {\r\n // do nothing\r\n }", "function PlcEvento (){\r\n\t\r\n}", "function Events(){}//", "function Events(){}//", "function emitNone(handler,isFn,self){if(isFn)handler.call(self);else{var len=handler.length;var listeners=arrayClone(handler,len);for(var i=0;i<len;++i){listeners[i].call(self);}}}", "function emitNone(handler,isFn,self){if(isFn)handler.call(self);else{var len=handler.length;var listeners=arrayClone(handler,len);for(var i=0;i<len;++i){listeners[i].call(self);}}}", "emitReserved(ev, ...args) {\n super.emit(ev, ...args);\n return this;\n }", "function signalDOMEvent(cm, e, override) {\r\n signal(cm, override || e.type, cm, e);\r\n return e_defaultPrevented(e) || e.codemirrorIgnore;\r\n }", "registerOnChange(fn) {\n this._cvaOnChange = fn;\n }", "registerOnChange(fn) {\n this._cvaOnChange = fn;\n }", "onBlur() {\r\n // Stub\r\n }", "function orchestra(event) {\n\n}", "function signalDOMEvent(cm, e, override) {\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore;\n }", "function signalDOMEvent(cm, e, override) {\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore;\n }", "function psEventHandler(event) {\n var event_type = event.type;\n // Prevent invocation when triggered manually from $ps_wrap\n if (!ps_wrap_do_not_trigger_map[event_type]) {\n //console.log('triggered ' + event_type);\n ps_do_not_trigger_map[event_type] = true;\n $ps_wrap.trigger(event_type);\n ps_do_not_trigger_map[event_type] = false;\n }\n }", "function ignr(o, t, f)\r\n{\r\n if (o.removeEventListener){\r\n // Because MSIE only has a bubbling phase, capture will always be false.\r\n o.removeEventListener(t, f, false);\r\n return true;\r\n } else if (o.detachEvent){\r\n return o.detachEvent(\"on\" + t, f);\r\n }\r\n return false;\r\n}", "featureClickEventHandler(event) {\r\n this.featureEventResponse(event);\r\n }", "end () {\n this.controlPoint.removeEventListener('characteristicvaluechanged', this.onEvent)\n }", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }" ]
[ "0.6373487", "0.63611615", "0.63611615", "0.6060489", "0.6045444", "0.5886854", "0.5886854", "0.58657736", "0.5735761", "0.57088494", "0.5656955", "0.5656955", "0.56511617", "0.5632864", "0.5632864", "0.56286216", "0.5614322", "0.56023324", "0.56001896", "0.5550384", "0.5531004", "0.5500628", "0.5500628", "0.5500628", "0.5500628", "0.5500628", "0.5491005", "0.54583275", "0.5420486", "0.53544885", "0.5325545", "0.5314658", "0.5313316", "0.53053534", "0.5297377", "0.52832735", "0.527975", "0.52783984", "0.527731", "0.5268728", "0.5264211", "0.5241594", "0.5241594", "0.52401197", "0.52355605", "0.52326727", "0.5222938", "0.5216581", "0.52111435", "0.5209966", "0.5204608", "0.519823", "0.5195301", "0.5192342", "0.518908", "0.5176374", "0.5169591", "0.5156972", "0.5153205", "0.514767", "0.51458675", "0.5145057", "0.5141991", "0.5141878", "0.5121961", "0.51158243", "0.51141775", "0.5113258", "0.5113258", "0.5113258", "0.511292", "0.5111277", "0.51037097", "0.5093752", "0.50921065", "0.50894094", "0.50863576", "0.5082577", "0.5081013", "0.5081013", "0.50805056", "0.5074228", "0.50735813", "0.50606483", "0.50606483", "0.50559705", "0.50559705", "0.5049278", "0.5035643", "0.5029232", "0.5029232", "0.5028267", "0.50247496", "0.50222534", "0.50222534", "0.5015578", "0.5013422", "0.5009582", "0.5003674", "0.50028455", "0.50028455" ]
0.0
-1
mask cnpj event => object return void
cnpj(event){ let isObj = typeof event == 'object', isEmpty = event.target.value.length <= 0; event.target.setAttribute('maxLength', 18); if(!isObj || isEmpty){ throw new Error('Bad format object'); } let v = event.target.value; event.target.value = v .replace(/\D/g, '') .replace(/(\d{2})(\d)/, "$1.$2") .replace(/(\d{3})(\d)/, "$1.$2") .replace(/(\d{3})(\d)/, "$1/$2") .replace(/(\d{4})(\d)/, "$1-$2") .replace(/(-\d{2})\d+?$/, "$1"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "pcBindEvent(){ return false }", "off(event) { // TODO\n\n }", "off(event) { // TODO\n\n }", "handleEvent() {}", "handleEvent() {}", "cancelEvent() {\n }", "onEvent() {\n \n }", "function InternalEvent() {}", "function InternalEvent() { }", "function InternalEvent() { }", "function InternalEvent() { }", "function InternalEvent() { }", "function InternalEvent() { }", "_evtChange(event) { }", "ignoreEvent(event) { return true; }", "function dumbListener2(event) {}", "function dumbListener2(event) {}", "_evtClick(event) { }", "function De(e){e.prototype.on=function(e,t){ni(this,e,t)},e.prototype.off=function(e,t){ke(this,e,t)}}", "handleEvents() {\n }", "oqnEvent () {\n this.skipInfect = 1\n }", "function psEventHandler(event) {\n var event_type = event.type;\n // Prevent invocation when triggered manually from $ps_wrap\n if (!ps_wrap_do_not_trigger_map[event_type]) {\n //console.log('triggered ' + event_type);\n ps_do_not_trigger_map[event_type] = true;\n $ps_wrap.trigger(event_type);\n ps_do_not_trigger_map[event_type] = false;\n }\n }", "function signalDOMEvent(cm, e, override) {\n\t\t if (typeof e == \"string\")\n\t\t e = {type: e, preventDefault: function() { this.defaultPrevented = true; }};\n\t\t signal(cm, override || e.type, cm, e);\n\t\t return e_defaultPrevented(e) || e.codemirrorIgnore;\n\t\t }", "function voidfunct(e){\r\n mp.trigger(\"CallActionCEFtoClient\", function_ret[e.currentTarget.dataset.descriptor], 1);\r\n \r\n //alert(\"choix : \"+function_ret[e.currentTarget.dataset.descriptor]);\r\n}", "function signalDOMEvent(cm, e, override) {\n\t\t if (typeof e == \"string\")\n\t\t { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n\t\t signal(cm, override || e.type, cm, e);\n\t\t return e_defaultPrevented(e) || e.codemirrorIgnore\n\t\t }", "function Eventable()\n{\n\n}", "function Event() { }", "function Event() { }", "function SaveCmapEventHandler(sender){this.sender=sender;}", "function handleEvent(event) {\n\n }", "function signalDOMEvent(cm, e, override) {\n\t if (typeof e == \"string\")\n\t e = {type: e, preventDefault: function() { this.defaultPrevented = true; }};\n\t signal(cm, override || e.type, cm, e);\n\t return e_defaultPrevented(e) || e.codemirrorIgnore;\n\t }", "function signalDOMEvent(cm, e, override) {\n\t if (typeof e == \"string\")\n\t e = {type: e, preventDefault: function() { this.defaultPrevented = true; }};\n\t signal(cm, override || e.type, cm, e);\n\t return e_defaultPrevented(e) || e.codemirrorIgnore;\n\t }", "function signalDOMEvent(cm, e, override) {\n\t if (typeof e == \"string\")\n\t e = {type: e, preventDefault: function() { this.defaultPrevented = true; }};\n\t signal(cm, override || e.type, cm, e);\n\t return e_defaultPrevented(e) || e.codemirrorIgnore;\n\t }", "handleEventChange() {\n }", "static set EVENT( value ) {\n overtakenAdaptEvent = value;\n }", "end(event) {\n\n }", "function constroiEventos(){}", "_onTap(e) {}", "function calibrationEvent(event){}", "stopEvent(event) {\n return false;\n }", "function signalDOMEvent(cm, e, override) {\r\n signal(cm, override || e.type, cm, e);\r\n return e_defaultPrevented(e) || e.codemirrorIgnore;\r\n }", "function signalDOMEvent(cm, e, override) {\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore;\n }", "function signalDOMEvent(cm, e, override) {\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore;\n }", "action(type, px, py, evt) { console.log('Action callback'); }", "function callCB(event) {\n console.log('SimpleCTI.callCB | event: ', event);\n }", "notify (event) {\n this.indoorBikeData.notify(event)\n }", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }", "_onChange() {\n void this._debouncer.invoke();\n }", "onModifyAtk() {}", "function signal(event) {\n return event;\n}", "function Events(){}//", "function Events(){}//", "function signal(event) {\n return event;\n }", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n e = {type: e, preventDefault: function() { this.defaultPrevented = true; }};\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore;\n }", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n e = {type: e, preventDefault: function() { this.defaultPrevented = true; }};\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore;\n }", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n e = {type: e, preventDefault: function() { this.defaultPrevented = true; }};\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore;\n }", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n e = {type: e, preventDefault: function() { this.defaultPrevented = true; }};\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore;\n }", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n e = {type: e, preventDefault: function() { this.defaultPrevented = true; }};\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore;\n }", "function holaMundo(){\n alert(\"Hola mundo\")\n console.log(event)\n }", "function markTouch(event) {\n event && (event.zrByTouch = true);\n} // function markTriggeredFromLocal(event) {", "function markTouch(event) {\n event && (event.zrByTouch = true);\n} // function markTriggeredFromLocal(event) {", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\") {\n e = {\n type: e,\n preventDefault: function preventDefault() {\n this.defaultPrevented = true;\n }\n };\n }\n\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore;\n }", "function on(e){vt(e.curOp,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;sn(e)})}", "function PlcEvento (){\r\n\t\r\n}", "_noopInputHandler() {\n // no-op handler that ensures we're running change detection on input events.\n }", "onMessage() {}", "onMessage() {}", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n}", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n}", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n}", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n}", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n}", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n}", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n}", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n}", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n}", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n}", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n}", "function ndefListener(nfcEvent) {\r\n console.log(JSON.stringify(nfcEvent.tag));\r\n navigator.notification.vibrate(500);\r\n}", "DisconnectEvents() {\n\n }", "pointercancel(payload) {\n domEventSequences.pointercancel(node, payload);\n }", "emitReserved(ev, ...args) {\n super.emit(ev, ...args);\n return this;\n }", "adoptedCallback() {}", "adoptedCallback() {}", "function serialEvent(){\n\n}" ]
[ "0.6668219", "0.65903574", "0.65903574", "0.6519867", "0.6519867", "0.6497433", "0.6435944", "0.6423412", "0.6326642", "0.6326642", "0.6326642", "0.6326642", "0.6326642", "0.63048786", "0.61810344", "0.60681367", "0.60681367", "0.6038464", "0.6000863", "0.59667486", "0.59620863", "0.5925454", "0.5867068", "0.5846024", "0.584512", "0.5826814", "0.575819", "0.575819", "0.57165027", "0.5692985", "0.56887084", "0.56887084", "0.56887084", "0.5678707", "0.56747097", "0.5665735", "0.5653222", "0.5639546", "0.5588528", "0.55723906", "0.5562251", "0.5555769", "0.5555769", "0.5544116", "0.55428326", "0.55418587", "0.553889", "0.553889", "0.553889", "0.553889", "0.553889", "0.553889", "0.553889", "0.553889", "0.553889", "0.553889", "0.553889", "0.553889", "0.553889", "0.553889", "0.553889", "0.553889", "0.553889", "0.5527079", "0.5509952", "0.5498409", "0.5491023", "0.5491023", "0.54908764", "0.548167", "0.548167", "0.548167", "0.548167", "0.548167", "0.54774296", "0.5473403", "0.5473403", "0.5466943", "0.5463971", "0.5462936", "0.54613274", "0.545267", "0.545267", "0.5442314", "0.5442314", "0.5442314", "0.5442314", "0.5442314", "0.5442314", "0.5442314", "0.5442314", "0.5442314", "0.5442314", "0.5442314", "0.5441987", "0.5441316", "0.54404867", "0.54333484", "0.54286593", "0.54286593", "0.54246646" ]
0.0
-1
Format static value value => string lang => language by default is ptBR currency => coin local of your country
moneyBr(value, lang = 'pt-BR', currency = 'BRL'){ return new Intl.NumberFormat(lang, { style: 'currency', currency: currency }).format(value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formatUSCurrency(val) {\r\n return val.toLocaleString('en-US',\r\n {style: \"currency\", currency: \"USD\"});\r\n}", "callback(value) {\n return formatCurrency(value, 4);\n }", "formatCurrency(value) {\n // get signal\n const signal = Number(value) < 0 ? '-' : ''\n //clean string\n // \\D -> Encontre tudo que náo é number\n value = String(value).replace(/\\D/g, '')\n // convert \n value = Number(value) / 100\n value = value.toLocaleString(\"pt-BR\", {\n style: \"currency\",\n currency: \"BRL\"\n })\n\n return signal + value\n }", "function change(val){\r\n \tval = Ext.util.Format.currency(val,' TL',2,true);\r\n return val;\r\n }", "function currencyFormat(label) {\n let formatCurrency = new Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n minimumFractionDigits: 2,\n });\n return formatCurrency.format(Number(label));\n }", "formatToLanguage() {\n const format = this.props.cardToShow.split('.')[this.props.cardToShow.split('.').length-1];\n switch (format) {\n case 'js': return 'javascript';\n case 'py': return 'python3';\n case 'rb': return 'ruby';\n case 'html': return 'html';\n case 'css': return 'html';\n case 'java': return 'java';\n case 'cpp': return 'cpp';\n case 'cs': return 'csharp';\n default: return '';\n }\n }", "callback(value) {\n return formatCurrency(value, 0);\n }", "static getLocale() {\n return 'en_US';\n }", "function langCode(value) {\n switch (value) {\n case 'eng':\n return 'e';\n case 'spa':\n return 's';\n case 'ger':\n return 'g';\n }\n}", "function formatLocalizedPrice (price) {\n return new Intl.NumberFormat(navigator.language, {style: 'currency', currency: price.currencyCode}).format(price.value);\n }", "function sign(){\n switch(cto.value){\n case value = \"usdollar\":\n bruh=\"$\"; break;\n case value = 'cadollar':\n bruh=\"CA$\"; break;\n case value = 'euro':\n bruh=\"E\"; break;\n case value = 'pound':\n bruh=\"£\"; break;\n case value = 'moroccan':\n bruh=\"Dh\"; break;\n case value = 'yen':\n bruh=\"¥\"; break;\n default:\n bruh=\"g\"\n }\n return bruh\n}", "convert() {\n return `${(this.payments.type.price[this.currencyType] / 100)}`;\n }", "getPrice() {\n return `${this.price} euros`;\n }", "static formatCurrency(x) {\n return \"₱\" + x.toFixed(2).toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n }", "function realCurrency(number){\r\n let value = number\r\n \r\n let result = value.toLocaleString('pt-br', {style: 'currency', currency: 'BRL'});\r\n\r\n return result\r\n}", "function formatoCurrency(valor) {\n var currency = 0;\n currency = valor.toFixed(2).replace(/(\\d)(?=(\\d{3})+(?!\\d))/g, \"$1,\");\n return currency;\n}", "function formatCurrency(val) {\n\tvar ele = new PM.OutputField();\n\tele.dataType = 'largedecimal';\n\tele.defaultValue = '0';\n\tele.formatter = 'usd';\n\tvar retVal = ele.format(val);\n\tele = null;\n\treturn retVal;\n}", "currencyString() {\n switch (GameConstants.Currency[this.cost.currency]) {\n case 'money':\n return 'Pokédollars';\n default:\n return `${GameConstants.camelCaseToString(GameConstants.Currency[this.cost.currency])}s`;\n }\n }", "formatMoney(value) {\n const formatter = new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency: 'USD',\n minimumFractionDigits: 0\n });\n return formatter.format(value);\n }", "function local() {\r\n let country = \"Portugal\";\r\n }", "function getLanguage() {\n return 'en-us';\n}", "function usCurrency$Format(num) {\n return '$' + num.toFixed(2).replace(/(\\d)(?=(\\d{3})+\\.)/g, '$1,');\n }", "getVatFieldLabel() {\n const vatLabel = get(\n COUNTRIES_VAT_LABEL,\n this.signUpFormCtrl.model.country.toUpperCase(),\n );\n\n if (vatLabel) {\n return this.$filter('translateDefault')(\n `sign_up_activity_field_vat_${this.signUpFormCtrl.model.legalform}_more`,\n 'sign_up_activity_field_vat_more',\n { vatLabel },\n undefined,\n false,\n 'escapeParameters',\n );\n }\n return this.$filter('translateDefault')(\n `sign_up_activity_field_vat_${this.signUpFormCtrl.model.legalform}`,\n `sign_up_activity_field_vat`,\n { vatLabel },\n undefined,\n false,\n 'escapeParameters',\n );\n }", "getLang(){\n\t\treturn data.lang;\n\t}", "function getCulturalFloat(obj,culture)\n {\n if(culture==\"nl-NL\")\n {\n obj=obj.replace(\",\",\".\");\n obj=parseFloat(obj).toFixed(2);\n return obj;\n } \n else\n {\n obj=parseFloat(obj).toFixed(2);\n return obj;\n\n }\n}", "get() {\n return defaultLocale;\n }", "function currency ( value ) {\n\treturn \"£\" + _number(value);\n}", "function rd_localize(strVar){\r if(app.isoLanguage === \"en_US\"){\r return strVar[\"en\"];\r }else if(app.isoLanguage === \"de_DE\"){\r return strVar[\"de\"];\r }\r \r\r }", "function formatCurrency(amount, currency) {\n // return Intl.NumberFormat('en-US'), // you can also leave blank the language but it will not take the sign of the currency\n return Intl.NumberFormat('en-US', {\n style: 'currency',\n currency, // which is the currency you passed in: like: currency: currency,\n }).format(amount);\n}", "function rd_localize(strVar){\r if(app.isoLanguage === \"en_US\"){\r return strVar[\"en\"];\r }else if(app.isoLanguage === \"de_DE\"){\r return strVar[\"de\"];\r }\r }", "function parse(value) {\n value = value || 0;\n var regex = new RegExp(\"[\\\\,\\\\\" + options.currencySymbol + \"]\", 'g');\n return value.toString().replace(regex, '');\n }", "function get_language(langue){\r\n\t// Langue par défaut : Anglais\r\n\tadd_log(3, \"get_language() > Début.\");\r\n\tswitch(langue_serveur) { \r\n\t\tcase \"fr\": // French\r\n\t\t\t// Les batiments :\r\n\t\t\tlangue_batiments['1'] = \"Bûcheron\";\r\n\t\t\tlangue_batiments['2'] = \"Carrière d'argile\";\r\n\t\t\tlangue_batiments['3'] = \"Mine de fer\";\r\n\t\t\tlangue_batiments['4'] = \"Ferme\";\r\n\t\t\tlangue_batiments['5'] = \"Scierie\";\r\n\t\t\tlangue_batiments['6'] = \"Usine de poteries\";\r\n\t\t\tlangue_batiments['7'] = \"Fonderie\";\r\n\t\t\tlangue_batiments['8'] = \"Moulin\";\r\n\t\t\tlangue_batiments['9'] = \"Boulangerie\";\r\n\t\t\tlangue_batiments['10'] = \"Dépôt de ressources\";\r\n\t\t\tlangue_batiments['11'] = \"Silo de céréales\";\r\n\t\t\tlangue_batiments['12'] = \"Armurerie\";\r\n\t\t\tlangue_batiments['13'] = \"Forge\";\r\n\t\t\tlangue_batiments['14'] = \"Place du tournoi\";\r\n\t\t\tlangue_batiments['15'] = \"Bâtiment principal\";\r\n\t\t\tlangue_batiments['16'] = \"Place de rassemblement\";\r\n\t\t\tlangue_batiments['17'] = \"Place du Marché\";\r\n\t\t\tlangue_batiments['18'] = \"Ambassade\";\r\n\t\t\tlangue_batiments['19'] = \"Caserne\";\r\n\t\t\tlangue_batiments['20'] = \"Écurie\";\r\n\t\t\tlangue_batiments['21'] = \"Atelier\";\r\n\t\t\tlangue_batiments['22'] = \"Académie\";\r\n\t\t\tlangue_batiments['23'] = \"Cachette\";\r\n\t\t\tlangue_batiments['24'] = \"Hôtel de ville\";\r\n\t\t\tlangue_batiments['25'] = \"Résidence\";\r\n\t\t\tlangue_batiments['26'] = \"Palais\";\r\n\t\t\tlangue_batiments['27'] = \"Chambre aux trésors\";\r\n\t\t\tlangue_batiments['28'] = \"Comptoir de commerce\";\r\n\t\t\tlangue_batiments['29'] = \"Grande caserne\";\r\n\t\t\tlangue_batiments['30'] = \"Grande écurie\";\r\n\t\t\tlangue_batiments['31'] = \"Mur d'enceinte\";\r\n\t\t\tlangue_batiments['32'] = \"Mur de terre\";\r\n\t\t\tlangue_batiments['33'] = \"Palissade\";\r\n\t\t\tlangue_batiments['34'] = \"Tailleur de pierre\";\r\n\t\t\tlangue_batiments['35'] = \"Brasserie\";\r\n\t\t\tlangue_batiments['36'] = \"Fabricant de pièges\";\r\n\t\t\tlangue_batiments['37'] = \"Manoir du héros\";\r\n\t\t\tlangue_batiments['38'] = \"Grand dépôt\";\r\n\t\t\tlangue_batiments['39'] = \"Grand silo\";\r\n\t\t\tlangue_batiments['40'] = \"Merveille du monde\";\r\n\t\t\tlangue_batiments['41'] = \"Abreuvoir\";\r\n\t\t\t// Ressources\r\n\t\t\tlangue_ressources['lumber'] = \"Bois\";\r\n\t\t\tlangue_ressources['clay'] = \"Argile\";\r\n\t\t\tlangue_ressources['iron'] = \"Fer\";\r\n\t\t\tlangue_ressources['crop'] = \"Céréales\";\r\n\t\t\t// Taches\r\n\t\t\tlangue_textes['build'] = \"Construire le bâtiment\";\r\n\t\t\tlangue_textes['upgrade'] = \"Augmenter\";\r\n\t\t\tlangue_textes['attack'] = \"Attaque\";\r\n\t\t\tlangue_textes['research'] = \"Rechercher\";\r\n\t\t\tlangue_textes['train'] = \"Entrainer\";\r\n\t\t\tlangue_textes['party'] = \"Fête\";\r\n\t\t\tlangue_textes['demolish'] = \"Démolir\";\r\n\t\t\tlangue_textes['send_merchants'] = \"Envoyer ressources\";\r\n\t\t\tlangue_textes['send_assistance'] = \"Envoyer une assistance\";\r\n\t\t\t// Textes\t\t\t\t\t\r\n\t\t\tlangue_textes['ressources'] = \"Ressources\";\r\n\t\t\tlangue_textes['villages'] = \"Villages\";\r\n\t\t\tlangue_textes['my_hero'] = \"Mon héro\";\r\n\t\t\tlangue_textes['task_list'] = \"Liste des tâches\";\r\n\t\t\tlangue_textes['options'] = \"Options Multi-Tools\";\r\n\t\t\tlangue_textes['options_right_side'] = \"Colonne de droite\";\r\n\t\t\tlangue_textes['replace_hero'] = \"Remplacer le cadre du héro ?\";\r\n\t\t\tlangue_textes['replace_player'] = \"Remplacer le cadre du joueur ?\";\r\n\t\t\tlangue_textes['replace_allianz'] = \"Remplacer le cadre de l'alliance ?\";\r\n\t\t\tlangue_textes['replace_village'] = \"Remplacer le cadre des villages ?\";\r\n\t\t\tlangue_textes['defense_village'] = \"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Ajouter le raccourci \\\"envoyer défense\\\" ?\";\r\n\t\t\tlangue_textes['merchant_village'] = \"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Ajouter le raccourci \\\"envoyer marchand\\\" ?\";\r\n\t\t\tlangue_textes['add_resource'] = \"Ajouter le cadre des barres de ressource ?\";\r\n\t\t\tlangue_textes['position_resource'] = \"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Avant ou après les villages ?\";\r\n\t\t\tlangue_textes['no'] = \"Non\";\r\n\t\t\tlangue_textes['yes'] = \"Oui\";\r\n\t\t\tlangue_textes['before_village'] = \"Avant les villages\";\r\n\t\t\tlangue_textes['after_village'] = \"Après les villages\";\r\n\t\t\tlangue_textes['options_various'] = \"Options diverses\";\r\n\t\t\tlangue_textes['replace_titre_page'] = \"Remplacer le nom de la page ?\";\r\n\t\t\tlangue_textes['save'] = \"Sauvegarder et fermer\";\r\n\t\t\tlangue_textes['replace_logo'] = \"Remplacer le logo original ?\";\r\n\t\t\tlangue_textes['ready'] = \"Prêt\";\r\n\t\t\tlangue_textes['never'] = \"Jamais\";\r\n\t\t\tlangue_textes['required_resources'] = \"Ressources nécessaires pour améliorer\";\r\n\t\t\tlangue_textes['insert_build_page'] = \"Afficher les ressources manquantes dans les pages de construction ?\";\r\n\t\t\tlangue_textes['infinity'] = \"Infini\";\r\n\t\t\tlangue_textes['upgrade_wharehouse'] = \"Vous devez améliorer le dépot de ressources.\";\r\n\t\t\tlangue_textes['upgrade_granary'] = \"Vous devez améliorer le dépot de céréales.\";\r\n\t\t\tlangue_textes['use_scheduler'] = \"Utiliser le planificateur ?\";\r\n\t\t\tlangue_textes['afficher_log'] = \"Niveau de log ?\";\r\n\t\t\tlangue_textes['add_build_list'] = \"- Ajouter à la liste des constructions -\";\r\n\t\t\tlangue_textes['add_build_box_titre'] = \"Ajouter une tâche (heure du serveur)\";\r\n\t\t\tlangue_textes['add_build_box_schedule'] = \"Planifier à :\";\r\n\t\t\tlangue_textes['add_build_box_format'] = \"(aaaa/mm/jj hh:mm:ss)\";\r\n\t\t\tbreak;\r\n\t\tcase \"ir\": // Persian by Mr_572\r\n\t\t\t// Buldings :\r\n\t\t\tlangue_batiments['1'] = \"هیزم شکن\";\r\n\t\t\tlangue_batiments['2'] = \"آجر سازی\";\r\n\t\t\tlangue_batiments['3'] = \"معدن آهن\";\r\n\t\t\tlangue_batiments['4'] = \"گندم زار\";\r\n\t\t\tlangue_batiments['5'] = \"چوب بری\";\r\n\t\t\tlangue_batiments['6'] = \"آجرپزی\";\r\n\t\t\tlangue_batiments['7'] = \"ذوب آهن\";\r\n\t\t\tlangue_batiments['8'] = \"آسیاب\";\r\n\t\t\tlangue_batiments['9'] = \"نانوایی\";\r\n\t\t\tlangue_batiments['10'] = \"آنبار\";\r\n\t\t\tlangue_batiments['11'] = \"آنبار غذا\";\r\n\t\t\tlangue_batiments['12'] = \"اسلحه سازی\";\r\n\t\t\tlangue_batiments['13'] = \"زره سازی\";\r\n\t\t\tlangue_batiments['14'] = \"میدان تمرین\";\r\n\t\t\tlangue_batiments['15'] = \"ساختمان اصلی\";\r\n\t\t\tlangue_batiments['16'] = \"اردوگاه\";\r\n\t\t\tlangue_batiments['17'] = \"بازار\";\r\n\t\t\tlangue_batiments['18'] = \"سفارت\";\r\n\t\t\tlangue_batiments['19'] = \"سربازخانه\";\r\n\t\t\tlangue_batiments['20'] = \"اصطبل\";\r\n\t\t\tlangue_batiments['21'] = \"کارگاه\";\r\n\t\t\tlangue_batiments['22'] = \"دارالفنون\";\r\n\t\t\tlangue_batiments['23'] = \"مخفیگاه\";\r\n\t\t\tlangue_batiments['24'] = \"تالار شهر\";\r\n\t\t\tlangue_batiments['25'] = \"اقامتگاه\";\r\n\t\t\tlangue_batiments['26'] = \"قصر\";\r\n\t\t\tlangue_batiments['27'] = \"خزانه\";\r\n\t\t\tlangue_batiments['28'] = \"تجارتخانه\";\r\n\t\t\tlangue_batiments['29'] = \"سربازخانه بزرگ\";\r\n\t\t\tlangue_batiments['30'] = \"اصطبل بزرگ\";\r\n\t\t\tlangue_batiments['31'] = \"دیوارشهر\";\r\n\t\t\tlangue_batiments['32'] = \"دیوار گلی\";\r\n\t\t\tlangue_batiments['33'] = \"پرچین\";\r\n\t\t\tlangue_batiments['34'] = \"سنگ تراشی\";\r\n\t\t\tlangue_batiments['35'] = \"قهوه خانه\";\r\n\t\t\tlangue_batiments['36'] = \"تله ساز\";\r\n\t\t\tlangue_batiments['37'] = \"عمارت قهرمان\";\r\n\t\t\tlangue_batiments['38'] = \"انبار بزرگ\";\r\n\t\t\tlangue_batiments['39'] = \"انبار غذای بزرگ\";\r\n\t\t\tlangue_batiments['40'] = \"شگفتی جهان\";\r\n\t\t\tlangue_batiments['41'] = \"آبشخور اسب\";\r\n\t\t\t// Ressources\r\n\t\t\tlangue_ressources['lumber'] = \"چوب\";\r\n\t\t\tlangue_ressources['clay'] = \"خشت\";\r\n\t\t\tlangue_ressources['iron'] = \"آهن\";\r\n\t\t\tlangue_ressources['crop'] = \"گندم\";\r\n\t\t\t// Tasks\r\n\t\t\tlangue_textes['build'] = \"ساختن\";\r\n\t\t\tlangue_textes['upgrade'] = \"ارتقاع\";\r\n\t\t\tlangue_textes['attack'] = \"حمله\";\r\n\t\t\tlangue_textes['research'] = \"تحقیق\";\r\n\t\t\tlangue_textes['train'] = \"تربیت\";\r\n\t\t\tlangue_textes['party'] = \"جشن\";\r\n\t\t\tlangue_textes['demolish'] = \"تخریب\";\r\n\t\t\tlangue_textes['send_merchants'] = \"ارسال تاجر\";\r\n\t\t\tlangue_textes['send_assistance'] = \"ارسال نیروی کمکی\";\r\n\t\t\t// Textes\t\t\t\t\t\r\n\t\t\tlangue_textes['ressources'] = \"منابع\";\r\n\t\t\tlangue_textes['villages'] = \"دهکده ها\";\r\n\t\t\tlangue_textes['my_hero'] = \"قهرمان\";\r\n\t\t\tlangue_textes['task_list'] = \"لیست وظایف\";\r\n\t\t\tlangue_textes['options'] = \"گزینه ها\";\r\n\t\t\tlangue_textes['options_right_side'] = \"ستون سمت چپ\";\r\n\t\t\tlangue_textes['replace_hero'] = \"بخش مربوط به قهرمان تغییر کند؟\";\r\n\t\t\tlangue_textes['replace_player'] = \"بخش مربوط به نام بازیکن تغییر کند؟\";\r\n\t\t\tlangue_textes['replace_allianz'] = \"بخش مربوط به اتحاد تغییر کند؟\";\r\n\t\t\tlangue_textes['replace_village'] = \"بخش مربوط به اسامی دهکده ها تغییر کند؟\";\r\n\t\t\tlangue_textes['defense_village'] = \"Add shortcut\\\"ارسال نیروی کمکی\\\" ?\";\r\n\t\t\tlangue_textes['merchant_village'] = \"Add shortcut \\\"ارسال منابع\\\" ?\";\r\n\t\t\tlangue_textes['add_resource'] = \"قسمت نوار منابع نمایش داده شود؟\";\r\n\t\t\tlangue_textes['position_resource'] = \"قبل یا بعد از بخش مربوط به اسامی دهکده ها\";\r\n\t\t\tlangue_textes['no'] = \"خیر\";\r\n\t\t\tlangue_textes['yes'] = \"بله\";\r\n\t\t\tlangue_textes['before_village'] = \"بعد از لیست دهکده ها\";\r\n\t\t\tlangue_textes['after_village'] = \"قبل از لیست دهکده ها\";\r\n\t\t\tlangue_textes['options_various'] = \"گزینه های مختلف\";\r\n\t\t\tlangue_textes['replace_titre_page'] = \"نام صفحه تغییر پیدا کند؟\";\r\n\t\t\tlangue_textes['save'] = \"Save and close\";\r\n\t\t\tlangue_textes['replace_logo'] = \"آرم تراوین تغییر کند؟\";\r\n\t\t\tlangue_textes['ready'] = \"آماده\";\r\n\t\t\tlangue_textes['never'] = \"هرگز\";\r\n\t\t\tlangue_textes['required_resources'] = \"منابع مورد نیاز برای ارتقاع\";\r\n\t\t\tlangue_textes['insert_build_page'] = \"نمایش منابع مورد نیاز در صفحه ساختمان؟\";\r\n\t\t\tlangue_textes['infinity'] = \"ارتقاع\";\r\n\t\t\tlangue_textes['upgrade_wharehouse'] = \"شما دارید برای ارتقاع انبار.\";\r\n\t\t\tlangue_textes['upgrade_granary'] = \" شما دارید برای ارتقاع انبار غذا.\";\r\n\t\t\tlangue_textes['use_scheduler'] = \"Use the scheduler ?\";\r\n\t\t\tlangue_textes['afficher_log'] = \"Log level ?\";\r\n\t\t\tlangue_textes['add_build_list'] = \"- Add to build list -\";\r\n\t\t\tlangue_textes['add_build_box_titre'] = \"Schedule task (Server time)\";\r\n\t\t\tlangue_textes['add_build_box_schedule'] = \"Schedule at :\";\r\n\t\t\tlangue_textes['add_build_box_format'] = \"(yyyy/mm/dd hh:mm:ss)\";\r\n\t\t\tbreak;\r\n\t\tcase \"sa\": // Arabic by Dream1\r\n\t\t// Buldings :\r\n\t\t\tlangue_batiments['1'] = \"الحطاب\";\r\n\t\t\tlangue_batiments['2'] = \"حفرة الطين\";\r\n\t\t\tlangue_batiments['3'] = \"منجم الحديد\";\r\n\t\t\tlangue_batiments['4'] = \"حقل القمح\";\r\n\t\t\tlangue_batiments['5'] = \"معمل النشار\";\r\n\t\t\tlangue_batiments['6'] = \"معمل البلوك\";\r\n\t\t\tlangue_batiments['7'] = \"مسبك الحديد\";\r\n\t\t\tlangue_batiments['8'] = \"المطاحن\";\r\n\t\t\tlangue_batiments['9'] = \"مخبز\";\r\n\t\t\tlangue_batiments['10'] = \"المخزن\";\r\n\t\t\tlangue_batiments['11'] = \"مخزن الحبوب\";\r\n\t\t\tlangue_batiments['12'] = \"الحداد\";\r\n\t\t\tlangue_batiments['13'] = \"مستودع الدروع\";\r\n\t\t\tlangue_batiments['14'] = \"ساحة البطولة\";\r\n\t\t\tlangue_batiments['15'] = \"المبنى الرئيسي\";\r\n\t\t\tlangue_batiments['16'] = \"نقطة التجمع\";\r\n\t\t\tlangue_batiments['17'] = \"السوق\";\r\n\t\t\tlangue_batiments['18'] = \"السفارة\";\r\n\t\t\tlangue_batiments['19'] = \"الثكنة\";\r\n\t\t\tlangue_batiments['20'] = \"إسطبل\";\r\n\t\t\tlangue_batiments['21'] = \"المصانع الحربية\";\r\n\t\t\tlangue_batiments['22'] = \"الأكادمية الحربية\";\r\n\t\t\tlangue_batiments['23'] = \"المخبأ\";\r\n\t\t\tlangue_batiments['24'] = \"البلدية\";\r\n\t\t\tlangue_batiments['25'] = \"السكن\";\r\n\t\t\tlangue_batiments['26'] = \"القصر\";\r\n\t\t\tlangue_batiments['27'] = \"الخزنة\";\r\n\t\t\tlangue_batiments['28'] = \"المكتب التجاري\";\r\n\t\t\tlangue_batiments['29'] = \"الثكنة الكبيرة\";\r\n\t\t\tlangue_batiments['30'] = \"الأسطبل الكبير\";\r\n\t\t\tlangue_batiments['31'] = \"حائط المدينة\";\r\n\t\t\tlangue_batiments['32'] = \"الحائط الأرضي\";\r\n\t\t\tlangue_batiments['33'] = \"الحاجز\";\r\n\t\t\tlangue_batiments['34'] = \"الحجار\";\r\n\t\t\tlangue_batiments['35'] = \"المقهى\";\r\n\t\t\tlangue_batiments['36'] = \"الصياد\";\r\n\t\t\tlangue_batiments['37'] = \"قصر الأبطال\";\r\n\t\t\tlangue_batiments['38'] = \"المخزن الكبير\";\r\n\t\t\tlangue_batiments['39'] = \"مخزن الحبوب الكبير\";\r\n\t\t\tlangue_batiments['40'] = \"أعجوبة العالم أو المعجزة\";\r\n\t\t\tlangue_batiments['41'] = \"ساقية الخيول\";\r\n\t\t\t// Ressources\r\n\t\t\tlangue_textes['build'] = \"بناء\";\r\n\t\t\tlangue_textes['upgrade'] = \"تطوير\";\r\n\t\t\tlangue_textes['attack'] = \"هجوم\";\r\n\t\t\tlangue_textes['research'] = \"بحث\";\r\n\t\t\tlangue_textes['train'] = \"قطار\";\r\n\t\t\tlangue_textes['party'] = \"حفله\";\r\n\t\t\tlangue_textes['demolish'] = \"هدم\";\r\n\t\t\tlangue_textes['send_merchants'] = \"أرسال التجار\";\r\n\t\t\tlangue_textes['send_assistance'] = \"دعم البريد الإلكتروني\";\r\n\t\t\t// Textes\t\t\t\t\t\r\n\t\t\tlangue_textes['ressources'] = \"الموارد\";\r\n\t\t\tlangue_textes['villages'] = \"القرى\";\r\n\t\t\tlangue_textes['my_hero'] = \"بطلي\";\r\n\t\t\tlangue_textes['task_list'] = \"قائمة المهام\";\r\n\t\t\tlangue_textes['options'] = \"خيارات\";\r\n\t\t\tlangue_textes['options_right_side'] = \"الخانة في الجانب الأيمن\";\r\n\t\t\tlangue_textes['replace_hero'] = \"أستبدال شكل قائمة البطل؟\";\r\n\t\t\tlangue_textes['replace_player'] = \"أستبدال شكل قائمة الاعب؟\";\r\n\t\t\tlangue_textes['replace_allianz'] = \"أستبدال شكل قائمة التحالف؟\";\r\n\t\t\tlangue_textes['replace_village'] = \"أستبدال شكل قائمة القرى؟\";\r\n\t\t\tlangue_textes['defense_village'] = \"أضافة أختصار \\\"أرسال القوات\\\"؟\";\r\n\t\t\tlangue_textes['merchant_village'] = \"أضافة أختصار \\\"أرسال التجار أو الموارد\\\"؟\";\r\n\t\t\tlangue_textes['add_resource'] = \"أضافة قائمة الموارد؟\";\r\n\t\t\tlangue_textes['position_resource'] = \"قائمة القرى قبل أو بعد؟\";\r\n\t\t\tlangue_textes['no'] = \"لا\";\r\n\t\t\tlangue_textes['yes'] = \"نعم\";\r\n\t\t\tlangue_textes['before_village'] = \"بعد قائمة القرى\";\r\n\t\t\tlangue_textes['after_village'] = \"قبل قائمة القرى\";\r\n\t\t\tlangue_textes['options_various'] = \"خيارات أخرى\";\r\n\t\t\tlangue_textes['replace_titre_page'] = \"أستبدال أسم الصفحة؟\";\r\n\t\t\tlangue_textes['save'] = \"Save and close\";\r\n\t\t\tlangue_textes['replace_logo'] = \"أستبدال الشعار الأصلي؟\";\r\n\t\t\tlangue_textes['ready'] = \"Ready\";\r\n\t\t\tlangue_textes['never'] = \"أبداَ\";\r\n\t\t\tlangue_textes['required_resources'] = \"الموارد المطلوبة للإرتقاء الى المستوى التالي\";\r\n\t\t\tlangue_textes['insert_build_page'] = \"أظهار كم تحتاج من الموارد للبناء؟\";\r\n\t\t\tlangue_textes['infinity'] = \"غير محدود\";\r\n\t\t\tlangue_textes['upgrade_wharehouse'] = \"You have to upgrade wharehouse.\";\r\n\t\t\tlangue_textes['upgrade_granary'] = \"You have to upgrade granary.\";\r\n\t\t\tlangue_textes['use_scheduler'] = \"Use the scheduler ?\";\r\n\t\t\tlangue_textes['afficher_log'] = \"Log level ?\";\r\n\t\t\tlangue_textes['add_build_list'] = \"- Add to build list -\";\r\n\t\t\tlangue_textes['add_build_box_titre'] = \"Schedule task (Server time)\";\r\n\t\t\tlangue_textes['add_build_box_schedule'] = \"Schedule at :\";\r\n\t\t\tlangue_textes['add_build_box_format'] = \"(yyyy/mm/dd hh:mm:ss)\";\r\n\tbreak;\r\n\t\tcase \"uk\": // English\r\n\t\tdefault:\r\n\t\t\t// Buldings :\r\n\t\t\tlangue_batiments['1'] = \"Woodcutter\";\r\n\t\t\tlangue_batiments['2'] = \"Clay Pit\";\r\n\t\t\tlangue_batiments['3'] = \"Iron Mine\";\r\n\t\t\tlangue_batiments['4'] = \"Cropland\";\r\n\t\t\tlangue_batiments['5'] = \"Sawmill\";\r\n\t\t\tlangue_batiments['6'] = \"Brickyard\";\r\n\t\t\tlangue_batiments['7'] = \"Iron Foundry\";\r\n\t\t\tlangue_batiments['8'] = \"Flour Mill\";\r\n\t\t\tlangue_batiments['9'] = \"Bakery\";\r\n\t\t\tlangue_batiments['10'] = \"Warehouse\";\r\n\t\t\tlangue_batiments['11'] = \"Granary\";\r\n\t\t\tlangue_batiments['12'] = \"Blacksmith\";\r\n\t\t\tlangue_batiments['13'] = \"Armory\";\r\n\t\t\tlangue_batiments['14'] = \"Tournament Square\";\r\n\t\t\tlangue_batiments['15'] = \"Main Building\";\r\n\t\t\tlangue_batiments['16'] = \"Rally Point\";\r\n\t\t\tlangue_batiments['17'] = \"Marketplace\";\r\n\t\t\tlangue_batiments['18'] = \"Embassy\";\r\n\t\t\tlangue_batiments['19'] = \"Barracks\";\r\n\t\t\tlangue_batiments['20'] = \"Stable\";\r\n\t\t\tlangue_batiments['21'] = \"Siege Workshop\";\r\n\t\t\tlangue_batiments['22'] = \"Academy\";\r\n\t\t\tlangue_batiments['23'] = \"Cranny\";\r\n\t\t\tlangue_batiments['24'] = \"City Hall\";\r\n\t\t\tlangue_batiments['25'] = \"Residence\";\r\n\t\t\tlangue_batiments['26'] = \"Palace\";\r\n\t\t\tlangue_batiments['27'] = \"Treasury\";\r\n\t\t\tlangue_batiments['28'] = \"Trade Office\";\r\n\t\t\tlangue_batiments['29'] = \"Great Barracks\";\r\n\t\t\tlangue_batiments['30'] = \"Great Stable\";\r\n\t\t\tlangue_batiments['31'] = \"City Wall\";\r\n\t\t\tlangue_batiments['32'] = \"Earth Wall\";\r\n\t\t\tlangue_batiments['33'] = \"Palisade\";\r\n\t\t\tlangue_batiments['34'] = \"Stonemason\";\r\n\t\t\tlangue_batiments['35'] = \"Brewery\";\r\n\t\t\tlangue_batiments['36'] = \"Trapper\";\r\n\t\t\tlangue_batiments['37'] = \"Hero's Mansion\";\r\n\t\t\tlangue_batiments['38'] = \"Great Warehouse\";\r\n\t\t\tlangue_batiments['39'] = \"Great Granary\";\r\n\t\t\tlangue_batiments['40'] = \"Wonder\";\r\n\t\t\tlangue_batiments['41'] = \"Horse Drinking Trough\";\r\n\t\t\t// Ressources\r\n\t\t\tlangue_ressources['lumber'] = \"Lumber\";\r\n\t\t\tlangue_ressources['clay'] = \"Clay\";\r\n\t\t\tlangue_ressources['iron'] = \"Iron\";\r\n\t\t\tlangue_ressources['crop'] = \"Crop\";\r\n\t\t\t// Tasks\r\n\t\t\tlangue_textes['build'] = \"Build\";\r\n\t\t\tlangue_textes['upgrade'] = \"Upgrade\";\r\n\t\t\tlangue_textes['attack'] = \"Attack\";\r\n\t\t\tlangue_textes['research'] = \"Research\";\r\n\t\t\tlangue_textes['train'] = \"Train\";\r\n\t\t\tlangue_textes['party'] = \"Party\";\r\n\t\t\tlangue_textes['demolish'] = \"Demolish\";\r\n\t\t\tlangue_textes['send_merchants'] = \"Send Merchants\";\r\n\t\t\tlangue_textes['send_assistance'] = \"Send assistance\";\r\n\t\t\t// Textes\t\t\t\t\t\r\n\t\t\tlangue_textes['ressources'] = \"Ressources\";\r\n\t\t\tlangue_textes['villages'] = \"Villages\";\r\n\t\t\tlangue_textes['my_hero'] = \"My hero\";\r\n\t\t\tlangue_textes['task_list'] = \"Task list\";\r\n\t\t\tlangue_textes['options'] = \"Multi-Tools options\";\r\n\t\t\tlangue_textes['options_right_side'] = \"Right side column\";\r\n\t\t\tlangue_textes['replace_hero'] = \"Replace hero's framework ?\";\r\n\t\t\tlangue_textes['replace_player'] = \"Replace player's framework ?\";\r\n\t\t\tlangue_textes['replace_allianz'] = \"Replace alliance's framework ?\";\r\n\t\t\tlangue_textes['replace_village'] = \"Replace village's framework ?\";\r\n\t\t\tlangue_textes['defense_village'] = \"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Add shortcut \\\"send defense\\\" ?\";\r\n\t\t\tlangue_textes['merchant_village'] = \"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Add shortcut \\\"send merchant\\\" ?\";\r\n\t\t\tlangue_textes['add_resource'] = \"Add resource bars framework ?\";\r\n\t\t\tlangue_textes['position_resource'] = \"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Before or after village's framework ?\";\r\n\t\t\tlangue_textes['no'] = \"No\";\r\n\t\t\tlangue_textes['yes'] = \"Yes\";\r\n\t\t\tlangue_textes['before_village'] = \"Before village\";\r\n\t\t\tlangue_textes['after_village'] = \"After village\";\r\n\t\t\tlangue_textes['options_various'] = \"Various options\";\r\n\t\t\tlangue_textes['replace_titre_page'] = \"Replace name's page ?\";\r\n\t\t\tlangue_textes['save'] = \"Save and close\";\r\n\t\t\tlangue_textes['replace_logo'] = \"Replace original logo ?\";\r\n\t\t\tlangue_textes['ready'] = \"Ready\";\r\n\t\t\tlangue_textes['never'] = \"Never\";\r\n\t\t\tlangue_textes['required_resources'] = \"Required resources to upgrade\";\r\n\t\t\tlangue_textes['insert_build_page'] = \"Show ressourses needed in building's pages ?\";\r\n\t\t\tlangue_textes['infinity'] = \"Infinity\";\r\n\t\t\tlangue_textes['upgrade_wharehouse'] = \"You have to upgrade wharehouse.\";\r\n\t\t\tlangue_textes['upgrade_granary'] = \"You have to upgrade granary.\";\r\n\t\t\tlangue_textes['use_scheduler'] = \"Use the scheduler ?\";\r\n\t\t\tlangue_textes['afficher_log'] = \"Log level ?\";\r\n\t\t\tlangue_textes['add_build_list'] = \"- Add to build list -\";\r\n\t\t\tlangue_textes['add_build_box_titre'] = \"Schedule task (Server time)\";\r\n\t\t\tlangue_textes['add_build_box_schedule'] = \"Schedule at :\";\r\n\t\t\tlangue_textes['add_build_box_format'] = \"(yyyy/mm/dd hh:mm:ss)\";\r\n\t\t\tbreak;\r\n\t\t}\r\n\tadd_log(3, \"get_language() > Fin.\");\r\n\t}", "function translations(lang) {\n\t\t lang = lang || 'en';\n\t\t var text = {\n\t\t daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],\n\t\t limit: 'Limit reached ({{limit}} items max).',\n\t\t loading: 'Loading...',\n\t\t minLength: 'Min. Length',\n\t\t months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],\n\t\t notSelected: 'Nothing Selected',\n\t\t required: 'Required',\n\t\t search: 'Search'\n\t\t };\n\t\t return window.VueStrapLang ? window.VueStrapLang(lang) : text;\n\t\t}", "function _getLocalizedValue(inSrceValue) {\r\n\t\t\t//--------------------------------------\r\n\t\t\t\tvar localized = '';\r\n\r\n\t\t\t\tif (inSrceValue) {\r\n\t\t\t\t\tlocalized = _localizedValues[inSrceValue];\r\n\t\t\t\t\tif (!localized) {\r\n\t\t\t\t\t\tif(_caseSensitive) {\r\n\t\t\t\t\t\t\tlocalized = inSrceValue;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// Create the lowerCase localized values if needed\r\n\t\t\t\t\t\t\tif(_localizedValuesLowerCase.length === 0) {\r\n\t\t\t\t\t\t\t\t_createLocalizedValuesLowerCase();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tlocalized = _localizedValues[ _getLowerCaseNoAccents(inSrceValue) ];\r\n\t\t\t\t\t\t\tif(!localized) {\r\n\t\t\t\t\t\t\t\tlocalized = inSrceValue;\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\r\n\t\t\t\treturn localized;\r\n\t\t\t}", "function toCurrency(){\n\n}", "userCallback(value) {\n // Convert the number to a string and splite the string every 3 charaters from the end\n value = value.toString();\n value = value.split(/(?=(?:...)*$)/);\n \n // Convert the array to a string and format the output\n value = value.join('.');\n return `₳ ${value}`;\n }", "function from() {\n var val = Values.first().text().toLowerCase();\n if (val.endsWith('€')) {\n return \"eur\";\n } else if (val.endsWith(\"chf\")) {\n return \"chf\";\n } else if (val.endsWith(\"dkk\")) {\n return \"dkk\";\n } else if (val.endsWith(\"gbp\")) {\n return \"gbp\";\n } else if (val.endsWith(\"nok\")) {\n return \"nok\";\n } else if (val.endsWith(\"sek\")) {\n return \"sek\";\n } else {\n return \"usd\";\n }\n\n}", "function getLocaleCurrencyName(locale){var data=findLocaleData(locale);return data[16/* CurrencyName */]||null;}", "function currencyFormatter(value, prefix, decimalPlaces, decimalSeparator, thousandSeparator, suffix) {\n\ttry {\n\t\tvar n = Number(value);\n\t\tprefix = prefix == undefined ? \"$\" : prefix;\n\t\tsuffix = suffix == undefined ? \"\" : suffix;\n\t\tdecimalPlaces = isNaN(decimalPlaces = Math.abs(decimalPlaces)) ? 2 : decimalPlaces;\n\t\tdecimalSeparator = decimalSeparator == undefined ? \".\" : decimalSeparator;\n\t\tthousandSeparator = thousandSeparator == undefined ? \",\" : thousandSeparator;\n\t\tvar s = n < 0 ? \"-\" : \"\", i = parseInt(n = Math.abs(+n || 0).toFixed(decimalPlaces)) + \"\", j = (j = i.length) > 3 ? j % 3 : 0;\n\t\treturn prefix + s + (j ? i.substr(0, j) + thousandSeparator : \"\") + i.substr(j).replace(/(\\decimalSeparator{3})(?=\\decimalSeparator)/g, \"$1\" + thousandSeparator)\n\t\t + (decimalPlaces ? decimalSeparator + Math.abs(n - i).toFixed(decimalPlaces).slice(2) : \"\") + suffix;\n\t} catch (error) {\n\t\talertMessage(\"Error coverting value(\" + value + \") to currency : \" + error, \"OK\", null, \"error\");\n\t}\n}", "function sertificationCalc (country) {\n let price;\n if (country === 'usa' || country === 'georgia') {\n price = '6500 грн'\n }\n if (country === 'europe') {\n price = '3000 грн'\n }\n if (country === 'emirates') {\n price = '7000 грн'\n }\n return price\n}", "render_lang_name(row){\n return bbn.fn.getField(this.source.primary, 'text', 'code', row.lang);\n }", "function currencyformate(value) {\n var formate = value.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n return formate;\n}", "function formatValue(value) {\n var str = parseFloat(value).toFixed(2) + \"\";\n str = str.replace(\".\", \",\");\n str = `R$ ${str}`;\n return str;\n}", "formatDate(dateP, lang) {\n // console.log(\"Date Receive \"+dateP);\n let splitdat = dateP.split('-');\n if (splitdat.length == 1) { //they use / instead of -\n splitdat = dateP.split('/');\n }\n //console.log(\"DATE FR : \" + splitdat+\" TO \"+lang);\n let date_f = dateP;\n if (lang == 'FR') {\n date_f = splitdat[2] + '-' + splitdat[1] + '-' + splitdat[0];\n }\n if (lang == 'EN') {\n date_f = splitdat[2] + '-' + splitdat[1] + '-' + splitdat[0];\n\n }\n //console.log(\"DATE FORMAT : \" + date_f+\" TO \"+lang);\n return date_f;\n\n }", "function rd_Approximate_localize(strVar)\r\n {\r\n return strVar[\"en\"];\r\n }", "function currencyFullName(currency) {\n var currencyDictionary = {\n 'AUD': 'Dólar Australiano',\n 'BGN': 'Lev Bulgaro',\n 'BRL': 'Real',\n 'CAD': 'Dólar Canadense',\n 'CHF': 'Franco',\n 'CNY': 'Yuan Renminbi',\n 'CZK': 'Coroa Checa',\n 'DKK': 'Coroa Dinamarqueza',\n 'EUR': 'Euro',\n 'GBP': 'Libra Esterlina',\n 'HKD': 'Dólar de Hong Kong',\n 'HRK': 'Kuna croata',\n 'HUF': 'Florim húngaro',\n 'IDR': 'Rupia indonésia',\n 'ILS': 'Novo shekel israelense',\n 'INR': 'Rupia indiana',\n 'JPY': 'Iene',\n 'KRW': 'Won sul-coreano',\n 'MXN': 'Peso Mexicano',\n 'MYR': 'Ringgit Malaio',\n 'NOK': 'Coroa Norueguesa',\n 'NZD': 'Dólar Neozelandês',\n 'PHP': 'Piso Filipino',\n 'PLN': 'zloty',\n 'RON': 'Leu Romeno',\n 'RUB': 'Rublos Russos',\n 'SEK': 'Coroa sueca',\n 'SGD': 'Dólar de Singapura',\n 'THB': 'Dólar de Singapura',\n 'TRY': 'Lira Turca',\n 'USD': 'Dolar Americano',\n 'ZAR': 'Rand da África do Sul',\n 'BTC': 'Bitcoin'\n };\n if (currencyDictionary[currency] === undefined) {\n return \"\"\n } else {\n return currencyDictionary[currency];\n }\n }", "function setLang(langValue) {\n gCurrLang = langValue;\n}", "function formatCurrency(num,dec) {\n\tvar parteEntera = '';\n\tvar parteDecimal = '';\n\t\n\tif(dec==undefined){dec=0;}\n\t\n\tvar auxNum = num + '';\n\tvar bDec = false;\n\tfor(m=0;m<auxNum.length;m++){\n\t\tif(auxNum.charAt(m) == \".\"){\n\t\t\tbDec = true;\n\t\t}else{\n\t\t\tif(bDec == true){\n\t\t\t\tparteDecimal += auxNum.charAt(m);\n\t\t\t}else{\n\t\t\t\tparteEntera += auxNum.charAt(m);\n\t\t\t}\t\n\t\t}\n\t}\n\t\n parteEntera = parteEntera.toString().replace(/\\$|\\,/g,'');\n if(isNaN(parteEntera))\n parteEntera = \"0\";\n sign = (parteEntera == (parteEntera = Math.abs(parteEntera)));\n parteEntera = Math.floor(parteEntera*100+0.50000000001);\n parteEntera = Math.floor(parteEntera/100).toString();\n for (var i = 0; i < Math.floor((parteEntera.length-(1+i))/3); i++)\n parteEntera = parteEntera.substring(0,parteEntera.length-(4*i+3))+'.'+\n parteEntera.substring(parteEntera.length-(4*i+3));\n parteEntera = (((sign)?'':'-') + parteEntera);\n\t\n\tvar resultado = parteEntera;\n\tif(dec>0){\n\t\tresultado+= ',' + parteDecimal;\n\t\tfor(m=parteDecimal.length;m<dec;m++){\n\t\t\tresultado+= '0';\n\t\t}\n\t}\n\t\n\treturn resultado;\n}", "function getNumeroFormatado(numero){ \r\n if (numero == \"-\"){\r\n return \"\";\r\n } \r\n let n = Number(numero);\r\n let valor = n.toLocaleString(\"pt-br\");\r\n return valor;\r\n}", "function format() {\n var args = Array.prototype.slice.call(arguments);\n args.unshift(undefined);\n return localeFormat.apply(null, args);\n }", "function encodeCurrency() {\n if (!chatAccount.currency) {\n return;\n }\n var currency = chatAccount.currency.toUpperCase();\n if (['USD','EUR','GBP','JPY'].indexOf(currency) >= 0) {\n setInputValue('account[currency]', currency);\n }\n }", "function convertCurrencyFromPl() {\n\n event.preventDefault();\n var amount = $input.val();\n var to = $selectTo.val();\n var results = 0;\n\n if (to === \"AUD - Australia\"){\n results = amount / rate[1].bid\n } else if (to === \"CAD - Kanada\"){\n results = amount / rate[2].bid\n } else if (to === \"CHF - Szwajcaria\") {\n results = amount / rate[5].bid\n } else if (to === \"CZK - Czechy\") {\n results = amount / rate[8].bid\n } else if (to === \"DKK - Dania\") {\n results = amount / rate[9].bid\n } else if (to === \"EUR - Unia Europejska\") {\n results = amount / rate[3].bid\n } else if (to === \"GBP - Wielka Brytania\") {\n results = amount / rate[6].bid\n } else if (to === \"HUF - Węgry\") {\n results = amount / rate[4].bid\n } else if (to === \"JPY - Japonia\") {\n results = amount / rate[7].bid\n } else if (to === \"NOK - Norwegia\") {\n results = amount / rate[10].bid\n } else if (to === \"SEK - Szwecja\") {\n results = amount / rate[11].bid\n } else if (to === \"USD - USA\") {\n results = amount / rate[0].bid\n }\n\n function addResultText() {\n var $newText = $(`\n <span>${$input.val()}</span>\n <span id=\"currency\">${$selectFrom.val()}</span>\n <span>=</span>\n <span id=\"results\">${results.toFixed(2)}</span>\n <span id=\"currency\">${$selectTo.val()}</span>\n `);\n $(\".form-text-content\").empty().append($newText);\n }\n\n addResultText();\n }", "function formatCurrency(num) {\n return 'PKR ' + (num).toFixed(2).replace(/\\d(?=(\\d{3})+\\.)/g, '$&,');\n}", "function convertCurrencyToPl() {\n\n event.preventDefault();\n var amount = $input.val(); // pobieranie wpisanej kwoty\n var from = $selectFrom.val(); // wybór waluty\n var results = 0;\n\n\n if (from === \"AUD - Australia\"){\n results = amount * rate[1].ask\n } else if (from === \"CAD - Kanada\"){\n results = amount * rate[2].ask\n } else if (from === \"CHF - Szwajcaria\") {\n results = amount * rate[5].ask\n } else if (from === \"CZK - Czechy\") {\n results = amount * rate[8].ask\n } else if (from === \"DKK - Dania\") {\n results = amount * rate[9].ask\n } else if (from === \"EUR - Unia Europejska\") {\n results = amount * rate[3].ask\n } else if (from === \"GBP - Wielka Brytania\") {\n results = amount * rate[6].ask\n } else if (from === \"HUF - Węgry\") {\n results = amount * rate[4].ask\n } else if (from === \"JPY - Japonia\") {\n results = amount * rate[7].ask\n } else if (from === \"NOK - Norwegia\") {\n results = amount * rate[10].ask\n } else if (from === \"SEK - Szwecja\") {\n results = amount * rate[11].ask\n } else if (from === \"USD - USA\") {\n results = amount * rate[0].ask\n }\n\n // usuwa mema i wpisuje wynik naszych obliczeń\n function addResultText() {\n var $newText = $(`\n <span>${$input.val()}</span>\n <span id=\"currency\">${$selectFrom.val()}</span>\n <span>=</span>\n <span id=\"results\">${results.toFixed(2)}</span>\n <span id=\"currency\">${$selectTo.val()}</span>\n `);\n $(\".form-text-content\").empty().append($newText);\n }\n\n addResultText();\n }", "html (showCurrency = true, signMode = 1) {\n let str = '<span class=\"major\">%j</span>'\n str += '<span class=\"separator\">%p</span>'\n str += '<span class=\"minor\">%n</span>'\n\n if (showCurrency) str = '<span class=\"currency\">%y</span>' + str\n\n const signModes = {\n 0: '',\n 1: '<span class=\"sign\">%s</span>',\n 2: '<span class=\"sign\">%+</span>',\n 3: '<span class=\"sign\">%-</span>'\n }\n\n str = signModes[signMode] + str\n str = this.format(str)\n\n const el = document.createElement('span')\n el.classList.add('amount')\n el.classList.add(this.positive ? 'positive' : 'negative')\n el.innerHTML = str\n\n return el.outerHTML\n }", "function formatCurrency(separator, symbol, symbolFirst, value) {\r\n let result = Math.trunc(value) + separator;\r\n result += value.toFixed(2).substr(-2,2);\r\n if (symbolFirst) return symbol + ' ' + result;\r\n else return result + ' ' + symbol;\r\n}", "function getCurrencySymbol(code,format,locale){if(locale===void 0){locale='en';}var currency=getLocaleCurrencies(locale)[code]||CURRENCIES_EN[code]||[];var symbolNarrow=currency[1/* SymbolNarrow */];if(format==='narrow'&&typeof symbolNarrow==='string'){return symbolNarrow;}return currency[0/* Symbol */]||code;}// Most currencies have cents, that's why the default is 2", "function translate(language) {\n if (language === \"es\") {\n return \"Hola, mundo!\";\n } else if (language === \"fr\") {\n return \"Bonjour le monde\";\n } else {\n return \"Hello, World\";\n }\n\n}", "convertLanguage(lang) {\n switch (lang) {\n case \"German\": {\n return 0;\n break;\n }\n case \"French\": {\n return 1;\n break;\n }\n case \"English\": {\n return 2;\n break;\n }\n case \"Spain\": {\n return 3;\n break;\n }\n case \"Italian\": {\n return 4;\n break;\n }\n default:\n return \"\";\n break;\n }\n }", "function formatPrice(num)\n{\n\t num = num.toString().replace(/\\$|\\,/g,'');\n\t if(isNaN(num))\n\t num = \"0\";\n\t sign = (num == (num = Math.abs(num)));\n\t num = Math.floor(num*100+0.50000000001);\n\t cents = num%100;\n\t num = Math.floor(num/100).toString();\n\t if(cents<10)\n\t cents = \"0\" + cents;\n\t for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)\n\t num = num.substring(0,num.length-(4*i+3))+','+ num.substring(num.length-(4*i+3));\t \n\t //return (((sign)?'':'-') + '<?php //echo $this->model_superadmin->generate_isocode_bo()?> ' + num + ',' + cents);\n\t return (((sign)?'':'-') + 'Rp. '+ num +',00');\n}", "function OutputAsCurrency(value, currency, locale) {\n // debugger;\n // If the caller didn't specify the currency, use a default of Canadian dollars\n if (!currency) {\n currency = \"CAD\";\n }\n // If the caller didn't specify the regional locale, use the web browser default locale\n if (!locale) {\n locale = GetPreferredRegion();\n }\n // Bug fix -- if they pass a string value, convert it to a number first\n if (typeof value == \"string\") {\n value = parseFloat(value);\n }\n\n var valueAsCurrency = \"\";\n var conversionRules = {\n style: \"currency\",\n currency: currency\n }\n\n if (value && value.toLocaleString() !== undefined) {\n valueAsCurrency = value.toLocaleString(locale, conversionRules);\n }\n return valueAsCurrency;\n}", "function localize(s : string) {\n let str = l10n_js[s];\n\n return str===undefined ? '??' + s + '??' : str;\n}", "function currencyFormatter(separator, symbol, symbolFirst, value) {\n let result = Math.trunc(value) + separator;\n result += value.toFixed(2).substr(-2,2);\n return symbolFirst ? `${symbol} ${result}` : `${result} ${symbol}`; \n}", "function formatCurrency() {\n var n, c, region, bIncludeCurrencyCode = false;\n for(var i = 0, l = arguments.length; i < l; i++) {\n var arg = arguments[i];\n if(typeof arg === \"number\") {\n if(n === undefined) {\n n = arg;\n } else {\n c = arg;\n }\n } else if(typeof arg === \"object\") {\n region = arg;\n } else if(typeof arg === \"boolean\") {\n bIncludeCurrencyCode = arg;\n }\n }\n\n function getCurrencyString(region) {\n /* does currency string go behind the number? */\n if(region.currency_position) {\n return (region.currency_space ? \" \" : \"\") + region.currency_string;\n }\n\n /* currency string goes in front of the number. */\n return region.currency_string + (region.currency_space ? \" \" : \"\");\n }\n var tmp = region || defaultRegion,\n num = formatNumber(n, c, tmp);\n return (!tmp.currency_position ? getCurrencyString(tmp) : \"\") + num + (tmp.currency_position ? getCurrencyString(tmp) : \"\") + (bIncludeCurrencyCode ? \" \" + tmp.currency_code : \"\");\n }", "function priceSymbol(x) {\n var price = new Intl.NumberFormat('ja-JP', { style: 'currency', currency: 'JPY' }).format(x);\n return price;\n}", "asText4() {\nreturn this._makeText(`${this.amount.toFixed(4)}`);\n}", "function currency(num){\n const currency = new Intl.NumberFormat('en-NG', { style: 'currency', currency: 'NGN' });\n return currency.format(num)\n}", "function convertPrice(price){\n return new Intl.NumberFormat('ru-RU').format(Math.round(price));\n}", "function translations (lang = 'en') {\n let text = {\n daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],\n limit: 'Limit reached ({{limit}} items max).',\n loading: 'Loading...',\n minLength: 'Min. Length',\n months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],\n notSelected: 'Nothing Selected',\n required: 'Required',\n search: 'Search'\n }\n return window.VueStrapLang ? window.VueStrapLang(lang) : text\n}", "function translations (lang = 'en') {\n let text = {\n daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],\n limit: 'Limit reached ({{limit}} items max).',\n loading: 'Loading...',\n minLength: 'Min. Length',\n months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],\n notSelected: 'Nothing Selected',\n required: 'Required',\n search: 'Search'\n }\n return window.VueStrapLang ? window.VueStrapLang(lang) : text\n}", "formatPrice(amount, currency) {\n let price = (amount / 100).toFixed(2);\n let numberFormat = new Intl.NumberFormat(['en-US'], {\n style: 'currency',\n currency: 'usd',\n currencyDisplay: 'symbol',\n });\n return numberFormat.format(price);\n }", "function PlcGeral(){\r\n}", "function t(e,t,n){return\"m\"===n?t?\"хвилина\":\"хвилину\":\"h\"===n?t?\"година\":\"годину\":e+\" \"+function(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[n],+e)}", "function t(e,t,n){return\"m\"===n?t?\"хвилина\":\"хвилину\":\"h\"===n?t?\"година\":\"годину\":e+\" \"+function(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[n],+e)}", "function formatCurrency(row, cell, value) {\n return '$' + formatNumber(value);\n }", "static get iso3166() {\n\t\treturn 'FR';\n\t}", "formatDecimalToReais(str) {\n var formatter =\n new Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n minimumFractionDigits: 2,\n });\n var formatado = formatter.format(str);\n return formatado;\n }", "get localizeFormatFunction() {\n\t\treturn this.nativeElement ? this.nativeElement.localizeFormatFunction : undefined;\n\t}", "get localizeFormatFunction() {\n\t\treturn this.nativeElement ? this.nativeElement.localizeFormatFunction : undefined;\n\t}", "function e(a){var c=b.localeData||b.langData;return c.call(b,a)||c.call(b,\"en\")}", "function translateLanTags(lang) {\n if (lang == \"Russian\") {\n return \"russo\";\n } else if(lang == \"Italian\") {\n return \"italiano\";\n } else if (lang == \"German\") {\n return \"tedesco\";\n } else {\n return lang;\n };\n}", "function Moneyformat() {\n $('.rate , .quantity').keyup(function (event) {\n // skip for arrow keys\n if (event.which >= 37 && event.which <= 40) return;\n // format number\n $(this).val(function (index, value) {\n return value.replace(/\\D/g, \"\").replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n });\n });\n }", "moneyFormat(value, decimals = 3) {\n if(!isFinite(value)) return `N/A`;\n\n const absValue = Math.abs(value);\n\n if(absValue >= 1.0e+9){\n return `${(value / 1.0e+9).toFixed(decimals)}B`;\n }\n\n if(absValue >= 1.0e+6){\n return `${(value / 1.0e+6).toFixed(decimals)}M`;\n }\n\n if(absValue >= 1.0e+3){\n return `${(value / 1.0e+3).toFixed(decimals)}K`;\n }\n\n return value.toFixed(decimals);\n }", "function formatCustom() {\n var tokens, data, seps, res;\n\n // Get the separators for localization.\n seps = separators(locale);\n\n // Tokenize the format string\n tokens = tokenize();\n\n // Generate the data used to process from the tokens\n data = generateFormatData(tokens);\n\n // Process the format data to generate the output.\n res = processData(data);\n\n return res;\n\n /**\n * Processes the given format data with the supplied number.\n * @param {object} data The format data as generated by\n * generateFormatData.\n */\n function processData(data) {\n var int, intNum, frac, fracNum, dpos, neg;\n\n // Apply adjustments\n neg = num < 0;\n num = Math.abs(num);\n\n if (num === 0) {\n num = num * data.zero.multiplier / data.zero.divisor;\n } else if (neg) {\n num = num * data.negative.multiplier /\n data.negative.divisor;\n } else {\n num = num * data.positive.multiplier /\n data.positive.divisor;\n }\n\n fracNum = Math.abs(num) - Math.floor(Math.abs(num));\n intNum = num - fracNum;\n int = String(intNum);\n\n if (num === 0) {\n int = processIntPart(data.zero);\n frac = processFracPart(data.zero);\n } else if (neg) {\n int = processIntPart(data.negative);\n frac = processFracPart(data.negative);\n } else {\n int = processIntPart(data.positive);\n frac = processFracPart(data.positive);\n }\n\n if (frac === false) {\n // This means we have rounded to zero, and need to change\n // format\n return processData(data);\n } else if (frac) {\n return int + seps.decimal + frac;\n } else {\n return int;\n }\n\n /**\n * Processes the integral part of the data.\n * @param {object} fmt The format object.\n */\n function processIntPart(fmt) {\n var i, cnt;\n\n // First try to normalize and balance the format\n // and number\n cnt = normalizePlaceholders();\n\n // If we need to group, add the group separators into\n // the format as literals.\n if (fmt.group) {\n addGroupLiterals(cnt);\n }\n\n // If we have a negative number, add it at the start of the\n // integral part as a literal.\n if (neg && cnt) {\n fmt.integral.unshift({\n type: 'literal',\n value: '-'\n });\n }\n\n // Go through and replace the placeholders.\n dpos = 0;\n for (i = 0; i < fmt.integral.length; i++) {\n if (fmt.integral[i].type === 'placeholder') {\n fmt.integral[i].type = 'literal';\n fmt.integral[i].value = int[dpos];\n dpos++;\n /* istanbul ignore if */\n } else if (fmt.integral[i].type !== 'literal') {\n // If this happens it is a dev error.\n throw new Error('Should not have tokens of type \"' +\n fmt.integral[i].type + '\"' + ' at this point!');\n }\n }\n return fmt.integral.map(value).join('');\n\n /**\n * Adds comma litrals to the format parts.\n * @param {number} phcnt The total number of placeholders.\n */\n function addGroupLiterals(phcnt) {\n var pos = 0, i;\n for (i = fmt.integral.length - 1; i >= 0; i--) {\n if (fmt.integral[i].type === 'placeholder') {\n pos++;\n if (pos < phcnt && pos > 0 && pos % 3 === 0) {\n fmt.integral.splice(i, 0, {\n type: 'literal',\n value: seps.separator\n });\n }\n }\n }\n }\n\n /**\n * Replaces \"#\" appearing after \"0\" with \"0\", and ensures the\n * placeholder count matches the int digit count.\n */\n function normalizePlaceholders() {\n var i, integ, has0, cnt, first;\n cnt = 0;\n for (i = 0; i < fmt.integral.length; i++) {\n integ = fmt.integral[i];\n if (integ.type === 'placeholder') {\n cnt++;\n if (first === undefined) {\n first = i;\n }\n if (integ.value === '0') {\n has0 = true;\n } else if (integ.value === '#' && has0) {\n integ.value = '0';\n }\n }\n }\n if (first === undefined) {\n first = 0;\n }\n\n // Add additional place holders with the first\n // until we have the same number of placeholders\n // as digits\n while (cnt > 0 && cnt < int.length) {\n fmt.integral.splice(first, 0, {\n type: 'placeholder',\n value: '#'\n });\n cnt++;\n }\n\n // We assume we have a first which points to a\n // placeholder (since cnt MUST be bigger than 0)\n while (int.length < cnt) {\n if (fmt.integral[first].value === '#') {\n fmt.integral.splice(first, 1);\n first = findFirstPlaceholder();\n cnt--;\n } else {\n int = '0' + int;\n }\n }\n\n return cnt;\n\n /** Find the first placeholder */\n function findFirstPlaceholder() {\n var i;\n for (i = 0; i < fmt.integral.length; i++) {\n if (fmt.integral[i].type === 'placeholder') {\n return i;\n }\n }\n return -1;\n }\n }\n }\n\n /**\n * Processes the fraction part\n * @param {object} fmt The format object.\n */\n function processFracPart(fmt) {\n var mult, was0, frac, pholders, idx, flag;\n if (!fmt.fraction.length) {\n return '';\n }\n pholders = fmt.fraction.filter(isPlaceholder);\n mult = Math.pow(10, pholders.length);\n was0 = fracNum === 0;\n fracNum = fracNum * mult;\n fracNum = Math.round(fracNum);\n if (!was0 && fracNum === 0 && intNum === 0) {\n return false;\n }\n frac = String(fracNum);\n\n // Ensure everything is in order.\n normalizePlaceholders();\n\n // Since we made the fraction an integer, we may have lost\n // significant 0s... put them back.\n frac = zeroPad(pholders.length, frac);\n\n // Remove any zeros from the end of frac, as well as #\n // placeholders that are not required (will not result in\n // any value being printed).\n frac = frac.split('');\n flag = true;\n while (frac.length) {\n if (flag && frac[frac.length - 1] === '0' &&\n pholders[pholders.length - 1].value === '#') {\n idx = fmt.fraction.indexOf(\n pholders[pholders.length - 1]\n );\n fmt.fraction.splice(idx, 1);\n } else {\n flag = false;\n pholders[pholders.length - 1].type = 'literal';\n pholders[pholders.length - 1].value =\n frac[frac.length - 1];\n }\n frac.pop();\n pholders.pop();\n }\n return fmt.fraction.map(value).join('');\n\n /** Ensures that all placeholders before the last 0 are 0 */\n function normalizePlaceholders() {\n var i, found;\n for (i = fmt.fraction.length - 1; i >= 0; i--) {\n if (fmt.fraction[i].type === 'placeholder') {\n if (found) {\n fmt.fraction[i].value = '0';\n } else if (fmt.fraction[i].value === '0') {\n found = true;\n }\n }\n }\n }\n }\n\n /**\n * Returns the value part of the supplied token.\n * @param {object} token The token to retrieve the value from.\n * @returns The token value.\n */\n function value(token) {\n return token.value;\n }\n\n /**\n * Returns true if this is a placeholder.\n * @param {object} token The token to check.\n */\n function isPlaceholder(token) {\n return token.type === 'placeholder';\n }\n }\n\n /**\n * Generates the format data from the supplied tokens.\n * @param {array} tokens The tokens to be used to generate the format\n * data.\n */\n function generateFormatData(tokens) {\n var i, sec, res, skip, pattern, curr;\n curr = 'positive';\n res = {\n positive: createSection()\n };\n sec = 0;\n pattern = res[curr].integral;\n for (i = 0; i < tokens.length; i++) {\n if (skip) {\n skip = false;\n continue;\n }\n switch (tokens[i].type) {\n case 'section':\n sec++;\n if (sec > 2) {\n // Stop processing.\n break;\n }\n if (tokens[i + 1] &&\n tokens[i + 1].type === 'section') {\n // We leave the section out if it is empty.\n continue;\n } else {\n curr = CUSTOM_FORMAT_SECTIONS[sec];\n res[curr] = createSection();\n pattern = res[curr].integral;\n }\n break;\n case 'skip':\n skip = true;\n // Add next as literal...\n if (tokens[i + 1]) {\n pattern.push({\n type: 'literal',\n value: tokens[i + 1].value\n });\n }\n break;\n case 'literal':\n pattern.push(tokens[i]);\n break;\n case 'placeholder':\n pattern.push(tokens[i]);\n break;\n case 'decimal':\n pattern = res[curr].fraction;\n break;\n case 'divisor':\n if (res[curr].divisor === 0) {\n res[curr].divisor =\n Math.pow(10, tokens[i].value.length);\n }\n break;\n case 'group':\n res[curr].group = true;\n break;\n case 'adjust':\n /* istanbul ignore else */\n if (tokens[i].value === '%') {\n if (res[curr].multiplier === 0) {\n res[curr].multiplier = 100;\n }\n } else if (tokens[i].value === '‰') {\n if (res[curr].multiplier === 0) {\n res[curr].multiplier = 1000;\n }\n } else {\n throw new Error('Unrecognized adjustment ' +\n 'value \"' + tokens[i].type + '\"');\n }\n pattern.push({\n type: 'literal',\n value: tokens[i].value\n });\n break;\n }\n }\n\n if (!res.negative) {\n res.negative = res.positive;\n }\n if (!res.zero) {\n res.zero = res.positive;\n }\n\n postProcess('positive');\n postProcess('negative');\n postProcess('zero');\n return res;\n\n /**\n * Flattens literals, and ensures valid divisor and multiplier\n * values.\n * @param {string} curr The current section being processed.\n */\n function postProcess(curr) {\n var i;\n if (res[curr].divisor === 0) {\n res[curr].divisor = 1;\n }\n if (res[curr].multiplier === 0) {\n res[curr].multiplier = 1;\n }\n for (i = 1; i < res[curr].integral.length; i++) {\n if (res[curr].integral[i].type === 'literal' &&\n res[curr].integral[i - 1].type === 'literal') {\n // Combine the 2 literals\n res[curr].integral[i - 1].value +=\n res[curr].integral[i].value;\n res[curr].integral.splice(i, 1);\n i--;\n }\n }\n for (i = 1; i < res[curr].fraction.length; i++) {\n if (res[curr].fraction[i].type === 'literal' &&\n res[curr].fraction[i - 1].type === 'literal') {\n // Combine the 2 literals\n res[curr].fraction[i - 1].value +=\n res[curr].fraction[i].value;\n res[curr].fraction.splice(i, 1);\n i--;\n }\n }\n }\n\n /** Creates a new section */\n function createSection() {\n return {\n group: false,\n divisor: 0,\n multiplier: 0,\n integral: [],\n fraction: []\n };\n }\n }\n\n /**\n * Tokenizes the custom format string to make it easier to work with.\n */\n function tokenize() {\n var i, res, char, divisor, divisorStop, lit, litStop, prev,\n token;\n\n res = [];\n divisor = '';\n lit = '';\n for (i = 0; i < fmt.length; i++) {\n token = undefined;\n divisorStop = true;\n litStop = true;\n char = fmt.charAt(i);\n switch (char) {\n case '\\\\':\n token = {\n type: 'skip',\n value: '\\\\'\n };\n break;\n case '0':\n token = {\n type: 'placeholder',\n value: '0'\n };\n break;\n case '#':\n token = {\n type: 'placeholder',\n value: '#'\n };\n break;\n case '.':\n token = {\n type: 'decimal',\n value: '.'\n };\n break;\n case ',':\n divisor += ',';\n divisorStop = false;\n break;\n case '%':\n token = {\n type: 'adjust',\n value: '%'\n };\n break;\n case '‰':\n token = {\n type: 'adjust',\n value: '‰'\n };\n break;\n case ';':\n token = {\n type: 'section'\n };\n break;\n default:\n lit += char;\n litStop = false;\n break;\n }\n\n if (divisorStop && divisor) {\n endDivisor(token);\n }\n if (lit && litStop) {\n endLit();\n }\n if (token) {\n res.push(token);\n }\n prev = char;\n }\n\n if (divisor) {\n endDivisor();\n }\n\n if (lit) {\n endLit();\n }\n\n return res;\n\n /**\n * Ends the divisor capture which may result in a divisor,\n * or a group\n * @param {object} token The token to check.\n */\n function endDivisor(token) {\n if (!token || token.type === 'decimal') {\n res.push({\n type: 'divisor',\n value: divisor\n });\n } else {\n res.push({\n type: 'group',\n value: ','\n });\n }\n divisor = '';\n }\n\n /** Ends a literal capture */\n function endLit() {\n res.push({\n type: 'literal',\n value: lit\n });\n lit = '';\n }\n }\n }", "function formatCustom() {\n var tokens, data, seps, res;\n\n // Get the separators for localization.\n seps = separators(locale);\n\n // Tokenize the format string\n tokens = tokenize();\n\n // Generate the data used to process from the tokens\n data = generateFormatData(tokens);\n\n // Process the format data to generate the output.\n res = processData(data);\n\n return res;\n\n /**\n * Processes the given format data with the supplied number.\n * @param {object} data The format data as generated by\n * generateFormatData.\n */\n function processData(data) {\n var int, intNum, frac, fracNum, dpos, neg;\n\n // Apply adjustments\n neg = num < 0;\n num = Math.abs(num);\n\n if (num === 0) {\n num = num * data.zero.multiplier / data.zero.divisor;\n } else if (neg) {\n num = num * data.negative.multiplier /\n data.negative.divisor;\n } else {\n num = num * data.positive.multiplier /\n data.positive.divisor;\n }\n\n fracNum = Math.abs(num) - Math.floor(Math.abs(num));\n intNum = num - fracNum;\n int = String(intNum);\n\n if (num === 0) {\n int = processIntPart(data.zero);\n frac = processFracPart(data.zero);\n } else if (neg) {\n int = processIntPart(data.negative);\n frac = processFracPart(data.negative);\n } else {\n int = processIntPart(data.positive);\n frac = processFracPart(data.positive);\n }\n\n if (frac === false) {\n // This means we have rounded to zero, and need to change\n // format\n return processData(data);\n } else if (frac) {\n return int + seps.decimal + frac;\n } else {\n return int;\n }\n\n /**\n * Processes the integral part of the data.\n * @param {object} fmt The format object.\n */\n function processIntPart(fmt) {\n var i, cnt;\n\n // First try to normalize and balance the format\n // and number\n cnt = normalizePlaceholders();\n\n // If we need to group, add the group separators into\n // the format as literals.\n if (fmt.group) {\n addGroupLiterals(cnt);\n }\n\n // If we have a negative number, add it at the start of the\n // integral part as a literal.\n if (neg && cnt) {\n fmt.integral.unshift({\n type: 'literal',\n value: '-'\n });\n }\n\n // Go through and replace the placeholders.\n dpos = 0;\n for (i = 0; i < fmt.integral.length; i++) {\n if (fmt.integral[i].type === 'placeholder') {\n fmt.integral[i].type = 'literal';\n fmt.integral[i].value = int[dpos];\n dpos++;\n /* istanbul ignore if */\n } else if (fmt.integral[i].type !== 'literal') {\n // If this happens it is a dev error.\n throw new Error('Should not have tokens of type \"' +\n fmt.integral[i].type + '\"' + ' at this point!');\n }\n }\n return fmt.integral.map(value).join('');\n\n /**\n * Adds comma litrals to the format parts.\n * @param {number} phcnt The total number of placeholders.\n */\n function addGroupLiterals(phcnt) {\n var pos = 0, i;\n for (i = fmt.integral.length - 1; i >= 0; i--) {\n if (fmt.integral[i].type === 'placeholder') {\n pos++;\n if (pos < phcnt && pos > 0 && pos % 3 === 0) {\n fmt.integral.splice(i, 0, {\n type: 'literal',\n value: seps.separator\n });\n }\n }\n }\n }\n\n /**\n * Replaces \"#\" appearing after \"0\" with \"0\", and ensures the\n * placeholder count matches the int digit count.\n */\n function normalizePlaceholders() {\n var i, integ, has0, cnt, first;\n cnt = 0;\n for (i = 0; i < fmt.integral.length; i++) {\n integ = fmt.integral[i];\n if (integ.type === 'placeholder') {\n cnt++;\n if (first === undefined) {\n first = i;\n }\n if (integ.value === '0') {\n has0 = true;\n } else if (integ.value === '#' && has0) {\n integ.value = '0';\n }\n }\n }\n if (first === undefined) {\n first = 0;\n }\n\n // Add additional place holders with the first\n // until we have the same number of placeholders\n // as digits\n while (cnt > 0 && cnt < int.length) {\n fmt.integral.splice(first, 0, {\n type: 'placeholder',\n value: '#'\n });\n cnt++;\n }\n\n // We assume we have a first which points to a\n // placeholder (since cnt MUST be bigger than 0)\n while (int.length < cnt) {\n if (fmt.integral[first].value === '#') {\n fmt.integral.splice(first, 1);\n first = findFirstPlaceholder();\n cnt--;\n } else {\n int = '0' + int;\n }\n }\n\n return cnt;\n\n /** Find the first placeholder */\n function findFirstPlaceholder() {\n var i;\n for (i = 0; i < fmt.integral.length; i++) {\n if (fmt.integral[i].type === 'placeholder') {\n return i;\n }\n }\n return -1;\n }\n }\n }\n\n /**\n * Processes the fraction part\n * @param {object} fmt The format object.\n */\n function processFracPart(fmt) {\n var mult, was0, frac, pholders, idx, flag;\n if (!fmt.fraction.length) {\n return '';\n }\n pholders = fmt.fraction.filter(isPlaceholder);\n mult = Math.pow(10, pholders.length);\n was0 = fracNum === 0;\n fracNum = fracNum * mult;\n fracNum = Math.round(fracNum);\n if (!was0 && fracNum === 0 && intNum === 0) {\n return false;\n }\n frac = String(fracNum);\n\n // Ensure everything is in order.\n normalizePlaceholders();\n\n // Since we made the fraction an integer, we may have lost\n // significant 0s... put them back.\n frac = zeroPad(pholders.length, frac);\n\n // Remove any zeros from the end of frac, as well as #\n // placeholders that are not required (will not result in\n // any value being printed).\n frac = frac.split('');\n flag = true;\n while (frac.length) {\n if (flag && frac[frac.length - 1] === '0' &&\n pholders[pholders.length - 1].value === '#') {\n idx = fmt.fraction.indexOf(\n pholders[pholders.length - 1]\n );\n fmt.fraction.splice(idx, 1);\n } else {\n flag = false;\n pholders[pholders.length - 1].type = 'literal';\n pholders[pholders.length - 1].value =\n frac[frac.length - 1];\n }\n frac.pop();\n pholders.pop();\n }\n return fmt.fraction.map(value).join('');\n\n /** Ensures that all placeholders before the last 0 are 0 */\n function normalizePlaceholders() {\n var i, found;\n for (i = fmt.fraction.length - 1; i >= 0; i--) {\n if (fmt.fraction[i].type === 'placeholder') {\n if (found) {\n fmt.fraction[i].value = '0';\n } else if (fmt.fraction[i].value === '0') {\n found = true;\n }\n }\n }\n }\n }\n\n /**\n * Returns the value part of the supplied token.\n * @param {object} token The token to retrieve the value from.\n * @returns The token value.\n */\n function value(token) {\n return token.value;\n }\n\n /**\n * Returns true if this is a placeholder.\n * @param {object} token The token to check.\n */\n function isPlaceholder(token) {\n return token.type === 'placeholder';\n }\n }\n\n /**\n * Generates the format data from the supplied tokens.\n * @param {array} tokens The tokens to be used to generate the format\n * data.\n */\n function generateFormatData(tokens) {\n var i, sec, res, skip, pattern, curr;\n curr = 'positive';\n res = {\n positive: createSection()\n };\n sec = 0;\n pattern = res[curr].integral;\n for (i = 0; i < tokens.length; i++) {\n if (skip) {\n skip = false;\n continue;\n }\n switch (tokens[i].type) {\n case 'section':\n sec++;\n if (sec > 2) {\n // Stop processing.\n break;\n }\n if (tokens[i + 1] &&\n tokens[i + 1].type === 'section') {\n // We leave the section out if it is empty.\n continue;\n } else {\n curr = CUSTOM_FORMAT_SECTIONS[sec];\n res[curr] = createSection();\n pattern = res[curr].integral;\n }\n break;\n case 'skip':\n skip = true;\n // Add next as literal...\n if (tokens[i + 1]) {\n pattern.push({\n type: 'literal',\n value: tokens[i + 1].value\n });\n }\n break;\n case 'literal':\n pattern.push(tokens[i]);\n break;\n case 'placeholder':\n pattern.push(tokens[i]);\n break;\n case 'decimal':\n pattern = res[curr].fraction;\n break;\n case 'divisor':\n if (res[curr].divisor === 0) {\n res[curr].divisor =\n Math.pow(10, tokens[i].value.length);\n }\n break;\n case 'group':\n res[curr].group = true;\n break;\n case 'adjust':\n /* istanbul ignore else */\n if (tokens[i].value === '%') {\n if (res[curr].multiplier === 0) {\n res[curr].multiplier = 100;\n }\n } else if (tokens[i].value === '‰') {\n if (res[curr].multiplier === 0) {\n res[curr].multiplier = 1000;\n }\n } else {\n throw new Error('Unrecognized adjustment ' +\n 'value \"' + tokens[i].type + '\"');\n }\n pattern.push({\n type: 'literal',\n value: tokens[i].value\n });\n break;\n }\n }\n\n if (!res.negative) {\n res.negative = res.positive;\n }\n if (!res.zero) {\n res.zero = res.positive;\n }\n\n postProcess('positive');\n postProcess('negative');\n postProcess('zero');\n return res;\n\n /**\n * Flattens literals, and ensures valid divisor and multiplier\n * values.\n * @param {string} curr The current section being processed.\n */\n function postProcess(curr) {\n var i;\n if (res[curr].divisor === 0) {\n res[curr].divisor = 1;\n }\n if (res[curr].multiplier === 0) {\n res[curr].multiplier = 1;\n }\n for (i = 1; i < res[curr].integral.length; i++) {\n if (res[curr].integral[i].type === 'literal' &&\n res[curr].integral[i - 1].type === 'literal') {\n // Combine the 2 literals\n res[curr].integral[i - 1].value +=\n res[curr].integral[i].value;\n res[curr].integral.splice(i, 1);\n i--;\n }\n }\n for (i = 1; i < res[curr].fraction.length; i++) {\n if (res[curr].fraction[i].type === 'literal' &&\n res[curr].fraction[i - 1].type === 'literal') {\n // Combine the 2 literals\n res[curr].fraction[i - 1].value +=\n res[curr].fraction[i].value;\n res[curr].fraction.splice(i, 1);\n i--;\n }\n }\n }\n\n /** Creates a new section */\n function createSection() {\n return {\n group: false,\n divisor: 0,\n multiplier: 0,\n integral: [],\n fraction: []\n };\n }\n }\n\n /**\n * Tokenizes the custom format string to make it easier to work with.\n */\n function tokenize() {\n var i, res, char, divisor, divisorStop, lit, litStop, prev,\n token;\n\n res = [];\n divisor = '';\n lit = '';\n for (i = 0; i < fmt.length; i++) {\n token = undefined;\n divisorStop = true;\n litStop = true;\n char = fmt.charAt(i);\n switch (char) {\n case '\\\\':\n token = {\n type: 'skip',\n value: '\\\\'\n };\n break;\n case '0':\n token = {\n type: 'placeholder',\n value: '0'\n };\n break;\n case '#':\n token = {\n type: 'placeholder',\n value: '#'\n };\n break;\n case '.':\n token = {\n type: 'decimal',\n value: '.'\n };\n break;\n case ',':\n divisor += ',';\n divisorStop = false;\n break;\n case '%':\n token = {\n type: 'adjust',\n value: '%'\n };\n break;\n case '‰':\n token = {\n type: 'adjust',\n value: '‰'\n };\n break;\n case ';':\n token = {\n type: 'section'\n };\n break;\n default:\n lit += char;\n litStop = false;\n break;\n }\n\n if (divisorStop && divisor) {\n endDivisor(token);\n }\n if (lit && litStop) {\n endLit();\n }\n if (token) {\n res.push(token);\n }\n prev = char;\n }\n\n if (divisor) {\n endDivisor();\n }\n\n if (lit) {\n endLit();\n }\n\n return res;\n\n /**\n * Ends the divisor capture which may result in a divisor,\n * or a group\n * @param {object} token The token to check.\n */\n function endDivisor(token) {\n if (!token || token.type === 'decimal') {\n res.push({\n type: 'divisor',\n value: divisor\n });\n } else {\n res.push({\n type: 'group',\n value: ','\n });\n }\n divisor = '';\n }\n\n /** Ends a literal capture */\n function endLit() {\n res.push({\n type: 'literal',\n value: lit\n });\n lit = '';\n }\n }\n }", "function get_language() {\r\n return _lang_code;\r\n }", "function translate$3(number,withoutSuffix,key){var result=number + ' ';switch(key){case 'ss':if(number === 1){result += 'sekunda';}else if(number === 2 || number === 3 || number === 4){result += 'sekunde';}else {result += 'sekundi';}return result;case 'm':return withoutSuffix?'jedna minuta':'jedne minute';case 'mm':if(number === 1){result += 'minuta';}else if(number === 2 || number === 3 || number === 4){result += 'minute';}else {result += 'minuta';}return result;case 'h':return withoutSuffix?'jedan sat':'jednog sata';case 'hh':if(number === 1){result += 'sat';}else if(number === 2 || number === 3 || number === 4){result += 'sata';}else {result += 'sati';}return result;case 'dd':if(number === 1){result += 'dan';}else {result += 'dana';}return result;case 'MM':if(number === 1){result += 'mjesec';}else if(number === 2 || number === 3 || number === 4){result += 'mjeseca';}else {result += 'mjeseci';}return result;case 'yy':if(number === 1){result += 'godina';}else if(number === 2 || number === 3 || number === 4){result += 'godine';}else {result += 'godina';}return result;}}", "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 $l(key,text) {\r\n\tvar string, l;\r\n\tif (lang[language][key]) { string = lang[language][key]; l = language; }\r\n\telse { string = lang['en'][key]; l = 'en'}\r\n\tif (text) { string = string.replace('%s', text); }\r\n\treturn string;\r\n}", "function $l(key,text) {\r\n\tvar string, l;\r\n\tif (lang[language][key]) { string = lang[language][key]; l = language; }\r\n\telse { string = lang['en'][key]; l = 'en'}\r\n\tif (text) { string = string.replace('%s', text); }\r\n\treturn string;\r\n}", "function $l(key,text) {\r\n\tvar string, l;\r\n\tif (lang[language][key]) { string = lang[language][key]; l = language; }\r\n\telse { string = lang['en'][key]; l = 'en'}\r\n\tif (text) { string = string.replace('%s', text); }\r\n\treturn string;\r\n}", "function t(e,t,n){return\"m\"===n?t?\"хвіліна\":\"хвіліну\":\"h\"===n?t?\"гадзіна\":\"гадзіну\":e+\" \"+function(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"хвіліна_хвіліны_хвілін\":\"хвіліну_хвіліны_хвілін\",hh:t?\"гадзіна_гадзіны_гадзін\":\"гадзіну_гадзіны_гадзін\",dd:\"дзень_дні_дзён\",MM:\"месяц_месяцы_месяцаў\",yy:\"год_гады_гадоў\"}[n],+e)}", "function t(e,t,n){return\"m\"===n?t?\"хвіліна\":\"хвіліну\":\"h\"===n?t?\"гадзіна\":\"гадзіну\":e+\" \"+function(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"хвіліна_хвіліны_хвілін\":\"хвіліну_хвіліны_хвілін\",hh:t?\"гадзіна_гадзіны_гадзін\":\"гадзіну_гадзіны_гадзін\",dd:\"дзень_дні_дзён\",MM:\"месяц_месяцы_месяцаў\",yy:\"год_гады_гадоў\"}[n],+e)}", "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 t(e,t,n){var r={ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"хвіліна_хвіліны_хвілін\":\"хвіліну_хвіліны_хвілін\",hh:t?\"гадзіна_гадзіны_гадзін\":\"гадзіну_гадзіны_гадзін\",dd:\"дзень_дні_дзён\",MM:\"месяц_месяцы_месяцаў\",yy:\"год_гады_гадоў\"};return\"m\"===n?t?\"хвіліна\":\"хвіліну\":\"h\"===n?t?\"гадзіна\":\"гадзіну\":e+\" \"+function(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}(r[n],+e)}", "function convertCurrencyCalculator (value) {\n\n\n\n\t}", "function t(e,t,n){var r,o;return\"m\"===n?t?\"хвилина\":\"хвилину\":\"h\"===n?t?\"година\":\"годину\":e+\" \"+(r=+e,o={ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[n].split(\"_\"),r%10==1&&r%100!=11?o[0]:r%10>=2&&r%10<=4&&(r%100<10||r%100>=20)?o[1]:o[2])}", "function t(e,t,n){var r,o;return\"m\"===n?t?\"хвилина\":\"хвилину\":\"h\"===n?t?\"година\":\"годину\":e+\" \"+(r=+e,o={ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[n].split(\"_\"),r%10==1&&r%100!=11?o[0]:r%10>=2&&r%10<=4&&(r%100<10||r%100>=20)?o[1]:o[2])}", "function t(e,t,n){var r,o;return\"m\"===n?t?\"хвилина\":\"хвилину\":\"h\"===n?t?\"година\":\"годину\":e+\" \"+(r=+e,o={ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[n].split(\"_\"),r%10==1&&r%100!=11?o[0]:r%10>=2&&r%10<=4&&(r%100<10||r%100>=20)?o[1]:o[2])}", "function t(e,t,n){var r,o;return\"m\"===n?t?\"хвилина\":\"хвилину\":\"h\"===n?t?\"година\":\"годину\":e+\" \"+(r=+e,o={ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[n].split(\"_\"),r%10==1&&r%100!=11?o[0]:r%10>=2&&r%10<=4&&(r%100<10||r%100>=20)?o[1]:o[2])}" ]
[ "0.651506", "0.64985025", "0.6482709", "0.62792337", "0.6258011", "0.6253429", "0.62495065", "0.6238753", "0.62161463", "0.62109095", "0.62088484", "0.61990064", "0.60094863", "0.5987913", "0.5980939", "0.59350103", "0.59262705", "0.5908184", "0.5867833", "0.5865651", "0.58216137", "0.58195525", "0.58169216", "0.5800721", "0.579371", "0.5789135", "0.578848", "0.57615095", "0.576037", "0.57548666", "0.57455236", "0.5736157", "0.5722436", "0.5721427", "0.5698622", "0.5660753", "0.5616776", "0.5606834", "0.5594794", "0.55858105", "0.5580076", "0.5578366", "0.5563133", "0.55525756", "0.55517185", "0.5549499", "0.55464995", "0.55393994", "0.55342096", "0.55303204", "0.55239815", "0.5512315", "0.55018646", "0.5494079", "0.54878163", "0.54860777", "0.54816145", "0.547315", "0.54708284", "0.54595584", "0.54537076", "0.54475886", "0.5445931", "0.5443686", "0.5436865", "0.5433246", "0.5432456", "0.5431958", "0.54294497", "0.54294497", "0.54271585", "0.5419659", "0.54186374", "0.54186374", "0.54180205", "0.5414475", "0.5403819", "0.5395495", "0.5395495", "0.5388269", "0.5377643", "0.537516", "0.537325", "0.53671485", "0.53671485", "0.53621846", "0.5355518", "0.5354265", "0.5351941", "0.5351941", "0.5351941", "0.53445673", "0.53445673", "0.53440577", "0.5343639", "0.5343202", "0.53419167", "0.53419167", "0.53419167", "0.53419167" ]
0.70016795
0
mask money event => object d = decimal point (string) sm = separator milhar (string) sd = separator decimal (string) return void
money(event, d = 2, sm = '.', sd = ','){ let decimal = d, separator_milhar = sd, separator_decimal = sd, decimal_potention = Math.pow(10, decimal), separator_thousend = `$1` + separator_milhar, override_value, value_pointer, blocks, parts, isObj = typeof event == 'object', isEmpty = event.target.value.length <= 0; if(!isObj || isEmpty){ throw new Error('Bad format object'); } event.target.setAttribute('maxLength', 20); override_value = event.target.value.replace(/\D/g, ''); value_pointer = (override_value / decimal_potention).toFixed(decimal); blocks = value_pointer.split('.'); parts = blocks[0] .toString() .replace(/(\d)(?=(\d{3})+(?!\d))/g, separator_thousend); event.target.value = `R$ ${typeof blocks[1] === 'undefined' ? parts : parts + separator_decimal + blocks[1]}`; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inputuang(e) {\n $(e).maskMoney({\n precision:0,\n prefix:'Rp. ', \n // allowNegative: true, \n thousands:'.', \n // decimal:',', \n affixesStay: true\n });\n }", "function format_amount(e)\r\n {\r\n var keyUnicode = e.charCode || e.keyCode;\r\n\r\n if (e !== undefined) {\r\n switch (keyUnicode) {\r\n case 16: break; // Shift\r\n case 17: break; // Ctrl\r\n case 18: break; // Alt\r\n case 27: this.value = ''; break; // Esc: clear entry\r\n case 35: break; // End\r\n case 36: break; // Home\r\n case 37: break; // cursor left\r\n case 38: break; // cursor up\r\n case 39: break; // cursor right\r\n case 40: break; // cursor down\r\n case 78: break; // N (Opera 9.63+ maps the \".\" from the number key section to the \"N\" key too!) (See: http://unixpapa.com/js/key.html search for \". Del\")\r\n case 110: break; // . number block (Opera 9.63+ maps the \".\" from the number block to the \"N\" key (78) !!!)\r\n case 190: break; // .\r\n default: $(this).formatCurrency({ colorize: true, negativeFormat: '-%s%n', roundToDecimalPlace: -1, eventOnDecimalsEntered: true });\r\n }\r\n }\r\n var new_val = $(this).val();\r\n var decimal_pos = new_val.indexOf(\".\");\r\n if(decimal_pos <=0) return;\r\n if((new_val.length - decimal_pos - 1) > 2)\r\n {\r\n //strip decimals more than 2 places\r\n $(this).val(new_val.substr(0,new_val.length - 1));\r\n }\r\n }", "function format_money(Obj, event) {\n _DECIMAL_DELIMITOR = \",\";\n var theKey;\n //var keyCode = (document.layers) ? keyStroke.which : event.keyCode;\n if (typeof (event) == \"undefined\") {\n theKey = window.event.keyCode;\n }\n else {\n theKey = (window.event) ? event.keyCode : event.which;\n }\n //var theKey = event.keyCode;\n // lay vi tri con tro \n var v_vi_tri_con_tro = doGetCaretPosition(Obj);\n var v_is_vi_tri_con_tro_o_cuoi = (v_vi_tri_con_tro == Obj.value.length) ? 1 : 0;\n //phuonghv add 20/08/2016 tim va thay the cac ky tu khong phai la kieu so ve rong.\n Obj.value = Obj.value.replace(/[^0-9,.-]/g, '');\n var theStringNum = Obj.value;\n theSecondStringNum = \"\";\n // Neu ki tu dau tien la \".\" thi bo qua\n if (theStringNum == \".\") {\n Obj.value = \"\";\n return;\n }\n var the_first_char = theStringNum.substr(0, 1);\n if (the_first_char == \"-\") {\n theStringNum = theStringNum.substr(1, theStringNum.length - 1);\n } else {\n the_first_char = \"\";\n }\n var theLen = theStringNum.length;\n\n pos = theStringNum.indexOf(\".\", 0)\n if (pos > 0) {\n arr_numstr = theStringNum.split(\".\");\n theFirstStringNum = theStringNum.substr(0, pos);\n theSecondStringNum = theStringNum.substr(pos + 1, theStringNum.length - pos);\n if (theSecondStringNum.substr(theSecondStringNum.length - 1, 1) == \".\") {\n Obj.value = the_first_char + theStringNum.substr(0, theStringNum.length - 1);\n return;\n }\n theStringNum = theFirstStringNum;\n }\n //Chi nhan cac ky tu la so\n if ((theKey >= 48 && theKey <= 57) || (theKey >= 96 && theKey <= 105) || (theKey == 8)) {\n var theNewString;\n var theSubString;\n var LastIndex;\n LastIndex = 0;\n theSubString = \"\"\n // Thay the ky tu \",\"\n for (var i = 0; i < theStringNum.length; i++) {\n if (theStringNum.substring(i, i + 1) == _DECIMAL_DELIMITOR)\t\t// Tim ky tu \",\"\n {\n theSubString = theSubString + theStringNum.substring(LastIndex, i)\n LastIndex = i + 1;\n }\n }\n theSubString = theSubString + theStringNum.substring(LastIndex, theStringNum.length) // Lay mot doan cuoi cung (vi doan cuoi cung khong co ky tu \",\")\n theStringNum = theSubString;\n\n theNewString = \"\"\n if (theStringNum.length > 3)\n while (theStringNum.length > 3) {\n theSubString = theStringNum.substring(theStringNum.length - 3, theStringNum.length);\n theStringNum = theStringNum.substring(0, theStringNum.length - 3);\n theNewString = _DECIMAL_DELIMITOR + theSubString + theNewString;\n //phuonghv add 20/08/2016 neu vi tri o cuoi thi tu dong cong them 1 vi them phan tach phan nghin boi dau ,\n if (v_is_vi_tri_con_tro_o_cuoi == 1) {\n v_vi_tri_con_tro++;\n }\n\n }\n if (pos > 0)\n theNewString = theStringNum + theNewString + \".\" + theSecondStringNum;\n else\n theNewString = theStringNum + theNewString;\n\n if (theLen > 3)\n Obj.value = the_first_char + theNewString;\n try {\n Obj.onchange();\n } catch (e) { ; }\n }\n // //phuonghv add 20/08/2016 dat lai vi tri con tro chuot vao vi tri nhap lieu\n setCaretPosition(Obj, v_vi_tri_con_tro);\n}", "function maskMoeda() {\n\t$(function() {\n\t\t$(\"#prc_prod\").maskMoney({\n\t\t\tthousands : '.',\n\t\t\tdecimal : ','\n\t\t});\n\t})\n}", "function maskQtd() {\n\t$(function() {\n\t\t$(\"#qtd_prod\").maskMoney({\n\t\t\tthousands : '',\n\t\t\tdecimal : ','\n\t\t});\n\t})\n}", "function Moneyformat() {\n $('.rate , .quantity').keyup(function (event) {\n // skip for arrow keys\n if (event.which >= 37 && event.which <= 40) return;\n // format number\n $(this).val(function (index, value) {\n return value.replace(/\\D/g, \"\").replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n });\n });\n }", "function perform(e){\n\t//e = t(e);\n\te = accounting.formatMoney(e);\n\te = e.replace(/^\\s+|\\s+$/g,\"\");\n\treturn e;\n\n}", "function MaskMoney(){ // criando função construtora, colocar as inicializacoes\r\n\t\tthis.decimal =$('.js-decimal'); // em função contrutora deve ser trocado var por this, pois o mesmo sera acesso no contexto da aplicacao\r\n\t\tthis.plain =$('.js-plain');\r\n\t}", "function setValueMaskMoney(elemento, valor, precision){\n\tvalor = valor.toString().replace('.', ',');\n\telemento.val(valor).focus().blur();\n}", "function formatMoney(number, c, d, t) {\n var formattedNumber, i, isNegative, j, n, s;\n n = number;\n isNegative = n < 0;\n c = (isNaN(c = Math.abs(c)) ? 2 : c);\n d = (d == null ? \".\" : d);\n t = (t == null ? \",\" : t);\n s = function(number) {\n if (isNegative) {\n return \"-\" + number;\n } else {\n return number;\n }\n };\n i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + \"\";\n j = ((j = i.length) > 3 ? j % 3 : 0);\n formattedNumber = (j ? i.substr(0, j) + t : \"\") + i.substr(j).replace(/(\\d{3})(?=\\d)/g, \"$1\" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : \"\");\n return s(formattedNumber);\n }", "function convertMoney(money) {\n return `$ ${money.toFixed(2).toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\")}`\n}", "static styleM(input) {\n return parseFloat(input / 1000).toFixed(2).toString().replace(\".\", \",\");\n }", "function forceCurrency(event) {\n\t// remove disallowed chars\n\tthis.value = this.value.replace(/[^0-9\\.]/g, \"\");\n\n\t// if only showing a dollar amount, add decimal points to show cents\n\tvar indexOfDecimal = this.value.indexOf(\".\");\n\tif (indexOfDecimal === -1) {\n\t\tthis.value += \".00\";\n\t}\n\t// if decimal is there, force exactly 2 digits after it\n\telse {\n\t\tvar charsAfterDecimal = this.value.slice(indexOfDecimal + 1, this.value.length);\n\t\t\n\t\t// add zeroes to the end of value until there are exactly 2 digits there\n\t\twhile (charsAfterDecimal.length < 2) {\n\t\t\tthis.value += \"0\";\n\t\t\tcharsAfterDecimal = this.value.slice(indexOfDecimal + 1, this.value.length);\n\t\t}\n\n\t\t// cut off any digits after decimal if more than 2\n\t\tthis.value = this.value.slice(0, indexOfDecimal + 3);\n\t}\n\n\t// if value starts with decimal point, add a zero in front. It looks better\n\tif (this.value.charAt(0) == \".\") {\n\t\tthis.value = \"0\" + this.value;\n\t}\n}", "function unformatMoney(money) {\n return parseFloat(money.replace(/[$,]/g, \"\"));\n }", "function formatoMoedaVolume(_num) {\n _num = _num.toString().replace(/\\$|\\,/g, '');\n if (isNaN(_num))\n _num = \"0\";\n var sign = (_num == (_num = Math.abs(_num)));\n _num = Math.floor(_num * 1000 + 0.50000000001);\n var cents = _num % 1000;\n _num = Math.floor(_num / 1000).toString();\n if (cents < 10)\n cents = \"0\" + cents;\n for (var i = 0; i < Math.floor((_num.length - (1 + i)) / 3); i++)\n _num = _num.substring(0, _num.length - (4 * i + 3)) + ',' + _num.substring(_num.length - (4 * i + 3));\n //retirando a virgula\n var retorno = (((sign) ? '' : '-') + _num + '.' + cents);\n while (retorno.indexOf(',') > - 1)\n retorno = retorno.replace(',', '');\n return retorno;\n}", "function cleanMoney(num){\n var out = '', str = String(num);\n for (var i = 1; i <= str.length; i++){\n var x = str.charAt(str.length - i);\n out = x + out;\n if (i % 3 === 0 && i < str.length &&\n !((str.includes('.')) && i === 3)){\n out = ',' + out;\n }\n }\n out = '$' + out;\n return out;\n }", "function formatMoney(num){ \n return num.toFixed(2).replace(/\\d(?=(\\d{3})+\\.)/g, '$&,');\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 dollars(n) {\n document.paycheck.feedback3.value = \"$ \" + n.toFixed(2);\n}", "function amountChanged() {\n var origAmount = $('#amount').val();\n\n if ($('#amountFormat').val() == \"DECIMAL\") {\n var amt = $.formatNumber(origAmount, {format: \"#,###.00\", locale: \"us\"});\n $('#realCCAmt').html(amt);\n }\n else {\n origAmount + \"00\";\n var amt = Number(origAmount) / 100;\n amt = $.formatNumber(amt, {format: \"#,###.00\", locale: \"us\"});\n $('#realCCAmt').html(amt);\n }\n}", "function FormatFourDecimal() {\n if (event != null) {\n var obj = event.srcElement;\n if (obj.value != \"\" && !(isNaN(obj.value))) {\n var intDecimalPlace = obj.value.length - obj.value.lastIndexOf(\".\")\n\n if (intDecimalPlace == 1 || intDecimalPlace == 0 || obj.value.lastIndexOf(\".\") == -1) {\n obj.value = obj.value + \".0000\"\n }\n else if (intDecimalPlace == 2) {\n obj.value = obj.value + \"000\"\n }\n else if (intDecimalPlace == 3) {\n obj.value = obj.value + \"00\"\n }\n else if (intDecimalPlace == 4) {\n obj.value = obj.value + \"0\"\n }\n else if (intDecimalPlace == 5) {\n obj.value = obj.value\n }\n }\n }\n}", "money( num, fixed ) {\n num = parseFloat( num ) || 0;\n fixed = parseInt( fixed ) || 0;\n let o = { style: 'decimal', minimumFractionDigits: fixed, maximumFractionDigits: fixed };\n return new Intl.NumberFormat( 'en-US', o ).format( num );\n }", "function formatMoney(number){\r\n\treturn '$' + number.toFixed(2).replace(/\\d(?=(\\d{3})+\\.)/g, '$&,');\r\n}", "function formatMoney(number){\n return '$'+number.toFixed(2).replace(/\\d(?=(\\d{3})+\\.)/g,'$&,');\n}", "function FormatNumber(num)\r\n{ \r\n var sVal='';\r\n var minus='';\r\n var CommaDelimiter=',';\r\n\t\t\r\n\t\tvar beforeDelimitorValue='';\r\n\t\tvar afterDelimitorValue=''; \r\n\t\tvar delimitarFlag=false;\r\n try \r\n {\r\n\t\tvar theLength=num.length;\r\n\t\t for (var i = 0 ; i < theLength ; i++)\r\n\t\t {\r\n\t\t if(num.charAt(i) == '.'){\r\n\t\t\t\tdelimitarFlag=true;\r\n\t\t\t}\r\n\t\t\tif(!delimitarFlag){\r\n\t\t\t\tbeforeDelimitorValue=beforeDelimitorValue+num.charAt(i);\t\t\r\n\t\t\t}else{\r\n\t\t\t\tafterDelimitorValue=afterDelimitorValue+num.charAt(i);\t\t\r\n\t\t\t}\r\n\t\t }\r\n\t\t var finalAmount=beforeDelimitorValue.toString();\r\n\t if (finalAmount.lastIndexOf(\"-\") == 0) { minus='-'; }\r\n finalAmount = FormatClean(finalAmount);\r\n finalAmount = parseFloat(finalAmount);\r\n var samount = new String(finalAmount);\r\n\t for (var i = 0; i < Math.floor((samount.length-(1+i))/3); i++)\r\n {\r\n samount = samount.substring(0,samount.length-(4*i+3)) + CommaDelimiter + samount.substring(samount.length-(4*i+3));\r\n }\r\n\t }\r\n catch (exception) { }\r\n return minus + samount+afterDelimitorValue;\r\n}", "function fomartMoney(number) {\n\treturn '$' + number.toFixed(2).replace(/\\d(?=(\\d{3})+\\.)/g, '$&,')\n}", "function formatMoney(number) {\r\n return '$ ' + number.toFixed(2).replace(/\\d(?=(\\d{3})+\\.)/g, '$&,');\r\n}", "function formatPrice(num)\n{\n\t num = num.toString().replace(/\\$|\\,/g,'');\n\t if(isNaN(num))\n\t num = \"0\";\n\t sign = (num == (num = Math.abs(num)));\n\t num = Math.floor(num*100+0.50000000001);\n\t cents = num%100;\n\t num = Math.floor(num/100).toString();\n\t if(cents<10)\n\t cents = \"0\" + cents;\n\t for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)\n\t num = num.substring(0,num.length-(4*i+3))+','+ num.substring(num.length-(4*i+3));\t \n\t //return (((sign)?'':'-') + '<?php //echo $this->model_superadmin->generate_isocode_bo()?> ' + num + ',' + cents);\n\t return (((sign)?'':'-') + 'Rp. '+ num +',00');\n}", "function FormatNum(num,mil,dec){\n\tvar num=new String(num);\n\tvar p=num.indexOf(\".\"); // se for = -1 n tem ponto\n\tif (p==-1){ \n\t\tnum+=\".00\";\n\t} else { \n\t\txy=num.split(\".\");\n\t\tt=xy[1];\n\t\tt=t.length;\n\t\tif (t==1){ num+=\"0\"; }\n\t}\n\tvar xe=num.split(\".\");\n\tvar te=xe[0];\n\tvar tamanho=te.length;\n\tvar vl='';\n\tvar c=0;\n\tvar te=te.replace(\"\",\" \");\n\tfor (i=tamanho; i > 0 ; i--){\t\t\n\t\tn=te.charAt(i);\n\t\tif (c==3){ vl=mil+vl; c=0; }\t\t\t\n\t\tvl=n+vl;\n\t\tc++;\n\t}\n\tif (vl==\"\"){ vl=0; }\n\tvar total=vl+\",\"+xe[1]\n\treturn total;\n}", "callback(value) {\n return formatCurrency(value, 0);\n }", "function cleanNumericValueForDisplaying(num) {\n var neg;\n if (num < 0) neg = true;\n else neg = false;\n num = Math.abs(num);\n var str = num.toString();\n\n var price, cleanPrice;\n var dollars, cleanDollars;\n var dollarArray = new Array();\n var correctOrder = '';\n var cents, cleanCents;\n\n if (str.indexOf('.') != -1) {\n price = str.split('.');\n dollars = price[0];\n cents = price[1];\n if (cents.length == 1) cleanCents = cents + '0';\n else cleanCents = cents;\n var commaCount = 0;\n for (var i = dollars.length - 1; i > -1; i--) {\n commaCount++;\n dollarArray.push(dollars[i]);\n if (commaCount % 3 == 0 && i != 0) dollarArray.push('-');\n }\n\n cleanDollars = dollarArray.toString();\n while (cleanDollars.indexOf(',') != -1) {\n cleanDollars = cleanDollars.replace(',', '');\n }\n\n while (cleanDollars.indexOf('-') != -1) {\n cleanDollars = cleanDollars.replace('-', ',');\n }\n\n for (var i = cleanDollars.length - 1; i > -1; i--) {\n correctOrder += cleanDollars[i];\n }\n\n cleanPrice = '$' + correctOrder + '.' + cleanCents;\n if (neg) {\n cleanPrice = '(-' + cleanPrice + ')';\n }\n return cleanPrice;\n } else {\n var commaCount = 0;\n for (var i = str.length - 1; i > -1; i--) {\n commaCount++;\n dollarArray.push(str[i]);\n if (commaCount % 3 == 0 && i != 0) dollarArray.push('-');\n }\n cleanDollars = dollarArray.toString();\n\n while (cleanDollars.indexOf(',') != -1) {\n cleanDollars = cleanDollars.replace(',', '');\n }\n\n while (cleanDollars.indexOf('-') != -1) {\n cleanDollars = cleanDollars.replace('-', ',');\n }\n\n for (var i = cleanDollars.length - 1; i > -1; i--) {\n correctOrder += cleanDollars[i];\n }\n\n cleanPrice = '$' + correctOrder;\n\n if (neg) {\n cleanPrice = '(-' + cleanPrice + ')';\n }\n return cleanPrice;\n }\n}", "callback(value) {\n return formatCurrency(value, 4);\n }", "function double_money(){\n arr.forEach(y=>{\n y.wealth=y.wealth.replace(',','')\n y.wealth=y.wealth.replace('$','')\n })\n arr.forEach(x=>{\n x.wealth='$'+(parseInt(x.wealth)*2).toString()+'.00';\n })\n }", "function displayFormattedMonetaryAmount(e) {\n var obj;\n //verificando se o que foi digitado é um número\n if (!isOnlyNumber(e)){\n return false;\n }\n\t //e.style.textAlign\t= \"right\";\n\t obj = (isNav) ? e.target : event.srcElement;\n\t keyCd = (isNav) ? e.which : event.keyCode;\n\n\t switch (keyCode) {\n\t // backspace\n\t\t\tcase 8:\n\t\t\t// delete\n\t\t\tcase 46:\n\t\t\t obj.value = formatMonetaryAmount(obj.value.substring(0,obj.value.length-1));\n\t\t\t\t break;\n\t\t\t// tab\n\t\t\tcase 9:\n\t\t\t return true;\n\t\t\t\t break;\n\t\t\tdefault :\n\t\t\t if ((keyCd>47)&&(keyCd<58)) {\n\t\t\t\t if (obj.maxLength>obj.value.length){\n\t\t\t\t\t\t obj.value = formatMonetaryAmount(obj.value + String.fromCharCode(keyCd));\n\t\t\t\t\t\t}\n\t\t\t\t }\t\n }\n\t return false;\n}", "function convertPounds(e) {\n let lbs = e.target.value;\n $output.style.visibility = \"visible\";\n if (lbs === \"\") {\n return ($output.style.visibility = \"hidden\"); // removing output if blank\n }\n $gramsOutput.innerHTML = (lbs / 0.0022046).toFixed(2);\n $kgOutput.innerHTML = (lbs / 2.205).toFixed(2);\n $ozOutput.innerHTML = (lbs * 16).toFixed(2);\n}", "function formatFrom ( decimals, thousand, mark, prefix, suffix, encoder, decoder, negativeBefore, negative, edit, undo, input ) {\r\n\r\n\t\tvar originalInput = input, inputIsNegative, output = '';\r\n\r\n\t\t// User defined pre-decoder. Result must be a non empty string.\r\n\t\tif ( undo ) {\r\n\t\t\tinput = undo(input);\r\n\t\t}\r\n\r\n\t\t// Test the input. Can't be empty.\r\n\t\tif ( !input || typeof input !== 'string' ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// If the string starts with the negativeBefore value: remove it.\r\n\t\t// Remember is was there, the number is negative.\r\n\t\tif ( negativeBefore && strStartsWith(input, negativeBefore) ) {\r\n\t\t\tinput = input.replace(negativeBefore, '');\r\n\t\t\tinputIsNegative = true;\r\n\t\t}\r\n\r\n\t\t// Repeat the same procedure for the prefix.\r\n\t\tif ( prefix && strStartsWith(input, prefix) ) {\r\n\t\t\tinput = input.replace(prefix, '');\r\n\t\t}\r\n\r\n\t\t// And again for negative.\r\n\t\tif ( negative && strStartsWith(input, negative) ) {\r\n\t\t\tinput = input.replace(negative, '');\r\n\t\t\tinputIsNegative = true;\r\n\t\t}\r\n\r\n\t\t// Remove the suffix.\r\n\t\t// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice\r\n\t\tif ( suffix && strEndsWith(input, suffix) ) {\r\n\t\t\tinput = input.slice(0, -1 * suffix.length);\r\n\t\t}\r\n\r\n\t\t// Remove the thousand grouping.\r\n\t\tif ( thousand ) {\r\n\t\t\tinput = input.split(thousand).join('');\r\n\t\t}\r\n\r\n\t\t// Set the decimal separator back to period.\r\n\t\tif ( mark ) {\r\n\t\t\tinput = input.replace(mark, '.');\r\n\t\t}\r\n\r\n\t\t// Prepend the negative symbol.\r\n\t\tif ( inputIsNegative ) {\r\n\t\t\toutput += '-';\r\n\t\t}\r\n\r\n\t\t// Add the number\r\n\t\toutput += input;\r\n\r\n\t\t// Trim all non-numeric characters (allow '.' and '-');\r\n\t\toutput = output.replace(/[^0-9\\.\\-.]/g, '');\r\n\r\n\t\t// The value contains no parse-able number.\r\n\t\tif ( output === '' ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// Covert to number.\r\n\t\toutput = Number(output);\r\n\r\n\t\t// Run the user-specified post-decoder.\r\n\t\tif ( decoder ) {\r\n\t\t\toutput = decoder(output);\r\n\t\t}\r\n\r\n\t\t// Check is the output is valid, otherwise: return false.\r\n\t\tif ( !isValidNumber(output) ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}", "asText4() {\nreturn this._makeText(`${this.amount.toFixed(4)}`);\n}", "function formatTo ( decimals, thousand, mark, prefix, suffix, encoder, decoder, negativeBefore, negative, edit, undo, input ) {\r\n\r\n\t\tvar originalInput = input, inputIsNegative, inputPieces, inputBase, inputDecimals = '', output = '';\r\n\r\n\t\t// Apply user encoder to the input.\r\n\t\t// Expected outcome: number.\r\n\t\tif ( encoder ) {\r\n\t\t\tinput = encoder(input);\r\n\t\t}\r\n\r\n\t\t// Stop if no valid number was provided, the number is infinite or NaN.\r\n\t\tif ( !isValidNumber(input) ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// Rounding away decimals might cause a value of -0\r\n\t\t// when using very small ranges. Remove those cases.\r\n\t\tif ( decimals !== false && parseFloat(input.toFixed(decimals)) === 0 ) {\r\n\t\t\tinput = 0;\r\n\t\t}\r\n\r\n\t\t// Formatting is done on absolute numbers,\r\n\t\t// decorated by an optional negative symbol.\r\n\t\tif ( input < 0 ) {\r\n\t\t\tinputIsNegative = true;\r\n\t\t\tinput = Math.abs(input);\r\n\t\t}\r\n\r\n\t\t// Reduce the number of decimals to the specified option.\r\n\t\tif ( decimals !== false ) {\r\n\t\t\tinput = toFixed( input, decimals );\r\n\t\t}\r\n\r\n\t\t// Transform the number into a string, so it can be split.\r\n\t\tinput = input.toString();\r\n\r\n\t\t// Break the number on the decimal separator.\r\n\t\tif ( input.indexOf('.') !== -1 ) {\r\n\t\t\tinputPieces = input.split('.');\r\n\r\n\t\t\tinputBase = inputPieces[0];\r\n\r\n\t\t\tif ( mark ) {\r\n\t\t\t\tinputDecimals = mark + inputPieces[1];\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\r\n\t\t// If it isn't split, the entire number will do.\r\n\t\t\tinputBase = input;\r\n\t\t}\r\n\r\n\t\t// Group numbers in sets of three.\r\n\t\tif ( thousand ) {\r\n\t\t\tinputBase = strReverse(inputBase).match(/.{1,3}/g);\r\n\t\t\tinputBase = strReverse(inputBase.join( strReverse( thousand ) ));\r\n\t\t}\r\n\r\n\t\t// If the number is negative, prefix with negation symbol.\r\n\t\tif ( inputIsNegative && negativeBefore ) {\r\n\t\t\toutput += negativeBefore;\r\n\t\t}\r\n\r\n\t\t// Prefix the number\r\n\t\tif ( prefix ) {\r\n\t\t\toutput += prefix;\r\n\t\t}\r\n\r\n\t\t// Normal negative option comes after the prefix. Defaults to '-'.\r\n\t\tif ( inputIsNegative && negative ) {\r\n\t\t\toutput += negative;\r\n\t\t}\r\n\r\n\t\t// Append the actual number.\r\n\t\toutput += inputBase;\r\n\t\toutput += inputDecimals;\r\n\r\n\t\t// Apply the suffix.\r\n\t\tif ( suffix ) {\r\n\t\t\toutput += suffix;\r\n\t\t}\r\n\r\n\t\t// Run the output through a user-specified post-formatter.\r\n\t\tif ( edit ) {\r\n\t\t\toutput = edit ( output, originalInput );\r\n\t\t}\r\n\r\n\t\t// All done.\r\n\t\treturn output;\r\n\t}", "dollars(num) {\n if(this.state.active === false) {\n return (num).toFixed(2);\n } else {\n return num;\n }\n }", "function formatAsMoney(amount) {\r\n\t return '$' + parseFloat(amount, 10).toFixed(2).replace(/(\\d)(?=(\\d{3})+\\.)/g, \"$1,\").toString();\r\n\t }", "function formatMoney(amount){\r\n return \"$\" + amount.toFixed(2)\r\n}", "function formatFrom ( decimals, thousand, mark, prefix, suffix, encoder, decoder, negativeBefore, negative, edit, undo, input ) {\n\n\t\tvar originalInput = input, inputIsNegative, output = '';\n\n\t\t// User defined pre-decoder. Result must be a non empty string.\n\t\tif ( undo ) {\n\t\t\tinput = undo(input);\n\t\t}\n\n\t\t// Test the input. Can't be empty.\n\t\tif ( !input || typeof input !== 'string' ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// If the string starts with the negativeBefore value: remove it.\n\t\t// Remember is was there, the number is negative.\n\t\tif ( negativeBefore && strStartsWith(input, negativeBefore) ) {\n\t\t\tinput = input.replace(negativeBefore, '');\n\t\t\tinputIsNegative = true;\n\t\t}\n\n\t\t// Repeat the same procedure for the prefix.\n\t\tif ( prefix && strStartsWith(input, prefix) ) {\n\t\t\tinput = input.replace(prefix, '');\n\t\t}\n\n\t\t// And again for negative.\n\t\tif ( negative && strStartsWith(input, negative) ) {\n\t\t\tinput = input.replace(negative, '');\n\t\t\tinputIsNegative = true;\n\t\t}\n\n\t\t// Remove the suffix.\n\t\t// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice\n\t\tif ( suffix && strEndsWith(input, suffix) ) {\n\t\t\tinput = input.slice(0, -1 * suffix.length);\n\t\t}\n\n\t\t// Remove the thousand grouping.\n\t\tif ( thousand ) {\n\t\t\tinput = input.split(thousand).join('');\n\t\t}\n\n\t\t// Set the decimal separator back to period.\n\t\tif ( mark ) {\n\t\t\tinput = input.replace(mark, '.');\n\t\t}\n\n\t\t// Prepend the negative symbol.\n\t\tif ( inputIsNegative ) {\n\t\t\toutput += '-';\n\t\t}\n\n\t\t// Add the number\n\t\toutput += input;\n\n\t\t// Trim all non-numeric characters (allow '.' and '-');\n\t\toutput = output.replace(/[^0-9\\.\\-.]/g, '');\n\n\t\t// The value contains no parse-able number.\n\t\tif ( output === '' ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Covert to number.\n\t\toutput = Number(output);\n\n\t\t// Run the user-specified post-decoder.\n\t\tif ( decoder ) {\n\t\t\toutput = decoder(output);\n\t\t}\n\n\t\t// Check is the output is valid, otherwise: return false.\n\t\tif ( !isValidNumber(output) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn output;\n\t}", "function betChange(){\n var quotation = Number($('.betModalQuotation > span:last-child').text().replace(',', '.'));\n\n var bet = Number($('#betInput').val());\n\n var sum = (quotation * bet).toFixed(2);\n\n $('.betModalSum').text(sum + ' €');\n}", "function formatTo ( decimals, thousand, mark, prefix, suffix, encoder, decoder, negativeBefore, negative, edit, undo, input ) {\n\n\t\tvar originalInput = input, inputIsNegative, inputPieces, inputBase, inputDecimals = '', output = '';\n\n\t\t// Apply user encoder to the input.\n\t\t// Expected outcome: number.\n\t\tif ( encoder ) {\n\t\t\tinput = encoder(input);\n\t\t}\n\n\t\t// Stop if no valid number was provided, the number is infinite or NaN.\n\t\tif ( !isValidNumber(input) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Rounding away decimals might cause a value of -0\n\t\t// when using very small ranges. Remove those cases.\n\t\tif ( decimals !== false && parseFloat(input.toFixed(decimals)) === 0 ) {\n\t\t\tinput = 0;\n\t\t}\n\n\t\t// Formatting is done on absolute numbers,\n\t\t// decorated by an optional negative symbol.\n\t\tif ( input < 0 ) {\n\t\t\tinputIsNegative = true;\n\t\t\tinput = Math.abs(input);\n\t\t}\n\n\t\t// Reduce the number of decimals to the specified option.\n\t\tif ( decimals !== false ) {\n\t\t\tinput = toFixed( input, decimals );\n\t\t}\n\n\t\t// Transform the number into a string, so it can be split.\n\t\tinput = input.toString();\n\n\t\t// Break the number on the decimal separator.\n\t\tif ( input.indexOf('.') !== -1 ) {\n\t\t\tinputPieces = input.split('.');\n\n\t\t\tinputBase = inputPieces[0];\n\n\t\t\tif ( mark ) {\n\t\t\t\tinputDecimals = mark + inputPieces[1];\n\t\t\t}\n\n\t\t} else {\n\n\t\t// If it isn't split, the entire number will do.\n\t\t\tinputBase = input;\n\t\t}\n\n\t\t// Group numbers in sets of three.\n\t\tif ( thousand ) {\n\t\t\tinputBase = strReverse(inputBase).match(/.{1,3}/g);\n\t\t\tinputBase = strReverse(inputBase.join( strReverse( thousand ) ));\n\t\t}\n\n\t\t// If the number is negative, prefix with negation symbol.\n\t\tif ( inputIsNegative && negativeBefore ) {\n\t\t\toutput += negativeBefore;\n\t\t}\n\n\t\t// Prefix the number\n\t\tif ( prefix ) {\n\t\t\toutput += prefix;\n\t\t}\n\n\t\t// Normal negative option comes after the prefix. Defaults to '-'.\n\t\tif ( inputIsNegative && negative ) {\n\t\t\toutput += negative;\n\t\t}\n\n\t\t// Append the actual number.\n\t\toutput += inputBase;\n\t\toutput += inputDecimals;\n\n\t\t// Apply the suffix.\n\t\tif ( suffix ) {\n\t\t\toutput += suffix;\n\t\t}\n\n\t\t// Run the output through a user-specified post-formatter.\n\t\tif ( edit ) {\n\t\t\toutput = edit ( output, originalInput );\n\t\t}\n\n\t\t// All done.\n\t\treturn output;\n\t}", "inputsFormat() {\n\n // On input\n this.jQueryCount.on('input', ( function(){\n\n // RegExp to find non-numerical chars\n const nonDigitRegExp = /\\D/;\n \n // Non-numerical chars are prohibited to input\n $(this).val($(this).val().replace(nonDigitRegExp,''));\n \n\n }));\n\n // On input\n this.jQueryPrice.on('input', (function(){\n \n // RegExp to find non-numerical and non-dot chars\n const nonDigitRegExp = /[^0-9.]/;\n\n // Prohibites chars are replaced with empty string\n $(this).val($(this).val().replace(nonDigitRegExp,''));\n\n // Basically this code allows only one dot in the field\n // The dot can be 'moved' forward, but not backwards -- that's kinda an issue tbh\n // NOTE: Think how to rewrite this to deal with 'past' and 'present' dot\n if($(this).val().match(/\\./g)){\n \n if($(this).val().match(/\\./g).length > 1){\n \n const valArray = $(this).val().split('');\n valArray[valArray.indexOf('.')] = '';\n $(this).val(valArray.join(''));\n }\n }\n \n }));\n \n // During focus\n this.jQueryPrice.focus(function(){\n\n // Dollar sign is hid\n let regExpDollar = /\\$/;\n\n $(this).val($(this).val().replace(/\\,/g, ''));\n $(this).val($(this).val().replace(regExpDollar, ''));\n });\n\n // Out of focus\n this.jQueryPrice.blur(function(){\n\n \n let regExpDollar = /\\$/;\n\n // Semis are put to divide digits\n if(!isNaN(parseFloat($(this).val()))){\n $(this).val(putSemi($(this).val()));\n\n // And dollar sign is added to the beggining of the string\n if(!$(this).val().match(regExpDollar)){\n $(this).val('$'.concat($(this).val()));\n }\n }\n\n // This code deletes all dots except one\n const strayDotRegExp = /\\.(?!\\d)/g;\n\n $(this).val($(this).val().replace(strayDotRegExp,''));\n \n if($(this).val().charAt(0) === '.'){\n $(this).val($(this).val().slice(1));\n }\n });\n \n }", "formatAmount(num) {\n var num = '' + num;\n var inputa = 0;\n if (num.indexOf('.') !== -1) {\n\n // move foucus to Decimal TextField\n this.mNumTextInput.current.blur();\n this.mDecimalTextInput.current.focus();\n\n //make the Decimal TextField Started with \".\"\n if (!this.state.mDecimal || this.state.mDecimal === '.00') {\n this.setState({\n mDecimal: '.'\n });\n }\n }\n // index is changeed, delete the old \",\" then reAdd\n num = num.replace(/[^0-9]/g, '');\n this.setState({\n mInt: (num || '').toString().replace(/(\\d)(?=(?:\\d{3})+$)/g, '$1,'),//.replace(/^0+/, '')\n });\n\n if (this.state.mDecima) {\n inputa = num + '' + this.state.mDecimal;\n } else {\n inputa = num;\n }\n\n this.props.onChangeText(inputa);\n }", "function parseMoney(text) {\n return text.replace(/^[0-9.,]/g, '');\n}", "function formatMoney(amount){\r\n let decimal = Math.round((amount - parseInt(amount))*100)/100\r\n let arr = Array.from(String(decimal.toString()), Number)\r\n let newArr = arr.slice(-2)\r\n let empty = []\r\n if(parseFloat(amount) == parseInt(amount)){\r\n empty.push(\"0\")\r\n empty.push(\"0\")\r\n return (\"$\" + parseInt(amount)) + \".\" + empty.join(\"\")\r\n }else if(newArr.join(\" \").includes('NaN')){\r\n newArr = newArr.slice(-1)\r\n newArr.push(\"0\")\r\n let result = (\"$\" + parseInt(amount)) + \".\" + newArr.join(\"\")\r\n return result\r\n }else if(newArr.length = 2){\r\n let result = \"$\" + (parseInt(amount) + parseFloat(\".\" + newArr.join(\"\")))\r\n return result\r\n }\r\n }", "function formatFrom(\n decimals,\n thousand,\n mark,\n prefix,\n suffix,\n encoder,\n decoder,\n negativeBefore,\n negative,\n edit,\n undo,\n input\n ) {\n var originalInput = input,\n inputIsNegative,\n output = \"\";\n\n // User defined pre-decoder. Result must be a non empty string.\n if (undo) {\n input = undo(input);\n }\n\n // Test the input. Can't be empty.\n if (!input || typeof input !== \"string\") {\n return false;\n }\n\n // If the string starts with the negativeBefore value: remove it.\n // Remember is was there, the number is negative.\n if (negativeBefore && strStartsWith(input, negativeBefore)) {\n input = input.replace(negativeBefore, \"\");\n inputIsNegative = true;\n }\n\n // Repeat the same procedure for the prefix.\n if (prefix && strStartsWith(input, prefix)) {\n input = input.replace(prefix, \"\");\n }\n\n // And again for negative.\n if (negative && strStartsWith(input, negative)) {\n input = input.replace(negative, \"\");\n inputIsNegative = true;\n }\n\n // Remove the suffix.\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice\n if (suffix && strEndsWith(input, suffix)) {\n input = input.slice(0, -1 * suffix.length);\n }\n\n // Remove the thousand grouping.\n if (thousand) {\n input = input.split(thousand).join(\"\");\n }\n\n // Set the decimal separator back to period.\n if (mark) {\n input = input.replace(mark, \".\");\n }\n\n // Prepend the negative symbol.\n if (inputIsNegative) {\n output += \"-\";\n }\n\n // Add the number\n output += input;\n\n // Trim all non-numeric characters (allow '.' and '-');\n output = output.replace(/[^0-9\\.\\-.]/g, \"\");\n\n // The value contains no parse-able number.\n if (output === \"\") {\n return false;\n }\n\n // Covert to number.\n output = Number(output);\n\n // Run the user-specified post-decoder.\n if (decoder) {\n output = decoder(output);\n }\n\n // Check is the output is valid, otherwise: return false.\n if (!isValidNumber(output)) {\n return false;\n }\n\n return output;\n }", "function formatTo(\n decimals,\n thousand,\n mark,\n prefix,\n suffix,\n encoder,\n decoder,\n negativeBefore,\n negative,\n edit,\n undo,\n input\n ) {\n var originalInput = input,\n inputIsNegative,\n inputPieces,\n inputBase,\n inputDecimals = \"\",\n output = \"\";\n\n // Apply user encoder to the input.\n // Expected outcome: number.\n if (encoder) {\n input = encoder(input);\n }\n\n // Stop if no valid number was provided, the number is infinite or NaN.\n if (!isValidNumber(input)) {\n return false;\n }\n\n // Rounding away decimals might cause a value of -0\n // when using very small ranges. Remove those cases.\n if (decimals !== false && parseFloat(input.toFixed(decimals)) === 0) {\n input = 0;\n }\n\n // Formatting is done on absolute numbers,\n // decorated by an optional negative symbol.\n if (input < 0) {\n inputIsNegative = true;\n input = Math.abs(input);\n }\n\n // Reduce the number of decimals to the specified option.\n if (decimals !== false) {\n input = toFixed(input, decimals);\n }\n\n // Transform the number into a string, so it can be split.\n input = input.toString();\n\n // Break the number on the decimal separator.\n if (input.indexOf(\".\") !== -1) {\n inputPieces = input.split(\".\");\n\n inputBase = inputPieces[0];\n\n if (mark) {\n inputDecimals = mark + inputPieces[1];\n }\n } else {\n // If it isn't split, the entire number will do.\n inputBase = input;\n }\n\n // Group numbers in sets of three.\n if (thousand) {\n inputBase = strReverse(inputBase).match(/.{1,3}/g);\n inputBase = strReverse(inputBase.join(strReverse(thousand)));\n }\n\n // If the number is negative, prefix with negation symbol.\n if (inputIsNegative && negativeBefore) {\n output += negativeBefore;\n }\n\n // Prefix the number\n if (prefix) {\n output += prefix;\n }\n\n // Normal negative option comes after the prefix. Defaults to '-'.\n if (inputIsNegative && negative) {\n output += negative;\n }\n\n // Append the actual number.\n output += inputBase;\n output += inputDecimals;\n\n // Apply the suffix.\n if (suffix) {\n output += suffix;\n }\n\n // Run the output through a user-specified post-formatter.\n if (edit) {\n output = edit(output, originalInput);\n }\n\n // All done.\n return output;\n }", "normalizeCurrencyValue(value){\n if (!value) {\n return value;\n }\n var onlyNums = value.replace(/[^\\d]/g, '');\n return onlyNums;\n }", "function formatTo ( decimals, thousand, mark, prefix, postfix, encoder, decoder, negativeBefore, negative, edit, undo, input ) {\r\n\r\n\t\tvar originalInput = input, inputIsNegative, inputPieces, inputBase, inputDecimals = '', output = '';\r\n\r\n\t\t// Apply user encoder to the input.\r\n\t\t// Expected outcome: number.\r\n\t\tif ( encoder ) {\r\n\t\t\tinput = encoder(input);\r\n\t\t}\r\n\r\n\t\t// Stop if no valid number was provided, the number is infinite or NaN.\r\n\t\tif ( !isValidNumber(input) ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// Rounding away decimals might cause a value of -0\r\n\t\t// when using very small ranges. Remove those cases.\r\n\t\tif ( decimals !== false && parseFloat(input.toFixed(decimals)) === 0 ) {\r\n\t\t\tinput = 0;\r\n\t\t}\r\n\r\n\t\t// Formatting is done on absolute numbers,\r\n\t\t// decorated by an optional negative symbol.\r\n\t\tif ( input < 0 ) {\r\n\t\t\tinputIsNegative = true;\r\n\t\t\tinput = Math.abs(input);\r\n\t\t}\r\n\r\n\t\t// Reduce the number of decimals to the specified option.\r\n\t\tif ( decimals !== false ) {\r\n\t\t\tinput = toFixed( input, decimals );\r\n\t\t}\r\n\r\n\t\t// Transform the number into a string, so it can be split.\r\n\t\tinput = input.toString();\r\n\r\n\t\t// Break the number on the decimal separator.\r\n\t\tif ( input.indexOf('.') !== -1 ) {\r\n\t\t\tinputPieces = input.split('.');\r\n\r\n\t\t\tinputBase = inputPieces[0];\r\n\r\n\t\t\tif ( mark ) {\r\n\t\t\t\tinputDecimals = mark + inputPieces[1];\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\r\n\t\t// If it isn't split, the entire number will do.\r\n\t\t\tinputBase = input;\r\n\t\t}\r\n\r\n\t\t// Group numbers in sets of three.\r\n\t\tif ( thousand ) {\r\n\t\t\tinputBase = strReverse(inputBase).match(/.{1,3}/g);\r\n\t\t\tinputBase = strReverse(inputBase.join( strReverse( thousand ) ));\r\n\t\t}\r\n\r\n\t\t// If the number is negative, prefix with negation symbol.\r\n\t\tif ( inputIsNegative && negativeBefore ) {\r\n\t\t\toutput += negativeBefore;\r\n\t\t}\r\n\r\n\t\t// Prefix the number\r\n\t\tif ( prefix ) {\r\n\t\t\toutput += prefix;\r\n\t\t}\r\n\r\n\t\t// Normal negative option comes after the prefix. Defaults to '-'.\r\n\t\tif ( inputIsNegative && negative ) {\r\n\t\t\toutput += negative;\r\n\t\t}\r\n\r\n\t\t// Append the actual number.\r\n\t\toutput += inputBase;\r\n\t\toutput += inputDecimals;\r\n\r\n\t\t// Apply the postfix.\r\n\t\tif ( postfix ) {\r\n\t\t\toutput += postfix;\r\n\t\t}\r\n\r\n\t\t// Run the output through a user-specified post-formatter.\r\n\t\tif ( edit ) {\r\n\t\t\toutput = edit ( output, originalInput );\r\n\t\t}\r\n\r\n\t\t// All done.\r\n\t\treturn output;\r\n\t}", "function formatFrom ( decimals, thousand, mark, prefix, postfix, encoder, decoder, negativeBefore, negative, edit, undo, input ) {\r\n\r\n\t\tvar originalInput = input, inputIsNegative, output = '';\r\n\r\n\t\t// User defined pre-decoder. Result must be a non empty string.\r\n\t\tif ( undo ) {\r\n\t\t\tinput = undo(input);\r\n\t\t}\r\n\r\n\t\t// Test the input. Can't be empty.\r\n\t\tif ( !input || typeof input !== 'string' ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// If the string starts with the negativeBefore value: remove it.\r\n\t\t// Remember is was there, the number is negative.\r\n\t\tif ( negativeBefore && strStartsWith(input, negativeBefore) ) {\r\n\t\t\tinput = input.replace(negativeBefore, '');\r\n\t\t\tinputIsNegative = true;\r\n\t\t}\r\n\r\n\t\t// Repeat the same procedure for the prefix.\r\n\t\tif ( prefix && strStartsWith(input, prefix) ) {\r\n\t\t\tinput = input.replace(prefix, '');\r\n\t\t}\r\n\r\n\t\t// And again for negative.\r\n\t\tif ( negative && strStartsWith(input, negative) ) {\r\n\t\t\tinput = input.replace(negative, '');\r\n\t\t\tinputIsNegative = true;\r\n\t\t}\r\n\r\n\t\t// Remove the postfix.\r\n\t\t// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice\r\n\t\tif ( postfix && strEndsWith(input, postfix) ) {\r\n\t\t\tinput = input.slice(0, -1 * postfix.length);\r\n\t\t}\r\n\r\n\t\t// Remove the thousand grouping.\r\n\t\tif ( thousand ) {\r\n\t\t\tinput = input.split(thousand).join('');\r\n\t\t}\r\n\r\n\t\t// Set the decimal separator back to period.\r\n\t\tif ( mark ) {\r\n\t\t\tinput = input.replace(mark, '.');\r\n\t\t}\r\n\r\n\t\t// Prepend the negative symbol.\r\n\t\tif ( inputIsNegative ) {\r\n\t\t\toutput += '-';\r\n\t\t}\r\n\r\n\t\t// Add the number\r\n\t\toutput += input;\r\n\r\n\t\t// Trim all non-numeric characters (allow '.' and '-');\r\n\t\toutput = output.replace(/[^0-9\\.\\-.]/g, '');\r\n\r\n\t\t// The value contains no parse-able number.\r\n\t\tif ( output === '' ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// Covert to number.\r\n\t\toutput = Number(output);\r\n\r\n\t\t// Run the user-specified post-decoder.\r\n\t\tif ( decoder ) {\r\n\t\t\toutput = decoder(output);\r\n\t\t}\r\n\r\n\t\t// Check is the output is valid, otherwise: return false.\r\n\t\tif ( !isValidNumber(output) ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}", "function formatoMoeda(_num) {\n _num = _num.toString().replace(/\\$|\\,/g, '');\n var decimal = 2;\n if (arguments.length >= 2) {\n decimal = arguments[1];\n }\n var pow = Math.pow(10, decimal);\n if (isNaN(_num))\n _num = \"0\";\n var sign = (_num == (_num = Math.abs(_num)));\n _num = Math.floor(_num * pow + 0.50000000001);\n var cents = _num % pow;\n _num = Math.floor(_num / pow).toString();\n if (cents < 10)\n cents = \"0\" + cents;\n for (var i = 0; i < Math.floor((_num.length - (1 + i)) / 3); i++)\n _num = _num.substring(0, _num.length - (4 * i + 3)) + ',' + _num.substring(_num.length - (4 * i + 3));\n\n //retirando a virgula\n var retorno = (((sign) ? '' : '-') + _num + '.' + cents);\n while (retorno.indexOf(',') > - 1)\n retorno = retorno.replace(',', '');\n return retorno;\n}", "function handleChange(e) {\n const {\n target: { value },\n } = e;\n // custom value for masking | const tranformValue = value.split(\"/\").join(\"\");\n if (isCurrency) {\n const parseValue = Number(value.replace(/[^0-9.-]+/g, ''));\n const currency = new Intl.NumberFormat().format(parseValue); // 123,456\n setCurrencyValue(currency);\n setFieldValue(name, parseValue);\n }\n }", "function inputNumericoDec(id) {\n id.keyup(function() {\n this.value = (this.value + '').replace(/[^.0-9]/g, '');\n });\n}", "function formatMoney(number) {\n return '$' + number.toFixed(2).replace(/\\d(?=(\\d{3})+\\.)/g, '$&,');\n}", "function formatDisplayGift(input) {\n\t\t\tif (typeof input == \"undefined\") {\n\t\t\t\tvar input = \"\";\n\t\t\t}\n\t\t\tinput = \"\" + input;\n\t\t\tvar amount = cleanCurrency(input);\n\t\t\tamount = amount.toFixed(2);\n\t\t\tamount = amount.replace(/\\.00$/g, \"\");\n\t\t\treturn amount;\n\t\t}", "formatCurrency(value) {\n // get signal\n const signal = Number(value) < 0 ? '-' : ''\n //clean string\n // \\D -> Encontre tudo que náo é number\n value = String(value).replace(/\\D/g, '')\n // convert \n value = Number(value) / 100\n value = value.toLocaleString(\"pt-BR\", {\n style: \"currency\",\n currency: \"BRL\"\n })\n\n return signal + value\n }", "function formatCurrency(n, c, d, t) {\n\t\tvar c = isNaN(c = Math.abs(c)) ? 2 : c,\n\t\t\td = (d == undefined) ? \".\" : d,\n\t\t\tt = (t == undefined) ? \",\" : t,\n\t\t\ts = (n < 0) ? \"-\" : \"\",\n\t\t\ti = parseInt(n = Math.abs(+n || 0).toFixed(c)) + \"\",\n\t\t\tj = ((j = i.length) > 3) ? (j % 3) : 0;\n\t\treturn APP_OPTS.currencyChar + s + (j ? i.substr(0, j) + t : \"\") + i.substr(j).replace(/(\\d{3})(?=\\d)/g, \"$1\" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : \"\");\n\t}", "function formatMoney(numStr) {\r\n // remove all spaces\r\n numStr = numStr.replace(/\\s/g, \"\");\r\n var minus;\r\n if(numStr.length && numStr[0]==='-') {\r\n minus = numStr[0];\r\n numStr = numStr.substr(1, numStr.length);\r\n } else {\r\n minus = '';\r\n }\r\n\r\n numStr = decimalNumberService.cutExtraZeros(numStr, 2);\r\n\r\n var data= numStr.split('.');\r\n if (data.length===1) {\r\n if(numStr.length) {\r\n return minus + insertSpaces(numStr) + '.00';\r\n } else {\r\n return '0.00';\r\n }\r\n } else {\r\n var digits = data[0];\r\n var fractions = data[1];\r\n\r\n // fractions format\r\n if(fractions.length === 0) {\r\n fractions = '00';\r\n } else if (fractions.length === 1) {\r\n fractions += '0';\r\n } else {\r\n fractions = fractions.substr(0, 2);\r\n }\r\n\r\n if(digits.length === 0) {\r\n digits = '0';\r\n } else {\r\n digits = insertSpaces(digits);\r\n }\r\n\r\n return minus + digits + '.' + fractions;\r\n }\r\n }", "convert() {\n return `${(this.payments.type.price[this.currencyType] / 100)}`;\n }", "function formatFrom ( decimals, thousand, mark, prefix, postfix, encoder, decoder, negativeBefore, negative, edit, undo, input ) {\n\n\t\tvar originalInput = input, inputIsNegative, output = '';\n\n\t\t// User defined pre-decoder. Result must be a non empty string.\n\t\tif ( undo ) {\n\t\t\tinput = undo(input);\n\t\t}\n\n\t\t// Test the input. Can't be empty.\n\t\tif ( !input || typeof input !== 'string' ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// If the string starts with the negativeBefore value: remove it.\n\t\t// Remember is was there, the number is negative.\n\t\tif ( negativeBefore && strStartsWith(input, negativeBefore) ) {\n\t\t\tinput = input.replace(negativeBefore, '');\n\t\t\tinputIsNegative = true;\n\t\t}\n\n\t\t// Repeat the same procedure for the prefix.\n\t\tif ( prefix && strStartsWith(input, prefix) ) {\n\t\t\tinput = input.replace(prefix, '');\n\t\t}\n\n\t\t// And again for negative.\n\t\tif ( negative && strStartsWith(input, negative) ) {\n\t\t\tinput = input.replace(negative, '');\n\t\t\tinputIsNegative = true;\n\t\t}\n\n\t\t// Remove the postfix.\n\t\t// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice\n\t\tif ( postfix && strEndsWith(input, postfix) ) {\n\t\t\tinput = input.slice(0, -1 * postfix.length);\n\t\t}\n\n\t\t// Remove the thousand grouping.\n\t\tif ( thousand ) {\n\t\t\tinput = input.split(thousand).join('');\n\t\t}\n\n\t\t// Set the decimal separator back to period.\n\t\tif ( mark ) {\n\t\t\tinput = input.replace(mark, '.');\n\t\t}\n\n\t\t// Prepend the negative symbol.\n\t\tif ( inputIsNegative ) {\n\t\t\toutput += '-';\n\t\t}\n\n\t\t// Add the number\n\t\toutput += input;\n\n\t\t// Trim all non-numeric characters (allow '.' and '-');\n\t\toutput = output.replace(/[^0-9\\.\\-.]/g, '');\n\n\t\t// The value contains no parse-able number.\n\t\tif ( output === '' ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Covert to number.\n\t\toutput = Number(output);\n\n\t\t// Run the user-specified post-decoder.\n\t\tif ( decoder ) {\n\t\t\toutput = decoder(output);\n\t\t}\n\n\t\t// Check is the output is valid, otherwise: return false.\n\t\tif ( !isValidNumber(output) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn output;\n\t}", "function round(control) \n{ \n ans = control.value * 1000 \n ans = Math.round(ans /10) + \"\" \n while (ans.length < 3) {ans = \"0\" + ans} \n len = ans.length \n ans = ans.substring(0,len-2) + \".\" + ans.substring(len-2,len)\n control.value = ans; \n}", "function formatTo ( decimals, thousand, mark, prefix, postfix, encoder, decoder, negativeBefore, negative, edit, undo, input ) {\n\n\t\tvar originalInput = input, inputIsNegative, inputPieces, inputBase, inputDecimals = '', output = '';\n\n\t\t// Apply user encoder to the input.\n\t\t// Expected outcome: number.\n\t\tif ( encoder ) {\n\t\t\tinput = encoder(input);\n\t\t}\n\n\t\t// Stop if no valid number was provided, the number is infinite or NaN.\n\t\tif ( !isValidNumber(input) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Rounding away decimals might cause a value of -0\n\t\t// when using very small ranges. Remove those cases.\n\t\tif ( decimals !== false && parseFloat(input.toFixed(decimals)) === 0 ) {\n\t\t\tinput = 0;\n\t\t}\n\n\t\t// Formatting is done on absolute numbers,\n\t\t// decorated by an optional negative symbol.\n\t\tif ( input < 0 ) {\n\t\t\tinputIsNegative = true;\n\t\t\tinput = Math.abs(input);\n\t\t}\n\n\t\t// Reduce the number of decimals to the specified option.\n\t\tif ( decimals !== false ) {\n\t\t\tinput = toFixed( input, decimals );\n\t\t}\n\n\t\t// Transform the number into a string, so it can be split.\n\t\tinput = input.toString();\n\n\t\t// Break the number on the decimal separator.\n\t\tif ( input.indexOf('.') !== -1 ) {\n\t\t\tinputPieces = input.split('.');\n\n\t\t\tinputBase = inputPieces[0];\n\n\t\t\tif ( mark ) {\n\t\t\t\tinputDecimals = mark + inputPieces[1];\n\t\t\t}\n\n\t\t} else {\n\n\t\t// If it isn't split, the entire number will do.\n\t\t\tinputBase = input;\n\t\t}\n\n\t\t// Group numbers in sets of three.\n\t\tif ( thousand ) {\n\t\t\tinputBase = strReverse(inputBase).match(/.{1,3}/g);\n\t\t\tinputBase = strReverse(inputBase.join( strReverse( thousand ) ));\n\t\t}\n\n\t\t// If the number is negative, prefix with negation symbol.\n\t\tif ( inputIsNegative && negativeBefore ) {\n\t\t\toutput += negativeBefore;\n\t\t}\n\n\t\t// Prefix the number\n\t\tif ( prefix ) {\n\t\t\toutput += prefix;\n\t\t}\n\n\t\t// Normal negative option comes after the prefix. Defaults to '-'.\n\t\tif ( inputIsNegative && negative ) {\n\t\t\toutput += negative;\n\t\t}\n\n\t\t// Append the actual number.\n\t\toutput += inputBase;\n\t\toutput += inputDecimals;\n\n\t\t// Apply the postfix.\n\t\tif ( postfix ) {\n\t\t\toutput += postfix;\n\t\t}\n\n\t\t// Run the output through a user-specified post-formatter.\n\t\tif ( edit ) {\n\t\t\toutput = edit ( output, originalInput );\n\t\t}\n\n\t\t// All done.\n\t\treturn output;\n\t}", "function handleBillValue(){\r\n \r\n if(bill.value.includes(\",\")){ //since we set input type=\"number\" we dont really need a lot of veryfication\r\n replace(\",\", \".\")\r\n }\r\n \r\n if(bill.value < 0){\r\n bill.value = Math.abs(bill.value);\r\n billValue = bill.value;\r\n }else{\r\n billValue = bill.value;\r\n }\r\n console.log(billValue);\r\n handleOutputs();\r\n}", "function formatMoney(number) {\n return \"$\" + number.toFixed(2).replace(/\\d(?=(\\d{3})+\\.)/g, \"$&,\");\n}", "function formatMoney(number) {\n return \"$\" + number.toFixed(2).replace(/\\d(?=(\\d{3})+\\.)/g, \"$&,\");\n}", "function formatMoney(number) {\n return \"$\" + number.toFixed(2).replace(/\\d(?=(\\d{3})+\\.)/g, \"$&,\");\n}", "function formatoMoneda(num) {\n return \"$\" + num.toFixed(0).replace(/(\\d)(?=(\\d{3})+(?!\\d))/g, \"$1.\");\n }", "function formatoMoneda(num) {\n return \"$\" + num.toFixed(0).replace(/(\\d)(?=(\\d{3})+(?!\\d))/g, \"$1.\");\n }", "function convertTotal(money){\n input = money.toString();\n var test = input.split(\"\");\n if (input.match(/\\./) !== null) {\n var part2;\n for (var i = 0; i < test.length; i++) {\n if (test[i] == \".\") {\n part2 = test.slice(i, i+3);\n test = test.slice(0, i);\n break;\n }\n };\n }\n if (test.length > 3) {\n for (var i = test.length - 3; i > 0; i = i - 3) {\n test.splice(i, 0, \",\");\n };\n }\n if (part2) {\n test = test.concat(part2);\n }\n input = test.join(\"\");\n return '$' + input;\n }", "function change(val){\r\n \tval = Ext.util.Format.currency(val,' TL',2,true);\r\n return val;\r\n }", "function formatMoney(number){\n return '$' + number.toFixed(2).replace(/\\d(?=(\\d{3})+\\.)/g, '$&,'); // 12,345.67\n\n}", "function formatTo(decimals, thousand, mark, prefix, suffix, encoder, decoder, negativeBefore, negative, edit, undo, input) {\n\n var originalInput = input, inputIsNegative, inputPieces, inputBase, inputDecimals = '', output = '';\n\n // Apply user encoder to the input.\n // Expected outcome: number.\n if (encoder) {\n input = encoder(input);\n }\n\n // Stop if no valid number was provided, the number is infinite or NaN.\n if (!isValidNumber(input)) {\n return false;\n }\n\n // Rounding away decimals might cause a value of -0\n // when using very small ranges. Remove those cases.\n if (decimals !== false && parseFloat(input.toFixed(decimals)) === 0) {\n input = 0;\n }\n\n // Formatting is done on absolute numbers,\n // decorated by an optional negative symbol.\n if (input < 0) {\n inputIsNegative = true;\n input = Math.abs(input);\n }\n\n // Reduce the number of decimals to the specified option.\n if (decimals !== false) {\n input = toFixed(input, decimals);\n }\n\n // Transform the number into a string, so it can be split.\n input = input.toString();\n\n // Break the number on the decimal separator.\n if (input.indexOf('.') !== -1) {\n inputPieces = input.split('.');\n\n inputBase = inputPieces[0];\n\n if (mark) {\n inputDecimals = mark + inputPieces[1];\n }\n\n } else {\n\n // If it isn't split, the entire number will do.\n inputBase = input;\n }\n\n // Group numbers in sets of three.\n if (thousand) {\n inputBase = strReverse(inputBase).match(/.{1,3}/g);\n inputBase = strReverse(inputBase.join(strReverse(thousand)));\n }\n\n // If the number is negative, prefix with negation symbol.\n if (inputIsNegative && negativeBefore) {\n output += negativeBefore;\n }\n\n // Prefix the number\n if (prefix) {\n output += prefix;\n }\n\n // Normal negative option comes after the prefix. Defaults to '-'.\n if (inputIsNegative && negative) {\n output += negative;\n }\n\n // Append the actual number.\n output += inputBase;\n output += inputDecimals;\n\n // Apply the suffix.\n if (suffix) {\n output += suffix;\n }\n\n // Run the output through a user-specified post-formatter.\n if (edit) {\n output = edit(output, originalInput);\n }\n\n // All done.\n return output;\n }", "function formatFrom(decimals, thousand, mark, prefix, suffix, encoder, decoder, negativeBefore, negative, edit, undo, input) {\n\n var originalInput = input, inputIsNegative, output = '';\n\n // User defined pre-decoder. Result must be a non empty string.\n if (undo) {\n input = undo(input);\n }\n\n // Test the input. Can't be empty.\n if (!input || typeof input !== 'string') {\n return false;\n }\n\n // If the string starts with the negativeBefore value: remove it.\n // Remember is was there, the number is negative.\n if (negativeBefore && strStartsWith(input, negativeBefore)) {\n input = input.replace(negativeBefore, '');\n inputIsNegative = true;\n }\n\n // Repeat the same procedure for the prefix.\n if (prefix && strStartsWith(input, prefix)) {\n input = input.replace(prefix, '');\n }\n\n // And again for negative.\n if (negative && strStartsWith(input, negative)) {\n input = input.replace(negative, '');\n inputIsNegative = true;\n }\n\n // Remove the suffix.\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice\n if (suffix && strEndsWith(input, suffix)) {\n input = input.slice(0, -1 * suffix.length);\n }\n\n // Remove the thousand grouping.\n if (thousand) {\n input = input.split(thousand).join('');\n }\n\n // Set the decimal separator back to period.\n if (mark) {\n input = input.replace(mark, '.');\n }\n\n // Prepend the negative symbol.\n if (inputIsNegative) {\n output += '-';\n }\n\n // Add the number\n output += input;\n\n // Trim all non-numeric characters (allow '.' and '-');\n output = output.replace(/[^0-9\\.\\-.]/g, '');\n\n // The value contains no parse-able number.\n if (output === '') {\n return false;\n }\n\n // Covert to number.\n output = Number(output);\n\n // Run the user-specified post-decoder.\n if (decoder) {\n output = decoder(output);\n }\n\n // Check is the output is valid, otherwise: return false.\n if (!isValidNumber(output)) {\n return false;\n }\n\n return output;\n }", "set Dollar(value) {}", "function euroTodollar() {\n var euro2dollar = 1.10;\n var bedrag = document.querySelector(\"#bedrag\").value;\n\n document.getElementById(\"convert\").value = (bedrag * euro2dollar).toFixed(2);\n\n }", "USD(b) {\n if (!b) { return '0.00' }\n else {\n // BOLT has 8 decimals right now\n b /= Math.pow(10, 8);\n b = b.toFixed(2)\n return String(b)\n }\n }", "function formatMoney(num) {\n return '£ ' + num.toFixed(2).replace(/\\d(?=(\\d{3})+\\.)/g, '$&,');\n}", "function floatToMoneyText(value) {\r\n\tvar text = (value < 1 ? \"0\" : \"\") + Math.floor(value * 100);\r\n\ttext = \"R$ \" + text;\r\n\treturn text.substr(0, text.length - 2) + \",\" + text.substr(-2);\r\n}", "amount (val) {\n if (typeof(val) == 'function') {\n val= val()\n }\n if (typeof(val) == 'undefined' || val == null) {\n return ''\n }\n if (typeof(val) == 'string') {\n val= parseFloat(val)\n }\n if (val < 0.0) {\n return '($' + Math.abs(val).toFixed(2) + ')'\n } else {\n return '$' + val.toFixed(2)\n }\n }", "function set_number_format(amount, decimals) {\n amount += '';\n amount = parseFloat(amount.replace(/[^0-9\\.]/g, ''));\n decimals = decimals || 0;\n if (isNaN(amount) || amount === 0)\n return parseFloat(0).toFixed(decimals);\n amount = '' + amount.toFixed(decimals);\n var amount_parts = amount.split('.'),\n regexp = /(\\d+)(\\d{3})/;\n while (regexp.test(amount_parts[0]))\n amount_parts[0] = amount_parts[0].replace(regexp, '$1' + ' ' + '$2');\n return amount_parts.join('.');\n }", "function formatMoney(value) {\n\treturn value.toFixed(2).replace(/\\d(?=(\\d{3})+\\.)/g, \"$&,\");\n}", "function formatMoney(number) {\n return '₹' + number.toFixed(2).replace(/\\d(?=(\\d{3})+\\.)/g, '$&,');\n}", "function formatAmount(amount){\n return \"$\" + amount.toFixed(2);\n}", "function em(value) {\n \treturn (Math.round((value / emPx) * 1000) / 1000).toString();\n }", "function currencyChecker(x){\n let form_input = document.getElementById('sl__value');\n\n //removes the comma and the dot\n var newX = x.value.replace(',','');\n newX = newX.replace('.', '');\n\n //split the entire number\n var s = newX.split('');\n\n //add the comma at the last third position\n if(s.length >= 3){\n var c = newX.slice(0, s.length-2) + \".\" + newX.slice(s.length-2);\n // console.log(\"insert comma: \"+c);\n x.value = c;\n }\n\n if(form_input)\n form_input.value = c;\n\n return c;\n\n //add the dot at the second position\n // if(s.length >= 6){\n // var d = c.slice(0, s.length-5) + \".\" + c.slice(s.length-5);\n // console.log('insert dot: '+d);\n // x.value = d;\n // }\n}", "handleDecimal(e) {\n if (!this.state.curVal.includes(\".\")) {\n this.setState({\n curVal: this.state.curVal + \".\"\n });\n }\n }", "function stocsd_format(number, tdecimals) {\n\t// tdecimals is optional and sets the number of decimals. It is rarly used (only in some tables)\n\t// Since the numbers automaticly goes to e-format when low enought\n\t\n\t// Used when e.g. the actuall error is reseted to null\n\tif(number == null) {\n\t\treturn \"\";\n\t}\n \n // If we force e-format we just convert here and return\n if(stocsd_eformat) {\n return number.toExponential(2).toUpperCase();\n }\n\t\n\t// Zero is a special case,\n\t// since its not written as E-format by default even as its <1E-7\n if(number == 0) {\n\t\treturn \"0\";\n\t}\n\t\n\t// Check if number is to small to be viewed in field\n\t// If so, force e-format\n\tif(Math.abs(number)<1E-7) {\n return number.toExponential(2).toUpperCase();\n\t}\n\t//Check if the number is to big to be view ed in the field\n\tif(Math.abs(number)>1E+7) {\n return number.toExponential(2).toUpperCase();\n\t}\n\t\n\t\n\t// Else format it as a regular number, and remove ending zeros\n\tvar stringified;\n\tif(tdecimals === undefined) {\n\t\tstringified = number.toFixed(7).toUpperCase();\n\t} else {\n\t\tstringified = number.toFixed(tdecimals).toUpperCase();\n\t}\n\t\n\t\n\n\n\t// Find the length of stringified, where the ending zeros have been removed\n\tvar i = stringified.length;\n\twhile(stringified.charAt(i-1)=='0') {\n\t\ti=i-1;\n\t\t// If we find a dot. Stop removing decimals\n\t\tif(stringified.charAt(i-1)=='.') {\n\t\t\ti=i-1;\n\t\t\tbreak;\n\t\t}\n\t}\n\t// Creates a stripped string without ending zeros\n\tvar stripped = stringified.substring(0,i);\n\treturn stripped;\n}", "function field_decimal(data,editable,config) {\n\tif (typeof data == 'string') data = parseFloat(data);\n\tif (isNaN(data)) data = null;\n\tif (config && typeof config.min == 'string') config.min = parseFloat(config.min);\n\tif (config && typeof config.max == 'string') config.max = parseFloat(config.max);\n\ttyped_field.call(this, data, editable, config);\n}", "moneyFormat(value, decimals = 3) {\n if(!isFinite(value)) return `N/A`;\n\n const absValue = Math.abs(value);\n\n if(absValue >= 1.0e+9){\n return `${(value / 1.0e+9).toFixed(decimals)}B`;\n }\n\n if(absValue >= 1.0e+6){\n return `${(value / 1.0e+6).toFixed(decimals)}M`;\n }\n\n if(absValue >= 1.0e+3){\n return `${(value / 1.0e+3).toFixed(decimals)}K`;\n }\n\n return value.toFixed(decimals);\n }", "function telefone(e){\r\n e.value=e.value.replace(/\\D/g,\"\") //REMOVE TUDO O QUE NÃO É DÍGITO\r\n e.value=e.value.replace(/^(\\d\\d)(\\d)/g,\"($1) $2\") //COLOCA PARÊNTESES EM VOLTA DOS DOIS PRIMEIROS DÍGITOS\r\n e.value=e.value.replace(/(\\d{4})(\\d)/,\"$1-$2\") //COLOCA HÍFEN ENTRE O QUARTO E O QUINTO DÍGITOS\r\n return e\r\n}", "function usd(amount) {\n // return +(parseFloat(amount).toFixed(4));\n return +(parseFloat(amount).toFixed(2)); // Reducing Price Precision\n}", "function format(data) {\n try {\n return \"$ \" + Number.parseFloat(data).toFixed(2);\n } catch (error) {\n console.log(error);\n return null;\n }\n}", "function formatCurrency(num,dec) {\n\tvar parteEntera = '';\n\tvar parteDecimal = '';\n\t\n\tif(dec==undefined){dec=0;}\n\t\n\tvar auxNum = num + '';\n\tvar bDec = false;\n\tfor(m=0;m<auxNum.length;m++){\n\t\tif(auxNum.charAt(m) == \".\"){\n\t\t\tbDec = true;\n\t\t}else{\n\t\t\tif(bDec == true){\n\t\t\t\tparteDecimal += auxNum.charAt(m);\n\t\t\t}else{\n\t\t\t\tparteEntera += auxNum.charAt(m);\n\t\t\t}\t\n\t\t}\n\t}\n\t\n parteEntera = parteEntera.toString().replace(/\\$|\\,/g,'');\n if(isNaN(parteEntera))\n parteEntera = \"0\";\n sign = (parteEntera == (parteEntera = Math.abs(parteEntera)));\n parteEntera = Math.floor(parteEntera*100+0.50000000001);\n parteEntera = Math.floor(parteEntera/100).toString();\n for (var i = 0; i < Math.floor((parteEntera.length-(1+i))/3); i++)\n parteEntera = parteEntera.substring(0,parteEntera.length-(4*i+3))+'.'+\n parteEntera.substring(parteEntera.length-(4*i+3));\n parteEntera = (((sign)?'':'-') + parteEntera);\n\t\n\tvar resultado = parteEntera;\n\tif(dec>0){\n\t\tresultado+= ',' + parteDecimal;\n\t\tfor(m=parteDecimal.length;m<dec;m++){\n\t\t\tresultado+= '0';\n\t\t}\n\t}\n\t\n\treturn resultado;\n}", "formatDecimalToBD(str) {\n if(str == null || str == '' || str == 0){\n return 0;\n }else{\n return str.replace(\".\", \"\").replace(\",\", \".\");\n } \n }", "function formatTo(decimals, thousand, mark, prefix, postfix, encoder,\n decoder, negativeBefore, negative, edit, undo, input) {\n var originalInput = input,\n inputIsNegative, inputPieces, inputBase, inputDecimals = '',\n output = '';\n // Apply user encoder to the input.\n // Expected outcome: number.\n if (encoder) {\n input = encoder(input);\n }\n // Stop if no valid number was provided, the number is infinite or NaN.\n if (!isValidNumber(input)) {\n return false;\n }\n // Rounding away decimals might cause a value of -0\n // when using very small ranges. Remove those cases.\n if (decimals !== false && parseFloat(input.toFixed(decimals)) === 0) {\n input = 0;\n }\n // Formatting is done on absolute numbers,\n // decorated by an optional negative symbol.\n if (input < 0) {\n inputIsNegative = true;\n input = Math.abs(input);\n }\n // Reduce the number of decimals to the specified option.\n if (decimals !== false) {\n input = toFixed(input, decimals);\n }\n // Transform the number into a string, so it can be split.\n input = input.toString();\n // Break the number on the decimal separator.\n if (input.indexOf('.') !== -1) {\n inputPieces = input.split('.');\n inputBase = inputPieces[0];\n if (mark) {\n inputDecimals = mark + inputPieces[1];\n }\n } else {\n // If it isn't split, the entire number will do.\n inputBase = input;\n }\n // Group numbers in sets of three.\n if (thousand) {\n inputBase = strReverse(inputBase).match(/.{1,3}/g);\n inputBase = strReverse(inputBase.join(strReverse(thousand)));\n }\n // If the number is negative, prefix with negation symbol.\n if (inputIsNegative && negativeBefore) {\n output += negativeBefore;\n }\n // Prefix the number\n if (prefix) {\n output += prefix;\n }\n // Normal negative option comes after the prefix. Defaults to '-'.\n if (inputIsNegative && negative) {\n output += negative;\n }\n // Append the actual number.\n output += inputBase;\n output += inputDecimals;\n // Apply the postfix.\n if (postfix) {\n output += postfix;\n }\n // Run the output through a user-specified post-formatter.\n if (edit) {\n output = edit(output, originalInput);\n }\n // All done.\n return output;\n }", "function PWM_Func_DecimalPrice(Price, Format) {\n try {\n\n ///int\n var nPrice = 0, nFrac1 = 0, nFrac2 = 0, nFrac3 = 0;\n //Decimal\n //var dPrice = 0M;\n var dPrice = 0;\n //string[]\n var PriceParts = Price.toString().split('#');\n\n if (PriceParts.length > 0) {\n for (var index = 0; index < PriceParts.length; index++) {\n if (index == 0)\n nPrice = parseInt(PriceParts[index]);\n else if (index == 1) {\n if (Format < 16)\n nFrac1 = parseInt(PriceParts[index].substring(0, PriceParts[index].indexOf(\"/\")));\n else\n nFrac1 = parseInt(PriceParts[index]);\n }\n else if (index == 2)\n nFrac2 = parseInt(PriceParts[index]);\n else if (index == 3)\n nFrac3 = parseInt(PriceParts[index]);\n }\n dPrice = parseFloat(nPrice);\n if (Format == 0) //1/2=eHalfs\n {\n if (nFrac1 == 0)\n return (nPrice + \"^\" + dPrice);\n else\n return (nPrice + \"-\" + nFrac1 + \"/2\" + \"^\" + (dPrice + parseFloat(nFrac1) / 2));\n }\n else if (Format == 1) //1/4=eQuarters\n {\n if (nFrac1 == 0)\n return (nPrice + \"^\" + dPrice);\n else\n return (nPrice + \"-\" + nFrac1 + \"/4\" + \"^\" + (dPrice + parseFloat(nFrac1) / 4));\n }\n else if (Format == 2) //1/8=eEighths\n {\n return (nPrice + \"'\" + nFrac1 + \"^\" + (dPrice + parseFloat(nFrac1) / 8));\n }\n else if (Format == 3) //1/16=eSixteenths\n {\n if (nFrac1 == 0)\n return (nPrice + \"''00\" + \"^\" + dPrice);\n else if (nFrac1 > 0 && nFrac1 < 10)\n return (nPrice + \"''0\" + nFrac1 + \"^\" + (dPrice + parseFloat(nFrac1) / 16));\n else\n return (nPrice + \"''\" + nFrac1 + \"^\" + (dPrice + parseFloat(nFrac1) / 16));\n }\n else if (Format == 4) //1/32=eThirtySeconds\n {\n if (nFrac1 == 0)\n return (nPrice + \"-00\" + \"^\" + dPrice);\n else if (nFrac1 > 0 && nFrac1 < 10)\n return (nPrice + \"-0\" + nFrac1 + \"^\" + (dPrice + parseFloat(nFrac1) / 32));\n else\n return (nPrice + \"-\" + nFrac1 + \"^\" + (dPrice + parseFloat(nFrac1) / 32));\n }\n else if (Format == 5) //1/64=eSixtyFourths\n {\n if (nFrac1 == 0)\n return (nPrice + \"^\" + dPrice);\n else\n return (nPrice + \"-\" + nFrac1 + \"/64\" + \"^\" + (dPrice + parseFloat(nFrac1) / 64));\n }\n else if (Format == 6) //1/128=eOneTwentyEights\n {\n if (nFrac1 == 0)\n return (nPrice + \"^\" + dPrice);\n else\n return (nPrice + \"-\" + nFrac1 + \"/128\" + \"^\" + (dPrice + parseFloat(nFrac1) / 128));\n }\n else if (Format == 7) //1/256=eTwoFiftySixths\n {\n if (nFrac1 == 0)\n return (nPrice + \"^\" + dPrice);\n else\n return (nPrice + \"-\" + nFrac1 + \"/256\" + \"^\" + (dPrice + parseFloat(nFrac1) / 256));\n }\n else if (Format == 8) {\n if (nFrac2 == 4) // if 2nd fraction is 4 then display \"+\" after 1st fraction\n {\n return (nPrice + \"-\" + ((nFrac1 == 0) ? \"00\" : nFrac1.toString()) + \"+\" + \"^\" + (dPrice + parseFloat(nFrac1) / 32 + parseFloat(0.031250 / 8 * nFrac2)));\n }\n else if (nFrac2 == 0) //if 2nd fraction is 0 then no need to display 2nd fraction\n {\n return (nPrice + \"-\" + ((nFrac1 == 0) ? \"00\" : nFrac1.toString()) + \"^\" + (dPrice + parseFloat(nFrac1) / 32));\n }\n else //show 2nd fraction after 1st fraction and dot\n {\n return (nPrice + \"-\" + ((nFrac1 == 0) ? \"00\" : nFrac1.toString()) + \".\" + nFrac2 + \"^\" + (dPrice + parseFloat(nFrac1) / 32 + parseFloat(0.031250 / 8 * nFrac2)));\n }\n }\n else if (Format == 9) //1/4R=eQuartersReduced\n {\n if (nFrac1 == 0)\n return (nPrice + \"^\" + dPrice);\n else if (nFrac1 == 2)\n return (nPrice + \"-\" + PWM_Func_GetReducedFraction(nFrac1, 4) + \"^\" + (dPrice + parseFloat(nFrac1) / 4));\n else\n return (nPrice + \"-\" + nFrac1 + \"/4\" + \"^\" + (dPrice + parseFloat(nFrac1) / 4));\n }\n else if (Format == 10) //1/8R=eEighthsReduced\n {\n if (nFrac1 == 0)\n return (nPrice + \"^\" + dPrice);\n else if (nFrac1 % 2 == 0)\n return (nPrice + \"-\" + PWM_Func_GetReducedFraction(nFrac1, 8) + \"^\" + (dPrice + parseFloat(nFrac1) / 8));\n else\n return (nPrice + \"-\" + nFrac1 + \"/8\" + \"^\" + (dPrice + parseFloat(nFrac1) / 8));\n }\n else if (Format == 11) //1/16R=eSixteenthsReduced\n {\n if (nFrac1 == 0)\n return (nPrice + \"^\" + dPrice);\n else if (nFrac1 % 2 == 0)\n return (nPrice + \"-\" + PWM_Func_GetReducedFraction(nFrac1, 16) + \"^\" + (dPrice + parseFloat(nFrac1) / 16));\n else\n return (nPrice + \"-\" + nFrac1 + \"/16\" + \"^\" + (dPrice + parseFloat(nFrac1) / 16));\n }\n else if (Format == 12) //1/32R=eThirtySecondsReduced\n {\n if (nFrac1 == 0)\n return (nPrice + \"^\" + dPrice);\n else if (nFrac1 % 2 == 0)\n return (nPrice + \"-\" + PWM_Func_GetReducedFraction(nFrac1, 32) + \"^\" + (dPrice + parseFloat(nFrac1) / 32));\n else\n return (nPrice + \"-\" + nFrac1 + \"/32\" + \"^\" + (dPrice + parseFloat(nFrac1) / 32));\n }\n else if (Format == 13) //1/64R=eSixtyFourthsReduced\n {\n if (nFrac1 == 0)\n return (nPrice + \"^\" + dPrice);\n else if (nFrac1 % 2 == 0)\n return (nPrice + \"-\" + PWM_Func_GetReducedFraction(nFrac1, 64) + \"^\" + (dPrice + parseFloat(nFrac1) / 64));\n else\n return (nPrice + \"-\" + nFrac1 + \"/64\" + \"^\" + (dPrice + parseFloat(nFrac1) / 64));\n }\n else if (Format == 14) //1/128R=eOneTwentyEightsReduced\n {\n if (nFrac1 == 0)\n return (nPrice + \"^\" + dPrice);\n else if (nFrac1 % 2 == 0)\n return (nPrice + \"-\" + PWM_Func_GetReducedFraction(nFrac1, 128) + \"^\" + (dPrice + parseFloat(nFrac1) / 128));\n else\n return (nPrice + \"-\" + nFrac1 + \"/128\" + \"^\" + (dPrice + parseFloat(nFrac1) / 128));\n }\n else if (Format == 15) //1/256R=eTwoFiftySixthsReduced\n {\n if (nFrac1 == 0)\n return (nPrice + \"^\" + dPrice);\n else if (nFrac1 % 2 == 0)\n return (nPrice + \"-\" + PWM_Func_GetReducedFraction(nFrac1, 256) + \"^\" + (dPrice + parseFloat(nFrac1) / 256));\n else\n return (nPrice + \"-\" + nFrac1 + \"/256\" + \"^\" + (dPrice + parseFloat(nFrac1) / 256));\n }\n else if (Format == 16) //1=e0DecimalPlaces\n {\n return (nPrice + \"^\" + dPrice);\n }\n else if (Format == 17) //0.1=e1DecimalPlace\n {\n return (nPrice + \".\" + (nFrac1.toString()).substring(0, 1) + \"^\" + dPrice + \".\" + nFrac1);\n }\n else if (Format == 18) //0.01=e2DecimalPlaces\n {\n return (nPrice + \".\" + nFrac1 + (nFrac2.toString()).substring(0, 1) + \"^\" + dPrice + \".\" + nFrac1 + nFrac2);\n }\n else if (Format == 19) //0.001=e3DecimalPlaces\n {\n return (nPrice + \".\" + nFrac1 + nFrac2 + (nFrac3.toString()).substring(0, 1) + \"^\" + dPrice + \".\" + nFrac1 + nFrac2 + nFrac3);\n }\n else if (Format == 20) //0.001=eFurtureRateHalfs\n {\n if (nFrac3 == 0)\n return (nPrice + \".\" + nFrac1 + nFrac2 + \"^\" + dPrice + \".\" + nFrac1 + nFrac2);\n else\n return (nPrice + \".\" + nFrac1 + nFrac2 + \"+\" + \"^\" + dPrice + \".\" + nFrac1 + nFrac2 + \"5\");\n }\n else if (Format == 21) //0.001=eFurtureRateQuarters\n {\n if (nFrac3 == 0)\n return (nPrice + \".\" + nFrac1 + nFrac2 + \"^\" + dPrice + \".\" + nFrac1 + nFrac2);\n else if (nFrac3 == 2)\n return (nPrice + \".\" + nFrac1 + nFrac2 + \"+\" + \"^\" + dPrice + \".\" + nFrac1 + nFrac2 + \"5\");\n else\n return (nPrice + \".\" + nFrac1 + nFrac2 + \".\" + nFrac3 + \"^\" + dPrice + \".\" + nFrac1 + nFrac2 + ((nFrac3 == 1) ? \"25\" : \"75\"));\n }\n }\n }\n catch (err) {\n PWM_Func_HandleJsError(\"PWM_Func_DecimalPrice\", err);\n }\n}", "formatPrice(price) {\r\n price = price.toString();\r\n if (!price.includes('.')) {\r\n return price + '.00';\r\n }\r\n for (var i = 0; i < price.length; i++) {\r\n if (price[i] === '.' && price[i+2] === undefined) {\r\n return price + '0';\r\n }\r\n }\r\n return price;\r\n }" ]
[ "0.6767298", "0.6744517", "0.67332816", "0.65413684", "0.62796265", "0.6259652", "0.6182066", "0.61473644", "0.6076687", "0.6056442", "0.604357", "0.60005164", "0.6000347", "0.59704", "0.59254843", "0.58790016", "0.5857714", "0.5849423", "0.58411807", "0.5815827", "0.57933676", "0.57736075", "0.5754655", "0.5751449", "0.57411283", "0.5726135", "0.57059216", "0.56949204", "0.5694171", "0.56936055", "0.567772", "0.5669764", "0.5667399", "0.5666433", "0.5664789", "0.5663325", "0.5657389", "0.56508875", "0.5648129", "0.5645763", "0.5642667", "0.5639776", "0.5632845", "0.5615351", "0.56091106", "0.559897", "0.55969596", "0.55967164", "0.5594522", "0.55923325", "0.5582007", "0.5579206", "0.5567251", "0.55660325", "0.5563897", "0.55574715", "0.5554181", "0.5553227", "0.5551325", "0.5549069", "0.55417836", "0.55416316", "0.55408615", "0.5539748", "0.55378085", "0.5531903", "0.5524027", "0.5524027", "0.5524027", "0.55229527", "0.55229527", "0.55219424", "0.5517351", "0.55103207", "0.5508461", "0.5508281", "0.5498991", "0.54969376", "0.5496075", "0.549424", "0.5493696", "0.5485674", "0.54803675", "0.54796493", "0.5479647", "0.5475958", "0.54727906", "0.54683584", "0.5460057", "0.5454793", "0.544816", "0.5442839", "0.5441817", "0.54395044", "0.54369867", "0.54353946", "0.5434345", "0.5432237", "0.5428659", "0.5428074" ]
0.8255722
0
mask phone event => object return void
phone(event){ let isObj = typeof event == 'object', isEmpty = event.target.value.length <= 0; if(!isObj || isEmpty){ throw new Error('Bad format object'); } event.target.setAttribute('maxLength', 17); let v = event.target.value.replace(/\D/g, '').match(/(\d{0,2})(\d{0,5})(\d{0,4})/); event.target.value = !v[2] ? v[1] : '( ' + v[1] + ' ) ' + v[2] + (v[3] ? '-' + v[3] : ''); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function MascaraTelefone(tel, event){ \n if(mascaraInteiro(tel, event)==false){\n event.returnValue = false;\n return false;\n } \n return formataCampo(tel, '(00) 0000-0000', event);\n}", "function maskTelefone(){\r\n $(\".telefoneMask\").mask(\"(99) 9999-9999?9\").focusout(function(event){\r\n var target, phone, element; \r\n target = (event.currentTarget) ? event.currentTarget : event.srcElement; \r\n phone = target.value.replace(/\\D/g, '');\r\n element = $(target); \r\n element.unmask(); \r\n if(phone.length > 10) { \r\n element.mask(\"(99) 99999-999?9\"); \r\n } else { \r\n element.mask(\"(99) 9999-9999?9\"); \r\n } \r\n });\r\n}", "function maskPhone(selector, masked = '+7 (___) ___-__-__') {\n const elems = document.querySelectorAll(selector);\n\n function mask(event) {\n const keyCode = event.keyCode;\n const template = masked,\n def = template.replace(/\\D/g, \"\"),\n val = this.value.replace(/\\D/g, \"\");\n console.log(template);\n let i = 0,\n newValue = template.replace(/[_\\d]/g, function (a) {\n return i < val.length ? val.charAt(i++) || def.charAt(i) : a;\n });\n i = newValue.indexOf(\"_\");\n if (i != -1) {\n newValue = newValue.slice(0, i);\n }\n let reg = template.substr(0, this.value.length).replace(/_+/g,\n function (a) {\n return \"\\\\d{1,\" + a.length + \"}\";\n }).replace(/[+()]/g, \"\\\\$&\");\n reg = new RegExp(\"^\" + reg + \"$\");\n if (!reg.test(this.value) || this.value.length < 5 || keyCode > 47 && keyCode < 58) {\n this.value = newValue;\n }\n if (event.type == \"blur\" && this.value.length < 5) {\n this.value = \"\";\n }\n\n }\n\n for (const elem of elems) {\n elem.addEventListener(\"input\", mask);\n elem.addEventListener(\"focus\", mask);\n elem.addEventListener(\"blur\", mask);\n }\n\n}", "function handlePhone(obj, evt, sMask)\n{\n\tevt = (evt) ? evt : ((window.event) ? window.event : \"\");\n\tvar keyCode = evt.keyCode;\n\tvar bIsSpecial = IsSpecial(obj,evt);\n\n\t//window.status = \"keyCode [\" + keyCode + \"] IsSpecial [\" + bIsSpecial + \"]\" ;\n\n\tif(!IsNumeric(obj,evt,false,false)) return false;\n\tif(bIsSpecial) return true;\n\tif(IsValidPhoneCharacter(obj,evt)) return false;\n\n\tvar strPhone = new String(obj.value);\n\tvar iLength = new Number(strPhone.length);\n\n\t// window.status = iLength + \" - \" + sMask.length + (iLength < sMask.length );\n\n\tif(iLength > sMask.length -1)\n\t{\n\t\tevt.cancelBubble = true;\n\t\treturn false;\n\t}\n\t\n\tvar sCharAt = sMask.charAt(iLength);\n\twhile( sCharAt!=\"#\" && (iLength < sMask.length-1 ))\n\t{\n\t\tstrPhone = strPhone + sCharAt;\n\t\tiLength = strPhone.length;\n\t\tsCharAt = sMask.charAt(iLength);\n\t}\n\n\tobj.value = strPhone;\n}", "function ready() {\n $(document).on('click', '.phoneMask', function () {\n $('.phoneMask').mask('X (999) 999-99-99', {\n translation: {\n 'X': {\n pattern: /[7-8]/\n }\n }\n });\n })\n}", "function MascaraTelefoneMovel(tel) {\n if (mascaraInteiro(tel) === false) {\n event.returnValue = false;\n }\n return formataCampo(tel, '(00) 00000-0000', event);\n}", "function maskPhoneInput() {\n\n\t\t// makes the assumption that there can only be 1 'tel' input per page\n\t\tvar elPhoneInput = document.querySelectorAll('input[type=\"tel\"]')[0];\n\n\t\t// check if input[type=\"tel\"] does not exist\n\t\tif (elPhoneInput == null) {\n\t\t\treturn;\n\t\t}\n\n\t\t// our input[type=\"tel\"] DOES exist..\n\t\tvar formatted = new Formatter(elPhoneInput, {\n\t\t\t'pattern': '{{999}}-{{999}}-{{9999}}'\n\t\t});\n\n\t}", "function MascaraTelefone(tel){\t\n\tif(mascaraInteiro(tel)==false){\n\t\tevent.returnValue = false;\n\t}\t\n\treturn formataCampo(tel, '(00) 0000-0000', event);\n}", "function markTouch(event) {\n event && (event.zrByTouch = true);\n} // function markTriggeredFromLocal(event) {", "function markTouch(event) {\n event && (event.zrByTouch = true);\n} // function markTriggeredFromLocal(event) {", "function MascaraTelefone(tel) {\n if (mascaraInteiro(tel) == false) {\n event.returnValue = false;\n }\n return formataCampo(tel, '(00) 00000-0000', event);\n}", "function call(e){\n\tvar mobile = e.data.MobileNumber;\n\t$m.callContact(mobile);\n}", "function initMasks(){\n $(\"[js-cta-phone]\").mask(\"000 000-00-00\", {\n // placeholder: \"+7 (___) ___-____\"\n });\n }", "function MicEvent()\r\n{\r\n try\r\n {\r\n gb_use_mic_dtmf = this.checked() ? true : false;\r\n ActivarMic();\r\n }\r\n catch(err)\r\n { \r\n DebugLog(err.message.toString());\r\n } \r\n}", "function MicEvent()\r\n{\r\n try\r\n {\r\n gb_use_mic_dtmf = this.checked() ? true : false;\r\n ActivarMic();\r\n }\r\n catch(err)\r\n { \r\n DebugLog(err.message.toString());\r\n } \r\n}", "function maskPhone(countryCode, fieldInstance) {\n if(countryCode==='CA' || countryCode==='USD') {\n \t fieldInstance.attr('data-inputmask', '\"mask\": \"(999) 999-9999\"');\n } else {\n \t fieldInstance.attr('data-inputmask', \"'mask': ['999-999-9999 [x99999]', '+099 99 99 9999[9]-9999']\");\n }\n $('[data-mask]').inputmask();\n }", "function mask_cpfcnpj(obj, event)\n{\n if ( obj.value.length > 14 )\n MascaraCNPJ(obj, event);\n else\n MascaraCPF(obj, event);\n}", "off(event) { // TODO\n\n }", "off(event) { // TODO\n\n }", "function addressBarFocused(event){\n clearMask();\n }", "function InputMaskedPhone() {\n var self = this;\n\n var Inputmask = require('inputmask');\n\n var input = document.querySelectorAll('.js-input-phone');\n\n self.init = function() {\n if(input) {\n var phoneMask = new Inputmask({\n 'mask': '+7 (999) 999 99 99',\n 'placeholder': '_'\n });\n\n phoneMask.mask(input);\n }\n };\n\n}", "static mask(element, msg) {\n return this.adapter.mask(element, msg);\n }", "function processAlarms(){\n \n}", "maskableInterrupt() {\n if (this.regs.iff1 !== 0) {\n this.interrupt(true);\n }\n }", "pcBindEvent(){ return false }", "onStoreAfterRequest(event) {\n if (this.activeMask && !event.exception) {\n this.unmaskBody();\n }\n }", "processPhone() {\n let input = this.phone\n resetError(input)\n this.changed = true\n\n if (isEmpty(input)) {\n this.valid = false\n } else if (isNumber(input)) {\n this.valid = false\n } else if (exact(input, 11)) {\n this.valid = false\n } else {\n input.success = true\n this.valid = true\n }\n }", "function intercept() {\n // Check if frida has located the JNI\n if (Java.available) {\n // Switch to the Java context\n Java.perform(function() {\n const myreceiver = Java.use('b3nac.injuredandroid.FlagFiveReceiver');\n var Activity = Java.use(\"android.app.Activity\");\n var Intent = Java.use(\"android.content.Intent\");\n myreceiver.onReceive.overload('android.content.Context', 'android.content.Intent').implementation = function (context, intent) {\n\t\tconsole.log('[+] received a broadcast');\n var myintent = Java.cast(intent, Intent);\n\t\tconsole.log('[+] intent is ' + myintent.toUri(0));\n\t\tvar myaction = myintent.getAction();\n\t\tvar mycomponent = myintent.getComponent();\n\t\tvar myextras = myintent.getExtras();\n\t\tconsole.log('[+] action is ' + myaction.toString());\n\t\tconsole.log('[+] component is ' + mycomponent.toString());\n\t\tif( myextras ) {\n\t\t console.log('[+] extras is ' + myextras.toString());\n\t\t}\n\t\tthis.onReceive( context, intent );\n }\n console.log('[+] FlagFiveReceiver.onReceive hooked')\n\n }\n )}\n\n}", "function box_touchstartHandler(event) {\r\n dragging = false;\r\n }", "phoneButton() {\n console.log(\"dialing 911...\");\n }", "function phoneOnChange() {\n const pattern = \"^((8|\\\\+7)[\\\\- ]?)?(\\\\(?\\\\d{3}\\\\)?[\\\\- ]?)?[\\\\d\\\\- ]{7,10}$\";\n validate(this, pattern);\n}", "function maskEvent(field, field_size, _mask, event) {\r\n\tvar key ='';\r\n\tvar aux='';\r\n\tvar len=0;\r\n\tvar i=0;\r\n\tvar strCheck = '0123456789';\r\n\tvar rcode = (window.Event) ? event.which : event.keyCode;\r\n\r\n\tif((rcode == 13) || (rcode == 8) || (rcode == 9) || (rcode == 0)) {\r\n\t\t//Enter BreakSpace TAB OUTROS\r\n\t\treturn true;\r\n\t}\r\n\r\n if(field.value.length < field_size) {\r\n \t\t//Get key value from key code\r\n\t\tkey=String.fromCharCode(rcode);\r\n\t\r\n\t\tif(strCheck.indexOf(key)==-1) {\r\n\t\t\t//Not a valid key\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\r\n\t\taux=field.value+key;\r\n\t\t//window.alert(aux);\r\n\t\taux=mask(_mask,aux);\r\n\t\t//window.alert(aux);\r\n\t\tfield.value=aux;\t\r\n\t}\r\n\treturn false;\r\n}", "function onEvents(callback){if(!callback||typeof(callback)!=='function'){return;}webphone_api.evcb.push(callback);}", "registerOnTouched(fn) {\n this._onTouch = fn;\n }", "registerOnTouched(fn) {\n this._onTouch = fn;\n }", "registerOnTouched(fn) {\n this._onTouch = fn;\n }", "registerOnTouched(fn) {\n this._onTouch = fn;\n }", "registerOnTouched(fn) {\n this._onTouch = fn;\n }", "registerOnTouched(fn) {\n this._onTouch = fn;\n }", "onEvent() {\n \n }", "tapEventOff(e){this.elevation=1}", "function MaskMarkerVisitor() {\n}", "function mask(o, f) {\n setTimeout(function () {\n var v = mphone(o.value);\n if (v != o.value) {\n o.value = v;\n }\n }, 1);\n}", "function CallPhone(){\n jQuery('#linkPhone').click(function() {\n var _id = jQuery(this).attr('data-value');\n jQuery.ajax({\n url: Routing.generate('viteloge_frontend_agency_call', {id: _id}, true),\n context: jQuery(this),\n method: 'POST',\n beforeSend: function() {\n jQuery(this).off('click');\n },\n success: function() {\n jQuery(this).on('click');\n }\n });\n });\n }", "function resetPhone() {\n if (phone && !phone.busy) {\n phone.state = PhoneState.Idle;\n }\n}", "function stayAlarmChange() {\n alarm.setAlarmEnabled(true);\n}", "function onTouchDown(event) {\n that.onOff();\n }", "function SPF_OnPhone(event) {\n return ($gameSwitches.value(10) && event.pageY < 150.0 && event.pageY < 150.0) || $gameSwitches.value(11);\n}", "function maskInput(args) {\n var inputEle = getMaskInput(args);\n applyMask.call(inputEle);\n var val = strippedValue.call(this, this.element);\n this.prevValue = val;\n this.value = val;\n if (args.mask) {\n unwireEvents.call(inputEle);\n wireEvents.call(inputEle);\n }\n}", "function setOffAlarm(eventName){\n alarmSound.play();\n alert(\"Your event: \"+eventName+\" is happening now!\");\n}", "function OnSMSAlert()\n{\n}", "disable() {\n this.stopTouching_();\n this.events_.removeAll();\n }", "function onTouchEnd(event) {\n\n touch.handled = false;\n\n }", "_onTap(e) {}", "onFocus() {\r\n // Stub\r\n }", "_initMaskPhoneDomestic() {\n if (document.querySelector('#hourDomesticMask') !== null) {\n IMask(document.querySelector('#hourDomesticMask'), {\n mask: '(000) 000-00-00',\n lazy: false,\n });\n }\n }", "function _mapTouch() {\n infoBoxManager.turnOn(infoBoxManager.STATE.IS_TOUCH);\n _mapDOM.canvas.removeEventListener('touchstart', _mapTouch, false);\n}", "cancelEvent() {\n }", "function reset(e){\n \n}", "onStoreAfterRequest(event) {\n if (this.loadMask && !event.exception) {\n this.masked = null;\n this.toggleEmptyText();\n }\n }", "function phoneNumber(no){\n\t\n}", "function maskIt(w,e,m,r,a){\n\n // Cancela se o evento for Backspace\n if (!e) var e = window.event\n if (e.keyCode) code = e.keyCode;\n else if (e.which) code = e.which;\n\n // Variáveis da função\n var txt = (!r) ? w.value.replace(/[^\\d]+/gi,'') : w.value.replace(/[^\\d]+/gi,'').reverse();\n var mask = (!r) ? m : m.reverse();\n var pre = (a ) ? a.pre : \"\";\n var pos = (a ) ? a.pos : \"\";\n var ret = \"\";\n if(code == 9 || code == 8 || txt.length == mask.replace(/[^#]+/g,'').length) return false;\n\n // Loop na máscara para aplicar os caracteres\n for(var x=0,y=0, z=mask.length;x<z && y<txt.length;){\n if(mask.charAt(x)!='#'){\n ret += mask.charAt(x); x++; }\n else {\n ret += txt.charAt(y); y++; x++; } }\n\n // Retorno da função\n ret = (!r) ? ret : ret.reverse()\n w.value = pre+ret+pos;\n}", "cancelByEventTypeMask(eventTypeMask) {\n this.events = this.events.filter(e => !e.matchesEventTypeMask(eventTypeMask));\n }", "onOtpChange(event) {\n //console.log(event);\n this.otp = event;\n }", "woreMaskToggle(e) {\n this.setState({\n woreMask: e.target.checked\n });\n }", "ignoreEvent(event) { return true; }", "set phone(val) {\n this._phone = val || null;\n }", "call(onResult) {\n const message = this.response.message || '';\n this.api.sendMessage(this.user.platformId, message,\n {\n disable_notification: !message.includes('🔔'),\n reply_markup: JSON.stringify({ hide_keyboard: true }),\n }).catch(console.log.bind(console));\n onResult();\n }", "onTouchEnd(event) {\n this.isPanning = false;\n }", "function applyMask() {\n setElementValue.call(this, this.promptMask);\n setMaskValue.call(this, this.value);\n}", "phoneChange2(event) {\n\t\tevent.preventDefault();\n\t\t/* get the string */\n\t\tvar num = event.target.value;\n\t\t/* validate the string */\n\t\tvar flag = (num.length === 4) && (/^\\d+$/.test(num));\n\n\t\tnum = (!flag) ? (this.state.phone) : (this.state.phone.substring(0,2) + num.substring(0, 4) + this.state.phone.substring(6,10));\n\t\tthis.setState({\n\t\t\tphone: num,\n\t\t\tphone2OK: flag,\n\t\t\tfilled: true\n\t\t})\n\t}", "nonMaskableInterrupt() {\n this.interrupt(false);\n }", "function Telephony() {\n\t\n}", "onBlur() {\r\n // Stub\r\n }", "function _event_for_mobile_type(e){\n try{\n var phone_str = self.remove_all_charaters_from_string(e.row.text_value);\n if(isNaN(phone_str) || (phone_str == '')){\n self.show_message(L('message_invalid_phone_number'));\n return;\n }\n var recipients = [];\n var option_dialog = Ti.UI.createOptionDialog({\n options:(self.is_ipad())?['SMS','Call','Cancel','']:['SMS','Call','Cancel'],\n buttonNames:['Cancel'],\n destructive:0,\n cancel:2,\n title:L('message_select_option')\n });\n option_dialog.show();\n option_dialog.addEventListener('click',function(evt){\n var temp_type_text = '';\n if(evt.index === 0){//sms\n temp_type_text = 'sms';\n }\n if(evt.index === 1){//sms\n temp_type_text = 'call';\n }\n if(temp_type_text != ''){\n var tmp_var = {\n display_content:e.row.text_value,\n content:phone_str,\n name:_client_name,\n source:'client',\n source_id:_client_id\n };\n recipients.push(tmp_var);\n self.action_events(_type,temp_type_text,_selected_job_id,_selected_job_reference_number,JSON.stringify(recipients));\n }\n });\n }catch(err){\n self.process_simple_error_message(err,window_source+' - _event_for_mobile_type');\n return;\n } \n }", "function De(e){e.prototype.on=function(e,t){ni(this,e,t)},e.prototype.off=function(e,t){ke(this,e,t)}}", "function handleTouch(zone, event) {\n if(isTransmitting) { return; }\n\n let emoji = EMOJIS[emojiIndex];\n transmitEmoji(emoji[IMAGE_INDEX], emoji[CODE_POINT_INDEX],\n EMOJI_TRANSMISSION_MILLISECONDS);\n Bangle.buzz(TRANSMIT_BUZZ_MILLISECONDS);\n}", "function handleTouch(zone, event) {\n if(isTransmitting) { return; }\n\n let emoji = EMOJIS[emojiIndex];\n transmitEmoji(emoji[IMAGE_INDEX], emoji[CODE_POINT_INDEX],\n EMOJI_TRANSMISSION_MILLISECONDS);\n Bangle.buzz(TRANSMIT_BUZZ_MILLISECONDS);\n}", "function OnClipBoardAlert()\n{\n}", "doCaptchaAlarm() { this.playSound('captchaAlarm'); }", "handlePhonePress(phone) {\n if (Platform.OS !== 'android') {\n var BUTTONS = [\n 'Text message',\n 'Call',\n 'Cancel',\n ];\n var CANCEL_INDEX = 2;\n\n ActionSheetIOS.showActionSheetWithOptions({\n options: BUTTONS,\n cancelButtonIndex: CANCEL_INDEX\n },\n (buttonIndex) => {\n switch (buttonIndex) {\n case 0:\n Communications.phonecall(phone, true);\n break;\n case 1:\n Communications.text(phone);\n break;\n }\n });\n }\n }", "function GamePADEvent()\r\n{\r\n try\r\n {\r\n gb_use_gamepad_dtmf = this.checked() ? true : false;\r\n }\r\n catch(err)\r\n { \r\n DebugLog(err.message.toString());\r\n } \t\r\n}", "function GamePADEvent()\r\n{\r\n try\r\n {\r\n gb_use_gamepad_dtmf = this.checked() ? true : false;\r\n }\r\n catch(err)\r\n { \r\n DebugLog(err.message.toString());\r\n } \t\r\n}", "handleEvent() {}", "handleEvent() {}", "externalTouchDown() {\n this._strikeTouchDown();\n }", "function OnContactAlert()\n{\n}", "function signal(event) {\n return event;\n }", "pressResend() {\n alert(this.state.otpCode + \" Resending the code..\");\n }", "handlePhone(evt) {\n evt.preventDefault()\n this.setState({\n phone: evt.target.value\n })\n }", "drawMask () {\n this.mask.graphics.clear()\n .beginFill(\"#fff\")\n .drawRect(this.x, this.y, this.width, this.height)\n .endFill();\n }", "function onLensTurnOnEvent() {\n // Make sure to reset var in lens Turn On Event\n tapAnimLayerPlaying = false;\n}", "function helperValidatePhone() {\r\n //sends the error state to change the background\r\n sendState(on, \"phone\");\r\n //adds the error to the array\r\n addDataAllErrors(allErrorMess[3]);\r\n }", "function noteOff(noteNumber) { }", "function signal(event) {\n return event;\n}", "mask() {\n this.expInfo[\"operation\"] = this.operation.value\n this.expInfo[\"value\"] = this.valueSelector.value\n this.paneOb.altFiltersState[this.id].op = this.operation.value\n this.paneOb.altFiltersState[this.id].val = this.valueSelector.value\n /** The list of 1's and 0's corresponding to whether the element at a particular index in the alternate column passes the logical comparison to the filter's specific operation and value choices */\n this.boolMask = this.paneOb.csvData[this.altColSelect.value].map(e => {\n if (this.operation.value == \"==\") {\n if (e == this.valueSelector.value) {\n return 1\n }\n return 0\n }\n if (this.operation.value == \"!=\") {\n if (e != this.valueSelector.value) {\n return 1\n }\n return 0\n }\n if (this.operation.value == \">\") {\n if (e > parseFloat(this.valueSelector.value)) {\n return 1\n }\n return 0\n }\n if (this.operation.value == \"<\") {\n if (e < parseFloat(this.valueSelector.value)) {\n return 1\n }\n return 0\n }\n })\n // emit event on the holder that the altchanged\n let altchange = new Event(\"altchange\")\n this.outerHolder.dispatchEvent(altchange)\n\n }", "function Buzz()\n{\n //Send debug to WiFi IDE.\n console.log( \"Buzz\" );\n \n //Vibrate phone.\n app.Vibrate( \"0,100,30,100,50,300\" );\n \n //Set alarm for 3 seconds time.\n var now = new Date().getTime(); \n app.SetAlarm( \"Set\", 1234, OnAlarm, now + 3000 );\n}", "handleqtty(qtty ,event){\n console.log ('event del qtty ' + qtty)\n /*var qtty = 1\n if (event.target.id == '-'){\n qtty = 0\n }*/\n this.props.changeQtty(this.props.indice ,qtty)\n }", "function resetOpener() {\n pin.write(0)\n}", "handleClearClick(){\n\n monit.monitOut(\"SEARCH\",\"onClear\",2);\n // OUT\n this.onClear();\n\n }" ]
[ "0.6531493", "0.634636", "0.5933209", "0.59231174", "0.59092224", "0.5791241", "0.57479745", "0.5736936", "0.5721405", "0.5721405", "0.57115054", "0.5506195", "0.5476668", "0.54755825", "0.54755825", "0.54608375", "0.54166406", "0.53920096", "0.53920096", "0.5381847", "0.5379517", "0.5304161", "0.5289355", "0.5272056", "0.525324", "0.52478534", "0.52402604", "0.52303743", "0.5204279", "0.5191091", "0.5182879", "0.51599133", "0.5138373", "0.50692", "0.50692", "0.50692", "0.50692", "0.50692", "0.50692", "0.5057199", "0.5054312", "0.5027984", "0.5001372", "0.49992865", "0.4982488", "0.4981639", "0.49621236", "0.49525774", "0.4952218", "0.4950913", "0.4939384", "0.49299216", "0.49018797", "0.4883029", "0.48798472", "0.48725426", "0.4867966", "0.4865542", "0.4864057", "0.48550183", "0.4853181", "0.485218", "0.48442036", "0.48395067", "0.48376673", "0.482923", "0.48289707", "0.4828007", "0.48179662", "0.48149866", "0.48106954", "0.48087227", "0.48052093", "0.4803782", "0.47932744", "0.47876006", "0.47844183", "0.47844183", "0.4769749", "0.47671214", "0.4764315", "0.47589567", "0.47589567", "0.47554857", "0.47554857", "0.47537464", "0.47522634", "0.47391275", "0.4729384", "0.47048432", "0.47045544", "0.4703727", "0.47009262", "0.4697422", "0.46970505", "0.4683141", "0.46713087", "0.4667866", "0.46663192", "0.46625638" ]
0.5108995
33
mask postal event => object return void
postal(event){ let isObj = typeof event == 'object', isEmpty = event.target.value.length <= 0; if(!isObj || isEmpty){ throw new Error('Bad format object'); } event.target.setAttribute('maxLength', 9); let v = event.target.value; event.target.value = v .replace(/\D/g, '') .replace(/(\d{5})(\d)/, "$1-$2") .replace(/(-\d{3})\d+?$/, "$1"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function MaskMarkerVisitor() {\n}", "onStoreAfterRequest(event) {\n if (this.activeMask && !event.exception) {\n this.unmaskBody();\n }\n }", "function mask_cpfcnpj(obj, event)\n{\n if ( obj.value.length > 14 )\n MascaraCNPJ(obj, event);\n else\n MascaraCPF(obj, event);\n}", "function setEventMarker(postal) {\n httpGet('https://maps.googleapis.com/maps/api/geocode/json?address=' + postal + '&sensor=true', function(data) {\n // console.log(data); // Debugging Purpose\n if (data.status = 'OK') {\n if (eventMarker) {\n eventMarker.remove();\n }\n\n var lng = data.results[0].geometry.location.lng,\n lat = data.results[0].geometry.location.lat;\n\n eventMarker = new mapboxgl.Marker({\n color: '#DC3545'\n })\n .setLngLat([lng, lat])\n .addTo(map);\n\n var btnFocus = doc.querySelector('button#zoomEvent');\n btnFocus.setAttribute('data-lng', lng);\n btnFocus.setAttribute('data-lat', lat);\n\n btnFocus.onclick = function() {\n map.flyTo({ center: [this.getAttribute('data-lng'), this.getAttribute('data-lat')] });\n }\n }\n });\n}", "function ready() {\n $(document).on('click', '.phoneMask', function () {\n $('.phoneMask').mask('X (999) 999-99-99', {\n translation: {\n 'X': {\n pattern: /[7-8]/\n }\n }\n });\n })\n}", "function maskTelefone(){\r\n $(\".telefoneMask\").mask(\"(99) 9999-9999?9\").focusout(function(event){\r\n var target, phone, element; \r\n target = (event.currentTarget) ? event.currentTarget : event.srcElement; \r\n phone = target.value.replace(/\\D/g, '');\r\n element = $(target); \r\n element.unmask(); \r\n if(phone.length > 10) { \r\n element.mask(\"(99) 99999-999?9\"); \r\n } else { \r\n element.mask(\"(99) 9999-9999?9\"); \r\n } \r\n });\r\n}", "function addressBarFocused(event){\n clearMask();\n }", "function markTouch(event) {\n event && (event.zrByTouch = true);\n} // function markTriggeredFromLocal(event) {", "function markTouch(event) {\n event && (event.zrByTouch = true);\n} // function markTriggeredFromLocal(event) {", "function maskPhone(selector, masked = '+7 (___) ___-__-__') {\n const elems = document.querySelectorAll(selector);\n\n function mask(event) {\n const keyCode = event.keyCode;\n const template = masked,\n def = template.replace(/\\D/g, \"\"),\n val = this.value.replace(/\\D/g, \"\");\n console.log(template);\n let i = 0,\n newValue = template.replace(/[_\\d]/g, function (a) {\n return i < val.length ? val.charAt(i++) || def.charAt(i) : a;\n });\n i = newValue.indexOf(\"_\");\n if (i != -1) {\n newValue = newValue.slice(0, i);\n }\n let reg = template.substr(0, this.value.length).replace(/_+/g,\n function (a) {\n return \"\\\\d{1,\" + a.length + \"}\";\n }).replace(/[+()]/g, \"\\\\$&\");\n reg = new RegExp(\"^\" + reg + \"$\");\n if (!reg.test(this.value) || this.value.length < 5 || keyCode > 47 && keyCode < 58) {\n this.value = newValue;\n }\n if (event.type == \"blur\" && this.value.length < 5) {\n this.value = \"\";\n }\n\n }\n\n for (const elem of elems) {\n elem.addEventListener(\"input\", mask);\n elem.addEventListener(\"focus\", mask);\n elem.addEventListener(\"blur\", mask);\n }\n\n}", "function MascaraTelefone(tel, event){ \n if(mascaraInteiro(tel, event)==false){\n event.returnValue = false;\n return false;\n } \n return formataCampo(tel, '(00) 0000-0000', event);\n}", "function zipBlurFunction() {\n getPlace();\n}", "_onEditAddress() {\n AddressActions.editAddress();\n }", "handleAddressChange(e) {\n \n this.setState({\n address: e,\n valid_addr: true\n })\n }", "function tpostal()\r\n {\r\n var pin_code_js = document.getElementById('to_post');\r\n var pin_code_js_value = pin_code_js.value.trim();\r\n if (pin_code_js_value == null || pin_code_js_value == \"\") {\r\n \tdocument.getElementById(\"tpostal\").innerHTML=\"Postal code must be filled out !\";\r\n $(function(){\r\n $(\"#to_post\").focus() });\r\n \r\n } else if (is_valid = !/^[a-zA-Z0-9 ]+$/.test(pin_code_js_value)) {\r\n \tdocument.getElementById(\"tpostal\").innerHTML=\"Postal code Only charecters and numerics\";\r\n $(function(){\r\n $(\"#to_post\").focus() });\r\n \r\n } else if (pin_code_js_value.length != 6) {\r\n \t document.getElementById(\"tpostal\").innerHTML=\"Postal code must have 6 digits only !\";\r\n $(function(){\r\n $(\"#to_post\").focus() });\r\n \r\n }\r\n else\r\n {\r\n \tcount++;\r\n }\r\n }", "onStoreAfterRequest(event) {\n if (this.loadMask && !event.exception) {\n this.masked = null;\n this.toggleEmptyText();\n }\n }", "handleShippingAddressState(e){\n const { rfq } = this.props\n const stateValue = ( null !== e )? e.value : ''\n rfq.shipping_address.state = stateValue\n this.props.updateRFQ( rfq )\n }", "function initMasks(){\n $(\"[js-cta-phone]\").mask(\"000 000-00-00\", {\n // placeholder: \"+7 (___) ___-____\"\n });\n }", "function maskEvent(field, field_size, _mask, event) {\r\n\tvar key ='';\r\n\tvar aux='';\r\n\tvar len=0;\r\n\tvar i=0;\r\n\tvar strCheck = '0123456789';\r\n\tvar rcode = (window.Event) ? event.which : event.keyCode;\r\n\r\n\tif((rcode == 13) || (rcode == 8) || (rcode == 9) || (rcode == 0)) {\r\n\t\t//Enter BreakSpace TAB OUTROS\r\n\t\treturn true;\r\n\t}\r\n\r\n if(field.value.length < field_size) {\r\n \t\t//Get key value from key code\r\n\t\tkey=String.fromCharCode(rcode);\r\n\t\r\n\t\tif(strCheck.indexOf(key)==-1) {\r\n\t\t\t//Not a valid key\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\r\n\t\taux=field.value+key;\r\n\t\t//window.alert(aux);\r\n\t\taux=mask(_mask,aux);\r\n\t\t//window.alert(aux);\r\n\t\tfield.value=aux;\t\r\n\t}\r\n\treturn false;\r\n}", "function applyMask(maskText){\n addressBarElement.style = maskText;\n }", "function maskInput(input, textbox, location, eventoftxtbox, checkforZipCode, Phonenumber) {\n var currentindex = getCaret(textbox);\n var reg0Str = '^\\d{3}-?\\d{2}-?\\d{4}$';\n\n if (checkforZipCode == undefined) {\n checkforZipCode = false;\n }\n if (Phonenumber == undefined) {\n Phonenumber = false;\n }\n\n if (checkforZipCode) {\n reg0Str = '^\\d{5}-?\\d{4}$';\n }\n\n if (Phonenumber) {\n reg0Str = '^\\d{3}-?\\d{3}-?\\d{4}$';\n }\n\n var reg0 = new RegExp(reg0Str);\n if (reg0.test(input)) return true;\n\n\n if (eventoftxtbox.keyCode != 37 && eventoftxtbox.keyCode != 38 && eventoftxtbox.keyCode != 39 && eventoftxtbox.keyCode != 40 && eventoftxtbox.keyCode != 17) {\n var delimiter = '-';\n if (input != '') {\n input = input.replace(/\\-/g, '');\n }\n if (Phonenumber) {\n input = input.substring(0, 10);\n }\n else {\n if (input.length > 9) {\n input = input.substring(0, 9);\n }\n }\n //Get the delimiter positons\n var locs = location.split(',');\n\n if (checkforZipCode) {\n //Iterate until all the delimiters are placed in the textbox\n for (var delimCount = 0; delimCount <= locs.length; delimCount++) {\n for (var inputCharCount = 0; inputCharCount <= 5; inputCharCount++) {\n\n //Check for the actual position of the delimiter\n if (inputCharCount == locs[delimCount] && input.length > 5) {\n\n //Confirm that the delimiter is not already present in that position\n if (input.substring(inputCharCount, inputCharCount + 1) != delimiter) {\n input = input.substring(0, inputCharCount) + delimiter + input.substring(inputCharCount, input.length);\n if (input.substring(inputCharCount, inputCharCount + 1) != delimiter) {\n input = input.substring(0, inputCharCount) + delimiter + input.substring(inputCharCount, input.length);\n }\n }\n }\n }\n }\n }\n else {\n //Iterate until all the delimiters are placed in the textbox\n for (var delimCount = 0; delimCount <= locs.length; delimCount++) {\n for (var inputCharCount = 0; inputCharCount <= input.length; inputCharCount++) {\n\n //Check for the actual position of the delimiter\n if (inputCharCount == locs[delimCount] && input.length > locs[delimCount]) {\n\n //Confirm that the delimiter is not already present in that position\n if (input.substring(inputCharCount, inputCharCount + 1) != delimiter) {\n input = input.substring(0, inputCharCount) + delimiter + input.substring(inputCharCount, input.length);\n if (input.substring(inputCharCount, inputCharCount + 1) != delimiter) {\n input = input.substring(0, inputCharCount) + delimiter + input.substring(inputCharCount, input.length);\n }\n }\n }\n }\n }\n }\n\n textbox.value = input;\n if (currentindex != 'undefined') {\n\n if (eventoftxtbox.keyCode == 46) {\n textbox.selectionStart = currentindex;\n textbox.selectionEnd = currentindex;\n }\n else {\n textbox.selectionStart = currentindex + 1;\n textbox.selectionEnd = currentindex + 1;\n }\n }\n }\n}", "function maskPhone(countryCode, fieldInstance) {\n if(countryCode==='CA' || countryCode==='USD') {\n \t fieldInstance.attr('data-inputmask', '\"mask\": \"(999) 999-9999\"');\n } else {\n \t fieldInstance.attr('data-inputmask', \"'mask': ['999-999-9999 [x99999]', '+099 99 99 9999[9]-9999']\");\n }\n $('[data-mask]').inputmask();\n }", "mask() {\n this.expInfo[\"operation\"] = this.operation.value\n this.expInfo[\"value\"] = this.valueSelector.value\n this.paneOb.altFiltersState[this.id].op = this.operation.value\n this.paneOb.altFiltersState[this.id].val = this.valueSelector.value\n /** The list of 1's and 0's corresponding to whether the element at a particular index in the alternate column passes the logical comparison to the filter's specific operation and value choices */\n this.boolMask = this.paneOb.csvData[this.altColSelect.value].map(e => {\n if (this.operation.value == \"==\") {\n if (e == this.valueSelector.value) {\n return 1\n }\n return 0\n }\n if (this.operation.value == \"!=\") {\n if (e != this.valueSelector.value) {\n return 1\n }\n return 0\n }\n if (this.operation.value == \">\") {\n if (e > parseFloat(this.valueSelector.value)) {\n return 1\n }\n return 0\n }\n if (this.operation.value == \"<\") {\n if (e < parseFloat(this.valueSelector.value)) {\n return 1\n }\n return 0\n }\n })\n // emit event on the holder that the altchanged\n let altchange = new Event(\"altchange\")\n this.outerHolder.dispatchEvent(altchange)\n\n }", "function Munge(PreOrPost)\n{\n /* Set the value for .AddressStatusCurrent to .AddressStatus, or \"Blank\" if .AddressStatus has no value, strip special char, */\n var selectedUnitPage = findPage('pyWorkPage.BCU.SelectedUnitPage');\n var addressStatus = ALMCB_Helpers.getFieldValue(selectedUnitPage, \"AddressStatus\");\n var addressStatusCurrent = ALMCB_Helpers.getFieldValue(selectedUnitPage, \"AddressStatusCurrent\");\n var addressStatusLast = ALMCB_Helpers.getFieldValue(selectedUnitPage, \"AddressStatusLast\");\n\n /**/\n console.log(\"addressStatus : \" + addressStatus);\n if (addressStatus == \"\")\n {\n addressStatusCurrent =\"\";\n } else {\n /* check for (GQ) and (TL) and remove */ \n if (addressStatus.indexOf(\"(\") >= 0)\n addressStatus = addressStatus.substr(0, addressStatus.length - 4).trim();\n\n /* strip out any special chars*/\n addressStatus = addressStatus.replace(/[`~!@#$%^&*()_|+\\-=?;:'\",.<>\\{\\}\\[\\]\\\\\\/]/gi, '');\n\n switch (PreOrPost) {\n case \"Pre\": \n if (addressStatus == \"Blank\")\n {\n addressStatusCurrent=addressStatus;\n addressStatusLast=addressStatus;\n }\n break;\n case \"Post\": \n addressStatusCurrent=addressStatus;\n if (addressStatusLast == \"\")\n addressStatusLast=addressStatus;\n if (addressStatusLast != addressStatusCurrent)\n addressStatusLast=addressStatusCurrent;\n break;\n }\n }\n selectedUnitPage.put('AddressStatusCurrent', addressStatusCurrent);\n selectedUnitPage.put('AddressStatusLast', addressStatusLast);\n SaveSelectedUnitPage();\n\n console.log(\"addressStatus : \" + addressStatus);\n}", "hook(evt) {\n if (clipboard.intercept) {\n evt.preventDefault(); // prevents copying highlighted section into clipboard\n evt.clipboardData.setData(\"text/html\", clipboard.data);\n\n // reset when done\n clipboard.intercept = false;\n clipboard.data = \"\";\n }\n }", "function setDaumPostCode() {\n const layer = document.querySelector(\".address-layer\");\n document.querySelector(\"#btnSearch\").addEventListener(\"click\", function () {\n daum.getAddress(layer);\n });\n}", "onAddressChange(text) {\n this.props.addressChange(text);\n }", "EventStreetView () {}", "function mapClickStreetAddress() {\n\tlet geocode;\n\tmap.addEventListener('click', function (event) {\n\t\tgeocode = [event.latlng.lat, event.latlng.lng].toString()\n\t\tlet prox = `${event.latlng.lat.toString()},`\n\t\tprox += `${event.latlng.lng.toString()}, 100`\n\n\t\tlet reverseGeocodingParameters = {\n\t\t\tprox: prox, // (example)prox: '52.5309,13.3847,150',\n\t\t\tmode: 'retrieveAddresses',\n\t\t\tmaxresults: 1\n\t\t};\n\n\t\tgeocoder.reverseGeocode(reverseGeocodingParameters, onSuccess, function (error) {\n\t\t\tconsole.log('mapClickStreetAddress: error: ', error);\n\t\t});\n\t})\n\tfunction onSuccess(result) {\n\t\tlet address = result.Response.View[0].Result[0].Location.Address\n\t\tconsole.log('the address_string: ', address.Label);\n\n\t\t// let obj = {\n\t\tlet audioFile = {\n\t\t\taddress_string: address.Label,\n\t\t\tstreet_number: address.HouseNumber,\n\t\t\tstreet_name: address.Street,\n\t\t\tcity: address.City,\n\t\t\tstate: address.State,\n\t\t\tpostal_code: address.PostalCode,\n\t\t\tgeocode: geocode\n\t\t}\n\n\t\t// a valid LatLng does NOT mean we have a valid street address ...\n\t\tif (!audioFile.street_number || !audioFile.street_name) {\n\t\t\tresetAddressForm()\n\n\t\t\t$('#geocode').html('<p>Please click again, there is no valid address within 100 meters of where you clicked.</p>').css('background-color', 'pink')\n\t\t\treturn;\n\t\t} else {\n\n\t\t\t// if we have a valid street address, the data is replaced on the DOM, in the address form, for User to edit/accept.\n\t\t\tloadDataToAddressForm(audioFile)\n $('#geocode-label').show()\n\t\t\t$('#voter-preference-form-div').css(\"background-color\", \"rgb(183, 240, 160)\");\n\t\t\t$('#submit-vote-preference-button').css(\"background-color\", \"rgb(183, 240, 160)\");\n\t\t\t$('#geocode').html(`<p>${audioFile.geocode}</p>`)\n\t\t}\n\t}\n}", "_textBoxKeyUpHandler() {\n const that = this;\n\n that.value = that._getValueWithTextMaskFormat({ start: 0, end: that._mask.length }, that.textMaskFormat);\n }", "function maskPhoneInput() {\n\n\t\t// makes the assumption that there can only be 1 'tel' input per page\n\t\tvar elPhoneInput = document.querySelectorAll('input[type=\"tel\"]')[0];\n\n\t\t// check if input[type=\"tel\"] does not exist\n\t\tif (elPhoneInput == null) {\n\t\t\treturn;\n\t\t}\n\n\t\t// our input[type=\"tel\"] DOES exist..\n\t\tvar formatted = new Formatter(elPhoneInput, {\n\t\t\t'pattern': '{{999}}-{{999}}-{{9999}}'\n\t\t});\n\n\t}", "function box_touchstartHandler(event) {\r\n dragging = false;\r\n }", "function IMapXtremeEventHandler()\n{\n}", "onEvent() {\n \n }", "function maskIt(w,e,m,r,a){\n\n // Cancela se o evento for Backspace\n if (!e) var e = window.event\n if (e.keyCode) code = e.keyCode;\n else if (e.which) code = e.which;\n\n // Variáveis da função\n var txt = (!r) ? w.value.replace(/[^\\d]+/gi,'') : w.value.replace(/[^\\d]+/gi,'').reverse();\n var mask = (!r) ? m : m.reverse();\n var pre = (a ) ? a.pre : \"\";\n var pos = (a ) ? a.pos : \"\";\n var ret = \"\";\n if(code == 9 || code == 8 || txt.length == mask.replace(/[^#]+/g,'').length) return false;\n\n // Loop na máscara para aplicar os caracteres\n for(var x=0,y=0, z=mask.length;x<z && y<txt.length;){\n if(mask.charAt(x)!='#'){\n ret += mask.charAt(x); x++; }\n else {\n ret += txt.charAt(y); y++; x++; } }\n\n // Retorno da função\n ret = (!r) ? ret : ret.reverse()\n w.value = pre+ret+pos;\n}", "function mCep(){\n$(document).ready(function () { \n var $seuCampoCpf = $(\"#cep\");\n $seuCampoCpf.mask('00000-000', {reverse: true});\n});\n}", "_onClickUseAddress(event) {\n DebugUtil.log(\"Use address button click\", event, this.props.address);\n event.preventDefault();\n this.props.useAddressClickHandler(this.props.address);\n }", "onclickinvite(event) {\n if (this._coords) {\n if (!IS_GUEST) {\n const url = ''.concat(\n location.protocol,\n '//', location.host,\n '/?', HASH\n );\n copyToClipboard(url);\n }\n dispatchEvent(new CustomEvent('client-bounds'));\n }\n }", "function mainEventhandler(gm, data, envelope) {\n if (data.eventType == Brew.BrewEventType.Error) {\n console.log(data.errorMsg);\n return;\n }\n // if (!(data.eventType in event_function_map)) {\n // console.error(\"received unknown event type\", data)\n // return\n // }\n // event_function_map[data.eventType](gm, data)\n if (data.eventType == Brew.BrewEventType.Info) {\n displayInfo(gm, data);\n }\n else if (data.eventType == Brew.BrewEventType.Move) {\n move(gm, data);\n }\n else if (data.eventType == Brew.BrewEventType.Wait) {\n rest(gm, data);\n }\n else if (data.eventType == Brew.BrewEventType.Pickup) {\n pickup(gm, data);\n }\n else if (data.eventType == Brew.BrewEventType.Drop) {\n dropItemAttempt(gm, data);\n }\n else if (data.eventType == Brew.BrewEventType.Special) {\n special(gm, data);\n }\n else if (data.eventType == Brew.BrewEventType.Attack) {\n attack(gm, data);\n }\n else if (data.eventType == Brew.BrewEventType.TargetingOn) {\n targetingOn(gm, data);\n }\n else if (data.eventType == Brew.BrewEventType.TargetingCancel) {\n targetingCancel(gm, data);\n }\n else if (data.eventType == Brew.BrewEventType.TargetingFinish) {\n targetingFinish(gm, data);\n }\n else if (data.eventType == Brew.BrewEventType.TargetingMove) {\n targetingMove(gm, data);\n }\n else if (data.eventType == Brew.BrewEventType.InventoryOn) {\n showInventoryList(gm, data);\n }\n else if (data.eventType == Brew.BrewEventType.InventoryOff) {\n stopShowingInventoryList(gm, data);\n }\n else if (data.eventType == Brew.BrewEventType.InventoryMove) {\n updateInventoryList(gm, data);\n }\n else if (data.eventType == Brew.BrewEventType.InventorySelect) {\n selectInventoryItem(gm, data);\n }\n else if (data.eventType == Brew.BrewEventType.ContextMenuOn) {\n showContextMenu(gm, data);\n }\n else if (data.eventType == Brew.BrewEventType.ContextMenuOff) {\n stopShowingContextMenu(gm, data);\n }\n else if (data.eventType == Brew.BrewEventType.ContextMenuMove) {\n updateContextMenu(gm, data);\n }\n else if (data.eventType == Brew.BrewEventType.ContextMenuSelect) {\n selectContextFromMenu(gm, data);\n }\n else {\n console.error(\"received unknown event type\", data);\n }\n }", "zoomToFeature(event) {\n this.$emit('set-area', event.target.feature.properties.code);\n }", "addressChange(e){\n var change = Object.assign({}, this.state);\n change.modValues[0].address = e.target.value;\n this.setState(change);\n }", "function handleSearchAddressInput(e) {\n\t\t\tclearTimeout(typingTimerSearchAddress);\n\t\t\tif (e.keyIdentifier != 'Shift' && e.currentTarget.value.length != 0) {\n\t\t\t\ttypingTimerSearchAddress = setTimeout(function() {\n\t\t\t\t\t//empty search results\n\t\t\t\t\tvar resultContainer = document.getElementById('fnct_searchAddressResults');\n\t\t\t\t\twhile (resultContainer.hasChildNodes()) {\n\t\t\t\t\t\tresultContainer.removeChild(resultContainer.lastChild);\n\t\t\t\t\t}\n\t\t\t\t\tvar numResults = $('#zoomToAddressResults').get(0);\n\t\t\t\t\twhile (numResults.hasChildNodes()) {\n\t\t\t\t\t\tnumResults.removeChild(numResults.lastChild);\n\t\t\t\t\t}\n\n\t\t\t\t\tvar lastSearchResults = $('#searchAddress').attr('data-search');\n\t\t\t\t\ttheInterface.emit('ui:searchAddressRequest', {\n\t\t\t\t\t\taddress : e.currentTarget.value,\n\t\t\t\t\t\tlastSearchResults : lastSearchResults\n\t\t\t\t\t});\n\t\t\t\t}, DONE_TYPING_INTERVAL);\n\t\t\t}\n\t\t}", "function textChanged(target){\n if(target === document.activeElement){\n return clearMask();\n }\n const newText = target.value;\n if(!newText){\n return;\n }\n if(newText.indexOf(\"://\")>-1){\n maskProtocolAndAddress(newText);\n } else {\n maskSimplifiedAddress(newText);\n }\n }", "function maskInput(args) {\n var inputEle = getMaskInput(args);\n applyMask.call(inputEle);\n var val = strippedValue.call(this, this.element);\n this.prevValue = val;\n this.value = val;\n if (args.mask) {\n unwireEvents.call(inputEle);\n wireEvents.call(inputEle);\n }\n}", "function controlCodePostal () {\nconst codepostal = formValues.codepostal;\n \n if(regexcodePostal(codepostal)){\n document.querySelector(\"#Codepostal_manque\").textContent = \"\";\n \n return true;\n }else{\n document.querySelector(\"#Codepostal_manque\").textContent = \"codePostal: doit étre composé de 5 chiffres\";\n alert(\"codePostal: doit étre composé de 5 chiffres\");\n return false;\n }\n \n }", "function handlePhone(obj, evt, sMask)\n{\n\tevt = (evt) ? evt : ((window.event) ? window.event : \"\");\n\tvar keyCode = evt.keyCode;\n\tvar bIsSpecial = IsSpecial(obj,evt);\n\n\t//window.status = \"keyCode [\" + keyCode + \"] IsSpecial [\" + bIsSpecial + \"]\" ;\n\n\tif(!IsNumeric(obj,evt,false,false)) return false;\n\tif(bIsSpecial) return true;\n\tif(IsValidPhoneCharacter(obj,evt)) return false;\n\n\tvar strPhone = new String(obj.value);\n\tvar iLength = new Number(strPhone.length);\n\n\t// window.status = iLength + \" - \" + sMask.length + (iLength < sMask.length );\n\n\tif(iLength > sMask.length -1)\n\t{\n\t\tevt.cancelBubble = true;\n\t\treturn false;\n\t}\n\t\n\tvar sCharAt = sMask.charAt(iLength);\n\twhile( sCharAt!=\"#\" && (iLength < sMask.length-1 ))\n\t{\n\t\tstrPhone = strPhone + sCharAt;\n\t\tiLength = strPhone.length;\n\t\tsCharAt = sMask.charAt(iLength);\n\t}\n\n\tobj.value = strPhone;\n}", "off(event) { // TODO\n\n }", "off(event) { // TODO\n\n }", "function controlEnter(e) {\n\t\t// console.log('disable');\n\t map.dragging.disable();\n\t}", "function unbindDefaultEvents (elem) {\n $(elem).unbind ('keypress.maskMoney');\n $(elem).unbind ('keydown.maskMoney');\n $(elem).unbind ('blur.maskMoney');\n $(elem).unbind ('focus.maskMoney');\n $(elem).unbind ('click.maskMoney');\n $(elem).unbind ('cut.maskMoney');\n $(elem).unbind ('paste.maskMoney');\n }", "function onGeocode(r) {\n if (r.bbox) {\n const [west, south, east, north] = r.bbox\n p.save(roundBbox({north, south, east, west}))\n } else {\n const c1 = turfDestination(r.center, 5, 45)\n const c2 = turfDestination(r.center, 5, -135)\n const [east, north] = c1.geometry.coordinates\n const [west, south] = c2.geometry.coordinates\n const newBounds = roundBbox({north, south, east, west})\n p.save(newBounds)\n p.leaflet.map.fitBounds(toLatLngBounds(newBounds))\n }\n }", "onModifyAtk() {}", "function pin(event, icon){\n\tevent.stopPropagation();\n}", "function geoButtonMouseDownHandler(event) {\r\n\r\n unsafeWindow.CheckFormatting(event);\r\n\r\n unsafeWindow.ButtonMouseDown(this);\r\n\r\n}", "tapEventOff(e){this.elevation=1}", "function DPC_onEditControlBlur(event){DatePickerControl.onEditControlBlur(event);}", "forecastEvent () {\n // Eeeesh :/\n }", "function tp_mask(layer)\n{\n\tlayer.parent.activeLayer = layer;\n\tlayer.parent.selection.select(sel = Array(\n\t\tArray(layer.bounds[0].value, layer.bounds[1].value),\n\t\tArray(layer.bounds[0].value, layer.bounds[3].value),\n\t\tArray(layer.bounds[2].value, layer.bounds[3].value),\n\t\tArray(layer.bounds[2].value, layer.bounds[1].value)\n\t));\n\tlayerMask.makeFromSelection(true);\n}", "function handleAddress(address) {\n setAddress(address)\n\n if(address.length < 3) {\n setIsAddressValid(false)\n } else {\n setIsAddressValid(true)\n }\n }", "function processClick(evt){\n interpretEntry(evt.target.id);\n evt.target.blur();\n} // processClick(evt)", "function igmask_edit(e, v, id, pe, x, y, w, h, z)\r\n{return new igmask_new(e, v, id, pe, x, y, w, h, z);}", "nameBlur(e) {\n\n }", "onGhostPointerDown(e) {\r\n this.ghostAnchor.node.setPointerCapture(e.pointerId);\r\n this.dragOrigin = new Point2D_1.Point2D(e.offsetX, e.offsetY);\r\n this.onChange(this, this.regionData.copy(), IRegionCallbacks_1.ChangeEventType.MOVEBEGIN);\r\n }", "function controlAddress () {\n const Adresse = formValues.Adresse;\n\n if(regexAddress(Adresse)){\n \n document.querySelector(\"#Address_manque\").textContent = \"\";\n return true;\n }else{\n document.querySelector(\"#Address_manque\").textContent = \"Address: non valide\";\n alert(\"Address: non valide\");\n return false;\n }\n \n }", "filterEvent(event) {\n return false;\n }", "onClick(event){\n this.geocodeLatLng(event.latLng, address =>{\n if(typeof(this.onClickMap) === 'function'){\n this.onClickMap(address, event.latLng)\n }\n })\n }", "function resetHighlightUNEMP(e) {\n geojson_unempl.resetStyle(e.target);\n info.update();\n}", "static mask(element, msg) {\n return this.adapter.mask(element, msg);\n }", "function onchangeAddress() {\n\tgetGeoByAddress();\t\n}", "function onP2pSendDragendIgnoredHandler(event) {\n event.preventDefault();\n}", "function editEvent(){\n\t\n}", "function damages_map(){\n\n}", "function handleMapEvent(event) {\n thisCheckbox = document.getElementById('mapbounds');\n if (thisCheckbox.checked) {\n removeAllGeometryFromVectorLayer(\"OpenLayers.Geometry.Polygon\");\n environment.added_bounds = getMapActiveBounds();\t// draw bounds\n saveQueryParamsToDB();\n //thisCheckbox.checked = false;\n }\n\t}", "function MascaraTelefoneMovel(tel) {\n if (mascaraInteiro(tel) === false) {\n event.returnValue = false;\n }\n return formataCampo(tel, '(00) 00000-0000', event);\n}", "function MascaraTelefone(tel){\t\n\tif(mascaraInteiro(tel)==false){\n\t\tevent.returnValue = false;\n\t}\t\n\treturn formataCampo(tel, '(00) 0000-0000', event);\n}", "handleEvent() {}", "handleEvent() {}", "_onClickRemoveAddress(event) {\n DebugUtil.log(\"Remove address button click\", event, this.props.address);\n event.preventDefault();\n this.props.removeAddressClickHandler(this.props.address);\n }", "function inputuang(e) {\n $(e).maskMoney({\n precision:0,\n prefix:'Rp. ', \n // allowNegative: true, \n thousands:'.', \n // decimal:',', \n affixesStay: true\n });\n }", "function resetfloodincboHighlight(e) {\r\n\tif (!e.target.feature.properties.selected){\r\nboroughfloodinclayer.resetStyle(e.target);\r\n};\r\n\r\n}", "function handleTouch(zone, event) {\n if(isTransmitting) { return; }\n\n let emoji = EMOJIS[emojiIndex];\n transmitEmoji(emoji[IMAGE_INDEX], emoji[CODE_POINT_INDEX],\n EMOJI_TRANSMISSION_MILLISECONDS);\n Bangle.buzz(TRANSMIT_BUZZ_MILLISECONDS);\n}", "function handleTouch(zone, event) {\n if(isTransmitting) { return; }\n\n let emoji = EMOJIS[emojiIndex];\n transmitEmoji(emoji[IMAGE_INDEX], emoji[CODE_POINT_INDEX],\n EMOJI_TRANSMISSION_MILLISECONDS);\n Bangle.buzz(TRANSMIT_BUZZ_MILLISECONDS);\n}", "function violentDayEvent(id) {\n\n}", "function changeX2MaskMoney (evt) {\n that.DEBUG && console.log ('changeX2MaskMoney');\n that.DEBUG && console.log ($(this).val ())\n if ($(this).val ().match (/%/)) {\n that.DEBUG && console.log ('destroying');\n $(this).data ('destroyed', true); // save the state so that we'll know to reinitialize\n $(this).maskMoney ('destroy');\n } else {\n if ($(this).data ('destroyed')) { \n that.maskMoney ($(this));\n }\n $(this).data ('destroyed', false);\n $(this).maskMoney ('mask');\n }\n }", "function resetHighlight(e) {\n // console.log(\"resetHighlight\");\n CapaAsentamientos.resetStyle(e.target);\n var layer = e.target;\n //layer.closePopup();\n // info.update(); //controla la info de la caja\n}", "function codeAddress() {\n \n //obtengo la direccion del formulario\n var address = document.getElementById(\"direccion\").value;\n //hago la llamada al geodecoder\n geocoder.geocode( { 'address': address}, function(results, status) {\n \n //si el estado de la llamado es OK\n if (status == google.maps.GeocoderStatus.OK) {\n //centro el mapa en las coordenadas obtenidas\n map.setCenter(results[0].geometry.location);\n //coloco el marcador en dichas coordenadas\n marker.setPosition(results[0].geometry.location);\n //actualizo el formulario \n updatePosition(results[0].geometry.location);\n \n //Añado un listener para cuando el markador se termine de arrastrar\n //actualize el formulario con las nuevas coordenadas\n google.maps.event.addListener(marker, 'dragend', function(){\n updatePosition(marker.getPosition());\n });\n } else {\n //si no es OK devuelvo error\n alert(\"No podemos encontrar la direcci&oacute;n, error: \" + status);\n }\n });\n }", "function ipMask(s2){\r\n\t \r\n \r\n var s2 = document.getElementById(s2);\r\n \r\n\t \r\n\t if(s2.value == \"1\"){\r\n \r\n ipA = 255;\r\n\t\t\t\r\n\t\t\t ipB = 255;\r\n\t\t\t\r\n\t\t\t ipC = 255;\r\n\t\t\t\r\n\t\t\t ipD = 255; \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 //-------Value to add for Broad Cast --------------\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 ipBr1 = 0;\r\n\t\t\t\t\t\t\t\t\t ipBr2 = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr3 = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr4 = 0;\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 subBits =32;\r\n\t\t\t\r\n\t\t\t hostBits =0 ;\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 kase = 1 ;\r\n\t\t\t\t\t\t\t\t \r\n dropSelect =1;\r\n \r\n \r\n\t } \r\n \r\n else if(s2.value == \"2\"){\r\n \r\n \r\n ipA = 255;\r\n\t\t\t\r\n\t\t\t ipB = 255;\r\n\t\t\t\r\n\t\t\t ipC = 255;\r\n\t\t\t\r\n\t\t\t ipD = 254; \r\n\t\t\t\t\t\t\t\t\t\t\t //-------Value to add for Broad Cast --------------\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 ipBr1 = 0;\r\n\t\t\t\t\t\t\t\t\t ipBr2 = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr3 = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr4 = 1;\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 subBits =31;\r\n\t\t\t\r\n\t\t\t hostBits =1 ;\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 \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 kase = 2 ;\r\n dropSelect =1;\t\t\t\t\t\t\t\t\t\t\t \r\n \r\n \r\n }\r\n \r\n \r\n else if(s2.value == \"3\"){\r\n \r\n \r\n ipA = 255;\r\n\t\t\t\r\n\t\t\t ipB = 255;\r\n\t\t\t\r\n\t\t\t ipC = 255;\r\n\t\t\t\r\n\t\t\t ipD = 252; \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 \r\n\t\t\t\t\t\t\t\t\t\t\t //-------Value to add for Broad Cast --------------\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 ipBr1 = 0;\r\n\t\t\t\t\t\t\t\t\t ipBr2 = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr3 = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr4 = 3;\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 \r\n\t\t\t\t\t\t\t\t\t\t\t subBits =30;\r\n\t\t\t\r\n\t\t\t hostBits =2 ;\r\n\t\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t kase = 3 ;\r\n\t\t dropSelect =1; \r\n \r\n \r\n }\r\n \r\n \r\n \r\n \r\n else if(s2.value == \"4\"){\r\n \r\n \r\n ipA = 255;\r\n\t\t\t\r\n\t\t\t ipB = 255;\r\n\t\t\t\r\n\t\t\t ipC = 255;\r\n\t\t\t\r\n\t\t\t ipD = 248; \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 //-------Value to add for Broad Cast --------------\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 ipBr1 = 0;\r\n\t\t\t\t\t\t\t\t\t ipBr2 = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr3 = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr4 = 7;\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 subBits =29;\r\n\t\t\t\r\n\t\t\t hostBits =3 ;\r\n\t\t\t\t\t\t\t\t\t\t\t \r\n\t\t kase = 4 ; \r\n dropSelect =1;\r\n \r\n }\r\n \r\n \r\n \r\n else if(s2.value == \"5\"){\r\n \r\n \r\n ipA = 255;\r\n\t\t\t\r\n\t\t\t ipB = 255;\r\n\t\t\t\r\n\t\t\t ipC = 255;\r\n\t\t\t\r\n\t\t\t ipD = 240; \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 \r\n\t\t\t\t\t\t\t\t\t\t\t //-------Value to add for Broad Cast --------------\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 ipBr1 = 0;\r\n\t\t\t\t\t\t\t\t\t ipBr2 = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr3 = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr4 = 15;\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 subBits =28;\r\n\t\t\t\r\n\t\t\t hostBits =4 ;\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t kase = 5 ; \r\n dropSelect =1;\r\n \r\n }\r\n \r\n \r\n else if(s2.value == \"6\"){\r\n \r\n \r\n \r\n\t\t\t\t\t\t\t\t\t\t\t ipA = 255;\r\n\t\t\t\r\n\t\t\t ipB = 255;\r\n\t\t\t\r\n\t\t\t ipC = 255;\r\n\t\t\t\r\n\t\t\t ipD = 224; \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 //-------Value to add for Broad Cast --------------\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 ipBr1 = 0;\r\n\t\t\t\t\t\t\t\t\t ipBr2 = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr3 = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr4 = 31;\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 subBits =27;\r\n\t\t\t\r\n\t\t\t hostBits =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 \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 \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 \r\n\t\t\t\t\t\t\t\t\t\t\t kase = 6 ; \r\n\t\t dropSelect =1; \r\n \r\n \r\n }\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\telse if(s2.value == \"7\"){\r\n \r\n \r\n \r\n\t\t\t\t\t\t\t\t\t\t\t ipA = 255;\r\n\t\t\t\r\n\t\t\t ipB = 255;\r\n\t\t\t\r\n\t\t\t ipC = 255;\r\n\t\t\t\r\n\t\t\t ipD = 192; \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 //-------Value to add for Broad Cast --------------\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 ipBr1 = 0;\r\n\t\t\t\t\t\t\t\t\t ipBr2 = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr3 = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr4 = 63;\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 subBits =26;\r\n\t\t\t\r\n\t\t\t hostBits =6 ;\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 \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 \r\n\t\t\t\t\t\t\t\t\t\t\t kase = 7 ; \r\n\t\t dropSelect =1; \r\n \r\n \r\n }\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\telse if(s2.value == \"8\"){\r\n \r\n \r\n \r\n\t\t\t\t\t\t\t\t\t\t\t ipA = 255;\r\n\t\t\t\r\n\t\t\t ipB = 255;\r\n\t\t\t\r\n\t\t\t ipC = 255;\r\n\t\t\t\r\n\t\t\t ipD = 128; \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 //-------Value to add for Broad Cast --------------\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 ipBr1 = 0;\r\n\t\t\t\t\t\t\t\t\t ipBr2 = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr3 = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr4 = 127;\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 subBits =25;\r\n\t\t\t\r\n\t\t\t hostBits =7 ;\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 \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 \r\n\t\t\t\t\t\t\t\t\t\t\t kase = 8 ; \r\n\t\t dropSelect =1; \r\n \r\n \r\n }\r\n\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\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\telse if(s2.value == \"9\"){\r\n \r\n ipA = 255;\r\n\t\t\t\r\n\t\t\t ipB = 255;\r\n\t\t\t\r\n\t\t\t ipC = 255;\r\n\t\t\t\r\n\t\t\t ipD = 0; \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 //-------Value to add for Broad Cast --------------\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 ipBr1 = 0;\r\n\t\t\t\t\t\t\t\t\t ipBr2 = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr3 = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr4 = 255;\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 subBits =24;\r\n\t\t\t\r\n\t\t\t hostBits =8 ;\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 \r\n\t\t\t\t\t\t\t\t\t\t\t \r\n \r\n\t\t\t\t\t\t\t\t\t\t\t kase = 9 ; \r\n dropSelect =1;\r\n \r\n \r\n\t } \r\n \r\n else if(s2.value == \"10\"){\r\n \r\n \r\n ipA = 255;\r\n\t\t\t\r\n\t\t\t ipB = 255;\r\n\t\t\t\r\n\t\t\t ipC = 254;\r\n\t\t\t\r\n\t\t\t ipD = 0; \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 \r\n\t\t\t\t\t\t\t\t\t\t\t //-------Value to add for Broad Cast --------------\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 ipBr1 = 0;\r\n\t\t\t\t\t\t\t\t\t ipBr2 = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr3 = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr4 = 255;\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 subBits =23;\r\n\t\t\t\r\n\t\t\t hostBits =9 ;\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 \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 kase = 10 ; \r\n dropSelect =1;\t\t\t\t\t\t\t\t\t\t\t \r\n \r\n \r\n }\r\n \r\n \r\n else if(s2.value == \"11\"){\r\n \r\n \r\n ipA = 255;\r\n\t\t\t\r\n\t\t\t ipB = 255;\r\n\t\t\t\r\n\t\t\t ipC = 252;\r\n\t\t\t\r\n\t\t\t ipD = 0; \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 //-------Value to add for Broad Cast --------------\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 ipBr1 = 0;\r\n\t\t\t\t\t\t\t\t\t ipBr2 = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr3 = 3;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr4 = 255;\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 subBits =22;\r\n\t\t\t\r\n\t\t\t hostBits =10 ;\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 \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 \r\n\t\t\t\t\t kase = 11 ; \r\n\t\t dropSelect =1; \r\n \r\n \r\n }\r\n \r\n \r\n \r\n \r\n else if(s2.value == \"12\"){\r\n \r\n \r\n ipA = 255;\r\n\t\t\t\r\n\t\t\t ipB = 255;\r\n\t\t\t\r\n\t\t\t ipC = 248;\r\n\t\t\t\r\n\t\t\t ipD = 0; \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 \r\n\t\t\t\t\t\t\t\t\t\t\t //-------Value to add for Broad Cast --------------\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 ipBr1 = 0;\r\n\t\t\t\t\t\t\t\t\t ipBr2 = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr3 = 7;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr4 = 255;\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 \r\n\t\t\t\t\t\t\t\t\t\t\t subBits =21;\r\n\t\t\t\r\n\t\t\t hostBits =11 ;\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 \r\n\t\t kase = 12 ; \r\n dropSelect =1;\r\n \r\n }\r\n \r\n \r\n \r\n else if(s2.value == \"13\"){\r\n \r\n \r\n ipA = 255;\r\n\t\t\t\r\n\t\t\t ipB = 255;\r\n\t\t\t\r\n\t\t\t ipC = 240;\r\n\t\t\t\r\n\t\t\t ipD = 0; \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 \r\n\t\t\t\t\t\t\t\t\t\t\t //-------Value to add for Broad Cast --------------\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 ipBr1 = 0;\r\n\t\t\t\t\t\t\t\t\t ipBr2 = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr3 = 15;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr4 = 255;\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 \r\n\t\t\t\t\t\t\t\t\t\t\t subBits =20;\r\n\t\t\t\r\n\t\t\t hostBits =12 ;\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 \r\n\t\t kase = 13 ; \r\n dropSelect =1;\r\n \r\n }\r\n \r\n \r\n else if(s2.value == \"14\"){\r\n \r\n \r\n \r\n\t\t\t\t\t\t\t\t\t\t\t ipA = 255;\r\n\t\t\t\r\n\t\t\t ipB = 255;\r\n\t\t\t\r\n\t\t\t ipC = 224;\r\n\t\t\t\r\n\t\t\t ipD = 0; \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 //-------Value to add for Broad Cast --------------\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 ipBr1 = 0;\r\n\t\t\t\t\t\t\t\t\t ipBr2 = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr3 = 31;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr4 = 255;\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 \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 subBits =19;\r\n\t\t\t\r\n\t\t\t hostBits =13 ;\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 \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 \r\n\t\t\t\t\t\t\t\t\t\t\t kase = 14 ; \r\n\t\t dropSelect =1; \r\n \r\n \r\n }\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\telse if(s2.value == \"15\"){\r\n \r\n \r\n \r\n\t\t\t\t\t\t\t\t\t\t\t ipA = 255;\r\n\t\t\t\r\n\t\t\t ipB = 255;\r\n\t\t\t\r\n\t\t\t ipC = 192;\r\n\t\t\t\r\n\t\t\t ipD = 0; \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 \r\n\t\t\t\t\t\t\t\t\t\t\t //-------Value to add for Broad Cast --------------\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 ipBr1 = 0;\r\n\t\t\t\t\t\t\t\t\t ipBr2 = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr3 = 63;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr4 = 255;\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 \r\n\t\t\t\t\t\t\t\t\t\t\t subBits =18;\r\n\t\t\t\r\n\t\t\t hostBits =14 ;\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 \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 kase = 15 ; \r\n\t\t dropSelect =1; \r\n \r\n \r\n }\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\telse if(s2.value == \"16\"){\r\n \r\n \r\n \r\n\t\t\t\t\t\t\t\t\t\t\t ipA = 255;\r\n\t\t\t\r\n\t\t\t ipB = 255;\r\n\t\t\t\r\n\t\t\t ipC = 128;\r\n\t\t\t\r\n\t\t\t ipD = 0; \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 \r\n\t\t\t\t\t\t\t\t\t\t\t //-------Value to add for Broad Cast --------------\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 ipBr1 = 0;\r\n\t\t\t\t\t\t\t\t\t ipBr2 = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr3 = 127;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr4 = 255;\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 \r\n\t\t\t\t\t\t\t\t\t\t\t subBits =17;\r\n\t\t\t\r\n\t\t\t hostBits =15 ;\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 \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 kase = 16 ; \r\n\t\t dropSelect =1; \r\n \r\n \r\n }\r\n\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\r\n\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\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\telse if(s2.value == \"17\"){\r\n \r\n ipA = 255;\r\n\t\t\t\r\n\t\t\t ipB = 255;\r\n\t\t\t\r\n\t\t\t ipC = 0;\r\n\t\t\t\r\n\t\t\t ipD = 0; \r\n\r\n //-------Value to add for Broad Cast --------------\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 ipBr1 = 0;\r\n\t\t\t\t\t\t\t\t\t ipBr2 = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr3 = 255;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr4 = 255;\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 \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 subBits =16;\r\n\t\t\t\r\n\t\t\t hostBits =16 ;\r\n\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t \r\n \r\n\t\t\t\t\t\t\t\t\t\t\t kase = 17 ; \r\n dropSelect =1;\r\n \r\n \r\n\t } \r\n \r\n else if(s2.value == \"18\"){\r\n \r\n \r\n ipA = 255;\r\n\t\t\t\r\n\t\t\t ipB = 254;\r\n\t\t\t\r\n\t\t\t ipC = 0;\r\n\t\t\t\r\n\t\t\t ipD = 0; \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 \r\n\t\t\t\t\t\t\t\t\t\t\t //-------Value to add for Broad Cast --------------\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 ipBr1 = 0;\r\n\t\t\t\t\t\t\t\t\t ipBr2 = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr3 = 255;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr4 = 255;\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 \r\n\t\t\t\t\t\t\t\t\t\t\t subBits =15;\r\n\t\t\t\r\n\t\t\t hostBits =17 ;\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 \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 kase = 18 ; \r\n dropSelect =1;\t\t\t\t\t\t\t\t\t\t\t \r\n \r\n \r\n }\r\n \r\n \r\n else if(s2.value == \"19\"){\r\n \r\n \r\n ipA = 255;\r\n\t\t\t\r\n\t\t\t ipB = 252;\r\n\t\t\t\r\n\t\t\t ipC = 0;\r\n\t\t\t\r\n\t\t\t ipD = 0; \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 \r\n\t\t\t\t\t\t\t\t\t\t\t //-------Value to add for Broad Cast --------------\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 ipBr1 = 0;\r\n\t\t\t\t\t\t\t\t\t ipBr2 = 3;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr3 = 255;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr4 = 255;\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 subBits =14;\r\n\t\t\t\r\n\t\t\t hostBits =18 ;\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 \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 \r\n\t\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t kase = 19 ; \r\n\t\t dropSelect =1; \r\n \r\n \r\n }\r\n \r\n \r\n \r\n \r\n else if(s2.value == \"20\"){\r\n \r\n \r\n ipA = 255;\r\n\t\t\t\r\n\t\t\t ipB = 248;\r\n\t\t\t\r\n\t\t\t ipC = 0;\r\n\t\t\t\r\n\t\t\t ipD = 0; \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 \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 //-------Value to add for Broad Cast --------------\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 ipBr1 = 0;\r\n\t\t\t\t\t\t\t\t\t ipBr2 = 7;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr3 = 255;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr4 = 255;\r\n\t\t\t\t\t\t\t\t\t\t\t \r\n\t\t \r\n\t\t\t\t\t\t\t\t\t\t\t kase = 20 ; \r\n dropSelect =1;\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 \r\n\t\t\t\t\t\t\t\t\t\t\t subBits =13;\r\n\t\t\t\r\n\t\t\t hostBits =19 ;\r\n \r\n }\r\n \r\n \r\n \r\n else if(s2.value == \"21\"){\r\n \r\n \r\n ipA = 255;\r\n\t\t\t\r\n\t\t\t ipB = 240;\r\n\t\t\t\r\n\t\t\t ipC = 0;\r\n\t\t\t\r\n\t\t\t ipD = 0;\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 \r\n\t\t\t\t\t\t\t\t\t\t\t //-------Value to add for Broad Cast --------------\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 ipBr1 = 0;\r\n\t\t\t\t\t\t\t\t\t ipBr2 = 15;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr3 = 255;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr4 = 255;\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 subBits =12;\r\n\t\t\t\r\n\t\t\t hostBits =20 ;\r\n \r\n\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t \r\n\t\t kase = 21 ; \r\n dropSelect =1;\r\n \r\n }\r\n \r\n \r\n else if(s2.value == \"22\"){\r\n \r\n \r\n \r\n\t\t\t\t\t\t\t\t\t\t\t ipA = 255;\r\n\t\t\t\r\n\t\t\t ipB = 224;\r\n\t\t\t\r\n\t\t\t ipC = 0;\r\n\t\t\t\r\n\t\t\t ipD = 0; \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 //-------Value to add for Broad Cast --------------\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 ipBr1 = 0;\r\n\t\t\t\t\t\t\t\t\t ipBr2 = 31;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr3 = 255;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr4 = 255;\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 subBits =11;\r\n\t\t\t\r\n\t\t\t hostBits =21 ;\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 \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 kase = 22 ; \r\n\t\t dropSelect =1; \r\n \r\n \r\n }\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\telse if(s2.value == \"23\"){\r\n \r\n \r\n \r\n\t\t\t\t\t\t\t\t\t\t\t ipA = 255;\r\n\t\t\t\r\n\t\t\t ipB = 192;\r\n\t\t\t\r\n\t\t\t ipC = 0;\r\n\t\t\t\r\n\t\t\t ipD = 0; \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 \r\n\t\t\t\t\t\t\t\t\t\t\t //-------Value to add for Broad Cast --------------\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 ipBr1 = 0;\r\n\t\t\t\t\t\t\t\t\t ipBr2 = 63;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr3 = 255;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr4 = 255;\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 \r\n\t\t\t\t\t\t\t\t\t\t\t subBits =10;\r\n\t\t\t\r\n\t\t\t hostBits =22;\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 \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 \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 kase = 23 ; \r\n\t\t dropSelect =1; \r\n \r\n \r\n }\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\telse if(s2.value == \"24\"){\r\n \r\n \r\n \r\n\t\t\t\t\t\t\t\t\t\t\t ipA = 255;\r\n\t\t\t\r\n\t\t\t ipB = 128;\r\n\t\t\t\r\n\t\t\t ipC = 0;\r\n\t\t\t\r\n\t\t\t ipD = 0; \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 \r\n\t\t\t\t\t\t\t\t\t\t\t //-------Value to add for Broad Cast --------------\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 ipBr1 = 0;\r\n\t\t\t\t\t\t\t\t\t ipBr2 = 127;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr3 = 255;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr4 = 255;\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 \r\n\t\t\t\t\t\t\t\t\t\t\t subBits =9;\r\n\t\t\t\r\n\t\t\t hostBits =23;\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 \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 \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 kase = 24 ; \r\n\t\t dropSelect =1; \r\n \r\n \r\n }\r\n\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\r\n\t\t\t\t\t\t\t\t\t\telse if(s2.value == \"25\"){\r\n \r\n ipA = 255;\r\n\t\t\t\r\n\t\t\t ipB = 0;\r\n\t\t\t\r\n\t\t\t ipC = 0;\r\n\t\t\t\r\n\t\t\t ipD = 0; \r\n\r\n //-------Value to add for Broad Cast --------------\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 ipBr1 = 0;\r\n\t\t\t\t\t\t\t\t\t ipBr2 = 255;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr3 = 255;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr4 = 255;\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 \r\n\t\t\t\t\t\t\t\t\t\t\t subBits =8;\r\n\t\t\t\r\n\t\t\t hostBits =24;\r\n\t\t\t\t\t\t\t\t\t\t\t \r\n\r\n\t\t\t\t\t\t\t kase = 25 ; \r\n dropSelect =1;\r\n \r\n \r\n\t } \r\n \r\n else if(s2.value == \"26\"){\r\n \r\n \r\n ipA = 254;\r\n\t\t\t\r\n\t\t\t ipB = 0;\r\n\t\t\t\r\n\t\t\t ipC = 0;\r\n\t\t\t\r\n\t\t\t ipD = 0; \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 //-------Value to add for Broad Cast --------------\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 ipBr1 = 1;\r\n\t\t\t\t\t\t\t\t\t ipBr2 = 255;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr3 = 255;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr4 = 255;\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 subBits =7;\r\n\t\t\t\r\n\t\t\t hostBits =25;\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 \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 kase = 26 ; \r\n dropSelect =1;\t\t\t\t\t\t\t\t\t\t\t \r\n \r\n \r\n }\r\n \r\n \r\n else if(s2.value == \"27\"){\r\n \r\n \r\n ipA = 252;\r\n\t\t\t\r\n\t\t\t ipB = 0;\r\n\t\t\t\r\n\t\t\t ipC = 0;\r\n\t\t\t\r\n\t\t\t ipD = 0; \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 //-------Value to add for Broad Cast --------------\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 ipBr1 = 3;\r\n\t\t\t\t\t\t\t\t\t ipBr2 = 255;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr3 = 255;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr4 = 255;\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 \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 subBits =6;\r\n\t\t\t\r\n\t\t\t hostBits =26;\r\n\t\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t kase = 27 ; \r\n\t\t dropSelect =1; \r\n \r\n \r\n }\r\n \r\n \r\n \r\n \r\n else if(s2.value == \"28\"){\r\n \r\n \r\n ipA = 248;\r\n\t\t\t\r\n\t\t\t ipB = 0;\r\n\t\t\t\r\n\t\t\t ipC = 0;\r\n\t\t\t\r\n\t\t\t ipD = 0; \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 \r\n\t\t\t\t\t\t\t\t\t\t\t //-------Value to add for Broad Cast --------------\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 ipBr1 = 7;\r\n\t\t\t\t\t\t\t\t\t ipBr2 = 255;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr3 = 255;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr4 = 255;\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 \r\n\t\t\t\t\t\t\t\t\t\t\t subBits =5;\r\n\t\t\t\r\n\t\t\t hostBits =27;\r\n\t\t\t\t\t\t\t\t\t\t\t \r\n\t\t \r\n\t\t\t\t\t\t\t\t\t\t\t kase = 28 ; \r\n dropSelect =1;\r\n \r\n }\r\n \r\n \r\n \r\n else if(s2.value == \"29\"){\r\n \r\n \r\n ipA = 240;\r\n\t\t\t\r\n\t\t\t ipB = 0;\r\n\t\t\t\r\n\t\t\t ipC = 0;\r\n\t\t\t\r\n\t\t\t ipD = 0; \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 //-------Value to add for Broad Cast --------------\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 ipBr1 = 15;\r\n\t\t\t\t\t\t\t\t\t ipBr2 = 255;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr3 = 255;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr4 = 255;\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 subBits =4;\r\n\t\t\t\r\n\t\t\t hostBits =28;\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 \r\n\t\t kase = 29 ; \r\n dropSelect =1;\r\n \r\n }\r\n \r\n \r\n else if(s2.value == \"30\"){\r\n \r\n \r\n \r\n\t\t\t\t\t\t\t\t\t\t\t ipA = 224;\r\n\t\t\t\r\n\t\t\t ipB = 0;\r\n\t\t\t\r\n\t\t\t ipC = 0;\r\n\t\t\t\r\n\t\t\t ipD = 0; \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 //-------Value to add for Broad Cast --------------\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 ipBr1 = 31;\r\n\t\t\t\t\t\t\t\t\t ipBr2 = 255;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr3 = 255;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr4 = 255;\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 subBits =3;\r\n\t\t\t\r\n\t\t\t hostBits =29;\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 \r\n\t\t\t\t\t\t\t\t\t\t\t kase = 30 ; \r\n\t\t dropSelect =1; \r\n \r\n \r\n }\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\telse if(s2.value == \"31\"){\r\n \r\n \r\n \r\n\t\t\t\t\t\t\t\t\t\t\t ipA = 192;\r\n\t\t\t\r\n\t\t\t ipB = 0;\r\n\t\t\t\r\n\t\t\t ipC = 0;\r\n\t\t\t\r\n\t\t\t ipD = 0; \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 //-------Value to add for Broad Cast --------------\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 ipBr1 = 63;\r\n\t\t\t\t\t\t\t\t\t ipBr2 = 255;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr3 = 255;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr4 = 255;\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 \r\n\t\t\t\t\t\t\t\t\t\t\t subBits =2;\r\n\t\t\t\r\n\t\t\t hostBits =30;\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 kase = 31 ; \r\n\t\t dropSelect =1; \r\n \r\n \r\n }\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\telse if(s2.value == \"32\"){\r\n \r\n \r\n \r\n\t\t\t\t\t\t\t\t\t\t\t ipA = 128;\r\n\t\t\t\r\n\t\t\t ipB = 0;\r\n\t\t\t\r\n\t\t\t ipC = 0;\r\n\t\t\t\r\n\t\t\t ipD = 0;\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t //-------Value to add for Broad Cast --------------\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 ipBr1 = 127;\r\n\t\t\t\t\t\t\t\t\t ipBr2 = 255;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr3 = 255;\r\n\t\t\t\t\t\t\t\t\t\t\t ipBr4 = 255;\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 subBits =1;\r\n\t\t\t\r\n\t\t\t hostBits =31;\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 kase = 32 ; \r\n\t\t dropSelect =1; \r\n \r\n \r\n }\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n}", "function MascaraTelefone(tel) {\n if (mascaraInteiro(tel) == false) {\n event.returnValue = false;\n }\n return formataCampo(tel, '(00) 00000-0000', event);\n}", "onBlur() {\r\n // Stub\r\n }", "function SaveCmapEventHandler(sender){this.sender=sender;}", "function fixEvent ( e, pageOffset ) {\r\n\r\n\t\t\t// Prevent scrolling and panning on touch events, while\r\n\t\t\t// attempting to slide. The tap event also depends on this.\r\n\t\t\te.preventDefault();\r\n\r\n\t\t\t// Filter the event to register the type, which can be\r\n\t\t\t// touch, mouse or pointer. Offset changes need to be\r\n\t\t\t// made on an event specific basis.\r\n\t\t\tvar touch = e.type.indexOf('touch') === 0,\r\n\t\t\t\tmouse = e.type.indexOf('mouse') === 0,\r\n\t\t\t\tpointer = e.type.indexOf('pointer') === 0,\r\n\t\t\t\tx,y, event = e;\r\n\r\n\t\t\t// IE10 implemented pointer events with a prefix;\r\n\t\t\tif ( e.type.indexOf('MSPointer') === 0 ) {\r\n\t\t\t\tpointer = true;\r\n\t\t\t}\r\n\r\n\t\t\tif ( touch ) {\r\n\t\t\t\t// noUiSlider supports one movement at a time,\r\n\t\t\t\t// so we can select the first 'changedTouch'.\r\n\t\t\t\tx = e.changedTouches[0].pageX;\r\n\t\t\t\ty = e.changedTouches[0].pageY;\r\n\t\t\t}\r\n\r\n\t\t\tpageOffset = pageOffset || getPageOffset();\r\n\r\n\t\t\tif ( mouse || pointer ) {\r\n\t\t\t\tx = e.clientX + pageOffset.x;\r\n\t\t\t\ty = e.clientY + pageOffset.y;\r\n\t\t\t}\r\n\r\n\t\t\tevent.pageOffset = pageOffset;\r\n\t\t\tevent.points = [x, y];\r\n\t\t\tevent.cursor = mouse || pointer; // Fix #435\r\n\r\n\t\t\treturn event;\r\n\t\t}", "function resetHighlight(e) {\n geojson.resetStyle(e.target);\n //Custom info:\n info.update();\n}", "function fixEvent(e, pageOffset) {\n // Prevent scrolling and panning on touch events, while\n // attempting to slide. The tap event also depends on this.\n e.preventDefault();\n // Filter the event to register the type, which can be\n // touch, mouse or pointer. Offset changes need to be\n // made on an event specific basis.\n var touch = e.type.indexOf('touch') === 0,\n mouse = e.type.indexOf('mouse') === 0,\n pointer = e.type.indexOf('pointer') === 0,\n x, y, event = e;\n // IE10 implemented pointer events with a prefix;\n if (e.type.indexOf('MSPointer') === 0) {\n pointer = true;\n }\n if (touch) {\n // noUiSlider supports one movement at a time,\n // so we can select the first 'changedTouch'.\n x = e.changedTouches[0].pageX;\n y = e.changedTouches[0].pageY;\n }\n pageOffset = pageOffset || getPageOffset();\n if (mouse || pointer) {\n x = e.clientX + pageOffset.x;\n y = e.clientY + pageOffset.y;\n }\n event.pageOffset = pageOffset;\n event.points = [x, y];\n event.cursor = mouse || pointer; // Fix #435\n return event;\n }", "function maskProtocolAndAddress(newText){\n const positionData = getDomainTextPositions(newText);\n if(!positionData){\n return clearMask();\n }\n const mask = createWebkitMask(positionData[0], positionData[1]);\n applyMask(mask);\n }", "function OnGeoreserve_Done( formattedAnswer )\r\n{\r\n try\r\n {\r\n $.widgetAppTextFieldShedModeFormsShedPositionProvince.set_text_value( formattedAnswer['administrative_area_level_2'] ) ;\r\n OnProvince_Change() ;\r\n $.widgetAppTextFieldShedModeFormsShedPositionMunicipality.set_text_value( formattedAnswer['locality'] ) ;\r\n OnMunicipality_Change() ;\r\n $.widgetAppTextFieldShedModeFormsShedPositionPlace.set_text_value( formattedAnswer['administrative_area_level_1'] ) ;\r\n OnPlace_Change() ;\r\n $.widgetAppTextFieldShedModeFormsShedPositionCivicNo.set_text_value( formattedAnswer['postal_code'] ) ;\r\n OnCivicNo_Change() ;\r\n var address = null ;\r\n if( Titanium.Locale.currentLanguage == \"en\" )\r\n {\r\n address = formattedAnswer['street_number'] + \" \" + formattedAnswer['route'] ;\r\n }\r\n else\r\n {\r\n address = formattedAnswer['route'] + \" \" + formattedAnswer['street_number'] ;\r\n }\r\n $.widgetAppTextFieldShedModeFormsShedPositionAddress.set_text_value( address ) ;\r\n OnAddress_Change() ;\r\n }\r\n catch( exception )\r\n {\r\n Alloy.Globals.AlertUserAndLogAsync( L( 'generic_exception_msg' ) + exception.message ) ;\r\n }\r\n finally\r\n {\r\n EndAsyncBusyAction( $.activity_indicator , controls , EndAsyncBusyAction_CallBack ) ;\r\n }\r\n}", "function fixEvent ( e, pageOffset ) {\n\t\n\t\t\t// Prevent scrolling and panning on touch events, while\n\t\t\t// attempting to slide. The tap event also depends on this.\n\t\t\te.preventDefault();\n\t\n\t\t\t// Filter the event to register the type, which can be\n\t\t\t// touch, mouse or pointer. Offset changes need to be\n\t\t\t// made on an event specific basis.\n\t\t\tvar touch = e.type.indexOf('touch') === 0,\n\t\t\t\tmouse = e.type.indexOf('mouse') === 0,\n\t\t\t\tpointer = e.type.indexOf('pointer') === 0,\n\t\t\t\tx,y, event = e;\n\t\n\t\t\t// IE10 implemented pointer events with a prefix;\n\t\t\tif ( e.type.indexOf('MSPointer') === 0 ) {\n\t\t\t\tpointer = true;\n\t\t\t}\n\t\n\t\t\tif ( touch ) {\n\t\t\t\t// noUiSlider supports one movement at a time,\n\t\t\t\t// so we can select the first 'changedTouch'.\n\t\t\t\tx = e.changedTouches[0].pageX;\n\t\t\t\ty = e.changedTouches[0].pageY;\n\t\t\t}\n\t\n\t\t\tpageOffset = pageOffset || getPageOffset();\n\t\n\t\t\tif ( mouse || pointer ) {\n\t\t\t\tx = e.clientX + pageOffset.x;\n\t\t\t\ty = e.clientY + pageOffset.y;\n\t\t\t}\n\t\n\t\t\tevent.pageOffset = pageOffset;\n\t\t\tevent.points = [x, y];\n\t\t\tevent.cursor = mouse || pointer; // Fix #435\n\t\n\t\t\treturn event;\n\t\t}", "function addFilter1(){if (noFixedFilter) {mask.style.backgroundColor = \"#65613E\";}}", "_deleteHandler(event) {\n const that = this,\n selectionStart = that.$.input.selectionStart,\n selectionEnd = that.$.input.selectionEnd,\n key = event.key;\n\n let newSelectionStart = selectionStart;\n\n that._preventDefault(event);\n\n if (selectionStart === selectionEnd) {\n if (key === 'Backspace') {\n for (let i = selectionStart; i > 0; i--) {\n const maskItem = that._mask[i - 1];\n\n if (maskItem.type === 'mask') {\n newSelectionStart = i - 1;\n maskItem.character = '';\n break;\n }\n else {\n newSelectionStart = selectionStart - 1;\n break;\n }\n }\n }\n else {\n for (let i = selectionStart; i < that._mask.length; i++) {\n const maskItem = that._mask[i];\n\n if (maskItem.type === 'mask') {\n newSelectionStart = i + 1;\n maskItem.character = '';\n break;\n }\n else {\n newSelectionStart = selectionStart + 1;\n break;\n }\n }\n }\n }\n else {\n that._cleanMask(selectionStart, selectionEnd);\n if (key === 'Delete') {\n newSelectionStart = selectionEnd;\n }\n }\n\n that._setMaskToInput();\n that._updateMaskFullAndCompleted();\n that.value = that._getValueWithTextMaskFormat({ start: 0, end: that._mask.length }, that.textMaskFormat);\n that.$.input.selectionStart = that.$.input.selectionEnd = newSelectionStart;\n }", "function InternalEvent() {}", "pcBindEvent(){ return false }" ]
[ "0.5835061", "0.56395924", "0.5594026", "0.5395339", "0.5369281", "0.5360633", "0.5350389", "0.53418493", "0.53418493", "0.53011334", "0.52943146", "0.5264602", "0.5187621", "0.5172707", "0.51695657", "0.50957537", "0.50862104", "0.50561285", "0.50167686", "0.50034493", "0.49717838", "0.4961285", "0.49129292", "0.49064466", "0.4906374", "0.49020448", "0.487683", "0.48750716", "0.48463628", "0.4832374", "0.48187238", "0.47912332", "0.47841907", "0.47744694", "0.47711107", "0.4766595", "0.47647357", "0.47627667", "0.47595564", "0.47481328", "0.47378618", "0.47358885", "0.47355723", "0.47308508", "0.47298652", "0.47237498", "0.47204047", "0.47204047", "0.47191066", "0.471019", "0.47079313", "0.46900332", "0.46891806", "0.46878123", "0.4685384", "0.46795884", "0.46758628", "0.46753696", "0.46676558", "0.46674672", "0.46672937", "0.46621767", "0.46571875", "0.46526653", "0.46464765", "0.4633381", "0.46253145", "0.46098408", "0.46087438", "0.4607147", "0.46066102", "0.46014574", "0.45919815", "0.45830625", "0.4581272", "0.45803034", "0.45803034", "0.457789", "0.45752066", "0.4574769", "0.4574399", "0.4574399", "0.45629779", "0.4560618", "0.45595223", "0.45592135", "0.4556778", "0.45559356", "0.45514244", "0.45409188", "0.45371282", "0.45350206", "0.45327964", "0.45314342", "0.45301715", "0.4526176", "0.45244804", "0.45197508", "0.451476", "0.45109624" ]
0.56837326
1
This attribute create a cookie cname is name of your cookie cvalue is the value of cookie exdays is total days
setCookie(cname, cvalue, exdays){ let d = new Date(); exdays = exdays ?? 30; d.setTime(d.getTime() + (exdays*24*60*60*1000)); let expires = "expires="+d.toUTCString(); document.cookie = `${cname}=${cvalue};${expires};path=/` }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setCookie(cname,cvalue,exdays){var d=new Date();d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1000);var expires=\"expires=\" + d.toUTCString();document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";}", "setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\n var expires = \"expires=\"+ d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n }", "function setCookie(cname, cvalue, exdays) {\r\n var d = new Date();\r\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\r\n var expires = \"expires=\"+d.toUTCString();\r\n\r\n // règle le pb des caractères interdits\r\n if ('btoa' in window) {\r\n cvalue = btoa(cvalue);\r\n }\r\n\r\n document.cookie = cname + \"=\" + cvalue + \"; \" + expires+';path=/';\r\n}", "function cook(name,value,days) {\n\tif (days) {\n\t\tvar date = new Date();\n\t\tdate.setTime(date.getTime()+(days*24*60*60*1000));\n\t\tvar expires = \"; expires=\"+date.toGMTString();\n\t}\n\telse var expires = \"\";\n\tdocument.cookie = name+\"=\"+value+expires+\"; path=/\";\n}", "function setCookie(cname, cvalue, exdays) {\n // console.log('setCookie(' + cname + ', ' + cvalue + ')');\n console.log('setCookie(' + cname + ')');\n var d = new Date();\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\n var expires = \"expires=\"+ d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n }// setCookie()", "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\n var expires = \"expires=\"+ d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n }", "setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\n var expires = \"expires=\"+ d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n }", "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));\n var expires = \"expires=\" + d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n }", "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));\n var expires = \"expires=\" + d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n }", "function setCookie(cname, cvalue, exdays) {\n const d = new Date();\n d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1000);\n const expires = \"expires=\" + d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires;\n}", "function setCookie(cname, cvalue, exdays){\r\n var d = new Date();\r\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\r\n var expires = \"expires=\"+ d.toUTCString();\r\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\r\n }", "function setCookie(cname, cvalue, exdays) {\r\n var d = new Date();\r\n d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1000);\r\n var expires = \"expires=\" + d.toUTCString();\r\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\r\n}", "function setCookie(cname,cvalue,exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\n var expires = \"expires=\" + d.toGMTString();\n document.cookie = cname+\"=\"+cvalue+\"; \"+expires;\n}", "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\n var expires = \"expires=\"+d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n }", "function createCookie(name,value,days) {\n if (days) {\n var date = new Date();\n //Calculate miliseconds since Unix Epoch for specified number of seconds\n date.setTime(date.getTime()+(days*24*60*60*1000));\n var expires = \"; expires=\"+date.toGMTString();\n } else {\n var expires = \"\";\n }\n document.cookie = name+\"=\"+value+expires+\"; path=/\";\n}", "function setCookie(cname, cvalue, exdays) {\r\n var d = new Date();\r\n d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1000);\r\n var expires = \"expires=\" + d.toUTCString();\r\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\r\n console.log(\"\" + cname + \"=\" + cvalue + \";\" + expires);\r\n}", "function setCookie(cname,cvalue,exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\n var expires = \"expires=\" + d.toGMTString();\n document.cookie = cname+\"=\"+cvalue+\"; \"+expires;\n}", "function setCookie(cname,cvalue,exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\n var expires = \"expires=\" + d.toGMTString();\n document.cookie = cname+\"=\"+cvalue+\"; \"+expires;\n}", "function setCookie(cname, cvalue, exdays) {\n\t\tvar now = new Date();\n\t\tvar time = now.getTime();\n\t\ttime += 60 * 1000;\n\t\tnow.setTime(time);\n\n\t\tvar expires = \"expires=\"+now.toUTCString();\n\t\tdocument.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n\t}", "function createCookie(name, value, days) {\n if (days) {\n var date = new Date();\n date.setTime(date.getTime()+(days*24*60*60*1000));\n var expires = \"; expires=\"+date.toGMTString();\n }\n else var expires = \"\";\n doc.cookie = name+\"=\"+value+expires+\"; path=/\";\n}", "function setCookie(cname, cvalue, exdays) {\r\n var d = new Date();\r\n d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1000);\r\n var expires = \"expires=\" + d.toUTCString();\r\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\r\n}", "function setCookie(cname, cvalue, exdays) {\n const d = new Date();\n d.setTime(d.getTime() + (exdays*60*60*1000));\n let expires = \"expires=\"+ d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n }", "function createCookie(name,value,days) {\n\n if (days) {\n var date = new Date();\n date.setTime(date.getTime()+(days*24*60*60*1000));\n var expires = \"; expires=\"+date.toGMTString();\n }\n else var expires = \"\";\n document.cookie = name+\"=\"+value+expires+\"; path=/\";\n return true;\n }", "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));\n var expires = \"expires=\"+d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \"; \" + expires;\n}", "function CreateCookie(name, value, days) {\n if (days) {\n var date = new Date();\n date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));\n var expires = \"; expires=\" + date.toGMTString();\n } else var expires = \"\";\n document.cookie = name + \"=\" + value + expires + \"; path=/\";\n}", "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1000);\n var expires = \"expires=\" + d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n}", "function setCookie(cname, cvalue, exdays) {\n const d = new Date();\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\n let expires = \"expires=\"+ d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n}", "function setCookie(cname, cvalue, exdays) {\n\tvar d = new Date();\n\td.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));\n\t// set expiration date to a year from now\n\tvar expires = \"expires=\"+d.toUTCString();\n\tdocument.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n}", "function setCookie(cname, cvalue, exdays) {\n let d = new Date();\n // Postavljanje vremena koliko cookie traje\n d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));\n let expires = \"expires=\" + d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \"; path=/\";\n}", "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\n var expires = \"expires=\"+ d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n }", "function setCookie(cname, cvalue, exdays) {\n let d = new Date();\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\n let expires = 'expires='+ d.toUTCString();\n document.cookie = cname + '=' + cvalue + ';' + expires;\n}", "function setCookie(cname, cvalue, exdays) {\n const d = new Date();\n d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));\n let expires = \"expires=\"+d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n}", "function setCookie(cname, cvalue, exdays) {\r\n var d = new Date();\r\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\r\n var expires = \"expires=\"+d.toUTCString();\r\n document.cookie = cname + \"=\" + cvalue + \"; \" + expires;\r\n}", "function setCookie(cname, cvalue, exdays) {\r\n var d = new Date();\r\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\r\n var expires = \"expires=\"+d.toUTCString();\r\n document.cookie = cname + \"=\" + cvalue + \"; \" + expires;\r\n}", "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1000);\n var expires = 'expires=' + d.toGMTString();\n document.cookie = cname + '=' + cvalue + ';' + expires + ';path=/';\n}", "function setCookie(c_name,value,exdays) { \n\tvar exdate=new Date();\n\texdate.setDate(exdate.getDate() + exdays);\n\tvar c_value=escape(value) + ((exdays==null) ? \"\" : \"; expires=\"+exdate.toUTCString());\n\tdocument.cookie=c_name + \"=\" + c_value;\n}", "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1000);\n var expires = 'expires=' + d.toUTCString();\n document.cookie = cname + '=' + cvalue + ';' + expires + ';path=/';\n}", "function setCookie(cname, cvalue, exdays) {\n\tvar d = new Date();\n\td.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));\n\tvar expires = 'expires=' + d.toUTCString();\n\tdocument.cookie = cname + '=' + cvalue + ';' + expires;\n}", "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\n var expires = \"expires=\"+d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \"; \" + expires;\n}", "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\n var expires = \"expires=\"+d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \"; \" + expires;\n}", "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\n var expires = \"expires=\"+d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \"; \" + expires;\n}", "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\n var expires = \"expires=\"+d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \"; \" + expires;\n}", "function createCookie(name, value, days) {\n if (days) {\n var date = new Date()\n date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000))\n var expires = \"; expires=\" + date.toGMTString()\n } else var expires = \"\"\n document.cookie = name + \"=\" + value + expires + \"; path=/\"\n }", "function enq_wc(name,value,days){\r\n\tvar expires='';\r\n\tif(days){\r\n\t\tvar date=new Date();\r\n\t\tdate.setTime(date.getTime()+(days*86400000));\r\n\t\tvar expires=\"; expires=\"+date.toUTCString();\r\n\t}\r\n\tvar domain='';\r\n\tif(enq_pl['domain']){\r\n\t\tdomain = \"; domain=\"+enq_pl['domain'];\r\n\t}\r\n\tdocument.cookie=name+\"=\"+value+expires+domain+\"; path=/\";\r\n}", "function setCookie(cname, cvalue, exdays) {\n console.log('set Cookie')\n var d = new Date();\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\n var expires = \"expires=\"+ d.toUTCString();\n var new_cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n new_cookie.raw=true;\n document.cookie = new_cookie;\n}", "function createCookie(name, value, days) {\n if (days) {\n var date = new Date();\n date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));\n var expires = \"; expires=\" + date.toGMTString();\n }\n else\n var expires = \"\";\n document.cookie = name + \"=\" + value + expires + \"; path=/\";\n}", "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));\n var expires = \"expires=\" + d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n}", "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));\n var expires = \"expires=\" + d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n}", "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));\n var expires = \"expires=\" + d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n}", "function createCookie(name, value, days) {\n if (days) {\n var date = new Date();\n date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));\n var expires = \"; expires=\" + date.toGMTString();\n } else\n var expires = \"\";\n document.cookie = name + \"=\" + value + expires + \"; path=/\";\n}", "function setCookie(c_name,value,exdays){\n\t\tvar exdate=new Date();\n\t\texdate.setDate(exdate.getDate() + exdays);\n\t\tvar c_value=escape(value) + ((exdays==null) ? \"\" : \"; expires=\"+exdate.toUTCString());\n\t\tdocument.cookie=c_name + \"=\" + c_value;\n\t}", "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));\n var expires = \"expires=\"+d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n}", "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));\n var expires = \"expires=\"+d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n}", "function setCookie(cname,cvalue,exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\n var expires = \"expires=\" + d.toGMTString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n}", "function setCookie(cname, cvalue, exdays) {\n\tvar d = new Date();\n\td.setTime(d.getTime() + (exdays*24*60*60*1000));\n\tvar expires = \"expires=\"+d.toUTCString();\n\tdocument.cookie = cname + \"=\" + cvalue + \"; \" + expires;\n}", "function createCookie(name, value, days) {\r\n if (days) {\r\n var date = new Date();\r\n date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));\r\n var expires = \"; expires=\" + date.toGMTString();\r\n } else\r\n var expires = \"\";\r\n document.cookie = name + \"=\" + value + expires + \"; path=/\";\r\n}", "function setCookie(c_name,value,exdays)\r\n\t\t{\r\n\t\t\tvar exdate=new Date();\r\n\t\t\texdate.setDate(exdate.getDate() + exdays);\r\n\t\t\tvar c_value=escape(value) + ((exdays==null) ? \"\" : \"; expires=\"+exdate.toUTCString());\r\n\t\t\tdocument.cookie=c_name + \"=\" + c_value;\r\n\t\t}", "function setCookie(c_name,value,exdays) {\n\tvar exdate = new Date();\n\texdate.setDate(exdate.getDate() + exdays);\n\tvar c_value = escape(value) + ((exdays === null) ? \"\" : \"; expires=\" + exdate.toUTCString());\n\tdocument.cookie = c_name + \"=\" + c_value;\n}", "function setCookie(cname, cvalue, exdays) {\n var d = new Date()\n d.setTime(d.getTime() + (exdays*24*60*60*1000))\n var expires = \"expires=\"+ d.toUTCString()\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\"\n}", "function setCookie(cname,cvalue,exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\n var expires = \"expires=\"+ d.toGMTString();\n document.cookie = cname + \"=\" + cvalue + \"; \" + expires + \";path=/\";\n}", "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));\n var expires = \"expires=\" + d.toGMTString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n //alert(document.cookie);\n}", "function setCookie(cname, cvalue, exdays) {\r\n var d = new Date();\r\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\r\n var expires = \"expires=\"+ d.toUTCString();\r\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\r\n}", "function setCookie(c_name,value,exdays)\r\n\t{\r\n\tvar exdate=new Date();\r\n\texdate.setDate(exdate.getDate() + exdays);\r\n\tvar c_value=escape(value) + ((exdays==null) ? \"\" : \"; expires=\"+exdate.toUTCString());\r\n\tdocument.cookie=c_name + \"=\" + c_value;\r\n\t}", "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\n var expires = \"expires=\"+ d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n}", "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\n var expires = \"expires=\"+ d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n}", "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\n var expires = \"expires=\"+ d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n}", "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\n var expires = \"expires=\"+ d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n}", "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\n var expires = \"expires=\"+ d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n}", "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\n var expires = \"expires=\"+ d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n}", "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\n var expires = \"expires=\"+ d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n}", "function setCookie(c_name,value,exdays)\r\n{\r\n var exdate = new Date();\r\n exdate.setDate(exdate.getDate() + exdays);\r\n\r\n var c_value=escape(value) + ((exdays==null) ? \"\" : \"; expires=\" + exdate.toUTCString());\r\n document.cookie=c_name + \"=\" + c_value;\r\n}", "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\n var expires = \"expires=\"+d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n}", "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\n var expires = \"expires=\"+d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n}", "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\n var expires = \"expires=\"+d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n}", "function setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\n var expires = \"expires=\"+d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n}", "function setCookie(cname, cvalue, exdays) {\r\n var d = new Date();\r\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\r\n var expires = \"expires=\"+d.toUTCString();\r\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\r\n}", "function setCookie(cname, cvalue, exdays) {\r\n var d = new Date();\r\n d.setTime(d.getTime() + (exdays*24*60*60*1000));\r\n var expires = \"expires=\"+d.toUTCString();\r\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\r\n}", "function setCookie(c_name,value,exdays)\n{\n var exdate=new Date();\n exdate.setDate(exdate.getDate() + exdays);\n var c_value=escape(value) + ((exdays==null) ? \"\" : \"; expires=\"+exdate.toUTCString());\n document.cookie=c_name + \"=\" + c_value;\n}", "function setCookie(c_name, value, exdays) {\n var exdate = new Date();\n exdate.setDate(exdate.getDate() + exdays);\n var c_value = escape(value) + ((exdays == null) ? \"\" : \"; expires=\" + exdate.toUTCString());\n document.cookie = c_name + \"=\" + c_value;\n}", "function setCookie(c_name, value, exdays) {\n var exdate = new Date();\n exdate.setDate(exdate.getDate() + exdays);\n var c_value = escape(value) + ((exdays == null) ? \"\" : \"; expires=\" + exdate.toUTCString());\n document.cookie = c_name + \"=\" + c_value;\n}", "function createCookie(name,value,days) {\r\tif (days) {\r\t\tvar date = new Date();\r\t\tdate.setTime(date.getTime()+(days*24*60*60*1000));\r\t\tvar expires = \"; expires=\"+date.toGMTString();\r\t}\r\telse var expires = \"\";\r\tdocument.cookie = name+\"=\"+value+expires+\"; path=/\";\r}", "function createCookie(name,value,days) {\n if (days) {\n var date = new Date();\n date.setTime(date.getTime()+(days*24*60*60*1000));\n var expires = \"; expires=\"+date.toGMTString();\n }\n else var expires = \"\";\n document.cookie = name+\"=\"+value+expires+\"; path=/\";\n}", "function createCookie(name, value, days) {\r\n\tif (days) {\r\n\t\tvar date = new Date();\r\n\t\tdate.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));\r\n\t\tvar expires = \"; expires=\" + date.toGMTString();\r\n\t} else {\r\n\t\tvar expires = \"\";\r\n\t}\r\n\tdocument.cookie = name + \"=\" + value + expires + \"; path=/\";\r\n}", "function createCookie(name, value, days) {\r\n\tif (days) {\r\n\t\tvar date = new Date();\r\n\t\tdate.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));\r\n\t\tvar expires = \"; expires=\" + date.toGMTString();\r\n\t}\r\n\telse\r\n\t\tvar expires = \"\";\r\n\tdocument.cookie = name + \"=\" + value + expires + \"; path=/\";\r\n}", "function setAcookie(c_name,value,exdays)\n{\n\teraseCookie(c_name);\n\tvar exdate=new Date();\n\texdate.setDate(exdate.getDate() + exdays);\n\tvar c_value=escape(value) + ((exdays==null) ? \"\" : \"; expires=\"+exdate.toUTCString())+\"; path=/\";\n\tdocument.cookie=c_name + \"=\" + c_value;\n}", "function _createCookie($name,$value,$days) {\n if ($days) {\n var $date = new Date();\n $date.setTime($date.getTime()+($days*24*60*60*1000));\n var $expires = \"; expires=\"+$date.toGMTString();\n } else {\n var $expires = \"\";\n }\n document.cookie = $name+\"=\"+$value+$expires+\"; path=/\";\n}", "function setCookie(c_name,value,exdays)\n{\n\tvar exdate=new Date();\n\texdate.setDate(exdate.getDate() + exdays);\n\tvar c_value=escape(value) + ((exdays==null) ? \"\" : \"; expires=\"+exdate.toUTCString());\n\tdocument.cookie=c_name + \"=\" + c_value + \"; path=/\";\n}", "function createCookie(name,value,days) {\n if (days) {\n var date = new Date();\n date.setTime(date.getTime()+(days*24*60*60*1000));\n var expires = \"; expires=\"+date.toGMTString();\n } else \n var expires = \"\";\n document.cookie = name+\"=\"+value+expires+\"; path=/\";\n}", "function setCookie(c_name, value, exdays) {\n var exdate = new Date();\n exdate.setDate(exdate.getDate() + exdays);\n var c_value = escape(value) + ((exdays === null) ? \"\" : \"; expires=\" +\n exdate.toUTCString());\n document.cookie = c_name + \"=\" + c_value;\n}", "function createCookie(name, value) {\n var date, expires;\n if (days) {\n date = new Date();\n date.setTime(date.getTime()+(24*60*60*365*5));\n expires = \"; expires=\"+date.toGMTString();\n } else {\n expires = \"\";\n }\n document.cookie = name+\"=\"+value+expires+\"; path=/\";\n}", "function createCookie(name,value,days) {\n if (days) {\n var date = new Date();\n date.setTime(date.getTime() + (days * 24 * 60 * 60 *1000));\n var expires = \"; expires=\" + date.toGMTString();\n } else {\n var expires = \"\";\n }\n document.cookie = name + \"=\" + value + expires + \"; path=/\";\n}", "function createCookie(name,value,days) {\n if (days) {\n var date = new Date();\n date.setTime(date.getTime()+(days*24*60*60*1000));\n var expires = \"; expires=\"+date.toGMTString();\n }\n else var expires = \"\";\n document.cookie = name+\"=\"+value+expires+\"; path=/\";\n}", "function createCookie(name,value,days) {\n if (days) {\n var date = new Date();\n date.setTime(date.getTime()+(days*24*60*60*1000));\n var expires = \"; expires=\"+date.toGMTString();\n }\n else var expires = \"\";\n document.cookie = name+\"=\"+value+expires+\"; path=/\";\n}", "function createCookie(name,value,days) {\n if (days) {\n var date = new Date();\n date.setTime(date.getTime()+(days*24*60*60*1000));\n var expires = \"; expires=\"+date.toGMTString();\n }\n else var expires = \"\";\n document.cookie = name+\"=\"+value+expires+\"; path=/\";\n}", "function createCookie(name,value,days) {\r\n if (days) {\r\n var date = new Date();\r\n date.setTime(date.getTime()+(days*24*60*60*1000));\r\n var expires = \"; expires=\"+date.toGMTString();\r\n }\r\n else var expires = \"\";\r\n document.cookie = name+\"=\"+value+expires+\"; path=/\";\r\n}", "function createCookie(name, value, days) {\n var expires;\n if (days) {\n var date = new Date();\n date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));\n expires = \"; expires=\" + date.toGMTString();\n }\n else {\n expires = \"\";\n }\n document.cookie = name + \"=\" + value + expires + \"; path=/\";\n}", "function setCookie(c_name,value,exdays)\r\n{\r\n var exdate=new Date();\r\n exdate.setDate(exdate.getDate() + exdays);\r\n var c_value=escape(value) + ((exdays==null) ? \"\" : \"; expires=\"+exdate.toUTCString());\r\n c_value = c_value + \"; path=/\";\r\n document.cookie=c_name + \"=\" + c_value;\r\n}", "function setCookie(name,value,exdays){ //função universal para criar cookie \r\n \r\n var expires;\r\n var date; \r\n var value;\r\n \r\n date = new Date(); // criando o COOKIE com a data atual\r\n date.setTime(date.getTime()+(exdays*24*60*60*1000));\r\n expires = date.toUTCString();\r\n \r\n document.cookie = name+\"=\"+value+\"; expires=\"+expires+\"; path=/\";\r\n}", "function setCookie(c_name,value,expiredays) {\r\n\tvar exdate=new Date();\r\n\texdate.setDate(exdate.getDate()+expiredays);\r\n\tdocument.cookie=c_name+ \"=\" +escape(value)+((expiredays==null) ? \"\" : \";expires=\"+exdate.toGMTString())+\"; path=/\";\r\n}", "function createCookie(name,value,days)\r\n{\r\n\tif (!days) days = 100; //default 100 days\r\n\tif (days)\r\n\t{\r\n\t\tvar date = new Date();\r\n\t\tdate.setTime(date.getTime()+(days*24*60*60*1000));\r\n\t\tvar expires = \"; expires=\"+date.toGMTString();\r\n\t}\r\n\telse var expires = \"\";\r\n\tdocument.cookie = name+\"=\"+value+expires+\"; path=/\";\r\n}" ]
[ "0.7987817", "0.79419273", "0.79051435", "0.7886888", "0.7867747", "0.7867051", "0.78637856", "0.78447634", "0.7819961", "0.78096455", "0.78079915", "0.7806359", "0.7795146", "0.7794914", "0.77932507", "0.7793025", "0.7785268", "0.7785268", "0.77834415", "0.77827555", "0.7780516", "0.77801603", "0.77790576", "0.7777237", "0.7773176", "0.7770158", "0.7770146", "0.77673715", "0.77648354", "0.7764651", "0.7759518", "0.77549785", "0.7754401", "0.7754401", "0.7752603", "0.7750036", "0.7748904", "0.7746918", "0.77456725", "0.77456725", "0.77456725", "0.77456725", "0.7744294", "0.77426195", "0.7738834", "0.77374756", "0.7737441", "0.7737441", "0.7737441", "0.7736487", "0.7726707", "0.77242106", "0.77242106", "0.7723738", "0.7714852", "0.7714139", "0.7714049", "0.77130663", "0.77127707", "0.77110475", "0.7700333", "0.7699867", "0.76992834", "0.769801", "0.769801", "0.769801", "0.769801", "0.769801", "0.769801", "0.769801", "0.76976746", "0.7688238", "0.7688238", "0.7688238", "0.7688238", "0.7686747", "0.7686747", "0.7686055", "0.76844853", "0.76844853", "0.7684143", "0.7682082", "0.7679846", "0.7678945", "0.76765645", "0.76750124", "0.7673481", "0.7671659", "0.7668419", "0.7666922", "0.7663786", "0.766318", "0.766318", "0.766318", "0.7656529", "0.76559293", "0.7645022", "0.7631211", "0.76282364", "0.762558" ]
0.78442466
8
This function return a cookie
getCookie(cname){ if(!cname) throw new Error('name cookie not specified'); let decodedCookie = decodeURIComponent(document.cookie); let ca = decodedCookie.split(';'); for(let i of ca){ let c = i.trim(); let explode = c.split('='); if(explode[0] && explode[0] == cname){ return `${explode[0]}=${explode[1]}`; } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCookieReturn() \r\n{\r\n\treturn docCookies.getItem('Host'); //Get the cookie\r\n}", "function getCookie(cname) {\n\treturn $.cookie(cname);\n}", "static get(name) \r\n\t{\r\n\t if (document.cookie.length > 0) {\r\n\t let c_start = document.cookie.indexOf(name + \"=\");\r\n\t \r\n\t if (c_start != -1) {\r\n\t c_start = c_start + name.length + 1;\r\n\t let c_end = document.cookie.indexOf(\";\", c_start);\r\n\t \r\n\t if (c_end == -1) {\r\n\t c_end = document.cookie.length;\r\n\t }\r\n\r\n\t return JSON.parse(unescape(document.cookie.substring(c_start, c_end)));\r\n\t }\r\n\t }\r\n\r\n\t return {};\r\n\t}", "function getCookie(name) {\n \n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n //RETORNANDO EL TOKEN\n return cookieValue;\n\n }//end function getCookie", "function Get_Cookie(name){var start=document.cookie.indexOf(name+'=');var len=start+name.length+1;if((!start)&&(name!=document.cookie.substring(0,name.length)))\nreturn null;if(start==-1)\nreturn null;var end=document.cookie.indexOf(';',len);if(end==-1)end=document.cookie.length;if(end==start){return'';}\nreturn unescape(document.cookie.substring(len,end));}", "function get_cookie() {\n var cookie = $.cookie(cookie_name);\n if (cookie == null)\n return false;\n else\n return $.cookie(cookie_name);\n}", "function get_cookie(c_name) {\n var c_value = document.cookie;\n var c_start = c_value.indexOf(\" \" + c_name + \"=\");\n if (c_start === -1) {\n c_start = c_value.indexOf(c_name + \"=\");\n }\n if (c_start === -1) {\n c_value = \"\";\n } else {\n c_start = c_value.indexOf(\"=\", c_start) + 1;\n var c_end = c_value.indexOf(\";\", c_start);\n if (c_end === -1)\n {\n c_end = c_value.length;\n }\n c_value = unescape(c_value.substring(c_start, c_end));\n }\n return c_value;\n}", "function getCookie() {\n\n // Check if the user is logged in\n if($.cookie('logged_in') != null){\n\n var token = $.cookie('logged_in')\n } \n else { \n // @todo - do we need this ?\n // Creates a user automatically if no user is logged in\n var token = \"guest\"\n }\n\n return token\n}", "async function getCookie(name) {\n var cookieValue = null;\n if (document.cookie && document.cookie != '') {\n var cookies = document.cookie.split(';');\n for (var i = 0; i < cookies.length; i++) {\n var cookie = jQuery.trim(cookies[i]);\n if (cookie.substring(0, name.length + 1) == (name + '=')) {\n cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n break;\n }\n }\n }\n //RETORNANDO EL TOKEN\n return cookieValue;\n }//end function getCookie", "function getCookie() {\n return $cookies.get(\"role\");\n }", "function Get_Cookie(name) { \n var start = document.cookie.indexOf(name+\"=\"); \n var len = start+name.length+1; \n if ((!start) && (name != document.cookie.substring(0,name.length))) return null; \n if (start == -1) return null; \n var end = document.cookie.indexOf(\";\",len); \n if (end == -1) end = document.cookie.length; \n return unescape(document.cookie.substring(len,end)); \n}", "function get_cookie(name) {\r\n\tvar searchstr = name + \"=\";\r\n\tvar returnvalue = \"\";\r\n\tif (document.cookie.length > 0) {\r\n\t\tvar offset = document.cookie.indexOf(searchstr);\r\n\t\t// if cookie exists\r\n\t\tif (offset != -1) {\r\n\t\t\toffset += searchstr.length;\r\n\t\t\t// set index of beginning of value\r\n\t\t\tvar end = document.cookie.indexOf(\";\", offset);\r\n\t\t\t\t// set index of end of cookie value\r\n\t\t\tif (end == -1) \r\n\t\t\t\t\tend = document.cookie.length;\r\n\t\t\treturnvalue=unescape(document.cookie.substring(offset, end));\r\n\t\t}\r\n \t}\r\n \treturn returnvalue;\r\n}", "function getCookie(c_name) { \n\tvar c_value = document.cookie;\n\tvar c_start = c_value.indexOf(\" \" + c_name + \"=\");\n\tif (c_start == -1)\n\t {\n\t c_start = c_value.indexOf(c_name + \"=\");\n\t }\n\tif (c_start == -1)\n\t {\n\t c_value = null;\n\t }\n\telse\n\t {\n\t c_start = c_value.indexOf(\"=\", c_start) + 1;\n\t var c_end = c_value.indexOf(\";\", c_start);\n\t if (c_end == -1)\n\t {\n\tc_end = c_value.length;\n\t}\n\tc_value = unescape(c_value.substring(c_start,c_end));\n\t}\n\treturn c_value;\n}", "function trx_addons_get_cookie(name) {\n \"use strict\";\n var defa = arguments[1]!=undefined ? arguments[1] : null;\n var start = document.cookie.indexOf(name + '=');\n var len = start + name.length + 1;\n if ((!start) && (name != document.cookie.substring(0, name.length))) {\n return defa;\n }\n if (start == -1)\n return defa;\n var end = document.cookie.indexOf(';', len);\n if (end == -1)\n end = document.cookie.length;\n return unescape(document.cookie.substring(len, end));\n}", "function getCookie() {\n\n\t // Restore the document.cookie property\n\t delete document.cookie;\n\n\t var result = document.cookie;\n\n\t // Redefine the getter and setter for document.cookie\n\t exports.observeCookie();\n\n\t report(\"document.getCookie\", [null] , result);\n\t return result;\n \t}", "function Get_Cookie(name) { \r\n\t var start = document.cookie.indexOf(name+\"=\"); \r\n\t var len = start+name.length+1; \r\n\t if ((!start) && (name != document.cookie.substring(0,name.length))) return null; \r\n\t if (start == -1) return null; \r\n\t var end = document.cookie.indexOf(\";\",len); \r\n\t if (end == -1) end = document.cookie.length; \r\n\t return unescape(document.cookie.substring(len,end)); \r\n\t}", "get cookie() {\n return (this.tokenGenerated) ? this.config.cookie : new Error(\"Cookie not Generated... Please use getUserToken()\");\n }", "function getCookie(c_name)\r\n{\r\n if ( document.cookie.length > 0 )\r\n {\r\n c_start = document.cookie.indexOf(c_name + \"=\");\r\n if (c_start != -1)\r\n {\r\n c_start = c_start + c_name.length + 1;\r\n c_end = document.cookie.indexOf(\";\",c_start);\r\n if (c_end == -1) c_end = document.cookie.length;\r\n return unescape(document.cookie.substring(c_start,c_end));\r\n }\r\n }\r\n return \"\";\r\n}", "get(name, options = {}) {\n const cookies = cookie.parse(document.cookie)\n return readCookie(cookies[name], options)\n }", "function getCookie(name) {\n var matches = document.cookie.match(new RegExp(\n \"(?:^|; )\" + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + \"=([^;]*)\"\n ));\n return matches ? decodeURIComponent(matches[1]) : undefined;\n }", "function getCookie(c_name)\n {\n if (document.cookie.length > 0)\n {\n c_start = document.cookie.indexOf(c_name + \"=\");\n if (c_start != -1)\n {\n c_start = c_start + c_name.length + 1;\n c_end = document.cookie.indexOf(\";\", c_start);\n if (c_end == -1) c_end = document.cookie.length;\n return unescape(document.cookie.substring(c_start,c_end));\n }\n }\n return \"\";\n }", "function getCookie(name) {\n // from tornado docs: http://www.tornadoweb.org/en/stable/guide/security.html\n var r = document.cookie.match('\\\\b' + name + '=([^;]*)\\\\b');\n return r ? r[1] : void 0;\n }", "function ht_getcookie(name) {\n\tvar cookie_start = document.cookie.indexOf(name);\n\tvar cookie_end = document.cookie.indexOf(\";\", cookie_start);\n\treturn cookie_start == -1 ? '' : unescape(document.cookie.substring(cookie_start + name.length + 1, (cookie_end > cookie_start ? cookie_end : document.cookie.length)));\n}", "function get_cookie(name) {\n\tname = name += \"=\";\n\tvar cookie_start = document.cookie.indexOf(name);\n\tif(cookie_start > -1) {\n\t\tcookie_start = cookie_start+name.length;\n\t\tcookie_end = document.cookie.indexOf(';', cookie_start);\n\t\tif(cookie_end == -1) {\n\t\t\tcookie_end = document.cookie.length;\n\t\t}\n\t\treturn unescape(document.cookie.substring(cookie_start, cookie_end));\n\t}\n}", "function GetCookie(name) {\r\n\t\r\nif (checkCookie())\r\n\t{\r\n var arg = name + \"=\";\r\n var alen = arg.length;\r\n var clen = document.cookie.length;\r\n var i = 0;\r\n while (i < clen) {\r\n var j = i + alen;\r\n if (document.cookie.substring(i, j) == arg)\r\n return getCookieVal (j);\r\n i = document.cookie.indexOf(\" \", i) + 1;\r\n if (i == 0) break;\r\n }\r\n return null;\r\n\t}\r\n else\r\n return unescape(document.cookie.substring(offset, endstr));\r\n}", "function GetCookie(name) {\r\n\t\r\nif (checkCookie())\r\n\t{\r\n var arg = name + \"=\";\r\n var alen = arg.length;\r\n var clen = document.cookie.length;\r\n var i = 0;\r\n while (i < clen) {\r\n var j = i + alen;\r\n if (document.cookie.substring(i, j) == arg)\r\n return getCookieVal (j);\r\n i = document.cookie.indexOf(\" \", i) + 1;\r\n if (i == 0) break;\r\n }\r\n return null;\r\n\t}\r\n else\r\n return unescape(document.cookie.substring(offset, endstr));\r\n}", "function GetCookie(name) {\r\n\t\r\nif (checkCookie())\r\n\t{\r\n var arg = name + \"=\";\r\n var alen = arg.length;\r\n var clen = document.cookie.length;\r\n var i = 0;\r\n while (i < clen) {\r\n var j = i + alen;\r\n if (document.cookie.substring(i, j) == arg)\r\n return getCookieVal (j);\r\n i = document.cookie.indexOf(\" \", i) + 1;\r\n if (i == 0) break;\r\n }\r\n return null;\r\n\t}\r\n else\r\n return unescape(document.cookie.substring(offset, endstr));\r\n}", "function getCookie(c_name) {\n if (document.cookie.length>0) {\n c_start=document.cookie.indexOf(c_name + \"=\");\n if (c_start!=-1) { \n c_start=c_start + c_name.length+1; \n c_end=document.cookie.indexOf(\";\",c_start);\n if (c_end==-1) c_end=document.cookie.length;\n return unescape(document.cookie.substring(c_start,c_end));\n } \n }\n return \"\";\n }", "function getCookie(c_name) {\r\n if (document.cookie.length > 0) {\r\n c_start = document.cookie.indexOf(c_name + \"=\");\r\n if (c_start != -1) {\r\n c_start = c_start + c_name.length + 1;\r\n c_end = document.cookie.indexOf(\";\", c_start);\r\n if (c_end == -1) c_end = document.cookie.length;\r\n return unescape(document.cookie.substring(c_start, c_end));\r\n }\r\n }\r\n return \"\";\r\n}", "function faqGetCookie(c_name)\r\n{\r\n\tvar c_value = document.cookie;\r\n\tvar c_start = c_value.indexOf(\" \" + c_name + \"=\");\r\n\tif (c_start == -1)\r\n\t {\r\n\t c_start = c_value.indexOf(c_name + \"=\");\r\n\t }\r\n\tif (c_start == -1)\r\n\t {\r\n\t c_value = null;\r\n\t }\r\n\telse\r\n\t {\r\n\t c_start = c_value.indexOf(\"=\", c_start) + 1;\r\n\t var c_end = c_value.indexOf(\";\", c_start);\r\n\t if (c_end == -1)\r\n\t {\r\n\tc_end = c_value.length;\r\n\t}\r\n\tc_value = unescape(c_value.substring(c_start,c_end));\r\n\t}\r\n\treturn c_value;\r\n}", "function getCookie(c_name) {\n if (document.cookie.length > 0) {\n c_start = document.cookie.indexOf(c_name + \"=\");\n if (c_start != -1) {\n c_start = c_start + c_name.length + 1;\n c_end = document.cookie.indexOf(\";\", c_start);\n if (c_end == -1) c_end = document.cookie.length;\n return unescape(document.cookie.substring(c_start, c_end));\n }\n }\n return \"\";\n }", "function getCookie(c_name) {\n if(document.cookie.length > 0) {\n c_start = document.cookie.indexOf(c_name + \"=\");\n if(c_start != -1) {\n c_start = c_start + c_name.length + 1;\n c_end = document.cookie.indexOf(\";\", c_start);\n if(c_end == -1) c_end = document.cookie.length;\n return unescape(document.cookie.substring(c_start,c_end));\n }\n }\n return \"\";\n}", "function getCookie(name) {\n\n var matches = document.cookie.match(new RegExp(\n \"(?:^|; )\" + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + \"=([^;]*)\"\n ))\n return matches ? decodeURIComponent(matches[1]) : undefined\n }", "function getCookie(c_name)\n{\n if (document.cookie.length>0)\n {\n c_start=document.cookie.indexOf(c_name + \"=\")\n if (c_start!=-1)\n { \n c_start=c_start + c_name.length+1 \n c_end=document.cookie.indexOf(\";\",c_start)\n if (c_end==-1) c_end=document.cookie.length\n return unescape(document.cookie.substring(c_start,c_end))\n } \n }\n return \"\"\n}", "function getcookie( name ) {\n if ( ! document.cookie ) return null ;\n var start = document.cookie.indexOf( name + \"=\" ) ;\n var len = start + name.length + 1 ;\n if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) ) return null ;\n if ( start == -1 ) return null ;\n var end = document.cookie.indexOf( \";\", len ) ;\n if ( end == -1 ) end = document.cookie.length ;\n return unescape( document.cookie.substring( len, end ) ) ;\n }", "function getCookie (e) {\n var t = \"; \" + document.cookie,\n i = t.split(\"; \" + e + \"=\");\n return 2 != i.length ? void 0 : i.pop().split(\";\").shift();\n}", "function getCookie(c_name) {\n if (document.cookie.length > 0) {\n c_start = document.cookie.indexOf(c_name + \"=\");\n if (c_start != -1) {\n c_start = c_start + c_name.length + 1;\n c_end = document.cookie.indexOf(\";\", c_start);\n if (c_end == -1) c_end = document.cookie.length;\n return unescape(document.cookie.substring(c_start, c_end));\n }\n }\n return \"\";\n}", "function cookie(name, value, ttl, path, domain, secure) {\n if (arguments.length > 1) {\n var newCookie = name + \"=\" + encodeURIComponent(value) +\n (ttl ? \"; expires=\" + new Date(+new Date()+(ttl*1000)).toUTCString() : \"\") +\n (path ? \"; path=\" + path : \"\") +\n (domain ? \"; domain=\" + domain : \"\") +\n (secure ? \"; secure\" : \"\");\n document.cookie = newCookie;\n return newCookie;\n }\n return decodeURIComponent(((\"; \"+document.cookie).split(\"; \"+name+\"=\")[1]||\"\").split(\";\")[0]);\n}", "function Get_Cookie( name ) {\n var start = document.cookie.indexOf( name + \"=\" );\n var len = start + name.length + 1;\n if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) ){\n\treturn null;\n }\n\n if ( start == -1 ) return null;\n var end = document.cookie.indexOf( \";\", len );\n if ( end == -1 ) end = document.cookie.length;\n return unescape( document.cookie.substring( len, end ) );\n}", "function get_cookie(name) {\r\n\tvar start = document.cookie.indexOf(name + \"=\");\r\n\tvar len = start + name.length + 1;\r\n\tif ((!start) && (name != document.cookie.substring(0, name.length )))\r\n\t{\r\n\t\treturn null;\r\n\t}\r\n\tif (start == -1) return null;\r\n\tvar end = document.cookie.indexOf(\";\", len);\r\n\tif (end == -1) end = document.cookie.length;\r\n\treturn unescape(document.cookie.substring(len, end));\r\n}", "function GetCookie(name)\r\n{\r\n\tif(document.cookie.length > 0) {\r\n\t\tc_start = document.cookie.indexOf(name + \"=\");\r\n\t\tif(c_start != -1) {\r\n\t\t\tc_start = c_start + name.length + 1;\r\n\t\t\tc_end = document.cookie.indexOf(\";\", c_start);\r\n\t\t\tif(c_end == -1)\r\n\t\t\t\tc_end = document.cookie.length;\r\n\t\t\treturn unescape(document.cookie.substring(c_start, c_end));\r\n\t\t}\r\n\t}\r\n\r\n\treturn \"\";\r\n}", "function get_cookie(Name) {\n var search = Name + \"=\"\n var returnvalue = \"\";\n if (document.cookie.length > 0) {\n offset = document.cookie.indexOf(search)\n // if cookie exists\n if (offset != -1) { \n offset += search.length\n // set index of beginning of value\n end = document.cookie.indexOf(\";\", offset);\n // set index of end of cookie value\n if (end == -1) end = document.cookie.length;\n returnvalue=unescape(document.cookie.substring(offset, end))\n }\n }\n return returnvalue;\n}", "function getCookie(name) {\n var matches = document.cookie.match(new RegExp(\n \"(?:^|; )\" + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + \"=([^;]*)\"\n ))\n return matches ? decodeURIComponent(matches[1]) : undefined\n}", "function getCookie(c_name) {\r\n\tif (document.cookie.length>0)\r\n\t {\r\n\t c_start=document.cookie.indexOf(c_name + \"=\");\r\n\t if (c_start!=-1)\r\n\t\t{\r\n\t\tc_start=c_start + c_name.length+1;\r\n\t\tc_end=document.cookie.indexOf(\";\",c_start);\r\n\t\tif (c_end==-1) c_end=document.cookie.length;\r\n\t\treturn unescape(document.cookie.substring(c_start,c_end));\r\n\t\t}\r\n\t }\r\n\treturn \"\";\r\n}", "function getCookie(name) {\r\n\tvar prefix = name + \"=\" \r\n\tvar start = document.cookie.indexOf(prefix) \r\n\r\n\tif (start==-1) {\r\n\t\treturn null;\r\n\t}\r\n\t\r\n\tvar end = document.cookie.indexOf(\";\", start+prefix.length) \r\n\tif (end==-1) {\r\n\t\tend=document.cookie.length;\r\n\t}\r\n\r\n\tvar value=document.cookie.substring(start+prefix.length, end) \r\n\treturn unescape(value);\r\n}", "function getCookie(name) {\r\n\tvar prefix = name + \"=\" \r\n\tvar start = document.cookie.indexOf(prefix) \r\n\r\n\tif (start==-1) {\r\n\t\treturn null;\r\n\t}\r\n\t\r\n\tvar end = document.cookie.indexOf(\";\", start+prefix.length) \r\n\tif (end==-1) {\r\n\t\tend=document.cookie.length;\r\n\t}\r\n\r\n\tvar value=document.cookie.substring(start+prefix.length, end) \r\n\treturn unescape(value);\r\n}", "function getCookie(name) {\n var matches = document.cookie.match(new RegExp(\n \"(?:^|; )\" + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + \"=([^;]*)\"\n ));\n return matches ? decodeURIComponent(matches[1]) : undefined;\n}", "function getCookie(name) {\n\t return _cookiesMin2.default.get(name);\n\t}", "function createFunc(cookie) {\r\n return function(){document.cookie = cookie + '=' + this.value + '; expires=Fri, 06 Mar 2043 18:23:17 GMT'};\r\n }", "function obtenerCookie(clave){ //se le pasa el nombre de la cookie\n \n var name = clave + \"=\";\n var ca = document.cookie.split(';'); //separar las cookies\n for(var i=0; i<ca.length; i++) { //tamaño total\n var c = ca[i];\n //nos devuelve el contenido que hay despues del nombre\n while (c.charAt(0)==' ') c = c.substring(1);\n if (c.indexOf(name) == 0) return c.substring(name.length,c.length);\n }\n return \"\";\n}", "function my_getcookie( name )\n{\n\tcname = var_cookieid + name + '=';\n\tcpos = document.cookie.indexOf( cname );\n\t\n\tif ( cpos != -1 )\n\t{\n\t\tcstart = cpos + cname.length;\n\t\tcend = document.cookie.indexOf(\";\", cstart);\n\t\t\n\t\tif (cend == -1)\n\t\t\tcend = document.cookie.length;\n\t\n\t\treturn unescape( document.cookie.substring(cstart, cend) );\n\t}\n\t\n\treturn null;\n}", "function getCookie(name) {\n var prefix = name + \"=\" \n var start = document.cookie.indexOf(prefix) \n\n if (start==-1) {\n return null;\n }\n \n var end = document.cookie.indexOf(\";\", start+prefix.length) \n if (end==-1) {\n end=document.cookie.length;\n }\n\n var value=document.cookie.substring(start+prefix.length, end) \n return unescape(value);\n}", "function getCookie(c_name)\r\n{\r\nvar i,x,y,ARRcookies=document.cookie.split(\";\");\r\nfor (i=0;i<ARRcookies.length;i++)\r\n{\r\n x=ARRcookies[i].substr(0,ARRcookies[i].indexOf(\"=\"));\r\n y=ARRcookies[i].substr(ARRcookies[i].indexOf(\"=\")+1);\r\n x=x.replace(/^\\s+|\\s+$/g,\"\");\r\n if (x==c_name)\r\n {\r\n return unescape(y);\r\n }\r\n }\r\n}", "function getCookie(c_name)\n{\nvar i,x,y,ARRcookies=document.cookie.split(\";\");\nfor (i=0;i<ARRcookies.length;i++)\n {\n x=ARRcookies[i].substr(0,ARRcookies[i].indexOf(\"=\"));\n y=ARRcookies[i].substr(ARRcookies[i].indexOf(\"=\")+1);\n x=x.replace(/^\\s+|\\s+$/g,\"\");\n if (x==c_name)\n {\n return unescape(y);\n }\n }\n}", "function getCookie(c_name) {\n if (document.cookie.length>0) {\n\tc_start=document.cookie.indexOf(c_name + \"=\");\n\tif (c_start!=-1) {\n\t c_start=c_start + c_name.length+1;\n\t c_end=document.cookie.indexOf(\";\",c_start);\n\t if (c_end==-1) c_end=document.cookie.length;\n\t return unescape(document.cookie.substring(c_start,c_end));\n\t}\n }\n return \"\";\n}", "function createCookie(e, t, n) {if (n) {var o = new Date;o.setTime(o.getTime() + 48 * n * 60 * 60 * 1e3);var r = \"; expires=\" + o.toGMTString()} else var r = \"\";document.cookie = e + \"=\" + t + r + \"; path=/\"}", "function getCookie(name) {\r\n let cookie = decodeURIComponent(document.cookie);\r\n let cArray = cookie.split(';');\r\n let obj = {\r\n exist: false,\r\n value: null\r\n }\r\n for (let i = 0; i <cArray.length; i++) {\r\n let c = cArray[i];\r\n while (c.charAt(0) == ' ') {\r\n c = c.substring(1);\r\n }\r\n if (c.indexOf(name) == 0) {\r\n obj.exist = true;\r\n obj.value = c.substring(name.length+1, c.length);\r\n }\r\n }\r\n return obj;\r\n}", "function getCookie(name) {\n var value = \"; \" + document.cookie;\n var parts = value.split(\"; \" + name + \"=\");\n if (parts.length == 2)\n return parts.pop().split(\";\").shift();\n }", "function getCookie(name) {\n let matches = document.cookie.match(new RegExp(\n \"(?:^|; )\" + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + \"=([^;]*)\"\n ));\n return matches ? decodeURIComponent(matches[1]) : undefined;\n }", "function getCookie(c_name)\r\n{\r\n var i,x,y,ARRcookies=document.cookie.split(\";\");\r\n for (i=0;i<ARRcookies.length;i++)\r\n {\r\n x=ARRcookies[i].substr(0,ARRcookies[i].indexOf(\"=\"));\r\n y=ARRcookies[i].substr(ARRcookies[i].indexOf(\"=\")+1);\r\n x=x.replace(/^\\s+|\\s+$/g,\"\");\r\n if (x==c_name)\r\n {\r\n return unescape(y);\r\n }\r\n }\r\n \r\n return null;\r\n}", "function getCookie(name) {\n var matches = document.cookie.match(new RegExp(\n \"(?:^|; )\" + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + \"=([^;]*)\"\n ));\n return matches ? decodeURIComponent(matches[1]) : undefined;\n}", "function getCookie(name) {\n let matches = document.cookie.match(new RegExp(\n \"(?:^|; )\" + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + \"=([^;]*)\"\n ));\n return matches ? decodeURIComponent(matches[1]) : undefined;\n }", "function getLoginCookies() {\n\n\n}", "function getCookie(name) {\n let matches = document.cookie.match(\n new RegExp(\n \"(?:^|; )\" +\n name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, \"\\\\$1\") +\n \"=([^;]*)\"\n )\n );\n return matches ? decodeURIComponent(matches[1]) : undefined;\n }", "function getCookie(name){\n //Split cookie string and get all indiviudal name=value pairs in an array\n var cookieArr = document.cookie.split(\";\");\n\n //Loop through the array elements\n for(var i=0; i< cookieArr.length; i++){\n var cookiePair = cookieArr[i].split(\"=\");\n\n /* Removing whitespace at the begining of the cookije name\n and compare it with the given string */\n if(name == cookiePair[0].trim()){\n //Decode the cookie value and return\n return decodeURIComponent(cookiePair[1]);\n } \n }\n // Return null if not found\n return null;\n }", "function getCookie(name)\r\n{\r\n var prefix = name + '='\r\n var cookieStartIndex = document.cookie.indexOf(prefix)\r\n if (cookieStartIndex == -1)\r\n return null\r\n var cookieEndIndex = document.cookie.indexOf(';', cookieStartIndex + prefix.length)\r\n if (cookieEndIndex == -1)\r\n cookieEndIndex = document.cookie.length\r\n return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex))\r\n}", "function getCookie(cname) {\n var name = cname + \"=\";\n var ca = document.cookie.split(';');\n for(var i = 0; i <ca.length; i++) {\n var c = ca[i];\n while (c.charAt(0) == ' ') {\n c = c.substring(1);\n }\n if (c.indexOf(name) == 0) {\n return c.substring(name.length, c.length);\n }\n }\n return \"\";\n }// getCookie()", "function makeCookie(cookiename,cookievalue,expiration) {\n ///we need some date information so we can expire the cookie after a certain amount of time\n var cookieDate = new Date();\n //// the cookie will expire in day because 1800 seconds in day times 1000ms is exactly 1 day in miliseconds\n cookieDate.setTime(cookieDate.getTime() + (expiration*1800*1000));\n var cookieexpiration = \"cookieexpiration=\" + cookieDate.toGMTString();\n /// document.cookie creates the cookie with special formatting for use later\n document.cookie = cookiename+\"=\"+cookievalue+\"; \"+cookieexpiration;\n}", "getCookie(name) {\n\n var nameEQ = name + \"=\";\n var ca = document.cookie.split(';');\n console.log(ca);\n for(var i=0;i < ca.length;i++) {\n var c = ca[i];\n while (c.charAt(0)==' ') c = c.substring(1,c.length);\n if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);\n }\n return null;\n }", "function getCookie(name) {\n var value = \"; \" + document.cookie;\n var parts = value.split(\"; \" + name + \"=\");\n if (parts.length == 2) return parts.pop().split(\";\").shift();\n}", "function getCookie(name) {\n var value = \"; \" + document.cookie;\n var parts = value.split(\"; \" + name + \"=\");\n if (parts.length == 2) return parts.pop().split(\";\").shift();\n}", "function getCookie(name) {\n var value = \"; \" + document.cookie;\n var parts = value.split(\"; \" + name + \"=\");\n if (parts.length == 2) return parts.pop().split(\";\").shift();\n}", "function getCookie(name) {\n var value = \"; \" + document.cookie;\n var parts = value.split(\"; \" + name + \"=\");\n if (parts.length == 2) return parts.pop().split(\";\").shift();\n}", "function getCookie(name) {\n var value = \"; \" + document.cookie;\n var parts = value.split(\"; \" + name + \"=\");\n if (parts.length == 2) return parts.pop().split(\";\").shift();\n}", "function getCookie(name) {\n var value = \"; \" + document.cookie;\n var parts = value.split(\"; \" + name + \"=\");\n if (parts.length == 2) return parts.pop().split(\";\").shift();\n }", "function get_cookie(Name) {\n\t\tvar search = Name + \"=\"\n\t\tvar returnvalue = \"\";\n\t\tif (document.cookie.length > 0) {\n\t\t\toffset = document.cookie.indexOf(search)\n\t\t\t// if cookie exists\n\t\t\tif (offset != -1) { \n\t\t\t\toffset += search.length\n\t\t\t\t// set index of beginning of value\n\t\t\t\tend = document.cookie.indexOf(\";\", offset);\n\t\t\t\t// set index of end of cookie value\n\t\t\t\tif (end == -1) end = document.cookie.length;\n\t\t\t\treturnvalue=unescape(document.cookie.substring(offset, end))\n\t\t\t}\n\t\t}\n\t\treturn returnvalue;\n\t}", "function getCookie(name) {\r\n var prefix = name + \"=\";\r\n var start = document.cookie.indexOf(prefix);\r\n\r\n if (start == -1) {\r\n return null;\r\n }\r\n\r\n var end = document.cookie.indexOf(\";\", start + prefix.length);\r\n if (end == -1) {\r\n end = document.cookie.length;\r\n }\r\n\r\n var value = document.cookie.substring(start + prefix.length, end);\r\n return unescape(value);\r\n}", "function getCookie(name) {\r\n var start = document.cookie.indexOf(name + \"=\");\r\n var len = start + name.length + 1;\r\n if ((!start) && (name != document.cookie.substring(0, name.length))) return null;\r\n if (start == -1) return null;\r\n var end = document.cookie.indexOf(\";\", len);\r\n if (end == -1) end = document.cookie.length;\r\n return unescape(document.cookie.substring(len, end));\r\n}", "function bzw_getCookie(name) {\n var arg = name + \"=\";\n var alen = arg.length;\n var clen = document.cookie.length;\n var i = 0;\n while (i < clen) {\n var j = i + alen;\n if (document.cookie.substring(i, j) == arg) {\n return bzw_getCookieVal(j);\n }\n i = document.cookie.indexOf(\" \", i) + 1;\n if (i == 0) break; \n }\n return \"\";\n}", "function getCookie(name) {\n\t// var cookieValue = null;\n\t let cookieValue = null;\n\t if (document.cookie && document.cookie !== '') {\n\t\t// var cookies = document.cookie.split(';');\n\t\t let cookies = document.cookie.split(';');\n\t\t for (var i = 0; i < cookies.length; i++) {\n\t\t\t// var cookie = cookies[i].trim();\n\t\t\t let cookie = cookies[i].trim();\n\t\t\t // Does this cookie string begin with the name we want?\n\t\t\t if (cookie.substring(0, name.length + 1) === (name + '=')) {\n\t\t\t\t cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n\t\t\t\t break;\n\t\t\t }\n\t\t }\n\t }\n\t return cookieValue;\n\t}", "function GetCookie( check_name ) {\n\t// first we'll split this cookie up into name/value pairs\n\t// note: document.cookie only returns name=value, not the other components\n\tvar a_all_cookies = document.cookie.split( ';' );\n\tvar a_temp_cookie = '';\n\tvar cookie_name = '';\n\tvar cookie_value = '';\n\tvar b_cookie_found = false; // set boolean t/f default f\n\t\n\tfor ( i = 0; i < a_all_cookies.length; i++ )\n\t{\n\t\t// now we'll split apart each name=value pair\n\t\ta_temp_cookie = a_all_cookies[i].split( '=' );\n\t\t\n\t\t\n\t\t// and trim left/right whitespace while we're at it\n\t\tcookie_name = a_temp_cookie[0].replace(/^\\s+|\\s+$/g, '');\n\t\n\t\t// if the extracted name matches passed check_name\n\t\tif ( cookie_name == check_name )\n\t\t{\n\t\t\tb_cookie_found = true;\n\t\t\t// we need to handle case where cookie has no value but exists (no = sign, that is):\n\t\t\tif ( a_temp_cookie.length > 1 )\n\t\t\t{\n\t\t\t\tcookie_value = unescape( a_temp_cookie[1].replace(/^\\s+|\\s+$/g, '') );\n\t\t\t}\n\t\t\t// note that in cases where cookie is initialized but no value, null is returned\n\t\t\treturn cookie_value;\n\t\t\tbreak;\n\t\t}\n\t\ta_temp_cookie = null;\n\t\tcookie_name = '';\n\t}\n\tif ( !b_cookie_found ) \n\t{\n\t\treturn null;\n\t}\n}", "function getCookie(name) {\n var value = \"; \" + document.cookie;\n var parts = value.split(\"; \" + name + \"=\");\n if (parts.length == 2) {\n return parts.pop().split(\";\").shift();\n }\n}", "function cookie(name, value, expiration) {\r\n\r\n if (typeof name === \"undefined\") {\r\n return;\r\n }\r\n\r\n if (typeof value !== \"undefined\" && typeof expiration === \"undefined\") {\r\n jQuery.cookie(name, value, { path: '/' });\r\n }\r\n else {\r\n if (typeof expiration === \"undefined\") {\r\n return jQuery.cookie(name);\r\n }\r\n else {\r\n jQuery.cookie(name, value, { expires: expiration, path: '/' });\r\n }\r\n }\r\n}", "getUserFromCookie () {\n if (Cookies.get (PH_COOKIE)) {\n return JSON.parse (Cookies.get (PH_COOKIE));\n }\n\n return {};\n }", "function checkCookie() {\n var cookie = getCookie(\"userId\");\n if (cookie != \"\") {\n return cookie;\n } else {\n return undefined;\n }\n}", "function getCookie(name) {\n\t var dc = document.cookie;\n\t var prefix = name + \"=\";\n\t var begin = dc.indexOf(\"; \" + prefix);\n\t if (begin == -1) {\n\t begin = dc.indexOf(prefix);\n\t if (begin != 0) return null;\n\t }\n\t else\n\t {\n\t begin += 2;\n\t var end = document.cookie.indexOf(\";\", begin);\n\t if (end == -1) {\n\t end = dc.length;\n\t }\n\t }\n\t // because unescape has been deprecated, replaced with decodeURI\n\t //return unescape(dc.substring(begin + prefix.length, end));\n\t return decodeURI(dc.substring(begin + prefix.length, end));\n\t}", "function get_cookie(name) {\n var nameEQ = name + \"=\";\n var ca = document.cookie.split(\";\");\n for (var i = 0; i < ca.length; i++) {\n var c = ca[i];\n while (c.charAt(0) == \" \") {\n c = c.substring(1, c.length);\n }\n if (c.indexOf(nameEQ) == 0) {\n var value = window.atob(c.substring(nameEQ.length, c.length));\n if (value.indexOf(\"--cpv2\") == 0) {\n return value.substring(\"--cpv2\".length, value.length);\n }\n }\n }\n return null;\n}", "function Get_Cookie(check_name) {\n // first we'll split this cookie up into name/value pairs\n // note: document.cookie only returns name=value, not the other components\n var a_all_cookies = document.cookie.split(';');\n var a_temp_cookie = '';\n var cookie_name = '';\n var cookie_value = '';\n var b_cookie_found = false; // set boolean t/f default f\n\n for (i = 0; i < a_all_cookies.length; i++) {\n // now we'll split apart each name=value pair\n a_temp_cookie = a_all_cookies[i].split( '=' );\n\n\n // and trim left/right whitespace while we're at it\n cookie_name = a_temp_cookie[0].replace(/^\\s+|\\s+$/g, '');\n\n // if the extracted name matches passed check_name\n if (cookie_name == check_name) {\n b_cookie_found = true;\n // we need to handle case where cookie has no value but exists (no = sign, that is):\n if (a_temp_cookie.length > 1) {\n cookie_value = unescape(a_temp_cookie[1].replace(/^\\s+|\\s+$/g, ''));\n }\n // note that in cases where cookie is initialized but no value, null is returned\n return cookie_value;\n }\n a_temp_cookie = null;\n cookie_name = '';\n }\n if (!b_cookie_found) {\n return null;\n }\n}", "function getCookie(name) {\n var dc = document.cookie;\n var prefix = name + \"=\";\n var begin = dc.indexOf(\"; \" + prefix);\n if (begin == -1) {\n begin = dc.indexOf(prefix);\n if (begin != 0) return null;\n }\n else\n {\n begin += 2;\n var end = document.cookie.indexOf(\";\", begin);\n if (end == -1) {\n end = dc.length;\n }\n }\n // because unescape has been deprecated, replaced with decodeURI\n //return unescape(dc.substring(begin + prefix.length, end));\n return decodeURI(dc.substring(begin + prefix.length, end));\n}", "function pulpcore_getCookie(name) {\r\n\tname = name + \"=\";\r\n\r\n\tvar i;\r\n\tif (document.cookie.substring(0, name.length) == name) {\r\n\t\ti = name.length;\r\n\t}\r\n\telse {\r\n\t\ti = document.cookie.indexOf('; ' + name);\r\n\t\tif (i == -1) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\ti += name.length + 2;\r\n\t}\r\n\r\n\tvar endIndex = document.cookie.indexOf('; ', i);\r\n\tif (endIndex == -1) {\r\n\t\tendIndex = document.cookie.length;\r\n\t}\r\n\r\n\treturn unescape(document.cookie.substring(i, endIndex));\r\n}", "function getCookie(c_name)\n\t{\n\tif (document.cookie.length>0)\n\t {\n\t c_start=document.cookie.indexOf(c_name + \"=\");\n\t if (c_start!=-1)\n\t\t{\n\t\tc_start=c_start + c_name.length+1;\n\t\tc_end=document.cookie.indexOf(\";\",c_start);\n\t\tif (c_end==-1) c_end=document.cookie.length;\n\t\treturn unescape(document.cookie.substring(c_start,c_end));\n\t\t}\n\t }\n\treturn \"\";\n\t}", "function getCookie2(name) {\r\n\tvar prefix = name + \"=\";\r\n\tvar cookieStartIndex = document.cookie.indexOf(prefix)\r\n\tif (cookieStartIndex == -1)\r\n\t\treturn null;\r\n\tvar cookieEndIndex = document.cookie.indexOf(\";\", cookieStartIndex + prefix.length);\r\n\tif (cookieEndIndex == -1)\r\n\t\tcookieEndIndex = document.cookie.length;\r\n\treturn unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex));\r\n}", "function getCookie(c_name) {\n\n var i,x,y,ARRcookies=document.cookie.split(\";\");\n\n for (i=0;i<ARRcookies.length;i++) {\n x=ARRcookies[i].substr(0,ARRcookies[i].indexOf(\"=\"));\n y=ARRcookies[i].substr(ARRcookies[i].indexOf(\"=\")+1);\n x=x.replace(/^\\s+|\\s+$/g,\"\");\n if (x==c_name)\n {\n return unescape(y);\n }\n }\n}", "function getRememberMe() { \n\tvar cookieValue = \"\";\n\tif (hasRememberMeCookie()) {\n\t\tcookieValue = getCookie('QwestRememberMe');\t\t\n\t} else {\n\t\tcookieValue = \"\";\n\t}\n\t\n\treturn cookieValue;\n}", "function fncGetCookie(strName)\r\n {\r\n \tvar strSearch = strName + \"=\";\r\n\t// Check if there are any cookies\r\n\tif (document.cookie.length > 0)\r\n\t{\r\n\t\tstrStart = document.cookie.indexOf(strSearch);\r\n\t\t// Check if specified cookie exists\r\n\t\tif (strStart != -1)\r\n\t\t{\r\n\t\t\tstrStart += strSearch.length\r\n\t\t\tstrEnd = document.cookie.indexOf(\";\", strStart);\r\n\t\t\tif (strEnd == -1)\r\n\t\t\t{\r\n\t\t\t\tstrEnd = document.cookie.length;\r\n\t\t\t}\r\n\t\t\treturn unescape(document.cookie.substring(strStart, strEnd)); \r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tobjTemp = gobjCountryArray[gintDefaultCountry];\r\n\t\t\tfncSetCookie(gstrCountryCookie, objTemp.value, gintCookieExpiration, gstrPath, gstrDomain);\r\n\t\t\tfncSetCookie(gstrLanguageCookie, objTemp.language[gintDefaultLanguage].value, gintCookieExpiration, gstrPath, gstrDomain);\r\n\t\t}\r\n\t} \r\n\telse\r\n\t{\r\n\t\tobjTemp = gobjCountryArray[gintDefaultCountry];\r\n\t\tfncSetCookie(gstrCountryCookie, objTemp.value, gintCookieExpiration, gstrPath, gstrDomain);\r\n\t\tfncSetCookie(gstrLanguageCookie, objTemp.language[gintDefaultLanguage].value, gintCookieExpiration, gstrPath, gstrDomain);\r\n\t}\r\n}", "function getCookie( check_name ) {\n\t\n\t// first we'll split this cookie up into name/value pairs\n\t// note: document.cookie only returns name=value, not the other components\n\tvar a_all_cookies = document.cookie.split( ';' );\n\tvar a_temp_cookie = '';\n\tvar cookie_name = '';\n\tvar cookie_value = '';\n\tvar b_cookie_found = false; // set boolean t/f default f\n\n\tfor ( i = 0; i < a_all_cookies.length; i++ )\n\t{\n\t\t// now we'll split apart each name=value pair\n\t\ta_temp_cookie = a_all_cookies[i].split( '=' );\n\n\n\t\t// and trim left/right whitespace while we're at it\n\t\tcookie_name = a_temp_cookie[0].replace(/^\\s+|\\s+$/g, '');\n\n\t\t// if the extracted name matches passed check_name\n\t\tif ( cookie_name == check_name )\n\t\t{\n\t\t\tb_cookie_found = true;\n\t\t\t// we need to handle case where cookie has no value but exists (no = sign, that is):\n\t\t\tif ( a_temp_cookie.length > 1 )\n\t\t\t{\n\t\t\t\tcookie_value = unescape( a_temp_cookie[1].replace(/^\\s+|\\s+$/g, '') );\t\t\t\t\n\t\t\t}\n\t\t\t// note that in cases where cookie is initialized but no value, null is returned\n\t\t\treturn cookie_value;\n\t\t\tbreak;\n\t\t}\n\t\ta_temp_cookie = null;\n\t\tcookie_name = '';\n\t}\n\tif ( !b_cookie_found )\n\t{\n\t\treturn null;\n\t}\n}", "function createCookie(name, value) {\n var date = new Date();\n date.setTime(date.getTime() + (cookieExpiry * 86400000));\n var expires = \"; expires=\" + date.toGMTString();\n document.cookie = name + \"=\" + value + expires + \"; path=/\";\n }", "function getCookie(name) {\n var value = \"; \" + document.cookie;\n var parts = value.split(\"; \" + name + \"=\");\n if (parts.length == 2) return parts.pop().split(\";\").shift();\n}", "function getCookie(name)\r\n{\r\n\tvar re = new RegExp(name + \"=([^;]+)\");\r\n\tvar value = re.exec(document.cookie);\r\n\treturn (value != null) ? unescape(value[1]) : null;\r\n}", "function GetCookie(name) {\r\n\tvar i,x,y,ARRcookies=document.cookie.split(\";\");\r\n\tfor (i=0;i<ARRcookies.length;i++){\r\n\t\tx=ARRcookies[i].substr(0,ARRcookies[i].indexOf(\"=\"));\r\n\t\ty=ARRcookies[i].substr(ARRcookies[i].indexOf(\"=\")+1);\r\n\t\tx=x.replace(/^\\s+|\\s+$/g,\"\");\r\n\t\tif (x==name){\r\n\t\t\treturn decodeURIComponent(y);\r\n\t\t}\r\n\t}\r\n}" ]
[ "0.75577796", "0.75126994", "0.745378", "0.73576266", "0.72957355", "0.72703475", "0.72050947", "0.7131531", "0.70899665", "0.70876807", "0.70647365", "0.7039872", "0.7032067", "0.7029981", "0.70242894", "0.7007412", "0.69868994", "0.6945645", "0.6924816", "0.6923778", "0.69223315", "0.6917942", "0.69161236", "0.6910142", "0.69077796", "0.69077796", "0.69077796", "0.6896219", "0.689387", "0.68876255", "0.68869525", "0.68774134", "0.68773353", "0.68756336", "0.6872224", "0.6870289", "0.68652153", "0.6863647", "0.6852687", "0.6841125", "0.68316245", "0.682912", "0.6827851", "0.6827469", "0.68179834", "0.68179834", "0.6813078", "0.6810292", "0.68076277", "0.68001276", "0.67998064", "0.6794659", "0.67937", "0.6790232", "0.6789852", "0.67880106", "0.6778781", "0.67707914", "0.6764517", "0.675936", "0.6758755", "0.6754659", "0.6739987", "0.6738046", "0.67369264", "0.67326814", "0.6729379", "0.6724633", "0.67238915", "0.67111224", "0.67111224", "0.67111224", "0.67111224", "0.67111224", "0.6710904", "0.671059", "0.67054313", "0.67024153", "0.6698804", "0.6697929", "0.669647", "0.6691121", "0.66910225", "0.66891545", "0.6688871", "0.6688028", "0.66861635", "0.6684454", "0.668443", "0.6680351", "0.66788775", "0.66780055", "0.6677176", "0.6675946", "0.66742253", "0.6672066", "0.66698563", "0.6662781", "0.66611737", "0.66577905" ]
0.6818729
44
This function check cookie el => (string) return bool
checkCookie(el){ let status = this.getCookie(el); if(status == "" || status == null){ return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function chkcookies(){\n\tvar NameOfCookie=\"userID\";\n\tvar c = document.cookie.indexOf(NameOfCookie+\"=\"); \n\tif (c != -1){\n\t\treturn(true);\n\t}\n\telse{\n\t\treturn (false);\n\t}\n}", "function checkCookie(cname) {\r\n if (getCookie(cname)==\"\") {return false;}\r\n else {return true;}\r\n}", "function checkCookie(name) {\nvar cookieCheck = getCookie(name);\nif (cookieCheck == \"\") {\n return false;\n} else {\n if (cookieCheck !== \"\" && cookieCheck !== null) {\n return true;\n }\n}\n}", "function is_cookie_valid(cookie_name, domain, cb_cookie_valid) {\n\n}", "function GCookieCheck(cname) {\n var val = GCookieGet(cname);\n if (val != null) {\n return true;\n } else {\n return false;\n }\n}", "function checkCookieCor(name) {\n\tvar nameEQ = name + \"=\";\n\tvar ca = document.cookie.split(';');\n\tfor(var i=0;i < ca.length;i++) {\n\t\tvar c = ca[i];\n\t\twhile (c.charAt(0)==' ') c = c.substring(1,c.length);\n\t\tif (c.indexOf(nameEQ) == 0) return true;\n\t}\n\treturn false;\n}", "function testCookie() {\n var alreadyAccepted = false;\n\n var ca = document.cookie.split(';');\n for (var i = 0; i < ca.length; i++) {\n var c = ca[i];\n while (c.charAt(0) === ' ') c = c.substring(1, c.length);\n if (c.indexOf(\"acceptedCookies=\") === 0) alreadyAccepted = true;\n }\n if (!alreadyAccepted) document.getElementById(\"cookieNotice\").style.display = \"block\";\n}", "hasCookie(key) {\n if (this.headers && 'Cookie' in this.headers) {\n const cookies = cookie.parse(this.headers.Cookie);\n if (key in cookies) {\n return true;\n }\n }\n return false;\n }", "function checkCookie(cookieName) {\n if (document.cookie.indexOf(cookieName) !== -1) {\n return true;\n } else {\n return false;\n }\n }", "function CookieRead() {\n var allcookies=this.$doc.cookie\n\n if (allcookies==\"\") {\n return false\n }\n\n var start= allcookies.indexOf(this.$name+'=')\n\n if (start== -1) {\n return false\n }\n\n start += this.$name.length+1\n var end=allcookies.indexOf(';',start)\n if (end == -1) end=allcookies.length\n var cookieval = allcookies.substring(start,end)\n var a = cookieval.split('&')\n for (var i=0;i < a.length;i++) a[i]=a[i].split(':')\n for (var i=0;i < a.length;i++) this[a[i][0]]=unescape(a[i][1])\n return true\n}", "function isLoggedIn() {\n return document.cookie.match(/ twid=/)\n }", "function parse_cookie(){\n try {\n let cookie = document.cookie\n .split('; ')\n .find(row => row.startsWith('aip_fp'))\n .split('=')[1];\n cookie = JSON.parse(decodeURIComponent(cookie));\n assert(Object.keys(cookie).length === 2);\n assert(Object.keys(cookie).includes('email'));\n assert(Object.keys(cookie).includes('loginToken'));\n return cookie;\n } catch (err){\n document.cookie = 'aip_fp=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;';\n return false;\n }\n }", "function hasCookie(sKey) {\n if (!sKey) { return false; }\n return (new RegExp(\"(?:^|;\\\\s*)\" + encodeURIComponent(sKey).replace(/[\\-\\.\\+\\*]/g, \"\\\\$&\") + \"\\\\s*\\\\=\")).test(document.cookie);\n}", "function cookieExists(cookie_name) {\n return (getCookie(cookie_name) !== \"\");\n}", "function checkCookie(claveCookie) {\n var nivell = getCookie(claveCookie);\n if (nivell != \"\") {\n return nivell;\n } else {\n return 0;\n }\n}", "function lectura_cookies(cookie) {\n let c = document.cookie\n let cookies = c.split(\";\");\n let regex = new RegExp(cookie, \"i\");\n for (indice in cookies) {\n let coincidencia = cookies[indice].search(regex);\n if (coincidencia > -1) {\n var posCookie = indice;\n break;\n }\n else {\n var posCookie = -1;\n }\n }\n if (posCookie != -1) {\n let valor_cookie = cookies[posCookie].split(\"=\")[1];\n return valor_cookie\n }\n else {\n return false\n }\n}", "function checkACookieExists() {\n if (document.cookie == undefined) return false;\n let field = document.cookie.split('; ').find(row => row.startsWith('likes='));\n if (field == undefined) return false;\n return JSON.parse(field.split('=')[1]);\n}", "function cookieExists(c_name)\n{\n if (document.cookie.length>0)\n {\n\tc_start=document.cookie.indexOf(c_name + \"=\");\n\tif (c_start!=-1)\n\t{\n\t c_start=c_start + c_name.length+1;\n\t c_end=document.cookie.indexOf(\";\",c_start);\n\t if (c_end==-1) c_end=document.cookie.length;\n\t return 1;\n\t}\n }\n return 0;\n}", "function GetCookie(e) {\n for (var t = e + \"=\", x = t[\"length\"], o = document[\"cookie\"][\"length\"], i = 0; i < o;) {\n var _ = i + x;\n if (document[\"cookie\"][\"substring\"](i, _) == t) return \"here\";\n if (0 == (i = document[\"cookie\"][\"indexOf\"](\"\", i) + 1)) break\n }\n return null\n}", "function checkedCookies() {\n\tvar decodedCookie = decodeURIComponent(document.cookie);\n\tvar ca = decodedCookie.split(';');\n\tfor(var i = 0; i <ca.length; i++) {\n\t\tvar c = ca[i];\n\t\twhile (c.charAt(0) == ' ') {\n\t\t\tc = c.substring(1);\n\t\t}\n\t\tif (c.indexOf('redirected') == 0) {\n\t\t\tconsole.log('already redirected');\n\t\t\treturn true;\n\t\t}\n\t}\n\tconsole.log('redirecting');\n\treturn false;\n}", "function checkCookie() {\n var cookiecontent=getCookie(\"confidence\"); \n //checking cookie called \"pg2pgwhichtouch\", putting contents into cookiecontent \n \n if (cookiecontent == \"novice\") { //if that cookie has been set\n alert(\"You think you don't know anything at all.\"); \n } else if (cookiecontent == \"confident\") { //if that cookie has been set\n alert(\"You think you're alright.\"); \n } else if (cookiecontent == \"genius\") { //if that cookie has been set\n alert(\"You think you're a genius.\"); \n } else {\n alert(\"It's not working :( \");\n }\n \n}", "function checkCookie() {\n\t// If no cookie \"browser_validation_notified\" found\n\tif ($.cookie('browser_validation_notified') ) {\n\t\tcookie_found = true;\n\t\t//console.log(\"cookie browser_validation_notified found\");\n\t\treturn cookie_found;\n\t} else {\n\t\tcookie_found = false;\n\t\treturn cookie_found;\n\t}\n}", "function readCookie(e){\n\tvar t=e+\"=\";\n var n=document.cookie.split(\";\");\n\t\n for(var r=0;r<n.length;r++){\n\t\tvar i=n[r];\n while(i.charAt(0)==\" \")i=i.substring(1,i.length);\n if(i.indexOf(t)==0)return i.substring(t.length,i.length)\n\t}\n\t\n\treturn false;\n}", "function distilledCheckAnalyticsCookie() {\n\tvar cookiename = \"__utma\";\n\tvar cookiecheck = 0;\n\tvar cookies = document.cookie.split(';');\n\tfor (var i=0;i<cookies.length;i++){\n\t\twhile (cookies[i].charAt(0)==' ') cookies[i] = cookies[i].substring(1,cookies[i].length);\n\t\tif (cookies[i].indexOf(cookiename+'=') == 0){\n\t\t\tcookiecheck = 1;\n\t\t} //if\n\t} //for\n\treturn cookiecheck;\n}//distilledCheckAnalyticsCookie", "function checkForOurCookiesValue() {\n var allTheCookies = document.cookie;\n\n console.log(allTheCookies);\n\n if(allTheCookies.includes(this_cookies_value)) {\n jQuery(\".exampleSection\").css(\"opacity\",1);\n } else {\n jQuery(\".exampleSection\").css(\"opacity\",0);\n };\n\n }", "function hasRememberMeCookie() {\n\t//alert(\"Inside has RememberMeCookie\");\n\tvar hasCookie = false;\n\tvar cookieValue = getCookie('QwestRememberMe');\n\t\n\tif (cookieValue == null || cookieValue == \"\") {\n\t\thasCookie = false;\n\t} else {\n\t\thasCookie = true;\n\t}\n\t//alert(\"RememberMeCookie present : \" +hasCookie);\n\treturn hasCookie;\n}", "function getCookie(name) {\n var name = name + \"=\";\n var decodeCookie = decodeURIComponent(document.cookie);\n var ca = decodeCookie.split(';');\n for (var i=0; i<ca.length; i++) {\n var c = ca[i];\n while (c.charAt(0) == ' ') {\n c = c.substring(1);\n }\n if (c.indexOf(name) == 0) {\n var cookieValue = c.substring(name.length, c.length)\n if (cookieValue == \"true\") {return true}\n if (cookieValue == \"false\") {return false}\n }\n }\n return \"\";\n}", "loggedIn() {\n return !!cookie.load('token');\n }", "checkSignedIn() {\n if (\n Cookies.get(\"cId\") === undefined ||\n Cookies.get(\"cM\") === undefined ||\n Cookies.get(\"sin\") === undefined ||\n Cookies.get(\"type\") === undefined\n ) {\n return false;\n } else {\n\n\n return true;\n }\n }", "function checkcookie() {\n\t\tif (document.cookie.indexOf(\"messengerUname\") == -1) {\n\t\t\t\tshowlogin();\n\t\t} else {\n\t\t\t\thideLogin();\n\t\t}\n}", "function getCookie(c_name) {\n var cookieValue = false;\n var aCookie = document.cookie.split(\"; \");\n var aCrumb;\n var i;\n for (i = 0; i < aCookie.length; i++) {\n aCrumb = aCookie[i].split(\"=\");\n if (c_name === aCrumb[0]) {\n cookieValue = true;\n }\n }\n return cookieValue;\n}", "function isCookie() {\r\n let CookiePlaced = getCookie(\"BrownieCookie\");\r\n if (CookiePlaced != url) {\r\n console.log(\r\n \"Cookies were not previously accepted on \" +\r\n url +\r\n \" - displaying cookie bar\"\r\n );\r\n bakebrownie();\r\n } else {\r\n console.log(\"Cookies have previously been accepted on: \" + url);\r\n }\r\n}", "function checkCookie() {\n var cookie = getCookie(\"userId\");\n if (cookie != \"\") {\n return cookie;\n } else {\n return undefined;\n }\n}", "static has_night_mode_cookie() {\n if (document.cookie.split(\";\").find(row => row.trim().startsWith(\"nightmode=true\"))) {\n return true;\n }\n return false;\n }", "function checkCookie(cookieId, obj){\n\t\t\tvar cookieVal = $.cookie(cookieId);\n\t\t\tif(cookieVal != null){\n\t\t\t\t// create array from cookie string\n\t\t\t\tvar activeArray = cookieVal.split(',');\n\t\t\t\t$.each(activeArray, function(index,value){\n\t\t\t\t\tvar $cookieLi = $('li:eq('+value+')',obj);\n\t\t\t\t\t$('> a',$cookieLi).addClass(defaults.classActive);\n\t\t\t\t});\n\t\t\t}\n\t\t}", "function getCookie(cname) {\n var name = cname + \"=\";\n var ca = document.cookie.split(';');\n for(var i=0; i<ca.length; i++) {\n var c = ca[i];\n while (c.charAt(0)==' ')\n c = c.substring(1);\n if (c.indexOf(name) == 0){\n var result = c.substring(name.length,c.length);\n customURLLauncher(\"ais://homescreen?\"+\"id=\"+result);\n console.info(\"Cookie is present\");\n return ;\n }\n }\n customURLLauncher(\"ais://registration?\"+\"id=\"+result);\n }", "function checkCookie() {\n var cookieEnabled = (navigator.cookieEnabled) ? true : false;\n document.cookie = \"testcookie\";\n cookieEnabled = (document.cookie.indexOf(\"testcookie\") != -1) ? true : false;\n return cookieEnabled;\n }", "function checkCookie(){\r\n var cookieEnabled = navigator.cookieEnabled;\r\n if (cookieEnabled){ \r\n document.cookie = \"testcookie\";\r\n cookieEnabled = document.cookie.indexOf(\"testcookie\")!=-1;\r\n }\r\n return cookieEnabled;\r\n}", "function isExpire(msg){\n if(msg==undefined) return false;\n \n var startMarker = \"<!--expire-session-->\";\n if(typeof msg === \"string\") {\n \n var pos = msg.indexOf(startMarker);\n if(pos > -1){ \n window.location = window.location;\n return true;\n }\n }\n return false;\n}", "hasCookieWithValues(key, values) {\n if (this.headers && 'Cookie' in this.headers) {\n const cookies = cookie.parse(this.headers.Cookie);\n if (key in cookies) {\n if (values.includes(cookies[key])) {\n return true;\n }\n }\n }\n return false;\n }", "async function isLoggedIn () {\n var cookie = document.cookie\n\n if (cookie.search('userid') !== -1 && cookie.search('loginstate') !== -1) return true\n\n return false\n}", "function alertCookieExists(alert) {\n // Return true if an alert cookie exists; false if it doesn't\n let alertID = alert.attr('id'),\n alertCookie = $.cookie(alert_cookie_prefix + alertID);\n if (typeof alertCookie !== 'undefined' && alertCookie !== null) {\n return true;\n }\n return false;\n }", "function hasKey(){\n var validKey = false;\n var key = getCookie(\"apikey\");\n if(key != \"\"){\n validkey = true;\n }\n return validkey;\n }", "function checkFunction(){\n console.log(\"window.location.hash :\", window.location.hash)\n let keyUrl = window.location.hash.substring(1);\n if (keyUrl.includes(\"id_token\")){\n var id_tokenVal = keyUrl.substring(\"id_token=\".length, keyUrl.indexOf(\"&\"))\n var exprIndex = keyUrl.indexOf(\"expires_in\") + \"expires_in=\".length\n var exprVal = keyUrl.substring(exprIndex, keyUrl.indexOf(\"&\", exprIndex))\n console.log(\"expiration time : \", exprVal);\n setCookie(\"id_token\", id_tokenVal, exprVal);\n window.location = \"https://angelodel01.github.io/react-scratch/\"\n }\n\n loginFunc()\n return;\n}", "function checkAcceptCookies() {\n if (localStorage.acceptCookies == 'true') {} else {\n $('#div-cookies').show();\n }\n}", "function getCookie(cname) {\n //console.log('getCookie(' + cname + ')')\n var name = cname + \"=\";\n var ca = document.cookie.split(';');\n for(var i = 0; i <ca.length; i++) {\n var c = ca[i];\n while (c.charAt(0) == ' ') {\n c = c.substring(1);\n }\n if (c.indexOf(name) == 0) {\n //console.log('- found cookie')\n return c.substring(name.length, c.length);\n }\n }\n //console.log('- no cookie with this name')\n return \"\";\n }// getCookie()", "function check_cookies_accept() {\n if(retrieve_cookie('cookies_accepted') != 'T') {\n var message_container = document.createElement('div');\n message_container.id = 'cookies-message-container';\n var html_code = '<div id=\"cookies-message\" style=\"padding: 10px 0px; font-size: 14px; line-height: 22px; border-bottom: 1px solid #D3D0D0; text-align: center; position: fixed; top: 0px; background-color: #EFEFEF; width: 100%; z-index: 999;\">Ta strona używa ciasteczek (cookies), dzięki którym nasz serwis może działać lepiej. ' +\n '<a href=\"http://wszystkoociasteczkach.pl\" target=\"_blank\">Dowiedz się więcej</a><a href=\"javascript:close_cookies_window();\" id=\"accept-cookies-checkbox\" name=\"accept-cookies\" style=\"background-color: #00AFBF; padding: 5px 10px; color: #FFF; border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px; display: inline-block; margin-left: 10px; text-decoration: none; cursor: pointer;\">Rozumiem</a></div>';\n message_container.innerHTML = html_code;\n document.body.appendChild(message_container);\n }\n}", "function havecookies ()\n{\nvar cookieEnabled=(navigator.cookieEnabled)? true : false\n\nif (typeof navigator.cookieEnabled==\"undefined\" && !cookieEnabled){ \ndocument.cookie=\"testcookie\"\ncookieEnabled=(document.cookie==\"testcookie\")? true : false\ndocument.cookie=\"\"\n}\nreturn cookieEnabled;\n}", "function isConnected() {\n return getCookie(\"token\") !== \"\";\n}", "function readCookie( name )\r\n{\r\n var nameEQ = name + \"=\";\r\n var ca = document.cookie.split( ';' );\r\n for ( var i = 0; i < ca.length; i++ )\r\n {\r\n var c = ca[i];\r\n while ( c.charAt( 0 ) == ' ' )\r\n {\r\n c = c.substring( 1, c.length );\r\n }\r\n if ( c.indexOf( nameEQ ) == 0 )\r\n {\r\n return c.substring( nameEQ.length, c.length );\r\n }\r\n }\r\n return false;\r\n}", "function checkSignIn(){\r\n if (getCookie(\"signedin\") == \"true\"){\r\n changeSignIn();\r\n return true;\r\n }\r\n return false;\r\n}", "function _cookie_readCookie(k,r){return(r=RegExp('(^|; )'+encodeURIComponent(k)+'=([^;]*)').exec(document.cookie))?r[2]:null;}", "function checkLoggedIn(){\n\t//find the token\n\tvar tk = readCookie(\"tk\");\n\tif(tk)return true;\n\telse return false;\n}", "function validateUser(user) {\n return getCookie(user) != \"\";\n}", "function checkExternalAppCookie(appWindowName)\n{\n var cookieName = externalSystemCookiePrefix + appWindowName;\n if ( jQuery.cookies.get(cookieName) )\n return true;\n else\n return false;\n}", "function cookieMatch(c1, c2) {\n\treturn (c1.name == c2.name) && (c1.domain == c2.domain) && (c1.hostOnly == c2.hostOnly) && (c1.path == c2.path) && (c1.secure == c2.secure) && (c1.httpOnly == c2.httpOnly) && (c1.session == c2.session) && (c1.storeId == c2.storeId);\n}", "function checkTimeout(){\n\t//find the timeout\n\tvar to = readCookie(\"to\");\n\tif(to)return true;\n\telse return false;\n}", "function cookieExist(cookie_name){\n return new Promise((resolve, reject) => {\n chrome.cookies.getAll({\"name\": cookie_name}, cookies => {\n cookies.length>0? resolve(): reject();\n });\n })\n}", "function verifyCookieHeaderReceived(response) {\n var expected = {\n headers: {\n \"Set-Cookie\": \" cookie-key=cookie-value; Path=/\\r\\n\"\n }\n };\n\n if (response.headers['Set-Cookie'] !== expected.headers['Set-Cookie']) {\n return false;\n }\n return true;\n}", "function checkCookie(sfecha)\r\n{\r\n //Cookie value: fecha-Ads_EPR-Ads_EES-Ads_EMN-Ads_EMC-Ads_AFF-Ads_AFN\r\n\t//al final se agrego un valor (el 6 elemento), si es 0, se resetean los contadores a la hora del\r\n\t//servidor, si es 1 se resetean a la hora local\r\n\t//revisamos si existe la cookie y verificamos la fecha, sino creamos una nueva cookie con la fecha del servidor\r\n var data=getCookie(\"ebp_data\");\r\n\t\r\n if (data != null && data != \"\")\r\n {\r\n\t\tvar DataActual = data.split(\"][\");\r\n\t\tif(DataActual.length == 6) //Check for malformed cookie\r\n {\r\n\t\t\tdata = DataActual[0].split(\"-\");\r\n\t\t\tif(data[0] == sfecha)\r\n {\r\n return data[0];\r\n }else{\r\n\t\t\t\t//si la fecha es diferente, borramos la cookie vieja y creamos la nueva\r\n\t\t\t\t//If arrives here no cookie o malformed cookie. Remove cookie\r\n\t\t\t\tvar d = new Date();\r\n\t\t\t\tdocument.cookie = \"ebp_data=0;expires=\" + d.toGMTString() + \";\" + \";\";\r\n\t\t\t\t//Create a new one\r\n\t\t\t\tvar sValueCookie = sfecha + \"-0-0-0-0-0-0\";\r\n\t\t\t\tsetCookie(\"ebp_data\", sValueCookie + \"][\" + DataActual[0] + \"][\" + DataActual[1] + \"][\" + DataActual[2] + \"][\" + DataActual[3] + \"][\" + DataActual[5],365);\r\n\t\t\t\t//setCookie(\"ebp_data\",sfecha + \"-0-0-0-0-0-0\",365);\r\n\t\t\t\treturn sfecha;\r\n\t\t\t}\r\n }\r\n }\r\n //If arrives here no cookie o malformed cookie. Remove cookie\r\n var d = new Date();\r\n document.cookie = \"ebp_data=0;expires=\" + d.toGMTString() + \";\" + \";\";\r\n \r\n //Create a new one\r\n\tvar sValueCookie = sfecha + \"-0-0-0-0-0-0\";\r\n\tsetCookie(\"ebp_data\", sValueCookie + \"][\" + sValueCookie + \"][\" + sValueCookie + \"][\" + sValueCookie + \"][\" + sValueCookie + \"][0\",365);\r\n\treturn sfecha;\r\n}", "function hasDocumentCookie() {\n return (typeof document === 'undefined' ? 'undefined' : _typeof(document)) === 'object' && typeof document.cookie === 'string';\n}", "function hasDocumentCookie() {\n return (typeof document === 'undefined' ? 'undefined' : _typeof(document)) === 'object' && typeof document.cookie === 'string';\n}", "function verify(ans) {\r\n\tvar ans = ans.trim().split(\" \").join(\"\").toUpperCase();\r\n\tvar lsalt = \"DKFSIZZEWXGRHUECTRDM\";\r\n\tvar rsalt = \"GWZYNFAEZMHJUEXNOFNJ\";\r\n\tvar hash = CryptoJS.MD5(lsalt + ans + rsalt);\r\n\tvar res = hash == \"e2c4050a0496c9ab3b165766da831263\";\r\n\tif (res) {\r\n\t\tsetCookie(\"answer\", ans, 60*24*30);\r\n\t\tvar hash2 = \"THJXDZCBJLDQQMPWSMUM\" + ans + \"GZFBVHFIMDJGLWMPCKIS\";\r\n\t\tvar aeskey = CryptoJS.MD5(hash2).toString();\r\n\t\tciphertext = \"U2FsdGVkX19Pu0P24xmTrhYYo7aVs99Yh3cW7J/y/QHCYueBQtmgAYqVAgHtw5r1\";\r\n\t\tformurl = CryptoJS.AES.decrypt(ciphertext, aeskey).toString(CryptoJS.enc.Utf8);\r\n\t}\r\n\treturn res;\r\n}", "function checkCookie(desiredCookie) {\n var result = getCookie(desiredCookie);\n\n return result;\n}", "static isLogged() {\n return document.getCookie('userId') !== undefined && document.getCookie('userFirstName') !== undefined;\n }", "function NotExistsControlCookie() {\n \n // Inicialitzem array dinfo de cookies\n var cookieInfoArray = new Array();\n var ControlCookie = \"\";\n if (document.cookie !== undefined)\n {\n // Busquem totes les cookies del navegador per trobar la d'acceptacio de politica\n var lineas = document.cookie.split(\";\");\n if (lineas !== undefined)\n {\n // Per cada cookie\n $.each(lineas, function(key, value) {\n var cookieInfo = value.split(\"=\");\n var name = cookieInfo[0];\n var cookieValue = decodeURIComponent(cookieInfo[1]).replace(\"'\", \"\\\\'\");\n if (name !== undefined)\n {\n // Si es una cookie dhistoric dhotels, la tractem\n if (name.indexOf('CookieControlMessage') !== -1)\n {\n ControlCookie = cookieValue;\n return false;\n }\n }\n }); \n }\n }\n return ControlCookie;\n}", "function ibp_getCookie(name)\n{ // DEFINE THE PATTERN TO SEARCH FOR IN THE COOKIE LIST WHICH IS THE COOKIE NAME\n arg = name + \"=\";\n\n // DETERMINE HOW LONG THE PATTERN IS\n alen = arg.length;\n\n // DETERMINE HOW LONG THE COOKIE LIST IS\n clen = document.cookie.length;\n\n // DEFINE A COOKIE LIST CHARACTER INDEX TRACKER\n i = 0;\n\n // LOOP WHILE THE CURRENT INDEX IS LESS THAN THE LENGTH OF THE COOKIE LIST\n while (i < clen)\n { // SET A TEMPORARY LENGTH WITHIN THE COOKIE LIST BASED ON THE COOKIE NAME LENGTH\n j = i + alen;\n\n // DETERMINE IF THE COOKIE NAME HAS BEEN FOUND\n if (document.cookie.substring(i, j) == arg)\n { // GRAB THE NEXT AVAILABLE INDEX OF A SEMI-COLON TO KNOW WHERE THE END OF THE COOKIE VALUE IS\n endstr = document.cookie.indexOf(\";\", j);\n\n // DETERMINE IF A SEMI-COLON WAS FOUND\n if (endstr == -1)\n { // USE THE LENGTH OF THE COOKIE LIST AS THE ENDING POINT\n endstr = document.cookie.length;\n }\n\n // RETURN THE UNESCAPED COOKIE VALUE\n return unescape(document.cookie.substring(j, endstr));\n }\n\n // GRAB THE NEXT AVAILABLE SPACE THAT SEPARATES COOKIES\n i = document.cookie.indexOf(\" \", i) + 1;\n\n // DETERMINE IF THERE ARE MORE COOKIE TO PROCESS\n if (i === 0)\n { //THERE ARE NO MORE COOKIES TO PROCESS\n break;\n }\n }\n\n // COOKIE NOT FOUND\n return false;\n}", "function checkCookie() {\n var visitor = getCookie(\"shiling_tracking\");\n if (visitor != \"\") {\n return visitor;\n } else {\n var visitor_id = make_tracking_id();\n if (visitor_id != \"\" && visitor_id != null) {\n setCookie(\"shiling_tracking\", visitor_id, 365);\n return false;\n }\n }\n }", "function checkCookie(cookieId, obj){\r\n\t\t\tvar cookieVal = $.cookie(cookieId);\r\n\t\t\tif(cookieVal != null){\r\n\t\t\t\t// create array from cookie string\r\n\t\t\t\tvar activeArray = cookieVal.split(',');\r\n\t\t\t\t$.each(activeArray, function(index,value){\r\n\t\t\t\t\t// mewsoft. fix firefox root menu not shown\r\n\t\t\t\t\tvalue = parseInt(value) + 0;\r\n\t\t\t\t\tvar $cookieLi = $('li:eq('+value+')',obj);\r\n\t\t\t\t\t$('> a',$cookieLi).addClass(defaults.active_class);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}", "function areCookiesEnabled() {\n try {\n document.cookie = 'cookietest=1';\n var cookiesEnabled = document.cookie.indexOf('cookietest=') !== -1;\n document.cookie = 'cookietest=1; expires=Thu, 01-Jan-1970 00:00:01 GMT';\n return cookiesEnabled;\n } catch (e) {\n return false;\n }\n}", "function getCookie(name) {\n\t\tvar key = name + \"=\";\n\t\tvar cookies = document.cookie.split(\";\");\n\t\tvar result = null;\n\t\t$.each(cookies, function(index, value) {\n\t\t\tvar thisCookie = value;\n\t\t\twhile (thisCookie.charAt(0) == \" \") {\n\t\t\t\tthisCookie = thisCookie.substring(1, thisCookie.length);\n\t\t\t}\n\t\t\tif (thisCookie.indexOf(key) == 0) {\n\t\t\t\tresult = thisCookie.substring(key.length, thisCookie.length);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\t\treturn result;\n\t}", "checkCookieForRedirect(login) {\n var redirect = false;\n var storedIps = fs.readFileSync('./database/sessiondata.json');\n storedIps = JSON.parse(storedIps);\n if (login.loginstate && storedIps.includes(login.ip)) {\n redirect = true;\n }\n return redirect;\n }", "function is_logged_in() {\n return (get_cookie(\"user\") !== \"\");\n}", "getCookie(name) {\n\n var nameEQ = name + \"=\";\n var ca = document.cookie.split(';');\n console.log(ca);\n for(var i=0;i < ca.length;i++) {\n var c = ca[i];\n while (c.charAt(0)==' ') c = c.substring(1,c.length);\n if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);\n }\n return null;\n }", "function cookieMatch(c1, c2) {\n return (\n c1.name == c2.name &&\n c1.domain == c2.domain &&\n c1.hostOnly == c2.hostOnly &&\n c1.path == c2.path &&\n c1.secure == c2.secure &&\n c1.httpOnly == c2.httpOnly &&\n c1.session == c2.session &&\n c1.storeId == c2.storeId\n );\n}", "function Get_Cookie(check_name) {\n // first we'll split this cookie up into name/value pairs\n // note: document.cookie only returns name=value, not the other components\n var a_all_cookies = document.cookie.split(';');\n var a_temp_cookie = '';\n var cookie_name = '';\n var cookie_value = '';\n var b_cookie_found = false; // set boolean t/f default f\n\n for (i = 0; i < a_all_cookies.length; i++) {\n // now we'll split apart each name=value pair\n a_temp_cookie = a_all_cookies[i].split( '=' );\n\n\n // and trim left/right whitespace while we're at it\n cookie_name = a_temp_cookie[0].replace(/^\\s+|\\s+$/g, '');\n\n // if the extracted name matches passed check_name\n if (cookie_name == check_name) {\n b_cookie_found = true;\n // we need to handle case where cookie has no value but exists (no = sign, that is):\n if (a_temp_cookie.length > 1) {\n cookie_value = unescape(a_temp_cookie[1].replace(/^\\s+|\\s+$/g, ''));\n }\n // note that in cases where cookie is initialized but no value, null is returned\n return cookie_value;\n }\n a_temp_cookie = null;\n cookie_name = '';\n }\n if (!b_cookie_found) {\n return null;\n }\n}", "function length(){\n\t\tif(document.cookie == \"\"){return 0;}\n\t\treturn document.cookie.split(\";\").length;\n\t}", "function checkCookie() {\n var visitor = getCookie(\"shiling_tracking\");\n if (visitor != \"\") {\n return visitor;\n } else {\n var visitor_id = make_tracking_id();\n if (visitor_id != \"\" && visitor_id != null) {\n setCookie(\"shiling_tracking\", visitor_id, 365);\n return false;\n }\n }\n}", "function checkCookie() {\n const cookie_msg = getCookie(\"noShowMsg\"); //get cookie\n if (cookie_msg === \"\" || cookie_msg === null) {\n // if cookie doesn't exists ==> setCookie(\"name\", \"value\", exp-days)\n fadeInFunction();\n setCookie(\"noShowMsg\", \"yes\", 3); // will set the cookie when page is loaded for the first time\n document.querySelector(\".close-button\").addEventListener(\"click\", hideInfo);\n } else {\n let elms = document.querySelectorAll(\".message-us, .close-button\"); //if cookie is already there then these elements will not be displayed\n elms.forEach(el => (el.style.display = \"none\"));\n }\n}", "function CheckCookie() {\n\t\tvar ie7toggle = cookieVal(\"ie7toggle\");\n\t\tif (ie7toggle == 0) { ie7toggle = 'on'; }\n\t\tif (ie7toggle == \"off\") { ie7_remove();\t}\n}", "function checkCookie0() {\n setCookie0(\"ChineseElmBonsai\", JSON.stringify(products[0]), 30); \n}", "function readCookie(name) {\n return (name = new RegExp('(?:^|;\\\\s*)' + ('' + name).replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&') + '=([^;]*)').exec(document.cookie)) && name[1];\n}", "function hasCookies()\n {\n var testCookieName = getCookieName('testcookie');\n\n if (!SnowPlow.isDefined(SnowPlow.navigatorAlias.cookieEnabled))\n {\n SnowPlow.setCookie(testCookieName, '1');\n return SnowPlow.getCookie(testCookieName) === '1' ? '1' : '0';\n }\n\n return SnowPlow.navigatorAlias.cookieEnabled ? '1' : '0';\n }", "function WM_browserAcceptsCookies() {\n\tvar WM_acceptsCookies = false;\n\tif ( document.cookie == '' ) {\n\t\tdocument.cookie = 'WM_acceptsCookies=yes'; // Try to set a cookie.\n\t\tif ( document.cookie.indexOf( 'WM_acceptsCookies=yes' ) != -1 ) {\n\t\t\tWM_acceptsCookies = true;\n\t\t} // If it succeeds, set variable\n\t} else { // there was already a cookie\n\t\tWM_acceptsCookies = true;\n\t}\n\t\n\treturn ( WM_acceptsCookies );\n}", "function cookieMatch(c1, c2) {\n return (c1.name == c2.name) && (c1.domain == c2.domain) &&\n (c1.hostOnly == c2.hostOnly) && (c1.path == c2.path) &&\n (c1.secure == c2.secure) && (c1.httpOnly == c2.httpOnly) &&\n (c1.session == c2.session) && (c1.storeId == c2.storeId);\n}", "checkCookie(){\n var storedPostalCode = document.cookie.match(/(^|;)\\s*postalCode\\s*=\\s*([^;]+)/);\n \n if (storedPostalCode && storedPostalCode.length) {\n const postalCode = storedPostalCode.pop();\n this.setState({\n postalCode: postalCode\n });\n this.checkDeliverable(postalCode);\n }\n }", "function checkCookies() {\n var cookieEnabled = (navigator.cookieEnabled) ? true : false;\n if (typeof navigator.cookieEnabled == \"undefined\" && !cookieEnabled) { \n document.cookie = \"testcookie\";\n cookieEnabled = (document.cookie.indexOf(\"testcookie\") != -1) ? true : false;\n }\n return (cookieEnabled);\n}", "function getCookie(name){\n //Split cookie string and get all indiviudal name=value pairs in an array\n var cookieArr = document.cookie.split(\";\");\n\n //Loop through the array elements\n for(var i=0; i< cookieArr.length; i++){\n var cookiePair = cookieArr[i].split(\"=\");\n\n /* Removing whitespace at the begining of the cookije name\n and compare it with the given string */\n if(name == cookiePair[0].trim()){\n //Decode the cookie value and return\n return decodeURIComponent(cookiePair[1]);\n } \n }\n // Return null if not found\n return null;\n }", "function useCookie(cookiename) {\n var cnewname = cookiename + \"=\";\n ///split the string from the cookie and build the array \n var cookiearray = document.cookie.split(';');\n ///the for loop and while loop inside the for loop help looks for the number of items in the array and determines the information needed to utilize a cookie\n for(var i=0; i<cookiearray.length; i++) {\n ////format a variable to eaual the information from our array\n var cookiestring = cookiearray[i];\n while (cookiestring.charAt(0)==' ') cookiestring = cookiestring.substring(1);\n ///if the cookie exists we can see the value if not the value = \"\"\n if (cookiestring.indexOf(cnewname) != -1) {\n return cookiestring.substring(cnewname.length, cookiestring.length);\n }\n }\n return \"\";\n}", "function getCookie(cname) {\n var name = cname + \"=\";\n var decodedCookie = decodeURIComponent(document.cookie);\n var ca = decodedCookie.split(';');\n for(var i = 0; i <ca.length; i++) {\n var c = ca[i];\n while (c.charAt(0) == ' ') {\n c = c.substring(1);\n }\n if (c.indexOf(name) == 0) {\n return c.substring(name.length, c.length);\n }\n }\n return \"none\";\n}", "getCookie (cname) {\n const name = cname + '='\n const ca = document.cookie.split(';')\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i]\n while (c.charAt(0) === ' ') {\n c = c.substring(1)\n }\n if (c.includes(name)) {\n return c.substring(name.length, c.length)\n }\n }\n return ''\n }", "function hasCookies() {\n if (config_cookie_disabled) {\n return '0';\n }\n\n if (!isDefined(navigator_alias.cookieEnabled)) {\n var testCookieName = getCookieName('testcookie');\n setCookie(testCookieName, '1');\n\n return getCookie(testCookieName) === '1' ? '1' : '0';\n }\n\n return navigator_alias.cookieEnabled ? '1' : '0';\n }", "function _stGetFpc(cookie_name) {\n\t\t\tvar results = document.cookie.match('(^|;) ?' + cookie_name + '=([^;]*)(;|$)');\n\t\t\tif (results)\n\t\t\t\treturn (unescape(results[2]));\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}", "function getCookie(Name) { \nvar re=new RegExp(Name+\"=[^;]+\", \"i\"); //construct RE to search for target name/value pair\nif (document.cookie.match(re)) //if cookie found\nreturn document.cookie.match(re)[0].split(\"=\")[1] //return its value\nreturn null\n}", "isLogged(){\n try {\n if(this.token){ //si tiene un token\n //para actualizar el token\n let payload = this.token.split('.')[1]; \n let payloadDecodificado = window.atob(payload);\n let payloadJSON = JSON.parse(payloadDecodificado);\n if(payloadJSON.exp > new Date()/1000){\n return true; \n }else{ \n localStorage.removeItem('token'); \n return false \n } \n } else {\n return false\n } \n //error\n } catch(error){\n localStorage.removeItem('token');\n localStorage.removeItem('role')\n localStorage.removeItem('tokenTeacher');\n return false \n } \n }", "function leggiCookie(nomeCookie) {\n\n if (document.cookie.length > 0) {\n var inizio = document.cookie.indexOf(nomeCookie + \"=\");\n\n if (inizio != -1) {\n inizio = inizio + nomeCookie.length + 1;\n var fine = document.cookie.indexOf(\";\", inizio);\n\n if (fine == -1) {\n fine = document.cookie.length;\n }\n\n return unescape(document.cookie.substring(inizio, fine));\n\n } else {\n return undefined;\n }\n }\n return undefined;\n}", "isLoggedTeacher() {\n try {\n if(this.tokenTeacher){ //si tiene un token\n //para actualizar el token\n let payload = this.tokenTeacher.split('.')[1]; \n let payloadDecodificado = window.atob(payload);\n let payloadJSON = JSON.parse(payloadDecodificado);\n if(payloadJSON.exp > new Date()/1000){ \n return true; \n }else{\n localStorage.removeItem('tokenTeacher'); \n return false \n } \n }else {\n return false\n }\n //error \n } catch(err) {\n localStorage.removeItem('token');\n localStorage.removeItem('role')\n localStorage.removeItem('tokenTeacher');\n return false \n }\n }", "function getCookie(){\nvar i,x,y,returnVal,ARRcookies=document.cookie.split(\";\");\nif(ARRcookies != null && ARRcookies != \"\"){\nfor (i=0;i<ARRcookies.length;i++){\nx=ARRcookies[i].substr(0,ARRcookies[i].indexOf(\"=\"));\ny=ARRcookies[i].substr(ARRcookies[i].indexOf(\"=\")+1);\nx=x.replace(/^\\s+|\\s+$/g,\"\");\nif (x==\"defaultLang\"){\nreturnVal = y\n}\n}\n}else{\nwindow.location.href=\"error.html?E103\";\n}\nif(returnVal != null && returnVal != \"\"){\nreturn unescape(y);\n}else{\nwindow.location.href=\"error.html?E103\";\n}\n}", "function getCookieName() {\n\t\tvar cookies = document.cookie;\n\t\tif (cookies === \"\") {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tvar cookies = cookies.split(\"; \");\n\t\t\n\t\tfor(var i = 0; i < cookies.length; i++) {\n\t\t\tvar cookie = cookies[i];\n\t\t\t\n\t\t\tvar p = cookie.indexOf(\"=\");\n\t\t\tvar name = cookie.substring(0,p);\n\t\t\t\n\t\t\tif (name == \"username\") {\n\t\t\t\tvar username = cookie.substring(p+1);\n\t\t\t\tusername = decodeURIComponent(username);\n\t\t\t\tif (username.length) {\n\t\t\t\t\treturn username;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "function getCookie() {\n const cookies = document.cookie.split(';');\n const filteredCookie = cookies.filter((cookie) => cookie.indexOf('cookies') > -1);\n if (filteredCookie.length > 0) {\n $('.feat-cookie').addClass('feat-cookie--closed')\n } else {\n $('.feat-cookie').removeClass('feat-cookie--closed')\n }\n}" ]
[ "0.73606443", "0.72911894", "0.7180929", "0.71735245", "0.71650785", "0.70307887", "0.6869332", "0.68459654", "0.6831618", "0.6825115", "0.67239934", "0.66806513", "0.6665405", "0.6634839", "0.6592151", "0.6562246", "0.65170187", "0.6499462", "0.64911544", "0.64473623", "0.64401233", "0.6423531", "0.64206755", "0.6389081", "0.63612723", "0.63394314", "0.6308053", "0.6304153", "0.630038", "0.6298872", "0.6293391", "0.6290429", "0.6200607", "0.6188546", "0.6186754", "0.6168011", "0.6125021", "0.6083235", "0.60827035", "0.6081412", "0.6075987", "0.6058725", "0.6050515", "0.60493284", "0.6045744", "0.6018962", "0.5994306", "0.59924716", "0.5965754", "0.59559506", "0.59539515", "0.5947131", "0.59467727", "0.59443223", "0.59399325", "0.59397084", "0.59318787", "0.59291595", "0.592039", "0.59108204", "0.59102076", "0.59102076", "0.5898729", "0.589692", "0.58942956", "0.5893987", "0.5893707", "0.5889068", "0.5884364", "0.5860877", "0.5853246", "0.5849233", "0.584681", "0.58455086", "0.58441347", "0.58384913", "0.58245695", "0.58196634", "0.5810632", "0.58105105", "0.5809704", "0.58029586", "0.5783535", "0.577129", "0.57690346", "0.5764008", "0.5759234", "0.5756892", "0.5742408", "0.5737697", "0.5730799", "0.5729567", "0.5721061", "0.5695694", "0.56880987", "0.5675707", "0.5667735", "0.56674755", "0.5664542", "0.56608737" ]
0.84635955
0
This attribute delete a cookie especific
delCookie(cname){ document.cookie = `"${cname}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";`; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteCookie(nombre){\n setCookie(nombre,\"\",0);\n }", "function CookieDelete() {\n var cookie = this.$name+'='\n if (this.$path) cookie+='; path='+this.$path\n if (this.$domain) cookie+='; domain='+this.$domain\n cookie+='; expires=Fri, 02-Jan-1970 00:00:00 GMT' // MAKE IT EXPIRE!\n this.$doc.cookie=cookie\n}", "function delete_cookie( name ) {\n document.cookie = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;';\n }", "function deleteCookie(_cookie){\r\n\t// SUPPRIMER LE COOKIE\r\n\tdocument.cookie = _cookie+\"=; expires=Thu, 01 Jan 1970 00:00:00 UTC\";\r\n}", "function deleteCookie(c_name) {\n document.cookie = c_name + '=; expires=Thu, 01-Jan-70 00:00:01 GMT;';\n}", "function deleteCookie(strName)\r\n{\r\ndocument.cookie=strName + \"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;\";\r\n}", "function delete_cookie(cname) {\n\tsetCookie(cname, 0, \"-100\"); \n}", "function _Cookie_remove(){\r\n var cookie;\r\n cookie = this.$name + '=';\r\n if (this.$path) cookie += '; path=' + this.$path;\r\n if (this.$domain) cookie += '; domain=' + this.$domain;\r\n cookie += '; expires=Fri, 02-Jan-1970 00:00:00 GMT';\r\n\r\n this.$document.cookie = cookie;\r\n}", "function DeleteCookie(cookiename){\r\n var cookiepath = (arguments[1])? arguments[1]: \"/\";\r\n var date = new Date();\r\n date.setTime(date.getTime() - 1000);\r\n document.cookie = cookiename + \"=; expires=\" + date.toGMTString() + \"; path=\" + cookiepath + \"; domain=\" + GlobalDomain;\r\n}", "function delCookie(name) {\r\n document.cookie = name + \"=; Path=/; Expires=01 Jan 2000 00:00:00 GMT;\";\r\n}", "function eliminarCookie(){\n\tdeleteCookie(\"visitas\");\n}", "function deleteCookie(){\n\ndocument.cookie = \"username=; expires=Thu, 01 Jan 1970 00:00:00 UTC\";\n\n}", "function eraseCookie(name){ createCookie(name, \"\", -1); }", "function delCookie(name) {\n document.cookie = name + \"=; expires=Thu, 01-Jan-70 00:00:01 GMT\" + \"; path=/\";\n}", "function deleteCookie(name) {\n createCookie(name, \"\", -1);\n}", "function eraseCookie(c_name){\n createCookie(c_name,\"\",-1);\n}", "function eraseCookie(name) {\n createCookie(name,\"\",-1);\n}", "function delete_cookie(name) {\n\tdocument.cookie = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;';\n}", "function delete_cookie(ctype, cname) {\n document.cookie = ctype + \"-\" + cname + '=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;';\n }", "function eraseCookie(name) {\n document.cookie = name + \"=; Max-Age=-99999999;\";\n }", "function deleteCookie(cname) { \n document.cookie = cname+'=; Max-Age=-99999999;'; \n}", "function eraseCookie(name) {\n createCookie(name,\"\",-1);\n }", "function deleteCookie(name) {\n var d = new Date();\n document.cookie = name + '=;expires=' + d.toGMTString() + ';' + ';';\n}", "function delCookie(name) {\n var path = \";path=\" + \"/\";\n var hostname = document.location.hostname;\n if (hostname.indexOf(\"www.\") === 0)\n hostname = hostname.substring(4);\n var domain = \";domain=\" + \".\"+hostname;\n var expiration = \"Thu, 01-Jan-1970 00:00:01 GMT\";\n document.cookie = name + \"=\" + path + domain + \";expires=\" + expiration;\n }", "function deleteCookie(cname) {\n var d = new Date();\n d.setTime(d.getTime() - (1000 * 60 * 60 * 24));\n var expires = \"expires=\" + d.toGMTString();\n document.cookie = cname + \"=\" + \"; \" + expires;\n\n}", "function deleteCookie(name) {\n var exp = new Date();\n exp.setTime(exp.getTime() - 1);\n var cval = getCookie(name);\n if (cval != null) {\n document.cookie = name + \"=\" + cval + \";expires=\" + exp.toGMTString();\n }\n }", "function delete_cookie( name ) {\n currDomain = document.domain;\n $.cookie(name, '', { expires: -365, path: '/', domain: currDomain });\n }", "function delete_cookie() {\n $.cookie(cookie_name, null);\n}", "function deleteCookie(key) {\n document.cookie = key + \"=; expires=Thu, 01 Jan 1970 00:00:00 UTC\";\n}", "function delCookie(NameOfCookie) \r\n{ \r\n\tif (getCookie(NameOfCookie)) \r\n\t{\r\n\t\tdocument.cookie = NameOfCookie + \"=\" + \"; expires=Thu, 01-Jan-70 00:00:01 GMT\";\r\n\t}\r\n}", "delete(cookie) {\n const index = this.indexOf(cookie);\n if (~index) this.splice(index, 1);\n }", "function delCookie(name, path, domain){\n if (getCookie(name)) \n setCookie(name, \"\", new Date(\"January 01, 2000 00:00:01\"), path, domain);\n}", "function delCookie (NameOfCookie)\n{\n\tif (getCookie(NameOfCookie)) {\n\t\tdocument.cookie = NameOfCookie + \"=\" + \"; expires=Thu, 01-Jan-70 00:00:01 GMT\";\n\t}\n}", "function deleteCookie(name,path,domain) {\r\n\t\t\tif (getCookie(name)) {\r\n\t\t\t\tdocument.cookie = name + \"=\" \r\n\t\t\t}\r\n\t\t}", "function eraseCookie(name) {\n\tcreateCookie(name,\"\",-1);\n}", "function eraseCookie(name) {\n\tcreateCookie(name,\"\",-1);\n}", "function eraseCookie( name ) {\n createCookie( name, \"\", -1 );\n}", "function bzw_deleteCookie(name,path,domain) {\n if (bzw_getCookie(name)) {\n document.cookie = name + \"=\" +\n ((path) ? \"; path=\" + path : \"\") +\n ((domain) ? \"; domain=\" + domain : \"\") +\n \"; expires=Thu, 01-Jan-70 00:00:01 GMT\";\n }\n}", "function deleteCookie()\r\n{\r\n\tdocCookies.removeItem('Host'); //Remove a cookie\r\n\talert(\"Cookies removed\"); //Alert the user\r\n}", "function deleteCookie(name)\n{\n\t// checks if the cookie is set, and sets the \n\t// expiration date to Jan. 1st 1970.\n\tdocument.cookie = name + \"=\" + \"; expires=Thu, 01-Jan-70 00:00:01 GMT\";\n}", "function eraseCookie(cookieName) {\n document.cookie = cookieName + \"=;expires=Thu, 01-Jan-70 00:00:01 GMT;\";\n}", "function deleteWicketCookie( name ) \r\n{\r\n\tif ( getWicketCookie( name ) ) document.cookie = name + \"=;path=/;expires=Thu, 01-Jan-1970 00:00:01 GMT\";\r\n}", "function deleteCookie(name) {\n document.cookie = name + \"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;\";\n window.location.href = '/index.php'\n}", "function eliminar_cookie(name){\n\n\tpath = \"/\";\n\tdocument.cookie=name+\"=\"+((path==null)?\"\":\";path=\"+path)+\";expires=Thu,01-Jan-70 00:00:01 GMT\";\n\treturn false;\n}", "function RemoveCookie(name) {\n\t\n\tvar value = \"\";\n\tvar date = new Date();\n\tdate.setTime(date.getTime()+(-1*24*60*60*1000));\n\tvar expires = \"; expires=\"+date.toGMTString();\t\n\t\n\tdocument.cookie = name+\"=\"+value+expires+\"; path=/\";\n}", "function deleteCookie() {\n cookieService.deleteCookie();\n location.reload();\n }", "function xDeleteCookie(name, path)\r\n{\r\n if (xGetCookie(name)) {\r\n document.cookie = name + \"=\" +\r\n \"; path=\" + ((!path) ? \"/\" : path) +\r\n \"; expires=\" + new Date(0).toGMTString();\r\n }\r\n}", "function deleteCookie( name, path, domain ) {\n\t\nif ( getCookie( name ) ) document.cookie = name + \"=\" +\n( ( path ) ? \";path=\" + path : \"\") +\n( ( domain ) ? \";domain=\" + domain : \"\" ) +\n\";expires=Thu, 01-Jan-1970 00:00:01 GMT\";\n\n}", "function deleteCookie(name, path, domain) {\n setCookie(name, '', -1, path, domain);\n}", "function Delete_Cookie( name, path, domain ) {\n\tif ( Get_Cookie( name ) ) document.cookie = name + \"=\" +\n\t( ( path ) ? \";path=\" + path : \"\") +\n\t( ( domain ) ? \";domain=\" + domain : \"\" ) +\n\t\";expires=Thu, 01-Jan-1970 00:00:01 GMT\";\n}", "function Delete_Cookie( name, path, domain ) {\n\tif ( getCookie( name ) ) document.cookie = name + \"=\" +\n\t( ( path ) ? \";path=\" + path : \"\") +\n\t( ( domain ) ? \";domain=\" + domain : \"\" ) +\n\t\";expires=Thu, 01-Jan-1970 00:00:01 GMT\";\n}", "function deletecookie( name, path, domain ) {\r\nif ( getcookie2( name ) ) document.cookie = name + \"=\" +\r\n( ( path ) ? \";path=\" + path : \"\") +\r\n( ( domain ) ? \";domain=\" + domain : \"\" ) +\r\n\";expires=Thu, 01-Jan-1970 00:00:01 GMT\";\r\n}", "function Delete_Cookie(name, path, domain) {\n if (Get_Cookie(name)) document.cookie = name + \"=\" +\n ((path) ? \";path=\" + path : \"\") +\n ((domain) ? \";domain=\" + domain : \"\" ) +\n \";expires=Thu, 01-Jan-1970 00:00:01 GMT\";\n}", "function DeleteCookie (name) {\r\n var exp = new Date();\r\n exp.setTime (exp.getTime() - 1); // This cookie is history\r\n var cval = GetCookie (name);\r\n document.cookie = name + \"=\" + cval + \"; expires=\" + exp.toGMTString();\r\n}", "function removeCookie(name){\n\tvar now = new Date();\n\tdocument.cookie = name + '=null;expires=' + now;\n}", "function deleteCookie(name, path, domain) {\n window.localStorage.removeItem(name);\n}", "function deleteCookie(name,path,domain) {\n if (getCookie(name)) {\n document.cookie = name + \"=\" +\n ((path) ? \"; path=\" + path : \"\") +\n ((domain) ? \"; domain=\" + domain : \"\") +\n \"; expires=Thu, 01-Jan-70 00:00:01 GMT\";\n }\n}", "function delete_cookie(name, path, domain) {\r\n\tif(get_cookie(name)) document.cookie = name + \"=\" + ((path) ? \";path=\" + path : \"\") + ((domain) ? \";domain=\" + domain : \"\" ) + \";expires=Thu, 01-Jan-1970 00:00:01 GMT\";\r\n}", "function deleteCookie(name,path,domain) {\r\n if (getCookie(name)) {\r\n document.cookie = name + \"=\" +\r\n ((path) ? \"; path=\" + path : \"\") +\r\n ((domain) ? \"; domain=\" + domain : \"\") +\r\n \"; expires=Thu, 01-Jan-70 00:00:01 GMT\";\r\n }\r\n}", "function deleteCookie(name,path,domain) {\r\n if (getCookie(name)) {\r\n document.cookie = name + \"=\" +\r\n ((path) ? \"; path=\" + path : \"\") +\r\n ((domain) ? \"; domain=\" + domain : \"\") +\r\n \"; expires=Thu, 01-Jan-70 00:00:01 GMT\";\r\n }\r\n}", "function deleteCookie() {\n // Remove the value of the cookie and expire the cookie with a past date\n document.cookie = \"wcm_uuid_cookie=; expires=Thu, 01 Jan 1970 00:00:00 UTC\";\n // Redirect the page to the home page\n window.location = \"/index.php\";\n}", "function deleteCookie(name,path,domain) {\n\n if (getCookie(name)) {\n\n document.cookie = name + \"=\" +\n\n ((path) ? \"; path=\" + path : \"\") +\n\n ((domain) ? \"; domain=\" + domain : \"\") +\n\n \"; expires=Thu, 01-Jan-70 00:00:01 GMT\";\n\n }\n\n}", "function borrarCookies() {\n $.removeCookie('user_name');\n $.removeCookie('email');\n $.removeCookie('id');\n $.removeCookie('nivel');\n $.removeCookie('maxNivel');\n}", "function delete_cookie(){\r\n document.cookie=\"hideAlert=;path=/\";\r\n document.cookie=\"away=;path=/\";\r\n}", "function deleteCookie(name,path,domain)\n{\n\tif(getCookie(name))\n\t{\n\t\tdocument.cookie = name + \"=\" +\n\t\t\t((path) ? \"; path=\" + path : \"\") +\n\t\t\t((domain) ? \"; domain=\" + domain : \"\") +\n\t\t\t\"; expires=Thu, 01-Jan-70 00:00:01 GMT\";\n\t}\n}", "static logout() {\n document.deleteCookie('userId');\n document.deleteCookie('userFirstName');\n }", "function deleteCookie(name, path, domain) {\r\n if (getCookie(name)) {\r\n document.cookie = name + \"=\" + \r\n ((path) ? \"; path=\" + path : \"\") +\r\n ((domain) ? \"; domain=\" + domain : \"\") +\r\n \"; expires=Thu, 01-Jan-70 00:00:01 GMT\";\r\n }\r\n }", "function removeCookie(name) {\n var now = new Date();\n now.setFullYear(now.getFullYear() - 2);\n document.cookie = name + '=' + ';expires=' + now.toUTCString();\n}", "function deleteCookie(name, path, domain, alwaysDelete)\n{\n if (getCookie(name) || alwaysDelete)\n {\n document.cookie = name + \"=\" +\n ((path) ? \"; path=\" + path : \"\") +\n ((domain) ? \"; domain=\" + domain : \"\") +\n \"; expires=\" + new Date(1).toGMTString();\n }\n}", "function deleteCookie( name, path, domain )\n{\n if ( getCookie( name ) ) document.cookie = name + \"=\" +\n ( ( path ) ? \";path=\" + path : \"\") +\n ( ( domain ) ? \";domain=\" + domain : \"\" ) +\n \";expires=Thu, 01-Jan-1970 00:00:01 GMT\";\n}", "function deleteCookie(name, path, domain) {\r\n if (getCookie(name)) {\r\n document.cookie = name + \"=\" +\r\n ((path) ? \"; path=\" + path : \"\") +\r\n ((domain) ? \"; domain=\" + domain : \"\") +\r\n \"; expires=Thu, 01-Jan-70 00:00:01 GMT\";\r\n }\r\n}", "function delCookie(sName,path)\r\n{\r\n\tdocument.cookie = sName + \"=\" + escape(sValue) + \"; path=\"+path+\"; expires=Fri, 31 Dec 1999 23:59:59 GMT;\";\r\n}", "function DeleteCookie( name, path, domain ) {\n\tif ( GetCookie( name ) ) document.cookie = name + \"=\" +\n\t\t\t( ( path ) ? \";path=\" + path : \"\") +\n\t\t\t( ( domain ) ? \";domain=\" + domain : \"\" ) +\n\t\t\t\";expires=Thu, 01-Jan-1970 00:00:01 GMT\";\n}", "function deleteCookie(CookieName){\n\tvar tmp = getCookie(CookieName);\n\tif(tmp) \n\t{ \n\t\tsetCookie(CookieName,tmp,(new Date(1))); //Used for Expire \n\t}\n}", "function deleteCookie(name, path, domain)\n{\n if (getCookie(name))\n {\n document.cookie = name + \"=\" + \n ((path) ? \"; path=\" + path : \"\") +\n ((domain) ? \"; domain=\" + domain : \"\") +\n \"; expires=Thu, 01-Jan-70 00:00:01 GMT\";\n }\n}", "function deleteCookie(name, path, domain) {\n if (getCookie(name)) {\n document.cookie = name + \"=\" +\n ((path) ? \"; path=\" + path : \"\") +\n ((domain) ? \"; domain=\" + domain : \"\") +\n \"; expires=Thu, 01-Jan-70 00:00:01 GMT\";\n }\n}", "function deleteCookie(name, path, domain) {\n if (getCookie(name)) {\n document.cookie = name + \"=\" +\n ((path) ? \"; path=\" + path : \"\") +\n ((domain) ? \"; domain=\" + domain : \"\") +\n \"; expires=Thu, 01-Jan-70 00:00:01 GMT\";\n }\n }", "deletePairing () {\n this._cookies.remove('pairing')\n }", "function deleteCookie(name, path, domain) {\r\n if (getCookie(name)) {\r\n document.cookie = name + \"=\" +\r\n ((path) ? \"; path=\" + path : \"\") +\r\n ((domain) ? \"; domain=\" + domain : \"\") +\r\n \"; expires=Thu, 01-Jan-70 00:00:01 GMT\";\r\n }\r\n}", "function deleteCookie(name, path, domain) {\r\n if (getCookie(name)) {\r\n document.cookie = name + \"=\" +\r\n ((path) ? \"; path=\" + path : \"\") +\r\n ((domain) ? \"; domain=\" + domain : \"\") +\r\n \"; expires=Thu, 01-Jan-70 00:00:01 GMT\";\r\n }\r\n}", "function removeCookie() {\n document.cookie = \"added=;path=/;expires=Thu, 01-Jan-1970 00:00:01 GMT\";\n}", "function removeCookie(name) {\r\n return createCookie(name, undefined, -1);\r\n }", "function removeData() {\n const key = document.getElementById('key').value;\n document.getElementById('cookiestr').innerHTML = '';\n\n const cookie = `${key}=; expires=Thu, 01 Jan 1970 00:00:00 UTC`;\n document.cookie = cookie;\n}", "function deleteRememberCookie(name) {\n\n\tvar domains = document.domain;\n\tvar lastIndex = domains.lastIndexOf(\".\");\t\n\tvar lastPart = domains.substring(lastIndex+1, domains.length);\n\tvar domainsRemovedLast = domains.substring(0,lastIndex);\n\tvar secondLastIndex = domainsRemovedLast.lastIndexOf(\".\");\n\tvar secontLastPart = domainsRemovedLast.substring(secondLastIndex+1, domainsRemovedLast.length);\n\tvar cookieDomains = \".\"+secontLastPart + \".\" + lastPart;\n\t\n var domain_string = \"; domain=\" + cookieDomains;\n \n var cookieVal= name +\"=; max-age=0; path=/\" + domain_string;\n\tdocument.cookie = cookieVal;\n\n}", "function userLogout(){\r\n delCookie();\r\n}", "delete (name, options) {\n if (!name) {\n // remove all\n Object.keys(cookieUtils.getCookies()).forEach(name => cookieUtils._delete(name))\n return\n }\n\n cookieUtils._delete(name, options)\n }", "function DeleteCookie(name) {\n\n var exp = new Date();\n\n exp.setTime(exp.getTime() - 1); // This cookie is history\n\n // delete multiple cookies with the same name but break if more than 10\n // To handle WebDriver cookie creation errors\n\n var cval = GetCookie(name);\n\n if (cval != null) {\n\n document.cookie = name + \"=\" + cval + \"; expires=\" + exp.toGMTString();\n // try with multiple domains\n // to overcome issue if webdriver adds a 'dot'\n document.cookie = name + \"=\" + cval + \"; domain=.\" + document.domain + \"; expires=\" + exp.toGMTString();\n }\n\n}", "function destroyCookie(ctx, name, options) {\n var opts = __assign(__assign({}, (options || {})), { maxAge: -1 });\n if (ctx && ctx.res && ctx.res.setHeader && ctx.res.getHeader) {\n var cookies = ctx.res.getHeader('Set-Cookie') || [];\n if (typeof cookies === 'string')\n cookies = [cookies];\n if (typeof cookies === 'number')\n cookies = [];\n cookies.push(cookie.serialize(name, '', opts));\n ctx.res.setHeader('Set-Cookie', cookies);\n }\n if (isBrowser()) {\n document.cookie = cookie.serialize(name, '', opts);\n }\n return {};\n}", "function logout() {\n //$cookies.remove('token');\n }", "function logout() {\n //$cookies.remove('token');\n }", "function RemoveCookie(cookie_name, path, domain)\n{\n if (GetCookie(cookie_name))\n {\n var cookie_data = \"\";\n if (path)\n {\n cookie_data += \";path=\" + path;\n }\n if (domain)\n {\n cookie_data += \";domain=\" + domain;\n }\n document.cookie = cookie_name + \"=\" + cookie_data + \";expires=Thu, 01-Jan-1970 00:00:01 GMT\";\n }\n}", "logout() {\n document.cookie = \"username=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;\";\n }", "clearTokenCookies() {\n this.cookies.set('token', null);\n }", "Removed ({ commit }, cname) {\n let cookie = Cookies.get(cname);\n if ( cookie ) {\n Cookies.remove(cname);\n }\n }", "function unsetLocationCookieTime(){\n document.cookie=\"setLocationTime=\" + '';\n // var setLocationTime = getCookie(\"setLocationTime\");\n}", "function delete_cookies() {\r\n document.cookie= \"nagvis_session=;path=/nagvis;expires=Fri, 3 Aug 1970 20:47:11 UTC\";\r\n document.cookie= \"Cacti=;path=/;expires=Fri, 3 Aug 1970 20:47:11 UTC\";\r\n document.cookie= \"restriction_type=;path=/;expires=Fri, 3 Aug 1970 20:47:11 UTC\";\r\n document.cookie= \"auth_hg_list=;path=/;expires=Fri, 3 Aug 1970 20:47:11 UTC\";\r\n document.cookie= \"auth_sg_list=;path=/;expires=Fri, 3 Aug 1970 20:47:11 UTC\";\r\n document.cookie= \"JOSSO_SESSIONID=;path=/portal;expires=Fri, 3 Aug 1970 20:47:11 UTC\";\r\n document.cookie= \"JSESSIONID=;path=/;expires=Fri, 3 Aug 1970 20:47:11 UTC\";\r\n document.cookie= \"CGISESSID=;path=/;expires=Fri, 3 Aug 1970 20:47:11 UTC\";\r\n document.cookie= \"PHPSESSID=;path=/;expires=Fri, 3 Aug 1970 20:47:11 UTC\";\r\n return true;\r\n}", "function fncDeleteCookie(strName, strPath, strDomain)\r\n {\r\n \tvar strSearch = strName + \"=\";\r\n\t// Check if there are any cookies\r\n\tif (document.cookie.length > 0)\r\n\t{\r\n\t\tstrStart = document.cookie.indexOf(strSearch);\r\n\t\t// Check if specified cookie exists\r\n\t\tif (strStart != -1)\r\n\t\t{\r\n \t\tdocument.cookie = strName + \"=\" + ((strPath) ? \"; path=\" + strPath : \"\") + ((strDomain) ? \"; domain=\" + strDomain : \"\") + \"; expires=Thu, 01-Jan-70 00:00:01 GMT\";\r\n\t\t}\r\n\t}\r\n }", "function destroyCookie(ctx, name, options) {\n /**\n * We forward the request destroy to setCookie function\n * as it is the same function with modified maxAge value.\n */\n return setCookie(ctx, name, '', __assign(__assign({}, (options || {})), { maxAge: -1 }));\n}", "function destroyCookie(ctx, name, options) {\n /**\n * We forward the request destroy to setCookie function\n * as it is the same function with modified maxAge value.\n */\n return setCookie(ctx, name, '', __assign(__assign({}, (options || {})), { maxAge: -1 }));\n}", "function clearCookie(name) {\n if (typeof document !== 'undefined') {\n document.cookie = name + '=;expires=Thu, 01 Jan 1970 00:00:01 GMT;';\n }\n\n return null;\n}" ]
[ "0.82916725", "0.8238889", "0.80935127", "0.795698", "0.7950102", "0.7918675", "0.7915504", "0.7909354", "0.7888002", "0.788007", "0.7870467", "0.7867997", "0.7858775", "0.78446335", "0.783574", "0.78317606", "0.7823664", "0.7794561", "0.77668893", "0.77474403", "0.77438724", "0.7694203", "0.7683581", "0.7677695", "0.76612127", "0.76436216", "0.7625288", "0.7618441", "0.7610517", "0.75935125", "0.7585359", "0.75779355", "0.7567371", "0.7554434", "0.75206006", "0.75206006", "0.7498454", "0.7488212", "0.7478852", "0.7455926", "0.7447348", "0.7445403", "0.74445695", "0.743203", "0.7415157", "0.74144685", "0.74084914", "0.73920256", "0.73838127", "0.73765177", "0.7373797", "0.7355546", "0.7350187", "0.7347572", "0.7342656", "0.7338813", "0.73387104", "0.7333762", "0.7322083", "0.7322083", "0.73203695", "0.731194", "0.7311401", "0.7311193", "0.7307142", "0.7306827", "0.7286376", "0.7246428", "0.7246007", "0.7239046", "0.7226719", "0.72216076", "0.72185695", "0.7215545", "0.72095126", "0.7205631", "0.72025543", "0.71889496", "0.71611005", "0.71611005", "0.7051498", "0.7032027", "0.7020253", "0.7014559", "0.69909173", "0.69862634", "0.6983582", "0.69460195", "0.69409513", "0.69409513", "0.6932456", "0.69320005", "0.69171655", "0.68430525", "0.6838579", "0.6825297", "0.68177366", "0.6816331", "0.6816331", "0.68119675" ]
0.7958248
3
function for time and date showing using Moment.js
function time() { $('#currentDay').text(moment().format('LLLL')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayTime() {\n var rightNow = moment().format(\"MMM DD, YYYY [:] hh:mm:ss a\");\n timeDisplayEl.text(rightNow);\n}", "function time() {\n $('span').html(moment().format());\n}", "function displayTime() {\n var curr = moment().format(\"MM-DD-YYYY HH:mm:ss\");\n currentDayEl.text(curr);\n}", "function displayTime() {\n var rightNow = moment().format('MMM DD, YYYY [at] hh:mm:ss a');\n timeDisplayEl.text(rightNow);\n}", "function currentTime(){\n var getHour = moment().format('HH');\n var getMin = moment().format('mm');\n var getMonth = moment().format('MMMM');\n var getDay = moment().format('Do');\n var getYear = moment().format('YYYY');\n $('.month').text(getMonth);\n $('.day').text(getDay);\n $('.year').text(getYear);\n $('.hours').text(getHour);\n $('.min').text(getMin);\n }", "function dateTime() {\n $(\"#dateTime\").text(moment().format('MMMM Do YYYY, h:mm a'));\n }", "function displayDateTime() {\n $(\"#currentDay\").text(\"Today is: \" + moment().format(\"dddd, MMMM Do YYYY\"));\n $(\"#currentTime\").text(\"Time is now: \" + moment().format(\"h:mm:ss A\"));\n }", "function updateDate() {\n date = moment()\n dateAndTime.html(date.format('dddd, MMMM Do YYYY, h:mm:ss a'))\n}", "function displayTime() {\n var rightNow = moment().format('LLLL');\n currentDayEl.text(rightNow);\n}", "function displayDateAndTime() {\n return new Date();\n}", "function getFormattedTime() {\n var today = new Date();\n //return moment(today).format(\"YYYYMMDDHHmmssSSS\");\n return moment(today).format(\"DDHHmmssSSS\");\n }", "function timeprocess(momentObject){\n var month = momentObject._d.getMonth()+1;\n var year = momentObject._d.getYear() + 1900;\n var date = momentObject._d.getDate();\n \n var mm = month.toString();\n var yyyy = year.toString();\n var dd = date.toString();\n\n if(date<10) {\n dd='0'+dd;\n } \n\n if(month<10) {\n mm='0'+mm;\n } \n\n return(yyyy + \"-\" + mm + \"-\" + dd); \n}", "function timeNow(){\n var now = moment().format('HH:mm')\n $(\"#current-time\").text(now)\n}", "function currentDate() {\n let date = moment().format(\"dddd MMMM Do YYYY \");\n $(\"#date\").html(\"<h5>\" + date + \"</h5>\");\n }", "function displayCurrentDate() {\nvar currentDate = moment().format(\"dddd, MMMM Do YYYY, h:mm:ss a\");\n$(\"#currentDay\").text(currentDate);\nconsole.log(currentDate);\n}", "function getFormattedTime() {\n var today = new Date();\n //return moment(today).format(\"YYYYMMDDHHmmssSSS\");\n return moment(today).format(\"YYYYMMDDHHmmss\");\n }", "showTime(time) {\n const current = new Date(time.time);\n\n const currentMonth = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"][current.getMonth()];\n const currentDay = current.getDate();\n const currentYear = current.getFullYear();\n\n const curTime = ui.formatTime(current);\n\n\n this.sunrise.innerHTML = ui.formatTime(new Date(time.sunrise));\n this.sunset.innerHTML = ui.formatTime(new Date(time.sunset));\n this.currentTime.innerHTML = `${curTime}, ${currentMonth} ${currentDay}, ${currentYear}`;\n }", "function handlebarsFormatDateForDisplay(){\r\n Handlebars.registerHelper('dateFormat', function(context, block) {\r\n if (window.moment) {\r\n return takeTime(context);\r\n }else{\r\n return context;\r\n };\r\n });\r\n }", "tipDateFormat(event) {\n var dateFormat = $('[data-date-format]').data('date-format'),\n timeFormat = $('[data-time-format]').data('time-format'),\n //format = dateFormat + \" \" + timeFormat,\n startDate = moment(event.start),\n endDate = moment(event.end),\n output = \"\";\n // Moment JS format Crafts Locale formats don't match up to PHP's date formst.\n let format = \"MMM D, YYYY h:m a\";\n\n //console.log(format);\n\n\n if (event.allDay) {\n if (event.multiDay) {\n //output += Craft.t(\"All Day from\");\n //output += \" \" + startDate.format(format) + \" \" + Craft.t(\"to\") + \" \" + endDate.format(format);\n output += \"<div><strong>\" + Craft.t(\"venti\", \"Begins\") + \":</strong> \" + startDate.format(format);\n output += \"</div><div>\";\n output += \"<strong>\" + Craft.t(\"venti\", \"Ends\") + \":</strong> \" + endDate.format(format);\n output += \"</div>\";\n } else {\n //output += Craft.t(\"All Day from\");\n //output += \" \" + startDate.format(format) + \" \" + Craft.t(\"to\") + \" \" + endDate.format(timeFormat);\n output += \"<strong>\" + Craft.t(\"venti\", \"Begins\") + \":</strong> \" + startDate.format(format);\n output += \"</div><div>\";\n output += \"<strong>\" + Craft.t(\"venti\", \"Ends\") + \":</strong> \" + endDate.format(timeFormat);\n output += \"</div>\";\n }\n } else {\n if (event.multiDay) {\n //output += \" \" + startDate.format(format) + \" \" + Craft.t(\"to\") + \" \" + endDate.format(format);\n output += \"<div><strong>\" + Craft.t(\"venti\", \"Begins\") + \":</strong> \" + startDate.format(format);\n output += \"</div><div>\";\n output += \"<strong>\" + Craft.t(\"venti\", \"Ends\") + \":</strong> \" + endDate.format(format);\n output += \"</div>\";\n } else {\n //output += \" \" + startDate.format(format) + \" \" + Craft.t(\"to\") + \" \" + endDate.format(timeFormat);\n output += \"<div><strong>\" + Craft.t(\"venti\", \"Begins\") + \":</strong> \" + startDate.format(format);\n output += \"</div><div>\";\n output += \"<strong>\" + Craft.t(\"venti\", \"Ends\") + \":</strong> \" + endDate.format(timeFormat);\n output += \"</div>\";\n }\n }\n\n return output;\n }", "function presentingTime() {\n let array_of_months = [\n \"জানুয়ারি\",\n \"ফেব্রুয়ারি\",\n \"মার্চ\",\n \"এপ্রিল\",\n \"মে\",\n \"জুন\",\n \"জুলাই\",\n \"অগাস্ট\",\n \"সেপ্টেম্বর\",\n \"অক্টোবর\",\n \"নভেম্বর\",\n \"ডিসেম্বর\",\n ];\n let array_of_day = [\n \"রবিবার\",\n \"সোমবার\",\n \"মঙ্গলবার\",\n \"বুধবার\",\n \"বৃহস্পতিবার\",\n \"শুক্রবার\",\n \"শনিবার\",\n ];\n let date = new Date();\n let hr = date.getHours();\n let year = date.getFullYear();\n let month = date.getMonth();\n let _date = date.getDate();\n let day = date.getDay();\n\n let day_night = \"\";\n if (hr > 4 && hr < 12) {\n day_night = \"সকাল\";\n } else if (hr > 11 && hr < 15) {\n day_night = \"দুপুর\";\n } else if (hr >= 15 && hr < 18) {\n day_night = \"বিকাল\";\n } else if (hr > 17 && hr < 19) {\n day_night = \"সন্ধ্যা\";\n } else {\n day_night = \"রাত\";\n }\n\n day_night_time.innerHTML = `${array_of_day[day]}, ${english_digit_to_bangla(\n _date\n )}-${array_of_months[month]}-${english_digit_to_bangla(year)} (${day_night})`;\n}", "function displayDate(){\n //Get current date \n currentDateElement.text(moment().format('dddd, MMMM Do YYYY'));\n}", "function timeManagement() {\n var day = $(\"#currentDay\"); \n var date = moment().format('llll').toString();\n day.text(date);\n var ampm = date.split(\" \");\n hour = parseInt(moment().format('LT').toString());\n if (ampm[5] === \"PM\") {\n hour = hour + 12;\n return hour;\n }\n return hour;\n }", "function clock() {\n var currTime = moment().format('MMMM Do YYYY, h:mm:ss a');\n $('#currentDay').html(currTime);\n}", "function CurrentDate() {\n var d = new Date();\n var fmt1 = 'dddd MMMM Do ';\n var now = moment(d).format(fmt1); \n // var currentHour= moment().format('HH');\n $(\"#currentDay\").text(now);\n console.log(now);\n\n SavedSchedule ()\n\n}", "changeTimeFormatByTime(time) {\n if(time > moment().subtract(1, 'minutes')) {\n return time.startOf('second').fromNow();\n } else if(time > moment().subtract(1, 'hours')) {\n return time.startOf('minute').fromNow();\n } else if(time > moment().subtract(1, 'days')) {\n return time.format('h:mm:ss a');\n } else if(time > moment().subtract(1, 'years')) {\n return time.format(\"MMM Do\");\n } else {\n return time.format(\"MMM Do YYYY\");\n }\n }", "function momentTime(){\n\tvar d = new Date();\n\tvar ms='';\n\tvar utcTimeReadable='';\n\tif(d.getUTCMilliseconds()<10){\n\t\t\tms = '00'+d.getUTCMilliseconds();\n\t\t}\n\telse if((d.getUTCMilliseconds()>=10)&&(d.getUTCMilliseconds()<100)){\n\t\t\tms='0'+d.getUTCMilliseconds();\n\t\t}\n\telse{\n\t\t\tms=d.getUTCMilliseconds();\n\t}\n\tutcTimeReadable = d.getUTCFullYear()+''\n\t\t+((d.getUTCMonth()+1)<10?('0'+(d.getUTCMonth()+1)):(d.getUTCMonth()+1))+''\n\t\t+(d.getUTCDate()<10?('0'+d.getUTCDate()):d.getUTCDate())+''\n\t\t+(d.getUTCHours()<10?('0'+d.getUTCHours()):d.getUTCHours())+''\n\t\t+(d.getUTCMinutes()<10?('0'+d.getUTCMinutes()):d.getUTCMinutes())+''\n\t\t+(d.getUTCSeconds()<10?('0'+d.getUTCSeconds()):d.getUTCSeconds())+''+ms;\n\t\treturn utcTimeReadable;\n}", "renderDate() {\n return moment.utc(this.props.party.date).format('MM/DD/YYYY [at] h:mm A');\n }", "function show_date(){\r\n\tvar date = new Date();\r\n\tvar get_date = date.getDate();\r\n\tvar get_month = date.getMonth();\r\n\tvar get_year = date.getFullYear();\r\n\tvar get_time = date.toLocaleTimeString();\r\n\tdocument.getElementById(\"date\").innerHTML = \"Date : \"+get_date+\"/\"+Number(get_month+1)+\"/\"+get_year;\r\n\tdocument.getElementById(\"time\").innerHTML = \"Time : \"+get_time;\r\n\r\n\r\n}", "function updateTime() {\n document.getElementById('uren_minuten').innerHTML = moment().format('H:mm');\n document.getElementById('dag_datum').innerHTML = moment().format('dddd, MMMM Do');\n document.getElementById(\"tijd\").classList.add('fadeInDown');\n}", "function displayTimes() {\n\n // iterate through the daySchedule object then display the corresponding value in the time container on the page\n for (var t = 0; t < daySchedule.length; t++) {\n\n // set the format for the currentTime\n $('#time-' + t).text(moment(daySchedule[t].time, \"HH\").format(\"h A\"));\n\n }\n}", "function displayDateandTime() {\n let date = new Date();\n let day = date.getDate();\n let month = date.getMonth() + 1;\n let year = date.getFullYear();\n let hour = date.getHours();\n let minute = date.getMinutes();\n const dateandtime = `${day}/${month}/${year} ${hour}:${minute}`;\n return dateandtime;\n\n}", "function dayTime() {\n // set the current time format\n currentTime = moment().format('dddd, MMMM Do YYYY, h:mm:ss a');\n\n // Empty the curent day element\n $('#currentDay').empty();\n\n // Display the current time\n $('#currentDay').text(currentTime);\n}", "function ShowTime() {\n $(\"#hdrDateTime\").html(formatAMPM());\n}", "function showDateTime() {\n let dt = new Date();\n let month = dt.getMonth() + 1;\n let day = dt.getDate();\n let year = dt.getFullYear();\n let hour = dt.getHours();\n hour = hour < 9 ? 0 + `${hour}` : hour;\n month = month < 9 ? 0 + `${month}` : month;\n let minutes = dt.getMinutes();\n\n console.log(`${day}/${month}/${year} ${hour}:${minutes}`);\n}", "function clock() {\n var dateString = moment().format('MMMM Do YYYY, h:mm:ss a');\n $('#currentDay').html(dateString);\n}", "function displayTime() {\n currDate = moment().format(\"dddd, MMMM Do YYYY, h:mm:ss a\");\n currentDayEl.html(currDate);\n currM = moment().format('m');\n currh = parseInt(moment().format(\"H\"));\n if(parseInt(currM)+0 === 0 && currh > prevHour){ /// This check is set the active hour automatically\n setBGClass();\n }\n}", "toShowCompletedDate(){\n return `${this.toShowDate()}, ${this.toShowTime()}`;\n }", "function getTimeHour(time){\n\n return moment(today + ' ' + time, \"dddd, MMMM Do YYYY hh:00 A\").format(\"MM-DD-YYYY hh:00 A\") ;\n\n}", "function currentTime() {\n let day = moment().format(\"MMM Do YYYY, HH:mm:ss\");\n currentDay.text(day);\n}", "function currentTime() {\n var timeNow = moment().format('h:mm a')\n $(\"#currentTime\").text(timeNow)\n }", "function renderDates(data) {\n\tvar sunrise = new Date(1000 * data.sys.sunrise);\n\tvar sunset = new Date(1000 * data.sys.sunset);\n\n outputSunrise.textContent = moment(sunrise).format(\"HH:mm\");\n outputSunset.textContent = moment(sunset).format(\"HH:mm\");\n\t\n}", "function getHeaderDate() {\n var currentHeaderDate = moment().format('MMMM Do YYYY, h:mm:ss a');\n $(\"#currentDay\").text(currentHeaderDate);\n}", "function inspect(){if(!this.isValid()){return'moment.invalid(/* '+this._i+' */)';}var func='moment';var zone='';if(!this.isLocal()){func=this.utcOffset()===0?'moment.utc':'moment.parseZone';zone='Z';}var prefix='['+func+'(\"]';var year=0<=this.year()&&this.year()<=9999?'YYYY':'YYYYYY';var datetime='-MM-DD[T]HH:mm:ss.SSS';var suffix=zone+'[\")]';return this.format(prefix+year+datetime+suffix);}", "function inspect(){if(!this.isValid()){return'moment.invalid(/* '+this._i+' */)';}var func='moment';var zone='';if(!this.isLocal()){func=this.utcOffset()===0?'moment.utc':'moment.parseZone';zone='Z';}var prefix='['+func+'(\"]';var year=0<=this.year()&&this.year()<=9999?'YYYY':'YYYYYY';var datetime='-MM-DD[T]HH:mm:ss.SSS';var suffix=zone+'[\")]';return this.format(prefix+year+datetime+suffix);}", "function displayDate() {\r\n var now = moment().format('MMMM Do YYYY, h:mm:ss');\r\n $('#currentDay').html(now)\r\n setTimeout(displayDate, 1000);\r\n}", "function formatDateForResults(isoDate) {\n var timeStr = moment(isoDate).format('hh:mm A');\n var dateStr = moment(isoDate).format(' ddd, DD MMM');\n var timezoneStr = 'timezone: UTC ' + moment(isoDate).format('Z');\n var htmlDate = '<p><strong>' + timeStr + '</strong>' + dateStr + '</p>' + '<p>' + timezoneStr + '</p>';\n return htmlDate; \n }", "function currentTimeInterval() {\n currentTime = moment().format(\"MMMM Do YYYY, h:mm:ss a\");\n $(\"#currentTime\").text(currentTime);\n}", "function displayCurrentDate() {\n var currentDate = moment().format(\"YYYY-MMMM-DD\");\n $(\"#currentDay\").text(currentDate);\n}", "function setTime() {\n var time = moment().format(\"LLLL\");\n return time;\n}", "function showTime() {\n\n var d = new Date();\n\n if (d.getMinutes().length < 2) {\n currTime = monthNames[d.getMonth()] + '.' + d.getDate() + '.' + d.getFullYear() + ' | ' + d.getHours() + ':0' + d.getMinutes();\n } else {\n currTime = monthNames[d.getMonth()] + '.' + d.getDate() + '.' + d.getFullYear() + ' | ' + d.getHours() + ':' + d.getMinutes();\n }\n\n $('.time').html(currTime);\n }", "function timer() {\n let currentTimeAndDate = moment();\n $(\"#currentTime\").text(currentTimeAndDate.format(\"LTS\"));\n $(\"#currentDay\").text(currentTimeAndDate.format(\"dddd, MMMM Do, YYYY\"));\n}", "function displayTime() {\n var time = moment().format('HH:mm:ss');\n $('#clock').html(time);\n setTimeout(displayTime, 1000);\n }", "function renderDate(){\n // Show current day\n var today = moment().format('Do MMMM YYYY');\n $(\".date0\").text(today);\n let dayArray = []\n for (i = 1 ; i < 5 ; i++){\n dayArray[i] = moment().add(i,'days').format('Do MMMM YYYY');\n $(\".date\"+i).text(dayArray[i]);\n }\n \n }", "function renderDate() {\n if (myStorage.getItem(\"use24hr\") == \"true\") {\n $(\"#currentDay\").text(moment().format(\"MMMM Do YYYY, H:mm:\"));\n } else {\n $(\"#currentDay\").text(moment().format(\"MMMM Do YYYY, h:mm:\"));\n }\n }", "setDisplayDateTime() {\n this.displayDate = this.currentDate.toLocaleDateString(this._locale, {\n day: '2-digit',\n month: 'long',\n year: 'numeric'\n });\n this.displayTime = this.currentDate.toLocaleTimeString(this._locale);\n }", "dateForHumans(item) {\n if (!item.date) return \"\";\n let startDate = DateTime.fromISO(item.date).toFormat(\"d LLLL yyyy\");\n if (!item.time && !item.enddate) return startDate;\n if (item.time) return `${startDate} at ${item.time}`;\n if (!item.enddate) return startDate;\n\n let endDate = DateTime.fromISO(item.enddate).toFormat(\"d LLLL yyyy\");\n return `${startDate} to ${endDate}`;\n }", "date_fmt (date, force_time_only) {\n const dt = moment(new Date(parseInt(date)));\n if (force_time_only || dt.isSame(new Date(), \"day\")) {\n console.log(dt)\n return dt.format(\"HH:mm:ss.SSS\");\n }\n else {\n return dt.format(\"L HH:mm:ss.SSS\");\n }\n }", "viewDateMoment () {\n const m = moment(this.props.viewDate)\n return function () {\n return m.clone()\n }\n }", "function showDateTime() {\n let currentDateTime = new Date();\n let hours =\n currentDateTime.getHours() < 10\n ? \"0\" + currentDateTime.getHours()\n : currentDateTime.getHours();\n\n let mins =\n currentDateTime.getMinutes() < 10\n ? \"0\" + currentDateTime.getMinutes()\n : currentDateTime.getMinutes();\n let secs =\n currentDateTime.getSeconds() < 10\n ? \"0\" + currentDateTime.getSeconds()\n : currentDateTime.getSeconds();\n\n dateTime.innerHTML = hours + \":\" + mins + \":\" + secs;\n}", "function getTimeStamp(){\n var t = moment().format('Do MMM YYYY [|] HH:mm [|] ');\n return t;\n}", "function getFormattedTime() {\n var today = new Date();\n\n return moment(today).format(\"YYYYMMDDHHmmss\");\n }", "function displayTime(){\r\n\tvar elt = \"#day\";\r\n\tvar now = new Date();\r\n\t$(elt).append(now.getDate()+\"/\"+(now.getMonth()+1) + \"/\"+now.getFullYear()+\" \"+(now.getHours())+\":\"+(now.getMinutes()+1)+\":\"+(now.getSeconds()+1));\r\n\r\n}", "function showTime() {\n let today = new Date(),\n hour = today.getHours(),\n min = today.getMinutes(),\n sec = today.getSeconds();\n weekDay = today.getDay();\n day = today.getDate();\n month = today.getMonth();\n\n\n // Set AM or PM\n //const amPm = hour >= 12 ? 'PM' : 'AM';\n\n // 12hr Format\n // hour = hour % 12 || 12;\n\n // Output Time\n time.innerHTML = `${hour}<span>:</span>${addZero(min)}<span>:</span>${addZero(\n sec\n )}`;\n date.innerHTML = `${DAYS[weekDay]}<span> </span>${day}<span> </span>${MONTHS[month]}`;\n //${showAmPm ? amPm : ''}`;\n\n setTimeout(showTime, 1000);\n}", "function getDateString(moment){\n return moment.toLocaleDateString('en-US',\n {year:'numeric'\n ,month:'long',\n day:'numeric'})\n}", "function getTime() {\n var displayTime\n document.getElementById('time').innerHTML = moment().format('h:mm')\n clearInterval(displayTime)\n displayTime = setInterval(function() {\n document.getElementById('time').innerHTML = moment().format('h:mm')\n }, 1000)\n}", "customDateHtml(date){\n\t\treturn moment(date).date(); //day of month\n\t}", "function showTime(){\n // let today=new Date(2020,06,10,08,33,30);{Testing purpose}\n let today=new Date(),\n date=today.getDate(),\n hour=today.getHours(),\n min=today.getMinutes(),\n sec=today.getSeconds();\n\n //Set AM or PM using ternanary operator(Shortend)\n const amPm=hour >= 12 ? 'PM' :'AM' ;\n\n //12 hour format\n hour = hour % 12 || 12;\n time.innerHTML=`${hour}<span>:</span>${addZero(min)}<span>:</span>${addZero(sec)} ${showAmPm ? amPm :''}`;\n setTimeout(showTime,1000); \n\n }", "function headerDate() {\n var currentHeaderDate = moment().format('dddd, MMMM Do');\n $(\"#currentDay\").text(currentHeaderDate);\n}", "function show_date() {\n let time = document.getElementById('time');\n time.innerHTML = Date();\n}", "setDisplayDateTime() {\n this._displayTime = new Date().toLocaleTimeString(this._locale);\n this._displayDate = new Date().toLocaleDateString(this._locale,\n {\n day: \"2-digit\",\n month: \"long\",\n year: \"numeric\"\n }\n );\n }", "function getCurrentTime(){\n return '[' + moment.format(\"HH:mm\") + '] ';\n}", "function displayTime() {\n var today = new Date();\n \n //gathers information about current hour, min and sec. \n //Add zero at the head if it is a single digit number.\n var currentHour = addZero(today.getHours());\n var currentMin = addZero(today.getMinutes());\n var currentSec = addZero(today.getSeconds());\n \n // for formatting the display.\n hourElement.innerHTML = currentHour + \":\";\n minElement.innerHTML = currentMin + \":\";\n secElement.innerHTML = currentSec;\n }", "function render_datetime(data){\n\t var datetime = data.split(' ');\n\t var date = datetime[0].split('-').reverse().join('/');\n\t var time = datetime[1].substring(0,5);\n\t return date+' às '+time;\n\t}", "setTime () {\n this.clock.time = moment()\n .local()\n .format(\"dddd, MMMM Do YYYY, h:mm:ss A\")\n }", "function change_to_readable(time) {\n var momentTimeDate = moment.duration(time)._data;\n var readableString = [];\n\n if (momentTimeDate.years) {\n readableString.push(momentTimeDate.years + ' Year' + (momentTimeDate.years > 1 ? 's' : ''));\n }\n if (momentTimeDate.months) {\n readableString.push(momentTimeDate.months + ' Month' + (momentTimeDate.months > 1 ? 's' : ''));\n }\n if (momentTimeDate.days) {\n readableString.push(momentTimeDate.days + ' Day' + (momentTimeDate.days > 1 ? 's' : ''));\n }\n if (momentTimeDate.hours) {\n readableString.push(momentTimeDate.hours + ' Hour' + (momentTimeDate.hours > 1 ? 's' : ''));\n }\n if (momentTimeDate.minutes) {\n readableString.push(momentTimeDate.minutes + ' Minute' + (momentTimeDate.minutes > 1 ? 's' : ''));\n }\n if (momentTimeDate.seconds) {\n readableString.push(momentTimeDate.seconds + ' Second' + (momentTimeDate.seconds > 1 ? 's' : ''));\n }\n if (momentTimeDate.milliseconds) {\n readableString.push(momentTimeDate.milliseconds + ' Milli-Second' + (momentTimeDate.milliseconds > 1 ? 's' : ''));\n }\n return readableString.join(' & ');\n}", "function showTime(){\n var myDate = new Date();\n var hours = myDate.getHours();\n var minutes = myDate.getMinutes();\n var seconds = myDate.getSeconds();\n myDate = myDate.toLocaleDateString();\n if (hours < 10) hours = 0 + hours;\n if (minutes < 10) minutes = \"0\" + minutes;\n if (seconds < 10) seconds = \"0\" + seconds;\n $(\"#HoraActual\").text(\"Hora y Fecha: \" +hours+ \":\" +minutes+ \":\" +seconds+ \" - \" +myDate);\n}", "function currentDay () {\n var currentDay = moment().format('dddd, MMMM Do YYYY, h:mm:ss a')\n $('#currentDay').html(currentDay)\n}", "function updateDateAndTime() {\n var currentDay = $(\"#currentDay\");\n var currentTime = $(\"#currentTime\");\n currentDay.innerHTML = \"\";\n currentTime.innerHtml = \"\";\n currentDay.text(\"Today is \" + moment().format('dddd') + \", \" +moment().format('ll')) \n currentTime.text(\"Current time is \" + moment().format('LT'))\n}", "function setScreenDate() {\n var scr_date_n = new Date().getTime();\n screenDate = moment(scr_date_n).format('LLLL');\n $(\"#currdate\").empty();\n $(\"#currdate\").text(screenDate);\n screenDatetemp = scr_date_n;\n}", "formatDate(value, format) {\n format = format || '';\n if (value) {\n return window.moment(value)\n .format(format);\n }\n return \"n/a\";\n }", "static getDateTimeString() {\n return `[${moment().format(\"DD.MM.YYYY HH:mm\")}] `;\n }", "function showTime() {\r\n // stocam in variabila time un string cu ora curenta obtinut din libraria moment.js\r\n const time = moment().format(\"HH:mm:ss\");\r\n // orice e in elementul clockContainer va fi rescris.\r\n clockContainer.innerHTML = time;\r\n // trimitem functia ca parametru in metoda requestAnimationFrame de pe obiectul window.\r\n window.requestAnimationFrame(showTime);\r\n}", "function displayDate() {\n let currentDay = $(\"#currentDay\").text(momentVar);\n return currentDay;\n \n }", "function setSadAnimalDateTime() {\n document.getElementById(\"timedate\").innerHTML = formatAMPM();\n}", "function displayCurrentTime() {\n setInterval(function(){\n $('#current-time').html(moment().format('HH:mm'))\n }, 1000);\n }", "static momentToFormat1(momentObj)\n\t{\n\t\tlet datetime = Moment(momentObj);\n\n\t\treturn (datetime.format('ddd, DD MMM YYYY h:mm A'));\n\t}", "toView(value) {\n return moment(value).format('MMMM D, YYYY')\n }", "function displayTime(dateob) {\n var hours = dateob.getHours(); //Current Hours\n var min = dateob.getMinutes(); //Current Minutes\n var base12Hour = hours % 12 !== 0 ? hours % 12 : 12;\n if (min < 10) {\n min = \"0\" + min;\n }\n var meridian = hours < 12 ? \"AM\" : \"PM\";\n return base12Hour + \":\" + min + \" \" + meridian;\n}", "function formatDate(date) {\n return moment(date).format(\"dddd, MMMM Do YY\");\n \n}", "function currentMoment(){\nlet currentTime = new Date(); //current date and time\nconsole.log(currentTime);\n\n//hoursElement.innerHTML = timestamp.getHours();\n//minutesElement.innerHTML = timestamp.getMinutes();\n//secondsElement.innerHTML = timestamp.getSeconds();\n\n\nconsole.log('Year:' + currentTime.getFullYear());//get current year\nconsole.log('Month:' + currentTime.getMonth());//get current month\nconsole.log('Date:' + currentTime.getDate());//get current date\nconsole.log('Hours:' + currentTime.getHours());\nconsole.log('Minutes:' + currentTime.getMinutes());\nconsole.log('Seconds:' + currentTime.getSeconds());\nconsole.log('Day:' + currentTime.getDay());\nconsole.log('Time:' + currentTime.getTime());\n\nreturn currentTime;\n}", "function inspect(){if(!this.isValid()){return 'moment.invalid(/* ' + this._i + ' */)';}var func='moment';var zone='';if(!this.isLocal()){func = this.utcOffset() === 0?'moment.utc':'moment.parseZone';zone = 'Z';}var prefix='[' + func + '(\"]';var year=0 <= this.year() && this.year() <= 9999?'YYYY':'YYYYYY';var datetime='-MM-DD[T]HH:mm:ss.SSS';var suffix=zone + '[\")]';return this.format(prefix + year + datetime + suffix);}", "function handleDateTime(mode, time) {\n if (time) {\n switch(mode) {\n case \"realTime\":\n return `${extractIsotime(time)}`;\n case \"dateTime\":\n return `${moment(time[0]).format(\"DD-MMM-YYYY HH:mm:ss\")} - ${moment(time[1]).format(\"DD-MMM-YYYY HH:mm:ss\")}`;\n default:\n return \"\";\n }\n } else {\n return \"\";\n }\n}", "function showDate() {\n let date = new Date();\n let year = date.getFullYear();\n let month = date.getMonth();\n let day = date.getDay();\n let hour = date.getHours();\n let minutes = date.getMinutes();\n\n console.log(`0${day}/0${month}/${year} ${hour}:${minutes}`);\n}", "function displayCurrentDay() {\n\tlet initMoment = moment().format(\"dddd Do, MMMM YYYY\");\n\t$(\"#currentDay\").text(initMoment);\n}", "setDisplayDateTime() {\n this.displayDate = this.currentDate.toLocaleDateString(this._locale)\n this.displayTime = this.currentDate.toLocaleTimeString(this._locale)\n }", "renderDateTitle(date) {\n return moment(date).format(\"dddd\") + \", \" + moment(date).format(\"MMMM Do\");\n }", "function t(a){return b.isMoment(a)&&(a=a.day()),P[a]}", "function display_month(data_moment){\n //svuoto il calendario\n $('#calendario').empty();\n\n //clono l'oggetto moment per usarlo per il data-day\n var date = data_moment.clone();\n\n //numero giorni del mese da visualizzare\n var days_of_month = date.daysInMonth();\n //mese testuale\n var text_month = date.format('MMMM');\n text_month = text_month.charAt(0).toUpperCase() + text_month.slice(1);\n //giorno della settimana in numero\n var day_of_week = date.day();\n //mese in numero\n var month = date.month();\n //anno in numero\n var year = date.year();\n\n //popolo dinaminamente il mese che appare come titolo\n $('#current_month').text(text_month);\n\n //devo stampare dei li vuoti per i giorni mancanti dall'inizio\n display_empty_block(day_of_week);\n //devo stampare i giorni\n display_days(days_of_month, date);\n //richiamo funzione per stampare le festività\n display_holiday(start_moment);\n }", "function formatTime(paras){\n paras.tweets.forEach(tweet=>{\n tweet.created_at = moment(tweet.created_at).fromNow();\n })\n\n }", "function tick() {\n dayEl.text(moment().format('LL'));\n timeEl.text(moment().format('hh:mm A'));\n $('.jumbotron').append(dayEl);\n $('.jumbotron').append(timeEl);\n}" ]
[ "0.73030645", "0.72945946", "0.72613907", "0.7187141", "0.7167462", "0.7119221", "0.7063596", "0.7029903", "0.6876256", "0.6823548", "0.67528963", "0.6738201", "0.67371815", "0.6736008", "0.6722044", "0.6691734", "0.665026", "0.66279733", "0.66225696", "0.660743", "0.6586442", "0.6580173", "0.656678", "0.656421", "0.65575874", "0.654943", "0.6533633", "0.65290165", "0.65072316", "0.6491188", "0.64854825", "0.64837813", "0.644897", "0.6431278", "0.64260143", "0.6391628", "0.63903236", "0.63779247", "0.63718736", "0.6371749", "0.6367687", "0.6364321", "0.6348455", "0.6348455", "0.633904", "0.6333538", "0.63303906", "0.63252306", "0.6324327", "0.63144135", "0.6299598", "0.6293433", "0.62923", "0.6292012", "0.6291382", "0.62702763", "0.6261957", "0.62594134", "0.6258004", "0.6257596", "0.6240946", "0.62383735", "0.62281185", "0.62242246", "0.6217411", "0.6213051", "0.62067467", "0.62057185", "0.61788404", "0.61732334", "0.6164444", "0.6160157", "0.61569774", "0.615564", "0.61409706", "0.6137473", "0.6135546", "0.6130748", "0.6125888", "0.6119157", "0.61188865", "0.6116989", "0.61142516", "0.61115444", "0.6109625", "0.6107292", "0.61056286", "0.61009926", "0.60636413", "0.6049653", "0.60250884", "0.6019325", "0.60187185", "0.601712", "0.6014896", "0.6014605", "0.60137653", "0.6013454", "0.6013158", "0.6010413" ]
0.663714
17
generate time blocks dynamically when page loads
function generateBlocks(){ for(let i = 9; i<18 ;i++){ $(".container").append(` <div class="row time-block"> <h2 class="hour col-2">${i<12 ? i+":00AM" : i>12? i-12+":00PM" : "12:00PM"}</h2> <textarea class="description col-8 ${i>hour ? "future" : i<hour ? "past" : "present"}" type="text">${todo[i] || ""}</textarea> <button id="${i}" class="saveBtn col-2">Save</button> </div>`) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setUpBlocks(start, end, thisDate) {\n // console.log(thisDate.format(\"M\"));\n for (var i = start; i <= end; i++) {\n var timeOfDay = i;\n var displayTime = timeOfDay;\n var suff = \"<span class='time-suffix'>a.m.</span>\";\n if (displayTime > 12) {\n displayTime -= 12;\n suff = \"<span class='time-suffix'>p.m.</span>\";\n }\n if (displayTime === 12) suff = \"<span class='time-suffix'>p.m.</span>\";\n\n // The id will be set to the time of day, 24-hour time\n\n // But the time will be displayed in 12-hour time\n displayTime = displayTime.toString() + \":00 \" + suff;\n // $(\"#displayTime-block-section\").append(newTimeBlock(displayTime, timeOfDay, thisDate).attr(\"id\", timeOfDay));\n $(\"#time-block-section\").append(newTimeBlock(displayTime, timeOfDay, thisDate));\n populateEventText(timeOfDay, thisDate);\n }\n}", "function generateTimeBlocks()\n {\n timeBlock.empty();\n\n console.log(startTime);\n console.log(endTime);\n\n for (let i=startTime; i<=endTime; i++)\n {\n let row = $(\"<div>\").addClass(\"row\").attr(\"data-time\", i);\n let timeEl = $(\"<div>\").addClass(\"col-1 hour\")\n let descriptionEl = $(\"<textarea>\").addClass(\"col-10 description\");\n let saveBtnEl = $(\"<button>\").addClass(\"col-1 saveBtn\").text(\"Save\");\n\n if(timeFormat === \"12\")\n {\n timeEl.text(moment({hour:i}).format(\"h a\"));\n }\n else\n {\n timeEl.text(moment({hour:i}).format(\"H:mm\"));\n }\n\n row.append(timeEl, descriptionEl, saveBtnEl);\n timeBlock.append(row);\n }\n updateCurrentTime();\n setPastPresent();\n getSavedEvents();\n }", "function createTimerBlock() {\n for (var i = 0; i < day.length; i++) {\n var hour = day[i];\n var newTime = $(\"#template\").clone();\n newTime.removeAttr(\"id\");\n newTime.attr(\"data-time\", hour.mTime);\n newTime.find(\".hour\").text(hour.time);\n if (localCopy) {\n newTime.find(\"textarea\").val(hour.notes);\n }\n $(\".container\").append(newTime);\n }\n $(\"#template\").remove();\n }", "function initializeTimeBlocks() {\n\n timeBlocks.each(function () {\n\n var thisBlock = $(this);\n var thisBlockHr = parseInt(thisBlock.attr(\"data-hour\"));\n\n //add style to time blocks to show where we are in the day\n if (thisBlockHr == currentHour) {\n thisBlock.addClass(\"present\");\n\n }\n if (thisBlockHr < currentHour) {\n thisBlock.addClass(\"past\");\n\n }\n if (thisBlockHr > currentHour) {\n thisBlock.addClass(\"future\");\n }\n\n });\n\n }", "function setTimeBlock() {\n timeBlock.each(function () {\n $thisBlock = $(this);\n var currentHour = d.getHours();\n var dataHour = parseInt($thisBlock.attr(\"dataHour\"));\n\n if (dataHour < currentHour) {\n $thisBlock.children(\"textarea\").addClass(\"past\").removeClass(\"present\", \"future\");\n }\n if (dataHour == currentHour) {\n $thisBlock.children(\"textarea\").addClass(\"present\").removeClass(\"past\", \"future\");\n }\n if (dataHour > currentHour) {\n $thisBlock.children(\"textarea\").addClass(\"future\").removeClass(\"past\", \"present\");\n }\n })\n\n }", "function timeTracker() {\n //use moment.js to set current hour value\n var rightNow = moment().hour();\n console.log(rightNow)\n //loop over the timeblocks use if/else to set the appropiate css class\n $(\".time-block\").each(function () {\n var blockhour = parseInt($(this).attr(\"id\").split(\"hour\")[1]);\n console.log(blockhour)\n\n if (blockhour === rightNow) {\n $(this).addClass(\"present\");\n $(this).removeClass(\"future\", \"past\");\n }\n\n else if (blockhour < rightNow) {\n $(this).addClass(\"past\");\n $(this).removeClass(\"present\", \"future\");\n }\n\n else {\n $(this).addClass(\"future\");\n $(this).removeClass(\"past\", \"present\");\n }\n });\n }", "function timeTracker (){\n const currentTime = dayjs().hour();\n\n // Function to loop over each timeblock\n $('.time-block').each(function(){\n const blockTime = parseInt($(this).attr('id').split('hour')[1]);\n\n // Calculate current time and add past class for grey timeblock colour\n if (blockTime < currentTime){\n $(this).removeClass('future');\n $(this).removeClass('present');\n $(this).addClass('past');\n }\n\n // Calculate current time and add current class for red timeblock colour\n else if (blockTime === currentTime){\n $(this).removeClass('past');\n $(this).removeClass('future');\n $(this).addClass('present');\n }\n\n // Calculate current time and add future class for green timeblock colour\n else {\n $(this).removeClass('present');\n $(this).removeClass('past');\n $(this).addClass('future');\n }\n })\n }", "function displayPlanner() {\n for (var i = 9; i < 18; i++) {\n createTimeBlock(i);\n }\n displayActivities();\n}", "function dynamicTime() {\n var currentTime = moment().format('HH:mm:ss');\n $('#dynamic-time').text(currentTime);\n setInterval(dynamicTime, 1000);\n }", "function timeAllot() {\n//I don't know why this only works if you iterate over it 25 times rather than 24. Otherwise, the very last block will not work.\n for(var i = 0; i < 25; i++) {\n timeBlocks[i] = {\n element: allRows[i],\n hour: i\n }\n }\n}", "function timeTracker() { \n var timeNow = moment().hour(); \n $(\".time-block\").each(function () {\n var blockTime = parseInt($(this).attr(\"id\").split(\"hour\")[1]);\n\n \n if (blockTime < timeNow) {\n $(this).removeClass(\"future\");\n $(this).removeClass(\"present\");\n $(this).addClass(\"past\");\n }\n else if (blockTime === timeNow) {\n $(this).removeClass(\"past\");\n $(this).removeClass(\"future\");\n $(this).addClass(\"present\");\n }\n else {\n $(this).removeClass(\"present\");\n $(this).removeClass(\"past\");\n $(this).addClass(\"future\");\n\n }\n })\n }", "function makeTimeBlocks() {\n var cal;\n //storedCal variable to pull from local and parse back into object\n var storedCal = JSON.parse(localStorage.getItem(\"myCalendar\"));\n //if cache is cleared, storedCal would be null, so return to defaultCalendar\n if (!storedCal) {\n storedCal = defaultCalendar;\n }\n if (storedCal) {\n cal = storedCal;\n }\n console.log(\"storedCal: \" + storedCal);\n console.log(\"cal: \" + cal);\n //compares each object in myCalendar array to determine AM/PM and set time block info\n cal.forEach(function (item, index) {\n var timeOfDay;\n var displayTime = item.time;\n //edge case at noon\n if (!item.morning && item.time !== 12) {\n displayTime = item.time - 12;\n } else if (item.time == 12) {\n displayTime = item.time;\n }\n if (item.morning) {\n timeOfDay = \" AM\";\n } else {\n timeOfDay = \" PM\";\n }\n\n var row = $(`<div id=${index} class=\"row\" />`).appendTo(\".container\");\n\n //Create left time block\n var leftBlock = $(\"<div />\", {\n text: displayTime + timeOfDay,\n }).appendTo(row);\n leftBlock.addClass(\"leftBlock\");\n\n // WHEN I click into a timeblock\n // THEN I can enter an event\n //Create middle input block and connect to object.notes\n var middleBlock = $(`<input />`, {\n id: item.time,\n text: item.notes,\n class: setTimeColor(item),\n }).appendTo(row);\n $(`#${item.time}`).attr(\"value\", item.notes);\n middleBlock.addClass(\"middleBlock\");\n\n //Create right save block\n var rightBlock = $(`<button class='saveBtn'><i class=\"fas fa-save\"></i></button>`).appendTo(row);\n rightBlock.addClass(\"rightBlock\")\n });\n\n }", "function drawTimeBlocks() {\n timeline.selectAll('.block').remove();\n const groupAll = timeline.selectAll('.block').data(currentDayParts);\n const groupAllEnter = groupAll.enter().append('g') // enter elements as groups [1]\n .attr('class', 'block');\n groupAllEnter.append('rect');\n groupAllEnter.select('rect')\n .attr('width', d => scaleX(d.end.toDate()) - scaleX(d.beginning.toDate()))\n .attr('x', d => scaleX(d.beginning.toDate()))\n .attr('y', config.svg.margin.y)\n .attr('height', config.bar.height)\n .attr('fill', d => colorScale(d.label))\n .attr('opacity', '0.3');\n }", "function renderTime(){\n let times = [];\n for (let i = timeStart; i <= timeEnd; i+=1){\n times.push(`${i}:00`)\n times.push(`${i}:30`)\n }\n const markup = timesMarkup(times)\n return markup\n }", "function timeSlots() {\n\n var currentTime = moment().hour();\n \n $(\".time-block\").each(function () {\n var timeBlock = parseInt($(this).attr(\"id\").split(\"time\")[1]);\n\n \n if (timeBlock < currentTime) {\n $(this).removeClass(\"future\");\n $(this).removeClass(\"present\");\n $(this).addClass(\"past\");\n }\n else if (timeBlock === currentTime) {\n $(this).removeClass(\"past\");\n $(this).removeClass(\"future\");\n $(this).addClass(\"present\");\n }\n else {\n $(this).removeClass(\"present\");\n $(this).removeClass(\"past\");\n $(this).addClass(\"future\");\n\n }\n })\n }", "function multiTimeFunc(content) {\n var timeToPred = 0;\n times.push(content);\n if (times.length == startStations.length) {\n for (var a = 0; a < times.length; a++) {\n timeToPred += times[a];\n }\n for (let y = 0; y < startEndTimes.length; y++) {\n timeToPred+=startEndTimes[y];\n }\n timeToPred = Math.floor(timeToPred);\n document.getElementById('time' + routeChosen).innerHTML = timeToPred + \" minutes\";\n }\n }", "function TimeBlock(startS, endS) {\n this.freeTimes = []; // Array with elem i representing start + i*15(mins)\n this.start = strToDate(startS).roundDown15();\n this.end = strToDate(endS).roundUp15();\n \n for(var i=this.start.clone(); i.isBefore(this.end); i.addMinutes(15)) {\n this.freeTimes.push(FREE);\n }\n \n this.markBlocks = function(block, duration, markAs) {\n var blockIndex = getNumBlocks(this.start, block); // Get time difference in 15 min blocks\n var blocksToCheck = (duration / 15 + (duration % 15 > 0 ? 1 : 0)); // Round up duration to 15 min blocks\n for(var i = 0; i < blocksToCheck; i++) {\n this.freeTimes[i + blockIndex] = markAs;\n }\n }\n}", "function addTimeBlocks() {\n var timeDiv = $(\".container\");\n var times = [\n {\n value: \"9AM\",\n id: 9\n },\n {\n value: \"10AM\",\n id: 10\n },\n {\n value: \"11AM\",\n id: 11\n },\n {\n value: \"12PM\",\n id: 12\n },\n {\n value: \"1PM\",\n id: 13\n },\n {\n value: \"2PM\",\n id: 14\n },\n {\n value: \"3PM\",\n id: 15\n },\n {\n value: \"4PM\",\n id: 16\n },\n {\n value: \"5PM\",\n id: 17\n }\n ];\n // loop through array of times to populate the dom\n $.each(times, function (i, item) {\n // variables to create DOM elements\n var divRow = $(\"<div>\").attr(\"class\", \"row\").attr(\"id\", item.id);\n var divTimeCol = $(\"<div>\").attr(\"class\", \"col-sm-2 hour text-center\").text(item.value);\n var textareaCol = $(\"<textarea>\").attr(\"class\", \"col-sm-8 time-block\").attr(\"id\", item.id + \"TextArea\");\n var btnSaveCol = $(\"<button>\").attr(\"class\", \"col-sm-2 saveBtn\").attr(\"id\",item.id + \"SaveBtn\").html(\"<i class=\\\"far fa-save\\\"></i>\");\n // append the elements to the div row\n divRow.append(divTimeCol);\n divRow.append(textareaCol);\n divRow.append(btnSaveCol);\n // update classes based on time\n if(item.id < hour){\n divRow.attr(\"class\", \"row time-block past\");\n } else if (item.id > hour){\n divRow.attr(\"class\", \"row time-block future\");\n } else {\n divRow.attr(\"class\", \"row time-block present\");\n };\n // append previous elements to the DOM\n timeDiv.append(divRow);\n // populate any saved content\n $.each(savedContent,function(index, value){\n $(\"#\" + value.time + \"TextArea\").text(value.text);\n });\n });\n }", "function renderTimeBlocks() {\n console.log(\"Starting renderTimeBlocks\");\n //empty variable to set for class attribute of the textarea of the time block items\n let classN = \"\";\n\n let reversedPast = pastHoursFromCurrentMoment.reverse(); //reversed array of past hours\n\n let reversedFuture = futureHoursFromCurrentMoment.reverse(); //reversed array of future hours\n console.log(`Past hours length: ${reversedPast.length}`); //logging length of the arrays\n console.log(`Future hours length: ${reversedFuture.length}`); //logging length of the arrays\n\n //This for loop is intented to render the future business hours and the current time on the planner app\n for (let y = 0; y <= reversedFuture.length - 1; y++) {\n if (reversedFuture[y].isBetween(startOfJourney, endOfJourney)) {\n if (reversedFuture[y] === moment().hour()) {\n classN = \"present\"\n } else {\n classN = \"future\";\n }\n containerEl.prepend(`<div class=\"row hour\">\n <p id=\"${reversedFuture[y].format(\"hA\")}\" class=\"time-block\">${reversedFuture[y].format(\"hA\")}</p>\n <textarea id=\"text-${reversedFuture[y].format(\"hA\")}\" rows=\"1\" cols=\"128\" class=\"${classN} text-area\"></textarea> \n <button id=\"${reversedFuture[y].format(\"hA\")}\" class=\"saveBtn\"><span class=\"fas fa-save\"></span></button>\n </div>`);\n //updating the value of the recentely created textarea from localstorage \n $(`#text-${reversedFuture[y].format(\"hA\")}`).val(localStorage.getItem(reversedFuture[y].format(\"hA\")));\n }\n }\n\n //This for loop is intented to render the past business hours from the current time\n for (let x = 0; x <= reversedPast.length - 1; x++) {\n if (reversedPast[x].isBetween(startOfJourney, endOfJourney)) {\n classN = \"past\";\n containerEl.prepend(`<div class=\"row hour\">\n <p id=\"${reversedPast[x].format(\"hA\")}\" class=\"time-block\">${reversedPast[x].format(\"hA\")}</p>\n <textarea id=\"text-${reversedPast[x].format(\"hA\")}\" rows=\"1\" cols=\"128\" class=\"${classN} text-area\"></textarea>\n \n <button id=\"${reversedPast[x].format(\"hA\")}\" class=\"saveBtn\"><span class=\"fas fa-save\"></span></button>\n </div>`);\n //updating the value of the recentely created textarea from localstorage \n $(`#text-${reversedPast[x].format(\"hA\")}`).val(localStorage.getItem(reversedPast[x].format(\"hA\")));\n\n }\n }\n\n }", "function block(day, min1, min2, color, text){\n\tvar out = isidiot ? divclass(\"block idiot\") : divclass(\"block\");\n\tout.style.backgroundColor = color;\n\tvar tempHeight = (100 * (min2 - min1) / (end_time - start_time));\n\ttempHeight = isidiot ? tempHeight - 1.5 : tempHeight;\n\tout.style.height = tempHeight.toString() + \"%\";\n\tout.style.top = (100 * (min1 - start_time) / (end_time - start_time)).toString() + \"%\";\n\tout.innerHTML = text + \"<br>\" + toclock(min1) + \"-\" + toclock(min2);\n\tgrab(day).appendChild(out);\n\tblocks.push(out);\n\treturn out;\n}", "function time(){\n\t $('#Begtime').mobiscroll().time({\n\t theme: 'wp',\n\t display: 'inline',\n\t mode: 'scroller'\n\t });\n\t $('#Endtime').mobiscroll().time({\n\t theme: 'wp',\n\t display: 'inline',\n\t mode: 'scroller'\n\t });\n\t removeUnwanted(); \n\t insertClass(); \n\t getTimeFromInput(\"Begtime\");\n\t getTimeFromInput(\"Endtime\");\n\t}", "function addTimes() {\n for (var i = 0; i < bgPage.sites.length; i++) {\n var node = document.createElement(\"LI\");\n var textNode = document.createTextNode(bgPage.sites[i] + \" \"\n + bgPage.formatTime(bgPage.timers[i]));\n node.appendChild(textNode);\n document.getElementById(\"list\").appendChild(node);\n }\n }", "function displayTimeBlocks() {\n\n //Loop through, until all time blocks have been created.\n for (var i = 0; i < businessHrs.length; i++) {\n //Grab the businessHr we're constructing a block for.\n var hour = businessHrs[i];\n\n //Each time block takes up one row and consists of a box that denotes that hour, an input, and a save button\n var row = $(\"<div>\").addClass(\"row\");\n\n var timeBlock = $(\"<div>\").addClass(\"time-block col-1\");\n timeBlock.text(hour);\n\n var textArea = $(\"<textarea>\").addClass(\"col-8\");\n textArea.attr(\"id\", hour);\n\n var button = $(\"<button>\").addClass(\"saveBtn col-1\");\n button.attr(\"data-hour\", hour)\n button.text(\"Save\");\n\n\n row.append(timeBlock);\n row.append(textArea);\n row.append(button);\n\n //When determining whether an hour block is in the past/present/future, can use moment().fromNow().\n var relativeTime = moment(hour, \"h\").fromNow().split(\" \");\n\n //If relativeTime is \"X minutes ago\", it's in the present, so add class \"present\"\n\n //If relativeTime is \"X hour/hours ago\", it was in the past, so add class \"past\"\n\n //If relativeTime is \"in X hours\", it's in the future, so add class \"future\"\n\n //Now load the locally stored events\n loadEvents();\n\n $(\".timeBlocks\").append(row);\n }\n\n}", "function newTimeBlock(displayTime, timeOfDay, thisDate) {\n // console.log(displayTime);\n var eventID = timeOfDay + \"-\" + thisDate.format(\"YYYYMMDD\");\n var newBlock = $(\"<div>\").addClass(\"row time-block-row\");\n newBlock.append(($(\"<div>\")).addClass(\"col-2 time-of-day\"));\n newBlock.find('.time-of-day').append($(\"<div>\").addClass(\"hour-of-the-day\").html(displayTime));\n newBlock.find('.time-of-day').attr(\"id\", timeOfDay + \"-column\");\n newBlock.append(($(\"<div>\")).addClass(\"col-9 event-column\"));\n newBlock.find('.event-column').append($(\"<input>\").addClass('event-for-the-day'));\n newBlock.find(\".event-for-the-day\").attr(\"id\", eventID);\n newBlock.append(($(\"<div>\")).addClass(\"col-1 save-column\"));\n newBlock.find('.save-column').append($(\"<button>\").addClass('save-event').html('<i class=\"far fa-save\"></i>'));\n newBlock.find('.save-event').on(\"click\", function () { addCalendarEvent(eventID) });\n return newBlock;\n}", "function init(){\n $(\"#currentDay\").append(todayComposite);\n addTimeBlocks();\n }", "generateAvailableTimes(datestamp, show_past, step = 15) {\n const now = dayjs__WEBPACK_IMPORTED_MODULE_4__();\n let date = dayjs__WEBPACK_IMPORTED_MODULE_4__(datestamp);\n const blocks = [];\n if (show_past || date.isAfter(now, 'd')) {\n date = date.startOf('d');\n }\n else if (date.isAfter(now, 'm')) {\n date = now;\n }\n date = date.minute(Math.ceil(date.minute() / step) * step);\n const end = date.endOf('d');\n // Add options for the rest of the day\n while (date.isBefore(end, 'm')) {\n blocks.push({\n name: `${date.format(Object(_user_interfaces_common__WEBPACK_IMPORTED_MODULE_3__[\"timeFormatString\"])())}`,\n id: date.format('HH:mm'),\n });\n date = date.add(step, 'm');\n }\n return blocks;\n }", "function hourUpdater() {\n // grabs the current time\n var currentHour = moment().hours();\n \n // cycles through the time blocks and adjusts the css\n $(\".time-block\").each(function() {\n var blockHour = parseInt($(this).attr(\"id\").split(\"-\")[1]);\n \n if (blockHour < currentHour) {\n $(this).addClass(\"past\");\n } \n else if (blockHour === currentHour) {\n $(this).removeClass(\"past\");\n $(this).addClass(\"present\");\n } \n else {\n $(this).removeClass(\"past\");\n $(this).removeClass(\"present\");\n $(this).addClass(\"future\");\n }\n });\n }", "function ScheduleBlock(props){\n let schedule = props.currPlan.schedules[props.currSchedule].split(\";\");\n let blocks = days.map((element,index)=>{\n let i = 0;\n for(i=0; i<schedule.length - 2; i++){ //loop over the sections for the schedule\n if(schedule[i] === \"\"){\n continue;\n }\n let info = props.state.dict[schedule[i]];\n //-------parsing the times\n let sDays = info.days.split('');\n let j = 0;\n for(j = 0; j<sDays.length;j++){\n if(sDays[j] == 'M'){\n sDays[j] = 'Monday'\n }\n else if(sDays[j] == 'T'){\n sDays[j] = 'Tuesday'\n }\n else if(sDays[j] == 'W'){\n sDays[j] = 'Wednesday'\n }\n else if(sDays[j] == 'R'){\n sDays[j] = 'Thursday'\n }\n else if(sDays[j] == 'F'){\n sDays[j] = 'Friday'\n }\n }\n let startTime = info.start.split(':');\n let endTime = info.end.split(':');\n let currTime = props.time.split(\":\");\n let startH = Number(startTime[0]);\n let endH = Number(endTime[0]);\n\n //----------------\n //console.log(startH)\n //console.log(currTime[0]);\n if(startH == currTime[0] && Number(startTime[1]) >= Number(currTime[1]) && Number(startTime[1]) < Number(currTime[1]) + 30){ //check if any sections have a start time matching the current row's time range\n if(sDays.indexOf(element) > -1){//if time matches, check which day\n if(endH > Number(currTime[0]) && Number(endTime[1]) >= Number(currTime[1])+30) // if 2 hours long, make the block 4 rows\n {\n return(\n <Table.Cell className={info.available.toString()} rowSpan='4' key={props.time + element}>\n <p className=\"sectionName\">{info.courseName}</p>\n <p className=\"sectionID\">{info.sectionId}</p>\n <p className=\"sectionTime\">{info.start}-\n {info.end}</p>\n </Table.Cell>\n )\n }\n else if(endH > Number(currTime[0])) // if longer than an hour, make the block 3 rows\n {\n return(\n <Table.Cell className={info.available.toString()} rowSpan='3' key={props.time + element}>\n <p className=\"sectionName\">{info.courseName}</p>\n <p className=\"sectionID\">{info.sectionId}</p>\n <p className=\"sectionTime\">{info.start}-\n {info.end}</p>\n </Table.Cell>\n )\n }\n else{\n return(\n <Table.Cell className={info.available.toString()} rowSpan='2' key={props.time + element}>\n <p className=\"sectionName\">{info.courseName}</p>\n <p className=\"sectionID\">{info.sectionId}</p>\n <p className=\"sectionTime\">{info.start}-\n {info.end}</p>\n </Table.Cell>\n )\n }\n\n\n\n }\n\n }\n //check if the block is two rows so we can avoid adding a block in that spot\n else if(endH == currTime[0] && Number(endTime[1]) >= Number(currTime[1]) && startH <= Number(currTime[0])){\n if(sDays.indexOf(element) > -1) {\n return;\n }\n }\n else if(endH > Number(currTime[0]) && startH <= Number(currTime[0])){\n if(sDays.indexOf(element) > -1) {\n return;\n }\n }\n }\n //if no matches, just return an empty cell\n return(\n <Table.Cell key={props.time + element}>\n\n </Table.Cell>\n\n )\n })\n\n\n return(\n <Table.Row>\n <Table.Cell rowSpan='1'>{props.time}</Table.Cell>\n {blocks}\n </Table.Row>\n\n )\n\n}", "calcTime() {\n const numIng = this.ingredients.length;\n const periods = Math.ceil(numIng / 3);\n this.time = periods * 15;\n }", "function currentTime() {\n var currentHour = moment().hour();\n\n // goes through each time block and adds or remove present/future/past class\n $(\".timeblocks\").each(function () {\n var blockTime = parseInt($(this).attr(\"id\"));\n\n if (blockTime < currentHour) {\n $(this).addClass(\"past\");\n $(this).removeClass(\"future\");\n $(this).removeClass(\"present\");\n } else if (blockTime === currentHour) {\n $(this).removeClass(\"past\");\n $(this).addClass(\"present\");\n $(this).removeClass(\"future\");\n } else {\n $(this).removeClass(\"present\");\n $(this).removeClass(\"past\");\n $(this).addClass(\"future\");\n }\n });\n }", "function displayTime() {\n $(\"tbody\").empty();\n setInterval(displayTime, 10 * 1000);\n $(\"#currentTime\").html(\"<h2>\" + moment().format(\"hh:mm a\") + \"</h2>\");\n displayTrain();\n }", "function initClocks() {\n var $rail = $('#WikiaRail');\n \n if ($rail.length === 0)\n return;\n \n var htmlClocksContainer = '<section id=\"wiki-custom-clockModule\" class=\"module\">';\n for (i = 0; i < clocksModuleLabels.length; ++i) {\n htmlClocksContainer = htmlClocksContainer + \n '<div class=\"clocksModule ' + clocksModuleLabels[i] + '\">'+\n '<b>' + clocksModuleLabels[i] + '</b> <br/>' +\n '<span id=\"clock'+ clocksModuleLabels[i] + '\">' + \n '</span>'+\n '</div>';\n }\n \n htmlClocksContainer = htmlClocksContainer + '</section>';\n $(htmlClocksContainer).appendTo($rail);\n \n setInterval( function () {\n refreshClock();\n }, 1000\n );\n }", "function timeUpdate() {\n //check current \n var currentHour = moment().hour();\n\n//added time block full length\n $(\".time-block\").each(function () {\n var blockHour = parseInt($(this).attr(\"id\").split(\"hour\")[1]);\n\n// loop - compare current time to time block to determing past, present, or future\n\n //check if hour is in the past\n if (blockHour < currentHour) {\n $(this).addClass(\"past\");\n $(this).removeClass(\"present\");\n $(this).removeClass(\"future\");\n }\n //check if hour is in the present \n else if (blockHour === currentHour) {\n $(this).removeClass(\"past\");\n $(this).addClass(\"present\");\n $(this).removeClass(\"future\");\n }\n //check if hour is in the future\n else {\n $(this).removeClass(\"past\");\n $(this).removeClass(\"present\");\n $(this).addClass(\"future\");\n }\n })\n}", "function evaluateTime() {\n $(\".time-block\").each (function() {\n hourField = Number($(this).attr(\"data-time\"));\n currentHour = Number(moment().format(\"k\"));\n if (hourField < currentHour) {\n $(this).addClass(\"past\");\n } else if (hourField > currentHour) {\n $(this).removeClass(\"present\");\n $(this).addClass(\"future\");\n } else {\n $(this).removeClass(\"past\");\n $(this).addClass(\"present\");\n }\n });\n }", "function generateTime()\n {\n var milisecond = time % 1000;\n var second = Math.floor(time / 1000) % 60;\n var minute = Math.floor(time / 60000) % 60;\n var hour = Math.floor(time / 3600000) % 60;\n \n if (milisecond < 10) {\n milisecond = '00' + milisecond;\n }\n else if (milisecond < 100) {\n milisecond = '0' + milisecond;\n }\n \n second = (second < 10) ? '0'+second : second;\n minute = (minute < 10) ? '0'+minute : minute;\n hour = (hour < 10) ? '0' + hour : hour;\n \n \n \n $('div.timer span.milisecond').html(milisecond);\n $('div.timer span.second').html(second);\n $('div.timer span.minute').html(minute);\n $('div.timer span.hour').html(hour);\n }", "function show5(){\r\nif (!document.layers&&!document.all)\r\nreturn\r\nvar Digital=new Date()\r\nvar hours=Digital.getHours()\r\nvar minutes=Digital.getMinutes()\r\nvar seconds=Digital.getSeconds()\r\n//var dn=\"AM\"\r\n//if (hours>12){\r\n//dn=\"PM\"\r\n//hours=hours-12\r\n//}\r\n//if (hours==0)\r\n//hours=12\r\nif (minutes<=9)\r\nminutes=\"0\"+minutes\r\nif (seconds<=9)\r\nseconds=\"0\"+seconds\r\n//change font size here to your desire\r\nmyclock=\"<font face='Arial' ><b></br><p>\"+hours+\":\"+minutes+\":\"\r\n+seconds+\" </b></font>\"\r\nif (document.layers){\r\ndocument.layers.liveclock.document.write(myclock)\r\ndocument.layers.liveclock.document.close()\r\n}\r\nelse if (document.all)\r\nliveclock.innerHTML=myclock\r\nsetTimeout(\"show5()\",1000)\r\n}", "function hourTracker() {\n //get current number of hours\n var currentHour = moment().format(\"H\");\n\n //loop over time blocks\n $(\".description\").each(function () {\n var blockHour = $(this).attr(\"id\");\n // console.log(blockHour, currentHour);\n\n if (blockHour < currentHour) {\n $(this).addClass(\"past\");\n $(this).removeClass(\"future\");\n $(this).removeClass(\"present\");\n } else if (blockHour === currentHour) {\n $(this).removeClass(\"past\");\n $(this).addClass(\"present\");\n $(this).removeClass(\"future\");\n } else {\n $(this).removeClass(\"present\");\n $(this).removeClass(\"past\");\n $(this).addClass(\"future\");\n }\n });\n }", "function buildTimeBlocks(hour){\n // Create and append row for time block\n let timeRowEl = $(\"<tr></tr>\")\n .attr(\"data-value\", hour)\n .addClass(`d-flex time-row ${hour}`);\n hourBlockBodyEl.append(timeRowEl);\n // Create and append hour column\n let hourColumnEl = $(\"<td></td>\")\n .attr(\"scope\", \"col\")\n .addClass(\"d-flex col-2 col-lg-1 justify-content-center align-items-center\")\n .text(moment(`${hour}`, \"h\").format(\"hA\"));\n timeRowEl.append(hourColumnEl);\n // Create and append task column\n let taskColumnEl = $(\"<td></td>\")\n .attr(\"scope\", \"col\")\n .addClass(\"col-8 col-lg-10\");\n let taskText = $(\"<textarea></textarea>\")\n .attr(\"type\", \"text\")\n .attr({\n \"data-toggle\":\"tooltip\",\n \"data-placement\": \"top\",\n \"title\": \"Enter tasks here\"\n })\n .addClass(\"d-flex form-control col-12 task-input\");\n taskColumnEl.append(taskText);\n timeRowEl.append(taskColumnEl);\n // Create and append save column\n let saveColumnEl = $(\"<td></td>\")\n .attr(\"scope\", \"col\")\n .addClass(\"d-flex col-2 col-lg-1 justify-content-center align-items-center\");\n let saveButtonEl = $(\"<button></button>\")\n .attr(\"type\", \"button\")\n .addClass(\"btn far fa-save fa-lg saveBtn\")\n .on(\"click\", saveTask);\n saveColumnEl.append(saveButtonEl); \n timeRowEl.append(saveColumnEl);\n}", "function establishTimeBlockColours() {\n $(\".timeBlock\").each(function () {\n const thisBlock = $(this);\n const thisBlockHour = parseInt(thisBlock.attr(\"data-hour\"));\n const thisTextArea = thisBlock.find(\"textarea\");\n\n if (thisBlockHour == currentHour) {\n thisTextArea.addClass(\"present\").removeClass(\"past future\");\n }\n if (thisBlockHour < currentHour) {\n thisTextArea.addClass(\"past\").removeClass(\"present future\");\n }\n if (thisBlockHour > currentHour) {\n thisTextArea.addClass(\"future\").removeClass(\"past present\");\n }\n });\n}", "function fillTimes() {\n let now = new Date();\n startTime.value = now.toLocaleDateString(\"en-US\") +\" \"+ now.toTimeString().slice(0,8);\n endTime.value = now.toLocaleDateString(\"en-US\") +\" \"+ now.toTimeString().slice(0,8);\n}", "function checkTime() {\n //use momentjs to grab current hour\n var currentHour = moment().hours();\n //compare currentHour against blockHour\n // if else?\n //need to grab hours for the time block\n // loop through timeblock hours class of time-block??\n\n $(\".time-block\").each(function () {\n var blockHour = parseInt($(this).attr(\"id\").split(\"-\")[1]);\n\n if (blockHour > currentHour) {\n $(this).addClass(\"past\");\n } else if (blockHour === currentHour) {\n $(this).addClass(\"present\");\n } else {\n $(this).addClass(\"future\");\n }\n });\n }", "function timeTracker() {\n //get current time\n var currentTime = moment().hour();\n //console.log(currentTime);\n \n //loop over time block rows\n $(\".time-block\").each(function () {\n dayHour = parseInt($(this).attr(\"id\"));\n console.log(dayHour);\n //checks time, adds class to change background color if neccessary\n if (dayHour < currentTime) {\n $(this).removeClass(\"future\");\n $(this).removeClass(\"present\");\n $(this).addClass(\"past\");\n }\n else if (dayHour > currentTime) {\n $(this).removeClass(\"present\");\n $(this).removeClass(\"past\");\n $(this).addClass(\"future\");\n }\n else {\n $(this).removeClass(\"future\");\n $(this).removeClass(\"past\");\n $(this).addClass(\"present\");\n }\n })\n }", "function setTimeColor(item) {\n //Set block to past\n if (item.time < now) {\n return \"past\";\n }\n //Set block to present\n else if (item.time == now) {\n return \"present\";\n }\n //Set block to future\n else {\n return \"future\";\n }\n }", "function colorText() {\n var currTime = moment().format(\"HH:00\");\n // var currTime = \"12:00\";\n\n for (block of timeBlocks) {\n /* //Console Logs\n console.log(currTime);\n console.log(currTime > timeBlocks[0].number);\n */\n var blockMilitaryTime = block.number;\n\n /* //PseudoCode\n if(blockTime < currTime) grey color\n else if(blockTime === currTime) red color\n else if(blockTime > currTime) green color\n */\n\n if (currTime > blockMilitaryTime) {\n $(`#${block.id}`).addClass(\"past\");\n // $(`#${block.id}`).attr(\"readonly\", true);\n $(`#${block.id}`).removeClass(\"present\");\n $(`#${block.id}`).removeClass(\"future\");\n /* //Console Logs\n console.log(block);\n console.log(\"past\");\n console.log(currTime);\n console.log(block.number);\n console.log(\"past check \" + (currTime > blockMilitaryTime));\n console.log(\"future check \" + (currTime < blockMilitaryTime));\n console.log(\"present check \" + (blockMilitaryTime === currTime));\n */\n }\n if (currTime < blockMilitaryTime) {\n $(`#${block.id}`).addClass(\"future\");\n // $(`#${block.id}`).attr(\"readonly\", false);\n $(`#${block.id}`).removeClass(\"past\");\n $(`#${block.id}`).removeClass(\"present\");\n\n /* //Console Logs\n console.log(block);\n console.log(\"future\");\n console.log(currTime);\n console.log(block.number);\n console.log(\"past check \" + (currTime > blockMilitaryTime));\n console.log(\"future check \" + (currTime < blockMilitaryTime));\n console.log(\"present check \" + (blockMilitaryTime === currTime));\n */\n }\n if (currTime === blockMilitaryTime) {\n $(`#${block.id}`).addClass(\"present\");\n // $(`#${block.id}`).attr(\"readonly\", false);\n $(`#${block.id}`).removeClass(\"past\");\n $(`#${block.id}`).removeClass(\"future\");\n\n /* //Console Logs\n console.log(block);\n console.log(\"present\");\n console.log(currTime);\n console.log(block.number);\n console.log(\"past check \" + (currTime > blockMilitaryTime));\n console.log(\"future check \" + (currTime < blockMilitaryTime));\n console.log(\"present check \" + (currTime === blockMilitaryTime)); \n */\n }\n }\n}", "displayTimeSlots(){\n const div = document.getElementById(\"displayHours\"+this.id);\n for (let i=0; i<24; i+=2) {\n this.displayHourWeather(i, div);\n }\n }", "function renderTimeBlocks(){\n for (var i = 9; i <= 17; i++){\n let index = i - 9;\n let timeBlock = $(\"<div></div>\").addClass(\"time-block row\");\n let timeArea = $(\"<div></div>\").addClass(\"hour col-2\").text(timeArray[index]);\n let textArea = $(\"<textarea></textarea>\").addClass(\"input\" + index + \" description col-9\").text(\"\");\n let button = $(\"<button></button>\").addClass(\"saveBtn col-1\").attr(\"data-btnIndex\", index);\n let saveIcon = $(\"<i></i>\").addClass(\"fas fa-save fa-2x\");\n $(\".container\").append(timeBlock);\n timeBlock.append(timeArea,textArea,button);\n button.append(saveIcon);\n \n //set the colour of the text area\n setRowColour(textArea,i);\n\n textArea.text(todosArray[index]);\n\n }\n }", "function hourUpdater(){\n var currentHour = moment().hour();\n $('.time-block').each(function(){\n var blockHour = parseInt($(this).attr('id').split('-')[1]);\n if(blockHour < currentHour){\n $('.description').addClass('past');\n } else if (blockHour === currentHour){\n $('.description').addClass('present');\n }else{\n $('.description').addClass('future');\n }\n })\n}", "function blockPastTimes() {\n let previousColor = '#575366';\n let currentColor = '#5762D5';\n let upcomingColor = '#ECE8EF';\n let lightTextColor = '#ECE8EF';\n\n for (let i = 0; i < timeBlockInputs.length; i++) {\n if (timeBlocks.eq(i).attr('data-time') < m.hour()) {\n //Disable text inputs and buttons before current time\n timeBlockInputs.eq(i).css('background-color', previousColor);\n timeBlockInputs.eq(i).css('color', lightTextColor);\n timeBlockInputs.eq(i).attr('disabled');\n timeBlockButtons.eq(i).attr('disabled');\n }\n else if (timeBlocks.eq(i).attr('data-time') == m.hour()) {\n //Color code current time\n timeBlockInputs.eq(i).css('background-color', currentColor);\n timeBlockInputs.eq(i).css('color', lightTextColor);\n }\n else {\n timeBlockInputs.eq(i).css('background-color', upcomingColor);\n }\n }\n }", "calcTime() {\n const ingNum = this.ingredients.length;\n const periods = Math.ceil(ingNum / 3);\n this.time = periods * 15;\n }", "calcTime() {\n const numberOfIngredients = this.ingredients.length;\n const periods = Math.ceil(numberOfIngredients / 3);\n this.time = periods * 15;\n }", "function currentTime() {\n var current = moment().hours()\n var time = $('.time-block');\n\n //This function parses each time-block and checks to see if each time block is in the past current or future.\n //When it checks each time block it will then add a new class that is called from our custom css file. \n time.each(function () {\n var hour = parseInt($(this).attr('id'))\n\n if (hour === current) {\n $(this).children('.col-sm-10').attr('class','current col-sm-10 description')\n } else if (current > hour) {\n $(this).children('.col-sm-10').attr('class','past col-sm-10 description')\n } else {\n $(this).children('.col-sm-10').attr('class','future col-sm-10 description')\n }\n })\n}", "function startTime() {\n let now = new Date();\n\n $(\"#clock\")\n .html('')\n .append($('<div>').html(now.format('EE dd/MM/yyyy')))\n .append($('<div>').html(now.format('HH:mm:ss')));\n\n setTimeout(startTime, 1000)\n}", "function updateTime() {\n\t\tvar dateTime = tizen.time.getCurrentDateTime(), secondToday = dateTime.getSeconds() + dateTime.getMinutes() * 60 + dateTime.getHours() * 3600,\n\t\tminDigitLeft = document.querySelector(\"#time-min-digit-left\"),\n\t\tminDigitRight = document.querySelector(\"#time-min-digit-right\"),\n\t\thourDigitLeft = document.querySelector(\"#time-hour-digit-left\"), \n\t\thourDigitRight = document.querySelector(\"#time-hour-digit-right\");\n\n\t\tvar minutesNow = (secondToday % 3600) / 60;\n\t\tvar hourNow = (secondToday / 3600);\n\t\tslideDigit(minDigitRight, minutesNow % 10.0);\n\t\tslideDigit(minDigitLeft, minutesNow / 10.0);\n\t\tslideDigit(hourDigitRight, hourNow % 10.0);\n\t\tslideDigit(hourDigitLeft, hourNow / 10.0);\n\t}", "function hourTracker() {\n var currentHour = moment().hour();\n\n $(\".time-block\").each(function () {\n var block = parseInt($(this).attr(\"id\").split(\"hour\")[1]);\n\n if (block < currentHour) {\n $(this).addClass(\"past\");\n $(this).removeClass(\"future\");\n $(this).removeClass(\"present\");\n }\n else if (block === currentHour) {\n $(this).removeClass(\"past\");\n $(this).addClass(\"present\");\n $(this).removeClass(\"future\");\n }\n else {\n $(this).removeClass(\"present\");\n $(this).removeClass(\"past\");\n $(this).addClass(\"future\");\n }\n });\n}", "function colorCodeTimeBlocks(){\n //Every second, check if the timeblock color coding should change\n var timeInterval = setInterval(function (){\n let currentTime = moment().format(\"H\");\n compareTimeBlocks(currentTime); \n }, 1000)\n \n}", "function checktime() {\n hoursArray.forEach(function(element){\n if (currentHour > element) {\n $(eval(\"Box\" + element)).addClass(\"pastcontentbox\").removeClass(\"contentbox\");\n } \n else if (currentHour === element) {\n $(eval(\"Box\" + element)).addClass(\"currentcontentbox\").removeClass(\"contentbox\");\n $(document).ready(function(){\n }\n )} \n }\n )}", "function processFunc(content) {\n content = Math.floor(content);\n for (let y = 0; y < startEndTimes.length; y++) {\n content+=startEndTimes[y];\n }\n document.getElementById('time' + routeChosen).innerHTML = content + \" minutes\";\n }", "function createSchedule(blocks, studyHours){\n\t\tvar scheduledBlockTotal = 0;\n\t\tfor(day in blocks){\n\t\t\tfor(bloc in blocks[day]){\n\t\t\t\tblocks[day][bloc].forEach(function(curVal){\n\t\t\t\t\tvar now = new Date;\n\t\t\t\t\tvar today = now.getDay();\n\t\t\t\t\tvar day = curVal.classList[0];\n\t\t\t\t\tvar daySplit = day.split('');\n\t\t\t\t\tvar letter = daySplit[0].toUpperCase();\n\t\t\t\t\tdaySplit[0] = letter;\n\t\t\t\t\tvar dayUpper = daySplit.join('');\n\t\t\t\t\tvar loopDayNum = days.indexOf(dayUpper);\n\t\t\t\t\tvar actualDayNum;\n\t\t\t\t\tif(today === 0){\n\t\t\t\t\t\tactualDayNum = 6;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tactualDayNum = today -1;\n\t\t\t\t\t}\n\t\t\t\t\tvar time = curVal.classList[1];\n\t\t\t\t\tif(startingToday && actualDayNum <= loopDayNum){\n\t\t\t\t\t\tif(scheduledBlockTotal < (studyHours - hoursAlreadyStudied) * 2){\n\t\t\t\t\t\t\tcurVal.style.backgroundColor = 'blue';\n\t\t\t\t\t\t\tscheduledBlockTotal++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse if(startingTomorrow && actualDayNum < loopDayNum){\n\t\t\t\t\t\tif(scheduledBlockTotal < (studyHours - hoursAlreadyStudied) * 2){\n\t\t\t\t\t\t\tcurVal.style.backgroundColor = 'blue';\n\t\t\t\t\t\t\tscheduledBlockTotal++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse if(startAtBeginning){\n\t\t\t\t\t\tif(scheduledBlockTotal < (studyHours - hoursAlreadyStudied) * 2){\n\t\t\t\t\t\t\tcurVal.style.backgroundColor = 'blue';\n\t\t\t\t\t\t\tscheduledBlockTotal++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tif(scheduledBlockTotal < (studyHours - hoursAlreadyStudied) * 2){\n\t\t\tdocument.getElementById('studyMsg').innerHTML = 'There is not enough scheduled time to complete the study hours necessary' +\n\t\t\t'<br />You have ' + scheduledBlockTotal / 2 + ' hours scheduled but need to find time for ' + \n\t\t\t(((studyHours - hoursAlreadyStudied) * 2) - (scheduledBlockTotal / 2)) +\n\t\t\t' more in order to complete your coursework for this week';\n\t\t}\n\t\telse{\n\t\t\tdocument.getElementById('studyMsg').innerHTML = 'You are scheduled for ' +\n\t\t\tscheduledBlockTotal / 2 + ' hours of study';\n\t\t}\n\t\t\n\t\tvar wSSD = {};\n\t\twSSD.schedule = schedule;\n\t\twSSD.studyBlocks = blocks;\n\t\tls.setItem('workSleepStudyData',JSON.stringify(wSSD));\n\t\tconsole.log('data stored: ');\n\t\tconsole.log(wSSD);\n\t}", "function timeCheck() {\n // Calling Add Date Function\n function addDate() {\n dateArea.textContent = m;\n };\n\n addDate();\n // Getting Hour as a single number\n var currentHour = moment().toString().split(\" \")[4].split(\":\")[0];\n\n for (var i = 0; i < hourBlockArray.length; i++) {\n // Getting hour in number for each hour block in the array\n var currentHourBlock = hourBlockArray[i].getAttribute(\"id\");\n // console.log(currentHourBlock);\n // console.log(currentHour);\n \n // If current hour block is less then current hour apply class \"past\"\n if (currentHourBlock < currentHour) {\n hourBlockArray[i].classList.add(\"past\");\n }\n // If current hour block is greater then current hour apply class \"future\"\n else if (currentHourBlock > currentHour) {\n hourBlockArray[i].classList.add(\"future\");\n // If current hour block is greater then current hour apply class \"future\"\n } else {\n hourBlockArray[i].classList.add(\"present\");\n }\n\n \n }\n\n \n \n\n}", "function getTimeById(blockId) {\n switch (blockId) {\n case 0:\n return \"9:00 am\";\n case 1:\n return \"10:00 am\";\n case 2:\n return \"11:00 am\";\n case 3:\n return \"12:00 pm\";\n case 4:\n return \"1:00 pm\";\n case 5:\n return \"2:00 pm\";\n case 6:\n return \"3:00 pm\";\n case 7:\n return \"4:00 pm\";\n case 8:\n return \"5:00 pm\";\n }\n \n}", "function fillTimeText(dom) {\n\tvar startTime = 9;\n\tfor (var i = 0; i <= 24; i++) {\n\t\tvar timeSlot = document.createElement('div');\n\t\tvar hour = startTime + Math.floor(i / 2);\n\t\tvar minute = i % 2 === 0 ? '00' : '30';\n\t\tif (minute === '00') {\n\t\t\tif (hour < 12) {\n\t\t\t\tvar timeText = document.createTextNode(hour + ':' + minute + ' AM')\n\t\t\t} else {\n\t\t\t\tif (hour > 12) {\n\t\t\t\t\thour = hour % 12;\n\t\t\t\t}\n\t\t\t\tvar timeText = document.createTextNode(hour + ':' + minute + ' PM')\n\t\t\t}\n\t\t\ttimeSlot.className = 'timeSlotRound';\n\t\t\ttimeSlot.appendChild(timeText);\n\t\t\tdom.append(timeSlot);\n\t\t} else {\n\t\t\tif (hour < 12) {\n\t\t\t\tvar timeText = document.createTextNode(hour + ':' + minute);\n\t\t\t} else {\n\t\t\t\tif (hour > 12) {\n\t\t\t\t\thour = hour % 12;\n\t\t\t\t}\n\t\t\t\tvar timeText = document.createTextNode(hour + ':' + minute);\n\t\t\t}\n\t\t\ttimeSlot.className = 'timeSlotHalf';\n\t\t\ttimeSlot.appendChild(timeText);\n\t\t\tdom.append(timeSlot);\n\t\t}\n\t}\n}", "function GetTime() {\n window.setTimeout( \"GetTime()\", 1000 );\n LiveTime = new Date()\n $(\"time\").innerHTML=LiveTime;\n }", "function setColor () {\n\n // function for each .time-block class\n $(\".time-block\").each(function() {\n\n //establishes block variable based on the time in the .hour class\n var block = $ (this).children(\".hour\").text()\n\n // establishes block1 variable based on the convertTime function with block parameter\n var block1 = convertTime(block)\n // establishes now1 variable as 24-hour time based on moment.js function\n var now1 = moment().hours()\n console.log(block1, now1);\n\n // if current time is after the time on workday scheduler\n if (block1 < now1) {\n $(this).addClass(\"past\");\n $(this).removeClass(\"future\");\n $(this).removeClass(\"present\");\n }\n // if current time is same as the time on workday scheduler\n else if (block1 === now1) {\n $(this).removeClass(\"past\");\n $(this).addClass(\"present\");\n $(this).removeClass(\"future\");\n }\n // if current time is before the time on workday scheduler\n else {\n $(this).removeClass(\"present\");\n $(this).removeClass(\"past\");\n $(this).addClass(\"future\");\n }\n })\n}", "function buildTimeBlocks() {\n for (var i = 0; i < 10; i++) {\n var hour = document.createElement(\"div\");\n var textArea = document.createElement(\"textarea\");\n var button = document.createElement(\"button\");\n\n //shows time attached to each block, displays 4 digit military time\n hour.innerHTML = (i + 7).toString().padStart(2, \"0\").padEnd(4, \"0\");\n // document.getElementById(\"hour\");\n hour.classList.add(\"hour\");\n container.appendChild(hour);\n\n //provides text area\n textArea.innerHTML = \"\";\n // document.getElementById(\"textarea\");\n textArea.classList.add(\"textarea\");\n container.appendChild(textArea);\n\n //provides save btn\n button.innerHTML = \"Save\";\n // document.getElementById(\"saveBtn\");\n button.classList.add(\"saveBtn\");\n container.appendChild(button);\n\n //color backgrounds of textareas according to time of day\n var presentAtt = document.createAttribute(\"id\");\n presentAtt.value = \"present\";\n var pastAtt = document.createAttribute(\"id\");\n pastAtt.value = \"past\";\n var futureAtt = document.createAttribute(\"id\");\n futureAtt.value = \"future\";\n if (currentTime == hour) {\n textArea.setAttribute(\"id\", \"present\");\n } else if (currentTime > hour) {\n textArea.setAttribute(\"id\", \"past\");\n } else if (currentTime < hour) {\n textArea.setAttribute(\"id\", \"future\");\n }\n\n button.addEventListener(\"click\", function (event) {\n event.preventDefault();\n localStorage.setItem(this.textContent, event);\n alert(\"Information saved.\");\n });\n }\n}", "function getCurrentHour(hourElArr, blockArr){\n let currentHour = moment().format(\"HH\");\n for (let i = 0; i < 9; i++) {\n if (parseInt(hourElArr[i].textContent) > parseInt(currentHour)){\n blockArr[i].setAttribute(\"class\",\"row time-block future\");\n } else if (parseInt(hourElArr[i].textContent) === parseInt(currentHour)){\n blockArr[i].setAttribute(\"class\",\"row time-block present\");\n } else if ((parseInt(hourElArr[i].textContent) < parseInt(currentHour))){\n blockArr[i].setAttribute(\"class\",\"row time-block past\");\n }\n }\n}", "function buildTime() {\n var table = ce('table');\n var tr = ce('tr');\n var tdPlus = ce('td');\n var tdMinus = ce('td');\n var tdPlusMinutes = ce('td');\n var tdMinusMinutes = ce('td');\n var td = ce('td');\n var hours = ce('input');\n var minutes = hours.cloneNode(true);\n var currentDown = null;\n\n function fastSeekTime() {\n isMouseDown = true;\n\n navTimer = setTimeout(updateTimeNav, 500);\n }\n\n function updateTimeNav() {\n switch (currentDown) {\n case tdPlus:\n updateHours(1);\n break;\n\n case tdMinus:\n updateHours(-1);\n break;\n\n case tdPlusMinutes:\n updateMinutes(1);\n break;\n\n case tdMinusMinutes:\n updateMinutes(-1);\n break;\n }\n\n navTimer = setTimeout(updateTimeNav, 50);\n }\n\n function updateMinutes(index) {\n if(index > 0) {\n var currentMinute = minutes.value == 59 ? 0 : +minutes.value + index;\n } else {\n var currentMinute = minutes.value == 0 ? 59 : +minutes.value + index;\n }\n minutes.value = pad(currentMinute);\n }\n\n function updateHours(index) {\n var currentHour = hours.value;\n\n if((currentHour == 11 && index > 0 || currentHour == 12 && index < 0) && options.timerFormat != 24) {\n var $amPm = $($self.data('timeContainer')).find('.amPm');\n var currentAmPm = $amPm.text();\n\n if(currentAmPm == 'am') {\n currentAmPm = 'pm';\n } else {\n currentAmPm = 'am';\n }\n\n $amPm.text(currentAmPm);\n }\n\n if(options.timerFormat != 24) {\n if(index > 0) {\n currentHour = currentHour == 12 ? 1 : +hours.value + index;\n } else {\n currentHour = currentHour == 1 ? 12 : +hours.value + index;\n }\n } else {\n if(index > 0) {\n currentHour = currentHour == 23 ? 0 : +hours.value + index;\n } else {\n currentHour = currentHour == 0 ? 23 : +hours.value + index;\n }\n }\n\n hours.value = pad(currentHour);\n }\n\n table.cellSpacing = 0;\n table.cellPadding = 0;\n\n tdPlus.innerHTML = '&#9650;';\n tdMinus.innerHTML = '&#9660;';\n tdPlusMinutes.innerHTML = '&#9650;';\n tdMinusMinutes.innerHTML = '&#9660;';\n\n tdPlus.className = 'stepper';\n tdMinus.className = 'stepper';\n tdPlusMinutes.className = 'stepper';\n tdMinusMinutes.className = 'stepper';\n\n hours.type = 'text';\n hours.name = 'hours';\n hours.value = pad(currentHour);\n\n minutes.type = 'text';\n minutes.name = 'minutes';\n minutes.value = pad(currentMinute);\n\n tdPlus.onmousedown = function() {\n currentDown = this;\n fastSeekTime();\n }\n\n tdMinus.onmousedown = function() {\n currentDown = this;\n fastSeekTime();\n }\n\n tdPlusMinutes.onmousedown = function() {\n currentDown = this;\n fastSeekTime();\n }\n\n tdMinusMinutes.onmousedown = function() {\n currentDown = this;\n fastSeekTime();\n }\n\n tdPlus.onclick = function() {\n updateHours(1);\n }\n\n tdMinus.onclick = function() {\n updateHours(-1);\n }\n\n tdPlusMinutes.onclick = function() {\n updateMinutes(1);\n }\n\n tdMinusMinutes.onclick = function() {\n updateMinutes(-1);\n }\n\n tr.appendChild(tdPlus);\n tr.appendChild(td.cloneNode(false));\n tr.appendChild(tdPlusMinutes);\n\n table.appendChild(tr);\n\n tr = tr.cloneNode();\n\n td.appendChild(hours);\n\n tr.appendChild(td); // hours input\n tr.appendChild(td.cloneNode(false));\n\n var td2 = td.cloneNode(false);\n td2.className = 'minutes-container ' + (options.timerFormat == 24 ? 'military-format' : '');\n td2.appendChild(minutes);\n\n var span = ce('span');\n\n if(options.timerFormat != 24) {\n span.innerHTML = 'pm';\n span.className = 'amPm';\n }\n\n td2.appendChild(span);\n tr.appendChild(td2); // minutes input\n\n table.appendChild(tr);\n\n tr = tr.cloneNode(false);\n\n td = ce('td');\n\n tr.appendChild(tdMinus); // hours minus\n tr.appendChild(td.cloneNode(false));\n tr.appendChild(tdMinusMinutes); // minutes minus\n\n table.appendChild(tr);\n\n tr = tr.cloneNode(false);\n\n var tdColspan = td.cloneNode(false);\n\n tdColspan.colSpan = 4;\n\n var setButton = ce('button');\n\n setButton.innerHTML = 'SET';\n\n setButton.onclick = function() {\n\n var selectedTd = $($self.data('dateContainer')).find('td.selected');\n\n if(selectedTd.length == 0) {\n hide();\n return;\n }\n\n var selectedDate = selectedTd.get(0);\n var $timeContainer = $($self.data('timeContainer'));\n var selectedTime = $timeContainer.find('input');\n\n var amOrPm = $timeContainer.find('.amPm').text();\n var minutesValue = selectedTime.filter('[name=minutes]').val();\n var hoursValue = selectedTime.filter('[name=hours]').val();\n\n var d = selectedDate.dataset;\n\n var valueString = d.dateDayValue +' ';\n valueString += options.monthsLabel[d.dateMonthValue] +', ';\n valueString += d.dateYearValue +' @ ';\n valueString += hoursValue +':'+ minutesValue+' ';\n\n if(options.timerFormat != 24) {\n valueString += amOrPm.toUpperCase();\n }\n\n $self.val( valueString );\n\n if(options.timerFormat != 24) {\n altField.val(d.dateYearValue+'-'+(+d.dateMonthValue+1)+'-'+d.dateDayValue +' '+ (+hoursValue + (amOrPm == 'pm' ? 12 : 0)) +':'+ minutesValue+':00' );\n } else {\n altField.val(d.dateYearValue+'-'+(+d.dateMonthValue+1)+'-'+d.dateDayValue +' '+ hoursValue +':'+ minutesValue+':00' );\n }\n\n hide();\n }\n\n tdColspan.appendChild(setButton);\n\n tr.appendChild(tdColspan);\n\n table.appendChild(tr);\n\n return table;\n }", "function hourUpdate(){\n var currentHour = (moment().hours());\n console.log($(\".time-block\"));\n $(\".time-block\").each(function () {\n var blockHour = parseInt($(this).attr(\"id\").split(\"-\")[1]);\n console.log(\"test\")\n \n if (blockHour < currentHour) {\n $(this).addClass(\"past\");\n \n }\n\n else if (blockHour === currentHour) {\n $(this).addClass(\"past\");\n $(this).addClass(\"present\");\n }\n\n else{\n $(this).addClass(\"past\");\n $(this).addClass(\"present\");\n $(this).addClass(\"future\");\n }\n \n });\n\n}", "function startTime() {\n var t = moment().format(\"h:mm:ss\");\n document.getElementById(\"clock\").innerHTML = t\n t=setTimeout('startTime()', 1500)\n// console.log(\"db clock: \" + t);\n\n}", "function jsac_apply_time(elts){\n\t\tfor (var i = 0; i <elts.length; i++){\n\t\t\tvar cur = elts[i].innerHTML;\n\t\t\t\n\t\t\t/*\n\t\t\tif (cur == \"0:00:00\" or !cur.length){\n\t\t\t\tvar timeNow = new Date();\n\t\t \t\tvar hours = timeNow.getHours();\n\t\t \t\tvar minutes = timeNow.getMinutes();\n\t\t \t\tvar seconds = timeNow.getSeconds();\n\t\t \t\tvar timeString = \"\" + hours;\n \t\t\t\ttimeString += ((minutes < 10) ? \":0\" : \":\") + minutes;\n \t\t\t\ttimeString += ((seconds < 10) ? \":0\" : \":\") + seconds;\n\t\t \t\telts[i].innerHTML = timeString;\n\t\t \t}\n\t\t\t*/\n\t\t }\n\t\t \n\t}", "calcTime () {\n const numberOfIngredients = this.ingredients.length;\n const period = Math.ceil( numberOfIngredients / 3 )\n this.time = period * 15;\n }", "function displayTime() {\n var time = moment().format('HH:mm:ss');\n $('#clock').html(time);\n setTimeout(displayTime, 1000);\n }", "function hourTracker() {\n var currentHour = moment().hour();\n\n // Grabs each time block and converted to an individual integer\n $(\".time-block\").each(function () {\n var blockHour = parseInt($(this).attr(\"id\").split(\"hour\")[1]);\n console.log(blockHour);\n\n // Color codes for Present, Past, Future\n if (blockHour === currentHour) {\n $(this).css(\"background-color\", \"yellow\");\n }\n\n if (blockHour < currentHour) {\n $(this).css(\"background-color\", \"gray\");\n }\n\n if (blockHour > currentHour) {\n $(this).css(\"background-color\", \"green\");\n }\n });\n }", "function realTime() {\r\n \t$(\"#clock\").html(moment().format(\"HH:mm:ss\"));\r\n \tif(moment().format(\"ss\") == 0) {\r\n \t\t// updates the train times on every minute\r\n \t\tclock();\r\n \t}\r\n}", "calcTime(){\n const numIng=this.ingredients.length;//ingredients is an array \n const periods= Math.ceil(numIng/3);\n this.time=periods*15;\n }", "function updatehour() {\r\n var currenthour = moment().hours()\r\n $(\".time-block\").each(function () {\r\n //splitting the hour-11 id with the \"-\"\r\n //as the delimiter, and focusing on the\r\n //number (hour) based on its position \r\n //after transforming it into an array\r\n var blockhour = parseInt($(this).attr(\"id\").split(\"-\")[1]);\r\n if (blockhour < currenthour) {\r\n //turn it grey\r\n $(this).addClass(\"past\")\r\n } else if (blockhour === currenthour) {\r\n //remove the grey and apply red\r\n $(this).removeClass(\"past\")\r\n $(this).addClass(\"present\")\r\n } else {\r\n //remove the grey and red, apply the green\r\n $(this).removeClass(\"past\")\r\n $(this).removeClass(\"present\")\r\n $(this).addClass(\"future\")\r\n }\r\n })\r\n\r\n }", "function updateTime (){\n setTimeout(\n function (){\n let time = document.querySelectorAll('.time_test-js');\n time.forEach(element => {\n let convertTime = new Date(element.getAttribute('data-time')),\n update = timeAgo(convertTime);\n element.innerHTML = update;\n });\n updateTime();\n }\n , 60000);\n}", "function compareTimeBlocks(currentTime){\n //For each element in the array, check the current time against the time block data and change classes accordingly\n timeblockArray.forEach(element => {\n let timeblockTime = moment(element.time,\"h:mma\");\n let timeblockHour = timeblockTime.format(\"H\");\n\n //Get handle to jQuery DOM object text area\n let display = element.domObject.children('textarea');\n \n //Check if current timeblock is in the past\n if(+currentTime>+timeblockHour){\n display.removeClass(\"present\");\n display.addClass(\"past\");\n //Next, check if timeblock is in the future\n }else if(+currentTime<+timeblockHour){\n display.removeClass(\"past\")\n display.addClass(\"future\");\n\n //Else, timeblock must be in the preset\n }else{\n display.removeClass(\"future\")\n display.addClass(\"present\")\n }\n });\n}", "function dynamicClock() {\n var today = new Date();\n var hours = today.getHours() % 12;\n if ( hours == 0) { hours = 12; }\n var mins = today.getMinutes();\n var secs = today.getSeconds();\n var timeString = getTime(hours) + \":\" + getTime(mins) + \":\" + getTime(secs);\n document.getElementById('txt').innerHTML = timeString;\n var theTime = setTimeout(dynamicClock, 500);\n}", "function displayTime() {\n currDate = moment().format(\"dddd, MMMM Do YYYY, h:mm:ss a\");\n currentDayEl.html(currDate);\n currM = moment().format('m');\n currh = parseInt(moment().format(\"H\"));\n if(parseInt(currM)+0 === 0 && currh > prevHour){ /// This check is set the active hour automatically\n setBGClass();\n }\n}", "function currentTime() {\n var currentHour = moment().hour();\n $(\".time-block\").each(function() {\n var hour = parseInt($(this).attr(\"id\"));\n\n if (hour < currentHour) {\n $(this).addClass(\"past\");\n } \n else if (hour === currentHour) {\n $(this).removeClass(\"past\");\n $(this).addClass(\"present\");\n }\n else {\n $(this).removeClass(\"past\");\n $(this).removeClass(\"present\");\n $(this).addClass(\"future\");\n }\n });\n}", "function loopHour() {\n var momentHour = moment().hours();\n\n console.log(momentHour);\n\n $(\".time-block\").each(function () {\n var ourHour = parseInt($(this).attr(\"id\").split(\"-\")[1]);\n console.log(ourHour);\n\n if (ourHour < momentHour) {\n $(this).children(\".description\").addClass(\"past\");\n } else if (ourHour === momentHour) {\n $(this).children(\".description\").removeClass(\"past\");\n $(this).children(\".description\").addClass(\"present\");\n } else {\n $(this).children(\".description\").addClass(\"future\");\n $(this).children(\".description\").removeClass(\"past\");\n $(this).children(\".description\").removeClass(\"present\");\n }\n });\n }", "function buildSchedule() {\n for (let i = 0; i < timeSlots.length; i++) {\n let slots = timeSlots[i];\n // grabs only the first 2 digits from the time key\n let slotsHour = slots.time / 100;\n // variables to build all elements and set appropriate attributes\n $row = $(\"<div>\").addClass(\"row time-block\")\n $hour = $(\"<div>\").addClass(\"col-md-1 hour\");\n // Determines whether to display AM or PM\n if (slotsHour > 12) { $hour.text(slotsHour - 12 + \"PM\") }\n else { $hour.text(slotsHour + \"AM\") }\n $input = $(\"<textarea>\").addClass(\"col-md-10 description\").attr(\"id\", \"hour\" + slotsHour)\n $saveIcon = $(\"<i>\").addClass(\"far fa-save\");\n $save = $(\"<button>\").addClass(\"col-md-1 btn saveBtn\").append($saveIcon);\n // color-codes time slots based on current time\n if (currentTime > slotsHour) {\n $input.addClass(\"past\")\n } else if (currentTime < slotsHour) {\n $input.addClass(\"future\")\n } else if (currentTime == slotsHour) {\n $input.addClass(\"present\")\n }\n // appends cols to row, and row to .container\n $row.append($hour, $input, $save)\n $(\".container\").append($row)\n }\n}", "function load_all_time_slots() {\n $.post('gate_man_AJAX/load_all_time_slots.php',{\n },function(data){\n if (typeof data === 'object'){\n parse_data(data);\n }else if(data){\n create_exception(data ,23,'danger');\n }else{\n create_exception(\"Could not connect to the server. Please check your <strong>internet connection</strong>.\",23,'danger');\n }\n });\n setTimeout(generate_gate_selector,250); // nutne cakanie koli spracovaniu dat ktor boli ziskane ajaxom\n}", "function buildTimeSlot(hour) {\n // Here is the creation of the row with its necessary classes\n const $timeSlot = $(\"<div>\")\n .attr(\"id\", \"hour-\" + hour)\n .attr(\"class\", \"row time-block hour\");\n// Here is the label for the rows\n const $timeLabel = $(\"<div>\").attr(\"class\", \"col-md-1\");\n // This if statement helped create the labels correctly marking hour and and period \n if(hour > 12){\n $timeLabel.text(hour - 12 + \"PM\");\n }else if(hour === 12){\n $timeLabel.text(hour + \"PM\");\n }else {\n $timeLabel.text(hour + \"AM\");\n };\n // Here a text area was created to attatch our todo's\n const $textArea = $(\"<textarea>\").attr(\"class\", \"col-md-10 description\");\n// This if else is used in conjunction with css to apply backgrounds that will colorcode the block based on time\n if (hour <= currentTime) {\n $textArea.addClass(\"past\");\n } else if(hour === currentTime){\n $textArea.addClass(\"present\");\n } else if(hour >= currentTime) {\n $textArea.addClass(\"present\")\n }\n // This creates our save buttons at the end of each row\n const $btn = $(\"<button>\")\n .attr(\"class\", \"btn saveBtn col-md-1\")\n .append($(\"<i>\").attr(\"class\", \"fas fa-save\"))\n .data(\"block-hour\", hour);\n// This ties all of the creat elements together\n $timeSlot.append($timeLabel, $textArea, $btn);\n\n return $timeSlot;\n}", "function refreshTimeTable() {\n\n currentWeekDay = currentTime.getDay();\n Year = currentTime.getFullYear();\n Month = currentTime.getMonth();\n Day = currentTime.getDate();\n var weekday = getMonthBeginWeekDay();\n var numOfTotalDay = getMonthGreatestDate(Year, Month);\n var numOFLastTotalDay = getLastMonthGreatestDate(Year, Month);\n var totalDayCounter = 0 - weekday;\n var dayCounter;\n var weekDayCounter;\n var blockClass;\n var timeTable;\n\n // Construct the weekdays in the first role\n timeTable = \"<tr class=\\\"weekDayBlockRow\\\">\";\n for (var counter = 0; counter < 7; counter++) {\n timeTable += \"<td>\" + weekNameList[counter] + \"</td>\";\n }\n timeTable += \"</tr>\";\n\n // Contruct specific date of the timetable and demonstrate its status: Last month? Next month?\n for (weekCounter = 0; weekCounter < 6; weekCounter++) {\n timeTable += \"<tbody class = \\\"dayTbody\\\"><tr class=\\\"normalDayBlockRow\\\">\";\n for (weekDayCounter = 0; weekDayCounter < 7; weekDayCounter++) {\n\n var blockID = weekCounter + \"-\" + weekDayCounter + \"-Date\";\n ++totalDayCounter\n // Days from last month\n if (totalDayCounter <= 0) {\n blockClass = \"blockedTimeTableBlock\";\n dayCounter = totalDayCounter + numOFLastTotalDay;\n }\n // Days form next month\n else if (totalDayCounter > numOfTotalDay) {\n blockClass = \"blockedTimeTableBlock\";\n dayCounter = totalDayCounter - numOfTotalDay;\n }\n // Days past && within this month\n else if (currentYear > Year || (currentYear == Year && (currentMonth > Month || (currentMonth == Month && currentDay > totalDayCounter)))) {\n blockClass = \"passedTableBlock\";\n dayCounter = totalDayCounter;\n }\n // Days in the future && with in this month\n else {\n blockClass = \"emptyTimeTableBlock\";\n dayCounter = totalDayCounter;\n }\n timeTable += \"<td id=\\\"\" + blockID + \"\\\" class=\\\"\" + blockClass + \"\\\">&nbsp\"\n + dayCounter\n + \"</td>\";\n\n if (weekDayCounter == 0) {\n if (dayCounter < 10)\n sundayList.push(Year + \"-\" + Month + \"-0\" + dayCounter);\n else\n sundayList.push(Year + \"-\" + Month + \"-\" + dayCounter);\n }\n }\n timeTable += \"</tr>\";\n\n // Demonstrate the job roles allocation during one week period\n for (var jobRoleCounter = 0; jobRoleCounter < 3; jobRoleCounter++) {\n timeTable += \"<tr class=\\\"\" + jobRoleList[jobRoleCounter] + \"JobBlockRow\\\">\";\n // weekDayCounter = 0;\n if (0) {\n timeTable += \"<td colspan=\\\"2\\\" class=\\\"JobBlock\\\">\";\n } else {\n timeTable += \"<td colspan=\\\"2\\\" class=\\\"JobBlock\\\">\";\n timeTable += \"<div id=\\\"\" + weekCounter + \"-\" + jobRoleCounter + \"-0\\\" class=\\\"\" + jobRoleList[jobRoleCounter] + \"JobBlock\\\"></div></td>\";\n }\n if (0) {\n timeTable += \"<td colspan=\\\"5\\\" class=\\\"JobBlock\\\">\";\n } else {\n timeTable += \"<td colspan=\\\"5\\\" class=\\\"JobBlock\\\">\";\n timeTable += \"<div id=\\\"\" + weekCounter + \"-\" + jobRoleCounter + \"-1\\\" class=\\\"\" + jobRoleList[jobRoleCounter] + \"JobBlock\\\"></div></td>\";\n }\n timeTable += \"</tr>\";\n }\n\n timeTable += \"</tbody>\";\n }\n\n // Insert the data structure into the HTML file \n // console.log(timeTable);\n document.getElementById(\"timeTable\").innerHTML = timeTable;\n // loadPerson();\n passData();\n getMonthData();\n}", "function createTimeLine(){\r\n\t\tvar timeLine = '<div class=\"timeLineContainer\"><div class=\"timeLine\"><div class=\"progressBar\"></div><div class=\"eventsLine\"></div></div></div>';\r\n\t\t\r\n\t\t$(\"body\").prepend(timeLine);\r\n\t}", "function getTime() {\n var today=new Date();\n today.setTime(today.getTime() + (hourOffset*3600*1000) + (minuteOffset*60*1000));\n document.getElementById('addTime').innerHTML = \"Simulation Time: \" + today.toLocaleTimeString('en-US', {timeZone: 'UTC'});\n var t = setTimeout(function(){getTime()},500);\n}", "function updateTime(){\n setTimeContent(\"timer\");\n}", "function checkIfCurHour() {\n var currHour = moment().hours();\n $timeBlockEl.each(function () {\n var blockHour = $(this).data(\"hour\");\n \n function getBlockStyle() {\n if (blockHour > currHour) {\n return \"future\";\n } else if (blockHour < currHour) {\n return \"past\";\n } else if (blockHour === currHour) {\n return \"present\";\n }\n }\n\n $(this).removeClass(\"present past future\");\n $(this).addClass(getBlockStyle());\n });\n}", "initialize_clock() {\n\t\tthis.$clock.html( theme_utils.get_current_localized_time() );\n\n\t\tsetInterval( () => _self.$clock.html( theme_utils.get_current_localized_time() ), 60000 );\n\t}", "function drawTimeGrid() {\n timeGrid.innerHTML = \"\";\n updateDateAndTz();\n fillDays();\n makeRows(25, difference + 1);\n }", "function startTime() {\n\tvar now = new Date();\n\tvar hour = ('0' + now.getHours()).slice(-2);\n\tvar mins = now.getMinutes();\n\tvar secs = now.getSeconds();\n\tvar ampm = hour >= 12 ? 'PM' : 'AM';\n\tvar day = ('0' + now.getDate()).slice(-2);\n\tvar month = ('0' + (now.getMonth()+1)).slice(-2);\n\tvar year = now.getFullYear();\n \thour = hour ? hour : 12;\n\tmins = mins < 10 ? '0' + mins : mins;\n\tsecs = secs < 10 ? '0' + secs : secs;\n\tvar timeString = hour + ':' + mins;\n\tvar dateString = month + '/' + day + '/' + year;\n\tdocument.getElementById('time').innerHTML = timeString;\n\tdocument.getElementById('date').innerHTML = dateString;\n\tvar t = setTimeout(startTime, 500);\n}", "function checkTime() {\n //get current time in hours\n var currentHour = moment().hour();\n\n //checking each time block\n $(\".time-block\").each(function () {\n //grabbing time string and converting it to a number to compare against current time\n var hour = parseInt($(this).attr(\"id\").split(\"time\")[1]);\n\n //check if we've moved past this timeblock\n if (hour < currentHour) {\n $(this).addClass(\"past\");\n $(this).removeClass(\"future\");\n $(this).removeClass(\"present\");\n }\n //if we are in this timeblock\n else if (hour === currentHour) {\n $(this).removeClass(\"past\");\n $(this).addClass(\"present\");\n $(this).removeClass(\"future\");\n }\n //if we have not yet reached this timeblock\n else {\n $(this).removeClass(\"present\");\n $(this).removeClass(\"past\");\n $(this).addClass(\"future\");\n }\n });\n}", "renderHours(currentDate, blocks, buffer) {\n var hours = [];\n var hourHeight = 95 / (this.state.end - this.state.start) + \"%\";\n \n\n for(let i = this.state.start; i < this.state.end; i++) {\n let toDisplay = (i > 11 ? (i === 12 ? 12 : i % 12) + \"PM\" : i + \"AM\");\n let toPass = i;\n\n //here we do the logic to figure out if it is busy or not\n let hourStyle = {\n 'height':hourHeight\n }\n let hourClass = \"calendar-hour\";\n /*\n * If the hour falls in a block we make it blue\n * IF it is an overnight event we currently will not deal with it, it will just go to the end of the current day\n */\n\n for(let j = 0; j < blocks.length; j++) {\n let overnight = false;\n //console.log(blocks[j]);\n if(blocks[j].finish.format(\"D\") > currentDate.format(\"D\")) {\n var newBlock = {\n start: moment().set({'day':currentDate.get('day') + 1,\n 'hour':1}),\n finish: blocks[j].finish\n }\n buffer.push(newBlock);\n overnight = true;\n } \n \n if(i >= blocks[j].start.format(\"H\") &&\n (i <= blocks[j].finish.format(\"H\") || overnight)) {\n hourClass = \"calendar-busy\";\n }\n }\n let toSend = currentDate.clone();\n toSend = toSend.set({'hour':toPass, 'minute':0, 'seconds':0});\n hours.push(\n <div key={currentDate.format('dddd') + i} style={hourStyle} className={hourClass} onClick={((e) => this.handleClick(e, toSend))}>\n { toDisplay }\n\n </div>\n );\n }\n return hours;\n }", "function checkTime() {\n //grab current hour using moment js\n var currentHour = moment().hours();\n console.log(currentHour);\n\n //NEED TO GRAB HOUR FOR TIME BLOCK TO CMPARE TO CURRENT HOUR AND turn caps lock off\n //loop through time block hours\n $(\".time-block\").each(function () {\n var blockHour = parseInt($(this).attr(\"id\").split(\"-\")[1]);\n // console.log(typeof)\n\n if (blockHour > currentHour) {\n $(this).addClass(\"past\");\n } else if (blockHour === currentHour) {\n $(this).addClass(\"present\");\n } else if (blockHour < currentHour) {\n $(this).addClass(\"future\");\n }\n });\n\n //check the currentHour against blockHour\n //if else\n }", "function loadTimer() {\n currentTimerType = PEvents.nextTimer(currentTimerType);\n \n switch (currentTimerType) {\n case PEvents.Timers.pomodoro:\n minutes = 25;\n seconds = 0;\n break;\n \n case PEvents.Timers.short_break:\n minutes = 5;\n seconds = 0;\n break;\n\n case PEvents.Timers.long_break:\n minutes = 25;\n seconds = 0;\n break;\n }\n\n render();\n }", "function showTime() {\r\n // stocam in variabila time un string cu ora curenta obtinut din libraria moment.js\r\n const time = moment().format(\"HH:mm:ss\");\r\n // orice e in elementul clockContainer va fi rescris.\r\n clockContainer.innerHTML = time;\r\n // trimitem functia ca parametru in metoda requestAnimationFrame de pe obiectul window.\r\n window.requestAnimationFrame(showTime);\r\n}", "function createTimeSlot(hour) {\n const $timeSlot = $(\"<div>\")\n .attr(\"id\", `hour-${hour}`)\n .attr(\"value\", hour)\n .attr(\"class\", \"row time-block\");\n const $timeLabel = $(\"<div>\").attr(\"class\", \"col-md-1 hour\").addClass(\"currentHour\");\n if (hour > 12) {\n $timeLabel.text(`${hour - 12} PM`);\n } else if (hour === 12) {\n $timeLabel.text(`${hour} PM`);\n } else {\n $timeLabel.text(`${hour} AM`);\n }\n\n // Defined the variable for the text area and save button to be rendrered.\n const $textArea = $(\"<textarea>\").attr(\"class\", \"col-md-10 description\").attr(\"text\", hour);\n const $saveBtn = $(\"<button>\")\n .attr(\"class\", \"btn saveBtn col-md-1\")\n .append($(\"<i>\").attr(\"class\", \"fas fa-save\"));\n $timeSlot.append($timeLabel, $textArea, $saveBtn);\n\n // declared a variable to get teh current time. This will be used in the next function to color the text area.\n let currentTime = parseInt(luxon.DateTime.local().toFormat(\"H\"));\n// This function sets the color of the text area based on the current time. Grey for past, Red for current hour and green for future hour.\n $(\".container\").each(function (block) {\n \n if ($timeSlot.attr(\"value\") < currentTime) {\n $textArea.addClass(\"past\");\n } else if ($timeSlot.attr(\"value\") == currentTime) {\n $textArea.addClass(\"present\");\n } else {\n $textArea.addClass(\"future\");\n }\n });\n return $timeSlot;\n}", "function createTimer() {\n debug(\"createTimer\");\n clock = document.createElement('span');\n clock.setAttribute(\"class\", \"timer\");\n clock.innerHTML = \"0 Seconds\";\n\n document.querySelector('.score-panel').appendChild(clock);\n startTime();\n }", "function showSlots() {\n let first = 20;\n week_slots.forEach((slot, i) => {\n\n let day_name = getDayName(slot['day'] - 1);\n let cur_day = document.querySelector('#'+day_name + ' .day_body');\n let slot_div = document.createElement('div');\n slot_div.classList.add('event');\n slot_div.id = slot['id'];\n\n days_with_slots[slot['day']] = true;\n\n let time = numToTime(slot['start']);\n if(slot.booked_by == null) {\n slot_div.innerHTML = time;\n } else {\n if(current_usr == SESSION_USR) {\n slot_div.innerHTML = `Booked by ${slot.booked_by}`;\n } else {\n slot_div.innerHTML = 'Booked';\n }\n slot_div.classList.add('bg_marked');\n }\n if(slot.start < first) first = slot.start;\n cur_day.appendChild(slot_div);\n });\n // console.log(`first ${first}`);\n}" ]
[ "0.75794035", "0.74038005", "0.7341512", "0.73205024", "0.7091409", "0.69319344", "0.68342084", "0.68321145", "0.6806659", "0.6770378", "0.674901", "0.6626801", "0.6596864", "0.6593662", "0.65730083", "0.6553637", "0.64862704", "0.6468854", "0.6459464", "0.64409274", "0.6429726", "0.6379942", "0.6378687", "0.6372553", "0.6362771", "0.6346664", "0.6346619", "0.6314631", "0.6289331", "0.6274103", "0.6267563", "0.6248061", "0.62428427", "0.6230787", "0.62169206", "0.62100995", "0.6199962", "0.6197875", "0.6196137", "0.61887354", "0.61518794", "0.6119008", "0.6113312", "0.61100835", "0.61052287", "0.6104166", "0.6097234", "0.60917664", "0.6089497", "0.60865515", "0.6074165", "0.60725087", "0.6064919", "0.6050903", "0.6046819", "0.60466677", "0.60314965", "0.602644", "0.6013487", "0.600633", "0.60054916", "0.5995933", "0.5978267", "0.596913", "0.5968132", "0.5963506", "0.59527606", "0.5952", "0.5950549", "0.5945806", "0.5933356", "0.5929298", "0.5924313", "0.5919209", "0.5911013", "0.5909237", "0.58976156", "0.5892974", "0.5885159", "0.58816195", "0.58811253", "0.5877001", "0.5872729", "0.58721405", "0.5860897", "0.5858389", "0.5852575", "0.58444095", "0.5843657", "0.5832544", "0.5832181", "0.58318186", "0.58256423", "0.58190763", "0.5813156", "0.5812534", "0.58098626", "0.58023906", "0.57998246", "0.57992095" ]
0.6504124
16
You can explore the builtin icon families and icons on the web at:
function TabBarIcon(props: { name: string; color: string }) { return <MaterialIcons size={30} style={{ marginBottom: -3 }} {...props} />; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function MatIconLocation() {}", "function Icon(n,s,c,callback){\n\texecute(\"gsettings get org.gnome.desktop.interface icon-theme\",function(stdout){\n\t\tif(stdout != \"\"){theme_name=decodeURIComponent(stdout.replace(/[\"']/g, \"\"));IconFinder(theme_name,n,s,c,callback,true);}else{\n\t\t\texecute(\"grep '^gtk-icon-theme-name' $HOME/.gtkrc-2.0 | awk -F'=' '{print $2}'\",function(stdout){\n\t\t\t\tif(stdout != \"\"){theme_name=decodeURIComponent(stdout.replace(/[\"']/g, \"\"));IconFinder(theme_name,n,s,c,callback,true);}\n\t\t\t})\n\t\t}\n\t})\n}", "getIcon_() {\n return this.isCloudGamingDevice_ ? 'oobe-32:game-controller' :\n 'oobe-32:checkmark';\n }", "generateIcons() {\n const terminalBase = Core.atlas.find(this.name);\n const terminalDisplay = Core.atlas.find(this.name + \"-display-icon\");\n return [terminalBase, terminalDisplay];\n }", "function getIcon(types) {\n\t\tswitch(types) {\n\t\t\t//case \"pharmacy\": return \"icons/drugstore.png\";\n\t\t\tcase \"hospital\": return \"https://www.phoenixchildrens.org/sites/default/files/images/hospital-building.png\";\n\t\t\t//case \"lab\": return \"icons/barber.png\";\n\t\t\tdefault: return \"http://www.bloodjournal.org/sites/all/modules/highwire/highwire/images/google-icon.png\";\n\t\t}\n\t}", "getIcon() {\n return \"document-cook\";\n }", "function getIconForDevice(system) {\n if (system == \"WIN\") {\n return \"fa-windows\";\n } else if (system == \"LINUX\") {\n return \"fa-linux\";\n } else {\n return \"fa-question-circle\";\n }\n}", "function icons() {\r\n var arr = [], style = 'style=\"width:18px\"';\r\n if (iconMapper.map(link)) add(iconMapper.map(link));\r\n if (iconMapper.map(obj.Type)) add(iconMapper.map(obj.Type));\r\n if (reg !== 'Message' && iconMapper.map(reg)) add(iconMapper.map(reg));\r\n if (detail.contains('email')) add(iconMapper.map('email'));\r\n if (detail.contains('SMS')) add(iconMapper.map('sms'));\r\n\r\n //make sure there is exactly 2 icons\r\n arr.first(2);\r\n while (arr.length < 2) {\r\n arr.push('icon-blank');\r\n }\r\n\r\n if (arr.length) {\r\n return '<i ' + style + ' class=\"' + arr.join(' icon-large muted disp-ib\"></i> <i ' + style + ' class=\"') + ' icon-large muted disp-ib\"></i> ';\r\n } else {\r\n return '';\r\n }\r\n function add(i) {\r\n if (!arr.contains(i)) arr.push(i);\r\n }\r\n }", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-1\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-1-4d521695.woff') format('woff')\"\n },\n icons: {\n 'Paste': '\\uE77F',\n 'WindowsLogo': '\\uE782',\n 'Error': '\\uE783',\n 'GripperBarVertical': '\\uE784',\n 'Unlock': '\\uE785',\n 'Slideshow': '\\uE786',\n 'Trim': '\\uE78A',\n 'AutoEnhanceOn': '\\uE78D',\n 'AutoEnhanceOff': '\\uE78E',\n 'Color': '\\uE790',\n 'SaveAs': '\\uE792',\n 'Light': '\\uE793',\n 'Filters': '\\uE795',\n 'AspectRatio': '\\uE799',\n 'Contrast': '\\uE7A1',\n 'Redo': '\\uE7A6',\n 'Crop': '\\uE7A8',\n 'PhotoCollection': '\\uE7AA',\n 'Album': '\\uE7AB',\n 'Rotate': '\\uE7AD',\n 'PanoIndicator': '\\uE7B0',\n 'Translate': '\\uE7B2',\n 'RedEye': '\\uE7B3',\n 'ViewOriginal': '\\uE7B4',\n 'ThumbnailView': '\\uE7B6',\n 'Package': '\\uE7B8',\n 'Telemarketer': '\\uE7B9',\n 'Warning': '\\uE7BA',\n 'Financial': '\\uE7BB',\n 'Education': '\\uE7BE',\n 'ShoppingCart': '\\uE7BF',\n 'Train': '\\uE7C0',\n 'Move': '\\uE7C2',\n 'TouchPointer': '\\uE7C9',\n 'Merge': '\\uE7D5',\n 'TurnRight': '\\uE7DB',\n 'Ferry': '\\uE7E3',\n 'Highlight': '\\uE7E6',\n 'PowerButton': '\\uE7E8',\n 'Tab': '\\uE7E9',\n 'Admin': '\\uE7EF',\n 'TVMonitor': '\\uE7F4',\n 'Speakers': '\\uE7F5',\n 'Game': '\\uE7FC',\n 'HorizontalTabKey': '\\uE7FD',\n 'UnstackSelected': '\\uE7FE',\n 'StackIndicator': '\\uE7FF',\n 'Nav2DMapView': '\\uE800',\n 'StreetsideSplitMinimize': '\\uE802',\n 'Car': '\\uE804',\n 'Bus': '\\uE806',\n 'EatDrink': '\\uE807',\n 'SeeDo': '\\uE808',\n 'LocationCircle': '\\uE80E',\n 'Home': '\\uE80F',\n 'SwitcherStartEnd': '\\uE810',\n 'ParkingLocation': '\\uE811',\n 'IncidentTriangle': '\\uE814',\n 'Touch': '\\uE815',\n 'MapDirections': '\\uE816',\n 'CaretHollow': '\\uE817',\n 'CaretSolid': '\\uE818',\n 'History': '\\uE81C',\n 'Location': '\\uE81D',\n 'MapLayers': '\\uE81E',\n 'SearchNearby': '\\uE820',\n 'Work': '\\uE821',\n 'Recent': '\\uE823',\n 'Hotel': '\\uE824',\n 'Bank': '\\uE825',\n 'LocationDot': '\\uE827',\n 'Dictionary': '\\uE82D',\n 'ChromeBack': '\\uE830',\n 'FolderOpen': '\\uE838',\n 'PinnedFill': '\\uE842',\n 'RevToggleKey': '\\uE845',\n 'USB': '\\uE88E',\n 'Previous': '\\uE892',\n 'Next': '\\uE893',\n 'Sync': '\\uE895',\n 'Help': '\\uE897',\n 'Emoji': '\\uE899',\n 'MailForward': '\\uE89C',\n 'ClosePane': '\\uE89F',\n 'OpenPane': '\\uE8A0',\n 'PreviewLink': '\\uE8A1',\n 'ZoomIn': '\\uE8A3',\n 'Bookmarks': '\\uE8A4',\n 'Document': '\\uE8A5',\n 'ProtectedDocument': '\\uE8A6',\n 'OpenInNewWindow': '\\uE8A7',\n 'MailFill': '\\uE8A8',\n 'ViewAll': '\\uE8A9',\n 'Switch': '\\uE8AB',\n 'Rename': '\\uE8AC',\n 'Go': '\\uE8AD',\n 'Remote': '\\uE8AF',\n 'SelectAll': '\\uE8B3',\n 'Orientation': '\\uE8B4',\n 'Import': '\\uE8B5'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-1\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-1-4d521695.woff') format('woff')\"\n },\n icons: {\n 'Paste': '\\uE77F',\n 'WindowsLogo': '\\uE782',\n 'Error': '\\uE783',\n 'GripperBarVertical': '\\uE784',\n 'Unlock': '\\uE785',\n 'Slideshow': '\\uE786',\n 'Trim': '\\uE78A',\n 'AutoEnhanceOn': '\\uE78D',\n 'AutoEnhanceOff': '\\uE78E',\n 'Color': '\\uE790',\n 'SaveAs': '\\uE792',\n 'Light': '\\uE793',\n 'Filters': '\\uE795',\n 'AspectRatio': '\\uE799',\n 'Contrast': '\\uE7A1',\n 'Redo': '\\uE7A6',\n 'Crop': '\\uE7A8',\n 'PhotoCollection': '\\uE7AA',\n 'Album': '\\uE7AB',\n 'Rotate': '\\uE7AD',\n 'PanoIndicator': '\\uE7B0',\n 'Translate': '\\uE7B2',\n 'RedEye': '\\uE7B3',\n 'ViewOriginal': '\\uE7B4',\n 'ThumbnailView': '\\uE7B6',\n 'Package': '\\uE7B8',\n 'Telemarketer': '\\uE7B9',\n 'Warning': '\\uE7BA',\n 'Financial': '\\uE7BB',\n 'Education': '\\uE7BE',\n 'ShoppingCart': '\\uE7BF',\n 'Train': '\\uE7C0',\n 'Move': '\\uE7C2',\n 'TouchPointer': '\\uE7C9',\n 'Merge': '\\uE7D5',\n 'TurnRight': '\\uE7DB',\n 'Ferry': '\\uE7E3',\n 'Highlight': '\\uE7E6',\n 'PowerButton': '\\uE7E8',\n 'Tab': '\\uE7E9',\n 'Admin': '\\uE7EF',\n 'TVMonitor': '\\uE7F4',\n 'Speakers': '\\uE7F5',\n 'Game': '\\uE7FC',\n 'HorizontalTabKey': '\\uE7FD',\n 'UnstackSelected': '\\uE7FE',\n 'StackIndicator': '\\uE7FF',\n 'Nav2DMapView': '\\uE800',\n 'StreetsideSplitMinimize': '\\uE802',\n 'Car': '\\uE804',\n 'Bus': '\\uE806',\n 'EatDrink': '\\uE807',\n 'SeeDo': '\\uE808',\n 'LocationCircle': '\\uE80E',\n 'Home': '\\uE80F',\n 'SwitcherStartEnd': '\\uE810',\n 'ParkingLocation': '\\uE811',\n 'IncidentTriangle': '\\uE814',\n 'Touch': '\\uE815',\n 'MapDirections': '\\uE816',\n 'CaretHollow': '\\uE817',\n 'CaretSolid': '\\uE818',\n 'History': '\\uE81C',\n 'Location': '\\uE81D',\n 'MapLayers': '\\uE81E',\n 'SearchNearby': '\\uE820',\n 'Work': '\\uE821',\n 'Recent': '\\uE823',\n 'Hotel': '\\uE824',\n 'Bank': '\\uE825',\n 'LocationDot': '\\uE827',\n 'Dictionary': '\\uE82D',\n 'ChromeBack': '\\uE830',\n 'FolderOpen': '\\uE838',\n 'PinnedFill': '\\uE842',\n 'RevToggleKey': '\\uE845',\n 'USB': '\\uE88E',\n 'Previous': '\\uE892',\n 'Next': '\\uE893',\n 'Sync': '\\uE895',\n 'Help': '\\uE897',\n 'Emoji': '\\uE899',\n 'MailForward': '\\uE89C',\n 'ClosePane': '\\uE89F',\n 'OpenPane': '\\uE8A0',\n 'PreviewLink': '\\uE8A1',\n 'ZoomIn': '\\uE8A3',\n 'Bookmarks': '\\uE8A4',\n 'Document': '\\uE8A5',\n 'ProtectedDocument': '\\uE8A6',\n 'OpenInNewWindow': '\\uE8A7',\n 'MailFill': '\\uE8A8',\n 'ViewAll': '\\uE8A9',\n 'Switch': '\\uE8AB',\n 'Rename': '\\uE8AC',\n 'Go': '\\uE8AD',\n 'Remote': '\\uE8AF',\n 'SelectAll': '\\uE8B3',\n 'Orientation': '\\uE8B4',\n 'Import': '\\uE8B5'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-2\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-2-63c99abf.woff') format('woff')\"\n },\n icons: {\n 'Picture': '\\uE8B9',\n 'ChromeClose': '\\uE8BB',\n 'ShowResults': '\\uE8BC',\n 'Message': '\\uE8BD',\n 'CalendarDay': '\\uE8BF',\n 'CalendarWeek': '\\uE8C0',\n 'MailReplyAll': '\\uE8C2',\n 'Read': '\\uE8C3',\n 'Cut': '\\uE8C6',\n 'PaymentCard': '\\uE8C7',\n 'Copy': '\\uE8C8',\n 'Important': '\\uE8C9',\n 'MailReply': '\\uE8CA',\n 'GotoToday': '\\uE8D1',\n 'Font': '\\uE8D2',\n 'FontColor': '\\uE8D3',\n 'FolderFill': '\\uE8D5',\n 'Permissions': '\\uE8D7',\n 'DisableUpdates': '\\uE8D8',\n 'Unfavorite': '\\uE8D9',\n 'Italic': '\\uE8DB',\n 'Underline': '\\uE8DC',\n 'Bold': '\\uE8DD',\n 'MoveToFolder': '\\uE8DE',\n 'Dislike': '\\uE8E0',\n 'Like': '\\uE8E1',\n 'AlignCenter': '\\uE8E3',\n 'OpenFile': '\\uE8E5',\n 'ClearSelection': '\\uE8E6',\n 'FontDecrease': '\\uE8E7',\n 'FontIncrease': '\\uE8E8',\n 'FontSize': '\\uE8E9',\n 'CellPhone': '\\uE8EA',\n 'RepeatOne': '\\uE8ED',\n 'RepeatAll': '\\uE8EE',\n 'Calculator': '\\uE8EF',\n 'Library': '\\uE8F1',\n 'PostUpdate': '\\uE8F3',\n 'NewFolder': '\\uE8F4',\n 'CalendarReply': '\\uE8F5',\n 'UnsyncFolder': '\\uE8F6',\n 'SyncFolder': '\\uE8F7',\n 'BlockContact': '\\uE8F8',\n 'Accept': '\\uE8FB',\n 'BulletedList': '\\uE8FD',\n 'Preview': '\\uE8FF',\n 'News': '\\uE900',\n 'Chat': '\\uE901',\n 'Group': '\\uE902',\n 'World': '\\uE909',\n 'Comment': '\\uE90A',\n 'DockLeft': '\\uE90C',\n 'DockRight': '\\uE90D',\n 'Repair': '\\uE90F',\n 'Accounts': '\\uE910',\n 'Street': '\\uE913',\n 'RadioBullet': '\\uE915',\n 'Stopwatch': '\\uE916',\n 'Clock': '\\uE917',\n 'WorldClock': '\\uE918',\n 'AlarmClock': '\\uE919',\n 'Photo': '\\uE91B',\n 'ActionCenter': '\\uE91C',\n 'Hospital': '\\uE91D',\n 'Timer': '\\uE91E',\n 'FullCircleMask': '\\uE91F',\n 'LocationFill': '\\uE920',\n 'ChromeMinimize': '\\uE921',\n 'ChromeRestore': '\\uE923',\n 'Annotation': '\\uE924',\n 'Fingerprint': '\\uE928',\n 'Handwriting': '\\uE929',\n 'ChromeFullScreen': '\\uE92D',\n 'Completed': '\\uE930',\n 'Label': '\\uE932',\n 'FlickDown': '\\uE935',\n 'FlickUp': '\\uE936',\n 'FlickLeft': '\\uE937',\n 'FlickRight': '\\uE938',\n 'MiniExpand': '\\uE93A',\n 'MiniContract': '\\uE93B',\n 'Streaming': '\\uE93E',\n 'MusicInCollection': '\\uE940',\n 'OneDriveLogo': '\\uE941',\n 'CompassNW': '\\uE942',\n 'Code': '\\uE943',\n 'LightningBolt': '\\uE945',\n 'CalculatorMultiply': '\\uE947',\n 'CalculatorAddition': '\\uE948',\n 'CalculatorSubtract': '\\uE949',\n 'CalculatorPercentage': '\\uE94C',\n 'CalculatorEqualTo': '\\uE94E',\n 'PrintfaxPrinterFile': '\\uE956',\n 'StorageOptical': '\\uE958',\n 'Communications': '\\uE95A',\n 'Headset': '\\uE95B',\n 'Health': '\\uE95E',\n 'Webcam2': '\\uE960',\n 'FrontCamera': '\\uE96B',\n 'ChevronUpSmall': '\\uE96D'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-2\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-2-63c99abf.woff') format('woff')\"\n },\n icons: {\n 'Picture': '\\uE8B9',\n 'ChromeClose': '\\uE8BB',\n 'ShowResults': '\\uE8BC',\n 'Message': '\\uE8BD',\n 'CalendarDay': '\\uE8BF',\n 'CalendarWeek': '\\uE8C0',\n 'MailReplyAll': '\\uE8C2',\n 'Read': '\\uE8C3',\n 'Cut': '\\uE8C6',\n 'PaymentCard': '\\uE8C7',\n 'Copy': '\\uE8C8',\n 'Important': '\\uE8C9',\n 'MailReply': '\\uE8CA',\n 'GotoToday': '\\uE8D1',\n 'Font': '\\uE8D2',\n 'FontColor': '\\uE8D3',\n 'FolderFill': '\\uE8D5',\n 'Permissions': '\\uE8D7',\n 'DisableUpdates': '\\uE8D8',\n 'Unfavorite': '\\uE8D9',\n 'Italic': '\\uE8DB',\n 'Underline': '\\uE8DC',\n 'Bold': '\\uE8DD',\n 'MoveToFolder': '\\uE8DE',\n 'Dislike': '\\uE8E0',\n 'Like': '\\uE8E1',\n 'AlignCenter': '\\uE8E3',\n 'OpenFile': '\\uE8E5',\n 'ClearSelection': '\\uE8E6',\n 'FontDecrease': '\\uE8E7',\n 'FontIncrease': '\\uE8E8',\n 'FontSize': '\\uE8E9',\n 'CellPhone': '\\uE8EA',\n 'RepeatOne': '\\uE8ED',\n 'RepeatAll': '\\uE8EE',\n 'Calculator': '\\uE8EF',\n 'Library': '\\uE8F1',\n 'PostUpdate': '\\uE8F3',\n 'NewFolder': '\\uE8F4',\n 'CalendarReply': '\\uE8F5',\n 'UnsyncFolder': '\\uE8F6',\n 'SyncFolder': '\\uE8F7',\n 'BlockContact': '\\uE8F8',\n 'Accept': '\\uE8FB',\n 'BulletedList': '\\uE8FD',\n 'Preview': '\\uE8FF',\n 'News': '\\uE900',\n 'Chat': '\\uE901',\n 'Group': '\\uE902',\n 'World': '\\uE909',\n 'Comment': '\\uE90A',\n 'DockLeft': '\\uE90C',\n 'DockRight': '\\uE90D',\n 'Repair': '\\uE90F',\n 'Accounts': '\\uE910',\n 'Street': '\\uE913',\n 'RadioBullet': '\\uE915',\n 'Stopwatch': '\\uE916',\n 'Clock': '\\uE917',\n 'WorldClock': '\\uE918',\n 'AlarmClock': '\\uE919',\n 'Photo': '\\uE91B',\n 'ActionCenter': '\\uE91C',\n 'Hospital': '\\uE91D',\n 'Timer': '\\uE91E',\n 'FullCircleMask': '\\uE91F',\n 'LocationFill': '\\uE920',\n 'ChromeMinimize': '\\uE921',\n 'ChromeRestore': '\\uE923',\n 'Annotation': '\\uE924',\n 'Fingerprint': '\\uE928',\n 'Handwriting': '\\uE929',\n 'ChromeFullScreen': '\\uE92D',\n 'Completed': '\\uE930',\n 'Label': '\\uE932',\n 'FlickDown': '\\uE935',\n 'FlickUp': '\\uE936',\n 'FlickLeft': '\\uE937',\n 'FlickRight': '\\uE938',\n 'MiniExpand': '\\uE93A',\n 'MiniContract': '\\uE93B',\n 'Streaming': '\\uE93E',\n 'MusicInCollection': '\\uE940',\n 'OneDriveLogo': '\\uE941',\n 'CompassNW': '\\uE942',\n 'Code': '\\uE943',\n 'LightningBolt': '\\uE945',\n 'CalculatorMultiply': '\\uE947',\n 'CalculatorAddition': '\\uE948',\n 'CalculatorSubtract': '\\uE949',\n 'CalculatorPercentage': '\\uE94C',\n 'CalculatorEqualTo': '\\uE94E',\n 'PrintfaxPrinterFile': '\\uE956',\n 'StorageOptical': '\\uE958',\n 'Communications': '\\uE95A',\n 'Headset': '\\uE95B',\n 'Health': '\\uE95E',\n 'Webcam2': '\\uE960',\n 'FrontCamera': '\\uE96B',\n 'ChevronUpSmall': '\\uE96D'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none',\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-a13498cf.woff') format('woff')\",\n },\n icons: {\n GlobalNavButton: '\\uE700',\n ChevronDown: '\\uE70D',\n ChevronUp: '\\uE70E',\n Edit: '\\uE70F',\n Add: '\\uE710',\n Cancel: '\\uE711',\n More: '\\uE712',\n Settings: '\\uE713',\n Mail: '\\uE715',\n Filter: '\\uE71C',\n Search: '\\uE721',\n Share: '\\uE72D',\n BlockedSite: '\\uE72F',\n FavoriteStar: '\\uE734',\n FavoriteStarFill: '\\uE735',\n CheckMark: '\\uE73E',\n Delete: '\\uE74D',\n ChevronLeft: '\\uE76B',\n ChevronRight: '\\uE76C',\n Calendar: '\\uE787',\n Megaphone: '\\uE789',\n Undo: '\\uE7A7',\n Flag: '\\uE7C1',\n Page: '\\uE7C3',\n Pinned: '\\uE840',\n View: '\\uE890',\n Clear: '\\uE894',\n Download: '\\uE896',\n Upload: '\\uE898',\n Folder: '\\uE8B7',\n Sort: '\\uE8CB',\n AlignRight: '\\uE8E2',\n AlignLeft: '\\uE8E4',\n Tag: '\\uE8EC',\n AddFriend: '\\uE8FA',\n Info: '\\uE946',\n SortLines: '\\uE9D0',\n List: '\\uEA37',\n CircleRing: '\\uEA3A',\n Heart: '\\uEB51',\n HeartFill: '\\uEB52',\n Tiles: '\\uECA5',\n Embed: '\\uECCE',\n Glimmer: '\\uECF4',\n Ascending: '\\uEDC0',\n Descending: '\\uEDC1',\n SortUp: '\\uEE68',\n SortDown: '\\uEE69',\n SyncToPC: '\\uEE6E',\n LargeGrid: '\\uEECB',\n SkypeCheck: '\\uEF80',\n SkypeClock: '\\uEF81',\n SkypeMinus: '\\uEF82',\n ClearFilter: '\\uEF8F',\n Flow: '\\uEF90',\n StatusCircleCheckmark: '\\uF13E',\n MoreVertical: '\\uF2BC',\n },\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none',\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-a13498cf.woff') format('woff')\",\n },\n icons: {\n GlobalNavButton: '\\uE700',\n ChevronDown: '\\uE70D',\n ChevronUp: '\\uE70E',\n Edit: '\\uE70F',\n Add: '\\uE710',\n Cancel: '\\uE711',\n More: '\\uE712',\n Settings: '\\uE713',\n Mail: '\\uE715',\n Filter: '\\uE71C',\n Search: '\\uE721',\n Share: '\\uE72D',\n BlockedSite: '\\uE72F',\n FavoriteStar: '\\uE734',\n FavoriteStarFill: '\\uE735',\n CheckMark: '\\uE73E',\n Delete: '\\uE74D',\n ChevronLeft: '\\uE76B',\n ChevronRight: '\\uE76C',\n Calendar: '\\uE787',\n Megaphone: '\\uE789',\n Undo: '\\uE7A7',\n Flag: '\\uE7C1',\n Page: '\\uE7C3',\n Pinned: '\\uE840',\n View: '\\uE890',\n Clear: '\\uE894',\n Download: '\\uE896',\n Upload: '\\uE898',\n Folder: '\\uE8B7',\n Sort: '\\uE8CB',\n AlignRight: '\\uE8E2',\n AlignLeft: '\\uE8E4',\n Tag: '\\uE8EC',\n AddFriend: '\\uE8FA',\n Info: '\\uE946',\n SortLines: '\\uE9D0',\n List: '\\uEA37',\n CircleRing: '\\uEA3A',\n Heart: '\\uEB51',\n HeartFill: '\\uEB52',\n Tiles: '\\uECA5',\n Embed: '\\uECCE',\n Glimmer: '\\uECF4',\n Ascending: '\\uEDC0',\n Descending: '\\uEDC1',\n SortUp: '\\uEE68',\n SortDown: '\\uEE69',\n SyncToPC: '\\uEE6E',\n LargeGrid: '\\uEECB',\n SkypeCheck: '\\uEF80',\n SkypeClock: '\\uEF81',\n SkypeMinus: '\\uEF82',\n ClearFilter: '\\uEF8F',\n Flow: '\\uEF90',\n StatusCircleCheckmark: '\\uF13E',\n MoreVertical: '\\uF2BC',\n },\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function mapper_page_paint_icons() {\n\n if( glyph_url != null ) return;\n\n if(true) { \n glyph_post = \"/dynamapper/icons/weather-clear.png\";\n var feature = {};\n feature[\"kind\"] = \"icon\";\n feature[\"image\"] = glyph_post;\n feature[\"iconSize\"] = [ 32, 32 ];\n feature[\"iconAnchor\"] = [ 9, 34 ];\n feature[\"iconWindowAnchor\"] = [ 9, 2 ];\n mapper_inject_feature(feature);\n }\n\n if(true) {\n glyph_person = \"/dynamapper/icons/emblem-favorite.png\";\n var feature = {};\n feature[\"kind\"] = \"icon\";\n feature[\"image\"] = glyph_person;\n feature[\"iconSize\"] = [ 32, 32 ];\n feature[\"iconAnchor\"] = [ 9, 34 ];\n feature[\"iconWindowAnchor\"] = [ 9, 2 ];\n mapper_inject_feature(feature);\n }\n\n if(true) {\n glyph_url = \"/dynamapper/icons/emblem-important.png\";\n var feature = {};\n feature[\"kind\"] = \"icon\";\n feature[\"image\"] = glyph_url;\n feature[\"iconSize\"] = [ 32, 32 ];\n feature[\"iconAnchor\"] = [ 9, 34 ];\n feature[\"iconWindowAnchor\"] = [ 9, 2 ];\n mapper_inject_feature(feature);\n }\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-6\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-6-ef6fd590.woff') format('woff')\"\n },\n icons: {\n 'SwayLogoInverse': '\\uED29',\n 'OutOfOffice': '\\uED34',\n 'Trophy': '\\uED3F',\n 'ReopenPages': '\\uED50',\n 'EmojiTabSymbols': '\\uED58',\n 'AADLogo': '\\uED68',\n 'AccessLogo': '\\uED69',\n 'AdminALogoInverse32': '\\uED6A',\n 'AdminCLogoInverse32': '\\uED6B',\n 'AdminDLogoInverse32': '\\uED6C',\n 'AdminELogoInverse32': '\\uED6D',\n 'AdminLLogoInverse32': '\\uED6E',\n 'AdminMLogoInverse32': '\\uED6F',\n 'AdminOLogoInverse32': '\\uED70',\n 'AdminPLogoInverse32': '\\uED71',\n 'AdminSLogoInverse32': '\\uED72',\n 'AdminYLogoInverse32': '\\uED73',\n 'DelveLogoInverse': '\\uED76',\n 'ExchangeLogoInverse': '\\uED78',\n 'LyncLogo': '\\uED79',\n 'OfficeVideoLogoInverse': '\\uED7A',\n 'SocialListeningLogo': '\\uED7C',\n 'VisioLogoInverse': '\\uED7D',\n 'Balloons': '\\uED7E',\n 'Cat': '\\uED7F',\n 'MailAlert': '\\uED80',\n 'MailCheck': '\\uED81',\n 'MailLowImportance': '\\uED82',\n 'MailPause': '\\uED83',\n 'MailRepeat': '\\uED84',\n 'SecurityGroup': '\\uED85',\n 'Table': '\\uED86',\n 'VoicemailForward': '\\uED87',\n 'VoicemailReply': '\\uED88',\n 'Waffle': '\\uED89',\n 'RemoveEvent': '\\uED8A',\n 'EventInfo': '\\uED8B',\n 'ForwardEvent': '\\uED8C',\n 'WipePhone': '\\uED8D',\n 'AddOnlineMeeting': '\\uED8E',\n 'JoinOnlineMeeting': '\\uED8F',\n 'RemoveLink': '\\uED90',\n 'PeopleBlock': '\\uED91',\n 'PeopleRepeat': '\\uED92',\n 'PeopleAlert': '\\uED93',\n 'PeoplePause': '\\uED94',\n 'TransferCall': '\\uED95',\n 'AddPhone': '\\uED96',\n 'UnknownCall': '\\uED97',\n 'NoteReply': '\\uED98',\n 'NoteForward': '\\uED99',\n 'NotePinned': '\\uED9A',\n 'RemoveOccurrence': '\\uED9B',\n 'Timeline': '\\uED9C',\n 'EditNote': '\\uED9D',\n 'CircleHalfFull': '\\uED9E',\n 'Room': '\\uED9F',\n 'Unsubscribe': '\\uEDA0',\n 'Subscribe': '\\uEDA1',\n 'HardDrive': '\\uEDA2',\n 'RecurringTask': '\\uEDB2',\n 'TaskManager': '\\uEDB7',\n 'TaskManagerMirrored': '\\uEDB8',\n 'Combine': '\\uEDBB',\n 'Split': '\\uEDBC',\n 'DoubleChevronUp': '\\uEDBD',\n 'DoubleChevronLeft': '\\uEDBE',\n 'DoubleChevronRight': '\\uEDBF',\n 'TextBox': '\\uEDC2',\n 'TextField': '\\uEDC3',\n 'NumberField': '\\uEDC4',\n 'Dropdown': '\\uEDC5',\n 'PenWorkspace': '\\uEDC6',\n 'BookingsLogo': '\\uEDC7',\n 'ClassNotebookLogoInverse': '\\uEDC8',\n 'DelveAnalyticsLogo': '\\uEDCA',\n 'DocsLogoInverse': '\\uEDCB',\n 'Dynamics365Logo': '\\uEDCC',\n 'DynamicSMBLogo': '\\uEDCD',\n 'OfficeAssistantLogo': '\\uEDCE',\n 'OfficeStoreLogo': '\\uEDCF',\n 'OneNoteEduLogoInverse': '\\uEDD0',\n 'PlannerLogo': '\\uEDD1',\n 'PowerApps': '\\uEDD2',\n 'Suitcase': '\\uEDD3',\n 'ProjectLogoInverse': '\\uEDD4',\n 'CaretLeft8': '\\uEDD5',\n 'CaretRight8': '\\uEDD6',\n 'CaretUp8': '\\uEDD7',\n 'CaretDown8': '\\uEDD8',\n 'CaretLeftSolid8': '\\uEDD9',\n 'CaretRightSolid8': '\\uEDDA',\n 'CaretUpSolid8': '\\uEDDB',\n 'CaretDownSolid8': '\\uEDDC',\n 'ClearFormatting': '\\uEDDD',\n 'Superscript': '\\uEDDE',\n 'Subscript': '\\uEDDF',\n 'Strikethrough': '\\uEDE0',\n 'Export': '\\uEDE1',\n 'ExportMirrored': '\\uEDE2'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-6\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-6-ef6fd590.woff') format('woff')\"\n },\n icons: {\n 'SwayLogoInverse': '\\uED29',\n 'OutOfOffice': '\\uED34',\n 'Trophy': '\\uED3F',\n 'ReopenPages': '\\uED50',\n 'EmojiTabSymbols': '\\uED58',\n 'AADLogo': '\\uED68',\n 'AccessLogo': '\\uED69',\n 'AdminALogoInverse32': '\\uED6A',\n 'AdminCLogoInverse32': '\\uED6B',\n 'AdminDLogoInverse32': '\\uED6C',\n 'AdminELogoInverse32': '\\uED6D',\n 'AdminLLogoInverse32': '\\uED6E',\n 'AdminMLogoInverse32': '\\uED6F',\n 'AdminOLogoInverse32': '\\uED70',\n 'AdminPLogoInverse32': '\\uED71',\n 'AdminSLogoInverse32': '\\uED72',\n 'AdminYLogoInverse32': '\\uED73',\n 'DelveLogoInverse': '\\uED76',\n 'ExchangeLogoInverse': '\\uED78',\n 'LyncLogo': '\\uED79',\n 'OfficeVideoLogoInverse': '\\uED7A',\n 'SocialListeningLogo': '\\uED7C',\n 'VisioLogoInverse': '\\uED7D',\n 'Balloons': '\\uED7E',\n 'Cat': '\\uED7F',\n 'MailAlert': '\\uED80',\n 'MailCheck': '\\uED81',\n 'MailLowImportance': '\\uED82',\n 'MailPause': '\\uED83',\n 'MailRepeat': '\\uED84',\n 'SecurityGroup': '\\uED85',\n 'Table': '\\uED86',\n 'VoicemailForward': '\\uED87',\n 'VoicemailReply': '\\uED88',\n 'Waffle': '\\uED89',\n 'RemoveEvent': '\\uED8A',\n 'EventInfo': '\\uED8B',\n 'ForwardEvent': '\\uED8C',\n 'WipePhone': '\\uED8D',\n 'AddOnlineMeeting': '\\uED8E',\n 'JoinOnlineMeeting': '\\uED8F',\n 'RemoveLink': '\\uED90',\n 'PeopleBlock': '\\uED91',\n 'PeopleRepeat': '\\uED92',\n 'PeopleAlert': '\\uED93',\n 'PeoplePause': '\\uED94',\n 'TransferCall': '\\uED95',\n 'AddPhone': '\\uED96',\n 'UnknownCall': '\\uED97',\n 'NoteReply': '\\uED98',\n 'NoteForward': '\\uED99',\n 'NotePinned': '\\uED9A',\n 'RemoveOccurrence': '\\uED9B',\n 'Timeline': '\\uED9C',\n 'EditNote': '\\uED9D',\n 'CircleHalfFull': '\\uED9E',\n 'Room': '\\uED9F',\n 'Unsubscribe': '\\uEDA0',\n 'Subscribe': '\\uEDA1',\n 'HardDrive': '\\uEDA2',\n 'RecurringTask': '\\uEDB2',\n 'TaskManager': '\\uEDB7',\n 'TaskManagerMirrored': '\\uEDB8',\n 'Combine': '\\uEDBB',\n 'Split': '\\uEDBC',\n 'DoubleChevronUp': '\\uEDBD',\n 'DoubleChevronLeft': '\\uEDBE',\n 'DoubleChevronRight': '\\uEDBF',\n 'TextBox': '\\uEDC2',\n 'TextField': '\\uEDC3',\n 'NumberField': '\\uEDC4',\n 'Dropdown': '\\uEDC5',\n 'PenWorkspace': '\\uEDC6',\n 'BookingsLogo': '\\uEDC7',\n 'ClassNotebookLogoInverse': '\\uEDC8',\n 'DelveAnalyticsLogo': '\\uEDCA',\n 'DocsLogoInverse': '\\uEDCB',\n 'Dynamics365Logo': '\\uEDCC',\n 'DynamicSMBLogo': '\\uEDCD',\n 'OfficeAssistantLogo': '\\uEDCE',\n 'OfficeStoreLogo': '\\uEDCF',\n 'OneNoteEduLogoInverse': '\\uEDD0',\n 'PlannerLogo': '\\uEDD1',\n 'PowerApps': '\\uEDD2',\n 'Suitcase': '\\uEDD3',\n 'ProjectLogoInverse': '\\uEDD4',\n 'CaretLeft8': '\\uEDD5',\n 'CaretRight8': '\\uEDD6',\n 'CaretUp8': '\\uEDD7',\n 'CaretDown8': '\\uEDD8',\n 'CaretLeftSolid8': '\\uEDD9',\n 'CaretRightSolid8': '\\uEDDA',\n 'CaretUpSolid8': '\\uEDDB',\n 'CaretDownSolid8': '\\uEDDC',\n 'ClearFormatting': '\\uEDDD',\n 'Superscript': '\\uEDDE',\n 'Subscript': '\\uEDDF',\n 'Strikethrough': '\\uEDE0',\n 'Export': '\\uEDE1',\n 'ExportMirrored': '\\uEDE2'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-0\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-0-467ee27f.woff') format('woff')\"\n },\n icons: {\n 'PageLink': '\\uE302',\n 'CommentSolid': '\\uE30E',\n 'ChangeEntitlements': '\\uE310',\n 'Installation': '\\uE311',\n 'WebAppBuilderModule': '\\uE313',\n 'WebAppBuilderFragment': '\\uE314',\n 'WebAppBuilderSlot': '\\uE315',\n 'BullseyeTargetEdit': '\\uE319',\n 'WebAppBuilderFragmentCreate': '\\uE31B',\n 'PageData': '\\uE31C',\n 'PageHeaderEdit': '\\uE31D',\n 'ProductList': '\\uE31E',\n 'UnpublishContent': '\\uE31F',\n 'DependencyAdd': '\\uE344',\n 'DependencyRemove': '\\uE345',\n 'EntitlementPolicy': '\\uE346',\n 'EntitlementRedemption': '\\uE347',\n 'SchoolDataSyncLogo': '\\uE34C',\n 'PinSolid12': '\\uE352',\n 'PinSolidOff12': '\\uE353',\n 'AddLink': '\\uE35E',\n 'SharepointAppIcon16': '\\uE365',\n 'DataflowsLink': '\\uE366',\n 'TimePicker': '\\uE367',\n 'UserWarning': '\\uE368',\n 'ComplianceAudit': '\\uE369',\n 'InternetSharing': '\\uE704',\n 'Brightness': '\\uE706',\n 'MapPin': '\\uE707',\n 'Airplane': '\\uE709',\n 'Tablet': '\\uE70A',\n 'QuickNote': '\\uE70B',\n 'Video': '\\uE714',\n 'People': '\\uE716',\n 'Phone': '\\uE717',\n 'Pin': '\\uE718',\n 'Shop': '\\uE719',\n 'Stop': '\\uE71A',\n 'Link': '\\uE71B',\n 'AllApps': '\\uE71D',\n 'Zoom': '\\uE71E',\n 'ZoomOut': '\\uE71F',\n 'Microphone': '\\uE720',\n 'Camera': '\\uE722',\n 'Attach': '\\uE723',\n 'Send': '\\uE724',\n 'FavoriteList': '\\uE728',\n 'PageSolid': '\\uE729',\n 'Forward': '\\uE72A',\n 'Back': '\\uE72B',\n 'Refresh': '\\uE72C',\n 'Lock': '\\uE72E',\n 'ReportHacked': '\\uE730',\n 'EMI': '\\uE731',\n 'MiniLink': '\\uE732',\n 'Blocked': '\\uE733',\n 'ReadingMode': '\\uE736',\n 'Favicon': '\\uE737',\n 'Remove': '\\uE738',\n 'Checkbox': '\\uE739',\n 'CheckboxComposite': '\\uE73A',\n 'CheckboxFill': '\\uE73B',\n 'CheckboxIndeterminate': '\\uE73C',\n 'CheckboxCompositeReversed': '\\uE73D',\n 'BackToWindow': '\\uE73F',\n 'FullScreen': '\\uE740',\n 'Print': '\\uE749',\n 'Up': '\\uE74A',\n 'Down': '\\uE74B',\n 'OEM': '\\uE74C',\n 'Save': '\\uE74E',\n 'ReturnKey': '\\uE751',\n 'Cloud': '\\uE753',\n 'Flashlight': '\\uE754',\n 'CommandPrompt': '\\uE756',\n 'Sad': '\\uE757',\n 'RealEstate': '\\uE758',\n 'SIPMove': '\\uE759',\n 'EraseTool': '\\uE75C',\n 'GripperTool': '\\uE75E',\n 'Dialpad': '\\uE75F',\n 'PageLeft': '\\uE760',\n 'PageRight': '\\uE761',\n 'MultiSelect': '\\uE762',\n 'KeyboardClassic': '\\uE765',\n 'Play': '\\uE768',\n 'Pause': '\\uE769',\n 'InkingTool': '\\uE76D',\n 'Emoji2': '\\uE76E',\n 'GripperBarHorizontal': '\\uE76F',\n 'System': '\\uE770',\n 'Personalize': '\\uE771',\n 'SearchAndApps': '\\uE773',\n 'Globe': '\\uE774',\n 'EaseOfAccess': '\\uE776',\n 'ContactInfo': '\\uE779',\n 'Unpin': '\\uE77A',\n 'Contact': '\\uE77B',\n 'Memo': '\\uE77C',\n 'IncomingCall': '\\uE77E'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-0\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-0-467ee27f.woff') format('woff')\"\n },\n icons: {\n 'PageLink': '\\uE302',\n 'CommentSolid': '\\uE30E',\n 'ChangeEntitlements': '\\uE310',\n 'Installation': '\\uE311',\n 'WebAppBuilderModule': '\\uE313',\n 'WebAppBuilderFragment': '\\uE314',\n 'WebAppBuilderSlot': '\\uE315',\n 'BullseyeTargetEdit': '\\uE319',\n 'WebAppBuilderFragmentCreate': '\\uE31B',\n 'PageData': '\\uE31C',\n 'PageHeaderEdit': '\\uE31D',\n 'ProductList': '\\uE31E',\n 'UnpublishContent': '\\uE31F',\n 'DependencyAdd': '\\uE344',\n 'DependencyRemove': '\\uE345',\n 'EntitlementPolicy': '\\uE346',\n 'EntitlementRedemption': '\\uE347',\n 'SchoolDataSyncLogo': '\\uE34C',\n 'PinSolid12': '\\uE352',\n 'PinSolidOff12': '\\uE353',\n 'AddLink': '\\uE35E',\n 'SharepointAppIcon16': '\\uE365',\n 'DataflowsLink': '\\uE366',\n 'TimePicker': '\\uE367',\n 'UserWarning': '\\uE368',\n 'ComplianceAudit': '\\uE369',\n 'InternetSharing': '\\uE704',\n 'Brightness': '\\uE706',\n 'MapPin': '\\uE707',\n 'Airplane': '\\uE709',\n 'Tablet': '\\uE70A',\n 'QuickNote': '\\uE70B',\n 'Video': '\\uE714',\n 'People': '\\uE716',\n 'Phone': '\\uE717',\n 'Pin': '\\uE718',\n 'Shop': '\\uE719',\n 'Stop': '\\uE71A',\n 'Link': '\\uE71B',\n 'AllApps': '\\uE71D',\n 'Zoom': '\\uE71E',\n 'ZoomOut': '\\uE71F',\n 'Microphone': '\\uE720',\n 'Camera': '\\uE722',\n 'Attach': '\\uE723',\n 'Send': '\\uE724',\n 'FavoriteList': '\\uE728',\n 'PageSolid': '\\uE729',\n 'Forward': '\\uE72A',\n 'Back': '\\uE72B',\n 'Refresh': '\\uE72C',\n 'Lock': '\\uE72E',\n 'ReportHacked': '\\uE730',\n 'EMI': '\\uE731',\n 'MiniLink': '\\uE732',\n 'Blocked': '\\uE733',\n 'ReadingMode': '\\uE736',\n 'Favicon': '\\uE737',\n 'Remove': '\\uE738',\n 'Checkbox': '\\uE739',\n 'CheckboxComposite': '\\uE73A',\n 'CheckboxFill': '\\uE73B',\n 'CheckboxIndeterminate': '\\uE73C',\n 'CheckboxCompositeReversed': '\\uE73D',\n 'BackToWindow': '\\uE73F',\n 'FullScreen': '\\uE740',\n 'Print': '\\uE749',\n 'Up': '\\uE74A',\n 'Down': '\\uE74B',\n 'OEM': '\\uE74C',\n 'Save': '\\uE74E',\n 'ReturnKey': '\\uE751',\n 'Cloud': '\\uE753',\n 'Flashlight': '\\uE754',\n 'CommandPrompt': '\\uE756',\n 'Sad': '\\uE757',\n 'RealEstate': '\\uE758',\n 'SIPMove': '\\uE759',\n 'EraseTool': '\\uE75C',\n 'GripperTool': '\\uE75E',\n 'Dialpad': '\\uE75F',\n 'PageLeft': '\\uE760',\n 'PageRight': '\\uE761',\n 'MultiSelect': '\\uE762',\n 'KeyboardClassic': '\\uE765',\n 'Play': '\\uE768',\n 'Pause': '\\uE769',\n 'InkingTool': '\\uE76D',\n 'Emoji2': '\\uE76E',\n 'GripperBarHorizontal': '\\uE76F',\n 'System': '\\uE770',\n 'Personalize': '\\uE771',\n 'SearchAndApps': '\\uE773',\n 'Globe': '\\uE774',\n 'EaseOfAccess': '\\uE776',\n 'ContactInfo': '\\uE779',\n 'Unpin': '\\uE77A',\n 'Contact': '\\uE77B',\n 'Memo': '\\uE77C',\n 'IncomingCall': '\\uE77E'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-7\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-7-2b97bb99.woff') format('woff')\"\n },\n icons: {\n 'SingleBookmark': '\\uEDFF',\n 'SingleBookmarkSolid': '\\uEE00',\n 'DoubleChevronDown': '\\uEE04',\n 'FollowUser': '\\uEE05',\n 'ReplyAll': '\\uEE0A',\n 'WorkforceManagement': '\\uEE0F',\n 'RecruitmentManagement': '\\uEE12',\n 'Questionnaire': '\\uEE19',\n 'ManagerSelfService': '\\uEE23',\n 'ProductionFloorManagement': '\\uEE29',\n 'ProductRelease': '\\uEE2E',\n 'ProductVariant': '\\uEE30',\n 'ReplyMirrored': '\\uEE35',\n 'ReplyAllMirrored': '\\uEE36',\n 'Medal': '\\uEE38',\n 'AddGroup': '\\uEE3D',\n 'QuestionnaireMirrored': '\\uEE4B',\n 'CloudImportExport': '\\uEE55',\n 'TemporaryUser': '\\uEE58',\n 'CaretSolid16': '\\uEE62',\n 'GroupedDescending': '\\uEE66',\n 'GroupedAscending': '\\uEE67',\n 'AwayStatus': '\\uEE6A',\n 'MyMoviesTV': '\\uEE6C',\n 'GenericScan': '\\uEE6F',\n 'AustralianRules': '\\uEE70',\n 'WifiEthernet': '\\uEE77',\n 'TrackersMirrored': '\\uEE92',\n 'DateTimeMirrored': '\\uEE93',\n 'StopSolid': '\\uEE95',\n 'DoubleChevronUp12': '\\uEE96',\n 'DoubleChevronDown12': '\\uEE97',\n 'DoubleChevronLeft12': '\\uEE98',\n 'DoubleChevronRight12': '\\uEE99',\n 'CalendarAgenda': '\\uEE9A',\n 'ConnectVirtualMachine': '\\uEE9D',\n 'AddEvent': '\\uEEB5',\n 'AssetLibrary': '\\uEEB6',\n 'DataConnectionLibrary': '\\uEEB7',\n 'DocLibrary': '\\uEEB8',\n 'FormLibrary': '\\uEEB9',\n 'FormLibraryMirrored': '\\uEEBA',\n 'ReportLibrary': '\\uEEBB',\n 'ReportLibraryMirrored': '\\uEEBC',\n 'ContactCard': '\\uEEBD',\n 'CustomList': '\\uEEBE',\n 'CustomListMirrored': '\\uEEBF',\n 'IssueTracking': '\\uEEC0',\n 'IssueTrackingMirrored': '\\uEEC1',\n 'PictureLibrary': '\\uEEC2',\n 'OfficeAddinsLogo': '\\uEEC7',\n 'OfflineOneDriveParachute': '\\uEEC8',\n 'OfflineOneDriveParachuteDisabled': '\\uEEC9',\n 'TriangleSolidUp12': '\\uEECC',\n 'TriangleSolidDown12': '\\uEECD',\n 'TriangleSolidLeft12': '\\uEECE',\n 'TriangleSolidRight12': '\\uEECF',\n 'TriangleUp12': '\\uEED0',\n 'TriangleDown12': '\\uEED1',\n 'TriangleLeft12': '\\uEED2',\n 'TriangleRight12': '\\uEED3',\n 'ArrowUpRight8': '\\uEED4',\n 'ArrowDownRight8': '\\uEED5',\n 'DocumentSet': '\\uEED6',\n 'GoToDashboard': '\\uEEED',\n 'DelveAnalytics': '\\uEEEE',\n 'ArrowUpRightMirrored8': '\\uEEEF',\n 'ArrowDownRightMirrored8': '\\uEEF0',\n 'CompanyDirectory': '\\uEF0D',\n 'OpenEnrollment': '\\uEF1C',\n 'CompanyDirectoryMirrored': '\\uEF2B',\n 'OneDriveAdd': '\\uEF32',\n 'ProfileSearch': '\\uEF35',\n 'Header2': '\\uEF36',\n 'Header3': '\\uEF37',\n 'Header4': '\\uEF38',\n 'RingerSolid': '\\uEF3A',\n 'Eyedropper': '\\uEF3C',\n 'MarketDown': '\\uEF42',\n 'CalendarWorkWeek': '\\uEF51',\n 'SidePanel': '\\uEF52',\n 'GlobeFavorite': '\\uEF53',\n 'CaretTopLeftSolid8': '\\uEF54',\n 'CaretTopRightSolid8': '\\uEF55',\n 'ViewAll2': '\\uEF56',\n 'DocumentReply': '\\uEF57',\n 'PlayerSettings': '\\uEF58',\n 'ReceiptForward': '\\uEF59',\n 'ReceiptReply': '\\uEF5A',\n 'ReceiptCheck': '\\uEF5B',\n 'Fax': '\\uEF5C',\n 'RecurringEvent': '\\uEF5D',\n 'ReplyAlt': '\\uEF5E',\n 'ReplyAllAlt': '\\uEF5F',\n 'EditStyle': '\\uEF60',\n 'EditMail': '\\uEF61',\n 'Lifesaver': '\\uEF62',\n 'LifesaverLock': '\\uEF63',\n 'InboxCheck': '\\uEF64',\n 'FolderSearch': '\\uEF65'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-7\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-7-2b97bb99.woff') format('woff')\"\n },\n icons: {\n 'SingleBookmark': '\\uEDFF',\n 'SingleBookmarkSolid': '\\uEE00',\n 'DoubleChevronDown': '\\uEE04',\n 'FollowUser': '\\uEE05',\n 'ReplyAll': '\\uEE0A',\n 'WorkforceManagement': '\\uEE0F',\n 'RecruitmentManagement': '\\uEE12',\n 'Questionnaire': '\\uEE19',\n 'ManagerSelfService': '\\uEE23',\n 'ProductionFloorManagement': '\\uEE29',\n 'ProductRelease': '\\uEE2E',\n 'ProductVariant': '\\uEE30',\n 'ReplyMirrored': '\\uEE35',\n 'ReplyAllMirrored': '\\uEE36',\n 'Medal': '\\uEE38',\n 'AddGroup': '\\uEE3D',\n 'QuestionnaireMirrored': '\\uEE4B',\n 'CloudImportExport': '\\uEE55',\n 'TemporaryUser': '\\uEE58',\n 'CaretSolid16': '\\uEE62',\n 'GroupedDescending': '\\uEE66',\n 'GroupedAscending': '\\uEE67',\n 'AwayStatus': '\\uEE6A',\n 'MyMoviesTV': '\\uEE6C',\n 'GenericScan': '\\uEE6F',\n 'AustralianRules': '\\uEE70',\n 'WifiEthernet': '\\uEE77',\n 'TrackersMirrored': '\\uEE92',\n 'DateTimeMirrored': '\\uEE93',\n 'StopSolid': '\\uEE95',\n 'DoubleChevronUp12': '\\uEE96',\n 'DoubleChevronDown12': '\\uEE97',\n 'DoubleChevronLeft12': '\\uEE98',\n 'DoubleChevronRight12': '\\uEE99',\n 'CalendarAgenda': '\\uEE9A',\n 'ConnectVirtualMachine': '\\uEE9D',\n 'AddEvent': '\\uEEB5',\n 'AssetLibrary': '\\uEEB6',\n 'DataConnectionLibrary': '\\uEEB7',\n 'DocLibrary': '\\uEEB8',\n 'FormLibrary': '\\uEEB9',\n 'FormLibraryMirrored': '\\uEEBA',\n 'ReportLibrary': '\\uEEBB',\n 'ReportLibraryMirrored': '\\uEEBC',\n 'ContactCard': '\\uEEBD',\n 'CustomList': '\\uEEBE',\n 'CustomListMirrored': '\\uEEBF',\n 'IssueTracking': '\\uEEC0',\n 'IssueTrackingMirrored': '\\uEEC1',\n 'PictureLibrary': '\\uEEC2',\n 'OfficeAddinsLogo': '\\uEEC7',\n 'OfflineOneDriveParachute': '\\uEEC8',\n 'OfflineOneDriveParachuteDisabled': '\\uEEC9',\n 'TriangleSolidUp12': '\\uEECC',\n 'TriangleSolidDown12': '\\uEECD',\n 'TriangleSolidLeft12': '\\uEECE',\n 'TriangleSolidRight12': '\\uEECF',\n 'TriangleUp12': '\\uEED0',\n 'TriangleDown12': '\\uEED1',\n 'TriangleLeft12': '\\uEED2',\n 'TriangleRight12': '\\uEED3',\n 'ArrowUpRight8': '\\uEED4',\n 'ArrowDownRight8': '\\uEED5',\n 'DocumentSet': '\\uEED6',\n 'GoToDashboard': '\\uEEED',\n 'DelveAnalytics': '\\uEEEE',\n 'ArrowUpRightMirrored8': '\\uEEEF',\n 'ArrowDownRightMirrored8': '\\uEEF0',\n 'CompanyDirectory': '\\uEF0D',\n 'OpenEnrollment': '\\uEF1C',\n 'CompanyDirectoryMirrored': '\\uEF2B',\n 'OneDriveAdd': '\\uEF32',\n 'ProfileSearch': '\\uEF35',\n 'Header2': '\\uEF36',\n 'Header3': '\\uEF37',\n 'Header4': '\\uEF38',\n 'RingerSolid': '\\uEF3A',\n 'Eyedropper': '\\uEF3C',\n 'MarketDown': '\\uEF42',\n 'CalendarWorkWeek': '\\uEF51',\n 'SidePanel': '\\uEF52',\n 'GlobeFavorite': '\\uEF53',\n 'CaretTopLeftSolid8': '\\uEF54',\n 'CaretTopRightSolid8': '\\uEF55',\n 'ViewAll2': '\\uEF56',\n 'DocumentReply': '\\uEF57',\n 'PlayerSettings': '\\uEF58',\n 'ReceiptForward': '\\uEF59',\n 'ReceiptReply': '\\uEF5A',\n 'ReceiptCheck': '\\uEF5B',\n 'Fax': '\\uEF5C',\n 'RecurringEvent': '\\uEF5D',\n 'ReplyAlt': '\\uEF5E',\n 'ReplyAllAlt': '\\uEF5F',\n 'EditStyle': '\\uEF60',\n 'EditMail': '\\uEF61',\n 'Lifesaver': '\\uEF62',\n 'LifesaverLock': '\\uEF63',\n 'InboxCheck': '\\uEF64',\n 'FolderSearch': '\\uEF65'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "get icon()\n\t{\n\t\tthrow new Error(\"Not implemented\");\n\t}", "function icon(platform){\n\n if(platform==\"CODECHEF\") return \"img/cc32.jpg\";\n else if (platform==\"HACKEREARTH\") return \"img/he32.png\";\n else if (platform==\"CODEFORCES\") return \"img/cf32.png\"; \n else if(platform==\"TOPCODER\") return \"img/tc32.gif\";\n else if(platform==\"HACKERRANK\") return \"img/hr36.png\";\n else if(platform==\"GOOGLE\") return \"img/google32.png\";\n else return \"img/other32.png\";\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-4\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-4-a656cc0a.woff') format('woff')\"\n },\n icons: {\n 'HelpMirrored': '\\uEA51',\n 'ImportMirrored': '\\uEA52',\n 'ImportAllMirrored': '\\uEA53',\n 'ListMirrored': '\\uEA55',\n 'MailForwardMirrored': '\\uEA56',\n 'MailReplyMirrored': '\\uEA57',\n 'MailReplyAllMirrored': '\\uEA58',\n 'MiniContractMirrored': '\\uEA59',\n 'MiniExpandMirrored': '\\uEA5A',\n 'OpenPaneMirrored': '\\uEA5B',\n 'ParkingLocationMirrored': '\\uEA5E',\n 'SendMirrored': '\\uEA63',\n 'ShowResultsMirrored': '\\uEA65',\n 'ThumbnailViewMirrored': '\\uEA67',\n 'Media': '\\uEA69',\n 'Devices3': '\\uEA6C',\n 'Focus': '\\uEA6F',\n 'VideoLightOff': '\\uEA74',\n 'Lightbulb': '\\uEA80',\n 'StatusTriangle': '\\uEA82',\n 'VolumeDisabled': '\\uEA85',\n 'Puzzle': '\\uEA86',\n 'EmojiNeutral': '\\uEA87',\n 'EmojiDisappointed': '\\uEA88',\n 'HomeSolid': '\\uEA8A',\n 'Ringer': '\\uEA8F',\n 'PDF': '\\uEA90',\n 'HeartBroken': '\\uEA92',\n 'StoreLogo16': '\\uEA96',\n 'MultiSelectMirrored': '\\uEA98',\n 'Broom': '\\uEA99',\n 'AddToShoppingList': '\\uEA9A',\n 'Cocktails': '\\uEA9D',\n 'Wines': '\\uEABF',\n 'Articles': '\\uEAC1',\n 'Cycling': '\\uEAC7',\n 'DietPlanNotebook': '\\uEAC8',\n 'Pill': '\\uEACB',\n 'ExerciseTracker': '\\uEACC',\n 'HandsFree': '\\uEAD0',\n 'Medical': '\\uEAD4',\n 'Running': '\\uEADA',\n 'Weights': '\\uEADB',\n 'Trackers': '\\uEADF',\n 'AddNotes': '\\uEAE3',\n 'AllCurrency': '\\uEAE4',\n 'BarChart4': '\\uEAE7',\n 'CirclePlus': '\\uEAEE',\n 'Coffee': '\\uEAEF',\n 'Cotton': '\\uEAF3',\n 'Market': '\\uEAFC',\n 'Money': '\\uEAFD',\n 'PieDouble': '\\uEB04',\n 'PieSingle': '\\uEB05',\n 'RemoveFilter': '\\uEB08',\n 'Savings': '\\uEB0B',\n 'Sell': '\\uEB0C',\n 'StockDown': '\\uEB0F',\n 'StockUp': '\\uEB11',\n 'Lamp': '\\uEB19',\n 'Source': '\\uEB1B',\n 'MSNVideos': '\\uEB1C',\n 'Cricket': '\\uEB1E',\n 'Golf': '\\uEB1F',\n 'Baseball': '\\uEB20',\n 'Soccer': '\\uEB21',\n 'MoreSports': '\\uEB22',\n 'AutoRacing': '\\uEB24',\n 'CollegeHoops': '\\uEB25',\n 'CollegeFootball': '\\uEB26',\n 'ProFootball': '\\uEB27',\n 'ProHockey': '\\uEB28',\n 'Rugby': '\\uEB2D',\n 'SubstitutionsIn': '\\uEB31',\n 'Tennis': '\\uEB33',\n 'Arrivals': '\\uEB34',\n 'Design': '\\uEB3C',\n 'Website': '\\uEB41',\n 'Drop': '\\uEB42',\n 'HistoricalWeather': '\\uEB43',\n 'SkiResorts': '\\uEB45',\n 'Snowflake': '\\uEB46',\n 'BusSolid': '\\uEB47',\n 'FerrySolid': '\\uEB48',\n 'AirplaneSolid': '\\uEB4C',\n 'TrainSolid': '\\uEB4D',\n 'Ticket': '\\uEB54',\n 'WifiWarning4': '\\uEB63',\n 'Devices4': '\\uEB66',\n 'AzureLogo': '\\uEB6A',\n 'BingLogo': '\\uEB6B',\n 'MSNLogo': '\\uEB6C',\n 'OutlookLogoInverse': '\\uEB6D',\n 'OfficeLogo': '\\uEB6E',\n 'SkypeLogo': '\\uEB6F',\n 'Door': '\\uEB75',\n 'EditMirrored': '\\uEB7E',\n 'GiftCard': '\\uEB8E',\n 'DoubleBookmark': '\\uEB8F',\n 'StatusErrorFull': '\\uEB90'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-4\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-4-a656cc0a.woff') format('woff')\"\n },\n icons: {\n 'HelpMirrored': '\\uEA51',\n 'ImportMirrored': '\\uEA52',\n 'ImportAllMirrored': '\\uEA53',\n 'ListMirrored': '\\uEA55',\n 'MailForwardMirrored': '\\uEA56',\n 'MailReplyMirrored': '\\uEA57',\n 'MailReplyAllMirrored': '\\uEA58',\n 'MiniContractMirrored': '\\uEA59',\n 'MiniExpandMirrored': '\\uEA5A',\n 'OpenPaneMirrored': '\\uEA5B',\n 'ParkingLocationMirrored': '\\uEA5E',\n 'SendMirrored': '\\uEA63',\n 'ShowResultsMirrored': '\\uEA65',\n 'ThumbnailViewMirrored': '\\uEA67',\n 'Media': '\\uEA69',\n 'Devices3': '\\uEA6C',\n 'Focus': '\\uEA6F',\n 'VideoLightOff': '\\uEA74',\n 'Lightbulb': '\\uEA80',\n 'StatusTriangle': '\\uEA82',\n 'VolumeDisabled': '\\uEA85',\n 'Puzzle': '\\uEA86',\n 'EmojiNeutral': '\\uEA87',\n 'EmojiDisappointed': '\\uEA88',\n 'HomeSolid': '\\uEA8A',\n 'Ringer': '\\uEA8F',\n 'PDF': '\\uEA90',\n 'HeartBroken': '\\uEA92',\n 'StoreLogo16': '\\uEA96',\n 'MultiSelectMirrored': '\\uEA98',\n 'Broom': '\\uEA99',\n 'AddToShoppingList': '\\uEA9A',\n 'Cocktails': '\\uEA9D',\n 'Wines': '\\uEABF',\n 'Articles': '\\uEAC1',\n 'Cycling': '\\uEAC7',\n 'DietPlanNotebook': '\\uEAC8',\n 'Pill': '\\uEACB',\n 'ExerciseTracker': '\\uEACC',\n 'HandsFree': '\\uEAD0',\n 'Medical': '\\uEAD4',\n 'Running': '\\uEADA',\n 'Weights': '\\uEADB',\n 'Trackers': '\\uEADF',\n 'AddNotes': '\\uEAE3',\n 'AllCurrency': '\\uEAE4',\n 'BarChart4': '\\uEAE7',\n 'CirclePlus': '\\uEAEE',\n 'Coffee': '\\uEAEF',\n 'Cotton': '\\uEAF3',\n 'Market': '\\uEAFC',\n 'Money': '\\uEAFD',\n 'PieDouble': '\\uEB04',\n 'PieSingle': '\\uEB05',\n 'RemoveFilter': '\\uEB08',\n 'Savings': '\\uEB0B',\n 'Sell': '\\uEB0C',\n 'StockDown': '\\uEB0F',\n 'StockUp': '\\uEB11',\n 'Lamp': '\\uEB19',\n 'Source': '\\uEB1B',\n 'MSNVideos': '\\uEB1C',\n 'Cricket': '\\uEB1E',\n 'Golf': '\\uEB1F',\n 'Baseball': '\\uEB20',\n 'Soccer': '\\uEB21',\n 'MoreSports': '\\uEB22',\n 'AutoRacing': '\\uEB24',\n 'CollegeHoops': '\\uEB25',\n 'CollegeFootball': '\\uEB26',\n 'ProFootball': '\\uEB27',\n 'ProHockey': '\\uEB28',\n 'Rugby': '\\uEB2D',\n 'SubstitutionsIn': '\\uEB31',\n 'Tennis': '\\uEB33',\n 'Arrivals': '\\uEB34',\n 'Design': '\\uEB3C',\n 'Website': '\\uEB41',\n 'Drop': '\\uEB42',\n 'HistoricalWeather': '\\uEB43',\n 'SkiResorts': '\\uEB45',\n 'Snowflake': '\\uEB46',\n 'BusSolid': '\\uEB47',\n 'FerrySolid': '\\uEB48',\n 'AirplaneSolid': '\\uEB4C',\n 'TrainSolid': '\\uEB4D',\n 'Ticket': '\\uEB54',\n 'WifiWarning4': '\\uEB63',\n 'Devices4': '\\uEB66',\n 'AzureLogo': '\\uEB6A',\n 'BingLogo': '\\uEB6B',\n 'MSNLogo': '\\uEB6C',\n 'OutlookLogoInverse': '\\uEB6D',\n 'OfficeLogo': '\\uEB6E',\n 'SkypeLogo': '\\uEB6F',\n 'Door': '\\uEB75',\n 'EditMirrored': '\\uEB7E',\n 'GiftCard': '\\uEB8E',\n 'DoubleBookmark': '\\uEB8F',\n 'StatusErrorFull': '\\uEB90'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-3\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-3-089e217a.woff') format('woff')\"\n },\n icons: {\n 'ChevronDownSmall': '\\uE96E',\n 'ChevronLeftSmall': '\\uE96F',\n 'ChevronRightSmall': '\\uE970',\n 'ChevronUpMed': '\\uE971',\n 'ChevronDownMed': '\\uE972',\n 'ChevronLeftMed': '\\uE973',\n 'ChevronRightMed': '\\uE974',\n 'Devices2': '\\uE975',\n 'PC1': '\\uE977',\n 'PresenceChickletVideo': '\\uE979',\n 'Reply': '\\uE97A',\n 'HalfAlpha': '\\uE97E',\n 'ConstructionCone': '\\uE98F',\n 'DoubleChevronLeftMed': '\\uE991',\n 'Volume0': '\\uE992',\n 'Volume1': '\\uE993',\n 'Volume2': '\\uE994',\n 'Volume3': '\\uE995',\n 'Chart': '\\uE999',\n 'Robot': '\\uE99A',\n 'Manufacturing': '\\uE99C',\n 'LockSolid': '\\uE9A2',\n 'FitPage': '\\uE9A6',\n 'FitWidth': '\\uE9A7',\n 'BidiLtr': '\\uE9AA',\n 'BidiRtl': '\\uE9AB',\n 'RightDoubleQuote': '\\uE9B1',\n 'Sunny': '\\uE9BD',\n 'CloudWeather': '\\uE9BE',\n 'Cloudy': '\\uE9BF',\n 'PartlyCloudyDay': '\\uE9C0',\n 'PartlyCloudyNight': '\\uE9C1',\n 'ClearNight': '\\uE9C2',\n 'RainShowersDay': '\\uE9C3',\n 'Rain': '\\uE9C4',\n 'Thunderstorms': '\\uE9C6',\n 'RainSnow': '\\uE9C7',\n 'Snow': '\\uE9C8',\n 'BlowingSnow': '\\uE9C9',\n 'Frigid': '\\uE9CA',\n 'Fog': '\\uE9CB',\n 'Squalls': '\\uE9CC',\n 'Duststorm': '\\uE9CD',\n 'Unknown': '\\uE9CE',\n 'Precipitation': '\\uE9CF',\n 'Ribbon': '\\uE9D1',\n 'AreaChart': '\\uE9D2',\n 'Assign': '\\uE9D3',\n 'FlowChart': '\\uE9D4',\n 'CheckList': '\\uE9D5',\n 'Diagnostic': '\\uE9D9',\n 'Generate': '\\uE9DA',\n 'LineChart': '\\uE9E6',\n 'Equalizer': '\\uE9E9',\n 'BarChartHorizontal': '\\uE9EB',\n 'BarChartVertical': '\\uE9EC',\n 'Freezing': '\\uE9EF',\n 'FunnelChart': '\\uE9F1',\n 'Processing': '\\uE9F5',\n 'Quantity': '\\uE9F8',\n 'ReportDocument': '\\uE9F9',\n 'StackColumnChart': '\\uE9FC',\n 'SnowShowerDay': '\\uE9FD',\n 'HailDay': '\\uEA00',\n 'WorkFlow': '\\uEA01',\n 'HourGlass': '\\uEA03',\n 'StoreLogoMed20': '\\uEA04',\n 'TimeSheet': '\\uEA05',\n 'TriangleSolid': '\\uEA08',\n 'UpgradeAnalysis': '\\uEA0B',\n 'VideoSolid': '\\uEA0C',\n 'RainShowersNight': '\\uEA0F',\n 'SnowShowerNight': '\\uEA11',\n 'Teamwork': '\\uEA12',\n 'HailNight': '\\uEA13',\n 'PeopleAdd': '\\uEA15',\n 'Glasses': '\\uEA16',\n 'DateTime2': '\\uEA17',\n 'Shield': '\\uEA18',\n 'Header1': '\\uEA19',\n 'PageAdd': '\\uEA1A',\n 'NumberedList': '\\uEA1C',\n 'PowerBILogo': '\\uEA1E',\n 'Info2': '\\uEA1F',\n 'MusicInCollectionFill': '\\uEA36',\n 'Asterisk': '\\uEA38',\n 'ErrorBadge': '\\uEA39',\n 'CircleFill': '\\uEA3B',\n 'Record2': '\\uEA3F',\n 'AllAppsMirrored': '\\uEA40',\n 'BookmarksMirrored': '\\uEA41',\n 'BulletedListMirrored': '\\uEA42',\n 'CaretHollowMirrored': '\\uEA45',\n 'CaretSolidMirrored': '\\uEA46',\n 'ChromeBackMirrored': '\\uEA47',\n 'ClearSelectionMirrored': '\\uEA48',\n 'ClosePaneMirrored': '\\uEA49',\n 'DockLeftMirrored': '\\uEA4C',\n 'DoubleChevronLeftMedMirrored': '\\uEA4D',\n 'GoMirrored': '\\uEA4F'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-3\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-3-089e217a.woff') format('woff')\"\n },\n icons: {\n 'ChevronDownSmall': '\\uE96E',\n 'ChevronLeftSmall': '\\uE96F',\n 'ChevronRightSmall': '\\uE970',\n 'ChevronUpMed': '\\uE971',\n 'ChevronDownMed': '\\uE972',\n 'ChevronLeftMed': '\\uE973',\n 'ChevronRightMed': '\\uE974',\n 'Devices2': '\\uE975',\n 'PC1': '\\uE977',\n 'PresenceChickletVideo': '\\uE979',\n 'Reply': '\\uE97A',\n 'HalfAlpha': '\\uE97E',\n 'ConstructionCone': '\\uE98F',\n 'DoubleChevronLeftMed': '\\uE991',\n 'Volume0': '\\uE992',\n 'Volume1': '\\uE993',\n 'Volume2': '\\uE994',\n 'Volume3': '\\uE995',\n 'Chart': '\\uE999',\n 'Robot': '\\uE99A',\n 'Manufacturing': '\\uE99C',\n 'LockSolid': '\\uE9A2',\n 'FitPage': '\\uE9A6',\n 'FitWidth': '\\uE9A7',\n 'BidiLtr': '\\uE9AA',\n 'BidiRtl': '\\uE9AB',\n 'RightDoubleQuote': '\\uE9B1',\n 'Sunny': '\\uE9BD',\n 'CloudWeather': '\\uE9BE',\n 'Cloudy': '\\uE9BF',\n 'PartlyCloudyDay': '\\uE9C0',\n 'PartlyCloudyNight': '\\uE9C1',\n 'ClearNight': '\\uE9C2',\n 'RainShowersDay': '\\uE9C3',\n 'Rain': '\\uE9C4',\n 'Thunderstorms': '\\uE9C6',\n 'RainSnow': '\\uE9C7',\n 'Snow': '\\uE9C8',\n 'BlowingSnow': '\\uE9C9',\n 'Frigid': '\\uE9CA',\n 'Fog': '\\uE9CB',\n 'Squalls': '\\uE9CC',\n 'Duststorm': '\\uE9CD',\n 'Unknown': '\\uE9CE',\n 'Precipitation': '\\uE9CF',\n 'Ribbon': '\\uE9D1',\n 'AreaChart': '\\uE9D2',\n 'Assign': '\\uE9D3',\n 'FlowChart': '\\uE9D4',\n 'CheckList': '\\uE9D5',\n 'Diagnostic': '\\uE9D9',\n 'Generate': '\\uE9DA',\n 'LineChart': '\\uE9E6',\n 'Equalizer': '\\uE9E9',\n 'BarChartHorizontal': '\\uE9EB',\n 'BarChartVertical': '\\uE9EC',\n 'Freezing': '\\uE9EF',\n 'FunnelChart': '\\uE9F1',\n 'Processing': '\\uE9F5',\n 'Quantity': '\\uE9F8',\n 'ReportDocument': '\\uE9F9',\n 'StackColumnChart': '\\uE9FC',\n 'SnowShowerDay': '\\uE9FD',\n 'HailDay': '\\uEA00',\n 'WorkFlow': '\\uEA01',\n 'HourGlass': '\\uEA03',\n 'StoreLogoMed20': '\\uEA04',\n 'TimeSheet': '\\uEA05',\n 'TriangleSolid': '\\uEA08',\n 'UpgradeAnalysis': '\\uEA0B',\n 'VideoSolid': '\\uEA0C',\n 'RainShowersNight': '\\uEA0F',\n 'SnowShowerNight': '\\uEA11',\n 'Teamwork': '\\uEA12',\n 'HailNight': '\\uEA13',\n 'PeopleAdd': '\\uEA15',\n 'Glasses': '\\uEA16',\n 'DateTime2': '\\uEA17',\n 'Shield': '\\uEA18',\n 'Header1': '\\uEA19',\n 'PageAdd': '\\uEA1A',\n 'NumberedList': '\\uEA1C',\n 'PowerBILogo': '\\uEA1E',\n 'Info2': '\\uEA1F',\n 'MusicInCollectionFill': '\\uEA36',\n 'Asterisk': '\\uEA38',\n 'ErrorBadge': '\\uEA39',\n 'CircleFill': '\\uEA3B',\n 'Record2': '\\uEA3F',\n 'AllAppsMirrored': '\\uEA40',\n 'BookmarksMirrored': '\\uEA41',\n 'BulletedListMirrored': '\\uEA42',\n 'CaretHollowMirrored': '\\uEA45',\n 'CaretSolidMirrored': '\\uEA46',\n 'ChromeBackMirrored': '\\uEA47',\n 'ClearSelectionMirrored': '\\uEA48',\n 'ClosePaneMirrored': '\\uEA49',\n 'DockLeftMirrored': '\\uEA4C',\n 'DoubleChevronLeftMedMirrored': '\\uEA4D',\n 'GoMirrored': '\\uEA4F'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-5\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-5-f95ba260.woff') format('woff')\"\n },\n icons: {\n 'Certificate': '\\uEB95',\n 'FastForward': '\\uEB9D',\n 'Rewind': '\\uEB9E',\n 'Photo2': '\\uEB9F',\n 'OpenSource': '\\uEBC2',\n 'Movers': '\\uEBCD',\n 'CloudDownload': '\\uEBD3',\n 'Family': '\\uEBDA',\n 'WindDirection': '\\uEBE6',\n 'Bug': '\\uEBE8',\n 'SiteScan': '\\uEBEC',\n 'BrowserScreenShot': '\\uEBED',\n 'F12DevTools': '\\uEBEE',\n 'CSS': '\\uEBEF',\n 'JS': '\\uEBF0',\n 'DeliveryTruck': '\\uEBF4',\n 'ReminderPerson': '\\uEBF7',\n 'ReminderGroup': '\\uEBF8',\n 'ReminderTime': '\\uEBF9',\n 'TabletMode': '\\uEBFC',\n 'Umbrella': '\\uEC04',\n 'NetworkTower': '\\uEC05',\n 'CityNext': '\\uEC06',\n 'CityNext2': '\\uEC07',\n 'Section': '\\uEC0C',\n 'OneNoteLogoInverse': '\\uEC0D',\n 'ToggleFilled': '\\uEC11',\n 'ToggleBorder': '\\uEC12',\n 'SliderThumb': '\\uEC13',\n 'ToggleThumb': '\\uEC14',\n 'Documentation': '\\uEC17',\n 'Badge': '\\uEC1B',\n 'Giftbox': '\\uEC1F',\n 'VisualStudioLogo': '\\uEC22',\n 'HomeGroup': '\\uEC26',\n 'ExcelLogoInverse': '\\uEC28',\n 'WordLogoInverse': '\\uEC29',\n 'PowerPointLogoInverse': '\\uEC2A',\n 'Cafe': '\\uEC32',\n 'SpeedHigh': '\\uEC4A',\n 'Commitments': '\\uEC4D',\n 'ThisPC': '\\uEC4E',\n 'MusicNote': '\\uEC4F',\n 'MicOff': '\\uEC54',\n 'PlaybackRate1x': '\\uEC57',\n 'EdgeLogo': '\\uEC60',\n 'CompletedSolid': '\\uEC61',\n 'AlbumRemove': '\\uEC62',\n 'MessageFill': '\\uEC70',\n 'TabletSelected': '\\uEC74',\n 'MobileSelected': '\\uEC75',\n 'LaptopSelected': '\\uEC76',\n 'TVMonitorSelected': '\\uEC77',\n 'DeveloperTools': '\\uEC7A',\n 'Shapes': '\\uEC7C',\n 'InsertTextBox': '\\uEC7D',\n 'LowerBrightness': '\\uEC8A',\n 'WebComponents': '\\uEC8B',\n 'OfflineStorage': '\\uEC8C',\n 'DOM': '\\uEC8D',\n 'CloudUpload': '\\uEC8E',\n 'ScrollUpDown': '\\uEC8F',\n 'DateTime': '\\uEC92',\n 'Event': '\\uECA3',\n 'Cake': '\\uECA4',\n 'Org': '\\uECA6',\n 'PartyLeader': '\\uECA7',\n 'DRM': '\\uECA8',\n 'CloudAdd': '\\uECA9',\n 'AppIconDefault': '\\uECAA',\n 'Photo2Add': '\\uECAB',\n 'Photo2Remove': '\\uECAC',\n 'Calories': '\\uECAD',\n 'POI': '\\uECAF',\n 'AddTo': '\\uECC8',\n 'RadioBtnOff': '\\uECCA',\n 'RadioBtnOn': '\\uECCB',\n 'ExploreContent': '\\uECCD',\n 'Product': '\\uECDC',\n 'ProgressLoopInner': '\\uECDE',\n 'ProgressLoopOuter': '\\uECDF',\n 'Blocked2': '\\uECE4',\n 'FangBody': '\\uECEB',\n 'Toolbox': '\\uECED',\n 'PageHeader': '\\uECEE',\n 'ChatInviteFriend': '\\uECFE',\n 'Brush': '\\uECFF',\n 'Shirt': '\\uED00',\n 'Crown': '\\uED01',\n 'Diamond': '\\uED02',\n 'ScaleUp': '\\uED09',\n 'QRCode': '\\uED14',\n 'Feedback': '\\uED15',\n 'SharepointLogoInverse': '\\uED18',\n 'YammerLogo': '\\uED19',\n 'Hide': '\\uED1A',\n 'Uneditable': '\\uED1D',\n 'ReturnToSession': '\\uED24',\n 'OpenFolderHorizontal': '\\uED25',\n 'CalendarMirrored': '\\uED28'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-5\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-5-f95ba260.woff') format('woff')\"\n },\n icons: {\n 'Certificate': '\\uEB95',\n 'FastForward': '\\uEB9D',\n 'Rewind': '\\uEB9E',\n 'Photo2': '\\uEB9F',\n 'OpenSource': '\\uEBC2',\n 'Movers': '\\uEBCD',\n 'CloudDownload': '\\uEBD3',\n 'Family': '\\uEBDA',\n 'WindDirection': '\\uEBE6',\n 'Bug': '\\uEBE8',\n 'SiteScan': '\\uEBEC',\n 'BrowserScreenShot': '\\uEBED',\n 'F12DevTools': '\\uEBEE',\n 'CSS': '\\uEBEF',\n 'JS': '\\uEBF0',\n 'DeliveryTruck': '\\uEBF4',\n 'ReminderPerson': '\\uEBF7',\n 'ReminderGroup': '\\uEBF8',\n 'ReminderTime': '\\uEBF9',\n 'TabletMode': '\\uEBFC',\n 'Umbrella': '\\uEC04',\n 'NetworkTower': '\\uEC05',\n 'CityNext': '\\uEC06',\n 'CityNext2': '\\uEC07',\n 'Section': '\\uEC0C',\n 'OneNoteLogoInverse': '\\uEC0D',\n 'ToggleFilled': '\\uEC11',\n 'ToggleBorder': '\\uEC12',\n 'SliderThumb': '\\uEC13',\n 'ToggleThumb': '\\uEC14',\n 'Documentation': '\\uEC17',\n 'Badge': '\\uEC1B',\n 'Giftbox': '\\uEC1F',\n 'VisualStudioLogo': '\\uEC22',\n 'HomeGroup': '\\uEC26',\n 'ExcelLogoInverse': '\\uEC28',\n 'WordLogoInverse': '\\uEC29',\n 'PowerPointLogoInverse': '\\uEC2A',\n 'Cafe': '\\uEC32',\n 'SpeedHigh': '\\uEC4A',\n 'Commitments': '\\uEC4D',\n 'ThisPC': '\\uEC4E',\n 'MusicNote': '\\uEC4F',\n 'MicOff': '\\uEC54',\n 'PlaybackRate1x': '\\uEC57',\n 'EdgeLogo': '\\uEC60',\n 'CompletedSolid': '\\uEC61',\n 'AlbumRemove': '\\uEC62',\n 'MessageFill': '\\uEC70',\n 'TabletSelected': '\\uEC74',\n 'MobileSelected': '\\uEC75',\n 'LaptopSelected': '\\uEC76',\n 'TVMonitorSelected': '\\uEC77',\n 'DeveloperTools': '\\uEC7A',\n 'Shapes': '\\uEC7C',\n 'InsertTextBox': '\\uEC7D',\n 'LowerBrightness': '\\uEC8A',\n 'WebComponents': '\\uEC8B',\n 'OfflineStorage': '\\uEC8C',\n 'DOM': '\\uEC8D',\n 'CloudUpload': '\\uEC8E',\n 'ScrollUpDown': '\\uEC8F',\n 'DateTime': '\\uEC92',\n 'Event': '\\uECA3',\n 'Cake': '\\uECA4',\n 'Org': '\\uECA6',\n 'PartyLeader': '\\uECA7',\n 'DRM': '\\uECA8',\n 'CloudAdd': '\\uECA9',\n 'AppIconDefault': '\\uECAA',\n 'Photo2Add': '\\uECAB',\n 'Photo2Remove': '\\uECAC',\n 'Calories': '\\uECAD',\n 'POI': '\\uECAF',\n 'AddTo': '\\uECC8',\n 'RadioBtnOff': '\\uECCA',\n 'RadioBtnOn': '\\uECCB',\n 'ExploreContent': '\\uECCD',\n 'Product': '\\uECDC',\n 'ProgressLoopInner': '\\uECDE',\n 'ProgressLoopOuter': '\\uECDF',\n 'Blocked2': '\\uECE4',\n 'FangBody': '\\uECEB',\n 'Toolbox': '\\uECED',\n 'PageHeader': '\\uECEE',\n 'ChatInviteFriend': '\\uECFE',\n 'Brush': '\\uECFF',\n 'Shirt': '\\uED00',\n 'Crown': '\\uED01',\n 'Diamond': '\\uED02',\n 'ScaleUp': '\\uED09',\n 'QRCode': '\\uED14',\n 'Feedback': '\\uED15',\n 'SharepointLogoInverse': '\\uED18',\n 'YammerLogo': '\\uED19',\n 'Hide': '\\uED1A',\n 'Uneditable': '\\uED1D',\n 'ReturnToSession': '\\uED24',\n 'OpenFolderHorizontal': '\\uED25',\n 'CalendarMirrored': '\\uED28'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-9\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-9-c6162b42.woff') format('woff')\"\n },\n icons: {\n 'AddFavoriteFill': '\\uF0C9',\n 'BufferTimeBefore': '\\uF0CF',\n 'BufferTimeAfter': '\\uF0D0',\n 'BufferTimeBoth': '\\uF0D1',\n 'PublishContent': '\\uF0D4',\n 'ClipboardList': '\\uF0E3',\n 'ClipboardListMirrored': '\\uF0E4',\n 'CannedChat': '\\uF0F2',\n 'SkypeForBusinessLogo': '\\uF0FC',\n 'TabCenter': '\\uF100',\n 'PageCheckedin': '\\uF104',\n 'PageList': '\\uF106',\n 'ReadOutLoud': '\\uF112',\n 'CaretBottomLeftSolid8': '\\uF121',\n 'CaretBottomRightSolid8': '\\uF122',\n 'FolderHorizontal': '\\uF12B',\n 'MicrosoftStaffhubLogo': '\\uF130',\n 'GiftboxOpen': '\\uF133',\n 'StatusCircleOuter': '\\uF136',\n 'StatusCircleInner': '\\uF137',\n 'StatusCircleRing': '\\uF138',\n 'StatusTriangleOuter': '\\uF139',\n 'StatusTriangleInner': '\\uF13A',\n 'StatusTriangleExclamation': '\\uF13B',\n 'StatusCircleExclamation': '\\uF13C',\n 'StatusCircleErrorX': '\\uF13D',\n 'StatusCircleInfo': '\\uF13F',\n 'StatusCircleBlock': '\\uF140',\n 'StatusCircleBlock2': '\\uF141',\n 'StatusCircleQuestionMark': '\\uF142',\n 'StatusCircleSync': '\\uF143',\n 'Toll': '\\uF160',\n 'ExploreContentSingle': '\\uF164',\n 'CollapseContent': '\\uF165',\n 'CollapseContentSingle': '\\uF166',\n 'InfoSolid': '\\uF167',\n 'GroupList': '\\uF168',\n 'ProgressRingDots': '\\uF16A',\n 'CaloriesAdd': '\\uF172',\n 'BranchFork': '\\uF173',\n 'MuteChat': '\\uF17A',\n 'AddHome': '\\uF17B',\n 'AddWork': '\\uF17C',\n 'MobileReport': '\\uF18A',\n 'ScaleVolume': '\\uF18C',\n 'HardDriveGroup': '\\uF18F',\n 'FastMode': '\\uF19A',\n 'ToggleLeft': '\\uF19E',\n 'ToggleRight': '\\uF19F',\n 'TriangleShape': '\\uF1A7',\n 'RectangleShape': '\\uF1A9',\n 'CubeShape': '\\uF1AA',\n 'Trophy2': '\\uF1AE',\n 'BucketColor': '\\uF1B6',\n 'BucketColorFill': '\\uF1B7',\n 'Taskboard': '\\uF1C2',\n 'SingleColumn': '\\uF1D3',\n 'DoubleColumn': '\\uF1D4',\n 'TripleColumn': '\\uF1D5',\n 'ColumnLeftTwoThirds': '\\uF1D6',\n 'ColumnRightTwoThirds': '\\uF1D7',\n 'AccessLogoFill': '\\uF1DB',\n 'AnalyticsLogo': '\\uF1DE',\n 'AnalyticsQuery': '\\uF1DF',\n 'NewAnalyticsQuery': '\\uF1E0',\n 'AnalyticsReport': '\\uF1E1',\n 'WordLogo': '\\uF1E3',\n 'WordLogoFill': '\\uF1E4',\n 'ExcelLogo': '\\uF1E5',\n 'ExcelLogoFill': '\\uF1E6',\n 'OneNoteLogo': '\\uF1E7',\n 'OneNoteLogoFill': '\\uF1E8',\n 'OutlookLogo': '\\uF1E9',\n 'OutlookLogoFill': '\\uF1EA',\n 'PowerPointLogo': '\\uF1EB',\n 'PowerPointLogoFill': '\\uF1EC',\n 'PublisherLogo': '\\uF1ED',\n 'PublisherLogoFill': '\\uF1EE',\n 'ScheduleEventAction': '\\uF1EF',\n 'FlameSolid': '\\uF1F3',\n 'ServerProcesses': '\\uF1FE',\n 'Server': '\\uF201',\n 'SaveAll': '\\uF203',\n 'LinkedInLogo': '\\uF20A',\n 'Decimals': '\\uF218',\n 'SidePanelMirrored': '\\uF221',\n 'ProtectRestrict': '\\uF22A',\n 'Blog': '\\uF22B',\n 'UnknownMirrored': '\\uF22E',\n 'PublicContactCardMirrored': '\\uF230',\n 'GridViewSmall': '\\uF232',\n 'GridViewMedium': '\\uF233',\n 'GridViewLarge': '\\uF234',\n 'Step': '\\uF241',\n 'StepInsert': '\\uF242',\n 'StepShared': '\\uF243',\n 'StepSharedAdd': '\\uF244',\n 'StepSharedInsert': '\\uF245',\n 'ViewDashboard': '\\uF246',\n 'ViewList': '\\uF247'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-9\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-9-c6162b42.woff') format('woff')\"\n },\n icons: {\n 'AddFavoriteFill': '\\uF0C9',\n 'BufferTimeBefore': '\\uF0CF',\n 'BufferTimeAfter': '\\uF0D0',\n 'BufferTimeBoth': '\\uF0D1',\n 'PublishContent': '\\uF0D4',\n 'ClipboardList': '\\uF0E3',\n 'ClipboardListMirrored': '\\uF0E4',\n 'CannedChat': '\\uF0F2',\n 'SkypeForBusinessLogo': '\\uF0FC',\n 'TabCenter': '\\uF100',\n 'PageCheckedin': '\\uF104',\n 'PageList': '\\uF106',\n 'ReadOutLoud': '\\uF112',\n 'CaretBottomLeftSolid8': '\\uF121',\n 'CaretBottomRightSolid8': '\\uF122',\n 'FolderHorizontal': '\\uF12B',\n 'MicrosoftStaffhubLogo': '\\uF130',\n 'GiftboxOpen': '\\uF133',\n 'StatusCircleOuter': '\\uF136',\n 'StatusCircleInner': '\\uF137',\n 'StatusCircleRing': '\\uF138',\n 'StatusTriangleOuter': '\\uF139',\n 'StatusTriangleInner': '\\uF13A',\n 'StatusTriangleExclamation': '\\uF13B',\n 'StatusCircleExclamation': '\\uF13C',\n 'StatusCircleErrorX': '\\uF13D',\n 'StatusCircleInfo': '\\uF13F',\n 'StatusCircleBlock': '\\uF140',\n 'StatusCircleBlock2': '\\uF141',\n 'StatusCircleQuestionMark': '\\uF142',\n 'StatusCircleSync': '\\uF143',\n 'Toll': '\\uF160',\n 'ExploreContentSingle': '\\uF164',\n 'CollapseContent': '\\uF165',\n 'CollapseContentSingle': '\\uF166',\n 'InfoSolid': '\\uF167',\n 'GroupList': '\\uF168',\n 'ProgressRingDots': '\\uF16A',\n 'CaloriesAdd': '\\uF172',\n 'BranchFork': '\\uF173',\n 'MuteChat': '\\uF17A',\n 'AddHome': '\\uF17B',\n 'AddWork': '\\uF17C',\n 'MobileReport': '\\uF18A',\n 'ScaleVolume': '\\uF18C',\n 'HardDriveGroup': '\\uF18F',\n 'FastMode': '\\uF19A',\n 'ToggleLeft': '\\uF19E',\n 'ToggleRight': '\\uF19F',\n 'TriangleShape': '\\uF1A7',\n 'RectangleShape': '\\uF1A9',\n 'CubeShape': '\\uF1AA',\n 'Trophy2': '\\uF1AE',\n 'BucketColor': '\\uF1B6',\n 'BucketColorFill': '\\uF1B7',\n 'Taskboard': '\\uF1C2',\n 'SingleColumn': '\\uF1D3',\n 'DoubleColumn': '\\uF1D4',\n 'TripleColumn': '\\uF1D5',\n 'ColumnLeftTwoThirds': '\\uF1D6',\n 'ColumnRightTwoThirds': '\\uF1D7',\n 'AccessLogoFill': '\\uF1DB',\n 'AnalyticsLogo': '\\uF1DE',\n 'AnalyticsQuery': '\\uF1DF',\n 'NewAnalyticsQuery': '\\uF1E0',\n 'AnalyticsReport': '\\uF1E1',\n 'WordLogo': '\\uF1E3',\n 'WordLogoFill': '\\uF1E4',\n 'ExcelLogo': '\\uF1E5',\n 'ExcelLogoFill': '\\uF1E6',\n 'OneNoteLogo': '\\uF1E7',\n 'OneNoteLogoFill': '\\uF1E8',\n 'OutlookLogo': '\\uF1E9',\n 'OutlookLogoFill': '\\uF1EA',\n 'PowerPointLogo': '\\uF1EB',\n 'PowerPointLogoFill': '\\uF1EC',\n 'PublisherLogo': '\\uF1ED',\n 'PublisherLogoFill': '\\uF1EE',\n 'ScheduleEventAction': '\\uF1EF',\n 'FlameSolid': '\\uF1F3',\n 'ServerProcesses': '\\uF1FE',\n 'Server': '\\uF201',\n 'SaveAll': '\\uF203',\n 'LinkedInLogo': '\\uF20A',\n 'Decimals': '\\uF218',\n 'SidePanelMirrored': '\\uF221',\n 'ProtectRestrict': '\\uF22A',\n 'Blog': '\\uF22B',\n 'UnknownMirrored': '\\uF22E',\n 'PublicContactCardMirrored': '\\uF230',\n 'GridViewSmall': '\\uF232',\n 'GridViewMedium': '\\uF233',\n 'GridViewLarge': '\\uF234',\n 'Step': '\\uF241',\n 'StepInsert': '\\uF242',\n 'StepShared': '\\uF243',\n 'StepSharedAdd': '\\uF244',\n 'StepSharedInsert': '\\uF245',\n 'ViewDashboard': '\\uF246',\n 'ViewList': '\\uF247'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-8\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-8-6fdf1528.woff') format('woff')\"\n },\n icons: {\n 'CollapseMenu': '\\uEF66',\n 'ExpandMenu': '\\uEF67',\n 'Boards': '\\uEF68',\n 'SunAdd': '\\uEF69',\n 'SunQuestionMark': '\\uEF6A',\n 'LandscapeOrientation': '\\uEF6B',\n 'DocumentSearch': '\\uEF6C',\n 'PublicCalendar': '\\uEF6D',\n 'PublicContactCard': '\\uEF6E',\n 'PublicEmail': '\\uEF6F',\n 'PublicFolder': '\\uEF70',\n 'WordDocument': '\\uEF71',\n 'PowerPointDocument': '\\uEF72',\n 'ExcelDocument': '\\uEF73',\n 'GroupedList': '\\uEF74',\n 'ClassroomLogo': '\\uEF75',\n 'Sections': '\\uEF76',\n 'EditPhoto': '\\uEF77',\n 'Starburst': '\\uEF78',\n 'ShareiOS': '\\uEF79',\n 'AirTickets': '\\uEF7A',\n 'PencilReply': '\\uEF7B',\n 'Tiles2': '\\uEF7C',\n 'SkypeCircleCheck': '\\uEF7D',\n 'SkypeCircleClock': '\\uEF7E',\n 'SkypeCircleMinus': '\\uEF7F',\n 'SkypeMessage': '\\uEF83',\n 'ClosedCaption': '\\uEF84',\n 'ATPLogo': '\\uEF85',\n 'OfficeFormsLogoInverse': '\\uEF86',\n 'RecycleBin': '\\uEF87',\n 'EmptyRecycleBin': '\\uEF88',\n 'Hide2': '\\uEF89',\n 'Breadcrumb': '\\uEF8C',\n 'BirthdayCake': '\\uEF8D',\n 'TimeEntry': '\\uEF95',\n 'CRMProcesses': '\\uEFB1',\n 'PageEdit': '\\uEFB6',\n 'PageArrowRight': '\\uEFB8',\n 'PageRemove': '\\uEFBA',\n 'Database': '\\uEFC7',\n 'DataManagementSettings': '\\uEFC8',\n 'CRMServices': '\\uEFD2',\n 'EditContact': '\\uEFD3',\n 'ConnectContacts': '\\uEFD4',\n 'AppIconDefaultAdd': '\\uEFDA',\n 'AppIconDefaultList': '\\uEFDE',\n 'ActivateOrders': '\\uEFE0',\n 'DeactivateOrders': '\\uEFE1',\n 'ProductCatalog': '\\uEFE8',\n 'ScatterChart': '\\uEFEB',\n 'AccountActivity': '\\uEFF4',\n 'DocumentManagement': '\\uEFFC',\n 'CRMReport': '\\uEFFE',\n 'KnowledgeArticle': '\\uF000',\n 'Relationship': '\\uF003',\n 'HomeVerify': '\\uF00E',\n 'ZipFolder': '\\uF012',\n 'SurveyQuestions': '\\uF01B',\n 'TextDocument': '\\uF029',\n 'TextDocumentShared': '\\uF02B',\n 'PageCheckedOut': '\\uF02C',\n 'PageShared': '\\uF02D',\n 'SaveAndClose': '\\uF038',\n 'Script': '\\uF03A',\n 'Archive': '\\uF03F',\n 'ActivityFeed': '\\uF056',\n 'Compare': '\\uF057',\n 'EventDate': '\\uF059',\n 'ArrowUpRight': '\\uF069',\n 'CaretRight': '\\uF06B',\n 'SetAction': '\\uF071',\n 'ChatBot': '\\uF08B',\n 'CaretSolidLeft': '\\uF08D',\n 'CaretSolidDown': '\\uF08E',\n 'CaretSolidRight': '\\uF08F',\n 'CaretSolidUp': '\\uF090',\n 'PowerAppsLogo': '\\uF091',\n 'PowerApps2Logo': '\\uF092',\n 'SearchIssue': '\\uF09A',\n 'SearchIssueMirrored': '\\uF09B',\n 'FabricAssetLibrary': '\\uF09C',\n 'FabricDataConnectionLibrary': '\\uF09D',\n 'FabricDocLibrary': '\\uF09E',\n 'FabricFormLibrary': '\\uF09F',\n 'FabricFormLibraryMirrored': '\\uF0A0',\n 'FabricReportLibrary': '\\uF0A1',\n 'FabricReportLibraryMirrored': '\\uF0A2',\n 'FabricPublicFolder': '\\uF0A3',\n 'FabricFolderSearch': '\\uF0A4',\n 'FabricMovetoFolder': '\\uF0A5',\n 'FabricUnsyncFolder': '\\uF0A6',\n 'FabricSyncFolder': '\\uF0A7',\n 'FabricOpenFolderHorizontal': '\\uF0A8',\n 'FabricFolder': '\\uF0A9',\n 'FabricFolderFill': '\\uF0AA',\n 'FabricNewFolder': '\\uF0AB',\n 'FabricPictureLibrary': '\\uF0AC',\n 'PhotoVideoMedia': '\\uF0B1',\n 'AddFavorite': '\\uF0C8'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-8\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-8-6fdf1528.woff') format('woff')\"\n },\n icons: {\n 'CollapseMenu': '\\uEF66',\n 'ExpandMenu': '\\uEF67',\n 'Boards': '\\uEF68',\n 'SunAdd': '\\uEF69',\n 'SunQuestionMark': '\\uEF6A',\n 'LandscapeOrientation': '\\uEF6B',\n 'DocumentSearch': '\\uEF6C',\n 'PublicCalendar': '\\uEF6D',\n 'PublicContactCard': '\\uEF6E',\n 'PublicEmail': '\\uEF6F',\n 'PublicFolder': '\\uEF70',\n 'WordDocument': '\\uEF71',\n 'PowerPointDocument': '\\uEF72',\n 'ExcelDocument': '\\uEF73',\n 'GroupedList': '\\uEF74',\n 'ClassroomLogo': '\\uEF75',\n 'Sections': '\\uEF76',\n 'EditPhoto': '\\uEF77',\n 'Starburst': '\\uEF78',\n 'ShareiOS': '\\uEF79',\n 'AirTickets': '\\uEF7A',\n 'PencilReply': '\\uEF7B',\n 'Tiles2': '\\uEF7C',\n 'SkypeCircleCheck': '\\uEF7D',\n 'SkypeCircleClock': '\\uEF7E',\n 'SkypeCircleMinus': '\\uEF7F',\n 'SkypeMessage': '\\uEF83',\n 'ClosedCaption': '\\uEF84',\n 'ATPLogo': '\\uEF85',\n 'OfficeFormsLogoInverse': '\\uEF86',\n 'RecycleBin': '\\uEF87',\n 'EmptyRecycleBin': '\\uEF88',\n 'Hide2': '\\uEF89',\n 'Breadcrumb': '\\uEF8C',\n 'BirthdayCake': '\\uEF8D',\n 'TimeEntry': '\\uEF95',\n 'CRMProcesses': '\\uEFB1',\n 'PageEdit': '\\uEFB6',\n 'PageArrowRight': '\\uEFB8',\n 'PageRemove': '\\uEFBA',\n 'Database': '\\uEFC7',\n 'DataManagementSettings': '\\uEFC8',\n 'CRMServices': '\\uEFD2',\n 'EditContact': '\\uEFD3',\n 'ConnectContacts': '\\uEFD4',\n 'AppIconDefaultAdd': '\\uEFDA',\n 'AppIconDefaultList': '\\uEFDE',\n 'ActivateOrders': '\\uEFE0',\n 'DeactivateOrders': '\\uEFE1',\n 'ProductCatalog': '\\uEFE8',\n 'ScatterChart': '\\uEFEB',\n 'AccountActivity': '\\uEFF4',\n 'DocumentManagement': '\\uEFFC',\n 'CRMReport': '\\uEFFE',\n 'KnowledgeArticle': '\\uF000',\n 'Relationship': '\\uF003',\n 'HomeVerify': '\\uF00E',\n 'ZipFolder': '\\uF012',\n 'SurveyQuestions': '\\uF01B',\n 'TextDocument': '\\uF029',\n 'TextDocumentShared': '\\uF02B',\n 'PageCheckedOut': '\\uF02C',\n 'PageShared': '\\uF02D',\n 'SaveAndClose': '\\uF038',\n 'Script': '\\uF03A',\n 'Archive': '\\uF03F',\n 'ActivityFeed': '\\uF056',\n 'Compare': '\\uF057',\n 'EventDate': '\\uF059',\n 'ArrowUpRight': '\\uF069',\n 'CaretRight': '\\uF06B',\n 'SetAction': '\\uF071',\n 'ChatBot': '\\uF08B',\n 'CaretSolidLeft': '\\uF08D',\n 'CaretSolidDown': '\\uF08E',\n 'CaretSolidRight': '\\uF08F',\n 'CaretSolidUp': '\\uF090',\n 'PowerAppsLogo': '\\uF091',\n 'PowerApps2Logo': '\\uF092',\n 'SearchIssue': '\\uF09A',\n 'SearchIssueMirrored': '\\uF09B',\n 'FabricAssetLibrary': '\\uF09C',\n 'FabricDataConnectionLibrary': '\\uF09D',\n 'FabricDocLibrary': '\\uF09E',\n 'FabricFormLibrary': '\\uF09F',\n 'FabricFormLibraryMirrored': '\\uF0A0',\n 'FabricReportLibrary': '\\uF0A1',\n 'FabricReportLibraryMirrored': '\\uF0A2',\n 'FabricPublicFolder': '\\uF0A3',\n 'FabricFolderSearch': '\\uF0A4',\n 'FabricMovetoFolder': '\\uF0A5',\n 'FabricUnsyncFolder': '\\uF0A6',\n 'FabricSyncFolder': '\\uF0A7',\n 'FabricOpenFolderHorizontal': '\\uF0A8',\n 'FabricFolder': '\\uF0A9',\n 'FabricFolderFill': '\\uF0AA',\n 'FabricNewFolder': '\\uF0AB',\n 'FabricPictureLibrary': '\\uF0AC',\n 'PhotoVideoMedia': '\\uF0B1',\n 'AddFavorite': '\\uF0C8'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function _getIcon(worktype) {\n\n let icon = new Array('fa');\n\n switch (worktype) {\n case 'article':\n icon.push('fa-file-text');\n break;\n case 'book':\n icon.push('fa-book');\n break;\n case 'audiobook':\n icon.push('fa-book');\n break;\n case 'game':\n icon.push('fa-gamepad');\n break;\n case 'movie':\n icon.push('fa-film');\n break;\n case 'music':\n icon.push('fa-music');\n break;\n case 'periodica':\n icon.push('fa-newspaper-o');\n break;\n default:\n icon.push('fa-question');\n break;\n }\n\n return icon;\n\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-14\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-14-5cf58db8.woff') format('woff')\"\n },\n icons: {\n 'Snooze': '\\uF4BD',\n 'WaffleOffice365': '\\uF4E0',\n 'ImageSearch': '\\uF4E8',\n 'NewsSearch': '\\uF4E9',\n 'VideoSearch': '\\uF4EA',\n 'R': '\\uF4EB',\n 'FontColorA': '\\uF4EC',\n 'FontColorSwatch': '\\uF4ED',\n 'LightWeight': '\\uF4EE',\n 'NormalWeight': '\\uF4EF',\n 'SemiboldWeight': '\\uF4F0',\n 'GroupObject': '\\uF4F1',\n 'UngroupObject': '\\uF4F2',\n 'AlignHorizontalLeft': '\\uF4F3',\n 'AlignHorizontalCenter': '\\uF4F4',\n 'AlignHorizontalRight': '\\uF4F5',\n 'AlignVerticalTop': '\\uF4F6',\n 'AlignVerticalCenter': '\\uF4F7',\n 'AlignVerticalBottom': '\\uF4F8',\n 'HorizontalDistributeCenter': '\\uF4F9',\n 'VerticalDistributeCenter': '\\uF4FA',\n 'Ellipse': '\\uF4FB',\n 'Line': '\\uF4FC',\n 'Octagon': '\\uF4FD',\n 'Hexagon': '\\uF4FE',\n 'Pentagon': '\\uF4FF',\n 'RightTriangle': '\\uF500',\n 'HalfCircle': '\\uF501',\n 'QuarterCircle': '\\uF502',\n 'ThreeQuarterCircle': '\\uF503',\n '6PointStar': '\\uF504',\n '12PointStar': '\\uF505',\n 'ArrangeBringToFront': '\\uF506',\n 'ArrangeSendToBack': '\\uF507',\n 'ArrangeSendBackward': '\\uF508',\n 'ArrangeBringForward': '\\uF509',\n 'BorderDash': '\\uF50A',\n 'BorderDot': '\\uF50B',\n 'LineStyle': '\\uF50C',\n 'LineThickness': '\\uF50D',\n 'WindowEdit': '\\uF50E',\n 'HintText': '\\uF50F',\n 'MediaAdd': '\\uF510',\n 'AnchorLock': '\\uF511',\n 'AutoHeight': '\\uF512',\n 'ChartSeries': '\\uF513',\n 'ChartXAngle': '\\uF514',\n 'ChartYAngle': '\\uF515',\n 'Combobox': '\\uF516',\n 'LineSpacing': '\\uF517',\n 'Padding': '\\uF518',\n 'PaddingTop': '\\uF519',\n 'PaddingBottom': '\\uF51A',\n 'PaddingLeft': '\\uF51B',\n 'PaddingRight': '\\uF51C',\n 'NavigationFlipper': '\\uF51D',\n 'AlignJustify': '\\uF51E',\n 'TextOverflow': '\\uF51F',\n 'VisualsFolder': '\\uF520',\n 'VisualsStore': '\\uF521',\n 'PictureCenter': '\\uF522',\n 'PictureFill': '\\uF523',\n 'PicturePosition': '\\uF524',\n 'PictureStretch': '\\uF525',\n 'PictureTile': '\\uF526',\n 'Slider': '\\uF527',\n 'SliderHandleSize': '\\uF528',\n 'DefaultRatio': '\\uF529',\n 'NumberSequence': '\\uF52A',\n 'GUID': '\\uF52B',\n 'ReportAdd': '\\uF52C',\n 'DashboardAdd': '\\uF52D',\n 'MapPinSolid': '\\uF52E',\n 'WebPublish': '\\uF52F',\n 'PieSingleSolid': '\\uF530',\n 'BlockedSolid': '\\uF531',\n 'DrillDown': '\\uF532',\n 'DrillDownSolid': '\\uF533',\n 'DrillExpand': '\\uF534',\n 'DrillShow': '\\uF535',\n 'SpecialEvent': '\\uF536',\n 'OneDriveFolder16': '\\uF53B',\n 'FunctionalManagerDashboard': '\\uF542',\n 'BIDashboard': '\\uF543',\n 'CodeEdit': '\\uF544',\n 'RenewalCurrent': '\\uF545',\n 'RenewalFuture': '\\uF546',\n 'SplitObject': '\\uF547',\n 'BulkUpload': '\\uF548',\n 'DownloadDocument': '\\uF549',\n 'GreetingCard': '\\uF54B',\n 'Flower': '\\uF54E',\n 'WaitlistConfirm': '\\uF550',\n 'WaitlistConfirmMirrored': '\\uF551',\n 'LaptopSecure': '\\uF552',\n 'DragObject': '\\uF553',\n 'EntryView': '\\uF554',\n 'EntryDecline': '\\uF555',\n 'ContactCardSettings': '\\uF556',\n 'ContactCardSettingsMirrored': '\\uF557'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-14\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-14-5cf58db8.woff') format('woff')\"\n },\n icons: {\n 'Snooze': '\\uF4BD',\n 'WaffleOffice365': '\\uF4E0',\n 'ImageSearch': '\\uF4E8',\n 'NewsSearch': '\\uF4E9',\n 'VideoSearch': '\\uF4EA',\n 'R': '\\uF4EB',\n 'FontColorA': '\\uF4EC',\n 'FontColorSwatch': '\\uF4ED',\n 'LightWeight': '\\uF4EE',\n 'NormalWeight': '\\uF4EF',\n 'SemiboldWeight': '\\uF4F0',\n 'GroupObject': '\\uF4F1',\n 'UngroupObject': '\\uF4F2',\n 'AlignHorizontalLeft': '\\uF4F3',\n 'AlignHorizontalCenter': '\\uF4F4',\n 'AlignHorizontalRight': '\\uF4F5',\n 'AlignVerticalTop': '\\uF4F6',\n 'AlignVerticalCenter': '\\uF4F7',\n 'AlignVerticalBottom': '\\uF4F8',\n 'HorizontalDistributeCenter': '\\uF4F9',\n 'VerticalDistributeCenter': '\\uF4FA',\n 'Ellipse': '\\uF4FB',\n 'Line': '\\uF4FC',\n 'Octagon': '\\uF4FD',\n 'Hexagon': '\\uF4FE',\n 'Pentagon': '\\uF4FF',\n 'RightTriangle': '\\uF500',\n 'HalfCircle': '\\uF501',\n 'QuarterCircle': '\\uF502',\n 'ThreeQuarterCircle': '\\uF503',\n '6PointStar': '\\uF504',\n '12PointStar': '\\uF505',\n 'ArrangeBringToFront': '\\uF506',\n 'ArrangeSendToBack': '\\uF507',\n 'ArrangeSendBackward': '\\uF508',\n 'ArrangeBringForward': '\\uF509',\n 'BorderDash': '\\uF50A',\n 'BorderDot': '\\uF50B',\n 'LineStyle': '\\uF50C',\n 'LineThickness': '\\uF50D',\n 'WindowEdit': '\\uF50E',\n 'HintText': '\\uF50F',\n 'MediaAdd': '\\uF510',\n 'AnchorLock': '\\uF511',\n 'AutoHeight': '\\uF512',\n 'ChartSeries': '\\uF513',\n 'ChartXAngle': '\\uF514',\n 'ChartYAngle': '\\uF515',\n 'Combobox': '\\uF516',\n 'LineSpacing': '\\uF517',\n 'Padding': '\\uF518',\n 'PaddingTop': '\\uF519',\n 'PaddingBottom': '\\uF51A',\n 'PaddingLeft': '\\uF51B',\n 'PaddingRight': '\\uF51C',\n 'NavigationFlipper': '\\uF51D',\n 'AlignJustify': '\\uF51E',\n 'TextOverflow': '\\uF51F',\n 'VisualsFolder': '\\uF520',\n 'VisualsStore': '\\uF521',\n 'PictureCenter': '\\uF522',\n 'PictureFill': '\\uF523',\n 'PicturePosition': '\\uF524',\n 'PictureStretch': '\\uF525',\n 'PictureTile': '\\uF526',\n 'Slider': '\\uF527',\n 'SliderHandleSize': '\\uF528',\n 'DefaultRatio': '\\uF529',\n 'NumberSequence': '\\uF52A',\n 'GUID': '\\uF52B',\n 'ReportAdd': '\\uF52C',\n 'DashboardAdd': '\\uF52D',\n 'MapPinSolid': '\\uF52E',\n 'WebPublish': '\\uF52F',\n 'PieSingleSolid': '\\uF530',\n 'BlockedSolid': '\\uF531',\n 'DrillDown': '\\uF532',\n 'DrillDownSolid': '\\uF533',\n 'DrillExpand': '\\uF534',\n 'DrillShow': '\\uF535',\n 'SpecialEvent': '\\uF536',\n 'OneDriveFolder16': '\\uF53B',\n 'FunctionalManagerDashboard': '\\uF542',\n 'BIDashboard': '\\uF543',\n 'CodeEdit': '\\uF544',\n 'RenewalCurrent': '\\uF545',\n 'RenewalFuture': '\\uF546',\n 'SplitObject': '\\uF547',\n 'BulkUpload': '\\uF548',\n 'DownloadDocument': '\\uF549',\n 'GreetingCard': '\\uF54B',\n 'Flower': '\\uF54E',\n 'WaitlistConfirm': '\\uF550',\n 'WaitlistConfirmMirrored': '\\uF551',\n 'LaptopSecure': '\\uF552',\n 'DragObject': '\\uF553',\n 'EntryView': '\\uF554',\n 'EntryDecline': '\\uF555',\n 'ContactCardSettings': '\\uF556',\n 'ContactCardSettingsMirrored': '\\uF557'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function getIcons(text) {\n switch (text) {\n case 'Frigate':\n case 'Galleon':\n case 'Skiff':\n case 'Pinnace':\n case 'Flute':\n return 'fas fa-ship';\n case 'Tax increase':\n return 'fas fa-balance-scale';\n case 'Expedition':\n return 'fas fa-map-signs';\n case 'Trader':\n return 'fas fa-exchange-alt';\n case 'Governor':\n return 'fas fa-landmark';\n case 'Jester':\n return 'far fa-smile-wink';\n case 'Admiral':\n return 'fas fa-binoculars';\n case 'Sailor':\n case 'Pirate':\n return 'fas fa-skull-crossbones';\n case 'Priest':\n return 'fas fa-cross';\n case 'Captain':\n return 'fas fa-anchor';\n case 'Settler':\n return 'fas fa-home';\n case 'Madamoiselle':\n return 'fas fa-percent';\n case 'Jack of all Trades':\n return 'fas fa-asterisk';\n }\n}", "function IconOptions() {}", "function setDesktopIcons(){\t}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-15\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-15-3807251b.woff') format('woff')\"\n },\n icons: {\n 'CalendarSettings': '\\uF558',\n 'CalendarSettingsMirrored': '\\uF559',\n 'HardDriveLock': '\\uF55A',\n 'HardDriveUnlock': '\\uF55B',\n 'AccountManagement': '\\uF55C',\n 'ReportWarning': '\\uF569',\n 'TransitionPop': '\\uF5B2',\n 'TransitionPush': '\\uF5B3',\n 'TransitionEffect': '\\uF5B4',\n 'LookupEntities': '\\uF5B5',\n 'ExploreData': '\\uF5B6',\n 'AddBookmark': '\\uF5B7',\n 'SearchBookmark': '\\uF5B8',\n 'DrillThrough': '\\uF5B9',\n 'MasterDatabase': '\\uF5BA',\n 'CertifiedDatabase': '\\uF5BB',\n 'MaximumValue': '\\uF5BC',\n 'MinimumValue': '\\uF5BD',\n 'VisualStudioIDELogo32': '\\uF5D0',\n 'PasteAsText': '\\uF5D5',\n 'PasteAsCode': '\\uF5D6',\n 'BrowserTab': '\\uF5D7',\n 'BrowserTabScreenshot': '\\uF5D8',\n 'DesktopScreenshot': '\\uF5D9',\n 'FileYML': '\\uF5DA',\n 'ClipboardSolid': '\\uF5DC',\n 'FabricUserFolder': '\\uF5E5',\n 'FabricNetworkFolder': '\\uF5E6',\n 'BullseyeTarget': '\\uF5F0',\n 'AnalyticsView': '\\uF5F1',\n 'Video360Generic': '\\uF609',\n 'Untag': '\\uF60B',\n 'Leave': '\\uF627',\n 'Trending12': '\\uF62D',\n 'Blocked12': '\\uF62E',\n 'Warning12': '\\uF62F',\n 'CheckedOutByOther12': '\\uF630',\n 'CheckedOutByYou12': '\\uF631',\n 'CircleShapeSolid': '\\uF63C',\n 'SquareShapeSolid': '\\uF63D',\n 'TriangleShapeSolid': '\\uF63E',\n 'DropShapeSolid': '\\uF63F',\n 'RectangleShapeSolid': '\\uF640',\n 'ZoomToFit': '\\uF649',\n 'InsertColumnsLeft': '\\uF64A',\n 'InsertColumnsRight': '\\uF64B',\n 'InsertRowsAbove': '\\uF64C',\n 'InsertRowsBelow': '\\uF64D',\n 'DeleteColumns': '\\uF64E',\n 'DeleteRows': '\\uF64F',\n 'DeleteRowsMirrored': '\\uF650',\n 'DeleteTable': '\\uF651',\n 'AccountBrowser': '\\uF652',\n 'VersionControlPush': '\\uF664',\n 'StackedColumnChart2': '\\uF666',\n 'TripleColumnWide': '\\uF66E',\n 'QuadColumn': '\\uF66F',\n 'WhiteBoardApp16': '\\uF673',\n 'WhiteBoardApp32': '\\uF674',\n 'PinnedSolid': '\\uF676',\n 'InsertSignatureLine': '\\uF677',\n 'ArrangeByFrom': '\\uF678',\n 'Phishing': '\\uF679',\n 'CreateMailRule': '\\uF67A',\n 'PublishCourse': '\\uF699',\n 'DictionaryRemove': '\\uF69A',\n 'UserRemove': '\\uF69B',\n 'UserEvent': '\\uF69C',\n 'Encryption': '\\uF69D',\n 'PasswordField': '\\uF6AA',\n 'OpenInNewTab': '\\uF6AB',\n 'Hide3': '\\uF6AC',\n 'VerifiedBrandSolid': '\\uF6AD',\n 'MarkAsProtected': '\\uF6AE',\n 'AuthenticatorApp': '\\uF6B1',\n 'WebTemplate': '\\uF6B2',\n 'DefenderTVM': '\\uF6B3',\n 'MedalSolid': '\\uF6B9',\n 'D365TalentLearn': '\\uF6BB',\n 'D365TalentInsight': '\\uF6BC',\n 'D365TalentHRCore': '\\uF6BD',\n 'BacklogList': '\\uF6BF',\n 'ButtonControl': '\\uF6C0',\n 'TableGroup': '\\uF6D9',\n 'MountainClimbing': '\\uF6DB',\n 'TagUnknown': '\\uF6DF',\n 'TagUnknownMirror': '\\uF6E0',\n 'TagUnknown12': '\\uF6E1',\n 'TagUnknown12Mirror': '\\uF6E2',\n 'Link12': '\\uF6E3',\n 'Presentation': '\\uF6E4',\n 'Presentation12': '\\uF6E5',\n 'Lock12': '\\uF6E6',\n 'BuildDefinition': '\\uF6E9',\n 'ReleaseDefinition': '\\uF6EA',\n 'SaveTemplate': '\\uF6EC',\n 'UserGauge': '\\uF6ED',\n 'BlockedSiteSolid12': '\\uF70A',\n 'TagSolid': '\\uF70E',\n 'OfficeChat': '\\uF70F'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-15\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-15-3807251b.woff') format('woff')\"\n },\n icons: {\n 'CalendarSettings': '\\uF558',\n 'CalendarSettingsMirrored': '\\uF559',\n 'HardDriveLock': '\\uF55A',\n 'HardDriveUnlock': '\\uF55B',\n 'AccountManagement': '\\uF55C',\n 'ReportWarning': '\\uF569',\n 'TransitionPop': '\\uF5B2',\n 'TransitionPush': '\\uF5B3',\n 'TransitionEffect': '\\uF5B4',\n 'LookupEntities': '\\uF5B5',\n 'ExploreData': '\\uF5B6',\n 'AddBookmark': '\\uF5B7',\n 'SearchBookmark': '\\uF5B8',\n 'DrillThrough': '\\uF5B9',\n 'MasterDatabase': '\\uF5BA',\n 'CertifiedDatabase': '\\uF5BB',\n 'MaximumValue': '\\uF5BC',\n 'MinimumValue': '\\uF5BD',\n 'VisualStudioIDELogo32': '\\uF5D0',\n 'PasteAsText': '\\uF5D5',\n 'PasteAsCode': '\\uF5D6',\n 'BrowserTab': '\\uF5D7',\n 'BrowserTabScreenshot': '\\uF5D8',\n 'DesktopScreenshot': '\\uF5D9',\n 'FileYML': '\\uF5DA',\n 'ClipboardSolid': '\\uF5DC',\n 'FabricUserFolder': '\\uF5E5',\n 'FabricNetworkFolder': '\\uF5E6',\n 'BullseyeTarget': '\\uF5F0',\n 'AnalyticsView': '\\uF5F1',\n 'Video360Generic': '\\uF609',\n 'Untag': '\\uF60B',\n 'Leave': '\\uF627',\n 'Trending12': '\\uF62D',\n 'Blocked12': '\\uF62E',\n 'Warning12': '\\uF62F',\n 'CheckedOutByOther12': '\\uF630',\n 'CheckedOutByYou12': '\\uF631',\n 'CircleShapeSolid': '\\uF63C',\n 'SquareShapeSolid': '\\uF63D',\n 'TriangleShapeSolid': '\\uF63E',\n 'DropShapeSolid': '\\uF63F',\n 'RectangleShapeSolid': '\\uF640',\n 'ZoomToFit': '\\uF649',\n 'InsertColumnsLeft': '\\uF64A',\n 'InsertColumnsRight': '\\uF64B',\n 'InsertRowsAbove': '\\uF64C',\n 'InsertRowsBelow': '\\uF64D',\n 'DeleteColumns': '\\uF64E',\n 'DeleteRows': '\\uF64F',\n 'DeleteRowsMirrored': '\\uF650',\n 'DeleteTable': '\\uF651',\n 'AccountBrowser': '\\uF652',\n 'VersionControlPush': '\\uF664',\n 'StackedColumnChart2': '\\uF666',\n 'TripleColumnWide': '\\uF66E',\n 'QuadColumn': '\\uF66F',\n 'WhiteBoardApp16': '\\uF673',\n 'WhiteBoardApp32': '\\uF674',\n 'PinnedSolid': '\\uF676',\n 'InsertSignatureLine': '\\uF677',\n 'ArrangeByFrom': '\\uF678',\n 'Phishing': '\\uF679',\n 'CreateMailRule': '\\uF67A',\n 'PublishCourse': '\\uF699',\n 'DictionaryRemove': '\\uF69A',\n 'UserRemove': '\\uF69B',\n 'UserEvent': '\\uF69C',\n 'Encryption': '\\uF69D',\n 'PasswordField': '\\uF6AA',\n 'OpenInNewTab': '\\uF6AB',\n 'Hide3': '\\uF6AC',\n 'VerifiedBrandSolid': '\\uF6AD',\n 'MarkAsProtected': '\\uF6AE',\n 'AuthenticatorApp': '\\uF6B1',\n 'WebTemplate': '\\uF6B2',\n 'DefenderTVM': '\\uF6B3',\n 'MedalSolid': '\\uF6B9',\n 'D365TalentLearn': '\\uF6BB',\n 'D365TalentInsight': '\\uF6BC',\n 'D365TalentHRCore': '\\uF6BD',\n 'BacklogList': '\\uF6BF',\n 'ButtonControl': '\\uF6C0',\n 'TableGroup': '\\uF6D9',\n 'MountainClimbing': '\\uF6DB',\n 'TagUnknown': '\\uF6DF',\n 'TagUnknownMirror': '\\uF6E0',\n 'TagUnknown12': '\\uF6E1',\n 'TagUnknown12Mirror': '\\uF6E2',\n 'Link12': '\\uF6E3',\n 'Presentation': '\\uF6E4',\n 'Presentation12': '\\uF6E5',\n 'Lock12': '\\uF6E6',\n 'BuildDefinition': '\\uF6E9',\n 'ReleaseDefinition': '\\uF6EA',\n 'SaveTemplate': '\\uF6EC',\n 'UserGauge': '\\uF6ED',\n 'BlockedSiteSolid12': '\\uF70A',\n 'TagSolid': '\\uF70E',\n 'OfficeChat': '\\uF70F'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-10\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-10-c4ded8e4.woff') format('woff')\"\n },\n icons: {\n 'ViewListGroup': '\\uF248',\n 'ViewListTree': '\\uF249',\n 'TriggerAuto': '\\uF24A',\n 'TriggerUser': '\\uF24B',\n 'PivotChart': '\\uF24C',\n 'StackedBarChart': '\\uF24D',\n 'StackedLineChart': '\\uF24E',\n 'BuildQueue': '\\uF24F',\n 'BuildQueueNew': '\\uF250',\n 'UserFollowed': '\\uF25C',\n 'ContactLink': '\\uF25F',\n 'Stack': '\\uF26F',\n 'Bullseye': '\\uF272',\n 'VennDiagram': '\\uF273',\n 'FiveTileGrid': '\\uF274',\n 'FocalPoint': '\\uF277',\n 'Insert': '\\uF278',\n 'RingerRemove': '\\uF279',\n 'TeamsLogoInverse': '\\uF27A',\n 'TeamsLogo': '\\uF27B',\n 'TeamsLogoFill': '\\uF27C',\n 'SkypeForBusinessLogoFill': '\\uF27D',\n 'SharepointLogo': '\\uF27E',\n 'SharepointLogoFill': '\\uF27F',\n 'DelveLogo': '\\uF280',\n 'DelveLogoFill': '\\uF281',\n 'OfficeVideoLogo': '\\uF282',\n 'OfficeVideoLogoFill': '\\uF283',\n 'ExchangeLogo': '\\uF284',\n 'ExchangeLogoFill': '\\uF285',\n 'Signin': '\\uF286',\n 'DocumentApproval': '\\uF28B',\n 'CloneToDesktop': '\\uF28C',\n 'InstallToDrive': '\\uF28D',\n 'Blur': '\\uF28E',\n 'Build': '\\uF28F',\n 'ProcessMetaTask': '\\uF290',\n 'BranchFork2': '\\uF291',\n 'BranchLocked': '\\uF292',\n 'BranchCommit': '\\uF293',\n 'BranchCompare': '\\uF294',\n 'BranchMerge': '\\uF295',\n 'BranchPullRequest': '\\uF296',\n 'BranchSearch': '\\uF297',\n 'BranchShelveset': '\\uF298',\n 'RawSource': '\\uF299',\n 'MergeDuplicate': '\\uF29A',\n 'RowsGroup': '\\uF29B',\n 'RowsChild': '\\uF29C',\n 'Deploy': '\\uF29D',\n 'Redeploy': '\\uF29E',\n 'ServerEnviroment': '\\uF29F',\n 'VisioDiagram': '\\uF2A0',\n 'HighlightMappedShapes': '\\uF2A1',\n 'TextCallout': '\\uF2A2',\n 'IconSetsFlag': '\\uF2A4',\n 'VisioLogo': '\\uF2A7',\n 'VisioLogoFill': '\\uF2A8',\n 'VisioDocument': '\\uF2A9',\n 'TimelineProgress': '\\uF2AA',\n 'TimelineDelivery': '\\uF2AB',\n 'Backlog': '\\uF2AC',\n 'TeamFavorite': '\\uF2AD',\n 'TaskGroup': '\\uF2AE',\n 'TaskGroupMirrored': '\\uF2AF',\n 'ScopeTemplate': '\\uF2B0',\n 'AssessmentGroupTemplate': '\\uF2B1',\n 'NewTeamProject': '\\uF2B2',\n 'CommentAdd': '\\uF2B3',\n 'CommentNext': '\\uF2B4',\n 'CommentPrevious': '\\uF2B5',\n 'ShopServer': '\\uF2B6',\n 'LocaleLanguage': '\\uF2B7',\n 'QueryList': '\\uF2B8',\n 'UserSync': '\\uF2B9',\n 'UserPause': '\\uF2BA',\n 'StreamingOff': '\\uF2BB',\n 'ArrowTallUpLeft': '\\uF2BD',\n 'ArrowTallUpRight': '\\uF2BE',\n 'ArrowTallDownLeft': '\\uF2BF',\n 'ArrowTallDownRight': '\\uF2C0',\n 'FieldEmpty': '\\uF2C1',\n 'FieldFilled': '\\uF2C2',\n 'FieldChanged': '\\uF2C3',\n 'FieldNotChanged': '\\uF2C4',\n 'RingerOff': '\\uF2C5',\n 'PlayResume': '\\uF2C6',\n 'BulletedList2': '\\uF2C7',\n 'BulletedList2Mirrored': '\\uF2C8',\n 'ImageCrosshair': '\\uF2C9',\n 'GitGraph': '\\uF2CA',\n 'Repo': '\\uF2CB',\n 'RepoSolid': '\\uF2CC',\n 'FolderQuery': '\\uF2CD',\n 'FolderList': '\\uF2CE',\n 'FolderListMirrored': '\\uF2CF',\n 'LocationOutline': '\\uF2D0',\n 'POISolid': '\\uF2D1',\n 'CalculatorNotEqualTo': '\\uF2D2',\n 'BoxSubtractSolid': '\\uF2D3'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-10\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-10-c4ded8e4.woff') format('woff')\"\n },\n icons: {\n 'ViewListGroup': '\\uF248',\n 'ViewListTree': '\\uF249',\n 'TriggerAuto': '\\uF24A',\n 'TriggerUser': '\\uF24B',\n 'PivotChart': '\\uF24C',\n 'StackedBarChart': '\\uF24D',\n 'StackedLineChart': '\\uF24E',\n 'BuildQueue': '\\uF24F',\n 'BuildQueueNew': '\\uF250',\n 'UserFollowed': '\\uF25C',\n 'ContactLink': '\\uF25F',\n 'Stack': '\\uF26F',\n 'Bullseye': '\\uF272',\n 'VennDiagram': '\\uF273',\n 'FiveTileGrid': '\\uF274',\n 'FocalPoint': '\\uF277',\n 'Insert': '\\uF278',\n 'RingerRemove': '\\uF279',\n 'TeamsLogoInverse': '\\uF27A',\n 'TeamsLogo': '\\uF27B',\n 'TeamsLogoFill': '\\uF27C',\n 'SkypeForBusinessLogoFill': '\\uF27D',\n 'SharepointLogo': '\\uF27E',\n 'SharepointLogoFill': '\\uF27F',\n 'DelveLogo': '\\uF280',\n 'DelveLogoFill': '\\uF281',\n 'OfficeVideoLogo': '\\uF282',\n 'OfficeVideoLogoFill': '\\uF283',\n 'ExchangeLogo': '\\uF284',\n 'ExchangeLogoFill': '\\uF285',\n 'Signin': '\\uF286',\n 'DocumentApproval': '\\uF28B',\n 'CloneToDesktop': '\\uF28C',\n 'InstallToDrive': '\\uF28D',\n 'Blur': '\\uF28E',\n 'Build': '\\uF28F',\n 'ProcessMetaTask': '\\uF290',\n 'BranchFork2': '\\uF291',\n 'BranchLocked': '\\uF292',\n 'BranchCommit': '\\uF293',\n 'BranchCompare': '\\uF294',\n 'BranchMerge': '\\uF295',\n 'BranchPullRequest': '\\uF296',\n 'BranchSearch': '\\uF297',\n 'BranchShelveset': '\\uF298',\n 'RawSource': '\\uF299',\n 'MergeDuplicate': '\\uF29A',\n 'RowsGroup': '\\uF29B',\n 'RowsChild': '\\uF29C',\n 'Deploy': '\\uF29D',\n 'Redeploy': '\\uF29E',\n 'ServerEnviroment': '\\uF29F',\n 'VisioDiagram': '\\uF2A0',\n 'HighlightMappedShapes': '\\uF2A1',\n 'TextCallout': '\\uF2A2',\n 'IconSetsFlag': '\\uF2A4',\n 'VisioLogo': '\\uF2A7',\n 'VisioLogoFill': '\\uF2A8',\n 'VisioDocument': '\\uF2A9',\n 'TimelineProgress': '\\uF2AA',\n 'TimelineDelivery': '\\uF2AB',\n 'Backlog': '\\uF2AC',\n 'TeamFavorite': '\\uF2AD',\n 'TaskGroup': '\\uF2AE',\n 'TaskGroupMirrored': '\\uF2AF',\n 'ScopeTemplate': '\\uF2B0',\n 'AssessmentGroupTemplate': '\\uF2B1',\n 'NewTeamProject': '\\uF2B2',\n 'CommentAdd': '\\uF2B3',\n 'CommentNext': '\\uF2B4',\n 'CommentPrevious': '\\uF2B5',\n 'ShopServer': '\\uF2B6',\n 'LocaleLanguage': '\\uF2B7',\n 'QueryList': '\\uF2B8',\n 'UserSync': '\\uF2B9',\n 'UserPause': '\\uF2BA',\n 'StreamingOff': '\\uF2BB',\n 'ArrowTallUpLeft': '\\uF2BD',\n 'ArrowTallUpRight': '\\uF2BE',\n 'ArrowTallDownLeft': '\\uF2BF',\n 'ArrowTallDownRight': '\\uF2C0',\n 'FieldEmpty': '\\uF2C1',\n 'FieldFilled': '\\uF2C2',\n 'FieldChanged': '\\uF2C3',\n 'FieldNotChanged': '\\uF2C4',\n 'RingerOff': '\\uF2C5',\n 'PlayResume': '\\uF2C6',\n 'BulletedList2': '\\uF2C7',\n 'BulletedList2Mirrored': '\\uF2C8',\n 'ImageCrosshair': '\\uF2C9',\n 'GitGraph': '\\uF2CA',\n 'Repo': '\\uF2CB',\n 'RepoSolid': '\\uF2CC',\n 'FolderQuery': '\\uF2CD',\n 'FolderList': '\\uF2CE',\n 'FolderListMirrored': '\\uF2CF',\n 'LocationOutline': '\\uF2D0',\n 'POISolid': '\\uF2D1',\n 'CalculatorNotEqualTo': '\\uF2D2',\n 'BoxSubtractSolid': '\\uF2D3'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "icons () {\n return require('@packages/icons')\n }", "function update_icon()\n {\n const icon = bookmarks.is_unlocked() ? \"unlocked-bookmarks.svg\" :\n \"locked-bookmarks.svg\";\n const path = `/icons/main/${icon}`;\n browser.browserAction.setIcon({\n path:\n {\n \"16\": path,\n \"32\": path,\n \"48\": path,\n \"64\": path,\n \"96\": path,\n \"128\": path,\n \"256\": path\n }\n });\n }", "async function getIcon(name) {\n return { path: BHA_ICONS_MAP[name] };\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-16\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-16-9cf93f3b.woff') format('woff')\"\n },\n icons: {\n 'OfficeChatSolid': '\\uF710',\n 'MailSchedule': '\\uF72E',\n 'WarningSolid': '\\uF736',\n 'Blocked2Solid': '\\uF737',\n 'SkypeCircleArrow': '\\uF747',\n 'SkypeArrow': '\\uF748',\n 'SyncStatus': '\\uF751',\n 'SyncStatusSolid': '\\uF752',\n 'ProjectDocument': '\\uF759',\n 'ToDoLogoOutline': '\\uF75B',\n 'VisioOnlineLogoFill32': '\\uF75F',\n 'VisioOnlineLogo32': '\\uF760',\n 'VisioOnlineLogoCloud32': '\\uF761',\n 'VisioDiagramSync': '\\uF762',\n 'Event12': '\\uF763',\n 'EventDateMissed12': '\\uF764',\n 'UserOptional': '\\uF767',\n 'ResponsesMenu': '\\uF768',\n 'DoubleDownArrow': '\\uF769',\n 'DistributeDown': '\\uF76A',\n 'BookmarkReport': '\\uF76B',\n 'FilterSettings': '\\uF76C',\n 'GripperDotsVertical': '\\uF772',\n 'MailAttached': '\\uF774',\n 'AddIn': '\\uF775',\n 'LinkedDatabase': '\\uF779',\n 'TableLink': '\\uF77A',\n 'PromotedDatabase': '\\uF77D',\n 'BarChartVerticalFilter': '\\uF77E',\n 'BarChartVerticalFilterSolid': '\\uF77F',\n 'MicOff2': '\\uF781',\n 'MicrosoftTranslatorLogo': '\\uF782',\n 'ShowTimeAs': '\\uF787',\n 'FileRequest': '\\uF789',\n 'WorkItemAlert': '\\uF78F',\n 'PowerBILogo16': '\\uF790',\n 'PowerBILogoBackplate16': '\\uF791',\n 'BulletedListText': '\\uF792',\n 'BulletedListBullet': '\\uF793',\n 'BulletedListTextMirrored': '\\uF794',\n 'BulletedListBulletMirrored': '\\uF795',\n 'NumberedListText': '\\uF796',\n 'NumberedListNumber': '\\uF797',\n 'NumberedListTextMirrored': '\\uF798',\n 'NumberedListNumberMirrored': '\\uF799',\n 'RemoveLinkChain': '\\uF79A',\n 'RemoveLinkX': '\\uF79B',\n 'FabricTextHighlight': '\\uF79C',\n 'ClearFormattingA': '\\uF79D',\n 'ClearFormattingEraser': '\\uF79E',\n 'Photo2Fill': '\\uF79F',\n 'IncreaseIndentText': '\\uF7A0',\n 'IncreaseIndentArrow': '\\uF7A1',\n 'DecreaseIndentText': '\\uF7A2',\n 'DecreaseIndentArrow': '\\uF7A3',\n 'IncreaseIndentTextMirrored': '\\uF7A4',\n 'IncreaseIndentArrowMirrored': '\\uF7A5',\n 'DecreaseIndentTextMirrored': '\\uF7A6',\n 'DecreaseIndentArrowMirrored': '\\uF7A7',\n 'CheckListText': '\\uF7A8',\n 'CheckListCheck': '\\uF7A9',\n 'CheckListTextMirrored': '\\uF7AA',\n 'CheckListCheckMirrored': '\\uF7AB',\n 'NumberSymbol': '\\uF7AC',\n 'Coupon': '\\uF7BC',\n 'VerifiedBrand': '\\uF7BD',\n 'ReleaseGate': '\\uF7BE',\n 'ReleaseGateCheck': '\\uF7BF',\n 'ReleaseGateError': '\\uF7C0',\n 'M365InvoicingLogo': '\\uF7C1',\n 'RemoveFromShoppingList': '\\uF7D5',\n 'ShieldAlert': '\\uF7D7',\n 'FabricTextHighlightComposite': '\\uF7DA',\n 'Dataflows': '\\uF7DD',\n 'GenericScanFilled': '\\uF7DE',\n 'DiagnosticDataBarTooltip': '\\uF7DF',\n 'SaveToMobile': '\\uF7E0',\n 'Orientation2': '\\uF7E1',\n 'ScreenCast': '\\uF7E2',\n 'ShowGrid': '\\uF7E3',\n 'SnapToGrid': '\\uF7E4',\n 'ContactList': '\\uF7E5',\n 'NewMail': '\\uF7EA',\n 'EyeShadow': '\\uF7EB',\n 'FabricFolderConfirm': '\\uF7FF',\n 'InformationBarriers': '\\uF803',\n 'CommentActive': '\\uF804',\n 'ColumnVerticalSectionEdit': '\\uF806',\n 'WavingHand': '\\uF807',\n 'ShakeDevice': '\\uF80A',\n 'SmartGlassRemote': '\\uF80B',\n 'Rotate90Clockwise': '\\uF80D',\n 'Rotate90CounterClockwise': '\\uF80E',\n 'CampaignTemplate': '\\uF811',\n 'ChartTemplate': '\\uF812',\n 'PageListFilter': '\\uF813',\n 'SecondaryNav': '\\uF814',\n 'ColumnVerticalSection': '\\uF81E',\n 'SkypeCircleSlash': '\\uF825',\n 'SkypeSlash': '\\uF826'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-16\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-16-9cf93f3b.woff') format('woff')\"\n },\n icons: {\n 'OfficeChatSolid': '\\uF710',\n 'MailSchedule': '\\uF72E',\n 'WarningSolid': '\\uF736',\n 'Blocked2Solid': '\\uF737',\n 'SkypeCircleArrow': '\\uF747',\n 'SkypeArrow': '\\uF748',\n 'SyncStatus': '\\uF751',\n 'SyncStatusSolid': '\\uF752',\n 'ProjectDocument': '\\uF759',\n 'ToDoLogoOutline': '\\uF75B',\n 'VisioOnlineLogoFill32': '\\uF75F',\n 'VisioOnlineLogo32': '\\uF760',\n 'VisioOnlineLogoCloud32': '\\uF761',\n 'VisioDiagramSync': '\\uF762',\n 'Event12': '\\uF763',\n 'EventDateMissed12': '\\uF764',\n 'UserOptional': '\\uF767',\n 'ResponsesMenu': '\\uF768',\n 'DoubleDownArrow': '\\uF769',\n 'DistributeDown': '\\uF76A',\n 'BookmarkReport': '\\uF76B',\n 'FilterSettings': '\\uF76C',\n 'GripperDotsVertical': '\\uF772',\n 'MailAttached': '\\uF774',\n 'AddIn': '\\uF775',\n 'LinkedDatabase': '\\uF779',\n 'TableLink': '\\uF77A',\n 'PromotedDatabase': '\\uF77D',\n 'BarChartVerticalFilter': '\\uF77E',\n 'BarChartVerticalFilterSolid': '\\uF77F',\n 'MicOff2': '\\uF781',\n 'MicrosoftTranslatorLogo': '\\uF782',\n 'ShowTimeAs': '\\uF787',\n 'FileRequest': '\\uF789',\n 'WorkItemAlert': '\\uF78F',\n 'PowerBILogo16': '\\uF790',\n 'PowerBILogoBackplate16': '\\uF791',\n 'BulletedListText': '\\uF792',\n 'BulletedListBullet': '\\uF793',\n 'BulletedListTextMirrored': '\\uF794',\n 'BulletedListBulletMirrored': '\\uF795',\n 'NumberedListText': '\\uF796',\n 'NumberedListNumber': '\\uF797',\n 'NumberedListTextMirrored': '\\uF798',\n 'NumberedListNumberMirrored': '\\uF799',\n 'RemoveLinkChain': '\\uF79A',\n 'RemoveLinkX': '\\uF79B',\n 'FabricTextHighlight': '\\uF79C',\n 'ClearFormattingA': '\\uF79D',\n 'ClearFormattingEraser': '\\uF79E',\n 'Photo2Fill': '\\uF79F',\n 'IncreaseIndentText': '\\uF7A0',\n 'IncreaseIndentArrow': '\\uF7A1',\n 'DecreaseIndentText': '\\uF7A2',\n 'DecreaseIndentArrow': '\\uF7A3',\n 'IncreaseIndentTextMirrored': '\\uF7A4',\n 'IncreaseIndentArrowMirrored': '\\uF7A5',\n 'DecreaseIndentTextMirrored': '\\uF7A6',\n 'DecreaseIndentArrowMirrored': '\\uF7A7',\n 'CheckListText': '\\uF7A8',\n 'CheckListCheck': '\\uF7A9',\n 'CheckListTextMirrored': '\\uF7AA',\n 'CheckListCheckMirrored': '\\uF7AB',\n 'NumberSymbol': '\\uF7AC',\n 'Coupon': '\\uF7BC',\n 'VerifiedBrand': '\\uF7BD',\n 'ReleaseGate': '\\uF7BE',\n 'ReleaseGateCheck': '\\uF7BF',\n 'ReleaseGateError': '\\uF7C0',\n 'M365InvoicingLogo': '\\uF7C1',\n 'RemoveFromShoppingList': '\\uF7D5',\n 'ShieldAlert': '\\uF7D7',\n 'FabricTextHighlightComposite': '\\uF7DA',\n 'Dataflows': '\\uF7DD',\n 'GenericScanFilled': '\\uF7DE',\n 'DiagnosticDataBarTooltip': '\\uF7DF',\n 'SaveToMobile': '\\uF7E0',\n 'Orientation2': '\\uF7E1',\n 'ScreenCast': '\\uF7E2',\n 'ShowGrid': '\\uF7E3',\n 'SnapToGrid': '\\uF7E4',\n 'ContactList': '\\uF7E5',\n 'NewMail': '\\uF7EA',\n 'EyeShadow': '\\uF7EB',\n 'FabricFolderConfirm': '\\uF7FF',\n 'InformationBarriers': '\\uF803',\n 'CommentActive': '\\uF804',\n 'ColumnVerticalSectionEdit': '\\uF806',\n 'WavingHand': '\\uF807',\n 'ShakeDevice': '\\uF80A',\n 'SmartGlassRemote': '\\uF80B',\n 'Rotate90Clockwise': '\\uF80D',\n 'Rotate90CounterClockwise': '\\uF80E',\n 'CampaignTemplate': '\\uF811',\n 'ChartTemplate': '\\uF812',\n 'PageListFilter': '\\uF813',\n 'SecondaryNav': '\\uF814',\n 'ColumnVerticalSection': '\\uF81E',\n 'SkypeCircleSlash': '\\uF825',\n 'SkypeSlash': '\\uF826'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-17\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-17-0c4ed701.woff') format('woff')\"\n },\n icons: {\n 'CustomizeToolbar': '\\uF828',\n 'DuplicateRow': '\\uF82A',\n 'RemoveFromTrash': '\\uF82B',\n 'MailOptions': '\\uF82C',\n 'Childof': '\\uF82D',\n 'Footer': '\\uF82E',\n 'Header': '\\uF82F',\n 'BarChartVerticalFill': '\\uF830',\n 'StackedColumnChart2Fill': '\\uF831',\n 'PlainText': '\\uF834',\n 'AccessibiltyChecker': '\\uF835',\n 'DatabaseSync': '\\uF842',\n 'ReservationOrders': '\\uF845',\n 'TabOneColumn': '\\uF849',\n 'TabTwoColumn': '\\uF84A',\n 'TabThreeColumn': '\\uF84B',\n 'BulletedTreeList': '\\uF84C',\n 'MicrosoftTranslatorLogoGreen': '\\uF852',\n 'MicrosoftTranslatorLogoBlue': '\\uF853',\n 'InternalInvestigation': '\\uF854',\n 'AddReaction': '\\uF85D',\n 'ContactHeart': '\\uF862',\n 'VisuallyImpaired': '\\uF866',\n 'EventToDoLogo': '\\uF869',\n 'Variable2': '\\uF86D',\n 'ModelingView': '\\uF871',\n 'DisconnectVirtualMachine': '\\uF873',\n 'ReportLock': '\\uF875',\n 'Uneditable2': '\\uF876',\n 'Uneditable2Mirrored': '\\uF877',\n 'BarChartVerticalEdit': '\\uF89D',\n 'GlobalNavButtonActive': '\\uF89F',\n 'PollResults': '\\uF8A0',\n 'Rerun': '\\uF8A1',\n 'QandA': '\\uF8A2',\n 'QandAMirror': '\\uF8A3',\n 'BookAnswers': '\\uF8A4',\n 'AlertSettings': '\\uF8B6',\n 'TrimStart': '\\uF8BB',\n 'TrimEnd': '\\uF8BC',\n 'TableComputed': '\\uF8F5',\n 'DecreaseIndentLegacy': '\\uE290',\n 'IncreaseIndentLegacy': '\\uE291',\n 'SizeLegacy': '\\uE2B2'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-17\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-17-0c4ed701.woff') format('woff')\"\n },\n icons: {\n 'CustomizeToolbar': '\\uF828',\n 'DuplicateRow': '\\uF82A',\n 'RemoveFromTrash': '\\uF82B',\n 'MailOptions': '\\uF82C',\n 'Childof': '\\uF82D',\n 'Footer': '\\uF82E',\n 'Header': '\\uF82F',\n 'BarChartVerticalFill': '\\uF830',\n 'StackedColumnChart2Fill': '\\uF831',\n 'PlainText': '\\uF834',\n 'AccessibiltyChecker': '\\uF835',\n 'DatabaseSync': '\\uF842',\n 'ReservationOrders': '\\uF845',\n 'TabOneColumn': '\\uF849',\n 'TabTwoColumn': '\\uF84A',\n 'TabThreeColumn': '\\uF84B',\n 'BulletedTreeList': '\\uF84C',\n 'MicrosoftTranslatorLogoGreen': '\\uF852',\n 'MicrosoftTranslatorLogoBlue': '\\uF853',\n 'InternalInvestigation': '\\uF854',\n 'AddReaction': '\\uF85D',\n 'ContactHeart': '\\uF862',\n 'VisuallyImpaired': '\\uF866',\n 'EventToDoLogo': '\\uF869',\n 'Variable2': '\\uF86D',\n 'ModelingView': '\\uF871',\n 'DisconnectVirtualMachine': '\\uF873',\n 'ReportLock': '\\uF875',\n 'Uneditable2': '\\uF876',\n 'Uneditable2Mirrored': '\\uF877',\n 'BarChartVerticalEdit': '\\uF89D',\n 'GlobalNavButtonActive': '\\uF89F',\n 'PollResults': '\\uF8A0',\n 'Rerun': '\\uF8A1',\n 'QandA': '\\uF8A2',\n 'QandAMirror': '\\uF8A3',\n 'BookAnswers': '\\uF8A4',\n 'AlertSettings': '\\uF8B6',\n 'TrimStart': '\\uF8BB',\n 'TrimEnd': '\\uF8BC',\n 'TableComputed': '\\uF8F5',\n 'DecreaseIndentLegacy': '\\uE290',\n 'IncreaseIndentLegacy': '\\uE291',\n 'SizeLegacy': '\\uE2B2'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function toggleIcon(grayedOut) {\n\t\tvar head = top.document.getElementsByTagName(\"head\");\n\t\tif (head) {\n\t\t\tvar icon = document.createElement('link');\n\t\t\ticon.type = 'image/x-icon';\n\t\t\ticon.rel = 'shortcut icon';\n\n\t\t\tif (grayedOut) {\n\t\t\t\t// Grayscale.\n\t\t\t\ticon.href = 'data:image/x-icon;base64,AAABAAQAICAAAAEACACoCAAARgAAABAQAAABAAgAaAUAAO4IAAAgIAAAAQAgAKgQAABWDgAAEBAAAAEAIABoBAAA/h4AACgAAAAgAAAAQAAAAAEACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQIBAAYEAwAAAgQABQUFAAkCAQAMBgMAAAYJAAkJCQAODAoADQ0OAAALEgAGDBEAAg4XAAAPGQAAEh4AEhISABQTEwAWFhYAGRkZAB4eHgAADiAAABQiAA0YIAAUHCIACSM0ACEhIQAkJCQAKSkpAC4uLgA2Mi8AMjIyADY2NgA5OTkAPT09AAAtSwAIMU0AADFRAAA4XQAAQGwAG0xsAABEcAAPSnIAAEx/AEFBQQBFRUUASEZFAElJSQBNTU0AUVFRAFVVVQBaWloAXV1dAGFiYgBlZWUAaWlpAG5ubgBxcXEAdXV1AHl5eQB9fX0AAE+FAABVjQAQVYMAGlyIAABYkwAOXZEACF2WAABdmwAAX58AGmOUAAZjoQARaqQAGWuhAAByvgAJeMIAAHvNABJ+xgAcf8MAAYHXAAeC1AAKg9UAAIbcABWV3gAAieMAAIrkAAiW8QAAl/gAAJf/AACZ/gAEmP8AAJ3/AAua+gAAof8ABaH/AASk/wAMo/8ACKT/AGbH/wB/zP8AgYGBAIWFhQCHiIgAiIiIAI2NjQCRkZEAlZWVAJmZmQCenp4AoaGhAKWlpQCoqKgAra2tAKyusACxsbIAtra2ALm5uQC9vb0AuOb/AMHBwQDGxsYAycnJAM/MywDPz88A0tLSANTU1ADZ2dkA3d3dAN/g4ADj4+MA6enpAPHx8QD09PQA+fn5AP7+/gDwwwAA/9IRAP/YMQD/3VEA/+RxAP/qkQD/8LEA//bRAP///wAAAAAALxQAAFAiAABwMAAAkD4AALBNAADPWwAA8GkAAP95EQD/ijEA/51RAP+vcQD/wZEA/9KxAP/l0QD///8AAAAAAC8DAABQBAAAcAYAAJAJAACwCgAAzwwAAPAOAAD/IBIA/z4xAP9cUQD/enEA/5eRAP+2sQD/1NEA////AAAAAAAvAA4AUAAXAHAAIQCQACsAsAA2AM8AQADwAEkA/xFaAP8xcAD/UYYA/3GcAP+RsgD/scgA/9HfAP///wAAAAAALwAgAFAANgBwAEwAkABiALAAeADPAI4A8ACkAP8RswD/Mb4A/1HHAP9x0QD/kdwA/7HlAP/R8AD///8AAAAAACwALwBLAFAAaQBwAIcAkAClALAAxADPAOEA8ADwEf8A8jH/APRR/wD2cf8A95H/APmx/wD70f8A////AAAAAAAbAC8ALQBQAD8AcABSAJAAYwCwAHYAzwCIAPAAmRH/AKYx/wC0Uf8AwnH/AM+R/wDcsf8A69H/AP///wAAAAAACAAvAA4AUAAVAHAAGwCQACEAsAAmAM8ALADwAD4R/wBYMf8AcVH/AIxx/wCmkf8Av7H/ANrR/wD///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8PAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAaCAAAAAAAAAAACBswAAAAAAAAAAAAAAAAAAAALAgAAAAAAAAAAAAAAAAAAAAACCwAAAAAAAAAAAAAHQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAfAAAAAAAAMAAAAAAAAAAAAAAAADhkAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAhhIUwAAAAAAAAAAAAAAAALwAAAAAAABQAAAAAAAAACnyPj34aAAAAAAAAAA8DAAAAADMBAAAhfzsEAAAAAABoj4+Pj2sAAAAAAAAnUiMAAAAyLAQACHiPj2wQAAAAMoaPj4+EMAAAAAAHQVtdTAsAACEsBAE8j4+Pj28IABqBj4+PjzkAAAAAA0RbW1lbPgMAISwDCniPj4+Pj2kKb4+Pj49wAgAAAAA9W1lZW19RDQAhLAQDE2qPj4+PhXeFj4+PfRIAAAAAKVtbWVthSBcBACEsBAAAADmGj4+Pj4+Pj4MgAAAAACVXW1lZXj8CAAAAIS8IAAAAADyPj4+Pj4+POQAAAAAWVVtYW15CAQAAAAAhMREKBAIAAGiPj4+Pj20DAAAAB0pbWVlbRwIAAAAAACEzGxMRCgQDaY+Pj4+PbQMAAABBXVlZWVtFAwAAAAAAITYfHBoTCWWPj4+Pj4+GOAAAJltbWVlZWVs+AAAAAAAhOS0hHRtlho+Pj4+Pj4+CHhVVW1lZW1tYW1krAwAAACE7My8ycI+Pj4+PeYaPj496TltZWVtNXFtZW1lFFgMAIWY3N3+Pj4+Pj3AcdI+Pj492WlhdSwpAYVlZW1tPDgAhaTw5dI+Pj494LRwwgo+Pj49jWVYZAAhJYVlZX0MBACFsamdkgI+PeTQvLyA8ho+Pj4ZiKgUEAAhGYF9QDAAAIXRvbGlvg3U6NzY0MS9wj4+Pj3ESERAIAgYoUyQAAAA2AHBybmxuaGVkOzg3MzWAj4+CLhsbFBMQCQYYBAAAAwAAeHR1cm9tbGpoZDs6NmaFj2QiIiAdHBoTEQkICAQ4AAAAfHR4d3Nxbm1raWdkOXJ0MzIxLywhHx0bGhMaZgAAAAAAAHl1eHd1c3BtbGpoZDw5ODUzMjAtLCAdZAAAAAAAAAAAAAB9d3V1dXRyb21raGdkOzk3NDI2bgAAAAAAAAAAAAAAAAAAAH55dXJycG5sa2hnaG13AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////n///4AB//wAAD/wAAAPwAAAA4AAAAGAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAGAAAABwAAAA/AAAA/8AAA//4AB////////////KAAAABAAAAAgAAAAAQAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQoABAcKAAAFDgAACA0ACAgIAAgKDAAPDw8AEhAOABQQDQAADhgAAhAZABAQEAAWEhAAEBQXABUVFQAZGRkAHx4dAAAYKAAMHywAJSUlACkpKQAvLy8AMjIyADY2NgA5OTkAPDw8AAArSAACOV4ABTteAAk+YgAAR3YAAEt9AAZPfwAKTnoAQEBAAEdHRwBMR0MASEhIAFJSUgBWVlYAWVlZAF1dXQBiYmIAZmZmAGpqagBycnIAdXV1AHl5eQABXp8AD2afAABkqAAAa7EAEHO0AEeDrAAAg9kAB4neAACb+wAAmf0ABZn8AAGd/gAAof8AAaX/AHLL/wCDg4MAh4eHAJGRkQCXl5cAmZmZAKGhoQCkpKQAqqelAK2trQCxsbEAtbW1ALq6ugDDw8MAycnJAM7OzgDV1dUA2traAN3d3QDk5OQA7OztAPLw7wD09PQA+vr6APj//wD+/v4APf8xAFv/UQB5/3EAmP+RALX/sQDU/9EA////AAAAAAAULwAAIlAAADBwAAA9kAAATLAAAFnPAABn8AAAeP8RAIr/MQCc/1EArv9xAMD/kQDS/7EA5P/RAP///wAAAAAAJi8AAEBQAABacAAAdJAAAI6wAACpzwAAwvAAANH/EQDY/zEA3v9RAOP/cQDp/5EA7/+xAPb/0QD///8AAAAAAC8mAABQQQAAcFsAAJB0AACwjgAAz6kAAPDDAAD/0hEA/9gxAP/dUQD/5HEA/+qRAP/wsQD/9tEA////AAAAAAAvFAAAUCIAAHAwAACQPgAAsE0AAM9bAADwaQAA/3kRAP+KMQD/nVEA/69xAP/BkQD/0rEA/+XRAP///wAAAAAALwMAAFAEAABwBgAAkAkAALAKAADPDAAA8A4AAP8gEgD/PjEA/1xRAP96cQD/l5EA/7axAP/U0QD///8AAAAAAC8ADgBQABcAcAAhAJAAKwCwADYAzwBAAPAASQD/EVoA/zFwAP9RhgD/cZwA/5GyAP+xyAD/0d8A////AAAAAAAvACAAUAA2AHAATACQAGIAsAB4AM8AjgDwAKQA/xGzAP8xvgD/UccA/3HRAP+R3AD/seUA/9HwAP///wAAAAAALAAvAEsAUABpAHAAhwCQAKUAsADEAM8A4QDwAPAR/wDyMf8A9FH/APZx/wD3kf8A+bH/APvR/wD///8AAAAAABsALwAtAFAAPwBwAFIAkABjALAAdgDPAIgA8ACZEf8ApjH/ALRR/wDCcf8Az5H/ANyx/wDr0f8A////AAAAAAAIAC8ADgBQABUAcAAbAJAAIQCwACYAzwAsAPAAPhH/AFgx/wBxUf8AjHH/AKaR/wC/sf8A2tH/AP///wAAAAAAADApJiYpMAAAAAAAAAAAFQAAAAAAAAAAFQAAAAAWAAAAAAAnKQAAAAAAFgApABQMAAAPUlMUAAABEgApFA9PSgwARF9VGAAENDcKFBQoX19GKV9fLQAAMz4+HRQVBS5YX1ZfSAAAID48IgIUGAIAMF9fURAAGzk9IQAAFCYQADBfX1ENAzc9PCAAABQrGkFWX1ZfRzE9Ozw5HwEUMENfX0svWF8/Oh4yPj4cFERCU1AqGUlfVzYABjU4CxRORkhCLywsU1QlEAgOEwAsAE5KSEVCMEZEJCMXEQkoAAAAAE5LSUZCQC8rKEAAAAAAAAAAAABQTkxNAAAAAAAA+B8AAOAHAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIABAADgBwAA/D8AACgAAAAgAAAAQAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWAAAAMgAAAFIAAABrAAAAfAAAAIEAAACBAAAAfAAAAGsAAABSAAAAMgAAABYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAADMAAAB2AAAAsQAAAN0AAAD4AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD4AAAA3QAAALEAAAB2AAAAMwAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAGcAAAC+AAAA9gAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD2AAAAvgAAAGcAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAFsAAADQAAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8BAQH/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAANAAAABbAAAABQAAAAAAAAAAAAAAAAAAABsAAACxAAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/bm5u/39/f/8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAACxAAAAGwAAAAAAAAAJAAAAtAAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/zo6Ov/09PT/+Pj4/0xMTP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAC0AAAACQAAAFkBAQH/AAAA/wAAAP8AAAD/Hx8f/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8PDw//z8/P////////////2dnZ/yAgIP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/ABIe/wACA/8AAAD/AAAA/wAAAP8AAABZBQUFqAMDA/8AAAD/AAAA/zk5Of/c3Nz/eHh4/wUFBf8AAAD/AAAA/wAAAP8AAAD/AAAA/4+Pj///////////////////////l5eX/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wBAbP8Ahtz/AC1L/wAAAP8AAAD/AAAA/wAAAKgKCgrGBAQE/wAAAP8JCQn/w8PD////////////n5+f/w8PD/8AAAD/AAAA/wAAAP9VVVX/+/v7//////////////////T09P9LS0v/AAAA/wAAAP8AAAD/AAAA/wAFCP8AWJP/AJz//wCh//8Ae83/AAsS/wAAAP8AAAD/AAAAxgoKCsUEBAT/AQEB/35+fv//////////////////////qKio/wkJCf8AAAD/ICAg/+Pj4///////////////////////cHBw/wAAAP8AAAD/AAAA/wAAAP8AAQH/AF2b/wCf//8Am///AJn//wCe//8AVY7/AAIE/wAAAP8AAADFCgoKxQICAv8MDAz/x8fH////////////////////////////kJCQ/w0NDf+np6f//////////////////////6ysrP8EBAT/AAAA/wAAAP8AAAD/AAAA/wBPhf8Anf//AJr//wCZ//8Amv//BKT//wqD1f8CDhf/AAAA/wAAAMUKCgrFBAQE/wEBAf8aGhr/lZWV///////////////////////6+vr/wcHB//r6+v/////////////////U1NT/FxcX/wAAAP8AAAD/AAAA/wAAAP8ARHD/AJz//wCb//8Amf//AJv//wai//8RaqT/DRgg/wIBAf8AAAD/AAAAxQsLC8UFBQX/AAAA/wAAAP8AAAD/cXFx//z8/P//////////////////////////////////////8fHx/zc3N/8AAAD/AAAA/wAAAP8AAAD/ADFR/wCX+P8AnP//AJn//wCa//8Gof//EFWD/wgDAv8AAAD/AAAA/wAAAP8AAADFExMTxQkJCf8BAQH/AAAA/wAAAP8AAAD/fX19//////////////////////////////////////9ycnL/AAAA/wAAAP8AAAD/AAAA/wAVI/8AieP/AJ7//wCZ//8Amv//BaL//w5dkf8GAQD/AAAA/wAAAP8AAAD/AAAA/wAAAMUeHh7GFBQU/wsLC/8GBgb/AwMD/wAAAP8AAAD/jY2N////////////////////////////o6Oj/wEBAf8AAAD/AAAA/wAAAP8ABwv/AHK+/wCf//8Amf//AJn//wCf//8GY6H/BgQD/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAAxSwsLMcjIyP/GBgY/xMTE/8ODg7/BgYG/wICAv+RkZH///////////////////////////+hoaH/AgIC/wAAAP8AAAD/AAAA/wBYk/8AoP//AJr//wCZ//8Amf//AJ7//wBfn/8AAgP/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAADFOjo6yDMzM/8oKCj/IiIi/xgYGP8LCwv/hYWF//////////////////////////////////39/f9ubm7/AAAA/wAAAP8AOF3/AJv+/wCb//8Amf//AJn//wCZ//8Amf//AJv//wBVjP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAMVJSUnIRERE/zk5Of8sLCz/JCQk/4WFhf/8/Pz//////////////////////////////////////+rq6v82Mi//AA4g/wCK5P8Anf//AJn//wCZ//8An///AJr//wCZ//8Am///AJn8/wBMf/8AAQL/AAAA/wAAAP8AAAD/AAAAxVlZWcpYWFj/S0tL/1RUVP+tra3////////////////////////////Ly8v//Pz8/////////////////8/My/8cf8P/AJv//wCZ//8Amf//A5z//xJ+xv8Lmvr/AJv//wCZ//8Am///AJr//wBfn/8AFCH/AAID/wAAAP8AAADFaGhoy2pqav9oaGj/3d3d////////////////////////////rq6u/ygoKP+4uLj//////////////////////7jm//8EmP//AJf//wCh//8JeML/Dg0P/xpciP8JpP//AJr//wCZ//8Am///AJ7//wGB1/8ADxn/AAAA/wAAAMV4eHjNfn5+/3BwcP+4uLj//////////////////////8fHx/9ERET/KSkp/01NTf/p6en//////////////////////3/M//8Amv//CJbx/wkjNP8AAAD/CwkJ/xlrof8Ipf//AJr//wCZ//8Co///CF2W/wICA/8AAAD/AAAAxoeHh8yUlJT/hoaG/4ODg//f39/////////////IyMj/Xl5e/0tLS/9ISEj/Nzc3/319ff/8/Pz//////////////////P7//2bH//8PSnL/CgEA/wQEBP8BAAD/CwkI/xpjlP8Mo///AKP//weC1P8GDBH/AAAA/wAAAP8AAADEkpKSpqioqP+cnJz/kJCQ/6ioqP/x8fH/vb29/3V1df9oaGj/ZWVl/1xcXP9TU1P/R0dH/66urv//////////////////////rK6w/xcXF/8UExP/EBAQ/wsLC/8FAwP/DAYD/xtMbP8Vld7/CDFN/wAAAP8AAAD/AAAA/wAAAJqwsLBQqqqq/7Kysv+mpqb/n5+f/6SkpP+MjIz/hoaG/4CAgP94eHj/b29v/2dnZ/9bW1v/YGFh/9/g4P///////////+jo6P9IRkX/JSUk/yQkJP8dHR3/GBgY/xISEv8LCgr/DQcD/xQcIv8FBQX/AAAA/wAAAP8AAAD+AAAAQenp6QWoqKiju7u7/7y8vP+xsbH/qKio/6Kiov+bm5v/k5OT/4uLi/+Dg4P/e3t7/3Nzc/9lZWX/h4iI//j5+f/+/v7/gYGB/zs7O/88PDz/NTU1/y4uLv8nJyf/ICAg/xoaGv8TExP/DgwK/woKCf8ICAj/BgYG/wMDA5MAAAABAAAAAOPj4w+0tLSXubm5+MTExP+/v7//tra2/6+vr/+np6f/oKCg/5iYmP+QkJD/iIiI/4CAgP9ycnL/srKz/7e3t/9aWlr/V1dX/1BQUP9ISEj/QUFB/zk5Of8yMjL/Kysr/yQkJP8hISH/Gxsb/xcXF/IeHh6HBgYGBwAAAAAAAAAAAAAAAAAAAADOzs49tLS0sry8vP/Gxsb/w8PD/7u7u/+zs7P/q6ur/6Ojo/+bm5v/lJSU/4yMjP+Dg4P/fHx8/3Jycv9ra2v/Y2Nj/1tbW/9TU1P/TU1N/0ZGRv8/Pz//Nzc3/ywsLPs6OjqkdXV1MAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADu7u4Dz8/PSLy8vKG6urrlvr6+/7+/v/+9vb3/uLi4/7CwsP+oqKj/oKCg/5eXl/+Pj4//iIiI/4GBgf95eXn/cXFx/2lpaf9eXl7/VFRU/1JSUt9mZmaWmZmZPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOPj4xrOzs5Wv7+/kri4uMK1tbXmsrKy+a+vr/+srKz/pqam/5+fn/+YmJj/jo6O/4WFhfiAgIDjgYGBvY2NjYqqqqpNz8/PEwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8fHxBebm5hja2towzs7OScbGxlrGxsZfwsLCXsDAwFjFxcVH0dHRLN/f3xXu7u4CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////AA//8AAA/8AAAD8AAAAOAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAB4AAAB/AAAB/+AAB//8AD//////8oAAAAEAAAACAAAAABACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAEsAAACEAAAApwAAALcAAAC3AAAApwAAAIQAAABLAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAdQAAANYAAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAANYAAAB1AAAAEAAAAAAAAAApAAAA0AAAAP8AAAD/AAAA/wAAAP8AAAD/UlJS/1paWv8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAANAAAAApAQEBpgAAAP8mJib/Dw8P/wAAAP8AAAD/FhYW/+Tk5P/t7e3/JCQk/wAAAP8AAAD/AAYL/wAYKP8AAAD/AAAApgICAtoUFBT/1dXV/7e3t/8QEBD/AAAA/5qamv//////9PT0/zMzM/8AAAD/AAgN/wBrsf8Ag9r/AA4Y/wAAANoAAADbVVVV////////////pKSk/1paWv/+/v7//////2pqav8AAAD/AAID/wBkqP8Apf//A6X//wU7Xv8AAADbBQUF2ggICP9ycnL//Pz8///////6+vr//////66urv8CAgL/AAAA/wBLff8Aov//A57+/wpOev8EBwr/AAAA2hQUFNoDAwP/AAAA/3Z2dv///////////93d3f8XFxf/AAAA/wArSP8Am/v/AKH//wZPf/8CAAD/AAAA/wAAANotLS3cGRkZ/wMDA/94eHj////////////b29v/FhIQ/wAFDv8Ag9n/AKH//wCe//8AS33/AAAA/wAAAP8AAADaS0tL3Tw8PP+Hh4f/+/v7///////7+/v//////6qnpf8BXp//AKD//wWZ/P8Cnf//AJr8/wBHdv8ABQn/AAAA2mVlZd+Xl5f///////////+5ubn/dnZ2//39/f//////csv//wCY//8JPmL/D2af/wKm//8Aov//Ajle/wAAANuLi4vdkpKS/+zs7P/Y2Nj/XV1d/zk5Of+zs7P///////j///9Hg6z/AAAA/wgKDP8Qc7T/B4ne/wIQGf8AAADYsLCwoaampv+tra3/kJCQ/3Z2dv9lZWX/Z2dn/+3t7v/y8O//TEdD/xoaGf8SEA7/EBQX/wwfLP8AAAD/AAAAmefn5yK+vr7EtLS0/62trf+goKD/kJCQ/3h4eP+jo6P/mZmZ/0dHR/9AQED/MTEx/x8eHf8UEA3/GxsbvQMDAxwAAAAA9PT0CNbW1mPDw8PIurq6+7CwsP+kpKT/k5OT/4ODg/90dHT/YWFh/1RUVPpdXV3Dj4+PXHt7ewUAAAAAAAAAAAAAAAAAAAAA9vb2BePj4znS0tJzw8PDmbi4uKupqamxp6enm7KysnDNzc018/PzAwAAAAAAAAAAAAAAAOAHrEGAAaxBAACsQQAArEEAAKxBAACsQQAArEEAAKxBAACsQQAArEEAAKxBAACsQQAArEEAAKxBgAGsQeAHrEE=';\n\t\t\t} else {\n\t\t\t\t// Color.\n\t\t\t\ticon.href = 'data:image/x-icon;base64,AAABAAQAICAAAAEACACoCAAARgAAABAQAAABAAgAaAUAAO4IAAAgIAAAAQAgAKgQAABWDgAAEBAAAAEAIABoBAAA/h4AACgAAAAgAAAAQAAAAAEACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQIBAAYEAwAAAgQABQUFAAkCAQAMBgMAAAYJAAkJCQAODAoADQ0OAAALEgAGDBEAAg4XAAAPGQAAEh4AEhISABQTEwAWFhYAGRkZAB4eHgAADiAAABQiAA0YIAAUHCIACSM0ACEhIQAkJCQAKSkpAC4uLgA2Mi8AMjIyADY2NgA5OTkAPT09AAAtSwAIMU0AADFRAAA4XQAAQGwAG0xsAABEcAAPSnIAAEx/AEFBQQBFRUUASEZFAElJSQBNTU0AUVFRAFVVVQBaWloAXV1dAGFiYgBlZWUAaWlpAG5ubgBxcXEAdXV1AHl5eQB9fX0AAE+FAABVjQAQVYMAGlyIAABYkwAOXZEACF2WAABdmwAAX58AGmOUAAZjoQARaqQAGWuhAAByvgAJeMIAAHvNABJ+xgAcf8MAAYHXAAeC1AAKg9UAAIbcABWV3gAAieMAAIrkAAiW8QAAl/gAAJf/AACZ/gAEmP8AAJ3/AAua+gAAof8ABaH/AASk/wAMo/8ACKT/AGbH/wB/zP8AgYGBAIWFhQCHiIgAiIiIAI2NjQCRkZEAlZWVAJmZmQCenp4AoaGhAKWlpQCoqKgAra2tAKyusACxsbIAtra2ALm5uQC9vb0AuOb/AMHBwQDGxsYAycnJAM/MywDPz88A0tLSANTU1ADZ2dkA3d3dAN/g4ADj4+MA6enpAPHx8QD09PQA+fn5AP7+/gDwwwAA/9IRAP/YMQD/3VEA/+RxAP/qkQD/8LEA//bRAP///wAAAAAALxQAAFAiAABwMAAAkD4AALBNAADPWwAA8GkAAP95EQD/ijEA/51RAP+vcQD/wZEA/9KxAP/l0QD///8AAAAAAC8DAABQBAAAcAYAAJAJAACwCgAAzwwAAPAOAAD/IBIA/z4xAP9cUQD/enEA/5eRAP+2sQD/1NEA////AAAAAAAvAA4AUAAXAHAAIQCQACsAsAA2AM8AQADwAEkA/xFaAP8xcAD/UYYA/3GcAP+RsgD/scgA/9HfAP///wAAAAAALwAgAFAANgBwAEwAkABiALAAeADPAI4A8ACkAP8RswD/Mb4A/1HHAP9x0QD/kdwA/7HlAP/R8AD///8AAAAAACwALwBLAFAAaQBwAIcAkAClALAAxADPAOEA8ADwEf8A8jH/APRR/wD2cf8A95H/APmx/wD70f8A////AAAAAAAbAC8ALQBQAD8AcABSAJAAYwCwAHYAzwCIAPAAmRH/AKYx/wC0Uf8AwnH/AM+R/wDcsf8A69H/AP///wAAAAAACAAvAA4AUAAVAHAAGwCQACEAsAAmAM8ALADwAD4R/wBYMf8AcVH/AIxx/wCmkf8Av7H/ANrR/wD///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8PAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAaCAAAAAAAAAAACBswAAAAAAAAAAAAAAAAAAAALAgAAAAAAAAAAAAAAAAAAAAACCwAAAAAAAAAAAAAHQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAfAAAAAAAAMAAAAAAAAAAAAAAAADhkAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAhhIUwAAAAAAAAAAAAAAAALwAAAAAAABQAAAAAAAAACnyPj34aAAAAAAAAABEDAAAAADMDAAAhfzsEAAAAAABoj4+Pj2sAAAAAAAAtaR8AAAAyLAQACHiPj2wQAAAAMoaPj4+EMAAAAAAENW9wZQkAACEsBAE8j4+Pj28IABqBj4+PjzkAAAAABDZvb29vNAMAISwDCniPj4+Pj2kKb4+Pj49wAQAAAAAyb29vb3BoEAAhLAQDE2qPj4+PhXeFj4+PfRIAAAAAL29vbm9wORMDACEsBAAAADmGj4+Pj4+Pj4MgAAAAACBub29ucDMCAAAAIS8IAAAAADyPj4+Pj4+POQAAAAASam9ub3A2AwAAAAAhMREKBAEAAGiPj4+Pj20DAAAABDxvbm9vOAIAAAAAACEzGxMRCgQDaY+Pj4+PbQMAAAA1cG9ub282AQAAAAAAITYfHBoTCWWPj4+Pj4+GOAAAIm9vb25vbm80AAAAAAAhOS0hHRtlho+Pj4+Pj4+CHxBqb25vb29ub28xAwAAACE7My8ycI+Pj4+PeYaPj496Z29vbm9nb29vb243EgMAIWY3N3+Pj4+Pj3AcdI+Pj4+Cbm5wZAo1cW5vb29oEAAhaTw5dI+Pj494LRwwgo+Pj498bm0bAAg5cG9ucDYDACFsamdkgI+PeTQvLyA8ho+Pj4Z6MQMEAAg3cHBoCgAAIXRvbGlvg3U6NzY0MS9wj4+Pj3ASERAIAQQxbB8AAAA2AHBybmxuaGVkOzg3MzWAj4+CLRsbFBMQCQQUBAAAAwAAeHR1cm9tbGpoZDs6NmaFj2QiIiAdHBoTEQkICAQ4AAAAfHR4d3Nwbm1raWdkOXJ0MzIxLywhHx0bGhMaZgAAAAAAAHl1eHd1c3BtbGpoZDw5ODUzMjAtLCAdZAAAAAAAAAAAAAB9d3V1dXRyb21raGdkOzk3NDI2bgAAAAAAAAAAAAAAAAAAAH55dXJycG5sa2hnaG13AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////n///4AB//wAAD/wAAAPwAAAA4AAAAGAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAGAAAABwAAAA/AAAA/8AAA//4AB////////////KAAAABAAAAAgAAAAAQAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQoABAcKAAAFDgAACA0ACAgIAAgKDAAPDw8AEhAOABQQDQAADhgAAhAZABAQEAAWEhAAEBQXABUVFQAZGRkAHx4dAAAYKAAMHywAJSUlACkpKQAvLy8AMjIyADY2NgA5OTkAPDw8AAArSAACOV4ABTteAAk+YgAAR3YAAEt9AAZPfwAKTnoAQEBAAEdHRwBMR0MASEhIAFJSUgBWVlYAWVlZAF1dXQBiYmIAZmZmAGpqagBycnIAdXV1AHl5eQABXp8AD2afAABkqAAAa7EAEHO0AEeDrAAAg9kAB4neAACb+wAAmf0ABZn8AAGd/gAAof8AAaX/AHLL/wCDg4MAh4eHAJGRkQCXl5cAmZmZAKGhoQCkpKQAqqelAK2trQCxsbEAtbW1ALq6ugDDw8MAycnJAM7OzgDV1dUA2traAN3d3QDk5OQA7OztAPLw7wD09PQA+vr6APj//wD+/v4APf8xAFv/UQB5/3EAmP+RALX/sQDU/9EA////AAAAAAAULwAAIlAAADBwAAA9kAAATLAAAFnPAABn8AAAeP8RAIr/MQCc/1EArv9xAMD/kQDS/7EA5P/RAP///wAAAAAAJi8AAEBQAABacAAAdJAAAI6wAACpzwAAwvAAANH/EQDY/zEA3v9RAOP/cQDp/5EA7/+xAPb/0QD///8AAAAAAC8mAABQQQAAcFsAAJB0AACwjgAAz6kAAPDDAAD/0hEA/9gxAP/dUQD/5HEA/+qRAP/wsQD/9tEA////AAAAAAAvFAAAUCIAAHAwAACQPgAAsE0AAM9bAADwaQAA/3kRAP+KMQD/nVEA/69xAP/BkQD/0rEA/+XRAP///wAAAAAALwMAAFAEAABwBgAAkAkAALAKAADPDAAA8A4AAP8gEgD/PjEA/1xRAP96cQD/l5EA/7axAP/U0QD///8AAAAAAC8ADgBQABcAcAAhAJAAKwCwADYAzwBAAPAASQD/EVoA/zFwAP9RhgD/cZwA/5GyAP+xyAD/0d8A////AAAAAAAvACAAUAA2AHAATACQAGIAsAB4AM8AjgDwAKQA/xGzAP8xvgD/UccA/3HRAP+R3AD/seUA/9HwAP///wAAAAAALAAvAEsAUABpAHAAhwCQAKUAsADEAM8A4QDwAPAR/wDyMf8A9FH/APZx/wD3kf8A+bH/APvR/wD///8AAAAAABsALwAtAFAAPwBwAFIAkABjALAAdgDPAIgA8ACZEf8ApjH/ALRR/wDCcf8Az5H/ANyx/wDr0f8A////AAAAAAAIAC8ADgBQABUAcAAbAJAAIQCwACYAzwAsAPAAPhH/AFgx/wBxUf8AjHH/AKaR/wC/sf8A2tH/AP///wAAAAAAADApJiYpMAAAAAAAAAAAFQAAAAAAAAAAFQAAAAAWAAAAAAAnKQAAAAAAFgApABQMAAAPUlMUAAAFEAApFA9PSgwARF9VGQAFL0IHFBQoX19GKV9fLQAALUhIIxQVBS5YX1ZfSAAAJ0hHJwUUGAUAMF9fURAAFkZIKAAAFCYQADBfX1EMBUJIRycAABQrGkFWX1ZfRixIRkdHJwIUMENfX0svWF9ORiQtSEgaFERCU1AqGUlfWEEABjBDDBRORkhCLywsU1QkEAcPEQAsAE5KSEVCMEZEJCMXEQcoAAAAAE5LSUZCQC8rKEAAAAAAAAAAAABQTkxNAAAAAAAA+B8AAOAHAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIABAADgBwAA/D8AACgAAAAgAAAAQAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWAAAAMgAAAFIAAABrAAAAfAAAAIEAAACBAAAAfAAAAGsAAABSAAAAMgAAABYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAADMAAAB2AAAAsQAAAN0AAAD4AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD4AAAA3QAAALEAAAB2AAAAMwAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAGcAAAC+AAAA9gAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD2AAAAvgAAAGcAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAFsAAADQAAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8BAQH/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAANAAAABbAAAABQAAAAAAAAAAAAAAAAAAABsAAACxAAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/bm5u/39/f/8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAACxAAAAGwAAAAAAAAAJAAAAtAAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/zo6Ov/09PT/+Pj4/0xMTP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAC0AAAACQAAAFkBAQH/AAAA/wAAAP8AAAD/Hx8f/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8PDw//z8/P////////////2dnZ/yAgIP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/ExMT/wICAv8AAAD/AAAA/wAAAP8AAABZBQUFqAMDA/8AAAD/AAAA/zk5Of/c3Nz/eHh4/wUFBf8AAAD/AAAA/wAAAP8AAAD/AAAA/4+Pj///////////////////////l5eX/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/0ZGRv+RkZH/MTEx/wAAAP8AAAD/AAAA/wAAAKgKCgrGBAQE/wAAAP8JCQn/w8PD////////////n5+f/w8PD/8AAAD/AAAA/wAAAP9VVVX/+/v7//////////////////T09P9LS0v/AAAA/wAAAP8AAAD/AAAA/wUFBf9gYGD/qKio/6urq/+Ghob/CwsL/wAAAP8AAAD/AAAAxgoKCsUEBAT/AQEB/35+fv//////////////////////qKio/wkJCf8AAAD/ICAg/+Pj4///////////////////////cHBw/wAAAP8AAAD/AAAA/wAAAP8AAAD/ZWVl/6qqqv+np6f/pqam/6mpqf9cXFz/AgIC/wAAAP8AAADFCgoKxQICAv8MDAz/x8fH////////////////////////////kJCQ/w0NDf+np6f//////////////////////6ysrP8EBAT/AAAA/wAAAP8AAAD/AAAA/1ZWVv+pqan/p6en/6ampv+np6f/ra2t/46Ojv8PDw//AAAA/wAAAMUKCgrFBAQE/wEBAf8aGhr/lZWV///////////////////////6+vr/wcHB//r6+v/////////////////U1NT/FxcX/wAAAP8AAAD/AAAA/wAAAP9JSUn/qKio/6enp/+mpqb/p6en/6ysrP9xcXH/GRkZ/wEBAf8AAAD/AAAAxQsLC8UFBQX/AAAA/wAAAP8AAAD/cXFx//z8/P//////////////////////////////////////8fHx/zc3N/8AAAD/AAAA/wAAAP8AAAD/NTU1/6Ojo/+oqKj/pqam/6enp/+srKz/W1tb/wMDA/8AAAD/AAAA/wAAAP8AAADFExMTxQkJCf8BAQH/AAAA/wAAAP8AAAD/fX19//////////////////////////////////////9ycnL/AAAA/wAAAP8AAAD/AAAA/xYWFv+UlJT/qamp/6ampv+np6f/rKys/2NjY/8BAQH/AAAA/wAAAP8AAAD/AAAA/wAAAMUeHh7GFBQU/wsLC/8GBgb/AwMD/wAAAP8AAAD/jY2N////////////////////////////o6Oj/wEBAf8AAAD/AAAA/wAAAP8HBwf/fHx8/6qqqv+mpqb/pqam/6qqqv9ra2v/AwMD/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAAxSwsLMcjIyP/GBgY/xMTE/8ODg7/BgYG/wICAv+RkZH///////////////////////////+hoaH/AgIC/wAAAP8AAAD/AAAA/2BgYP+qqqr/p6en/6ampv+mpqb/qamp/2dnZ/8CAgL/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAADFOjo6yDMzM/8oKCj/IiIi/xgYGP8LCwv/hYWF//////////////////////////////////39/f9ubm7/AAAA/wAAAP88PDz/p6en/6enp/+mpqb/pqam/6ampv+mpqb/p6en/1xcXP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAMVJSUnIRERE/zk5Of8sLCz/JCQk/4WFhf/8/Pz//////////////////////////////////////+rq6v8xMTH/ERER/5WVlf+pqan/pqam/6ampv+qqqr/p6en/6ampv+np6f/paWl/1JSUv8BAQH/AAAA/wAAAP8AAAD/AAAAxVlZWcpYWFj/S0tL/1RUVP+tra3////////////////////////////Ly8v//Pz8/////////////////8zMzP+IiIj/p6en/6ampv+mpqb/qKio/4eHh/+np6f/p6en/6ampv+np6f/p6en/2dnZ/8VFRX/AgIC/wAAAP8AAADFaGhoy2pqav9oaGj/3d3d////////////////////////////rq6u/ygoKP+4uLj//////////////////////+jo6P+mpqb/paWl/6urq/+BgYH/DQ0N/2FhYf+urq7/p6en/6ampv+np6f/qamp/4yMjP8QEBD/AAAA/wAAAMV4eHjNfn5+/3BwcP+4uLj//////////////////////8fHx/9ERET/KSkp/01NTf/p6en//////////////////////9LS0v+np6f/oaGh/yUlJf8AAAD/CQkJ/3Jycv+urq7/p6en/6ampv+srKz/ZGRk/wICAv8AAAD/AAAAxoeHh8yUlJT/hoaG/4ODg//f39/////////////IyMj/Xl5e/0tLS/9ISEj/Nzc3/319ff/8/Pz//////////////////v7+/83Nzf9PT0//AQEB/wQEBP8AAAD/CAgI/2lpaf+tra3/rKys/42Njf8MDAz/AAAA/wAAAP8AAADEkpKSpqioqP+cnJz/kJCQ/6ioqP/x8fH/vb29/3V1df9oaGj/ZWVl/1xcXP9TU1P/R0dH/66urv//////////////////////rq6u/xcXF/8TExP/EBAQ/wsLC/8DAwP/BQUF/1BQUP+cnJz/NDQ0/wAAAP8AAAD/AAAA/wAAAJqwsLBQqqqq/7Kysv+mpqb/n5+f/6SkpP+MjIz/hoaG/4CAgP94eHj/b29v/2dnZ/9bW1v/YGBg/9/f3////////////+jo6P9FRUX/JCQk/yQkJP8dHR3/GBgY/xISEv8KCgr/BgYG/xwcHP8FBQX/AAAA/wAAAP8AAAD+AAAAQenp6QWoqKiju7u7/7y8vP+xsbH/qKio/6Kiov+bm5v/k5OT/4uLi/+Dg4P/e3t7/3Nzc/9lZWX/h4eH//j4+P/+/v7/gYGB/zs7O/88PDz/NTU1/y4uLv8nJyf/ICAg/xoaGv8TExP/CwsL/wkJCf8ICAj/BgYG/wMDA5MAAAABAAAAAOPj4w+0tLSXubm5+MTExP+/v7//tra2/6+vr/+np6f/oKCg/5iYmP+QkJD/iIiI/4CAgP9ycnL/srKy/7e3t/9aWlr/V1dX/1BQUP9ISEj/QUFB/zk5Of8yMjL/Kysr/yQkJP8hISH/Gxsb/xcXF/IeHh6HBgYGBwAAAAAAAAAAAAAAAAAAAADOzs49tLS0sry8vP/Gxsb/w8PD/7u7u/+zs7P/q6ur/6Ojo/+bm5v/lJSU/4yMjP+Dg4P/fHx8/3Jycv9ra2v/Y2Nj/1tbW/9TU1P/TU1N/0ZGRv8/Pz//Nzc3/ywsLPs6OjqkdXV1MAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADu7u4Dz8/PSLy8vKG6urrlvr6+/7+/v/+9vb3/uLi4/7CwsP+oqKj/oKCg/5eXl/+Pj4//iIiI/4GBgf95eXn/cXFx/2lpaf9eXl7/VFRU/1JSUt9mZmaWmZmZPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOPj4xrOzs5Wv7+/kri4uMK1tbXmsrKy+a+vr/+srKz/pqam/5+fn/+YmJj/jo6O/4WFhfiAgIDjgYGBvY2NjYqqqqpNz8/PEwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8fHxBebm5hja2towzs7OScbGxlrGxsZfwsLCXsDAwFjFxcVH0dHRLN/f3xXu7u4CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////AA//8AAA/8AAAD8AAAAOAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAB4AAAB/AAAB/+AAB//8AD//////8oAAAAEAAAACAAAAABACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAEsAAACEAAAApwAAALcAAAC3AAAApwAAAIQAAABLAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAdQAAANYAAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAANYAAAB1AAAAEAAAAAAAAAApAAAA0AAAAP8AAAD/AAAA/wAAAP8AAAD/UlJS/1paWv8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAANAAAAApAQEBpgAAAP8mJib/Dw8P/wAAAP8AAAD/FhYW/+Tk5P/t7e3/JCQk/wAAAP8AAAD/BgYG/xoaGv8AAAD/AAAApgICAtoUFBT/1dXV/7e3t/8QEBD/AAAA/5qamv//////9PT0/zMzM/8AAAD/CAgI/3R0dP+Ojo7/Dw8P/wAAANoAAADbVVVV////////////pKSk/1paWv/+/v7//////2pqav8AAAD/AgIC/21tbf+tra3/rq6u/z8/P/8AAADbBQUF2ggICP9ycnL//Pz8///////6+vr//////66urv8CAgL/AAAA/1FRUf+srKz/qamp/1NTU/8HBwf/AAAA2hQUFNoDAwP/AAAA/3Z2dv///////////93d3f8XFxf/AAAA/y4uLv+mpqb/q6ur/1VVVf8AAAD/AAAA/wAAANotLS3cGRkZ/wMDA/94eHj////////////b29v/ERER/wcHB/+Ojo7/q6ur/6mpqf9RUVH/AAAA/wAAAP8AAADaS0tL3Tw8PP+Hh4f/+/v7///////7+/v//////6ampv9nZ2f/qqqq/6ampv+pqan/pqam/01NTf8FBQX/AAAA2mVlZd+Xl5f///////////+5ubn/dnZ2//39/f//////0NDQ/6ampv9CQkL/bW1t/66urv+srKz/Pj4+/wAAANuLi4vdkpKS/+zs7P/Y2Nj/XV1d/zk5Of+zs7P///////7+/v+IiIj/AAAA/woKCv97e3v/lJSU/xEREf8AAADYsLCwoaampv+tra3/kJCQ/3Z2dv9lZWX/Z2dn/+3t7f/v7+//RkZG/xkZGf8PDw//FBQU/yAgIP8AAAD/AAAAmefn5yK+vr7EtLS0/62trf+goKD/kJCQ/3h4eP+jo6P/mZmZ/0dHR/9AQED/MTEx/x0dHf8PDw//GxsbvQMDAxwAAAAA9PT0CNbW1mPDw8PIurq6+7CwsP+kpKT/k5OT/4ODg/90dHT/YWFh/1RUVPpdXV3Dj4+PXHt7ewUAAAAAAAAAAAAAAAAAAAAA9vb2BePj4znS0tJzw8PDmbi4uKupqamxp6enm7KysnDNzc018/PzAwAAAAAAAAAAAAAAAOAHrEGAAaxBAACsQQAArEEAAKxBAACsQQAArEEAAKxBAACsQQAArEEAAKxBAACsQQAArEEAAKxBgAGsQeAHrEE=';\n\t\t\t}\n\t\t\thead[0].appendChild(icon);\n\t\t}\n\n\t\thead = top.document.getElementById(\"logodesc\");\n\t\tif (head) {\n\t\t\thead.parentNode.removeChild(head);\n\t\t}\n\t}", "function renderIcons() {\r\n\t\te.renderIcon('#logo', 'logo');\r\n\t\t//e.renderIcon('#loading_msglogo','logo');\r\n\t\te.renderIcon('.menu_icon', 'user_management');\r\n\t\te.renderIcon('.menu_click', 'user_management');\r\n\t\te.renderIcon('.notification', 'notification');\r\n\t\te.renderIcon('header .analysis_status .analysis_icon', 'analysis');\r\n\t\te.renderFontIcon('.input_clear_icon', 'ic-close-sm');\r\n\t\te.renderFontIcon('.search_icon', 'ic-search');\r\n\t\te.renderIcon('#add_bookmark', 'bookmarks');\r\n\t\te.renderIcon('#add_bookmark1', 'bookmarks');\r\n\t\te.renderFontIcon('.tag_icon', 'ic-tags');\r\n\t\t$(document).foundation();\r\n\t\tg.init();\r\n\t}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-12\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-12-7e945a1e.woff') format('woff')\"\n },\n icons: {\n 'FinancialSolid': '\\uF346',\n 'FinancialMirroredSolid': '\\uF347',\n 'HeadsetSolid': '\\uF348',\n 'PermissionsSolid': '\\uF349',\n 'ParkingSolid': '\\uF34A',\n 'ParkingMirroredSolid': '\\uF34B',\n 'DiamondSolid': '\\uF34C',\n 'AsteriskSolid': '\\uF34D',\n 'OfflineStorageSolid': '\\uF34E',\n 'BankSolid': '\\uF34F',\n 'DecisionSolid': '\\uF350',\n 'Parachute': '\\uF351',\n 'ParachuteSolid': '\\uF352',\n 'FiltersSolid': '\\uF353',\n 'ColorSolid': '\\uF354',\n 'ReviewSolid': '\\uF355',\n 'ReviewRequestSolid': '\\uF356',\n 'ReviewRequestMirroredSolid': '\\uF357',\n 'ReviewResponseSolid': '\\uF358',\n 'FeedbackRequestSolid': '\\uF359',\n 'FeedbackRequestMirroredSolid': '\\uF35A',\n 'FeedbackResponseSolid': '\\uF35B',\n 'WorkItemBar': '\\uF35C',\n 'WorkItemBarSolid': '\\uF35D',\n 'Separator': '\\uF35E',\n 'NavigateExternalInline': '\\uF35F',\n 'PlanView': '\\uF360',\n 'TimelineMatrixView': '\\uF361',\n 'EngineeringGroup': '\\uF362',\n 'ProjectCollection': '\\uF363',\n 'CaretBottomRightCenter8': '\\uF364',\n 'CaretBottomLeftCenter8': '\\uF365',\n 'CaretTopRightCenter8': '\\uF366',\n 'CaretTopLeftCenter8': '\\uF367',\n 'DonutChart': '\\uF368',\n 'ChevronUnfold10': '\\uF369',\n 'ChevronFold10': '\\uF36A',\n 'DoubleChevronDown8': '\\uF36B',\n 'DoubleChevronUp8': '\\uF36C',\n 'DoubleChevronLeft8': '\\uF36D',\n 'DoubleChevronRight8': '\\uF36E',\n 'ChevronDownEnd6': '\\uF36F',\n 'ChevronUpEnd6': '\\uF370',\n 'ChevronLeftEnd6': '\\uF371',\n 'ChevronRightEnd6': '\\uF372',\n 'ContextMenu': '\\uF37C',\n 'AzureAPIManagement': '\\uF37F',\n 'AzureServiceEndpoint': '\\uF380',\n 'VSTSLogo': '\\uF381',\n 'VSTSAltLogo1': '\\uF382',\n 'VSTSAltLogo2': '\\uF383',\n 'FileTypeSolution': '\\uF387',\n 'WordLogoInverse16': '\\uF390',\n 'WordLogo16': '\\uF391',\n 'WordLogoFill16': '\\uF392',\n 'PowerPointLogoInverse16': '\\uF393',\n 'PowerPointLogo16': '\\uF394',\n 'PowerPointLogoFill16': '\\uF395',\n 'ExcelLogoInverse16': '\\uF396',\n 'ExcelLogo16': '\\uF397',\n 'ExcelLogoFill16': '\\uF398',\n 'OneNoteLogoInverse16': '\\uF399',\n 'OneNoteLogo16': '\\uF39A',\n 'OneNoteLogoFill16': '\\uF39B',\n 'OutlookLogoInverse16': '\\uF39C',\n 'OutlookLogo16': '\\uF39D',\n 'OutlookLogoFill16': '\\uF39E',\n 'PublisherLogoInverse16': '\\uF39F',\n 'PublisherLogo16': '\\uF3A0',\n 'PublisherLogoFill16': '\\uF3A1',\n 'VisioLogoInverse16': '\\uF3A2',\n 'VisioLogo16': '\\uF3A3',\n 'VisioLogoFill16': '\\uF3A4',\n 'TestBeaker': '\\uF3A5',\n 'TestBeakerSolid': '\\uF3A6',\n 'TestExploreSolid': '\\uF3A7',\n 'TestAutoSolid': '\\uF3A8',\n 'TestUserSolid': '\\uF3A9',\n 'TestImpactSolid': '\\uF3AA',\n 'TestPlan': '\\uF3AB',\n 'TestStep': '\\uF3AC',\n 'TestParameter': '\\uF3AD',\n 'TestSuite': '\\uF3AE',\n 'TestCase': '\\uF3AF',\n 'Sprint': '\\uF3B0',\n 'SignOut': '\\uF3B1',\n 'TriggerApproval': '\\uF3B2',\n 'Rocket': '\\uF3B3',\n 'AzureKeyVault': '\\uF3B4',\n 'Onboarding': '\\uF3BA',\n 'Transition': '\\uF3BC',\n 'LikeSolid': '\\uF3BF',\n 'DislikeSolid': '\\uF3C0',\n 'CRMCustomerInsightsApp': '\\uF3C8',\n 'EditCreate': '\\uF3C9',\n 'PlayReverseResume': '\\uF3E4',\n 'PlayReverse': '\\uF3E5',\n 'SearchData': '\\uF3F1',\n 'UnSetColor': '\\uF3F9',\n 'DeclineCall': '\\uF405'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-12\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-12-7e945a1e.woff') format('woff')\"\n },\n icons: {\n 'FinancialSolid': '\\uF346',\n 'FinancialMirroredSolid': '\\uF347',\n 'HeadsetSolid': '\\uF348',\n 'PermissionsSolid': '\\uF349',\n 'ParkingSolid': '\\uF34A',\n 'ParkingMirroredSolid': '\\uF34B',\n 'DiamondSolid': '\\uF34C',\n 'AsteriskSolid': '\\uF34D',\n 'OfflineStorageSolid': '\\uF34E',\n 'BankSolid': '\\uF34F',\n 'DecisionSolid': '\\uF350',\n 'Parachute': '\\uF351',\n 'ParachuteSolid': '\\uF352',\n 'FiltersSolid': '\\uF353',\n 'ColorSolid': '\\uF354',\n 'ReviewSolid': '\\uF355',\n 'ReviewRequestSolid': '\\uF356',\n 'ReviewRequestMirroredSolid': '\\uF357',\n 'ReviewResponseSolid': '\\uF358',\n 'FeedbackRequestSolid': '\\uF359',\n 'FeedbackRequestMirroredSolid': '\\uF35A',\n 'FeedbackResponseSolid': '\\uF35B',\n 'WorkItemBar': '\\uF35C',\n 'WorkItemBarSolid': '\\uF35D',\n 'Separator': '\\uF35E',\n 'NavigateExternalInline': '\\uF35F',\n 'PlanView': '\\uF360',\n 'TimelineMatrixView': '\\uF361',\n 'EngineeringGroup': '\\uF362',\n 'ProjectCollection': '\\uF363',\n 'CaretBottomRightCenter8': '\\uF364',\n 'CaretBottomLeftCenter8': '\\uF365',\n 'CaretTopRightCenter8': '\\uF366',\n 'CaretTopLeftCenter8': '\\uF367',\n 'DonutChart': '\\uF368',\n 'ChevronUnfold10': '\\uF369',\n 'ChevronFold10': '\\uF36A',\n 'DoubleChevronDown8': '\\uF36B',\n 'DoubleChevronUp8': '\\uF36C',\n 'DoubleChevronLeft8': '\\uF36D',\n 'DoubleChevronRight8': '\\uF36E',\n 'ChevronDownEnd6': '\\uF36F',\n 'ChevronUpEnd6': '\\uF370',\n 'ChevronLeftEnd6': '\\uF371',\n 'ChevronRightEnd6': '\\uF372',\n 'ContextMenu': '\\uF37C',\n 'AzureAPIManagement': '\\uF37F',\n 'AzureServiceEndpoint': '\\uF380',\n 'VSTSLogo': '\\uF381',\n 'VSTSAltLogo1': '\\uF382',\n 'VSTSAltLogo2': '\\uF383',\n 'FileTypeSolution': '\\uF387',\n 'WordLogoInverse16': '\\uF390',\n 'WordLogo16': '\\uF391',\n 'WordLogoFill16': '\\uF392',\n 'PowerPointLogoInverse16': '\\uF393',\n 'PowerPointLogo16': '\\uF394',\n 'PowerPointLogoFill16': '\\uF395',\n 'ExcelLogoInverse16': '\\uF396',\n 'ExcelLogo16': '\\uF397',\n 'ExcelLogoFill16': '\\uF398',\n 'OneNoteLogoInverse16': '\\uF399',\n 'OneNoteLogo16': '\\uF39A',\n 'OneNoteLogoFill16': '\\uF39B',\n 'OutlookLogoInverse16': '\\uF39C',\n 'OutlookLogo16': '\\uF39D',\n 'OutlookLogoFill16': '\\uF39E',\n 'PublisherLogoInverse16': '\\uF39F',\n 'PublisherLogo16': '\\uF3A0',\n 'PublisherLogoFill16': '\\uF3A1',\n 'VisioLogoInverse16': '\\uF3A2',\n 'VisioLogo16': '\\uF3A3',\n 'VisioLogoFill16': '\\uF3A4',\n 'TestBeaker': '\\uF3A5',\n 'TestBeakerSolid': '\\uF3A6',\n 'TestExploreSolid': '\\uF3A7',\n 'TestAutoSolid': '\\uF3A8',\n 'TestUserSolid': '\\uF3A9',\n 'TestImpactSolid': '\\uF3AA',\n 'TestPlan': '\\uF3AB',\n 'TestStep': '\\uF3AC',\n 'TestParameter': '\\uF3AD',\n 'TestSuite': '\\uF3AE',\n 'TestCase': '\\uF3AF',\n 'Sprint': '\\uF3B0',\n 'SignOut': '\\uF3B1',\n 'TriggerApproval': '\\uF3B2',\n 'Rocket': '\\uF3B3',\n 'AzureKeyVault': '\\uF3B4',\n 'Onboarding': '\\uF3BA',\n 'Transition': '\\uF3BC',\n 'LikeSolid': '\\uF3BF',\n 'DislikeSolid': '\\uF3C0',\n 'CRMCustomerInsightsApp': '\\uF3C8',\n 'EditCreate': '\\uF3C9',\n 'PlayReverseResume': '\\uF3E4',\n 'PlayReverse': '\\uF3E5',\n 'SearchData': '\\uF3F1',\n 'UnSetColor': '\\uF3F9',\n 'DeclineCall': '\\uF405'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-13\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-13-c3989a02.woff') format('woff')\"\n },\n icons: {\n 'RectangularClipping': '\\uF407',\n 'TeamsLogo16': '\\uF40A',\n 'TeamsLogoFill16': '\\uF40B',\n 'Spacer': '\\uF40D',\n 'SkypeLogo16': '\\uF40E',\n 'SkypeForBusinessLogo16': '\\uF40F',\n 'SkypeForBusinessLogoFill16': '\\uF410',\n 'FilterSolid': '\\uF412',\n 'MailUndelivered': '\\uF415',\n 'MailTentative': '\\uF416',\n 'MailTentativeMirrored': '\\uF417',\n 'MailReminder': '\\uF418',\n 'ReceiptUndelivered': '\\uF419',\n 'ReceiptTentative': '\\uF41A',\n 'ReceiptTentativeMirrored': '\\uF41B',\n 'Inbox': '\\uF41C',\n 'IRMReply': '\\uF41D',\n 'IRMReplyMirrored': '\\uF41E',\n 'IRMForward': '\\uF41F',\n 'IRMForwardMirrored': '\\uF420',\n 'VoicemailIRM': '\\uF421',\n 'EventAccepted': '\\uF422',\n 'EventTentative': '\\uF423',\n 'EventTentativeMirrored': '\\uF424',\n 'EventDeclined': '\\uF425',\n 'IDBadge': '\\uF427',\n 'BackgroundColor': '\\uF42B',\n 'OfficeFormsLogoInverse16': '\\uF433',\n 'OfficeFormsLogo': '\\uF434',\n 'OfficeFormsLogoFill': '\\uF435',\n 'OfficeFormsLogo16': '\\uF436',\n 'OfficeFormsLogoFill16': '\\uF437',\n 'OfficeFormsLogoInverse24': '\\uF43A',\n 'OfficeFormsLogo24': '\\uF43B',\n 'OfficeFormsLogoFill24': '\\uF43C',\n 'PageLock': '\\uF43F',\n 'NotExecuted': '\\uF440',\n 'NotImpactedSolid': '\\uF441',\n 'FieldReadOnly': '\\uF442',\n 'FieldRequired': '\\uF443',\n 'BacklogBoard': '\\uF444',\n 'ExternalBuild': '\\uF445',\n 'ExternalTFVC': '\\uF446',\n 'ExternalXAML': '\\uF447',\n 'IssueSolid': '\\uF448',\n 'DefectSolid': '\\uF449',\n 'LadybugSolid': '\\uF44A',\n 'NugetLogo': '\\uF44C',\n 'TFVCLogo': '\\uF44D',\n 'ProjectLogo32': '\\uF47E',\n 'ProjectLogoFill32': '\\uF47F',\n 'ProjectLogo16': '\\uF480',\n 'ProjectLogoFill16': '\\uF481',\n 'SwayLogo32': '\\uF482',\n 'SwayLogoFill32': '\\uF483',\n 'SwayLogo16': '\\uF484',\n 'SwayLogoFill16': '\\uF485',\n 'ClassNotebookLogo32': '\\uF486',\n 'ClassNotebookLogoFill32': '\\uF487',\n 'ClassNotebookLogo16': '\\uF488',\n 'ClassNotebookLogoFill16': '\\uF489',\n 'ClassNotebookLogoInverse32': '\\uF48A',\n 'ClassNotebookLogoInverse16': '\\uF48B',\n 'StaffNotebookLogo32': '\\uF48C',\n 'StaffNotebookLogoFill32': '\\uF48D',\n 'StaffNotebookLogo16': '\\uF48E',\n 'StaffNotebookLogoFill16': '\\uF48F',\n 'StaffNotebookLogoInverted32': '\\uF490',\n 'StaffNotebookLogoInverted16': '\\uF491',\n 'KaizalaLogo': '\\uF492',\n 'TaskLogo': '\\uF493',\n 'ProtectionCenterLogo32': '\\uF494',\n 'GallatinLogo': '\\uF496',\n 'Globe2': '\\uF49A',\n 'Guitar': '\\uF49B',\n 'Breakfast': '\\uF49C',\n 'Brunch': '\\uF49D',\n 'BeerMug': '\\uF49E',\n 'Vacation': '\\uF49F',\n 'Teeth': '\\uF4A0',\n 'Taxi': '\\uF4A1',\n 'Chopsticks': '\\uF4A2',\n 'SyncOccurence': '\\uF4A3',\n 'UnsyncOccurence': '\\uF4A4',\n 'GIF': '\\uF4A9',\n 'PrimaryCalendar': '\\uF4AE',\n 'SearchCalendar': '\\uF4AF',\n 'VideoOff': '\\uF4B0',\n 'MicrosoftFlowLogo': '\\uF4B1',\n 'BusinessCenterLogo': '\\uF4B2',\n 'ToDoLogoBottom': '\\uF4B3',\n 'ToDoLogoTop': '\\uF4B4',\n 'EditSolid12': '\\uF4B5',\n 'EditSolidMirrored12': '\\uF4B6',\n 'UneditableSolid12': '\\uF4B7',\n 'UneditableSolidMirrored12': '\\uF4B8',\n 'UneditableMirrored': '\\uF4B9',\n 'AdminALogo32': '\\uF4BA',\n 'AdminALogoFill32': '\\uF4BB',\n 'ToDoLogoInverse': '\\uF4BC'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-13\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-13-c3989a02.woff') format('woff')\"\n },\n icons: {\n 'RectangularClipping': '\\uF407',\n 'TeamsLogo16': '\\uF40A',\n 'TeamsLogoFill16': '\\uF40B',\n 'Spacer': '\\uF40D',\n 'SkypeLogo16': '\\uF40E',\n 'SkypeForBusinessLogo16': '\\uF40F',\n 'SkypeForBusinessLogoFill16': '\\uF410',\n 'FilterSolid': '\\uF412',\n 'MailUndelivered': '\\uF415',\n 'MailTentative': '\\uF416',\n 'MailTentativeMirrored': '\\uF417',\n 'MailReminder': '\\uF418',\n 'ReceiptUndelivered': '\\uF419',\n 'ReceiptTentative': '\\uF41A',\n 'ReceiptTentativeMirrored': '\\uF41B',\n 'Inbox': '\\uF41C',\n 'IRMReply': '\\uF41D',\n 'IRMReplyMirrored': '\\uF41E',\n 'IRMForward': '\\uF41F',\n 'IRMForwardMirrored': '\\uF420',\n 'VoicemailIRM': '\\uF421',\n 'EventAccepted': '\\uF422',\n 'EventTentative': '\\uF423',\n 'EventTentativeMirrored': '\\uF424',\n 'EventDeclined': '\\uF425',\n 'IDBadge': '\\uF427',\n 'BackgroundColor': '\\uF42B',\n 'OfficeFormsLogoInverse16': '\\uF433',\n 'OfficeFormsLogo': '\\uF434',\n 'OfficeFormsLogoFill': '\\uF435',\n 'OfficeFormsLogo16': '\\uF436',\n 'OfficeFormsLogoFill16': '\\uF437',\n 'OfficeFormsLogoInverse24': '\\uF43A',\n 'OfficeFormsLogo24': '\\uF43B',\n 'OfficeFormsLogoFill24': '\\uF43C',\n 'PageLock': '\\uF43F',\n 'NotExecuted': '\\uF440',\n 'NotImpactedSolid': '\\uF441',\n 'FieldReadOnly': '\\uF442',\n 'FieldRequired': '\\uF443',\n 'BacklogBoard': '\\uF444',\n 'ExternalBuild': '\\uF445',\n 'ExternalTFVC': '\\uF446',\n 'ExternalXAML': '\\uF447',\n 'IssueSolid': '\\uF448',\n 'DefectSolid': '\\uF449',\n 'LadybugSolid': '\\uF44A',\n 'NugetLogo': '\\uF44C',\n 'TFVCLogo': '\\uF44D',\n 'ProjectLogo32': '\\uF47E',\n 'ProjectLogoFill32': '\\uF47F',\n 'ProjectLogo16': '\\uF480',\n 'ProjectLogoFill16': '\\uF481',\n 'SwayLogo32': '\\uF482',\n 'SwayLogoFill32': '\\uF483',\n 'SwayLogo16': '\\uF484',\n 'SwayLogoFill16': '\\uF485',\n 'ClassNotebookLogo32': '\\uF486',\n 'ClassNotebookLogoFill32': '\\uF487',\n 'ClassNotebookLogo16': '\\uF488',\n 'ClassNotebookLogoFill16': '\\uF489',\n 'ClassNotebookLogoInverse32': '\\uF48A',\n 'ClassNotebookLogoInverse16': '\\uF48B',\n 'StaffNotebookLogo32': '\\uF48C',\n 'StaffNotebookLogoFill32': '\\uF48D',\n 'StaffNotebookLogo16': '\\uF48E',\n 'StaffNotebookLogoFill16': '\\uF48F',\n 'StaffNotebookLogoInverted32': '\\uF490',\n 'StaffNotebookLogoInverted16': '\\uF491',\n 'KaizalaLogo': '\\uF492',\n 'TaskLogo': '\\uF493',\n 'ProtectionCenterLogo32': '\\uF494',\n 'GallatinLogo': '\\uF496',\n 'Globe2': '\\uF49A',\n 'Guitar': '\\uF49B',\n 'Breakfast': '\\uF49C',\n 'Brunch': '\\uF49D',\n 'BeerMug': '\\uF49E',\n 'Vacation': '\\uF49F',\n 'Teeth': '\\uF4A0',\n 'Taxi': '\\uF4A1',\n 'Chopsticks': '\\uF4A2',\n 'SyncOccurence': '\\uF4A3',\n 'UnsyncOccurence': '\\uF4A4',\n 'GIF': '\\uF4A9',\n 'PrimaryCalendar': '\\uF4AE',\n 'SearchCalendar': '\\uF4AF',\n 'VideoOff': '\\uF4B0',\n 'MicrosoftFlowLogo': '\\uF4B1',\n 'BusinessCenterLogo': '\\uF4B2',\n 'ToDoLogoBottom': '\\uF4B3',\n 'ToDoLogoTop': '\\uF4B4',\n 'EditSolid12': '\\uF4B5',\n 'EditSolidMirrored12': '\\uF4B6',\n 'UneditableSolid12': '\\uF4B7',\n 'UneditableSolidMirrored12': '\\uF4B8',\n 'UneditableMirrored': '\\uF4B9',\n 'AdminALogo32': '\\uF4BA',\n 'AdminALogoFill32': '\\uF4BB',\n 'ToDoLogoInverse': '\\uF4BC'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function addBuiltIns(PfeIcon){[{name:\"web\",path:\"https://access.redhat.com/webassets/avalon/j/lib/rh-iconfont-svgs\"},{name:\"rh\",path:\"https://access.redhat.com/webassets/avalon/j/lib/rh-iconfont-svgs\"}].forEach(function(set){return PfeIcon.addIconSet(set.name,set.path,function(name,iconSetName,iconSetPath){var regex=new RegExp(\"^\".concat(iconSetName,\"(-icon)?-(.*)\")),_regex$exec=regex.exec(name),_regex$exec2=babelHelpers.slicedToArray(_regex$exec,3),iconName=_regex$exec2[2],iconId=\"\".concat(iconSetName,\"-icon-\").concat(iconName),iconPath=\"\".concat(iconSetPath,\"/\").concat(iconId,\".svg\");return iconPath})})}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-11\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-11-2a8393d6.woff') format('woff')\"\n },\n icons: {\n 'BoxAdditionSolid': '\\uF2D4',\n 'BoxMultiplySolid': '\\uF2D5',\n 'BoxPlaySolid': '\\uF2D6',\n 'BoxCheckmarkSolid': '\\uF2D7',\n 'CirclePauseSolid': '\\uF2D8',\n 'CirclePause': '\\uF2D9',\n 'MSNVideosSolid': '\\uF2DA',\n 'CircleStopSolid': '\\uF2DB',\n 'CircleStop': '\\uF2DC',\n 'NavigateBack': '\\uF2DD',\n 'NavigateBackMirrored': '\\uF2DE',\n 'NavigateForward': '\\uF2DF',\n 'NavigateForwardMirrored': '\\uF2E0',\n 'UnknownSolid': '\\uF2E1',\n 'UnknownMirroredSolid': '\\uF2E2',\n 'CircleAddition': '\\uF2E3',\n 'CircleAdditionSolid': '\\uF2E4',\n 'FilePDB': '\\uF2E5',\n 'FileTemplate': '\\uF2E6',\n 'FileSQL': '\\uF2E7',\n 'FileJAVA': '\\uF2E8',\n 'FileASPX': '\\uF2E9',\n 'FileCSS': '\\uF2EA',\n 'FileSass': '\\uF2EB',\n 'FileLess': '\\uF2EC',\n 'FileHTML': '\\uF2ED',\n 'JavaScriptLanguage': '\\uF2EE',\n 'CSharpLanguage': '\\uF2EF',\n 'CSharp': '\\uF2F0',\n 'VisualBasicLanguage': '\\uF2F1',\n 'VB': '\\uF2F2',\n 'CPlusPlusLanguage': '\\uF2F3',\n 'CPlusPlus': '\\uF2F4',\n 'FSharpLanguage': '\\uF2F5',\n 'FSharp': '\\uF2F6',\n 'TypeScriptLanguage': '\\uF2F7',\n 'PythonLanguage': '\\uF2F8',\n 'PY': '\\uF2F9',\n 'CoffeeScript': '\\uF2FA',\n 'MarkDownLanguage': '\\uF2FB',\n 'FullWidth': '\\uF2FE',\n 'FullWidthEdit': '\\uF2FF',\n 'Plug': '\\uF300',\n 'PlugSolid': '\\uF301',\n 'PlugConnected': '\\uF302',\n 'PlugDisconnected': '\\uF303',\n 'UnlockSolid': '\\uF304',\n 'Variable': '\\uF305',\n 'Parameter': '\\uF306',\n 'CommentUrgent': '\\uF307',\n 'Storyboard': '\\uF308',\n 'DiffInline': '\\uF309',\n 'DiffSideBySide': '\\uF30A',\n 'ImageDiff': '\\uF30B',\n 'ImagePixel': '\\uF30C',\n 'FileBug': '\\uF30D',\n 'FileCode': '\\uF30E',\n 'FileComment': '\\uF30F',\n 'BusinessHoursSign': '\\uF310',\n 'FileImage': '\\uF311',\n 'FileSymlink': '\\uF312',\n 'AutoFillTemplate': '\\uF313',\n 'WorkItem': '\\uF314',\n 'WorkItemBug': '\\uF315',\n 'LogRemove': '\\uF316',\n 'ColumnOptions': '\\uF317',\n 'Packages': '\\uF318',\n 'BuildIssue': '\\uF319',\n 'AssessmentGroup': '\\uF31A',\n 'VariableGroup': '\\uF31B',\n 'FullHistory': '\\uF31C',\n 'Wheelchair': '\\uF31F',\n 'SingleColumnEdit': '\\uF321',\n 'DoubleColumnEdit': '\\uF322',\n 'TripleColumnEdit': '\\uF323',\n 'ColumnLeftTwoThirdsEdit': '\\uF324',\n 'ColumnRightTwoThirdsEdit': '\\uF325',\n 'StreamLogo': '\\uF329',\n 'PassiveAuthentication': '\\uF32A',\n 'AlertSolid': '\\uF331',\n 'MegaphoneSolid': '\\uF332',\n 'TaskSolid': '\\uF333',\n 'ConfigurationSolid': '\\uF334',\n 'BugSolid': '\\uF335',\n 'CrownSolid': '\\uF336',\n 'Trophy2Solid': '\\uF337',\n 'QuickNoteSolid': '\\uF338',\n 'ConstructionConeSolid': '\\uF339',\n 'PageListSolid': '\\uF33A',\n 'PageListMirroredSolid': '\\uF33B',\n 'StarburstSolid': '\\uF33C',\n 'ReadingModeSolid': '\\uF33D',\n 'SadSolid': '\\uF33E',\n 'HealthSolid': '\\uF33F',\n 'ShieldSolid': '\\uF340',\n 'GiftBoxSolid': '\\uF341',\n 'ShoppingCartSolid': '\\uF342',\n 'MailSolid': '\\uF343',\n 'ChatSolid': '\\uF344',\n 'RibbonSolid': '\\uF345'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "function initializeIcons(baseUrl, options) {\n if (baseUrl === void 0) { baseUrl = ''; }\n var subset = {\n style: {\n MozOsxFontSmoothing: 'grayscale',\n WebkitFontSmoothing: 'antialiased',\n fontStyle: 'normal',\n fontWeight: 'normal',\n speak: 'none'\n },\n fontFace: {\n fontFamily: \"\\\"FabricMDL2Icons-11\\\"\",\n src: \"url('\" + baseUrl + \"fabric-icons-11-2a8393d6.woff') format('woff')\"\n },\n icons: {\n 'BoxAdditionSolid': '\\uF2D4',\n 'BoxMultiplySolid': '\\uF2D5',\n 'BoxPlaySolid': '\\uF2D6',\n 'BoxCheckmarkSolid': '\\uF2D7',\n 'CirclePauseSolid': '\\uF2D8',\n 'CirclePause': '\\uF2D9',\n 'MSNVideosSolid': '\\uF2DA',\n 'CircleStopSolid': '\\uF2DB',\n 'CircleStop': '\\uF2DC',\n 'NavigateBack': '\\uF2DD',\n 'NavigateBackMirrored': '\\uF2DE',\n 'NavigateForward': '\\uF2DF',\n 'NavigateForwardMirrored': '\\uF2E0',\n 'UnknownSolid': '\\uF2E1',\n 'UnknownMirroredSolid': '\\uF2E2',\n 'CircleAddition': '\\uF2E3',\n 'CircleAdditionSolid': '\\uF2E4',\n 'FilePDB': '\\uF2E5',\n 'FileTemplate': '\\uF2E6',\n 'FileSQL': '\\uF2E7',\n 'FileJAVA': '\\uF2E8',\n 'FileASPX': '\\uF2E9',\n 'FileCSS': '\\uF2EA',\n 'FileSass': '\\uF2EB',\n 'FileLess': '\\uF2EC',\n 'FileHTML': '\\uF2ED',\n 'JavaScriptLanguage': '\\uF2EE',\n 'CSharpLanguage': '\\uF2EF',\n 'CSharp': '\\uF2F0',\n 'VisualBasicLanguage': '\\uF2F1',\n 'VB': '\\uF2F2',\n 'CPlusPlusLanguage': '\\uF2F3',\n 'CPlusPlus': '\\uF2F4',\n 'FSharpLanguage': '\\uF2F5',\n 'FSharp': '\\uF2F6',\n 'TypeScriptLanguage': '\\uF2F7',\n 'PythonLanguage': '\\uF2F8',\n 'PY': '\\uF2F9',\n 'CoffeeScript': '\\uF2FA',\n 'MarkDownLanguage': '\\uF2FB',\n 'FullWidth': '\\uF2FE',\n 'FullWidthEdit': '\\uF2FF',\n 'Plug': '\\uF300',\n 'PlugSolid': '\\uF301',\n 'PlugConnected': '\\uF302',\n 'PlugDisconnected': '\\uF303',\n 'UnlockSolid': '\\uF304',\n 'Variable': '\\uF305',\n 'Parameter': '\\uF306',\n 'CommentUrgent': '\\uF307',\n 'Storyboard': '\\uF308',\n 'DiffInline': '\\uF309',\n 'DiffSideBySide': '\\uF30A',\n 'ImageDiff': '\\uF30B',\n 'ImagePixel': '\\uF30C',\n 'FileBug': '\\uF30D',\n 'FileCode': '\\uF30E',\n 'FileComment': '\\uF30F',\n 'BusinessHoursSign': '\\uF310',\n 'FileImage': '\\uF311',\n 'FileSymlink': '\\uF312',\n 'AutoFillTemplate': '\\uF313',\n 'WorkItem': '\\uF314',\n 'WorkItemBug': '\\uF315',\n 'LogRemove': '\\uF316',\n 'ColumnOptions': '\\uF317',\n 'Packages': '\\uF318',\n 'BuildIssue': '\\uF319',\n 'AssessmentGroup': '\\uF31A',\n 'VariableGroup': '\\uF31B',\n 'FullHistory': '\\uF31C',\n 'Wheelchair': '\\uF31F',\n 'SingleColumnEdit': '\\uF321',\n 'DoubleColumnEdit': '\\uF322',\n 'TripleColumnEdit': '\\uF323',\n 'ColumnLeftTwoThirdsEdit': '\\uF324',\n 'ColumnRightTwoThirdsEdit': '\\uF325',\n 'StreamLogo': '\\uF329',\n 'PassiveAuthentication': '\\uF32A',\n 'AlertSolid': '\\uF331',\n 'MegaphoneSolid': '\\uF332',\n 'TaskSolid': '\\uF333',\n 'ConfigurationSolid': '\\uF334',\n 'BugSolid': '\\uF335',\n 'CrownSolid': '\\uF336',\n 'Trophy2Solid': '\\uF337',\n 'QuickNoteSolid': '\\uF338',\n 'ConstructionConeSolid': '\\uF339',\n 'PageListSolid': '\\uF33A',\n 'PageListMirroredSolid': '\\uF33B',\n 'StarburstSolid': '\\uF33C',\n 'ReadingModeSolid': '\\uF33D',\n 'SadSolid': '\\uF33E',\n 'HealthSolid': '\\uF33F',\n 'ShieldSolid': '\\uF340',\n 'GiftBoxSolid': '\\uF341',\n 'ShoppingCartSolid': '\\uF342',\n 'MailSolid': '\\uF343',\n 'ChatSolid': '\\uF344',\n 'RibbonSolid': '\\uF345'\n }\n };\n (0,_fluentui_style_utilities__WEBPACK_IMPORTED_MODULE_0__.registerIcons)(subset, options);\n}", "static get icon() { throw new Error('unimplemented - must use a concrete class'); }", "constructor() {\n this.icon = 'images/favicon-32x32.png';\n }", "function getIcon(abr) {\n switch (abr) {\n case \"BCH\":\n return \"bch.png\";\n case \"ZRX\":\n return \"zrx.png\";\n case \"LTC\":\n return \"ltc.png\";\n case \"ETH\":\n return \"eth.png\";\n case \"ETC\":\n return \"etc.png\";\n case \"BTC\":\n return \"btc.png\";\n case \"USDC\":\n return \"usdc.png\";\n default:\n return \"bat.png\";\n break;\n }\n }", "function getIcon(_icon) {\n switch (_icon) {\n case \"info\":\n return _icon + \" bz-information-icon\";\n case \"warning\":\n return _icon + \" bz-ontime-normal\";\n case \"error\":\n return _icon + \" bz-overdue-normal\";\n case \"success\":\n return _icon + \" bz-upcoming-normal\";\n default:\n return _icon + \" bz-workonit\";\n }\n }", "function setIcon () {\n if ( oauth.hasToken() ) {\n chrome.browserAction.setIcon( { 'path': 'img/icon-19-on.png' } );\n } else {\n chrome.browserAction.setIcon( { 'path': 'img/icon-19-off.png' } );\n }\n}", "function getIcon(abr) {\n switch (abr) {\n case \"BCH\":\n return \"bch.png\";\n case \"ZRX\":\n return \"bch.png\";\n case \"LTC\":\n return \"ltc.png\";\n case \"ETH\":\n return \"eth.png\";\n case \"BTC\":\n return \"btc.png\";\n case \"BTC\":\n return \"btc.png\";\n default:\n return \"bat.png\";\n break;\n }\n}", "function getIconName(icon) {\n switch (icon) {\n case 'clear-day':\n return 'wi-day-sunny';\n case 'clear-night':\n return 'wi-night-clear';\n case 'wind':\n return 'wi-windy';\n case 'partly-cloudy-day':\n return 'wi-day-cloudy';\n case 'partly-cloudy-night':\n return 'wi-night-alt-cloudy';\n case 'rain':\n case 'snow':\n case 'sleet':\n case 'fog':\n case 'cloudy':\n return 'wi-' + icon;\n default:\n return 'wi-na';\n }\n}", "getIcons(content) {\n switch (content) {\n case \"Logout\":\n return (\n <>\n <FiLogOut size=\"0.9rem\" />\n </>\n );\n case \"Login\":\n return (\n <>\n <FiLogIn size=\"0.9rem\" />\n </>\n );\n case \"Profile\":\n return (\n <>\n <FiUserPlus size=\"0.9rem\" />\n </>\n );\n case \"Help\":\n return (\n <>\n <FiShoppingCart size=\"0.9rem\" />\n </>\n );\n case \"Home\":\n return (\n <>\n <FiUser size=\"0.9rem\" />\n </>\n );\n case \"About\":\n return (\n <>\n <FiClipboard size=\"0.9rem\" />\n </>\n );\n case \"Contact\":\n return (\n <>\n <BsGift size=\"0.9rem\" />\n </>\n );\n case \"Staff Manager\":\n return (\n <>\n <GrUserSettings size=\"0.9rem\" />\n </>\n );\n default:\n return <></>;\n }\n }", "function showIconAbout() {\n\t\n\tvar info = \"The icons listed here can be found at:\\n\";\n\tinfo += \"http://www.thenounproject.com\\n\\n\";\n\tinfo += \"Info Icon:\\t\\tKarthick Nagarajan - Icon #5134\\n\"\n\t\n\twindow.alert(info);\n}", "function getIcon(name) {\n var icon = undefined;\n var options = _iconSettings.__options;\n name = name ? name.toLowerCase() : '';\n name = _iconSettings.__remapped[name] || name;\n if (name) {\n icon = _iconSettings[name];\n if (icon) {\n var subset = icon.subset;\n if (subset && subset.fontFace) {\n if (!subset.isRegistered) {\n Object(__WEBPACK_IMPORTED_MODULE_2__uifabric_merge_styles__[\"d\" /* fontFace */])(subset.fontFace);\n subset.isRegistered = true;\n }\n if (!subset.className) {\n subset.className = Object(__WEBPACK_IMPORTED_MODULE_2__uifabric_merge_styles__[\"g\" /* mergeStyles */])(subset.style, {\n fontFamily: subset.fontFace.fontFamily,\n fontWeight: subset.fontFace.fontWeight || 'normal',\n fontStyle: subset.fontFace.fontStyle || 'normal'\n });\n }\n }\n }\n else {\n if (!options.disableWarnings && options.warnOnMissingIcons) {\n Object(__WEBPACK_IMPORTED_MODULE_1__uifabric_utilities__[\"_54\" /* warn */])(\"The icon \\\"\" + name + \"\\\" was used but not registered. See http://aka.ms/fabric-icon-usage for more information.\");\n }\n }\n }\n return icon;\n}", "function getIcon(itemType) {\n switch(itemType) {\n case 'food': \n return FoodIcon; \n case 'movie':\n return MovieIcon; \n case 'event': \n return EventIcon; \n default: \n return UnknownIcon; \n }\n}", "function _mime_icon(_mime) {\n var _word = \"img/document-word.png\",\n _xls = \"img/document-xls.png\",\n _pdf = \"img/document-pdf.png\",\n _ppt = \"img/document-ppt.png\",\n _plain = \"img/document-plain.png\",\n _map = {\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\": _word,\n \"application/msword\": _word,\n \"application/vnd.ms-excel\": _xls,\n \"application/x-excel\": _xls,\n \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\": _xls,\n \"application/vnd.ms-powerpoint\": _ppt,\n \"application/vnd.openxmlformats-officedocument.presentationml.presentation\": _ppt,\n \"application/vnd.openxmlformats-officedocument.presentationml.slideshow\": _ppt,\n \"application/pdf\": _pdf\n };\n\n if (_map.hasOwnProperty(_mime)) {\n return _map[_mime];\n }\n\n return _plain;\n }", "function getIcon(iconValue) {\n switch(iconValue) {\n case \"website\":\n return \"fa fa-globe\";\n case \"reddit\":\n return \"fa fa-reddit\";\n case \"github\":\n return \"fa fa-github\";\n case \"blog\":\n return \"fa fa-rss\";\n case \"portfolio\":\n return \"fa fa-briefcase\";\n }\n}", "function getIcon(){\r\n switch (e['eventtype']) {\r\n case \"residential\": return \"img/house.png\";\r\n\r\n case \"commercial\": return \"img/commercial.png\";\r\n\r\n case \"charity\": return \"img/charity.png\"\r\n\r\n }\r\n }", "function addBuiltIns(_ref) {\n var PfeIcon = _ref.PfeIcon,\n config = _ref.config;\n\n // If the user wants to completely opt out of default icon sets,\n // allow them to.\n if (config.IconSets && config.IconSets.length === 0) {\n return;\n }\n\n // If the user provides their own icon sets, use them. If not, use our defaults.\n // @TODO: Switch from access.redhat.com to another icon set.\n var iconSets = config.IconSets || [{\n name: \"web\",\n path: \"https://access.redhat.com/webassets/avalon/j/lib/rh-iconfont-svgs\"\n }, {\n name: \"rh\",\n path: \"https://access.redhat.com/webassets/avalon/j/lib/rh-iconfont-svgs\"\n }];\n\n var resolveDefaultIconName = function resolveDefaultIconName(name, iconSetName, iconSetPath) {\n var regex = new RegExp(\"^\" + iconSetName + \"(-icon)?-(.*)\");\n\n var _regex$exec = regex.exec(name),\n _regex$exec2 = slicedToArray(_regex$exec, 3),\n iconName = _regex$exec2[2];\n\n var iconId = iconSetName + \"-icon-\" + iconName;\n var iconPath = iconSetPath + \"/\" + iconId + \".svg\";\n\n return iconPath;\n };\n\n // Register the icon sets.\n iconSets.forEach(function (set) {\n // If there's a `resolveIconName` function provided, use it. If not, fall back\n // to the `resolveDefaultIconName` function.\n if (set.resolveIconName && typeof set.resolveIconName === \"function\") {\n resolveDefaultIconName = set.resolveIconName;\n }\n\n PfeIcon.addIconSet(set.name, set.path, resolveDefaultIconName);\n });\n }", "function getIcon(name) {\r\n var icon = undefined;\r\n var options = _iconSettings.__options;\r\n name = name ? normalizeIconName(name) : '';\r\n name = _iconSettings.__remapped[name] || name;\r\n if (name) {\r\n icon = _iconSettings[name];\r\n if (icon) {\r\n var subset = icon.subset;\r\n if (subset && subset.fontFace) {\r\n if (!subset.isRegistered) {\r\n Object(lib[\"c\" /* fontFace */])(subset.fontFace);\r\n subset.isRegistered = true;\r\n }\r\n if (!subset.className) {\r\n subset.className = Object(lib[\"f\" /* mergeStyles */])(subset.style, {\r\n fontFamily: subset.fontFace.fontFamily,\r\n fontWeight: subset.fontFace.fontWeight || 'normal',\r\n fontStyle: subset.fontFace.fontStyle || 'normal'\r\n });\r\n }\r\n }\r\n }\r\n else {\r\n if (!options.disableWarnings && options.warnOnMissingIcons) {\r\n warn(\"The icon \\\"\" + name + \"\\\" was used but not registered. See http://aka.ms/fabric-icon-usage for more information.\");\r\n }\r\n }\r\n }\r\n return icon;\r\n}", "function getIcon(type) {\r\n const all_weather = \"<span title='All Weather' class='fa fa-cloud'></span>\";\r\n const tent = \"<span title='Tent' class='glyphicon glyphicon-tent'></span>\";\r\n const caravan = \"<span title='Caravan' class='fas fa-car'></span>\";\r\n const motorhome = \"<span title='Motorhome' class='fas fa-truck'></span>\";\r\n const electrical = \"<span title='Electrical Outlet' class='fas fa-bolt'></span>\";\r\n\r\n switch (type) {\r\n case \"tent\":\r\n return tent;\r\n case \"caravan\":\r\n return caravan + \" \" + all_weather;\r\n case \"motorhome\":\r\n return motorhome + \" \" + all_weather + electrical;\r\n case \"all\":\r\n return tent + \" \" + caravan + \" \" + motorhome + \" \" + electrical;\r\n case \"all-manage\":\r\n return \"<div class='row'>\" + tent + \" \" + caravan + \"</div><div class='row'>\" + motorhome + \" \" + electrical + \"</div>\";\r\n default:\r\n return \"N/A\";\r\n }\r\n}", "getIcon(object) {\n var cont = this.getMarkerIconController();\n return cont.getIcon(object);\n }", "function cargarIconos(){\n // iconos para mostrar puntos\n estilosMarcadores[\"carga\"] = styles.marcadorCarga();\n estilosMarcadores[\"traslado\"] = styles.marcadorTraslado();\n }", "function makeIcons(app) {\n if (HIDDEN_ROLES.indexOf(app.manifest.role) !== -1) {\n return;\n }\n\n if (app.manifest.entry_points) {\n for (var i in app.manifest.entry_points) {\n icons.push(new Icon(app, i));\n }\n } else {\n icons.push(new Icon(app));\n }\n }", "computeDesktopIcons() {\n var _this = this;\n\n return (0, _bluebirdLst().coroutine)(function* () {\n const packager = _this.packager;\n const iconDir = packager.platformSpecificBuildOptions.icon;\n const sources = [iconDir == null ? \"icons\" : iconDir];\n const commonConfiguration = packager.config;\n let icnsPath = (commonConfiguration.mac || {}).icon || commonConfiguration.icon;\n\n if (icnsPath != null) {\n if (!icnsPath.endsWith(\".icns\")) {\n icnsPath += \".icns\";\n }\n\n sources.push(icnsPath);\n }\n\n sources.push(\"icon.icns\");\n sources.push(path.join((0, _pathManager().getTemplatePath)(\"linux\"), \"electron-icons\"));\n const result = yield packager.resolveIcon(sources, \"set\");\n _this.maxIconPath = result[result.length - 1].file;\n return result;\n })();\n }", "icon(properties) {\n properties.tag = \"i\";\n properties.class = this.removeLeadingWhitespace(\n `${this.processContent(properties.class)} fas fa-${properties.icon}`\n );\n return this.getElement(properties);\n }", "function getIcon(name) {\n var icon = undefined;\n var options = _iconSettings.__options;\n name = name ? normalizeIconName(name) : '';\n name = _iconSettings.__remapped[name] || name;\n if (name) {\n icon = _iconSettings[name];\n if (icon) {\n var subset = icon.subset;\n if (subset && subset.fontFace) {\n if (!subset.isRegistered) {\n Object(_uifabric_merge_styles__WEBPACK_IMPORTED_MODULE_2__[\"fontFace\"])(subset.fontFace);\n subset.isRegistered = true;\n }\n if (!subset.className) {\n subset.className = Object(_uifabric_merge_styles__WEBPACK_IMPORTED_MODULE_2__[\"mergeStyles\"])(subset.style, {\n fontFamily: subset.fontFace.fontFamily,\n fontWeight: subset.fontFace.fontWeight || 'normal',\n fontStyle: subset.fontFace.fontStyle || 'normal'\n });\n }\n }\n }\n else {\n if (!options.disableWarnings && options.warnOnMissingIcons) {\n Object(_uifabric_utilities__WEBPACK_IMPORTED_MODULE_1__[\"warn\"])(\"The icon \\\"\" + name + \"\\\" was used but not registered. See http://aka.ms/fabric-icon-usage for more information.\");\n }\n }\n }\n return icon;\n}", "get fontIcon() { return this._fontIcon; }", "get fontIcon() { return this._fontIcon; }", "function cargarIconos(){\n // iconos para mostrar puntos\n estilosActuales[\"carga\"] = styles.marcadorCarga();\n //corregir esto\n estilosActuales[\"Taxi/Remis\"] = styles.marcadorTraslado();\n // default\n estilosActuales[\"default\"] = styles.marcadorDefault();\n }", "get icon() {\n this._logger.debug(\"icon[get]\");\n return this._icon;\n }", "function getIcon(style) {\n switch (style) {\n case \"#icon-1753-0288D1\":\n return \"img/green-atm.png\";\n case \"baby\":\n return \"img/ed-baby.png\";\n case \"#icon-1753-0288D1\":\n return \"img/green-atm.png\";\n case \"barbell\":\n return \"img/blue-barbell.png\";\n case \"#icon-1519-0288D1\":\n return \"img/blue-sports.png\";\n case \"bed\":\n return \"img/red-bed.png\";\n case \"#icon-1522-0288D1\":\n return \"img/purple-bike.png\";\n case \"bike\":\n return \"img/blue-bike.png\";\n case \"#icon-1664-0288d1\":\n return \"img/lightpurple-book.png\";\n case \"#icon-1899-DB4436\":\n return \"img/red-book.png\";\n case \"#icon-1546-DB4436\":\n return \"img/red-buildings.png\";\n // case \"clipboard\":\n // return \"img/clipboard.png\";\n case \"coffee\":\n return \"img/orange-coffee.png\";\n case \"#icon-1820-0288D1\":\n return \"img/green-laptop.png\";\n case \"#icon-1547-0288D1-nodesc\":\n return \"img/purple-downtown.png\";\n case \"#icon-1577-0288D1\":\n return \"img/orange-fastfood.png\";\n case \"#icon-1577-DB4436\":\n return \"img/orange-food.png\";\n case \"#icon-1548-0288D1\":\n return \"img/purple-pillars.png\";\n case \"#icon-1646-DB4436\":\n return \"img/green-health.png\";\n case \"microscope\":\n return \"img/purple-science.png\";\n //case \"minus\": return \"img/minus.png\";\n case \"#icon-1548-0288D1\":\n return \"img/red-music.png\";\n case \"paint-blue\":\n return \"img/blue-paint.png\";\n case \"#icon-1509-0288D1\":\n return \"img/purple-paint.png\";\n case \"rcmp\":\n return \"img/purple-rcmp.png\";\n case \"running\":\n return \"img/blue-running.png\";\n case \"#icon-1685-0288D1\":\n return \"img/shop-green.png\";\n case \"shop-orange\":\n return \"img/orange-retail.png\";\n case \"#icon-1680-0288D1\":\n return \"img/blue-sports.png\";\n case \"#icon-1701-0288D1\":\n return \"img/blue-swim.png\";\n case \"tennis\":\n return \"img/blue-tennis.png\";\n case \"#icon-1709-0288D1\":\n return \"img/blue-threatre.png\";\n case \"ticket\":\n return \"img/purple-ticket.png\";\n case \"#icon-1886-0288D1\":\n return \"img/blue-tree.png\";\n case \"#icon-1890-0288D1\":\n return \"img/blue-volley.png\";\n default:\n return \"img/blue-dot.png\";\n }\n}", "get iconButton() {\n return {\n type: \"rich-text-editor-icon-picker\",\n };\n }", "function getIcon(name) {\n var icon = undefined;\n var options = _iconSettings.__options;\n name = name ? normalizeIconName(name) : '';\n name = _iconSettings.__remapped[name] || name;\n if (name) {\n icon = _iconSettings[name];\n if (icon) {\n var subset = icon.subset;\n if (subset && subset.fontFace) {\n if (!subset.isRegistered) {\n (0,_fluentui_merge_styles__WEBPACK_IMPORTED_MODULE_4__.fontFace)(subset.fontFace);\n subset.isRegistered = true;\n }\n if (!subset.className) {\n subset.className = (0,_fluentui_merge_styles__WEBPACK_IMPORTED_MODULE_5__.mergeStyles)(subset.style, {\n fontFamily: subset.fontFace.fontFamily,\n fontWeight: subset.fontFace.fontWeight || 'normal',\n fontStyle: subset.fontFace.fontStyle || 'normal',\n });\n }\n }\n }\n else {\n // eslint-disable-next-line deprecation/deprecation\n if (!options.disableWarnings && options.warnOnMissingIcons) {\n (0,_fluentui_utilities__WEBPACK_IMPORTED_MODULE_3__.warn)(\"The icon \\\"\" + name + \"\\\" was used but not registered. See https://github.com/microsoft/fluentui/wiki/Using-icons for more information.\");\n }\n }\n }\n return icon;\n}", "function getIcon(name) {\n var icon = undefined;\n var options = _iconSettings.__options;\n name = name ? normalizeIconName(name) : '';\n name = _iconSettings.__remapped[name] || name;\n if (name) {\n icon = _iconSettings[name];\n if (icon) {\n var subset = icon.subset;\n if (subset && subset.fontFace) {\n if (!subset.isRegistered) {\n (0,_fluentui_merge_styles__WEBPACK_IMPORTED_MODULE_4__.fontFace)(subset.fontFace);\n subset.isRegistered = true;\n }\n if (!subset.className) {\n subset.className = (0,_fluentui_merge_styles__WEBPACK_IMPORTED_MODULE_5__.mergeStyles)(subset.style, {\n fontFamily: subset.fontFace.fontFamily,\n fontWeight: subset.fontFace.fontWeight || 'normal',\n fontStyle: subset.fontFace.fontStyle || 'normal',\n });\n }\n }\n }\n else {\n // eslint-disable-next-line deprecation/deprecation\n if (!options.disableWarnings && options.warnOnMissingIcons) {\n (0,_fluentui_utilities__WEBPACK_IMPORTED_MODULE_3__.warn)(\"The icon \\\"\" + name + \"\\\" was used but not registered. See https://github.com/microsoft/fluentui/wiki/Using-icons for more information.\");\n }\n }\n }\n return icon;\n}", "function getIconInfo(namespace_name, success) {\n var filter = \"&CQL_FILTER=layer='\" + namespace_name + \"'\"\n var url = jsonUrl(\"iconmaster\") + filter\n getGeoserverTable(url, success)\n }", "function fullIcon(data) {\n return { ...exports.iconDefaults, ...data };\n}", "oIcon(properties) {\n properties.tag = \"i\";\n properties.class = this.removeLeadingWhitespace(\n `${this.processContent(properties.class)} far fa-${properties.icon}`\n );\n return this.getElement(properties);\n }", "function getFontIcon(alias) {\n var icon = { name: alias, isCustom: false };\n\n switch (alias) {\n case \"ace\":\n icon.name = \"code\";\n icon.isCustom = false;\n break;\n case \"styleselect\":\n case \"styles\":\n case \"fontsizeselect\":\n icon.name = \"icon-list\";\n icon.isCustom = true;\n break;\n case \"umbembeddialog\":\n icon.name = \"icon-tv\";\n icon.isCustom = true;\n break;\n case \"umbmediapicker\":\n icon.name = \"icon-picture\";\n icon.isCustom = true;\n break;\n case \"umbmacro\":\n icon.name = \"icon-settings-alt\";\n icon.isCustom = true;\n break;\n default:\n icon.name = alias;\n icon.isCustom = false;\n }\n\n return icon;\n }", "getIcon(val, context) {\n let ary = val.replaceAll(\"/\", \"-\").split(\":\");\n // legacy API used to fill in icons: for lazy devs so let's mirror\n if (ary.length === 1) {\n ary = [\"icons\", val];\n }\n if (ary.length == 2 && this.iconsets[ary[0]]) {\n if (\n typeof this.iconsets[ary[0]] !== \"string\" &&\n this.iconsets[ary[0]][ary[1]] &&\n typeof this.iconsets[ary[0]][ary[1]] !== \"function\"\n ) {\n return this.iconsets[ary[0]][ary[1]];\n } else if (ary[1]) {\n return `${this.iconsets[ary[0]]}${ary[1]}.svg`;\n }\n }\n // if we get here we just missed on the icon hydrating which means\n // either it's an invalid icon OR the library to register the icons\n // location will import AFTER (possible microtiming early on)\n // also weird looking by context is either the element asking about\n // itself OR the the iconset state manager checking for hydration\n if (context !== this && context) {\n this.needsHydrated.push(context);\n }\n return null;\n }", "function getIconClassName(name) {\n var className = '';\n var icon = Object(__WEBPACK_IMPORTED_MODULE_1__icons__[\"a\" /* getIcon */])(name);\n if (icon) {\n className = Object(__WEBPACK_IMPORTED_MODULE_0__uifabric_merge_styles__[\"g\" /* mergeStyles */])(icon.subset.className, defaultIconStyles, {\n selectors: {\n '::before': {\n content: \"\\\"\" + icon.code + \"\\\"\"\n }\n }\n });\n }\n return className;\n}", "function updateIcon () {\n browser.browserAction.setIcon({\n path: currentBookmark\n ? {\n 19: '../public/star-filled-19.png',\n 38: '../public/star-filled-38.png'\n }\n : {\n 19: '../public/star-empty-19.png',\n 38: '../public/star-empty-38.png'\n },\n tabId: currentTab.id\n })\n browser.browserAction.setTitle({\n // Screen readers can see the title\n title: currentBookmark ? 'Unbookmark it!' : 'Bookmark it!',\n tabId: currentTab.id\n })\n}", "updateDriveSpecificIcons() {\n const metadata = this.parentTree_.metadataModel.getCache(\n [this.dirEntry_], ['shared', 'isMachineRoot', 'isExternalMedia']);\n\n const icon = this.querySelector('.icon');\n icon.classList.toggle('shared', !!(metadata[0] && metadata[0].shared));\n\n if (metadata[0] && metadata[0].isMachineRoot) {\n icon.setAttribute(\n 'volume-type-icon', VolumeManagerCommon.RootType.COMPUTER);\n }\n\n if (metadata[0] && metadata[0].isExternalMedia) {\n icon.setAttribute(\n 'volume-type-icon', VolumeManagerCommon.RootType.EXTERNAL_MEDIA);\n }\n }", "get flagIcon() {\n return FLAGS + \"/\" + this.popoverRegion.code + \".png\";\n }", "function getSearchImage(objectType)\n{\n switch (objectType)\n {\n case \"device\":\n return \"icon-desktop\"\n break;\n default:\n return \"icon-exclamation-circle\"\n break;\n }\n}", "function getIcon(description) {\n if(ICONS.hasOwnProperty(description)) {\n return ICON_PATH + ICONS[description];\n }\n return ICON_PATH + DEFAULT_ICON;\n}" ]
[ "0.7022685", "0.6987905", "0.6862808", "0.6845584", "0.67316145", "0.6693436", "0.660245", "0.6580989", "0.6570295", "0.6570295", "0.65496427", "0.65496427", "0.65430087", "0.65430087", "0.65259886", "0.65188533", "0.65188533", "0.65053725", "0.65053725", "0.6476853", "0.6476853", "0.6474752", "0.64693105", "0.6456801", "0.6456801", "0.6449955", "0.6449955", "0.6447834", "0.6447834", "0.64476687", "0.64476687", "0.64405525", "0.64405525", "0.64313924", "0.6425735", "0.6425735", "0.6409617", "0.6394964", "0.6380712", "0.63660836", "0.63660836", "0.6362049", "0.6362049", "0.6359937", "0.63484", "0.63393664", "0.6331867", "0.6331867", "0.63157785", "0.63157785", "0.6311479", "0.6302269", "0.6298103", "0.6298103", "0.62860656", "0.62860656", "0.6258718", "0.6239506", "0.6239506", "0.6233337", "0.6230442", "0.6209729", "0.6191018", "0.615128", "0.61004645", "0.60987306", "0.6084174", "0.60839754", "0.6079409", "0.60741633", "0.6073638", "0.6071391", "0.6065188", "0.60453445", "0.60351384", "0.60223293", "0.60208106", "0.6011007", "0.599895", "0.5981816", "0.5959997", "0.59568596", "0.5955513", "0.5955513", "0.5954004", "0.5951253", "0.5945827", "0.5940264", "0.5914409", "0.5914409", "0.5903544", "0.58955336", "0.5892826", "0.5889282", "0.58863175", "0.58862406", "0.5886001", "0.5876683", "0.5875533", "0.5869753", "0.58631384" ]
0.0
-1
React navigation tab stack for Playlist Analyser.
function TabOneNavigator() { return ( <TabOneStack.Navigator> <TabOneStack.Screen name="PlaylistAnalyserHome" component={PlaylistAnalyser} options={{ headerTitle: 'Playlist Analyser' }} /> <TabOneStack.Screen name="SearchSong" component={SearchSong} options={{ headerTitle: 'Playlist Analyser' }} /> <TabOneStack.Screen name="SearchPlaylist" component={SearchPlaylist} options={{ headerTitle: 'Playlist Analyser' }} /> <TabOneStack.Screen name="SearchPlaylistResults" component={SearchPlaylistResults} options={{ headerTitle: 'Playlist Analyser' }} /> <TabOneStack.Screen name="PlaylistResults" component={PlaylistResults} options={{ headerTitle: 'Playlist Analyser' }} /> </TabOneStack.Navigator> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render(){\n var trackers_list = get_top_trackers()\n\n return (\n <div className=\"flex-container\">\n <Tab.Container id=\"tracker-tabs\" defaultActiveKey=\"first\">\n <Row class=\"tracker-list-box\">\n <Col sm={3}>\n <Nav variant=\"pills\" className=\"flex-column\">\n <Nav.Item>\n <Nav.Link variant=\"primary\" className=\"header-tab\" eventKey=\"first\">Website</Nav.Link>\n </Nav.Item>\n {trackers_list.map(datas =>\n <Nav.Item>\n <Nav.Link variant=\"primary\" eventKey={datas[0]}>{datas[0]}</Nav.Link>\n </Nav.Item>\n )}\n </Nav>\n </Col>\n <Col sm={8}>\n <Tab.Content>\n <Tab.Pane eventKey=\"first\">\n <p className=\"text-for-tabs\"> Click on a tab to view a scrollable list of the trackers on that website!\n </p>\n </Tab.Pane>\n {trackers_list.map(datas =>\n <Tab.Pane eventKey={datas[0]}>\n <ul class=\"tracker-list\">\n {datas[1].map(tracker =>\n <li style={{listStyle: 'circle', marginLeft: '4px', marginTop: '2px', marginBottom: '2px'}}>{tracker}</li>\n )}\n </ul>\n </Tab.Pane>\n )}\n </Tab.Content>\n </Col>\n </Row>\n </Tab.Container>\n </div>\n )\n }", "renderTabs() {\n return (\n <Tabs defaultActiveKey={1} id=\"tab\" >\n <Tab eventKey={1} title=\"Projects\">\n {this.renderProjs()}\n </Tab>\n <Tab eventKey={2} title=\"Users\">\n {this.renderUsers()}\n </Tab>\n <Tab eventKey={3} title=\"Search\">\n {this.renderSearch()}\n <ListGroup><br /><br />\n {this.renderResult()}\n </ListGroup>\n </Tab>\n </Tabs>\n );\n }", "function TabStack(props) {\n const tabPress = (e) => {\n global.currenRouter = e.target.split(\"-\")[0];\n };\n return (\n <Tab.Navigator\n initialRouteName=\"Home\"\n activeColor=\"#e91e63\"\n shifting={true}\n barStyle={{\n backgroundColor: \"white\",\n }}\n >\n <Tab.Screen\n name=\"Home\"\n component={CategoriesScreen}\n listeners={{ tabPress }}\n options={{\n title: \"Trang chủ\",\n tabBarIcon: ({ color }) => (\n <Icon color={color} name=\"home\" size={26} />\n ),\n }}\n />\n\n {/* <Tab.Screen name=\"Template\" component={TemplateStackScreen} listeners={{ tabPress }} /> */}\n <Tab.Screen\n name=\"Message\"\n component={MessageScreen}\n listeners={{ tabPress }}\n options={{\n title: \"Tin Nhắn\",\n tabBarIcon: ({ color }) => (\n <Icon color={color} name=\"comment\" size={26} />\n ),\n }}\n />\n <Tab.Screen\n name=\"Account\"\n component={AccountScreen}\n listeners={{ tabPress }}\n options={{\n title: \"Tài Khoản\",\n tabBarIcon: ({ color }) => (\n <Icon color={color} name=\"account-circle\" size={26} />\n ),\n }}\n />\n </Tab.Navigator>\n );\n}", "renderProjs() {\n return (\n <div className=\"projs\">\n <PageHeader>All Projects</PageHeader>\n <Tabs defaultActiveKey={1} id=\"projtab\" >\n <Tab eventKey={1} title=\"All Projects\">\n <ListGroup>\n {this.renderProjsList(this.state.projs)}\n </ListGroup>\n </Tab>\n <Tab eventKey={2} title=\"Completed Projects\">\n <ListGroup>\n {this.renderCompProjsList(this.state.projs)}\n </ListGroup>\n </Tab>\n <Tab eventKey={3} title=\"Active Projects\">\n <ListGroup>\n {this.renderActiveProjsList(this.state.projs)}\n </ListGroup>\n </Tab>\n <Tab eventKey={4} title=\"Pending Projects\">\n <ListGroup>\n {this.renderPendingProjsList(this.state.projs)}\n </ListGroup>\n </Tab>\n </Tabs>\n </div>\n );\n }", "function TabTwoNavigator() {\n return (\n <TabTwoStack.Navigator>\n <TabTwoStack.Screen\n name=\"SongAnalyserHome\"\n component={SongAnalyser}\n options={{ headerTitle: 'Song Analyser' }}\n />\n <TabTwoStack.Screen\n name=\"SearchSong\"\n component={SearchSong}\n options={{ headerTitle: 'Song Analyser' }}\n />\n <TabTwoStack.Screen\n name=\"SongResults\"\n component={SongResults}\n options={{ headerTitle: 'Song Analyser' }}\n />\n </TabTwoStack.Navigator>\n );\n}", "setStackTab() {\n }", "render() {\n const { appNavigationState } = this.props;\n const { tabs } = appNavigationState;\n const tabKey = tabs.routes[tabs.index].key;\n const scenes = appNavigationState[tabKey];\n\n return (\n <View style={styles.navigator}>\n <NavigationCardStack\n key={`stack_${tabKey}`}\n onNavigateBack={this.back}\n navigationState={scenes}\n renderOverlay={this.renderHeader}\n renderScene={this.renderScene}\n style={styles.navigatorCardStack}\n />\n <YourTabs\n navigationState={tabs}\n />\n </View>\n );\n }", "function MainView() {\n return (\n <div className=\"col-md-9\">\n <div className=\"feed-toggle\">\n <ul className=\"nav nav-pills outline-active\">\n <YourFeedTab />\n\n <GlobalFeedTab />\n\n <TagFilterTab />\n </ul>\n </div>\n\n <ArticleList />\n </div>\n );\n}", "phaseTabs() {\n var allPhasesTab = (\n <li key={'all'} className={'tab ' + this.isViewingPhase('all')}>\n <a id={'all'} onClick={this.setPhase}>All Games</a>\n </li>\n );\n var tabList = [allPhasesTab];\n for(var phase in this.props.divisions) {\n if(phase != 'noPhase') {\n var oneTab = (\n <li key={phase} className={'tab ' + this.isViewingPhase(phase)}>\n <a id={phase} onClick={this.setPhase}>{phase}</a>\n </li>\n );\n tabList.push(oneTab);\n }\n }\n var skinny = this.state.overflowTabs ? '' : ' skinny-tabs';\n return (\n <div className=\"nav-content\">\n <ul className={'tabs tabs-transparent' + skinny} id=\"phase-tabs\">\n {tabList}\n </ul>\n </div>\n );\n }", "function Tabs(props){\n const allTabs = ['synopsis', 'cast', 'episodes', 'related'];\n const tabNames = ['Story', 'Cast', 'Eps.', 'Related'];\n\n const tabs = allTabs.map((tab, index) => {\n const load = (tab === 'synopsis' ? null : 'MAL'); // Whether to load MAL or not\n const onTab = props.currentTab === tab // See if it's on\n const className = `tab-${tab} ` + (onTab ? 'on' : null); // If on, add \"on\"\n\n return(<div key={tab} className={className} onClick={() => props.handleTab(tab, load)}> {tabNames[index]}</div>)\n });\n\n return(\n <div className=\"window-tabs\">\n {tabs}\n </div>\n )\n }", "render(){\n\n\n return (\n\n\n <Tab.Navigator\n \n >\n \n <Tab.Screen name=\"Profile\" component={ProfileStackScreen} />\n <Tab.Screen name=\"Post\" component={PostStackScreen} />\n <Tab.Screen name=\"Friends\" component={FriendsStackScreen} />\n <Tab.Screen name=\"Chitts\" component={ChittsStackScreen} />\n\n </Tab.Navigator>\n\n )\n }", "function Interview(props) {\n\n //Creating object of pages\n const navigation = {\n pages: [\n { path: '/', label: 'Welcome', },\n { path: '/about-me', label: 'About Me' },\n { path: '/about-website', label: 'Why this website?' }\n ],\n }\n\n //Handler for Navigation tab changed\n const selectionHandler = (event, value) => {\n props.history.push(value);\n }\n\n return (\n //Website Navigation Tabs \n <Grid className='Interview' style={{height: '100%'}}>\n <CustomTabs\n value={props.history.location.pathname || '/'}\n onChange={selectionHandler}\n centered\n >\n {navigation.pages.map((page) => {\n return (\n <CustomTab value={page.path} label={page.label} key={page.path} />\n )\n })}\n </CustomTabs>\n {/*Configuring Switch to rerender exact page requested*/}\n <Switch>\n <Route path='/about-website'>\n <AboutWebsite />\n </Route>\n <Route path='/about-me'>\n <AboutMe />\n </Route>\n <Route path='/'>\n <Welcome />\n </Route>\n </Switch>\n <Footer />\n </Grid>\n );\n}", "getRenderedTabs() {\n let changeTab = this.props.changeTab;\n let shownTab = this.props.shownTab;\n\n let addClass = shownTab === TAB_ADD ? 'active' : '';\n let searchClass = shownTab === TAB_SEARCH ? 'active' : '';\n\n return (\n <ul className='nav nav-tabs'>\n <li className={addClass}\n onClick={changeTab.bind(this, TAB_ADD)}\n >\n <a href='#'>Wall</a>\n </li>\n <li className={searchClass}\n onClick={changeTab.bind(this, TAB_SEARCH)}\n >\n <a href='#'>Search</a>\n </li>\n </ul>\n );\n }", "render() {\n return (\n <div>\n <h1>Ja<span className=\"highlight\">mmm</span>ing</h1>\n <div className=\"App\">\n <SearchBar onSearch={this.search} />\n <div className=\"App-playlist\">\n <SearchResults searchResults={this.state.searchResults}\n onAdd={this.addTrack}/>\n <PlayList name={this.state.playlistName}\n tracks={this.state.playlistTracks} onRemove={this.removeTrack}\n onNameChange={this.updatePlaylistName} onSave={this.savePlaylist} />\n </div>\n </div>\n </div>\n );\n }", "function TabStackNavigator() {\n return (\n <Stack.Navigator screenOptions={{headerShown: false}}>\n <Stack.Screen name={ROUTES.Tab1} component={Home} />\n <Stack.Screen name={ROUTES.Search} component={Search} />\n <Stack.Screen name={ROUTES.Quotes} component={QuoteStackNavigator} />\n <Stack.Screen name={ROUTES.Clients} component={ClientStackNavigator} />\n <Stack.Screen name={ROUTES.Users} component={UsersStackNavigator} />\n <Stack.Screen name={ROUTES.Orders} component={OrdersStackNavigator} />\n <Stack.Screen name={ROUTES.Products} component={ProductStackNavigator} />\n <Stack.Screen\n name={ROUTES.UploadOrders}\n component={UploadOrdersStackNavigator}\n />\n <Stack.Screen\n name={ROUTES.SupportRequests}\n component={RequestsStackNavigator}\n />\n </Stack.Navigator>\n );\n}", "render () {\n\t\tlet { tabStates } = this.state;\n\t\tlet { project, diagram } = this.props;\n\t\tlet tabs = [];\n\n\t\ttabs.push(Tab(0, project ? project.name : 'No Project selected', ProjectMenu, this.props));\n\n\t\tif (project) {\n\t\t\ttabs.push(Tab(1, diagram ? diagram.name : 'No Diagram selected', DiagramMenu, this.props));\n\t\t\tif (diagram) {\n\t\t\t\ttabs.push(Tab(2, `Components [${diagram.type}]`, ComponentMenu, this.props));\n\t\t\t}\n\t\t}\n\n\t\treturn <div className=\"side\">\n\t\t\t<Tabs tabs={tabs} toggle={this.setTabState} states={tabStates}/>\n\t\t</div>;\n\t}", "function NavTabs(props) {\n const {\n tabs = [],\n currentPage,\n handlePageChange,\n } = props;\n \n return (\n <ul className=\"nav nav-tabs ml-auto my-1 mr-2\">\n {tabs.map((tab) => (\n <li\n className=\"nav-item\"\n key={tab}\n style={{\n backgroundColor: \"#122240\",\n color: \"#be8180\",\n }}\n >\n <a\n style={{\n backgroundColor: \"#122240\",\n color: \"#be8180\",\n }}\n href={\"#\" + tab.toLowerCase()}\n // Whenever a tab is clicked on,\n // the current page is set through the handlePageChange props.\n onClick={() => handlePageChange(tab)}\n className={currentPage === tab ? \"nav-link active\" : \"nav-link\"}\n >\n {tab}\n </a>\n </li>\n ))}\n </ul>\n );\n}", "function HomeBottomTabs() {\n return (\n <Tab.Navigator\n //customize the bottom tabs using the customTabBarStyle\n tabBarOptions={customTabBarStyle}\n >\n <Tab.Screen\n name=\"Classes\"\n //make this tab go to the classes screen\n component={ClassesStackScreen}\n options={{\n //make the icon for this tab a scholar's cap\n tabBarIcon: ({ color, size }) => (\n <Ionicons name=\"school-outline\" size={size} color={color} />\n ),\n }}\n />\n <Tab.Screen\n name=\"Notes\"\n //make this tab go to the library screen\n component={LibraryStackScreen}\n options={{\n //make the icon for this tab a notes icon\n tabBarIcon: ({ color, size }) => (\n <SimpleLineIcons name=\"note\" size={size} color={color} />\n ),\n }}\n />\n <Tab.Screen\n name=\"Folders\"\n //make this tab go to the folders screen\n component={FoldersStackScreen}\n options={{\n //make the icon for this tab a folder\n tabBarIcon: ({ color, size }) => (\n <AntDesign name=\"folder1\" size={size} color={color} />\n ),\n }}\n />\n <Tab.Screen\n name=\"Planner\"\n //make this tab go to the planner screen\n component={PlannerStackScreen}\n options={{\n //make the icon for this tab a calendar\n tabBarIcon: ({ color, size }) => (\n <FontAwesome5 name=\"calendar-check\" size={size} color={color} />\n ),\n }}\n />\n </Tab.Navigator>\n );\n}", "render() {\n\n return (\n <div className=\"settings-subnav\">\n <Tabs.Tabs className=\"grid-one\">\n <Tabs.Tab label=\"General\">\n <section className=\"grid-one\">\n <div className=\"grid-item\"><BasicCard/></div>\n <div className=\"grid-item\"><BasicCard/></div>\n <div className=\"grid-item\"><Toggle label=\"Toggle Stuff\" defaultToggled={true}/></div>\n </section>\n </Tabs.Tab>\n <Tabs.Tab label=\"Design\" >\n </Tabs.Tab>\n <Tabs.Tab label=\"Modules\" />\n <Tabs.Tab label=\"Notify\" />\n <Tabs.Tab label=\"Priveleges\" />\n </Tabs.Tabs>\n </div>\n // <DropDownMenu menuItems={menuItems} onChange={this.transitionToRoute} />\n );\n }", "getTabs() {\n let tabList = []\n for (const tabLabel of Object.values(this.props.tabs)) {\n tabList.push(<Tab key={tabLabel} title={tabLabel} tabs={this.props.tabs} updateTabs={() => this.props.updateTabs(this.props.keywordsToSearch)}> </Tab>)\n }\n return tabList\n }", "function App() {\n return (\n <div className=\"App\">\n <Nav arr={tab}/>\n\n </div>\n );\n}", "handleNavClicks() {\n if (hasEl(`#${this.playlistNavPrev.id}`)) {\n this.playlistNavPrev.addEventListener('click', (e) => {\n e.preventDefault()\n this.prev()\n })\n }\n if (hasEl(`#${this.playlistNavNext.id}`)) {\n this.playlistNavNext.addEventListener('click', (e) => {\n e.preventDefault()\n this.next()\n })\n }\n }", "function ClassBottomTabs({ route }) {\n return (\n <Tab.Navigator\n //customize the bottom tabs using the customTabBarStyle\n //edit some of the parameters from the customTabBarStyle to suit the class that the user navigated to\n tabBarOptions={{\n ...customTabBarStyle,\n activeTintColor: route.params.tintColor,\n style: {\n backgroundColor: \"white\",\n },\n }}\n >\n <Tab.Screen\n name=\"Camera\"\n options={{\n //make the bottom tab icon a camera\n tabBarIcon: ({ color, size }) => (\n <Feather name=\"camera\" size={size} color={color} />\n ),\n }}\n >\n {/* Customize the header of the camera screen to suit the class that the user navigated to */}\n {(props) => (\n <CameraStackScreen\n {...props}\n title={route.params.title}\n backgroundColor={route.params.backgroundColor}\n iconName={route.params.iconName}\n />\n )}\n </Tab.Screen>\n <Tab.Screen\n name=\"Notes\"\n options={{\n //make the bottom tab icon a notes icon\n tabBarIcon: ({ color, size }) => (\n <SimpleLineIcons name=\"note\" size={size} color={color} />\n ),\n }}\n >\n {/* Customize the header of the library screen to suit the class that the user navigated to */}\n {(props) => (\n <LibraryStackScreen\n {...props}\n title={route.params.title}\n backgroundColor={route.params.backgroundColor}\n iconName={route.params.iconName}\n />\n )}\n </Tab.Screen>\n <Tab.Screen\n name=\"Folders\"\n options={{\n //make the bottom tab icon a folder\n tabBarIcon: ({ color, size }) => (\n <AntDesign name=\"folder1\" size={size} color={color} />\n ),\n }}\n >\n {/* Customize the header of the folders screen to suit the class that the user navigated to */}\n {(props) => (\n <FoldersStackScreen\n {...props}\n title={route.params.title}\n backgroundColor={route.params.backgroundColor}\n iconName={route.params.iconName}\n />\n )}\n </Tab.Screen>\n <Tab.Screen\n name=\"Planner\"\n options={{\n //make the bottom tab icon a calendar\n tabBarIcon: ({ color, size }) => (\n <FontAwesome5 name=\"calendar-check\" size={size} color={color} />\n ),\n }}\n >\n {/* Customize the header of the planner screen to suit the class that the user navigated to */}\n {(props) => (\n <PlannerStackScreen\n {...props}\n title={route.params.title}\n backgroundColor={route.params.backgroundColor}\n iconName={route.params.iconName}\n />\n )}\n </Tab.Screen>\n </Tab.Navigator>\n );\n}", "function TabLinks(props) {\n \n const state = useContext(UserContext);\n const { value, setValue } = state;\n\n const handleChange = (event, newValue) => {\n setValue(newValue);\n };\n\n const handleLinks = value => {\n props.history.replace(value)\n };\n\n return (\n <div style={{ flexGrow: \"1\", margin: \"0\"}}>\n <Tabs\n value={value}\n onChange={handleChange}\n indicatorColor=\"primary\"\n textColor=\"primary\"\n variant={$(window).width() < 769 ? \"fullWidth\" : \"standard\"}\n centered\n >\n <Tab label=\"Home\" className={\"tabs\"} onClick={() => handleLinks(\"/\")} />\n <Tab label={$(window).width() < 769 ? \"Upcoming\" : \"Upcoming Items\"} className={\"tabs\"} onClick={() => handleLinks(\"/upcoming\")} />\n <Tab label={$(window).width() < 769 ? \"Weapons\" : \"Weapon Search\"} className={\"tabs\"} onClick={() => handleLinks(\"/weaponsearch\")}/>\n <Tab label={$(window).width() < 769 ? \"Players\" : \"Player Information\"} className={\"tabs\"} onClick={() => handleLinks(\"/playersearch\")}/>\n </Tabs>\n </div>\n );\n}", "render() {\n if (this.state.error) {\n return <Redirect to=\"/\" />;\n }\n\n return (\n <div>\n <Tabs\n defaultActiveKey=\"0\"\n renderTabBar={() => <ScrollableInkTabBar />}\n renderTabContent={() => <TabContent />}\n >\n { this.getTabPanes() }\n </Tabs>\n </div>\n );\n }", "_genTab(){\n const tabs = {}\n const {keys,theme} = this.props\n this.preKeys = keys\n keys.forEach((item,index) => {\n if(item.checked){\n tabs[`tab${index}`] = {\n screen: props => <TreadingTabPage theme={theme} {...props} timeSpan={this.state.timeSpan} tabLabel={item.name}/>, // 这是个不错的技巧\n navigationOptions:{\n title:item.name\n }\n }\n }\n });\n return tabs\n }", "function TabbedPanel(props) {\n const { sections, currentSection } = props;\n\n const [tab, setTab] = React.useState(0);\n const handleChange = (evt, newTab) => {\n setTab(newTab);\n };\n\n if (sections && sections[currentSection]) {\n return (\n <div style={styling.tabbedPanels}>\n <AppBar\n position=\"static\"\n style={{\n backgroundColor: ProfileBackgroundColor,\n borderBottomRightRadius: \"20px\"\n }}\n >\n <Tabs value={tab} onChange={handleChange} aria-label=\"subtabs\">\n {getPanelTabs(sections, currentSection, SUBTAB_STR)}\n </Tabs>\n </AppBar>\n {getPanelStack(sections, currentSection, SUBTAB_STR, tab)}\n </div>\n );\n } else {\n return null;\n }\n}", "render() {\n const { activeTab } = this.state;\n return (\n <div className=\"Game\">\n <Menu inverted size=\"massive\" widths={4} stackable attached=\"bottom\">\n {this.createTab(\n 'players', 'orange', this.props.lfgCount, 'new recruit', 'Recruit Noobs')}\n {this.createTab(\n 'teams', 'green', this.props.rosterCount, 'free player', 'Group Players into Teams')}\n {this.createTab(\n 'matches', 'red', this.props.teamWaitingCount, 'ready team', 'Battle!')}\n {this.createTab(\n 'stats', 'grey', this.props.newAchievements, 'achievement', 'Progress & Achievements')}\n </Menu>\n <div className=\"GameContent\">\n <Players display={activeTab === 'players'} />\n <Teams display={activeTab === 'teams'} />\n <Matches display={activeTab === 'matches'} />\n </div>\n </div>\n );\n }", "renderTabs() {\n return React.Children.map(this.props.children, (child, index) => {\n if (!child) return null;\n\n return React.cloneElement(child, {\n index,\n onClick: this.onTabClick,\n isActive: index === this.state.activeTab\n });\n });\n }", "render() {\n let self = this;\n let count = 0;\n return (\n <div className=\"start\">\n <div className=\"start-header\">\n <div>\n <h1>Weather Report</h1>\n\n </div>\n </div>\n\n <div className=\"start-body\">\n <div>\n <Search\n placeholder=\"Search the weather city\"\n onChange={this.onSearchKeyChange.bind(this)}\n onSearch={this.handleSearch.bind(this)}\n style={{ width: \"50vh\" }}\n\n />\n </div>\n <br />\n\n <Tabs defaultActiveKey=\"1\" onChange={this.callback}>\n <TabPane tab=\"Weather 5 day / 3 hour forecast above 20\" key=\"1\">\n {this.state.allWeatherabove20.map(function (item) {\n return (\n <div>\n <Collapse >\n <Panel header={item.Date}>\n <Descriptions title=\"Weather Info\" bordered>\n <Descriptions.Item label=\"Date Time\">\n {item.Date}\n </Descriptions.Item>\n\n <Descriptions.Item label=\"Temperature\">\n {item.Temperature}\n </Descriptions.Item>\n </Descriptions>\n\n </Panel>\n\n </Collapse>\n </div>\n )\n })}\n\n </TabPane>\n <TabPane tab=\"Sunny/Clear Weather\" key=\"2\">\n {this.state.allclearWeather.map(function (item) {\n return (\n <div>\n <Collapse >\n <Panel header={item.Date}>\n <Descriptions title=\"Weather Info\" bordered>\n <Descriptions.Item label=\"Date Time\">\n {item.Date}\n </Descriptions.Item>\n\n <Descriptions.Item> \n <Image width={100} src={item.Image}\n /> </Descriptions.Item>\n\n <Descriptions.Item label=\"Description\">\n {item.Description}\n </Descriptions.Item>\n </Descriptions>\n\n </Panel>\n\n </Collapse>\n </div>\n )\n })}\n\n </TabPane>\n </Tabs>\n\n\n\n </div>\n\n\n </div>\n\n );\n }", "render() {\n const { bookings, future, onFindWorkshopClick, past } = this.props\n const tabStyle = {\n backgroundColor: this.context.muiTheme.palette.accent2Color,\n color: this.context.muiTheme.palette.primary1Color\n }\n\n return (\n <div className={classes.container}>\n <Tabs\n inkBarStyle={{backgroundColor: this.context.muiTheme.palette.primary1Color}}\n onChange={this._handleChange}\n value={this.state.slideIndex}\n >\n <Tab\n label={strings.label_future}\n style={tabStyle}\n value={0}\n />\n <Tab\n label={strings.label_past}\n style={tabStyle}\n value={1}\n />\n </Tabs>\n <SwipeableViews\n containerStyle={{height: '100%'}}\n slideStyle={{height: '100%'}}\n style={{height: 'calc(100% - 48px)'}}\n index={this.state.slideIndex}\n onChangeIndex={this._handleChange}\n >\n <BookingsTab\n bookings={future}\n messageNoBookings={strings.message_no_future_bookings}\n onFindWorkshopClick={onFindWorkshopClick}\n />\n <BookingsTab\n bookings={past}\n messageNoBookings={strings.message_no_past_bookings}\n onFindWorkshopClick={onFindWorkshopClick}\n />\n </SwipeableViews>\n {this.props.showHelp &&\n <HelpOverlay\n hasBookings={bookings.length > 0}\n onClose={this.props.onHelpClose}\n />\n }\n </div>\n )\n }", "function NavTabs(props) {\n return (\n <div>\n <nav className='navbar pt-3 pb-3 navbar-expand-lg nav-jgMain fixed-top bg-dark'>\n <div className='container'>\n <a className='navbar-brand navbar-brand-jg' href='index.html'>\n JENNERATION\n </a>\n <button\n className='navbar-toggler navbar-dark bg-dark'\n type='button'\n data-toggle='collapse'\n data-target='#navbarNavAltMarkup'\n aria-controls='navbarNavAltMarkup'\n aria-expanded='false'\n aria-label='Toggle navigation'\n >\n <span className='navbar-toggler-icon'></span>\n </button>\n <div\n className='collapse navbar-collapse justify-content-end'\n id='navbarNavAltMarkup'\n >\n <div className='navbar-nav'>\n <a\n className='nav-item nav-link active'\n href='#home'\n onClick={() => props.handlePageChange(\"Home\")}\n className={\n props.currentPage === \"Home\" ? \"nav-link active\" : \"nav-link\"\n }\n >\n Home<span className='sr-only'>(current)</span>\n </a>\n\n <a\n className='nav-item nav-link active'\n href='#projects'\n onClick={() => props.handlePageChange(\"Projects\")}\n className={\n props.currentPage === \"Projects\"\n ? \"nav-link active\"\n : \"nav-link\"\n }\n >\n Works\n </a>\n\n <a\n className='nav-item nav-link active'\n href='#about'\n onClick={() => props.handlePageChange(\"About\")}\n className={\n props.currentPage === \"About\" ? \"nav-link active\" : \"nav-link\"\n }\n >\n About\n </a>\n\n <a\n className='nav-item nav-link active'\n href='#contact'\n onClick={() => props.handlePageChange(\"Contact\")}\n className={\n props.currentPage === \"Contact\"\n ? \"nav-link active\"\n : \"nav-link\"\n }\n >\n Contact\n </a>\n </div>\n </div>\n </div>\n </nav>\n </div>\n );\n}", "function setupTabs() {\n\tdocument.querySelectorAll('.tabs__button').forEach((button) => {\n\t\tbutton.addEventListener('click', () => {\n\t\t\tconst sideBar = button.parentElement;\n\t\t\tconst tabsContainer = sideBar.parentElement;\n\t\t\tconst tabNumber = button.dataset.forTab;\n\t\t\tconst tabToActivate = tabsContainer.querySelector(`.tabs__content[data-tab=\"${tabNumber}\"]`);\n\n\t\t\tsideBar.querySelectorAll('.tabs__button').forEach((button) => {\n\t\t\t\tbutton.classList.remove('tabs__button--active');\n\t\t\t});\n\n\t\t\ttabsContainer.querySelectorAll('.tabs__content').forEach((tab) => {\n\t\t\t\ttab.classList.remove('tabs__content--active');\n\t\t\t});\n\n\t\t\tbutton.classList.add('tabs__button--active');\n\t\t\ttabToActivate.classList.add('tabs__content--active');\n\t\t});\n\t});\n}", "constructor(userScript, onInitialize, config) {\n super();\n this._config = config;\n\n this.userScript = userScript;\n this.currentTabIndex = 0;\n this._tabs = [];\n this._closedTabs = [];\n this._pastURLs = [];\n this._pastTitles = [];\n this._onInitialize = onInitialize;\n\n const TOPBAR_HEIGHT = config.TOPBAR_HEIGHT;\n\n // Width ratio computation\n const LOCATION_WIDTH_RATIO = 0.5;\n const TOOLBAR_CONTAINER_WIDTH_RATIO = (1.0 - LOCATION_WIDTH_RATIO) / 2;\n\n let leftToolBar = new ToolBarButtonContainer(\n \"left\",\n TOOLBAR_CONTAINER_WIDTH_RATIO\n );\n let rightToolBar = new ToolBarButtonContainer(\n \"right\",\n TOOLBAR_CONTAINER_WIDTH_RATIO\n );\n\n let completion = new LocationBarCompletion(this, TOPBAR_HEIGHT);\n const locationBar = new LocationBar(this, completion, LOCATION_WIDTH_RATIO);\n this._locationBar = locationBar;\n completion.locationBar = locationBar;\n\n const toolbar = new ToolBar(TOPBAR_HEIGHT);\n this._toolbar = toolbar;\n\n const tabAndContentContainer = new TabAndContentContainer(TOPBAR_HEIGHT);\n this._tabAndContentContainer = tabAndContentContainer;\n\n const tabContentHolder = new TabContentHolder(this);\n this._tabContentHolder = tabContentHolder;\n\n const searchBar = new SearchBar(this);\n this._searchBar = searchBar;\n\n const tabList = config.TAB_VERTICAL\n ? new TabListVertical(this)\n : new TabListHorizontal(this);\n this._tabList = tabList;\n\n rightToolBar\n .addChild(\n new ToolBarButton(\"questionmark.circle\", () => this.showKeyHelp())\n )\n .addChild(\n new ToolBarButton(\"rectangle.on.rectangle\", () =>\n this.selectTabsByPanel()\n )\n )\n .addChild(new ToolBarButton(\"plus\", () => this.createNewTab(null, true)))\n .addChild(new ToolBarButton(\"square.and.arrow.up\", () => this.share()));\n\n leftToolBar\n .addChild(new ToolBarButton(\"multiply\", () => $app.close()))\n .addChild(new ToolBarButton(\"chevron.left\", () => this.goBack()))\n .addChild(new ToolBarButton(\"chevron.right\", () => this.goForward()))\n .addChild(new ToolBarButton(\"book\", () => this.showBookmark()));\n\n // Declare view relationship\n toolbar\n .addChild(leftToolBar)\n .addChild(locationBar)\n .addChild(rightToolBar);\n\n tabContentHolder.addChild(searchBar);\n\n tabAndContentContainer.addChild(tabList).addChild(tabContentHolder);\n\n this.addChild(completion)\n .addChild(toolbar)\n .addChild(tabAndContentContainer);\n\n // Render UI\n this.render();\n }", "function displayTabOnClick() {\n const tabs = document.querySelectorAll(\"#resources-nav .nav-item\");\n tabs.forEach(function (tabButton) {\n tabButton.addEventListener(\"click\", function (e) {\n e.preventDefault();\n let tabContentId = tabButton.id.split(/tab\\-(.+)/)[1];\n openCategory(e, tabContentId);\n });\n });\n}", "function NavTabs(props) {\n return /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_2__[\"jsxDEV\"])(\"div\", {\n children: /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_2__[\"jsxDEV\"])(\"nav\", {\n className: \"navbar pt-3 pb-3 navbar-expand-lg nav-jgMain fixed-top bg-dark\",\n children: /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_2__[\"jsxDEV\"])(\"div\", {\n className: \"container\",\n children: [/*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_2__[\"jsxDEV\"])(\"a\", {\n className: \"navbar-brand navbar-brand-jg\",\n href: \"index.html\",\n children: \"JENNERATION\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 8,\n columnNumber: 11\n }, this), /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_2__[\"jsxDEV\"])(\"button\", {\n className: \"navbar-toggler navbar-dark bg-dark\",\n type: \"button\",\n \"data-toggle\": \"collapse\",\n \"data-target\": \"#navbarNavAltMarkup\",\n \"aria-controls\": \"navbarNavAltMarkup\",\n \"aria-expanded\": \"false\",\n \"aria-label\": \"Toggle navigation\",\n children: /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_2__[\"jsxDEV\"])(\"span\", {\n className: \"navbar-toggler-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 16,\n columnNumber: 13\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 9,\n columnNumber: 11\n }, this), /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_2__[\"jsxDEV\"])(\"div\", {\n className: \"collapse navbar-collapse justify-content-end\",\n id: \"navbarNavAltMarkup\",\n children: /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_2__[\"jsxDEV\"])(\"div\", {\n className: \"navbar-nav\",\n children: [/*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_2__[\"jsxDEV\"])(\"a\", {\n className: \"nav-item nav-link active\",\n href: \"#home\",\n onClick: () => props.handlePageChange(\"Home\"),\n className: props.currentPage === \"Home\" ? \"nav-link active\" : \"nav-link\",\n children: [\"Home\", /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_2__[\"jsxDEV\"])(\"span\", {\n className: \"sr-only\",\n children: \"(current)\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 26,\n columnNumber: 21\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 23,\n columnNumber: 15\n }, this), /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_2__[\"jsxDEV\"])(\"a\", {\n className: \"nav-item nav-link active\",\n href: \"#about\",\n onClick: () => props.handlePageChange(\"About\"),\n className: props.currentPage === \"About\" ? \"nav-link active\" : \"nav-link\",\n children: \"About\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 29,\n columnNumber: 15\n }, this), /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_2__[\"jsxDEV\"])(\"a\", {\n className: \"nav-item nav-link active\",\n href: \"#projects\",\n onClick: () => props.handlePageChange(\"Projects\"),\n className: props.currentPage === \"Projects\" ? \"nav-link active\" : \"nav-link\",\n children: \"Projects\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 35,\n columnNumber: 15\n }, this), /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_2__[\"jsxDEV\"])(\"a\", {\n className: \"nav-item nav-link active\",\n href: \"#contact\",\n onClick: () => props.handlePageChange(\"Contact\"),\n className: props.currentPage === \"Contact\" ? \"nav-link active\" : \"nav-link\",\n children: \"Contact\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 41,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 22,\n columnNumber: 13\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 18,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 7,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 6,\n columnNumber: 7\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 5,\n columnNumber: 5\n }, this);\n}", "renderTab(e) {\n\t\tthis.setState({\n\t\t\tcons:'', \n\t\t\tvowl:'', \n\t\t\ttabData: this.second.current.state.selected.data\n\t\t}, this.props.onClick); \n\t}", "function HomeTabs() {\n return (\n // The route to \"Home\" is rendered on first load of the navigator\n // The screenOptions options in the Navigator sets the default options for\n // each of the child Screens\n // This function is passed down to each individual Screen, which then passes\n // its route prop to this function\n <Tab.Navigator\n initialRouteName=\"Home\"\n screenOptions={({ route }) => ({\n tabBarIcon: ({ color, size }) => {\n // Switch statements that assigns icon based on TabScreen name\n switch (route.name) {\n case 'Diagnostics':\n return <MaterialCommunityIcons name=\"hospital\" size={size} color={color} />;\n case 'Data':\n return <MaterialCommunityIcons name=\"waveform\" size={size} color={color} />;\n case 'Home':\n return <Ionicons name=\"ios-globe-outline\" size={size} color={color} />;\n case 'Ambiance':\n return <FontAwesome5 name=\"lightbulb\" size={size} color={color} />;\n case 'Settings':\n return <Ionicons name=\"settings-outline\" size={size} color={color} />;\n default:\n return <Text>error</Text>;\n }\n },\n })}\n tabBarOptions={{\n activeTintColor: 'black',\n inactiveTintColor: 'gray',\n }}\n >\n {/* The different tabs routes are declared here as Screens */}\n <Tab.Screen name=\"Diagnostics\" component={DiagnosticsTab} />\n <Tab.Screen name=\"Data\" component={DataTab} />\n <Tab.Screen name=\"Home\" component={HomeTab} />\n <Tab.Screen name=\"Ambiance\" component={AmbianceTab} />\n <Tab.Screen name=\"Settings\" component={SettingsTab} />\n </Tab.Navigator>\n );\n}", "function tabs(){\n\t\tvar ul = document.createElement(\"ul\");\n\n\t\t//setting materialize's classes to 'ul' tag\n\t\tul.setAttribute(\"class\", \"tabs tabs-transparent\");\n\n\t\t//for each element inside 'clothingItems' do...\n\t\tclothingItems.forEach((item)=>{\n\n\t\t\t//creating 'a' and 'li' tags\n\t\t\tvar li = document.createElement(\"li\");\n\t\t\tvar a = document.createElement(\"a\");\n\n\t\t\t//setting 'tab' class(materialize) and \"href\", to 'li' and 'a' elements \n\t\t\tli.setAttribute(\"class\", \"tab\");\n\t\t\ta.setAttribute(\"href\", \"#\"+item.toLowerCase());\n\n\t\t\t//defining which is parent element and which is child element\n\t\t\ta.innerHTML = item;\n\t\t\tli.appendChild(a);\n\t\t\tul.appendChild(li);\n\t\t\tproductTab.appendChild(ul);\n\t\t});\n\t}", "renderHistory(historyData, index) {\n const title = historyData.video.snippet.title.length > 50 ? \n historyData.video.snippet.title.substring(0, 50) + \"...\" : historyData.video.snippet.title;\n\n return (\n <QueueListItem \n onSelectVideo={this.props.onQueueVideo} \n deleteVideo={this.props.deleteArchive}\n videoData={historyData.video}\n key={index}\n id={index}\n title={title} />\n );\n }", "render() {\n return (\n <ul className=\"placeholder-container flex\">\n <li className=\"playlist\">\n <div className=\"pl-title-container\">\n <h2>SoundCloud Weekly</h2>\n <p>All of SoundCloud. Just for you.</p>\n </div>\n <div className=\"pl-content-container flex gradient\">\n <PlaylistImg albumart={this.state.albumart} />\n <PlaylistTracks playlist={this.state.playlist} />\n </div>\n <PlaylistActions />\n </li>\n </ul>\n );\n }", "render() {\n console.log('sef a', this.props)\n return (\n <div className=\"intro_container\">\n <div className=\"text_intro\">\n <p>More...</p>\n </div>\n <div className=\"intro_tabs\">\n <div className=\"news_bubble\">\n <img className=\"news_img\" src={feed} alt=\"\"/>\n <button onClick={() => this.props.router.history.push('/feed')} className=\"main_button_tab\">Feed</button>\n </div>\n <div className=\"friends_bubble\">\n <img className=\"friends_img\" src={chat} alt=\"\"/>\n <button onClick={() => this.props.router.history.push('/chat')} className=\"main_button_tab\">Chat</button>\n </div>\n <div className=\"space_station_bubble\">\n <img className=\"ss_img\" src={apod} alt=\"\"/>\n <button onClick={() => this.props.router.history.push('/apod')} className=\"main_button_tab\">APOD</button>\n </div>\n </div>\n <div className=\"bottom_footer\">\n \n </div>\n </div>\n )\n }", "render(){\n return (\n <div>\n {/*Page header used by bootstrap to name the app */}\n <PageHeader>Title <small>Words to live by</small></PageHeader>\n {/*\n Nav/NavItem used by bootstrap to create links to different routes.\n React-router v4 uses \"Link\" imported from 'react-router-dom' rather\n than simple hrefs. Since bootstrap NavItems use hrefs, we need to\n use LinkContainer to make them play nice.\n */}\n <Nav bsStyle=\"tabs\">\n <LinkContainer exact={true} to =\"/\">\n <NavItem eventKey={1}>\n Home\n </NavItem>\n </LinkContainer>\n <LinkContainer to =\"/route1\">\n <NavItem eventKey={2}>\n Route 1\n </NavItem>\n </LinkContainer>\n <LinkContainer to =\"/route2\">\n <NavItem eventKey={3}>\n Route 2\n </NavItem>\n </LinkContainer>\n </Nav>\n </div>\n )\n }", "function PlaylistPage(props) {\n return(\n <div>\n It's Playlist page\n </div>\n );\n}", "setup() {\n\t\t\tvar that = this;\n\t\t\tthis._forEach(this._activeTabs, function(index, tab) {\n\t\t\t\tthat._forEach(tab.children, function(index, child) {\n\t\t\t\t\tvar target = that.getTarget(child);\n\t\t\t\t\tthat.showPanel(child, target);\n\t\t\t\t});\n\t\t\t});\n\t\t}", "function TabsComponent() {\r\n return <Tabs data={tabItems} />;\r\n}", "allTabs() {\n return [\n [\"Intro\", this.renderIntroTab()],\n [\"Globals\", this.renderGlobalsTab()],\n [\"Basic Interventions\", this.renderBasicsTab()],\n [\"Far Future\", this.renderFarFutureTab()],\n [\"Veg Advocacy\", this.renderVegTab()],\n [\"Cage Free\", this.renderCageFreeTab()],\n [\"AI Safety\", this.renderAISafetyTab()],\n [\"Targeted Values Spreading\", this.renderTargetedValuesSpreadingTab()],\n ]\n }", "setupTabs() {\n const instanceTabs = global.hadronApp.appRegistry.getRole('Instance.Tab');\n const roles = filter(instanceTabs, (role) => {\n return !(this.props.isDataLake && role.name === 'Performance');\n });\n\n const tabs = roles.map((role) => role.name);\n const views = roles.map((role, i) => {\n return (\n <UnsafeComponent component={role.component} key={i} />\n );\n });\n\n this.tabs = tabs;\n this.views = views;\n }", "function useTabList(props) {\n var _useTabsContext = useTabsContext(),\n focusedIndex = _useTabsContext.focusedIndex,\n orientation = _useTabsContext.orientation,\n direction = _useTabsContext.direction;\n\n var descendants = useTabsDescendantsContext();\n var onKeyDown = React.useCallback(function (event) {\n var _keyMap;\n\n var nextTab = function nextTab() {\n var next = descendants.nextEnabled(focusedIndex);\n if (next) focus(next.node);\n };\n\n var prevTab = function prevTab() {\n var prev = descendants.prevEnabled(focusedIndex);\n if (prev) focus(prev.node);\n };\n\n var firstTab = function firstTab() {\n var first = descendants.firstEnabled();\n if (first) focus(first.node);\n };\n\n var lastTab = function lastTab() {\n var last = descendants.lastEnabled();\n if (last) focus(last.node);\n };\n\n var isHorizontal = orientation === \"horizontal\";\n var isVertical = orientation === \"vertical\";\n var eventKey = normalizeEventKey(event);\n var ArrowStart = direction === \"ltr\" ? \"ArrowLeft\" : \"ArrowRight\";\n var ArrowEnd = direction === \"ltr\" ? \"ArrowRight\" : \"ArrowLeft\";\n var keyMap = (_keyMap = {}, _keyMap[ArrowStart] = function () {\n return isHorizontal && prevTab();\n }, _keyMap[ArrowEnd] = function () {\n return isHorizontal && nextTab();\n }, _keyMap.ArrowDown = function ArrowDown() {\n return isVertical && nextTab();\n }, _keyMap.ArrowUp = function ArrowUp() {\n return isVertical && prevTab();\n }, _keyMap.Home = firstTab, _keyMap.End = lastTab, _keyMap);\n var action = keyMap[eventKey];\n\n if (action) {\n event.preventDefault();\n action(event);\n }\n }, [descendants, focusedIndex, orientation, direction]);\n return _extends({}, props, {\n role: \"tablist\",\n \"aria-orientation\": orientation,\n onKeyDown: callAllHandlers(props.onKeyDown, onKeyDown)\n });\n}", "function loadTabs() {\n\t\tvar htmlToAppend = '';\n\t\thtmlToAppend += '<ul class=\"nav nav-tabs\">';\n\t\t\n\t\tvar tabsMade = 0;\n\t\tfor(var i = 0; i <tuneJSON.tracks.length; i++) {//create the nav tabs for each nonempty track\n\t\t\tif(typeof tuneJSON.tracks[i].instrument !== 'undefined') {\n\t\t\t\tif(tabsMade === 0) {//if first tab add an active class to it\n\t\t\t\t\ttabsMade++;\n\t\t\t\t\thtmlToAppend +='<li class=\"active\"><a href=\"#track' + i +\n\t\t\t\t\t '\" data-toggle=\"tab\"><span class=\"instrument-name\">' + midiHelper.getInstrumentName(tuneJSON.tracks[i].instrument) + \n\t\t\t\t\t '</span></a></li>';\n\t\t\t\t} else {\n\t\t\t\t\thtmlToAppend += '<li role=\"presentation\"><a href=\"#track' + i + '\" role=\"tab\" data-toggle=\"tab\"><span class=\"instrument-name\">' +\n\t\t\t\t\tmidiHelper.getInstrumentName(tuneJSON.tracks[i].instrument) + \n\t\t\t\t\t'</span><button class=\"remove-tab-button\" id=\"remove-tab' + i + '\"><span class=\"glyphicon glyphicon-remove\" aria-hidden=\"true\"></span></button></a></li>';\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\thtmlToAppend += '</ul><div class=\"tab-content\">';\n\t\t//now add the tab panels\n\t\t\n\t\ttabsMade = 0;\n\n\t\tfor(var i = 0; i <tuneJSON.tracks.length; i++) {//create the tab pane for each nonempty track\n\t\t\tif(typeof tuneJSON.tracks[i].instrument !== 'undefined') {\n\t\t\t\tif(tabsMade === 0) {\n\t\t\t\t\thtmlToAppend += '<div class=\"tab-pane active\" id=\"track' + i +'\"></div>';\n\t\t\t\t\ttabsMade++;\n\t\t\t\t} else {\n\t\t\t\t\thtmlToAppend+= '<div class=\"tab-pane\" id=\"track' + i +'\"></div>';\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\thtmlToAppend += '</div>';\n\t\t$('.canvas').append(htmlToAppend);\n\n\t\t$('.remove-tab-button').click(function() {//add remove event to delete button\n\t\t\tdeleteInstrument(parseInt($(this).attr('id').substring(10), 10));//get index of track\n\t\t});\n\t\t\n\t}", "getTabViewContents(){\n const { context, schemas, windowWidth, windowHeight, href, session } = this.props;\n const { mounted } = this.state;\n\n //context = SET; // Use for testing along with _testing_data\n\n const processedFiles = this.allProcessedFilesFromExperimentSet(context);\n const processedFilesUniqeLen = (processedFiles && processedFiles.length && ProcessedFilesStackedTableSection.allFilesUniqueCount(processedFiles)) || 0;\n const rawFiles = this.allFilesFromExperimentSet(context, false);\n const rawFilesUniqueLen = (rawFiles && rawFiles.length && RawFilesStackedTableSection.allFilesUniqueCount(rawFiles)) || 0;\n const width = this.getTabViewWidth();\n\n const commonProps = { width, context, schemas, windowWidth, href, session, mounted };\n const propsForTableSections = _.extend(SelectedFilesController.pick(this.props), commonProps);\n\n var tabs = [];\n\n // Processed Files Table Tab\n if (processedFilesUniqeLen > 0){\n tabs.push({\n tab : <span><i className=\"icon icon-microchip fas icon-fw\"/>{ ' ' + processedFilesUniqeLen + \" Processed File\" + (processedFilesUniqeLen > 1 ? 's' : '') }</span>,\n key : 'processed-files',\n content : (\n <SelectedFilesController resetSelectedFilesCheck={ExperimentSetView.resetSelectedFilesCheck} initiallySelectedFiles={processedFiles}>\n <ProcessedFilesStackedTableSection {...propsForTableSections} files={processedFiles} />\n </SelectedFilesController>\n )\n });\n }\n\n // Raw files tab, if have experiments with raw files\n if (rawFilesUniqueLen > 0){\n tabs.push({\n tab : <span><i className=\"icon icon-leaf fas icon-fw\"/>{ ' ' + rawFilesUniqueLen + \" Raw File\" + (rawFilesUniqueLen > 1 ? 's' : '') }</span>,\n key : 'raw-files',\n content : (\n <SelectedFilesController resetSelectedFilesCheck={ExperimentSetView.resetSelectedFilesCheck} initiallySelectedFiles={rawFiles}>\n <RawFilesStackedTableSection {...propsForTableSections} files={rawFiles} />\n </SelectedFilesController>\n )\n });\n }\n\n // Supplementary Files Tab\n if (ExperimentSetView.shouldShowSupplementaryFilesTabView(context)){\n //const referenceFiles = SupplementaryFilesTabView.allReferenceFiles(context) || [];\n //const opfCollections = SupplementaryFilesTabView.combinedOtherProcessedFiles(context) || [];\n //const allOpfFiles = _.reduce(opfCollections, function (memo, coll) { return memo.concat(coll.files || []); }, []);\n //const allFiles = referenceFiles.concat(allOpfFiles);\n tabs.push({\n tab : <span><i className=\"icon icon-copy far icon-fw\"/> Supplementary Files</span>,\n key : 'supplementary-files',\n content: (\n <SelectedFilesController resetSelectedFilesCheck={ExperimentSetView.resetSelectedFilesCheck} initiallySelectedFiles={[]/*allFiles*/}>\n <SupplementaryFilesTabView {...propsForTableSections} {...this.state} />\n </SelectedFilesController>\n )\n });\n }\n\n // Graph Section Tab\n if (this.shouldGraphExist()){\n tabs.push(FileViewGraphSection.getTabObject(\n _.extend({}, this.props, { 'isNodeCurrentContext' : this.isWorkflowNodeCurrentContext }),\n this.state,\n this.handleToggleAllRuns,\n width\n ));\n }\n\n return _.map(tabs.concat(this.getCommonTabs()), function(tabObj){\n return _.extend(tabObj, {\n 'style' : {\n 'minHeight' : Math.max(mounted && !isServerSide() && (windowHeight - 180), 100) || 800\n }\n });\n });\n }", "function useTabs(props) {\n var defaultIndex = props.defaultIndex,\n onChange = props.onChange,\n index = props.index,\n isManual = props.isManual,\n isLazy = props.isLazy,\n _props$lazyBehavior = props.lazyBehavior,\n lazyBehavior = _props$lazyBehavior === void 0 ? \"unmount\" : _props$lazyBehavior,\n _props$orientation = props.orientation,\n orientation = _props$orientation === void 0 ? \"horizontal\" : _props$orientation,\n _props$direction = props.direction,\n direction = _props$direction === void 0 ? \"ltr\" : _props$direction,\n htmlProps = _objectWithoutPropertiesLoose(props, _excluded$1);\n /**\n * We use this to keep track of the index of the focused tab.\n *\n * Tabs can be automatically activated, this means selection follows focus.\n * When we navigate with the arrow keys, we move focus and selection to next/prev tab\n *\n * Tabs can also be manually activated, this means selection does not follow focus.\n * When we navigate with the arrow keys, we only move focus NOT selection. The user\n * will need not manually activate the tab using `Enter` or `Space`.\n *\n * This is why we need to keep track of the `focusedIndex` and `selectedIndex`\n */\n\n\n var _React$useState = React.useState(defaultIndex != null ? defaultIndex : 0),\n focusedIndex = _React$useState[0],\n setFocusedIndex = _React$useState[1];\n\n var _useControllableState = useControllableState({\n defaultValue: defaultIndex != null ? defaultIndex : 0,\n value: index,\n onChange: onChange\n }),\n selectedIndex = _useControllableState[0],\n setSelectedIndex = _useControllableState[1];\n /**\n * Sync focused `index` with controlled `selectedIndex` (which is the `props.index`)\n */\n\n\n React.useEffect(function () {\n if (index != null) {\n setFocusedIndex(index);\n }\n }, [index]);\n /**\n * Think of `useDescendants` as a register for the tab nodes.\n */\n\n var descendants = useTabsDescendants();\n /**\n * Generate a unique id or use user-provided id for the tabs widget\n */\n\n var id = useId(props.id, \"tabs\");\n return {\n id: id,\n selectedIndex: selectedIndex,\n focusedIndex: focusedIndex,\n setSelectedIndex: setSelectedIndex,\n setFocusedIndex: setFocusedIndex,\n isManual: isManual,\n isLazy: isLazy,\n lazyBehavior: lazyBehavior,\n orientation: orientation,\n descendants: descendants,\n direction: direction,\n htmlProps: htmlProps\n };\n}", "function choosePlaylist( event ) {\n var selected = $(this);\n var index = selected.index();\n var offset = index - selected.siblings(\".active\").index();\n\n for(var i = Math.abs(offset); i--; ) {\n nav[ offset < 0 ? \"previous\" : \"next\" ]( i !== 0 );\n }\n\n focusActiveSlide();\n }", "render() {\n const {\n location,\n children,\n loggedUser,\n isAuthenticated\n } = this.props;\n\n const timeRangeTabHeadline = {\n textTransform: 'none',\n minWidth: 33,\n }\n const tabs = [\n { label: \"5m\", value: 5, style: timeRangeTabHeadline },\n { label: \"30m\", value: 30, style: timeRangeTabHeadline },\n { label: \"1h\", value: 60, style: timeRangeTabHeadline },\n { label: \"3h\", value: 180, style: timeRangeTabHeadline },\n { label: \"6h\", value: 360, style: timeRangeTabHeadline },\n { label: \"12h\", value: 720, style: timeRangeTabHeadline },\n { label: \"1d\", value: 1440, style: timeRangeTabHeadline },\n { label: \"2d\", value: 2880, style: timeRangeTabHeadline },\n { label: \"4d\", value: 5760, style: timeRangeTabHeadline },\n { label: \"7d\", value: 10080, style: timeRangeTabHeadline },\n { label: \"1M\", value: 43800, style: timeRangeTabHeadline },\n { label: \"2M\", value: 87600, style: timeRangeTabHeadline },\n { label: \"6M\", value: 262800, style: timeRangeTabHeadline },\n { label: \"1Y\", value: 525600, style: timeRangeTabHeadline },\n ]\n\n return (\n <div>\n <EventListener target=\"window\" onKeyUp={this.handleKeyUp} />\n <div className=\"appBar\">\n <div className=\"newAppToolbar\">\n <IconButton style={{ height: '48px', padding:0 }}\n onTouchTap={this.onMenuButtonClick} >\n <img draggable=\"false\" onmousedown=\"return false\" style=\"user-drag: none\" src=\"/static/digitalis_icon_white_s.png\" />\n </IconButton>\n \n <h1 className=\"appToolbarTitle\">{this.props.UiState.currentPage}</h1>\n <div className=\"appToolbarRightContainer\">\n <div className=\"appToolbarRight\">\n <div>\n <span onClick={this.openTimeSelection} style={this.timeRangeSelectionTextStyle}>{this.customTimeText}</span>\n <IconButton style={this.timeRangeSelectionIconStyle} onTouchTap={this.openTimeSelection}>\n <FontIcon className=\"material-icons\" color=\"white\">access_time</FontIcon>\n </IconButton>\n\n </div>\n <Tabs style={{ marginRight: 20 }}\n value={this.props.ChartStore.predefinedTime}\n tabItemContainerStyle={{ background: 'transparent' }}\n inkBarStyle={{ backgroundColor: '#b9eaff' }}>\n {tabs.map(t => <Tab disableFocusRipple disableTouchRipple key={t.value} value={t.value} label={t.label} style={t.style} onActive={this.handleTimeRange} />)}\n </Tabs>\n {isAuthenticated ? <Logged {...this.props} /> : <FlatButton {...this.props} label=\"Login\" labelStyle={{ color: 'white' }} onTouchTap={this.handleOpen} />}\n </div>\n </div>\n </div>\n <div className=\"subToolbarContainer\">\n <div style={this.subToolbarStyle}>\n <div className=\"timeSelectionMenu\">\n <TimeSelector {...this.props}></TimeSelector>\n </div>\n </div> </div>\n </div>\n <div onClick={this.openTimeSelection} style={this.applicationBarMaskStyle} />\n <style jsx>{`\n\n\n \n .subToolbarContainer{\n display:flex;\n flex-direction: row;\n justify-content: flex-end;\n width:100%\n }\n .timeSelectionMenu{\n margin-bottom: 15px;\n }\n \n .appBar{\n position:fixed;\n \n z-index: 1300;\n width:100%;\n background-color: #5899fb;\n box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.12);\n transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms;\n }\n .newAppToolbar{\n display: flex;\n align-items: center;\n justify-content: center;\n padding-left:8px;\n }\n .appToolbarRightContainer{\n margin-left:auto;\n }\n\n .appToolbarRight{\n display: inline-flex;\n margin-left:auto;\n }\n .appToolbarTitle{\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n margin: 0;\n padding-left:5px;\n letter-spacing: 0;\n font-size: 24px;\n font-weight: 400;\n color: #ffffff;\n height: auto;\n line-height: initial;\n user-select: none;\n }\n \n `}</style>\n\n </div>);\n }", "function TabThreeNavigator() {\n return (\n <TabThreeStack.Navigator>\n <TabThreeStack.Screen\n name=\"AboutHome\"\n component={About}\n options={{ headerTitle: 'About' }}\n />\n </TabThreeStack.Navigator>\n );\n}", "renderTabs() {\n const { active } = this.state;\n return (\n <View style={stylesLocation.tabs}>\n <View\n style={[\n stylesLocation.tab,\n active === \"all\" ? stylesLocation.activeTab : null\n ]}\n >\n <Text\n style={[\n stylesLocation.tabTitle,\n active === \"all\" ? stylesLocation.activeTabTitle : null\n ]}\n onPress={() => this.handleTab(\"all\")}\n >\n All\n </Text>\n </View>\n <View\n style={[\n stylesLocation.tab,\n active === \"hospital\" ? stylesLocation.activeTab : null\n ]}\n >\n <Text\n style={[\n stylesLocation.tabTitle,\n active === \"hospital\" ? stylesLocation.activeTabTitle : null\n ]}\n onPress={() => this.handleTab(\"hospital\")}\n >\n Hospital\n </Text>\n </View>\n <View\n style={[\n stylesLocation.tab,\n active === \"clinic\" ? stylesLocation.activeTab : null\n ]}\n >\n <Text\n style={[\n stylesLocation.tabTitle,\n active === \"clinic\" ? stylesLocation.activeTabTitle : null\n ]}\n onPress={() => this.handleTab(\"clinic\")}\n >\n Clinic\n </Text>\n </View>\n </View>\n );\n }", "render() {\n return(\n <div className=\"Projects-Tabs\">\n {this.props.isAuthenticated && this.props.user ?\n this.props.user.admin ?\n <Tabs activeKey={this.state.activeKey}\n onSelect={this.handleSelect}\n id=\"tabs\">\n <Tab eventKey={1} title=\"Your projects\">\n {this.renderProjects()}\n </Tab>\n <Tab eventKey={2} title=\"All projects\">\n {this.renderAllProjects()}\n </Tab>\n </Tabs>\n : this.renderProjects()\n : this.renderLander()\n }\n </div>\n );\n }", "showMainScreen(animated) {\n const createTabs = () => {\n let tabs = [\n {\n label: 'Charts',\n screen: 'app.ChartCatalogScreen',\n icon: require('../img/tabBarCharts.png'),\n selectedIcon: require('../img/tabBarCharts.png'),\n title: 'Charts',\n navigatorStyle: {\n navBarTranslucent: true,\n drawUnderTabBar: true,\n statusBarTextColorScheme: 'dark'\n }\n },\n {\n label: 'Profile',\n screen: 'app.ProfileScreen',\n icon: require('../img/tabBarProfile.png'),\n selectedIcon: require('../img/tabBarProfile.png'),\n title: 'Profile',\n navigatorStyle: {\n navBarHidden: true,\n statusBarTextColorScheme: 'dark'\n }\n }\n ];\n\n return tabs;\n };\n\n Navigation.startTabBasedApp({\n animationType: animated ? 'slide-down': 'none',\n tabs: createTabs(),\n tabsStyle: {\n tabBarTranslucent: true,\n tabBarButtonColor: colors.light,\n tabBarSelectedButtonColor: colors.primary,\n }\n });\n }", "get tabs() {\n if (!this.props.renderHiddenTabs) {\n return this.visibleTab;\n }\n\n const tabs = this.children.map((child, index) => {\n return (\n <Tab\n role='tabpanel'\n title={ child.props.title }\n tabId={ child.props.tabId }\n position={ this.props.position }\n key={ this.tabRefs[index] }\n ariaLabelledby={ this.tabRefs[index] }\n isTabSelected={ this.isTabSelected(child.props.tabId) }\n >\n {child.props.children}\n </Tab>\n );\n });\n\n return tabs;\n }", "function ChangeTabs(evt, backSymbol) {\n var i, tabcontent, tablinks;\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n document.getElementById(backSymbol).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n}", "_makeTabsFromPfTab() {\n const ul = this.querySelector('ul');\n if (this.children && this.children.length) {\n const pfTabs = [].slice\n .call(this.children)\n .filter(node => node.nodeName === 'PF-TAB');\n [].forEach.call(pfTabs, (pfTab, idx) => {\n const tab = this._makeTab(pfTab);\n ul.appendChild(tab);\n this.tabMap.set(tab, pfTab);\n this.panelMap.set(pfTab, tab);\n\n if (idx === 0) {\n this._makeActive(tab);\n }\n else {\n pfTab.style.display = 'none';\n }\n });\n }\n }", "renderContainer() {\n if (this.state.activeTab === \"Backlog\") {\n return (\n <BacklogContainer\n removeStoryFromSprint={this.removeStoryFromState}\n addStoryToSprint={this.addStoryToState}\n selectedStories={this.state.selectedStories}\n currentUser={this.props.currentUser}\n />\n );\n } else {\n return (\n <SprintContainer\n team={this.props.currentUser.team}\n removeStoryFromSprint={this.removeStoryFromState}\n addStoryToSprint={this.addStoryToState}\n selectedStories={this.state.selectedStories}\n currentUser={this.props.currentUser}\n />\n );\n }\n }", "function ResultsNavBar() {\n return (\n <div className=\"subNavContainer\">\n <NavLink\n testid=\"navigateViewResults\"\n destination=\"/ViewResults\"\n linkName=\"Data log\"\n />\n </div>\n );\n}", "renderTabs() {\n const { tags } = this.state\n return (\n tags.map((tag, index) => {\n return (\n <Tab \n key={index} \n className={this.activeTabStyle(this.state.value === index)} \n label={tag}\n />\n )\n })\n )\n }", "filterTabs() {\n const { tags } = this.state\n\n const allProjects = (\n myProjects.map((project, index) => {\n return <Project key={index} siteImage={project.siteImage} name={project.name} clicked={this.openModalHandler} />\n })\n )\n\n const filteredProjects = (tag) => (\n myProjects.filter(project => {\n return project.tag === tag\n }).map((foundProject, index) => {\n return <Project key={index} siteImage={foundProject.siteImage} name={foundProject.name} clicked={this.openModalHandler} />\n })\n )\n \n return (\n tags.map((tag, index) => {\n if (tag === \"ALL\") {\n return (\n <TabContainer key={index} label={tag}>\n {this.renderStack(allProjects)}\n </TabContainer>\n ) \n } \n else {\n return (\n <TabContainer key={index} label={tag}>\n {this.renderStack(filteredProjects(tag))}\n </TabContainer>\n )\n }\n })\n )\n }", "render() {\n return (\n <div id=\"preview-cont\" className=\"nav-prev\">\n <div id=\"sectionDesc\"><p>{this.state.description}</p></div>\n <div id=\"previewButtons\">\n <button id=\"-1\" type=\"button\" onClick={this.props.navBack}>Back</button>\n <Link role=\"button\" to={this.state.toLink}>Proceed</Link>\n </div>\n </div>\n );\n }", "render() {\n const { children } = this.props;\n return (\n <div className=\"tabs\">\n {Children.map(children, this._addChildRefs, this)}\n </div>\n );\n }", "function navAllStories(evt) {\n hidePageComponents();\n putStoriesOnPage();\n}", "function setupTabs(){\n const content = document.getElementById('content');\n buttons = Array.from(content.getElementsByTagName('button'));\n\n buttons.forEach(button => {\n button.addEventListener(\"click\", changeTab);\n });\n\n loadHome();\n buttons[0].classList.add('button-active');\n}", "function navAllStories(evt) {\n console.debug(\"navAllStories\");\n hidePageComponents();\n putStoriesOnPage();\n // addStarToStories();\n}", "function Tabs(props) {\n let items = [];\n for (let i = 0; props.tabs && i < props.tabs.length; i++) {\n items.push(\n <Tab key={i} index={i} selectTab={props.selectTab} closeDrawer={props.closeDrawer} tab={props.tabs[i]}/>\n );\n }\n return <div>{items}</div>;\n}", "function NavBar(props) {\n\tconst {classes, isMobile, pollingFailed} = props;\n\tconst homeLabel = pollingFailed ? (\n\t\t<span className={classes.errorLabel}>\n\t\t\tHome <Error />\n\t\t</span>\n\t) : (\n\t\t'Home'\n\t);\n\tlet [selectedIndex, setSelectedIndex] = useState(0);\n\n\treturn (\n\t\t<div className={classes.navBarContainer}>\n\t\t\t<Tabs\n\t\t\t\tclassName={classes.tabBar}\n\t\t\t\tindicatorColor=\"secondary\"\n\t\t\t\tvariant=\"fullWidth\"\n\t\t\t\tvalue={selectedIndex}\n\t\t\t>\n\t\t\t\t{isMobile\n\t\t\t\t\t? [\n\t\t\t\t\t\t\t<Tab\n\t\t\t\t\t\t\t\tkey=\"mobile-tab-dashboard\"\n\t\t\t\t\t\t\t\ticon={<Home />}\n\t\t\t\t\t\t\t\tcomponent={Link}\n\t\t\t\t\t\t\t\tto=\"/\"\n\t\t\t\t\t\t\t\tonClick={() => setSelectedIndex(0)}\n\t\t\t\t\t\t\t/>,\n\t\t\t\t\t\t\t<Tab\n\t\t\t\t\t\t\t\tkey=\"mobile-tab-admin\"\n\t\t\t\t\t\t\t\ticon={<Person />}\n\t\t\t\t\t\t\t\tcomponent={Link}\n\t\t\t\t\t\t\t\tto=\"/admin\"\n\t\t\t\t\t\t\t\tonClick={() => setSelectedIndex(1)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t ]\n\t\t\t\t\t: [\n\t\t\t\t\t\t\t<Tab\n\t\t\t\t\t\t\t\tkey=\"desktop-tab-dashboard\"\n\t\t\t\t\t\t\t\taria-label=\"Dashboard\"\n\t\t\t\t\t\t\t\tclassName={classes.tab}\n\t\t\t\t\t\t\t\tcolor=\"inherit\"\n\t\t\t\t\t\t\t\tlabel={homeLabel}\n\t\t\t\t\t\t\t\tcomponent={Link}\n\t\t\t\t\t\t\t\tto=\"/\"\n\t\t\t\t\t\t\t\tonClick={() => setSelectedIndex(0)}\n\t\t\t\t\t\t\t/>,\n\t\t\t\t\t\t\t<Tab\n\t\t\t\t\t\t\t\tkey=\"desktop-tab-admin\"\n\t\t\t\t\t\t\t\taria-label=\"Admin\"\n\t\t\t\t\t\t\t\tclassName={classes.tab}\n\t\t\t\t\t\t\t\tcolor=\"inherit\"\n\t\t\t\t\t\t\t\tlabel=\"Admin\"\n\t\t\t\t\t\t\t\tcomponent={Link}\n\t\t\t\t\t\t\t\tto=\"/admin\"\n\t\t\t\t\t\t\t\tonClick={() => setSelectedIndex(1)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t ]}\n\t\t\t</Tabs>\n\t\t</div>\n\t);\n}", "function navigate() {\n withNavigationContainer((listHolder) => {\n openedLeftNavForNavigate = false;\n // Since the projects list can get reconstructed, watch for changes and\n // reconstruct the shortcut tips. A function to unregister the mutation\n // observer is passed in.\n oldNavigateOptions = [];\n const unregisterListener = registerMutationObserver(listHolder, () => {\n setupNavigate(listHolder);\n }, {childList: true, subtree: true});\n finishNavigate = () => {\n unregisterListener();\n finishNavigate = null;\n switchKeymap(DEFAULT_KEYMAP);\n updateKeymap();\n if (openedLeftNavForNavigate && !leftNavIsHidden()) {\n toggleLeftNav();\n }\n };\n setupNavigate(listHolder);\n });\n }", "displayTracks(album) {\n var route = {\n albumId: album.id,\n title: album.title,\n scene: 1\n }\n this.props.navigator.push(route);\n }", "function renderHistoryList() {}", "function Tabs() {\n const [toggleState, setToggleState] = useState(1);\n\n const toggleTab = (index) => {\n setToggleState(index);\n };\n\n return (\n <div className=\"container\">\n <div className=\"bloc-tabs\">\n <button className={toggleState === 1 ? \"tabs active-tabs\" : \"tabs\"} onClick={() => toggleTab(1)}>Upload Design</button>\n <button className={toggleState === 2 ? \"tabs active-tabs\" : \"tabs\"} onClick={() => toggleTab(2)}>Manage Design</button>\n <button className={toggleState === 3 ? \"tabs active-tabs\" : \"tabs\"} onClick={() => toggleTab(3)}>Find New Gig</button>\n </div>\n\n <div className=\"content-tabs\">\n <div className={toggleState === 1 ? \"content active-content\" : \"content\"}>\n <UploadDesign />\n </div>\n\n <div className={toggleState === 2 ? \"content active-content\" : \"content\"}>\n <img src=\"../../comingSoon.png\" alt=\"logo\"/>\n </div>\n\n <div className={toggleState === 3 ? \"content active-content\" : \"content\"}>\n <img src=\"../../comingSoon.png\" alt=\"logo\"/>\n </div>\n </div>\n </div>\n );\n}", "_init() {\n var _this = this;\n\n this.$element.attr({'role': 'tablist'});\n this.$tabTitles = this.$element.find(`.${this.options.linkClass}`);\n this.$tabContent = $(`[data-tabs-content=\"${this.$element[0].id}\"]`);\n\n this.$tabTitles.each(function(){\n var $elem = $(this),\n $link = $elem.find('a'),\n isActive = $elem.hasClass(`${_this.options.linkActiveClass}`),\n hash = $link[0].hash.slice(1),\n linkId = $link[0].id ? $link[0].id : `${hash}-label`,\n $tabContent = $(`#${hash}`);\n\n $elem.attr({'role': 'presentation'});\n\n $link.attr({\n 'role': 'tab',\n 'aria-controls': hash,\n 'aria-selected': isActive,\n 'id': linkId\n });\n\n $tabContent.attr({\n 'role': 'tabpanel',\n 'aria-hidden': !isActive,\n 'aria-labelledby': linkId\n });\n\n if(isActive && _this.options.autoFocus){\n $(window).load(function() {\n $('html, body').animate({ scrollTop: $elem.offset().top }, _this.options.deepLinkSmudgeDelay, () => {\n $link.focus();\n });\n });\n }\n });\n if(this.options.matchHeight) {\n var $images = this.$tabContent.find('img');\n\n if ($images.length) {\n Foundation.onImagesLoaded($images, this._setHeight.bind(this));\n } else {\n this._setHeight();\n }\n }\n\n //current context-bound function to open tabs on page load or history popstate\n this._checkDeepLink = () => {\n var anchor = window.location.hash;\n //need a hash and a relevant anchor in this tabset\n if(anchor.length) {\n var $link = this.$element.find('[href$=\"'+anchor+'\"]');\n if ($link.length) {\n this.selectTab($(anchor), true);\n\n //roll up a little to show the titles\n if (this.options.deepLinkSmudge) {\n var offset = this.$element.offset();\n $('html, body').animate({ scrollTop: offset.top }, this.options.deepLinkSmudgeDelay);\n }\n\n /**\n * Fires when the zplugin has deeplinked at pageload\n * @event Tabs#deeplink\n */\n this.$element.trigger('deeplink.zf.tabs', [$link, $(anchor)]);\n }\n }\n }\n\n //use browser to open a tab, if it exists in this tabset\n if (this.options.deepLink) {\n this._checkDeepLink();\n }\n\n this._events();\n }", "@action handlePlaylistClick(dom, playlist) {\n // we need to set the activePlaylistItem as well\n // todo: this will probably break if we have an empty playlist\n const activePlaylistItem = playlist.items[0];\n\n UIStore.get().updateControlPanelState({\n activePlaylist: playlist,\n activePlaylistItem: activePlaylistItem,\n });\n }", "function App() {\n return (\n <div>\n <h1>Tabs Demo</h1>\n <Tabs>\n <div label=\"Home\">Please click on the To do list tab!</div>\n <div label=\"Calendar\"></div>\n <div label=\"Stickers\">\n After 'while, <em>Crocodile</em>!\n </div>\n <div label=\"To Do List\">\n <ul>\n </ul>\n </div>\n </Tabs>\n </div>\n );\n}", "render() {\n let stacks = this.props.stacks;\n let stack_list = stacks.map((stack) => {\n return <li className=\"stack-item shadow\">{stack}</li>;\n });\n let proj_label = this.props.proj_link == null ? <div className=\"label\">N/A</div> : <div className=\"label\">View Project</div>;\n // TODO remove or use the counter in css\n let indent = this.props.indent ? \"project-block indent\" : \"project-block\";\n return (\n <div className={indent}>\n <div className=\"card\">\n <div className=\"project\">\n <a className=\"link\" href={this.props.proj_link}>\n <div className=\"shadow\">\n <img className=\"preview hexagon\" src={this.props.proj_img}></img>\n {proj_label}\n </div>\n </a>\n <a className=\"link\" href={this.props.code_link}>\n <div className=\"shadow\">\n <img className=\"code hexagon\" src={CodeIcon}></img>\n <div className=\"label\">View Code</div>\n </div>\n </a>\n </div>\n <div className=\"info\">\n <div className=\"test\">\n \n <div className=\"project-title\">\n {this.props.title}\n <div className=\"underline\"></div>\n </div>\n </div>\n <ul className=\"stack-list\">{stack_list}</ul>\n <div className=\"project-description\">{this.props.description}</div>\n </div>\n </div> \n </div>\n );\n }", "render(){ // see it says raindeer right here\n\t\treturn (\n\t\t<div> {/*^ this says that i will let u return the raindeers to the pole */}\n\t\t\t<h1>Ja<span className=\"highlight\">mmm</span>ing</h1>\n\t\t\t<h1 className=\"Description\">Make Your Spotify Playlist</h1>\n\t\t\t<div className=\"App\">\n\t\t\t<SearchBar onSearch={this.search}/>\n\t\t\t<div className=\"App-playlist\">\n\t\t\t<SearchResults searchResults={this.state.searchResults} \n\t\t\t\t\t\t\tonAdd={this.addTrack}\n\t\t\t\t\t\t\tonRemove={this.removeTrack} />\n\t\t\t<Playlist playlistTracks={this.state.playlistTracks}\n\t\t\t\t\t\t\tonRemove={this.removeTrack}\n\t\t\t\t\t\t\tonNameChange={this.updatePlaylistName}\n\t\t\t\t\t\t\tonSave={this.savePlaylist}/> \n\t\t\t</div> \n\t\t\t</div>\n\t\t</div>\n\t\t);\n\t}", "function gridToStack(){\n subNavHandler(0, 'singlestack', 10);\n }", "function navAllStories(evt) {\n console.debug(\"navAllStories\", evt);\n hidePageComponents();\n putStoriesOnPage();\n}", "function navAllStories(evt) {\n console.debug(\"navAllStories\", evt);\n hidePageComponents();\n putStoriesOnPage();\n}", "function initTabNav() {\n const tabMenu = document.querySelectorAll('[data-tab=\"menu\"] li')\n const tabContent = document.querySelectorAll('[data-tab=\"content\"] section')\n\n if (tabMenu.length && tabContent.length) {\n function activeTab(index) {\n tabContent.forEach(section => {\n section.classList.remove('active')\n })\n const direction = tabContent[index].dataset.anime\n tabContent[index].classList.add('active', direction)\n }\n \n tabMenu.forEach((li, index) => {\n li.addEventListener('click', () => activeTab(index))\n })\n }\n}", "static get tag() {\n return \"a11y-tabs\";\n }", "function App() {\n return (\n <>\n<LandingPage/>\n<LandingpageTab/>\n </>\n );\n}", "onTabClick(index) {\n if (this.props.onSwitch) this.props.onSwitch(index);\n }", "function MainStackNavigator() {\n return (\n \n\n // {/* <TabNavigator /> */}\n // <NavigationContainer>\n // <Tab.Navigator>\n // <Tab.Screen name='CommunitiesPublicGoals' component={CommunitiesPublicGoals} />\n // </Tab.Navigator>\n // </NavigationContainer>\n\n <NavigationContainer>\n <Stack.Navigator initialRouteName='Home'>\n <Stack.Screen name='Home' component={Home} />\n <Stack.Screen name='userHome' component={userHome} />\n <Stack.Screen name='UsersIndividualGoal' component={UsersIndividualGoal} />\n <Stack.Screen name='AddNewGoal' component={AddNewGoal} />\n <Stack.Screen name='CommunitiesPublicGoals' component={CommunitiesPublicGoals} />\n\n \n </Stack.Navigator>\n </NavigationContainer>\n )\n}", "render() {\n return (\n <Navbar className = \"bp3-dark top-tabbar\">\n <NavbarGroup align = { Alignment.LEFT }>\n <Tabs\n animate = { true }\n large = { true }\n onChange = { this.change_tab }\n selectedTabId = { this.state.current_catagory }\n >\n <Tab id = \"General\" title = \"General\"/>\n <Tab id = \"Business\" title = \"Business\"/>\n <Tab id = \"Technology\" title = \"Technology\"/>\n <Tab id = \"Science\" title = \"Science\"/>\n <Tab id = \"Sports\" title = \"Sports\"/>\n <Tab id = \"Health\" title = \"Health\"/>\n <Tab id = \"Entertainment\" title = \"Entertainment\" />\n </Tabs>\n </NavbarGroup>\n </Navbar>\n );\n }", "function addTabToPage() {\n\tfor (let index = 0; index < categories.length; index++) {\n\t\tpopulatePrototype(mainNavTabs, categories[index], protoItemLinkTab);\t\n\t}\n}", "render(){\n return(\n <div>\n {this.renderTab()}\n </div>\n );\n }", "render() {\n\n if(!this.props.isLoggedIn)\n {\n return <Redirect to=\"/\" />;\n }\n\n return (\n <div className=\"adminDashboardContainer\">\n <h2 className = \"DashboardWelcome\"> {this.state.businessName}</h2>\n\n <Tabs defaultActiveKey=\"viewWorkers\" id=\"uncontrolled-tab-example\">\n <Tab eventKey=\"viewWorkers\" title=\"All Workers\" >\n <ViewWorkerList workers={this.state.workers} services={this.state.services} />\n </Tab>\n\n <Tab eventKey=\"viewServices\" title=\"All Services\" >\n <ViewServicesList services={this.state.services}/>\n </Tab>\n </Tabs>\n\n </div>\n )\n }", "function navAllStories (evt) {\n\tconsole.debug('navAllStories', evt);\n\thidePageComponents(); // located in main.js\n\tputStoriesOnPage(); // located in stories.js\n\tupdateNavOnLogin();\n}", "onTabChange(e, { activeIndex }) {\n this.setState({ activeIndex });\n }", "buildTabView()\n {\n switch(this.state.selectedTab) {\n case \"main\" : return(<MainTab {...this.props} onUpdate={this.updateIndicator.bind(this)}\n onPrintDetails={this.onPrintDetails.bind(this)}/>)\n case \"expenses\" : return(<ExpensesTab {...this.props} \n onGoBack={this.goBack.bind(this)}/>)\n case \"depreciations\" : return(<DepreciationsTab {...this.props} \n onGoBack={this.goBack.bind(this)}/>)\n }\n }", "function HistoryTab() {\n\treturn (\n\t\t<div>\n\t\t\t<p>Hello World This is the History Tab</p>\n\t\t\t<img src={Head} />\n\t\t</div>\n\t);\n}", "function renderTab(tab,index){\n\t\n\tvar img = '';\n\tif(localStorage['thumb'+tab.id]) img = localStorage['thumb'+tab.id];\n\telse img = \"1.gif\";\n\n\tvar icon = '';\n\tif(tab.favIconUrl) icon = tab.favIconUrl;\n\tvar selected = '';\n\tif(tab.selected) selected = 'selected';\n\n\treturn '<li id=\"'+tab.id+'\"><a href=\"'+tab.url+'\" onclick=\"if(focustab) opentab('+(index)+'); else focustab=true; return false;\" onmouseover=\"this.focus();\"><img class=\"icon\" src=\"'+icon+'\"><div class=\"'+selected+'\"><img class=\"screen\" src=\"'+img+'\"></div><span>'+tab.title+'</span></a></li>';\n}", "_makeTabsFromPfTab () {\n let ul = this.querySelector('ul');\n let pfTabs = this.querySelectorAll('pf-tab');\n [].forEach.call(pfTabs, function (pfTab, idx) {\n let tab = this._makeTab(pfTab);\n ul.appendChild(tab);\n this.tabMap.set(tab, pfTab);\n this.panelMap.set(pfTab, tab);\n\n if (idx === 0) {\n this._makeActive(tab);\n } else {\n pfTab.style.display = 'none';\n }\n }.bind(this));\n }", "navigateToTab(tabIndex) {\n this.props.navigator.handleDeepLink({\n link: 'tab/' + tabIndex\n });\n this.props.navigator.dismissModal({animationType: 'slide-down'});\n }" ]
[ "0.66776645", "0.6347059", "0.62501615", "0.60769594", "0.6051393", "0.59929645", "0.59875596", "0.59699994", "0.5966047", "0.5892641", "0.58367765", "0.58248866", "0.58224255", "0.580555", "0.57718146", "0.5764554", "0.574374", "0.5736207", "0.57299453", "0.57164484", "0.5710292", "0.56965", "0.56842154", "0.567119", "0.5610391", "0.5599284", "0.5595739", "0.5573694", "0.5558208", "0.55422467", "0.55094326", "0.5494656", "0.54940706", "0.54850256", "0.54837304", "0.5469078", "0.54682124", "0.5464925", "0.54596", "0.54564494", "0.5451474", "0.5449962", "0.5445016", "0.54403114", "0.54380625", "0.54274166", "0.54244107", "0.5424064", "0.54199576", "0.5418388", "0.5388183", "0.5384531", "0.53773856", "0.53766006", "0.537275", "0.5369778", "0.536838", "0.5367067", "0.5365197", "0.53634715", "0.5361607", "0.5360783", "0.5356601", "0.5355141", "0.535281", "0.5348083", "0.53397286", "0.5338375", "0.5327384", "0.53265315", "0.52923036", "0.52917355", "0.5288175", "0.5286233", "0.52826786", "0.5277159", "0.5275075", "0.5274579", "0.52734315", "0.5270965", "0.52671415", "0.52633417", "0.5259817", "0.5259817", "0.5259149", "0.5258673", "0.52473336", "0.52324665", "0.5222163", "0.52162755", "0.5212757", "0.52021945", "0.5186559", "0.51847947", "0.5182303", "0.51770306", "0.51763844", "0.51740974", "0.5173009", "0.51709336" ]
0.64225847
1
React navigation tab stack for Song Analyser.
function TabTwoNavigator() { return ( <TabTwoStack.Navigator> <TabTwoStack.Screen name="SongAnalyserHome" component={SongAnalyser} options={{ headerTitle: 'Song Analyser' }} /> <TabTwoStack.Screen name="SearchSong" component={SearchSong} options={{ headerTitle: 'Song Analyser' }} /> <TabTwoStack.Screen name="SongResults" component={SongResults} options={{ headerTitle: 'Song Analyser' }} /> </TabTwoStack.Navigator> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function TabOneNavigator() {\n return (\n <TabOneStack.Navigator>\n <TabOneStack.Screen\n name=\"PlaylistAnalyserHome\"\n component={PlaylistAnalyser}\n options={{ headerTitle: 'Playlist Analyser' }}\n />\n <TabOneStack.Screen\n name=\"SearchSong\"\n component={SearchSong}\n options={{ headerTitle: 'Playlist Analyser' }}\n />\n <TabOneStack.Screen\n name=\"SearchPlaylist\"\n component={SearchPlaylist}\n options={{ headerTitle: 'Playlist Analyser' }}\n />\n <TabOneStack.Screen\n name=\"SearchPlaylistResults\"\n component={SearchPlaylistResults}\n options={{ headerTitle: 'Playlist Analyser' }}\n />\n <TabOneStack.Screen\n name=\"PlaylistResults\"\n component={PlaylistResults}\n options={{ headerTitle: 'Playlist Analyser' }}\n />\n </TabOneStack.Navigator>\n );\n}", "function TabStack(props) {\n const tabPress = (e) => {\n global.currenRouter = e.target.split(\"-\")[0];\n };\n return (\n <Tab.Navigator\n initialRouteName=\"Home\"\n activeColor=\"#e91e63\"\n shifting={true}\n barStyle={{\n backgroundColor: \"white\",\n }}\n >\n <Tab.Screen\n name=\"Home\"\n component={CategoriesScreen}\n listeners={{ tabPress }}\n options={{\n title: \"Trang chủ\",\n tabBarIcon: ({ color }) => (\n <Icon color={color} name=\"home\" size={26} />\n ),\n }}\n />\n\n {/* <Tab.Screen name=\"Template\" component={TemplateStackScreen} listeners={{ tabPress }} /> */}\n <Tab.Screen\n name=\"Message\"\n component={MessageScreen}\n listeners={{ tabPress }}\n options={{\n title: \"Tin Nhắn\",\n tabBarIcon: ({ color }) => (\n <Icon color={color} name=\"comment\" size={26} />\n ),\n }}\n />\n <Tab.Screen\n name=\"Account\"\n component={AccountScreen}\n listeners={{ tabPress }}\n options={{\n title: \"Tài Khoản\",\n tabBarIcon: ({ color }) => (\n <Icon color={color} name=\"account-circle\" size={26} />\n ),\n }}\n />\n </Tab.Navigator>\n );\n}", "render(){\n var trackers_list = get_top_trackers()\n\n return (\n <div className=\"flex-container\">\n <Tab.Container id=\"tracker-tabs\" defaultActiveKey=\"first\">\n <Row class=\"tracker-list-box\">\n <Col sm={3}>\n <Nav variant=\"pills\" className=\"flex-column\">\n <Nav.Item>\n <Nav.Link variant=\"primary\" className=\"header-tab\" eventKey=\"first\">Website</Nav.Link>\n </Nav.Item>\n {trackers_list.map(datas =>\n <Nav.Item>\n <Nav.Link variant=\"primary\" eventKey={datas[0]}>{datas[0]}</Nav.Link>\n </Nav.Item>\n )}\n </Nav>\n </Col>\n <Col sm={8}>\n <Tab.Content>\n <Tab.Pane eventKey=\"first\">\n <p className=\"text-for-tabs\"> Click on a tab to view a scrollable list of the trackers on that website!\n </p>\n </Tab.Pane>\n {trackers_list.map(datas =>\n <Tab.Pane eventKey={datas[0]}>\n <ul class=\"tracker-list\">\n {datas[1].map(tracker =>\n <li style={{listStyle: 'circle', marginLeft: '4px', marginTop: '2px', marginBottom: '2px'}}>{tracker}</li>\n )}\n </ul>\n </Tab.Pane>\n )}\n </Tab.Content>\n </Col>\n </Row>\n </Tab.Container>\n </div>\n )\n }", "render() {\n const { appNavigationState } = this.props;\n const { tabs } = appNavigationState;\n const tabKey = tabs.routes[tabs.index].key;\n const scenes = appNavigationState[tabKey];\n\n return (\n <View style={styles.navigator}>\n <NavigationCardStack\n key={`stack_${tabKey}`}\n onNavigateBack={this.back}\n navigationState={scenes}\n renderOverlay={this.renderHeader}\n renderScene={this.renderScene}\n style={styles.navigatorCardStack}\n />\n <YourTabs\n navigationState={tabs}\n />\n </View>\n );\n }", "renderTabs() {\n return (\n <Tabs defaultActiveKey={1} id=\"tab\" >\n <Tab eventKey={1} title=\"Projects\">\n {this.renderProjs()}\n </Tab>\n <Tab eventKey={2} title=\"Users\">\n {this.renderUsers()}\n </Tab>\n <Tab eventKey={3} title=\"Search\">\n {this.renderSearch()}\n <ListGroup><br /><br />\n {this.renderResult()}\n </ListGroup>\n </Tab>\n </Tabs>\n );\n }", "function Tabs(props){\n const allTabs = ['synopsis', 'cast', 'episodes', 'related'];\n const tabNames = ['Story', 'Cast', 'Eps.', 'Related'];\n\n const tabs = allTabs.map((tab, index) => {\n const load = (tab === 'synopsis' ? null : 'MAL'); // Whether to load MAL or not\n const onTab = props.currentTab === tab // See if it's on\n const className = `tab-${tab} ` + (onTab ? 'on' : null); // If on, add \"on\"\n\n return(<div key={tab} className={className} onClick={() => props.handleTab(tab, load)}> {tabNames[index]}</div>)\n });\n\n return(\n <div className=\"window-tabs\">\n {tabs}\n </div>\n )\n }", "setStackTab() {\n }", "render(){\n\n\n return (\n\n\n <Tab.Navigator\n \n >\n \n <Tab.Screen name=\"Profile\" component={ProfileStackScreen} />\n <Tab.Screen name=\"Post\" component={PostStackScreen} />\n <Tab.Screen name=\"Friends\" component={FriendsStackScreen} />\n <Tab.Screen name=\"Chitts\" component={ChittsStackScreen} />\n\n </Tab.Navigator>\n\n )\n }", "function TabStackNavigator() {\n return (\n <Stack.Navigator screenOptions={{headerShown: false}}>\n <Stack.Screen name={ROUTES.Tab1} component={Home} />\n <Stack.Screen name={ROUTES.Search} component={Search} />\n <Stack.Screen name={ROUTES.Quotes} component={QuoteStackNavigator} />\n <Stack.Screen name={ROUTES.Clients} component={ClientStackNavigator} />\n <Stack.Screen name={ROUTES.Users} component={UsersStackNavigator} />\n <Stack.Screen name={ROUTES.Orders} component={OrdersStackNavigator} />\n <Stack.Screen name={ROUTES.Products} component={ProductStackNavigator} />\n <Stack.Screen\n name={ROUTES.UploadOrders}\n component={UploadOrdersStackNavigator}\n />\n <Stack.Screen\n name={ROUTES.SupportRequests}\n component={RequestsStackNavigator}\n />\n </Stack.Navigator>\n );\n}", "function HomeBottomTabs() {\n return (\n <Tab.Navigator\n //customize the bottom tabs using the customTabBarStyle\n tabBarOptions={customTabBarStyle}\n >\n <Tab.Screen\n name=\"Classes\"\n //make this tab go to the classes screen\n component={ClassesStackScreen}\n options={{\n //make the icon for this tab a scholar's cap\n tabBarIcon: ({ color, size }) => (\n <Ionicons name=\"school-outline\" size={size} color={color} />\n ),\n }}\n />\n <Tab.Screen\n name=\"Notes\"\n //make this tab go to the library screen\n component={LibraryStackScreen}\n options={{\n //make the icon for this tab a notes icon\n tabBarIcon: ({ color, size }) => (\n <SimpleLineIcons name=\"note\" size={size} color={color} />\n ),\n }}\n />\n <Tab.Screen\n name=\"Folders\"\n //make this tab go to the folders screen\n component={FoldersStackScreen}\n options={{\n //make the icon for this tab a folder\n tabBarIcon: ({ color, size }) => (\n <AntDesign name=\"folder1\" size={size} color={color} />\n ),\n }}\n />\n <Tab.Screen\n name=\"Planner\"\n //make this tab go to the planner screen\n component={PlannerStackScreen}\n options={{\n //make the icon for this tab a calendar\n tabBarIcon: ({ color, size }) => (\n <FontAwesome5 name=\"calendar-check\" size={size} color={color} />\n ),\n }}\n />\n </Tab.Navigator>\n );\n}", "function Interview(props) {\n\n //Creating object of pages\n const navigation = {\n pages: [\n { path: '/', label: 'Welcome', },\n { path: '/about-me', label: 'About Me' },\n { path: '/about-website', label: 'Why this website?' }\n ],\n }\n\n //Handler for Navigation tab changed\n const selectionHandler = (event, value) => {\n props.history.push(value);\n }\n\n return (\n //Website Navigation Tabs \n <Grid className='Interview' style={{height: '100%'}}>\n <CustomTabs\n value={props.history.location.pathname || '/'}\n onChange={selectionHandler}\n centered\n >\n {navigation.pages.map((page) => {\n return (\n <CustomTab value={page.path} label={page.label} key={page.path} />\n )\n })}\n </CustomTabs>\n {/*Configuring Switch to rerender exact page requested*/}\n <Switch>\n <Route path='/about-website'>\n <AboutWebsite />\n </Route>\n <Route path='/about-me'>\n <AboutMe />\n </Route>\n <Route path='/'>\n <Welcome />\n </Route>\n </Switch>\n <Footer />\n </Grid>\n );\n}", "function App() {\n return (\n <div className=\"App\">\n <Nav arr={tab}/>\n\n </div>\n );\n}", "phaseTabs() {\n var allPhasesTab = (\n <li key={'all'} className={'tab ' + this.isViewingPhase('all')}>\n <a id={'all'} onClick={this.setPhase}>All Games</a>\n </li>\n );\n var tabList = [allPhasesTab];\n for(var phase in this.props.divisions) {\n if(phase != 'noPhase') {\n var oneTab = (\n <li key={phase} className={'tab ' + this.isViewingPhase(phase)}>\n <a id={phase} onClick={this.setPhase}>{phase}</a>\n </li>\n );\n tabList.push(oneTab);\n }\n }\n var skinny = this.state.overflowTabs ? '' : ' skinny-tabs';\n return (\n <div className=\"nav-content\">\n <ul className={'tabs tabs-transparent' + skinny} id=\"phase-tabs\">\n {tabList}\n </ul>\n </div>\n );\n }", "render() {\n return (\n <div>\n <h1>Ja<span className=\"highlight\">mmm</span>ing</h1>\n <div className=\"App\">\n <SearchBar onSearch={this.search} />\n <div className=\"App-playlist\">\n <SearchResults searchResults={this.state.searchResults}\n onAdd={this.addTrack}/>\n <PlayList name={this.state.playlistName}\n tracks={this.state.playlistTracks} onRemove={this.removeTrack}\n onNameChange={this.updatePlaylistName} onSave={this.savePlaylist} />\n </div>\n </div>\n </div>\n );\n }", "render() {\n let self = this;\n let count = 0;\n return (\n <div className=\"start\">\n <div className=\"start-header\">\n <div>\n <h1>Weather Report</h1>\n\n </div>\n </div>\n\n <div className=\"start-body\">\n <div>\n <Search\n placeholder=\"Search the weather city\"\n onChange={this.onSearchKeyChange.bind(this)}\n onSearch={this.handleSearch.bind(this)}\n style={{ width: \"50vh\" }}\n\n />\n </div>\n <br />\n\n <Tabs defaultActiveKey=\"1\" onChange={this.callback}>\n <TabPane tab=\"Weather 5 day / 3 hour forecast above 20\" key=\"1\">\n {this.state.allWeatherabove20.map(function (item) {\n return (\n <div>\n <Collapse >\n <Panel header={item.Date}>\n <Descriptions title=\"Weather Info\" bordered>\n <Descriptions.Item label=\"Date Time\">\n {item.Date}\n </Descriptions.Item>\n\n <Descriptions.Item label=\"Temperature\">\n {item.Temperature}\n </Descriptions.Item>\n </Descriptions>\n\n </Panel>\n\n </Collapse>\n </div>\n )\n })}\n\n </TabPane>\n <TabPane tab=\"Sunny/Clear Weather\" key=\"2\">\n {this.state.allclearWeather.map(function (item) {\n return (\n <div>\n <Collapse >\n <Panel header={item.Date}>\n <Descriptions title=\"Weather Info\" bordered>\n <Descriptions.Item label=\"Date Time\">\n {item.Date}\n </Descriptions.Item>\n\n <Descriptions.Item> \n <Image width={100} src={item.Image}\n /> </Descriptions.Item>\n\n <Descriptions.Item label=\"Description\">\n {item.Description}\n </Descriptions.Item>\n </Descriptions>\n\n </Panel>\n\n </Collapse>\n </div>\n )\n })}\n\n </TabPane>\n </Tabs>\n\n\n\n </div>\n\n\n </div>\n\n );\n }", "function ClassBottomTabs({ route }) {\n return (\n <Tab.Navigator\n //customize the bottom tabs using the customTabBarStyle\n //edit some of the parameters from the customTabBarStyle to suit the class that the user navigated to\n tabBarOptions={{\n ...customTabBarStyle,\n activeTintColor: route.params.tintColor,\n style: {\n backgroundColor: \"white\",\n },\n }}\n >\n <Tab.Screen\n name=\"Camera\"\n options={{\n //make the bottom tab icon a camera\n tabBarIcon: ({ color, size }) => (\n <Feather name=\"camera\" size={size} color={color} />\n ),\n }}\n >\n {/* Customize the header of the camera screen to suit the class that the user navigated to */}\n {(props) => (\n <CameraStackScreen\n {...props}\n title={route.params.title}\n backgroundColor={route.params.backgroundColor}\n iconName={route.params.iconName}\n />\n )}\n </Tab.Screen>\n <Tab.Screen\n name=\"Notes\"\n options={{\n //make the bottom tab icon a notes icon\n tabBarIcon: ({ color, size }) => (\n <SimpleLineIcons name=\"note\" size={size} color={color} />\n ),\n }}\n >\n {/* Customize the header of the library screen to suit the class that the user navigated to */}\n {(props) => (\n <LibraryStackScreen\n {...props}\n title={route.params.title}\n backgroundColor={route.params.backgroundColor}\n iconName={route.params.iconName}\n />\n )}\n </Tab.Screen>\n <Tab.Screen\n name=\"Folders\"\n options={{\n //make the bottom tab icon a folder\n tabBarIcon: ({ color, size }) => (\n <AntDesign name=\"folder1\" size={size} color={color} />\n ),\n }}\n >\n {/* Customize the header of the folders screen to suit the class that the user navigated to */}\n {(props) => (\n <FoldersStackScreen\n {...props}\n title={route.params.title}\n backgroundColor={route.params.backgroundColor}\n iconName={route.params.iconName}\n />\n )}\n </Tab.Screen>\n <Tab.Screen\n name=\"Planner\"\n options={{\n //make the bottom tab icon a calendar\n tabBarIcon: ({ color, size }) => (\n <FontAwesome5 name=\"calendar-check\" size={size} color={color} />\n ),\n }}\n >\n {/* Customize the header of the planner screen to suit the class that the user navigated to */}\n {(props) => (\n <PlannerStackScreen\n {...props}\n title={route.params.title}\n backgroundColor={route.params.backgroundColor}\n iconName={route.params.iconName}\n />\n )}\n </Tab.Screen>\n </Tab.Navigator>\n );\n}", "function TabLinks(props) {\n \n const state = useContext(UserContext);\n const { value, setValue } = state;\n\n const handleChange = (event, newValue) => {\n setValue(newValue);\n };\n\n const handleLinks = value => {\n props.history.replace(value)\n };\n\n return (\n <div style={{ flexGrow: \"1\", margin: \"0\"}}>\n <Tabs\n value={value}\n onChange={handleChange}\n indicatorColor=\"primary\"\n textColor=\"primary\"\n variant={$(window).width() < 769 ? \"fullWidth\" : \"standard\"}\n centered\n >\n <Tab label=\"Home\" className={\"tabs\"} onClick={() => handleLinks(\"/\")} />\n <Tab label={$(window).width() < 769 ? \"Upcoming\" : \"Upcoming Items\"} className={\"tabs\"} onClick={() => handleLinks(\"/upcoming\")} />\n <Tab label={$(window).width() < 769 ? \"Weapons\" : \"Weapon Search\"} className={\"tabs\"} onClick={() => handleLinks(\"/weaponsearch\")}/>\n <Tab label={$(window).width() < 769 ? \"Players\" : \"Player Information\"} className={\"tabs\"} onClick={() => handleLinks(\"/playersearch\")}/>\n </Tabs>\n </div>\n );\n}", "function ChangeTabs(evt, backSymbol) {\n var i, tabcontent, tablinks;\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n document.getElementById(backSymbol).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n}", "function NavTabs(props) {\n const {\n tabs = [],\n currentPage,\n handlePageChange,\n } = props;\n \n return (\n <ul className=\"nav nav-tabs ml-auto my-1 mr-2\">\n {tabs.map((tab) => (\n <li\n className=\"nav-item\"\n key={tab}\n style={{\n backgroundColor: \"#122240\",\n color: \"#be8180\",\n }}\n >\n <a\n style={{\n backgroundColor: \"#122240\",\n color: \"#be8180\",\n }}\n href={\"#\" + tab.toLowerCase()}\n // Whenever a tab is clicked on,\n // the current page is set through the handlePageChange props.\n onClick={() => handlePageChange(tab)}\n className={currentPage === tab ? \"nav-link active\" : \"nav-link\"}\n >\n {tab}\n </a>\n </li>\n ))}\n </ul>\n );\n}", "renderTab(e) {\n\t\tthis.setState({\n\t\t\tcons:'', \n\t\t\tvowl:'', \n\t\t\ttabData: this.second.current.state.selected.data\n\t\t}, this.props.onClick); \n\t}", "render(){\n return (\n <div>\n {/*Page header used by bootstrap to name the app */}\n <PageHeader>Title <small>Words to live by</small></PageHeader>\n {/*\n Nav/NavItem used by bootstrap to create links to different routes.\n React-router v4 uses \"Link\" imported from 'react-router-dom' rather\n than simple hrefs. Since bootstrap NavItems use hrefs, we need to\n use LinkContainer to make them play nice.\n */}\n <Nav bsStyle=\"tabs\">\n <LinkContainer exact={true} to =\"/\">\n <NavItem eventKey={1}>\n Home\n </NavItem>\n </LinkContainer>\n <LinkContainer to =\"/route1\">\n <NavItem eventKey={2}>\n Route 1\n </NavItem>\n </LinkContainer>\n <LinkContainer to =\"/route2\">\n <NavItem eventKey={3}>\n Route 2\n </NavItem>\n </LinkContainer>\n </Nav>\n </div>\n )\n }", "displayTracks(album) {\n var route = {\n albumId: album.id,\n title: album.title,\n scene: 1\n }\n this.props.navigator.push(route);\n }", "function navAllStories(evt) {\n console.debug(\"navAllStories\");\n hidePageComponents();\n putStoriesOnPage();\n // addStarToStories();\n}", "renderProjs() {\n return (\n <div className=\"projs\">\n <PageHeader>All Projects</PageHeader>\n <Tabs defaultActiveKey={1} id=\"projtab\" >\n <Tab eventKey={1} title=\"All Projects\">\n <ListGroup>\n {this.renderProjsList(this.state.projs)}\n </ListGroup>\n </Tab>\n <Tab eventKey={2} title=\"Completed Projects\">\n <ListGroup>\n {this.renderCompProjsList(this.state.projs)}\n </ListGroup>\n </Tab>\n <Tab eventKey={3} title=\"Active Projects\">\n <ListGroup>\n {this.renderActiveProjsList(this.state.projs)}\n </ListGroup>\n </Tab>\n <Tab eventKey={4} title=\"Pending Projects\">\n <ListGroup>\n {this.renderPendingProjsList(this.state.projs)}\n </ListGroup>\n </Tab>\n </Tabs>\n </div>\n );\n }", "render() {\n const { activeTab } = this.state;\n return (\n <div className=\"Game\">\n <Menu inverted size=\"massive\" widths={4} stackable attached=\"bottom\">\n {this.createTab(\n 'players', 'orange', this.props.lfgCount, 'new recruit', 'Recruit Noobs')}\n {this.createTab(\n 'teams', 'green', this.props.rosterCount, 'free player', 'Group Players into Teams')}\n {this.createTab(\n 'matches', 'red', this.props.teamWaitingCount, 'ready team', 'Battle!')}\n {this.createTab(\n 'stats', 'grey', this.props.newAchievements, 'achievement', 'Progress & Achievements')}\n </Menu>\n <div className=\"GameContent\">\n <Players display={activeTab === 'players'} />\n <Teams display={activeTab === 'teams'} />\n <Matches display={activeTab === 'matches'} />\n </div>\n </div>\n );\n }", "function MainView() {\n return (\n <div className=\"col-md-9\">\n <div className=\"feed-toggle\">\n <ul className=\"nav nav-pills outline-active\">\n <YourFeedTab />\n\n <GlobalFeedTab />\n\n <TagFilterTab />\n </ul>\n </div>\n\n <ArticleList />\n </div>\n );\n}", "function NavTabs(props) {\n return (\n <div>\n <nav className='navbar pt-3 pb-3 navbar-expand-lg nav-jgMain fixed-top bg-dark'>\n <div className='container'>\n <a className='navbar-brand navbar-brand-jg' href='index.html'>\n JENNERATION\n </a>\n <button\n className='navbar-toggler navbar-dark bg-dark'\n type='button'\n data-toggle='collapse'\n data-target='#navbarNavAltMarkup'\n aria-controls='navbarNavAltMarkup'\n aria-expanded='false'\n aria-label='Toggle navigation'\n >\n <span className='navbar-toggler-icon'></span>\n </button>\n <div\n className='collapse navbar-collapse justify-content-end'\n id='navbarNavAltMarkup'\n >\n <div className='navbar-nav'>\n <a\n className='nav-item nav-link active'\n href='#home'\n onClick={() => props.handlePageChange(\"Home\")}\n className={\n props.currentPage === \"Home\" ? \"nav-link active\" : \"nav-link\"\n }\n >\n Home<span className='sr-only'>(current)</span>\n </a>\n\n <a\n className='nav-item nav-link active'\n href='#projects'\n onClick={() => props.handlePageChange(\"Projects\")}\n className={\n props.currentPage === \"Projects\"\n ? \"nav-link active\"\n : \"nav-link\"\n }\n >\n Works\n </a>\n\n <a\n className='nav-item nav-link active'\n href='#about'\n onClick={() => props.handlePageChange(\"About\")}\n className={\n props.currentPage === \"About\" ? \"nav-link active\" : \"nav-link\"\n }\n >\n About\n </a>\n\n <a\n className='nav-item nav-link active'\n href='#contact'\n onClick={() => props.handlePageChange(\"Contact\")}\n className={\n props.currentPage === \"Contact\"\n ? \"nav-link active\"\n : \"nav-link\"\n }\n >\n Contact\n </a>\n </div>\n </div>\n </div>\n </nav>\n </div>\n );\n}", "function HistoryTab() {\n\treturn (\n\t\t<div>\n\t\t\t<p>Hello World This is the History Tab</p>\n\t\t\t<img src={Head} />\n\t\t</div>\n\t);\n}", "function loadTabs() {\n\t\tvar htmlToAppend = '';\n\t\thtmlToAppend += '<ul class=\"nav nav-tabs\">';\n\t\t\n\t\tvar tabsMade = 0;\n\t\tfor(var i = 0; i <tuneJSON.tracks.length; i++) {//create the nav tabs for each nonempty track\n\t\t\tif(typeof tuneJSON.tracks[i].instrument !== 'undefined') {\n\t\t\t\tif(tabsMade === 0) {//if first tab add an active class to it\n\t\t\t\t\ttabsMade++;\n\t\t\t\t\thtmlToAppend +='<li class=\"active\"><a href=\"#track' + i +\n\t\t\t\t\t '\" data-toggle=\"tab\"><span class=\"instrument-name\">' + midiHelper.getInstrumentName(tuneJSON.tracks[i].instrument) + \n\t\t\t\t\t '</span></a></li>';\n\t\t\t\t} else {\n\t\t\t\t\thtmlToAppend += '<li role=\"presentation\"><a href=\"#track' + i + '\" role=\"tab\" data-toggle=\"tab\"><span class=\"instrument-name\">' +\n\t\t\t\t\tmidiHelper.getInstrumentName(tuneJSON.tracks[i].instrument) + \n\t\t\t\t\t'</span><button class=\"remove-tab-button\" id=\"remove-tab' + i + '\"><span class=\"glyphicon glyphicon-remove\" aria-hidden=\"true\"></span></button></a></li>';\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\thtmlToAppend += '</ul><div class=\"tab-content\">';\n\t\t//now add the tab panels\n\t\t\n\t\ttabsMade = 0;\n\n\t\tfor(var i = 0; i <tuneJSON.tracks.length; i++) {//create the tab pane for each nonempty track\n\t\t\tif(typeof tuneJSON.tracks[i].instrument !== 'undefined') {\n\t\t\t\tif(tabsMade === 0) {\n\t\t\t\t\thtmlToAppend += '<div class=\"tab-pane active\" id=\"track' + i +'\"></div>';\n\t\t\t\t\ttabsMade++;\n\t\t\t\t} else {\n\t\t\t\t\thtmlToAppend+= '<div class=\"tab-pane\" id=\"track' + i +'\"></div>';\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\thtmlToAppend += '</div>';\n\t\t$('.canvas').append(htmlToAppend);\n\n\t\t$('.remove-tab-button').click(function() {//add remove event to delete button\n\t\t\tdeleteInstrument(parseInt($(this).attr('id').substring(10), 10));//get index of track\n\t\t});\n\t\t\n\t}", "getRenderedTabs() {\n let changeTab = this.props.changeTab;\n let shownTab = this.props.shownTab;\n\n let addClass = shownTab === TAB_ADD ? 'active' : '';\n let searchClass = shownTab === TAB_SEARCH ? 'active' : '';\n\n return (\n <ul className='nav nav-tabs'>\n <li className={addClass}\n onClick={changeTab.bind(this, TAB_ADD)}\n >\n <a href='#'>Wall</a>\n </li>\n <li className={searchClass}\n onClick={changeTab.bind(this, TAB_SEARCH)}\n >\n <a href='#'>Search</a>\n </li>\n </ul>\n );\n }", "getTabs() {\n let tabList = []\n for (const tabLabel of Object.values(this.props.tabs)) {\n tabList.push(<Tab key={tabLabel} title={tabLabel} tabs={this.props.tabs} updateTabs={() => this.props.updateTabs(this.props.keywordsToSearch)}> </Tab>)\n }\n return tabList\n }", "function gridToStack(){\n subNavHandler(0, 'singlestack', 10);\n }", "handleNavClicks() {\n if (hasEl(`#${this.playlistNavPrev.id}`)) {\n this.playlistNavPrev.addEventListener('click', (e) => {\n e.preventDefault()\n this.prev()\n })\n }\n if (hasEl(`#${this.playlistNavNext.id}`)) {\n this.playlistNavNext.addEventListener('click', (e) => {\n e.preventDefault()\n this.next()\n })\n }\n }", "render() {\n console.log('sef a', this.props)\n return (\n <div className=\"intro_container\">\n <div className=\"text_intro\">\n <p>More...</p>\n </div>\n <div className=\"intro_tabs\">\n <div className=\"news_bubble\">\n <img className=\"news_img\" src={feed} alt=\"\"/>\n <button onClick={() => this.props.router.history.push('/feed')} className=\"main_button_tab\">Feed</button>\n </div>\n <div className=\"friends_bubble\">\n <img className=\"friends_img\" src={chat} alt=\"\"/>\n <button onClick={() => this.props.router.history.push('/chat')} className=\"main_button_tab\">Chat</button>\n </div>\n <div className=\"space_station_bubble\">\n <img className=\"ss_img\" src={apod} alt=\"\"/>\n <button onClick={() => this.props.router.history.push('/apod')} className=\"main_button_tab\">APOD</button>\n </div>\n </div>\n <div className=\"bottom_footer\">\n \n </div>\n </div>\n )\n }", "_genTab(){\n const tabs = {}\n const {keys,theme} = this.props\n this.preKeys = keys\n keys.forEach((item,index) => {\n if(item.checked){\n tabs[`tab${index}`] = {\n screen: props => <TreadingTabPage theme={theme} {...props} timeSpan={this.state.timeSpan} tabLabel={item.name}/>, // 这是个不错的技巧\n navigationOptions:{\n title:item.name\n }\n }\n }\n });\n return tabs\n }", "render() {\n\n return (\n <div className=\"settings-subnav\">\n <Tabs.Tabs className=\"grid-one\">\n <Tabs.Tab label=\"General\">\n <section className=\"grid-one\">\n <div className=\"grid-item\"><BasicCard/></div>\n <div className=\"grid-item\"><BasicCard/></div>\n <div className=\"grid-item\"><Toggle label=\"Toggle Stuff\" defaultToggled={true}/></div>\n </section>\n </Tabs.Tab>\n <Tabs.Tab label=\"Design\" >\n </Tabs.Tab>\n <Tabs.Tab label=\"Modules\" />\n <Tabs.Tab label=\"Notify\" />\n <Tabs.Tab label=\"Priveleges\" />\n </Tabs.Tabs>\n </div>\n // <DropDownMenu menuItems={menuItems} onChange={this.transitionToRoute} />\n );\n }", "render () {\n\t\tlet { tabStates } = this.state;\n\t\tlet { project, diagram } = this.props;\n\t\tlet tabs = [];\n\n\t\ttabs.push(Tab(0, project ? project.name : 'No Project selected', ProjectMenu, this.props));\n\n\t\tif (project) {\n\t\t\ttabs.push(Tab(1, diagram ? diagram.name : 'No Diagram selected', DiagramMenu, this.props));\n\t\t\tif (diagram) {\n\t\t\t\ttabs.push(Tab(2, `Components [${diagram.type}]`, ComponentMenu, this.props));\n\t\t\t}\n\t\t}\n\n\t\treturn <div className=\"side\">\n\t\t\t<Tabs tabs={tabs} toggle={this.setTabState} states={tabStates}/>\n\t\t</div>;\n\t}", "function navAllStories(evt) {\n hidePageComponents();\n putStoriesOnPage();\n}", "render() {\n let homeActive = \"\";\n let searchActive = \"\";\n let libraryActive = \"\";\n let songsActive = \"\";\n let createPlaylistsActive = \"\";\n let likedSongsActive = \"\";\n let currentURL = window.location.href;\n if (currentURL === baseUrl2 + \"webplayer/home\") {\n homeActive = \"active\";\n searchActive = \"\";\n libraryActive = \"\";\n createPlaylistsActive = \"\";\n likedSongsActive = \"\";\n songsActive=\"\";\n } else if (currentURL === baseUrl2 + \"webplayer/librarypage/playlists\") {\n homeActive = \"\";\n searchActive = \"\";\n libraryActive = \" active\";\n createPlaylistsActive = \"\";\n likedSongsActive = \"\";\n songsActive=\"\";\n } else if (currentURL === baseUrl2 + \"webplayer/likedplay\") {\n homeActive = \"\";\n searchActive = \"\";\n libraryActive = \"\";\n createPlaylistsActive = \"\";\n likedSongsActive = \"BottomTwoActive\";\n songsActive=\"\";\n } else if (currentURL === baseUrl2 + \"webplayer/songs\") {\n homeActive = \"\";\n searchActive = \"\";\n libraryActive = \"\";\n createPlaylistsActive = \"\";\n likedSongsActive = \"\";\n songsActive=\"active\";\n }\n let redirected = null;\n if (this.state.SignedIn) {\n redirected = <Redirect to=\"/webplayer/librarypage/playlists\"></Redirect>;\n }\n\n let songsSidebar = null;\n if (this.props.isSignedIn.isSignedIn === true) {\n songsSidebar=(\n <Link to=\"/webplayer/songs\" className={songsActive}>\n <i className=\"fa fa-music\" />\n Songs\n </Link >\n );\n }\n else{\n songsSidebar=(\n <Button \n className={\"SidebarSongButton \" + songsActive}\n onClick={()=>this.toggleModalSong()}>\n <i className=\"fa fa-music\" />\n Songs\n </Button>\n );\n }\n \n // const showLikeAndCreate = this.props.data.data.map((data) => {\n // if (data.id === this.state.tempId) {\n // return(\n // <div>\n // <h3 className=\"sidebarHeaderBetween\">PLAYLISTS</h3>\n // <Link to=\"/\" className={createPlaylistsActive}>\n // <i className=\"fa fa-plus-square\"></i>\n // Create Playlist\n // </Link>\n // <Link to=\"/webplayer/nowplay\" className={likedSongsActive}>\n // <i className=\"fa fa-heart\"></i>\n // Liked Songs\n // </Link>\n // </div>\n // )\n // }\n // });\n\n let showLikeAndCreate = (\n <div>\n <h3 className=\"sidebarHeaderBetween\">PLAYLISTS</h3>\n <Button className={\"SidebarSongButton\" + createPlaylistsActive} onClick={()=>this.toggleModalNew()}>\n <i className=\"fa fa-plus-square\"></i>\n Create Playlist\n </Button>\n <Link to=\"/webplayer/likedplay\" className={likedSongsActive}>\n <i className=\"fa fa-heart\"></i>\n Liked Songs\n </Link>\n </div>\n );\n\n return (\n <div>\n {redirected}\n <div className=\"WebPlayerHomeBody\">\n <div className=\"container InfoContainer\">\n <div className=\"row InfoContainerRow\">\n <div className=\"col-md-3 col-lg-2 Linkers\">\n <div className=\"sidebar\">\n <Link to=\"/home\" className=\"AppearBigImage\">\n <img\n src=\"https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcSBmnPgQKW4JLrNcSFhPFCLHz3t8kT1pZl0PVkLYsa8FoScWYda\"\n height=\"50px\"\n width=\"145px\"\n alt=\"\"\n />\n </Link>\n <Link to=\"/webplayer/home\" className={homeActive}>\n <i className=\"fa fa-home\" />\n Home\n </Link>\n <Link to=\"/webplayer/search\" className={searchActive}>\n <i className=\"fa fa-search\"></i>\n Search\n </Link>\n <Button\n className={\"SidebarLibraryButton\" + libraryActive}\n onClick={this.toggleModal}>\n <i className=\"fa fa-bomb\"></i>\n Your Library\n </Button>\n {songsSidebar}\n {showLikeAndCreate}\n </div>\n </div>\n <div className=\"col-md-9 col-lg-10 webPlayerHomeNavAndContent\">\n <Switch>\n <Route\n path=\"/webplayer/home\"\n component={() => (\n <HomeNavAndContent\n data={this.props.data}\n id={this.props.id}\n playLists={this.props.playLists}\n artist={this.props.artist}\n album={this.props.album}\n handleLogoutId={this.props.handleLogoutId}\n ///////////////\n data_be={this.props.data_be}\n handleLogout_BE={this.props.handleLogout_BE}\n isSignedIn={this.props.isSignedIn}\n handleCurrentPlayList={this.props.handleCurrentPlayList}\n categories={this.props.categories}\n handleCurrentAlbums={this.props.handleCurrentAlbums}\n handleCurrentArtists={this.props.handleCurrentArtists}\n />\n )}\n />\n <Route\n path=\"/webplayer/librarypage\"\n component={() => (\n <LibraryPage\n data={this.props.data}\n id={this.props.id}\n playLists={this.props.playLists}\n artist={this.props.artist}\n album={this.props.album}\n handleLogoutId={this.props.handleLogoutId}\n data_be={this.props.data_be}\n handleCurrentPlayList={this.props.handleCurrentPlayList}\n isSignedIn={this.props.isSignedIn}\n handleLogout_BE={this.props.handleLogout_BE}\n currentPlaylist={this.props.currentPlaylist}\n handleCurrentAlbums={this.props.handleCurrentAlbums}\n handleCurrentArtists={this.props.handleCurrentArtists}\n PlayTheFooter={this.props.PlayTheFooter}\n AddPrevSong={this.props.AddPrevSong}\n PlaySong={this.props.PlaySong}\n PauseSong={this.props.PauseSong}\n isPlaying={this.props.isPlaying}\n token={this.props.token}\n // fetchPlaylistById_be={this.props.fetchPlaylistById_be}\n // playlist_BE={this.props.playlist_BE}\n />\n )}\n />\n <Route\n exact\n path=\"/webplayer/likedplay\"\n component={() => (\n <LikedPlay\n id={this.props.id}\n data={this.props.data}\n playLists={this.props.playLists}\n data_be={this.props.data_be}\n ///////fetching the playlist of the user\n currentPlaylist={this.props.currentPlaylist}\n isSignedIn={this.props.isSignedIn}\n /// for logging out\n handleLogout_BE={this.props.handleLogout_BE}\n patchedfollow={this.props.patchedfollow}\n patchedunfollow={this.props.patchedunfollow}\n PlayTheFooter={this.props.PlayTheFooter}\n PlaySong={this.props.PlaySong}\n PauseSong={this.props.PauseSong}\n isPlaying={this.props.isPlaying}\n isModalOpen={this.props.isModalOpen}\n ControlModal={this.props.ControlModal}\n PatchAddPlaylist={this.props.PatchAddPlaylist}\n ShareSongs={this.props.ShareSongs}\n RemoveQueue={this.props.RemoveQueue}\n AddToQueue={this.props.AddToQueue}\n DeleteAddPlaylist={this.props.DeleteAddPlaylist}\n AddSong_inPlaylist_id={this.props.AddSong_inPlaylist_id}\n songid={this.props.songid}\n DisLikeSong={this.props.DisLikeSong}\n token={this.props.token}\n />\n )}\n />\n <Route\n exact\n path=\"/webplayer/nowplay\"\n component={() => (\n <NowPlay\n fullsongs={this.props.fullsongs}\n id={this.props.id}\n data={this.props.data}\n playLists={this.props.playLists}\n data_be={this.props.data_be}\n ///////fetching the playlist of the user logged in\n currentPlaylist={this.props.currentPlaylist}\n isSignedIn={this.props.isSignedIn}\n handleLogout_BE={this.props.handleLogout_BE}\n ///////Handling the follow and unfollow of the users\n patchedfollow={this.props.patchedfollow}\n patchedunfollow={this.props.patchedunfollow}\n PlayTheFooter={this.props.PlayTheFooter}\n PlaySong={this.props.PlaySong}\n PauseSong={this.props.PauseSong}\n isPlaying={this.props.isPlaying}\n handleChangeData_BE={this.props.handleChangeData_BE}\n token={this.props.token}\n AddSong_inPlaylist_id={this.props.AddSong_inPlaylist_id}\n songid={this.props.songid}\n isModalOpen={this.props.isModalOpen}\n ControlModal={this.props.ControlModal}\n PatchAddPlaylist={this.props.PatchAddPlaylist}\n RemoveQueue={this.props.RemoveQueue}\n AddToQueue={this.props.AddToQueue}\n DeleteAddPlaylist={this.props.DeleteAddPlaylist}\n LikeSong={this.props.LikeSong}\n DisLikeSong={this.props.DisLikeSong}\n ShareSongs={this.props.ShareSongs}\n />\n )}\n />\n <Route\n exact\n path=\"/webplayer/artist\"\n component={() => (\n <Artist\n\n id={this.props.id}\n data={this.props.data}\n playLists={this.props.playLists}\n data_be={this.props.data_be}\n currentPlaylist={this.props.currentPlaylist}\n isSignedIn={this.props.isSignedIn}\n handleLogout_BE={this.props.handleLogout_BE}\n PlayTheFooter={this.props.PlayTheFooter}\n PlaySong={this.props.PlaySong}\n PauseSong={this.props.PauseSong}\n isPlaying={this.props.isPlaying}\n token={this.props.token}\n FollowArtist={this.props.FollowArtist}\n UnFollowArtist={this.props.UnFollowArtist}\n />\n )}\n />\n <Route\n exact\n path=\"/webplayer/search\"\n component={() => (\n <Search\n categories={this.props.categories}\n fullsongs={this.props.fullsongs}\n fullartists={this.props.fullartists}\n id={this.props.id}\n data={this.props.data}\n playLists={this.props.playLists}\n data_be={this.props.data_be}\n currentPlaylist={this.props.currentPlaylist}\n isSignedIn={this.props.isSignedIn}\n handleLogout_BE={this.props.handleLogout_BE}\n PlayTheFooter={this.props.PlayTheFooter}\n PlaySong={this.props.PlaySong}\n PauseSong={this.props.PauseSong}\n isPlaying={this.props.isPlaying}\n token={this.props.token}\n handleCurrentArtists={this.props.handleCurrentArtists}\n />\n )}\n />\n <Route\n exact\n path=\"/webplayer/songs\"\n component={() => (\n <SongsByGenres\n data={this.props.data}\n id={this.props.id}\n playLists={this.props.playLists}\n artist={this.props.artist}\n album={this.props.album}\n handleLogoutId={this.props.handleLogoutId}\n ///////////////\n data_be={this.props.data_be}\n handleLogout_BE={this.props.handleLogout_BE}\n isSignedIn={this.props.isSignedIn}\n handleCurrentPlayList={this.props.handleCurrentPlayList}\n categories={this.props.categories}\n handleCurrentAlbums={this.props.handleCurrentAlbums}\n handleCurrentArtists={this.props.handleCurrentArtists}\n PlayTheFooter={this.props.PlayTheFooter}\n GetSongsByGeneres={this.props.GetSongsByGeneres}\n genretracks={this.props.genretracks}\n token={this.props.token}\n />\n )}\n />\n <Route\n exact\n path=\"/webplayer/queue\"\n component={() => (\n <Queue\n data={this.props.data}\n id={this.props.id}\n playLists={this.props.playLists}\n artist={this.props.artist}\n album={this.props.album}\n handleLogoutId={this.props.handleLogoutId}\n ///////////////\n data_be={this.props.data_be}\n handleLogout_BE={this.props.handleLogout_BE}\n isSignedIn={this.props.isSignedIn}\n handleCurrentPlayList={this.props.handleCurrentPlayList}\n categories={this.props.categories}\n handleCurrentAlbums={this.props.handleCurrentAlbums}\n handleCurrentArtists={this.props.handleCurrentArtists}\n PlayTheFooter={this.props.PlayTheFooter}\n queue={this.props.queue}\n AddPrevSong={this.props.AddPrevSong}\n SetIsQueue={this.props.SetIsQueue}\n isQueue={this.props.isQueue}\n\n />\n )}\n />\n <Redirect to=\"/webplayer/home\" />\n </Switch>\n </div>\n </div>\n </div>\n </div>\n <div className=\"playFooterFixed\">\n <PlayFooter \n currentPlaylist={this.props.currentPlaylist} \n song={this.props.song}\n PlayShuffle={this.props.PlayShuffle}\n PauseShuffle={this.props.PauseShuffle}\n shuffle={this.props.shuffle}\n ChangeSongProgress={this.props.ChangeSongProgress}\n progress={this.props.progress}\n ChangeProgressMode={this.props.ChangeProgressMode}\n in_set_progress_mode={this.props.in_set_progress_mode}\n ChangeProgressDirty={this.props.ChangeProgressDirty}\n is_progress_dirty ={this.props.is_progress_dirty}\n PlayTheFooter={this.props.PlayTheFooter}\n ChangeTotalTime={this.props.ChangeTotalTime}\n ChangeCurrentTime={this.props.ChangeCurrentTime}\n currentTime ={this.props.currentTime}\n totalTime ={this.props.totalTime}\n isSignedIn={this.props.isSignedIn}\n PlayTheFooter={this.props.PlayTheFooter}\n AddPrevSong={this.props.AddPrevSong}\n prevsong={this.props.prevsong}\n audio={this.props.audio}\n AudioControl={this.props.AudioControl}\n GetQueue={this.props.GetQueue}\n queue={this.props.queue}\n data_be={this.props.data_be}\n token={this.props.token}\n LikeSong={this.props.LikeSong}\n DisLikeSong={this.props.DisLikeSong}\n FollowArtist={this.props.FollowArtist}\n UnFollowArtist={this.props.UnFollowArtist}\n RemoveQueue={this.props.RemoveQueue}\n SetIsQueue={this.props.SetIsQueue}\n isQueue={this.props.isQueue}\n handleCurrentPlayList={this.props.handleCurrentPlayList}\n\n\n />\n </div>\n <Modal\n isOpen={this.state.isModalOpen}\n toggle={this.toggleModal}\n className=\"ModalBackGround row\"\n size=\"lg\">\n <div className=\"modal-content modalcontent\">\n <ModalBody className=\"p-0 modalbody\">\n <div className=\"row flexer\">\n <div className=\"col-sm-6 col-md-6 col-lg-6 leftPart \">\n <div className=\"row\">\n <div className=\"col-sm-12 col-md-12 col-lg-12 \">\n <h2 className=\"theHeader\">\n Get the most out of Spotify with a free account\n </h2>\n </div>\n </div>\n <div className=\"row flexer\">\n <div className=\"col-sm-12 col-md-12 col-lg-12\">\n <ol className=\"libraryol\">\n <li className=\"libraryli flexer\">\n <svg\n className=\"librarysvg flexer\"\n xmlns=\"http://www.w3.org/1999/xlink\"\n viewBox=\"0 0 16 18\"\n width=\"16\"\n height=\"16\">\n <polygon points=\"13.985,2.383 5.127,12.754 1.388,8.375 0.73,9.145 5.127,14.294 14.745,3.032\"></polygon>\n </svg>\n No credit card, ever\n </li>\n <li className=\"libraryli flexer\">\n <svg\n className=\"librarysvg flexer\"\n xmlns=\"http://www.w3.org/1999/xlink\"\n viewBox=\"0 0 16 18\"\n width=\"16\"\n height=\"16\">\n <polygon points=\"13.985,2.383 5.127,12.754 1.388,8.375 0.73,9.145 5.127,14.294 14.745,3.032\"></polygon>\n </svg>\n Get unlimited podcasts\n </li>\n <li className=\"libraryli flexer\">\n <svg\n className=\"flexer librarysvg\"\n xmlns=\"http://www.w3.org/1999/xlink\"\n viewBox=\"0 0 16 18\"\n width=\"16\"\n height=\"16\">\n <polygon points=\"13.985,2.383 5.127,12.754 1.388,8.375 0.73,9.145 5.127,14.294 14.745,3.032\"></polygon>\n </svg>\n Play your favorite music, with ads\n </li>\n </ol>\n <div className=\"row LibraryModalClose\">\n <Button\n className=\"LibraryModalCloseButton\"\n color=\"success\"\n onClick={this.toggleModal}>\n Close\n </Button>\n </div>\n </div>\n </div>\n </div>\n <div className=\"col-sm-6 col-md-6 col-lg-6\">\n <div className=\"righPart\">\n <div className=\"innerRight\">\n <Button className=\"signupfree\">\n <Link to=\"/signup\" className=\"linksignup\">\n Sign up free\n </Link>\n </Button>\n <div className=\"seperator_LibraryModal\"></div>\n <div className=\"alreadyhaveanaccount\">\n Already have an account?\n </div>\n <Button className=\"libraryloginbut\">\n <Link to=\"/signin\" className=\"linkLogin\">\n Log in\n </Link>\n </Button>\n </div>\n </div>\n </div>\n </div>\n </ModalBody>\n </div>\n </Modal>\n <Modal isOpen={this.state.isModalOpenNew} toggle={this.toggleModalNew} className=\"\">\n <ModalBody className=\"createPlayLsitBody\">\n <Row>\n <Col md={12} xs={12} sm={12}>\n <Row>\n <Col md={{ size: 6, offset: 5 }} xs={{ size: 6, offset: 5 }} sm={{ size: 6, offset: 5 }}>\n <Button className=\"exitButton_CP\" onClick={()=>this.toggleModalNew()}>\n <svg width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" xmlns=\"http://www.w3.org/2000/svg\">\n <title>Close</title>\n <path d=\"M31.098 29.794L16.955 15.65 31.097 1.51 29.683.093 15.54 14.237 1.4.094-.016 1.508 14.126 15.65-.016 29.795l1.414 1.414L15.54 17.065l14.144 14.143\" fill=\"#fff\" fill-rule=\"evenodd\"></path>\n </svg>\n </Button>\n </Col>\n </Row>\n <Row>\n <Col md={{ size: 6, offset:3}} xs={{ size: 6, offset:3}} sm={{ size: 6, offset:3}} className=\"Create_new_playlist\">\n <h1>Create new playlist</h1>\n </Col>\n </Row>\n <Row>\n <Col className=\"inputField_CP\" md={12} xs={12} sm={12}>\n <div className=\"inputBox_CP\">\n <Row>\n <Col md={{size:10, offset:2}} xs={12} sm={12} >\n <div className=\"contentSpacing_CP\">\n <h4 className=\"inputBox-label_CP\">Playlist Name</h4>\n <input type=\"text\" className=\"inputBox-input_CP\" placeholder=\"New Playlist\" onChange={this.handleChange}></input> \n </div>\n </Col>\n </Row>\n </div>\n </Col>\n </Row>\n <Row>\n <Col md={{size:7,offset:5}} xs={12} sm={12} className=\"create_Cancel_CP\">\n <button class=\"CancelButton_CP\" type=\"button\" onClick={()=>this.toggleModalNew()}>CANCEL</button>\n <button class=\"CreateButton_CP\" type=\"button\" onClick={()=>this.handleSubmit()}>CREATE</button>\n </Col>\n </Row>\n \n </Col>\n </Row>\n </ModalBody> \n </Modal>\n <Modal\n isOpen={this.state.isModalOpenSong}\n toggle={this.toggleModalSong}\n className=\"row\"\n size=\"lg\"\n >\n <ModalBody>\n <div className=\"row HomeNotSignedInModal\">\n \n <div className=\"col-sm-12 col-md-12 col-lg-12\">\n <div className=\"row HomeNotSignedInModalTextAndLinks\">\n <div className=\"col-sm-12 col-md-12 col-lg-12 \">\n <h2 className=\"HomeNotSignedInModalHeader2\">\n Your Favorite Songs Are All In One Place\n </h2>\n </div>\n </div>\n <div className=\"row HomeNotSignedInModalTextAndLinks\">\n <div className=\"col-sm-12 col-md-12 col-lg-12\">\n <Button\n className=\"HomeNotSignedInModalButton\"\n color=\"success\"\n >\n <Link\n className=\"HomeNotSignedInModalLinkInsideButton\"\n to=\"/signup\"\n >\n SIGN UP FREE\n </Link>\n </Button>\n </div>\n </div>\n <div className=\"row HomeNotSignedInModalTextAndLinks\">\n <div className=\"col-sm-12 col-md-12 col-lg-12\">\n <p className=\"HomeNotSignedInModalParagraph\">\n Already have an account?\n <Button\n className=\"HomeNotSignedInModalButtonInsideParagraph\"\n color=\"success\"\n >\n <Link\n className=\"HomeNotSignedInModalLinkInsideButtonInsideParagraph\"\n to=\"/signup\"\n >\n LOG IN\n </Link>\n </Button>\n </p>\n </div>\n </div>\n </div>\n </div>\n <div className=\"row HomeNotSignedInClose\">\n <Button\n className=\"HomeNotSignedInModalClosedButton\"\n color=\"success\"\n onClick={()=>this.toggleModalSong()}\n >\n Close\n </Button>\n </div>\n </ModalBody>\n </Modal>\n </div>\n );\n }", "renderTabs() {\n const { tags } = this.state\n return (\n tags.map((tag, index) => {\n return (\n <Tab \n key={index} \n className={this.activeTabStyle(this.state.value === index)} \n label={tag}\n />\n )\n })\n )\n }", "onTabClick(index) {\n if (this.props.onSwitch) this.props.onSwitch(index);\n }", "function Tabs() {\n const [toggleState, setToggleState] = useState(1);\n\n const toggleTab = (index) => {\n setToggleState(index);\n };\n\n return (\n <div className=\"container\">\n <div className=\"bloc-tabs\">\n <button className={toggleState === 1 ? \"tabs active-tabs\" : \"tabs\"} onClick={() => toggleTab(1)}>Upload Design</button>\n <button className={toggleState === 2 ? \"tabs active-tabs\" : \"tabs\"} onClick={() => toggleTab(2)}>Manage Design</button>\n <button className={toggleState === 3 ? \"tabs active-tabs\" : \"tabs\"} onClick={() => toggleTab(3)}>Find New Gig</button>\n </div>\n\n <div className=\"content-tabs\">\n <div className={toggleState === 1 ? \"content active-content\" : \"content\"}>\n <UploadDesign />\n </div>\n\n <div className={toggleState === 2 ? \"content active-content\" : \"content\"}>\n <img src=\"../../comingSoon.png\" alt=\"logo\"/>\n </div>\n\n <div className={toggleState === 3 ? \"content active-content\" : \"content\"}>\n <img src=\"../../comingSoon.png\" alt=\"logo\"/>\n </div>\n </div>\n </div>\n );\n}", "function navAllStories(evt) {\n console.debug(\"navAllStories\", evt);\n hidePageComponents();\n putStoriesOnPage();\n}", "function navAllStories(evt) {\n console.debug(\"navAllStories\", evt);\n hidePageComponents();\n putStoriesOnPage();\n}", "render(){\n return (\n\n <div>\n\n {/*Page header used by bootstrap to name the app */}\n <img className=\"floatLeft\" width=\"10%\" height=\"10%\" src={require('../images/starsdatabase5.png')} alt=\"Image of STARS Emblem\"/>\n <img className=\"floatRight\" width=\"15%\" height=\"15%\" src={require('../images/starsdatabase3.png')} alt=\"Image of STARS Emblem 2\"/>\n <img className=\"floatRight\" width=\"15%\" height=\"15%\" src={require('../images/starsdatabase.jpg')} alt=\"Image of STARS Emblem 2\"/>\n \n <div ><PageHeader >SSU STARS <small>Sustainability Tracking, Assessment, & Rating System</small></PageHeader> </div>\n\n {/*\n Nav/NavItem used by bootstrap to create links to different routes.\n React-router v4 uses \"Link\" imported from 'react-router-dom' rather\n than simple hrefs. Since bootstrap NavItems use hrefs, we need to\n use LinkContainer to make them play nice.\n */}\n <Nav bsStyle=\"tabs\">\n <LinkContainer exact={true} to =\"/\">\n <NavItem eventKey={1}>\n Home\n </NavItem>\n </LinkContainer>\n \n\n <LinkContainer to =\"/filter\">\n <NavItem eventKey={2}>\n Queries\n </NavItem>\n </LinkContainer>\n\n <LinkContainer to =\"/reportingFieldsRoute\">\n <NavItem eventKey={3}>\n Credits\n </NavItem>\n </LinkContainer>\n\n \n\n\n\n </Nav>\n \n\n </div>\n )\n }", "function NavTabs(props) {\n return /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_2__[\"jsxDEV\"])(\"div\", {\n children: /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_2__[\"jsxDEV\"])(\"nav\", {\n className: \"navbar pt-3 pb-3 navbar-expand-lg nav-jgMain fixed-top bg-dark\",\n children: /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_2__[\"jsxDEV\"])(\"div\", {\n className: \"container\",\n children: [/*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_2__[\"jsxDEV\"])(\"a\", {\n className: \"navbar-brand navbar-brand-jg\",\n href: \"index.html\",\n children: \"JENNERATION\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 8,\n columnNumber: 11\n }, this), /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_2__[\"jsxDEV\"])(\"button\", {\n className: \"navbar-toggler navbar-dark bg-dark\",\n type: \"button\",\n \"data-toggle\": \"collapse\",\n \"data-target\": \"#navbarNavAltMarkup\",\n \"aria-controls\": \"navbarNavAltMarkup\",\n \"aria-expanded\": \"false\",\n \"aria-label\": \"Toggle navigation\",\n children: /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_2__[\"jsxDEV\"])(\"span\", {\n className: \"navbar-toggler-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 16,\n columnNumber: 13\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 9,\n columnNumber: 11\n }, this), /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_2__[\"jsxDEV\"])(\"div\", {\n className: \"collapse navbar-collapse justify-content-end\",\n id: \"navbarNavAltMarkup\",\n children: /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_2__[\"jsxDEV\"])(\"div\", {\n className: \"navbar-nav\",\n children: [/*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_2__[\"jsxDEV\"])(\"a\", {\n className: \"nav-item nav-link active\",\n href: \"#home\",\n onClick: () => props.handlePageChange(\"Home\"),\n className: props.currentPage === \"Home\" ? \"nav-link active\" : \"nav-link\",\n children: [\"Home\", /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_2__[\"jsxDEV\"])(\"span\", {\n className: \"sr-only\",\n children: \"(current)\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 26,\n columnNumber: 21\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 23,\n columnNumber: 15\n }, this), /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_2__[\"jsxDEV\"])(\"a\", {\n className: \"nav-item nav-link active\",\n href: \"#about\",\n onClick: () => props.handlePageChange(\"About\"),\n className: props.currentPage === \"About\" ? \"nav-link active\" : \"nav-link\",\n children: \"About\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 29,\n columnNumber: 15\n }, this), /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_2__[\"jsxDEV\"])(\"a\", {\n className: \"nav-item nav-link active\",\n href: \"#projects\",\n onClick: () => props.handlePageChange(\"Projects\"),\n className: props.currentPage === \"Projects\" ? \"nav-link active\" : \"nav-link\",\n children: \"Projects\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 35,\n columnNumber: 15\n }, this), /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_2__[\"jsxDEV\"])(\"a\", {\n className: \"nav-item nav-link active\",\n href: \"#contact\",\n onClick: () => props.handlePageChange(\"Contact\"),\n className: props.currentPage === \"Contact\" ? \"nav-link active\" : \"nav-link\",\n children: \"Contact\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 41,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 22,\n columnNumber: 13\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 18,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 7,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 6,\n columnNumber: 7\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 5,\n columnNumber: 5\n }, this);\n}", "function HomeTabs() {\n return (\n // The route to \"Home\" is rendered on first load of the navigator\n // The screenOptions options in the Navigator sets the default options for\n // each of the child Screens\n // This function is passed down to each individual Screen, which then passes\n // its route prop to this function\n <Tab.Navigator\n initialRouteName=\"Home\"\n screenOptions={({ route }) => ({\n tabBarIcon: ({ color, size }) => {\n // Switch statements that assigns icon based on TabScreen name\n switch (route.name) {\n case 'Diagnostics':\n return <MaterialCommunityIcons name=\"hospital\" size={size} color={color} />;\n case 'Data':\n return <MaterialCommunityIcons name=\"waveform\" size={size} color={color} />;\n case 'Home':\n return <Ionicons name=\"ios-globe-outline\" size={size} color={color} />;\n case 'Ambiance':\n return <FontAwesome5 name=\"lightbulb\" size={size} color={color} />;\n case 'Settings':\n return <Ionicons name=\"settings-outline\" size={size} color={color} />;\n default:\n return <Text>error</Text>;\n }\n },\n })}\n tabBarOptions={{\n activeTintColor: 'black',\n inactiveTintColor: 'gray',\n }}\n >\n {/* The different tabs routes are declared here as Screens */}\n <Tab.Screen name=\"Diagnostics\" component={DiagnosticsTab} />\n <Tab.Screen name=\"Data\" component={DataTab} />\n <Tab.Screen name=\"Home\" component={HomeTab} />\n <Tab.Screen name=\"Ambiance\" component={AmbianceTab} />\n <Tab.Screen name=\"Settings\" component={SettingsTab} />\n </Tab.Navigator>\n );\n}", "renderContainer() {\n if (this.state.activeTab === \"Backlog\") {\n return (\n <BacklogContainer\n removeStoryFromSprint={this.removeStoryFromState}\n addStoryToSprint={this.addStoryToState}\n selectedStories={this.state.selectedStories}\n currentUser={this.props.currentUser}\n />\n );\n } else {\n return (\n <SprintContainer\n team={this.props.currentUser.team}\n removeStoryFromSprint={this.removeStoryFromState}\n addStoryToSprint={this.addStoryToState}\n selectedStories={this.state.selectedStories}\n currentUser={this.props.currentUser}\n />\n );\n }\n }", "render() {\n const { bookings, future, onFindWorkshopClick, past } = this.props\n const tabStyle = {\n backgroundColor: this.context.muiTheme.palette.accent2Color,\n color: this.context.muiTheme.palette.primary1Color\n }\n\n return (\n <div className={classes.container}>\n <Tabs\n inkBarStyle={{backgroundColor: this.context.muiTheme.palette.primary1Color}}\n onChange={this._handleChange}\n value={this.state.slideIndex}\n >\n <Tab\n label={strings.label_future}\n style={tabStyle}\n value={0}\n />\n <Tab\n label={strings.label_past}\n style={tabStyle}\n value={1}\n />\n </Tabs>\n <SwipeableViews\n containerStyle={{height: '100%'}}\n slideStyle={{height: '100%'}}\n style={{height: 'calc(100% - 48px)'}}\n index={this.state.slideIndex}\n onChangeIndex={this._handleChange}\n >\n <BookingsTab\n bookings={future}\n messageNoBookings={strings.message_no_future_bookings}\n onFindWorkshopClick={onFindWorkshopClick}\n />\n <BookingsTab\n bookings={past}\n messageNoBookings={strings.message_no_past_bookings}\n onFindWorkshopClick={onFindWorkshopClick}\n />\n </SwipeableViews>\n {this.props.showHelp &&\n <HelpOverlay\n hasBookings={bookings.length > 0}\n onClose={this.props.onHelpClose}\n />\n }\n </div>\n )\n }", "render() {\n return (\n <Navbar className = \"bp3-dark top-tabbar\">\n <NavbarGroup align = { Alignment.LEFT }>\n <Tabs\n animate = { true }\n large = { true }\n onChange = { this.change_tab }\n selectedTabId = { this.state.current_catagory }\n >\n <Tab id = \"General\" title = \"General\"/>\n <Tab id = \"Business\" title = \"Business\"/>\n <Tab id = \"Technology\" title = \"Technology\"/>\n <Tab id = \"Science\" title = \"Science\"/>\n <Tab id = \"Sports\" title = \"Sports\"/>\n <Tab id = \"Health\" title = \"Health\"/>\n <Tab id = \"Entertainment\" title = \"Entertainment\" />\n </Tabs>\n </NavbarGroup>\n </Navbar>\n );\n }", "render() {\n if (this.state.error) {\n return <Redirect to=\"/\" />;\n }\n\n return (\n <div>\n <Tabs\n defaultActiveKey=\"0\"\n renderTabBar={() => <ScrollableInkTabBar />}\n renderTabContent={() => <TabContent />}\n >\n { this.getTabPanes() }\n </Tabs>\n </div>\n );\n }", "function navAllStories (evt) {\n\tconsole.debug('navAllStories', evt);\n\thidePageComponents(); // located in main.js\n\tputStoriesOnPage(); // located in stories.js\n\tupdateNavOnLogin();\n}", "function navAllStories(evt) {\n\tconsole.debug('navAllStories', evt);\n\thidePageComponents();\n\tputStoriesOnPage();\n}", "function MainStackNavigator() {\n return (\n \n\n // {/* <TabNavigator /> */}\n // <NavigationContainer>\n // <Tab.Navigator>\n // <Tab.Screen name='CommunitiesPublicGoals' component={CommunitiesPublicGoals} />\n // </Tab.Navigator>\n // </NavigationContainer>\n\n <NavigationContainer>\n <Stack.Navigator initialRouteName='Home'>\n <Stack.Screen name='Home' component={Home} />\n <Stack.Screen name='userHome' component={userHome} />\n <Stack.Screen name='UsersIndividualGoal' component={UsersIndividualGoal} />\n <Stack.Screen name='AddNewGoal' component={AddNewGoal} />\n <Stack.Screen name='CommunitiesPublicGoals' component={CommunitiesPublicGoals} />\n\n \n </Stack.Navigator>\n </NavigationContainer>\n )\n}", "function setupTabs() {\n\tdocument.querySelectorAll('.tabs__button').forEach((button) => {\n\t\tbutton.addEventListener('click', () => {\n\t\t\tconst sideBar = button.parentElement;\n\t\t\tconst tabsContainer = sideBar.parentElement;\n\t\t\tconst tabNumber = button.dataset.forTab;\n\t\t\tconst tabToActivate = tabsContainer.querySelector(`.tabs__content[data-tab=\"${tabNumber}\"]`);\n\n\t\t\tsideBar.querySelectorAll('.tabs__button').forEach((button) => {\n\t\t\t\tbutton.classList.remove('tabs__button--active');\n\t\t\t});\n\n\t\t\ttabsContainer.querySelectorAll('.tabs__content').forEach((tab) => {\n\t\t\t\ttab.classList.remove('tabs__content--active');\n\t\t\t});\n\n\t\t\tbutton.classList.add('tabs__button--active');\n\t\t\ttabToActivate.classList.add('tabs__content--active');\n\t\t});\n\t});\n}", "renderTabs() {\n return React.Children.map(this.props.children, (child, index) => {\n if (!child) return null;\n\n return React.cloneElement(child, {\n index,\n onClick: this.onTabClick,\n isActive: index === this.state.activeTab\n });\n });\n }", "renderTabs() {\n const { active } = this.state;\n return (\n <View style={stylesLocation.tabs}>\n <View\n style={[\n stylesLocation.tab,\n active === \"all\" ? stylesLocation.activeTab : null\n ]}\n >\n <Text\n style={[\n stylesLocation.tabTitle,\n active === \"all\" ? stylesLocation.activeTabTitle : null\n ]}\n onPress={() => this.handleTab(\"all\")}\n >\n All\n </Text>\n </View>\n <View\n style={[\n stylesLocation.tab,\n active === \"hospital\" ? stylesLocation.activeTab : null\n ]}\n >\n <Text\n style={[\n stylesLocation.tabTitle,\n active === \"hospital\" ? stylesLocation.activeTabTitle : null\n ]}\n onPress={() => this.handleTab(\"hospital\")}\n >\n Hospital\n </Text>\n </View>\n <View\n style={[\n stylesLocation.tab,\n active === \"clinic\" ? stylesLocation.activeTab : null\n ]}\n >\n <Text\n style={[\n stylesLocation.tabTitle,\n active === \"clinic\" ? stylesLocation.activeTabTitle : null\n ]}\n onPress={() => this.handleTab(\"clinic\")}\n >\n Clinic\n </Text>\n </View>\n </View>\n );\n }", "render() {\n return (\n <div id=\"preview-cont\" className=\"nav-prev\">\n <div id=\"sectionDesc\"><p>{this.state.description}</p></div>\n <div id=\"previewButtons\">\n <button id=\"-1\" type=\"button\" onClick={this.props.navBack}>Back</button>\n <Link role=\"button\" to={this.state.toLink}>Proceed</Link>\n </div>\n </div>\n );\n }", "function initTabNav() {\n const tabMenu = document.querySelectorAll('[data-tab=\"menu\"] li')\n const tabContent = document.querySelectorAll('[data-tab=\"content\"] section')\n\n if (tabMenu.length && tabContent.length) {\n function activeTab(index) {\n tabContent.forEach(section => {\n section.classList.remove('active')\n })\n const direction = tabContent[index].dataset.anime\n tabContent[index].classList.add('active', direction)\n }\n \n tabMenu.forEach((li, index) => {\n li.addEventListener('click', () => activeTab(index))\n })\n }\n}", "function TabThreeNavigator() {\n return (\n <TabThreeStack.Navigator>\n <TabThreeStack.Screen\n name=\"AboutHome\"\n component={About}\n options={{ headerTitle: 'About' }}\n />\n </TabThreeStack.Navigator>\n );\n}", "onTabChange(e, { activeIndex }) {\n this.setState({ activeIndex });\n }", "function ResultsNavBar() {\n return (\n <div className=\"subNavContainer\">\n <NavLink\n testid=\"navigateViewResults\"\n destination=\"/ViewResults\"\n linkName=\"Data log\"\n />\n </div>\n );\n}", "function setupTabs(){\n const content = document.getElementById('content');\n buttons = Array.from(content.getElementsByTagName('button'));\n\n buttons.forEach(button => {\n button.addEventListener(\"click\", changeTab);\n });\n\n loadHome();\n buttons[0].classList.add('button-active');\n}", "getPage(index){\n switch (index) {\n case 0:\n return (<div className=\"play-list-content\">\n <PlayListContent\n loadTrack={this.loadTrack}\n tracks = {this.state.tracks}>\n </PlayListContent>\n </div>)\n case 1:\n return (<div className=\"play-list-content\">\n <MyFavorite\n loadTrack={this.loadTrack}\n tracks = {this.state.tracks}>\n </MyFavorite>\n </div>)\n case 2:\n // 时下流行 case: This may need to be changed, change to taking specific youtube url\n return (<div className=\"search_result\"><Search> </Search> </div>)\n\n default:\n return (<div className=\"play-list-content\">\n <PlayListContent\n loadTrack={this.loadTrack}\n tracks = {this.state.tracks}>\n </PlayListContent>\n </div>)\n }\n }", "handleLinks(viewName) {\n this.setState({\n currentView: viewName\n })\n }", "constructor(props) {\n super(props);\n this.state = {\n currentTab: this.props.children[0].props.label,\n };\n }", "handleTabClick(index) {\n this.setState(({\n activeTab: index\n }))\n }", "static async onEnter({ state, store }, params) {\n state.common.title = 'Songs'\n await store.setLists.browse()\n await store.sets.browse()\n await store.songs.browse();\n }", "buildTabView()\n {\n switch(this.state.selectedTab) {\n case \"main\" : return(<MainTab {...this.props} onUpdate={this.updateIndicator.bind(this)}\n onPrintDetails={this.onPrintDetails.bind(this)}/>)\n case \"expenses\" : return(<ExpensesTab {...this.props} \n onGoBack={this.goBack.bind(this)}/>)\n case \"depreciations\" : return(<DepreciationsTab {...this.props} \n onGoBack={this.goBack.bind(this)}/>)\n }\n }", "filterTabs() {\n const { tags } = this.state\n\n const allProjects = (\n myProjects.map((project, index) => {\n return <Project key={index} siteImage={project.siteImage} name={project.name} clicked={this.openModalHandler} />\n })\n )\n\n const filteredProjects = (tag) => (\n myProjects.filter(project => {\n return project.tag === tag\n }).map((foundProject, index) => {\n return <Project key={index} siteImage={foundProject.siteImage} name={foundProject.name} clicked={this.openModalHandler} />\n })\n )\n \n return (\n tags.map((tag, index) => {\n if (tag === \"ALL\") {\n return (\n <TabContainer key={index} label={tag}>\n {this.renderStack(allProjects)}\n </TabContainer>\n ) \n } \n else {\n return (\n <TabContainer key={index} label={tag}>\n {this.renderStack(filteredProjects(tag))}\n </TabContainer>\n )\n }\n })\n )\n }", "allTabs() {\n return [\n [\"Intro\", this.renderIntroTab()],\n [\"Globals\", this.renderGlobalsTab()],\n [\"Basic Interventions\", this.renderBasicsTab()],\n [\"Far Future\", this.renderFarFutureTab()],\n [\"Veg Advocacy\", this.renderVegTab()],\n [\"Cage Free\", this.renderCageFreeTab()],\n [\"AI Safety\", this.renderAISafetyTab()],\n [\"Targeted Values Spreading\", this.renderTargetedValuesSpreadingTab()],\n ]\n }", "function displayTabOnClick() {\n const tabs = document.querySelectorAll(\"#resources-nav .nav-item\");\n tabs.forEach(function (tabButton) {\n tabButton.addEventListener(\"click\", function (e) {\n e.preventDefault();\n let tabContentId = tabButton.id.split(/tab\\-(.+)/)[1];\n openCategory(e, tabContentId);\n });\n });\n}", "function TabsComponent() {\r\n return <Tabs data={tabItems} />;\r\n}", "setTabData() {\n const { activeTab, defaultActiveTab, tabs } = this.props;\n let updatedActiveTab = defaultActiveTab;\n\n const updatedTabs = tabs.map(({ active, content, title }, index) => {\n updatedActiveTab = active ? index : updatedActiveTab;\n\n return (\n <Tab key={title} eventKey={index} title={<TabTitleText>{title}</TabTitleText>}>\n {content}\n </Tab>\n );\n });\n\n if (typeof activeTab === 'number') {\n updatedActiveTab = activeTab;\n }\n\n this.setState({\n updatedActiveTab,\n updatedTabs\n });\n }", "function App() {\n return (\n <div className=\"App\">\n <Tabs></Tabs>\n </div>\n );\n}", "function renderOptions(tag = \"\" , history){\n\n let tag_arrays = [\"Updates\", \"Blog\", \"Demos\" ] //Initialize global options\n \n if(tag !== \"\"){ //If the tag is not empty\n let rest_array = []\n\n while(tag_arrays[0] !== tag && tag_arrays.length > 1 ){\n rest_array.push(tag_arrays[0])\n tag_arrays.shift()\n }\n\n tag_arrays.shift()\n\n for(let i = rest_array.length-1; i >= 0; i--){\n tag_arrays.unshift(rest_array[i])\n }\n\n tag_arrays.unshift(\"Home\")\n\n }\n\n\n //Finalized array\n const final_array = tag_arrays.map((optionTag) => \n <div className = \"nav-item\" onClick = {() => history.push('/Home/' + optionTag )} >\n {optionTag}\n </div>\n );\n\n\n \n return(\n\n <div className = \"nav-container\">\n {final_array}\n </div>\n )\n}", "function onTabPaneClick(e) {\n e.preventDefault();\n var $target = $(this);\n var idx = $target.index();\n var $parent = $target.parent();\n var $tabs = $parent.find('.js-tab-pane');\n var $slider = $( $parent.data('slider') );\n $tabs.removeClass('js-active');\n $target.addClass('js-active');\n $slider.slick('slickGoTo', idx);\n }", "function NavBar(props) {\n\tconst {classes, isMobile, pollingFailed} = props;\n\tconst homeLabel = pollingFailed ? (\n\t\t<span className={classes.errorLabel}>\n\t\t\tHome <Error />\n\t\t</span>\n\t) : (\n\t\t'Home'\n\t);\n\tlet [selectedIndex, setSelectedIndex] = useState(0);\n\n\treturn (\n\t\t<div className={classes.navBarContainer}>\n\t\t\t<Tabs\n\t\t\t\tclassName={classes.tabBar}\n\t\t\t\tindicatorColor=\"secondary\"\n\t\t\t\tvariant=\"fullWidth\"\n\t\t\t\tvalue={selectedIndex}\n\t\t\t>\n\t\t\t\t{isMobile\n\t\t\t\t\t? [\n\t\t\t\t\t\t\t<Tab\n\t\t\t\t\t\t\t\tkey=\"mobile-tab-dashboard\"\n\t\t\t\t\t\t\t\ticon={<Home />}\n\t\t\t\t\t\t\t\tcomponent={Link}\n\t\t\t\t\t\t\t\tto=\"/\"\n\t\t\t\t\t\t\t\tonClick={() => setSelectedIndex(0)}\n\t\t\t\t\t\t\t/>,\n\t\t\t\t\t\t\t<Tab\n\t\t\t\t\t\t\t\tkey=\"mobile-tab-admin\"\n\t\t\t\t\t\t\t\ticon={<Person />}\n\t\t\t\t\t\t\t\tcomponent={Link}\n\t\t\t\t\t\t\t\tto=\"/admin\"\n\t\t\t\t\t\t\t\tonClick={() => setSelectedIndex(1)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t ]\n\t\t\t\t\t: [\n\t\t\t\t\t\t\t<Tab\n\t\t\t\t\t\t\t\tkey=\"desktop-tab-dashboard\"\n\t\t\t\t\t\t\t\taria-label=\"Dashboard\"\n\t\t\t\t\t\t\t\tclassName={classes.tab}\n\t\t\t\t\t\t\t\tcolor=\"inherit\"\n\t\t\t\t\t\t\t\tlabel={homeLabel}\n\t\t\t\t\t\t\t\tcomponent={Link}\n\t\t\t\t\t\t\t\tto=\"/\"\n\t\t\t\t\t\t\t\tonClick={() => setSelectedIndex(0)}\n\t\t\t\t\t\t\t/>,\n\t\t\t\t\t\t\t<Tab\n\t\t\t\t\t\t\t\tkey=\"desktop-tab-admin\"\n\t\t\t\t\t\t\t\taria-label=\"Admin\"\n\t\t\t\t\t\t\t\tclassName={classes.tab}\n\t\t\t\t\t\t\t\tcolor=\"inherit\"\n\t\t\t\t\t\t\t\tlabel=\"Admin\"\n\t\t\t\t\t\t\t\tcomponent={Link}\n\t\t\t\t\t\t\t\tto=\"/admin\"\n\t\t\t\t\t\t\t\tonClick={() => setSelectedIndex(1)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t ]}\n\t\t\t</Tabs>\n\t\t</div>\n\t);\n}", "function App() {\n return (\n <>\n<LandingPage/>\n<LandingpageTab/>\n </>\n );\n}", "render(){ // see it says raindeer right here\n\t\treturn (\n\t\t<div> {/*^ this says that i will let u return the raindeers to the pole */}\n\t\t\t<h1>Ja<span className=\"highlight\">mmm</span>ing</h1>\n\t\t\t<h1 className=\"Description\">Make Your Spotify Playlist</h1>\n\t\t\t<div className=\"App\">\n\t\t\t<SearchBar onSearch={this.search}/>\n\t\t\t<div className=\"App-playlist\">\n\t\t\t<SearchResults searchResults={this.state.searchResults} \n\t\t\t\t\t\t\tonAdd={this.addTrack}\n\t\t\t\t\t\t\tonRemove={this.removeTrack} />\n\t\t\t<Playlist playlistTracks={this.state.playlistTracks}\n\t\t\t\t\t\t\tonRemove={this.removeTrack}\n\t\t\t\t\t\t\tonNameChange={this.updatePlaylistName}\n\t\t\t\t\t\t\tonSave={this.savePlaylist}/> \n\t\t\t</div> \n\t\t\t</div>\n\t\t</div>\n\t\t);\n\t}", "function App() {\n const songs = music\n const sounds = background\n\n\n\n const [currentSongIndex, setCurrentSongIndex] = useState(0);\n const [nextSongIndex, setNextSongIndex] = useState(0);\n\n useEffect(() => {\n setNextSongIndex(() => {\n if (currentSongIndex + 1 > songs.length - 1) {\n return 0;\n } else {\n return currentSongIndex + 1;\n }\n });\n }, [currentSongIndex, songs.length]);\n\n return (\n <div className=\"App center\">\n <Player \n currentSongIndex={currentSongIndex} \n setCurrentSongIndex={setCurrentSongIndex} \n nextSongIndex={nextSongIndex} \n songs={songs}\n sounds={sounds}\n />\n\n </div>\n );\n}", "render() {\n const {\n location,\n children,\n loggedUser,\n isAuthenticated\n } = this.props;\n\n const timeRangeTabHeadline = {\n textTransform: 'none',\n minWidth: 33,\n }\n const tabs = [\n { label: \"5m\", value: 5, style: timeRangeTabHeadline },\n { label: \"30m\", value: 30, style: timeRangeTabHeadline },\n { label: \"1h\", value: 60, style: timeRangeTabHeadline },\n { label: \"3h\", value: 180, style: timeRangeTabHeadline },\n { label: \"6h\", value: 360, style: timeRangeTabHeadline },\n { label: \"12h\", value: 720, style: timeRangeTabHeadline },\n { label: \"1d\", value: 1440, style: timeRangeTabHeadline },\n { label: \"2d\", value: 2880, style: timeRangeTabHeadline },\n { label: \"4d\", value: 5760, style: timeRangeTabHeadline },\n { label: \"7d\", value: 10080, style: timeRangeTabHeadline },\n { label: \"1M\", value: 43800, style: timeRangeTabHeadline },\n { label: \"2M\", value: 87600, style: timeRangeTabHeadline },\n { label: \"6M\", value: 262800, style: timeRangeTabHeadline },\n { label: \"1Y\", value: 525600, style: timeRangeTabHeadline },\n ]\n\n return (\n <div>\n <EventListener target=\"window\" onKeyUp={this.handleKeyUp} />\n <div className=\"appBar\">\n <div className=\"newAppToolbar\">\n <IconButton style={{ height: '48px', padding:0 }}\n onTouchTap={this.onMenuButtonClick} >\n <img draggable=\"false\" onmousedown=\"return false\" style=\"user-drag: none\" src=\"/static/digitalis_icon_white_s.png\" />\n </IconButton>\n \n <h1 className=\"appToolbarTitle\">{this.props.UiState.currentPage}</h1>\n <div className=\"appToolbarRightContainer\">\n <div className=\"appToolbarRight\">\n <div>\n <span onClick={this.openTimeSelection} style={this.timeRangeSelectionTextStyle}>{this.customTimeText}</span>\n <IconButton style={this.timeRangeSelectionIconStyle} onTouchTap={this.openTimeSelection}>\n <FontIcon className=\"material-icons\" color=\"white\">access_time</FontIcon>\n </IconButton>\n\n </div>\n <Tabs style={{ marginRight: 20 }}\n value={this.props.ChartStore.predefinedTime}\n tabItemContainerStyle={{ background: 'transparent' }}\n inkBarStyle={{ backgroundColor: '#b9eaff' }}>\n {tabs.map(t => <Tab disableFocusRipple disableTouchRipple key={t.value} value={t.value} label={t.label} style={t.style} onActive={this.handleTimeRange} />)}\n </Tabs>\n {isAuthenticated ? <Logged {...this.props} /> : <FlatButton {...this.props} label=\"Login\" labelStyle={{ color: 'white' }} onTouchTap={this.handleOpen} />}\n </div>\n </div>\n </div>\n <div className=\"subToolbarContainer\">\n <div style={this.subToolbarStyle}>\n <div className=\"timeSelectionMenu\">\n <TimeSelector {...this.props}></TimeSelector>\n </div>\n </div> </div>\n </div>\n <div onClick={this.openTimeSelection} style={this.applicationBarMaskStyle} />\n <style jsx>{`\n\n\n \n .subToolbarContainer{\n display:flex;\n flex-direction: row;\n justify-content: flex-end;\n width:100%\n }\n .timeSelectionMenu{\n margin-bottom: 15px;\n }\n \n .appBar{\n position:fixed;\n \n z-index: 1300;\n width:100%;\n background-color: #5899fb;\n box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.12);\n transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms;\n }\n .newAppToolbar{\n display: flex;\n align-items: center;\n justify-content: center;\n padding-left:8px;\n }\n .appToolbarRightContainer{\n margin-left:auto;\n }\n\n .appToolbarRight{\n display: inline-flex;\n margin-left:auto;\n }\n .appToolbarTitle{\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n margin: 0;\n padding-left:5px;\n letter-spacing: 0;\n font-size: 24px;\n font-weight: 400;\n color: #ffffff;\n height: auto;\n line-height: initial;\n user-select: none;\n }\n \n `}</style>\n\n </div>);\n }", "function showPrev() {\r\n if (index <= 0) index = songs.length;\r\n index--;\r\n index %= songs.length;\r\n localStorage.setItem(\"song\", JSON.stringify(songs[index]));\r\n slide(index);\r\n document.querySelector('meta[name=\"theme-color\"]').setAttribute('content', `${songs[index].bgColor}`);\r\n}", "getTabViewContents(){\n const { context, schemas, windowWidth, windowHeight, href, session } = this.props;\n const { mounted } = this.state;\n\n //context = SET; // Use for testing along with _testing_data\n\n const processedFiles = this.allProcessedFilesFromExperimentSet(context);\n const processedFilesUniqeLen = (processedFiles && processedFiles.length && ProcessedFilesStackedTableSection.allFilesUniqueCount(processedFiles)) || 0;\n const rawFiles = this.allFilesFromExperimentSet(context, false);\n const rawFilesUniqueLen = (rawFiles && rawFiles.length && RawFilesStackedTableSection.allFilesUniqueCount(rawFiles)) || 0;\n const width = this.getTabViewWidth();\n\n const commonProps = { width, context, schemas, windowWidth, href, session, mounted };\n const propsForTableSections = _.extend(SelectedFilesController.pick(this.props), commonProps);\n\n var tabs = [];\n\n // Processed Files Table Tab\n if (processedFilesUniqeLen > 0){\n tabs.push({\n tab : <span><i className=\"icon icon-microchip fas icon-fw\"/>{ ' ' + processedFilesUniqeLen + \" Processed File\" + (processedFilesUniqeLen > 1 ? 's' : '') }</span>,\n key : 'processed-files',\n content : (\n <SelectedFilesController resetSelectedFilesCheck={ExperimentSetView.resetSelectedFilesCheck} initiallySelectedFiles={processedFiles}>\n <ProcessedFilesStackedTableSection {...propsForTableSections} files={processedFiles} />\n </SelectedFilesController>\n )\n });\n }\n\n // Raw files tab, if have experiments with raw files\n if (rawFilesUniqueLen > 0){\n tabs.push({\n tab : <span><i className=\"icon icon-leaf fas icon-fw\"/>{ ' ' + rawFilesUniqueLen + \" Raw File\" + (rawFilesUniqueLen > 1 ? 's' : '') }</span>,\n key : 'raw-files',\n content : (\n <SelectedFilesController resetSelectedFilesCheck={ExperimentSetView.resetSelectedFilesCheck} initiallySelectedFiles={rawFiles}>\n <RawFilesStackedTableSection {...propsForTableSections} files={rawFiles} />\n </SelectedFilesController>\n )\n });\n }\n\n // Supplementary Files Tab\n if (ExperimentSetView.shouldShowSupplementaryFilesTabView(context)){\n //const referenceFiles = SupplementaryFilesTabView.allReferenceFiles(context) || [];\n //const opfCollections = SupplementaryFilesTabView.combinedOtherProcessedFiles(context) || [];\n //const allOpfFiles = _.reduce(opfCollections, function (memo, coll) { return memo.concat(coll.files || []); }, []);\n //const allFiles = referenceFiles.concat(allOpfFiles);\n tabs.push({\n tab : <span><i className=\"icon icon-copy far icon-fw\"/> Supplementary Files</span>,\n key : 'supplementary-files',\n content: (\n <SelectedFilesController resetSelectedFilesCheck={ExperimentSetView.resetSelectedFilesCheck} initiallySelectedFiles={[]/*allFiles*/}>\n <SupplementaryFilesTabView {...propsForTableSections} {...this.state} />\n </SelectedFilesController>\n )\n });\n }\n\n // Graph Section Tab\n if (this.shouldGraphExist()){\n tabs.push(FileViewGraphSection.getTabObject(\n _.extend({}, this.props, { 'isNodeCurrentContext' : this.isWorkflowNodeCurrentContext }),\n this.state,\n this.handleToggleAllRuns,\n width\n ));\n }\n\n return _.map(tabs.concat(this.getCommonTabs()), function(tabObj){\n return _.extend(tabObj, {\n 'style' : {\n 'minHeight' : Math.max(mounted && !isServerSide() && (windowHeight - 180), 100) || 800\n }\n });\n });\n }", "async function navAllStories(evt) {\n console.debug(\"navAllStories\", evt);\n storyList = await StoryList.getStories();\n hidePageComponents();\n putStoriesOnPage(storyList);\n \n\n}", "Navigate(_, src) {\n if (src.tab && src.tab.id) {\n onTabUpdate(src.tab.id, src.tab);\n }\n }", "showMainScreen(animated) {\n const createTabs = () => {\n let tabs = [\n {\n label: 'Charts',\n screen: 'app.ChartCatalogScreen',\n icon: require('../img/tabBarCharts.png'),\n selectedIcon: require('../img/tabBarCharts.png'),\n title: 'Charts',\n navigatorStyle: {\n navBarTranslucent: true,\n drawUnderTabBar: true,\n statusBarTextColorScheme: 'dark'\n }\n },\n {\n label: 'Profile',\n screen: 'app.ProfileScreen',\n icon: require('../img/tabBarProfile.png'),\n selectedIcon: require('../img/tabBarProfile.png'),\n title: 'Profile',\n navigatorStyle: {\n navBarHidden: true,\n statusBarTextColorScheme: 'dark'\n }\n }\n ];\n\n return tabs;\n };\n\n Navigation.startTabBasedApp({\n animationType: animated ? 'slide-down': 'none',\n tabs: createTabs(),\n tabsStyle: {\n tabBarTranslucent: true,\n tabBarButtonColor: colors.light,\n tabBarSelectedButtonColor: colors.primary,\n }\n });\n }", "render(){\r\n\r\n\r\n //Esto es un metodo, para cambiar el icono\r\n this.handleClick = (n) =>{\r\n if(n === 0){ this.setState({open0:!this.state.open0}); console.log(this.state.open0)}\r\n if(n === 1){ this.setState({open1:!this.state.open1}); console.log(this.state.open0)}\r\n if(n === 2){ this.setState({open2:!this.state.open2}); console.log(this.state.open0)}\r\n if(this.state.actPage !== this.state.pages[n]){\r\n this.setState({actPage: this.state.pages[n]})\r\n }else{\r\n this.setState({actPage: \"HomePage\"})\r\n }\r\n }\r\n\r\n\r\n //Enlazar un componente con una propiedad\r\n const BuildHomePage = () => {\r\n return(\r\n <HomePage \r\n preguntas = {this.preguntas}\r\n />\r\n );\r\n }\r\n\r\n return(\r\n <div className = \"contenedor\"> \r\n <Router>\r\n <header>\r\n <div><h1>PLATAFORMA PASKAY</h1></div>\r\n <NavLink activeClassName=\"selected-in\" exact= \"true\" to=\"/login\"> <FontAwesomeIcon icon={faUser} size = \"1x\"/>Iniciar Sesion</NavLink>\r\n </header>\r\n <div>\r\n <nav className = \"marco-izq\">\r\n <ul>\r\n <li>\r\n <NavLink activeClassName=\"selected\" exact= \"true\" onClick = {() => this.handleClick(1)} to=\"/\"> <FontAwesomeIcon icon={faHome} size = \"4x\"/><span>Inicio</span></NavLink>\r\n </li>\r\n <li>\r\n <NavLink activeClassName = \"selected\" exact= \"true\" onClick = {() => this.handleClick(1)} to=\"/upload\"><FontAwesomeIcon icon={faUpload} size = \"4x\"/><span>Subir preg.</span></NavLink>\r\n </li>\r\n <li>\r\n <NavLink activeClassName = \"selected\" exact= \"true\" onClick = {() => this.handleClick(2)} to=\"/generador\"><FontAwesomeIcon icon={faFileAlt} size = \"4x\"/><span>Generador</span></NavLink>\r\n </li>\r\n </ul>\r\n </nav>\r\n </div>\r\n <Switch>\r\n <Route path=\"/login\" component = {IniciarSesion}></Route>\r\n <Route path=\"/generador\" component = {GenPage}></Route>\r\n <Route path=\"/upload\" component = {UploadPage}></Route>\r\n <Route path=\"/\" component = {Buscador}></Route>\r\n </Switch>\r\n </Router>\r\n </div>\r\n )\r\n }", "navigateToTab(tabIndex) {\n this.props.navigator.handleDeepLink({\n link: 'tab/' + tabIndex\n });\n this.props.navigator.dismissModal({animationType: 'slide-down'});\n }", "function openGraph(evt, graphName) {\n var i, tabcontent, tablinks\n tabcontent = document.getElementsByClassName(\"tabcontent\")\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\"\n }\n tablinks = document.getElementsByClassName(\"tablinks\")\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\")\n }\n document.getElementById(graphName).style.display = \"block\"\n evt.currentTarget.className += \" active\"\n}", "_link() {\r\n if(this.store.activeTab === \"n0\") {\r\n this.push(\"/\")\r\n }\r\n else {\r\n this.push(`/console/${this.connections[this.store.activeTab]}`)\r\n }\r\n }", "function useTabs(props) {\n var defaultIndex = props.defaultIndex,\n onChange = props.onChange,\n index = props.index,\n isManual = props.isManual,\n isLazy = props.isLazy,\n _props$lazyBehavior = props.lazyBehavior,\n lazyBehavior = _props$lazyBehavior === void 0 ? \"unmount\" : _props$lazyBehavior,\n _props$orientation = props.orientation,\n orientation = _props$orientation === void 0 ? \"horizontal\" : _props$orientation,\n _props$direction = props.direction,\n direction = _props$direction === void 0 ? \"ltr\" : _props$direction,\n htmlProps = _objectWithoutPropertiesLoose(props, _excluded$1);\n /**\n * We use this to keep track of the index of the focused tab.\n *\n * Tabs can be automatically activated, this means selection follows focus.\n * When we navigate with the arrow keys, we move focus and selection to next/prev tab\n *\n * Tabs can also be manually activated, this means selection does not follow focus.\n * When we navigate with the arrow keys, we only move focus NOT selection. The user\n * will need not manually activate the tab using `Enter` or `Space`.\n *\n * This is why we need to keep track of the `focusedIndex` and `selectedIndex`\n */\n\n\n var _React$useState = React.useState(defaultIndex != null ? defaultIndex : 0),\n focusedIndex = _React$useState[0],\n setFocusedIndex = _React$useState[1];\n\n var _useControllableState = useControllableState({\n defaultValue: defaultIndex != null ? defaultIndex : 0,\n value: index,\n onChange: onChange\n }),\n selectedIndex = _useControllableState[0],\n setSelectedIndex = _useControllableState[1];\n /**\n * Sync focused `index` with controlled `selectedIndex` (which is the `props.index`)\n */\n\n\n React.useEffect(function () {\n if (index != null) {\n setFocusedIndex(index);\n }\n }, [index]);\n /**\n * Think of `useDescendants` as a register for the tab nodes.\n */\n\n var descendants = useTabsDescendants();\n /**\n * Generate a unique id or use user-provided id for the tabs widget\n */\n\n var id = useId(props.id, \"tabs\");\n return {\n id: id,\n selectedIndex: selectedIndex,\n focusedIndex: focusedIndex,\n setSelectedIndex: setSelectedIndex,\n setFocusedIndex: setFocusedIndex,\n isManual: isManual,\n isLazy: isLazy,\n lazyBehavior: lazyBehavior,\n orientation: orientation,\n descendants: descendants,\n direction: direction,\n htmlProps: htmlProps\n };\n}", "componentDidMount() {\n this.props.loadBg(\"mining\");\n this.getHistory();\n }", "render() {\n return <SettingsNavigator />\n }", "render() {\n return (\n <ul className=\"placeholder-container flex\">\n <li className=\"playlist\">\n <div className=\"pl-title-container\">\n <h2>SoundCloud Weekly</h2>\n <p>All of SoundCloud. Just for you.</p>\n </div>\n <div className=\"pl-content-container flex gradient\">\n <PlaylistImg albumart={this.state.albumart} />\n <PlaylistTracks playlist={this.state.playlist} />\n </div>\n <PlaylistActions />\n </li>\n </ul>\n );\n }", "function TabsPage() {\r\n this.tab1Root = __WEBPACK_IMPORTED_MODULE_1__home_home__[\"a\" /* HomePage */];\r\n }", "renderHistory(historyData, index) {\n const title = historyData.video.snippet.title.length > 50 ? \n historyData.video.snippet.title.substring(0, 50) + \"...\" : historyData.video.snippet.title;\n\n return (\n <QueueListItem \n onSelectVideo={this.props.onQueueVideo} \n deleteVideo={this.props.deleteArchive}\n videoData={historyData.video}\n key={index}\n id={index}\n title={title} />\n );\n }", "constructor(props) {\n super(props);\n this.contents = {};\n this.tabTexts = {};\n this.tabIcons = {};\n this.tabContainers = {};\n\n // Initialize State\n this.state = {\n // First tab is active by default\n activeTab: props.initialTab || 0\n }\n }", "render() {\n return (\n <div>\n <Card className='animated pulse onlinePlayers' bordered={false}>\n <Statistic title='Playing' value={this.state.playing} prefix={<GiSwordwoman />} />\n <Statistic title='Waiting' value={this.state.waiting} prefix={<GiSleepy />} />\n </Card>\n <Card className='leftPanel' bordered={false}>\n <Row style={{ paddingLeft: '24px', paddingRight: '24px' }}>\n <Col span={4} align='center'>\n <Tooltip title='Home'>\n <GiHouse\n className='zoom'\n size='40px'\n color={this.state.currentPage === 'home' ? '#375a7f' : 'white' }\n onClick={this.changePage.bind(this, 'home')}\n />\n </Tooltip>\n </Col>\n <Col span={4} align='center'>\n <Tooltip title='Discord'>\n <FaUserCog \n className='zoom'\n size='40px'\n color={this.state.currentPage === 'discord' ? '#375a7f' : 'white' }\n onClick={this.changePage.bind(this, 'discord')}\n />\n </Tooltip>\n </Col>\n <Col span={4} align='center'>\n <Tooltip title='Queue'>\n <GiGamepad\n className='zoom'\n size='40px'\n color={this.state.currentPage === 'queue' ? '#375a7f' : 'white' }\n onClick={this.changePage.bind(this, 'queue')}\n />\n </Tooltip>\n </Col>\n <Col span={4} align='center'>\n <Tooltip title='Character'>\n <GiPoloShirt\n className='zoom'\n size='40px'\n color={this.state.currentPage === 'character' ? '#375a7f' : 'white' }\n onClick={this.changePage.bind(this, 'character')}\n />\n </Tooltip>\n </Col>\n <Col span={4} align='center'>\n <Tooltip title='Settings'>\n <IoMdSettings\n className='zoom'\n size='40px'\n color={this.state.currentPage === 'settings' ? '#375a7f' : 'white' }\n onClick={this.changePage.bind(this, 'settings')}\n />\n </Tooltip>\n </Col>\n <Col span={4} align='center'>\n <Tooltip title='Exit'>\n <GiExitDoor\n className='zoom'\n size='40px'\n color='white'\n onClick={this.changePage.bind(this, 'exit')}\n />\n </Tooltip>\n </Col>\n </Row>\n <div className={this.state.animatedContent}>\n { this.components.find(value => {\n return this.state.currentPage === value.id;\n }).component }\n </div>\n </Card>\n </div>\n );\n }", "homeClicked() {\n this.props.navChanged(\"Home\");\n }" ]
[ "0.6475666", "0.6468039", "0.63124937", "0.60596925", "0.60255635", "0.5970851", "0.5945669", "0.59344715", "0.58610266", "0.5822944", "0.58227867", "0.5788462", "0.576454", "0.5754998", "0.57089555", "0.56597733", "0.56468105", "0.5641285", "0.56297016", "0.56173426", "0.5611835", "0.56107014", "0.55886793", "0.55815524", "0.5580788", "0.55792564", "0.5553785", "0.5549624", "0.55380106", "0.5529344", "0.55241305", "0.5517682", "0.5516787", "0.5509914", "0.5493055", "0.54849446", "0.5475467", "0.54693735", "0.54542893", "0.54520947", "0.54419947", "0.5438761", "0.5422136", "0.5422136", "0.5418032", "0.5417793", "0.5395198", "0.5376392", "0.53711885", "0.5360731", "0.534664", "0.53379345", "0.5336004", "0.5331717", "0.5309063", "0.5304306", "0.5301144", "0.529528", "0.5290942", "0.5287546", "0.5282756", "0.5280394", "0.52747875", "0.5245926", "0.52413416", "0.52360964", "0.5233664", "0.52277046", "0.5226397", "0.5221119", "0.52162564", "0.52146995", "0.52066684", "0.52048945", "0.5203982", "0.5201338", "0.51990885", "0.51960653", "0.51909417", "0.5188067", "0.51804733", "0.51702666", "0.51681143", "0.5161163", "0.51599526", "0.5155764", "0.51511073", "0.51441646", "0.51309496", "0.5130611", "0.51291656", "0.5127345", "0.512592", "0.5125533", "0.5118116", "0.5112083", "0.5106957", "0.5105524", "0.50944746", "0.5093664" ]
0.6485928
0
React navigation tab stack for About.
function TabThreeNavigator() { return ( <TabThreeStack.Navigator> <TabThreeStack.Screen name="AboutHome" component={About} options={{ headerTitle: 'About' }} /> </TabThreeStack.Navigator> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function AboutStackNavigator() {\n\treturn (\n\t\t<Stack.Navigator>\n\t\t\t<Stack.Screen name=\"About\" component={AboutScreen} />\n\t\t</Stack.Navigator>\n\t);\n}", "function TabStack(props) {\n const tabPress = (e) => {\n global.currenRouter = e.target.split(\"-\")[0];\n };\n return (\n <Tab.Navigator\n initialRouteName=\"Home\"\n activeColor=\"#e91e63\"\n shifting={true}\n barStyle={{\n backgroundColor: \"white\",\n }}\n >\n <Tab.Screen\n name=\"Home\"\n component={CategoriesScreen}\n listeners={{ tabPress }}\n options={{\n title: \"Trang chủ\",\n tabBarIcon: ({ color }) => (\n <Icon color={color} name=\"home\" size={26} />\n ),\n }}\n />\n\n {/* <Tab.Screen name=\"Template\" component={TemplateStackScreen} listeners={{ tabPress }} /> */}\n <Tab.Screen\n name=\"Message\"\n component={MessageScreen}\n listeners={{ tabPress }}\n options={{\n title: \"Tin Nhắn\",\n tabBarIcon: ({ color }) => (\n <Icon color={color} name=\"comment\" size={26} />\n ),\n }}\n />\n <Tab.Screen\n name=\"Account\"\n component={AccountScreen}\n listeners={{ tabPress }}\n options={{\n title: \"Tài Khoản\",\n tabBarIcon: ({ color }) => (\n <Icon color={color} name=\"account-circle\" size={26} />\n ),\n }}\n />\n </Tab.Navigator>\n );\n}", "render(){\n\n\n return (\n\n\n <Tab.Navigator\n \n >\n \n <Tab.Screen name=\"Profile\" component={ProfileStackScreen} />\n <Tab.Screen name=\"Post\" component={PostStackScreen} />\n <Tab.Screen name=\"Friends\" component={FriendsStackScreen} />\n <Tab.Screen name=\"Chitts\" component={ChittsStackScreen} />\n\n </Tab.Navigator>\n\n )\n }", "function NavTabs(props) {\n return (\n <div>\n <nav className='navbar pt-3 pb-3 navbar-expand-lg nav-jgMain fixed-top bg-dark'>\n <div className='container'>\n <a className='navbar-brand navbar-brand-jg' href='index.html'>\n JENNERATION\n </a>\n <button\n className='navbar-toggler navbar-dark bg-dark'\n type='button'\n data-toggle='collapse'\n data-target='#navbarNavAltMarkup'\n aria-controls='navbarNavAltMarkup'\n aria-expanded='false'\n aria-label='Toggle navigation'\n >\n <span className='navbar-toggler-icon'></span>\n </button>\n <div\n className='collapse navbar-collapse justify-content-end'\n id='navbarNavAltMarkup'\n >\n <div className='navbar-nav'>\n <a\n className='nav-item nav-link active'\n href='#home'\n onClick={() => props.handlePageChange(\"Home\")}\n className={\n props.currentPage === \"Home\" ? \"nav-link active\" : \"nav-link\"\n }\n >\n Home<span className='sr-only'>(current)</span>\n </a>\n\n <a\n className='nav-item nav-link active'\n href='#projects'\n onClick={() => props.handlePageChange(\"Projects\")}\n className={\n props.currentPage === \"Projects\"\n ? \"nav-link active\"\n : \"nav-link\"\n }\n >\n Works\n </a>\n\n <a\n className='nav-item nav-link active'\n href='#about'\n onClick={() => props.handlePageChange(\"About\")}\n className={\n props.currentPage === \"About\" ? \"nav-link active\" : \"nav-link\"\n }\n >\n About\n </a>\n\n <a\n className='nav-item nav-link active'\n href='#contact'\n onClick={() => props.handlePageChange(\"Contact\")}\n className={\n props.currentPage === \"Contact\"\n ? \"nav-link active\"\n : \"nav-link\"\n }\n >\n Contact\n </a>\n </div>\n </div>\n </div>\n </nav>\n </div>\n );\n}", "function Interview(props) {\n\n //Creating object of pages\n const navigation = {\n pages: [\n { path: '/', label: 'Welcome', },\n { path: '/about-me', label: 'About Me' },\n { path: '/about-website', label: 'Why this website?' }\n ],\n }\n\n //Handler for Navigation tab changed\n const selectionHandler = (event, value) => {\n props.history.push(value);\n }\n\n return (\n //Website Navigation Tabs \n <Grid className='Interview' style={{height: '100%'}}>\n <CustomTabs\n value={props.history.location.pathname || '/'}\n onChange={selectionHandler}\n centered\n >\n {navigation.pages.map((page) => {\n return (\n <CustomTab value={page.path} label={page.label} key={page.path} />\n )\n })}\n </CustomTabs>\n {/*Configuring Switch to rerender exact page requested*/}\n <Switch>\n <Route path='/about-website'>\n <AboutWebsite />\n </Route>\n <Route path='/about-me'>\n <AboutMe />\n </Route>\n <Route path='/'>\n <Welcome />\n </Route>\n </Switch>\n <Footer />\n </Grid>\n );\n}", "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 const { appNavigationState } = this.props;\n const { tabs } = appNavigationState;\n const tabKey = tabs.routes[tabs.index].key;\n const scenes = appNavigationState[tabKey];\n\n return (\n <View style={styles.navigator}>\n <NavigationCardStack\n key={`stack_${tabKey}`}\n onNavigateBack={this.back}\n navigationState={scenes}\n renderOverlay={this.renderHeader}\n renderScene={this.renderScene}\n style={styles.navigatorCardStack}\n />\n <YourTabs\n navigationState={tabs}\n />\n </View>\n );\n }", "function TabStackNavigator() {\n return (\n <Stack.Navigator screenOptions={{headerShown: false}}>\n <Stack.Screen name={ROUTES.Tab1} component={Home} />\n <Stack.Screen name={ROUTES.Search} component={Search} />\n <Stack.Screen name={ROUTES.Quotes} component={QuoteStackNavigator} />\n <Stack.Screen name={ROUTES.Clients} component={ClientStackNavigator} />\n <Stack.Screen name={ROUTES.Users} component={UsersStackNavigator} />\n <Stack.Screen name={ROUTES.Orders} component={OrdersStackNavigator} />\n <Stack.Screen name={ROUTES.Products} component={ProductStackNavigator} />\n <Stack.Screen\n name={ROUTES.UploadOrders}\n component={UploadOrdersStackNavigator}\n />\n <Stack.Screen\n name={ROUTES.SupportRequests}\n component={RequestsStackNavigator}\n />\n </Stack.Navigator>\n );\n}", "function NavTabs(props) {\n const {\n tabs = [],\n currentPage,\n handlePageChange,\n } = props;\n \n return (\n <ul className=\"nav nav-tabs ml-auto my-1 mr-2\">\n {tabs.map((tab) => (\n <li\n className=\"nav-item\"\n key={tab}\n style={{\n backgroundColor: \"#122240\",\n color: \"#be8180\",\n }}\n >\n <a\n style={{\n backgroundColor: \"#122240\",\n color: \"#be8180\",\n }}\n href={\"#\" + tab.toLowerCase()}\n // Whenever a tab is clicked on,\n // the current page is set through the handlePageChange props.\n onClick={() => handlePageChange(tab)}\n className={currentPage === tab ? \"nav-link active\" : \"nav-link\"}\n >\n {tab}\n </a>\n </li>\n ))}\n </ul>\n );\n}", "function HomeBottomTabs() {\n return (\n <Tab.Navigator\n //customize the bottom tabs using the customTabBarStyle\n tabBarOptions={customTabBarStyle}\n >\n <Tab.Screen\n name=\"Classes\"\n //make this tab go to the classes screen\n component={ClassesStackScreen}\n options={{\n //make the icon for this tab a scholar's cap\n tabBarIcon: ({ color, size }) => (\n <Ionicons name=\"school-outline\" size={size} color={color} />\n ),\n }}\n />\n <Tab.Screen\n name=\"Notes\"\n //make this tab go to the library screen\n component={LibraryStackScreen}\n options={{\n //make the icon for this tab a notes icon\n tabBarIcon: ({ color, size }) => (\n <SimpleLineIcons name=\"note\" size={size} color={color} />\n ),\n }}\n />\n <Tab.Screen\n name=\"Folders\"\n //make this tab go to the folders screen\n component={FoldersStackScreen}\n options={{\n //make the icon for this tab a folder\n tabBarIcon: ({ color, size }) => (\n <AntDesign name=\"folder1\" size={size} color={color} />\n ),\n }}\n />\n <Tab.Screen\n name=\"Planner\"\n //make this tab go to the planner screen\n component={PlannerStackScreen}\n options={{\n //make the icon for this tab a calendar\n tabBarIcon: ({ color, size }) => (\n <FontAwesome5 name=\"calendar-check\" size={size} color={color} />\n ),\n }}\n />\n </Tab.Navigator>\n );\n}", "function App() {\n return (\n <div className=\"App\">\n <Nav arr={tab}/>\n\n </div>\n );\n}", "render(){\n return (\n <div>\n {/*Page header used by bootstrap to name the app */}\n <PageHeader>Title <small>Words to live by</small></PageHeader>\n {/*\n Nav/NavItem used by bootstrap to create links to different routes.\n React-router v4 uses \"Link\" imported from 'react-router-dom' rather\n than simple hrefs. Since bootstrap NavItems use hrefs, we need to\n use LinkContainer to make them play nice.\n */}\n <Nav bsStyle=\"tabs\">\n <LinkContainer exact={true} to =\"/\">\n <NavItem eventKey={1}>\n Home\n </NavItem>\n </LinkContainer>\n <LinkContainer to =\"/route1\">\n <NavItem eventKey={2}>\n Route 1\n </NavItem>\n </LinkContainer>\n <LinkContainer to =\"/route2\">\n <NavItem eventKey={3}>\n Route 2\n </NavItem>\n </LinkContainer>\n </Nav>\n </div>\n )\n }", "function App() {\n const [pages] = useState([\n {\n name: \"about me\",\n page: <About />\n },\n {\n name: \"projects\",\n page: <Portfolio />\n }\n // {\n // name: \"contact\",\n // page: <Contact />\n // },\n // {\n // name: \"resume\",\n // page: <Resume />\n // },\n ]);\n\n const [currentPage, setCurrentPage] = useState(pages[0]);\n\n // function displayPage() {\n // switch (currentPage.name) {\n // case \"about me\":\n // return <About />;\n\n // case \"portfolio\":\n // return <Portfolio />;\n\n // case 'resume':\n // return <Resume/>;\n\n // case 'contact':\n // return <Contact/>;\n\n // default: // defensive programming used to redirect user if information is missing or whatever scenario\n // return <About />;\n // }\n // }\n\n return (\n \n <div>\n <Title/>\n <Nav\n pages={pages}\n currentPage={currentPage}\n setCurrentPage={setCurrentPage}\n />\n <main>\n {currentPage.page}\n </main>\n\n\n \n <Footer />\n\n </div>\n );\n}", "function HistoryTab() {\n\treturn (\n\t\t<div>\n\t\t\t<p>Hello World This is the History Tab</p>\n\t\t\t<img src={Head} />\n\t\t</div>\n\t);\n}", "function AboutPageWithStack({ navigation }) {\n return (\n <Stack.Navigator\n initialRouteName=\"About\"\n screenOptions={{\n headerLeft: ()=> <NavigationDrawerStructure navigationProps={navigation} />, //left drawer menu icon from cust component\n headerStyle: {\n backgroundColor: '#0E7AD5', //Set Header background color\n },\n headerTintColor: '#fff', //Set Header text & icon color\n headerTitleStyle: {\n fontWeight: 'bold', //Set Header text font & style\n }\n }}>\n <Stack.Screen\n name=\"About\"\n component={aboutPage}\n options={{\n title: 'About', //Set Header Title\n }}/>\n <Stack.Screen\n name=\"Contact\"\n component={contactPage}\n options={{\n title: 'Contact', //Set Header Title\n }}/>\n </Stack.Navigator>\n );\n}", "function AppTabScreen({routeName}){\n return(\n <Tab.Navigator\n initialRouteName={routeName}\n screenOptions={({ route }) => ({\n tabBarIcon: ({ focused, color, size }) => {\n let iconName;\n\n if (route.name === 'App') {\n iconName = 'ios-home';\n } \n else if (route.name === 'Options') {\n iconName = focused ? 'ios-list-box' : 'ios-list';\n }\n else if (route.name === 'About') {\n iconName = focused ? 'ios-information-circle' : 'ios-information-circle-outline';\n }\n\n // Qualquer componente pode ser usado\n return <Ionicons name={iconName} size={size} color={color} />;\n },\n })}\n tabBarOptions={{\n activeTintColor: 'red',\n inactiveTintColor: 'black',\n }}\n >\n\n <Tab.Screen name=\"App\" component={AppStack}/>\n <Tab.Screen name=\"Options\" component={OptionsScreen}/>\n <Tab.Screen name=\"About\" component={AboutScreen}/>\n\n </Tab.Navigator>\n );\n}", "function HomeTabs() {\n return (\n // The route to \"Home\" is rendered on first load of the navigator\n // The screenOptions options in the Navigator sets the default options for\n // each of the child Screens\n // This function is passed down to each individual Screen, which then passes\n // its route prop to this function\n <Tab.Navigator\n initialRouteName=\"Home\"\n screenOptions={({ route }) => ({\n tabBarIcon: ({ color, size }) => {\n // Switch statements that assigns icon based on TabScreen name\n switch (route.name) {\n case 'Diagnostics':\n return <MaterialCommunityIcons name=\"hospital\" size={size} color={color} />;\n case 'Data':\n return <MaterialCommunityIcons name=\"waveform\" size={size} color={color} />;\n case 'Home':\n return <Ionicons name=\"ios-globe-outline\" size={size} color={color} />;\n case 'Ambiance':\n return <FontAwesome5 name=\"lightbulb\" size={size} color={color} />;\n case 'Settings':\n return <Ionicons name=\"settings-outline\" size={size} color={color} />;\n default:\n return <Text>error</Text>;\n }\n },\n })}\n tabBarOptions={{\n activeTintColor: 'black',\n inactiveTintColor: 'gray',\n }}\n >\n {/* The different tabs routes are declared here as Screens */}\n <Tab.Screen name=\"Diagnostics\" component={DiagnosticsTab} />\n <Tab.Screen name=\"Data\" component={DataTab} />\n <Tab.Screen name=\"Home\" component={HomeTab} />\n <Tab.Screen name=\"Ambiance\" component={AmbianceTab} />\n <Tab.Screen name=\"Settings\" component={SettingsTab} />\n </Tab.Navigator>\n );\n}", "function MainView() {\n return (\n <div className=\"col-md-9\">\n <div className=\"feed-toggle\">\n <ul className=\"nav nav-pills outline-active\">\n <YourFeedTab />\n\n <GlobalFeedTab />\n\n <TagFilterTab />\n </ul>\n </div>\n\n <ArticleList />\n </div>\n );\n}", "function HomeScreen() {\n return (\n <>\n <Tab.Navigator\n initialRouteName=\"BookList\"\n tabBarOptions={{\n activeTintColor: \"#e91e63\",\n }}\n >\n <Tab.Screen\n name=\"BookListScreen\"\n component={BookListScreen}\n options={{\n tabBarLabel: \"Home\",\n tabBarIcon: ({ color, size }) => (\n <MaterialCommunityIcons name=\"home\" color={color} size={size} />\n ),\n }}\n />\n <Tab.Screen\n name=\"Search\"\n component={BookSearchScreen}\n options={{\n tabBarLabel: \"Search\",\n tabBarIcon: ({ color, size }) => (\n <FAIcon5 name=\"search\" color={color} size={size} />\n ),\n }}\n />\n <Tab.Screen\n name=\"Menu\"\n component={MenuScreen}\n options={{\n tabBarLabel: \"Menu\",\n tabBarIcon: ({ color, size }) => (\n <MaterialCommunityIcons name=\"menu\" color={color} size={size} />\n ),\n }}\n />\n </Tab.Navigator>\n </>\n );\n}", "function Tabs(props){\n const allTabs = ['synopsis', 'cast', 'episodes', 'related'];\n const tabNames = ['Story', 'Cast', 'Eps.', 'Related'];\n\n const tabs = allTabs.map((tab, index) => {\n const load = (tab === 'synopsis' ? null : 'MAL'); // Whether to load MAL or not\n const onTab = props.currentTab === tab // See if it's on\n const className = `tab-${tab} ` + (onTab ? 'on' : null); // If on, add \"on\"\n\n return(<div key={tab} className={className} onClick={() => props.handleTab(tab, load)}> {tabNames[index]}</div>)\n });\n\n return(\n <div className=\"window-tabs\">\n {tabs}\n </div>\n )\n }", "function MainStackNavigator() {\n return (\n \n\n // {/* <TabNavigator /> */}\n // <NavigationContainer>\n // <Tab.Navigator>\n // <Tab.Screen name='CommunitiesPublicGoals' component={CommunitiesPublicGoals} />\n // </Tab.Navigator>\n // </NavigationContainer>\n\n <NavigationContainer>\n <Stack.Navigator initialRouteName='Home'>\n <Stack.Screen name='Home' component={Home} />\n <Stack.Screen name='userHome' component={userHome} />\n <Stack.Screen name='UsersIndividualGoal' component={UsersIndividualGoal} />\n <Stack.Screen name='AddNewGoal' component={AddNewGoal} />\n <Stack.Screen name='CommunitiesPublicGoals' component={CommunitiesPublicGoals} />\n\n \n </Stack.Navigator>\n </NavigationContainer>\n )\n}", "function NavTabs(props) {\n return /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_2__[\"jsxDEV\"])(\"div\", {\n children: /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_2__[\"jsxDEV\"])(\"nav\", {\n className: \"navbar pt-3 pb-3 navbar-expand-lg nav-jgMain fixed-top bg-dark\",\n children: /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_2__[\"jsxDEV\"])(\"div\", {\n className: \"container\",\n children: [/*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_2__[\"jsxDEV\"])(\"a\", {\n className: \"navbar-brand navbar-brand-jg\",\n href: \"index.html\",\n children: \"JENNERATION\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 8,\n columnNumber: 11\n }, this), /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_2__[\"jsxDEV\"])(\"button\", {\n className: \"navbar-toggler navbar-dark bg-dark\",\n type: \"button\",\n \"data-toggle\": \"collapse\",\n \"data-target\": \"#navbarNavAltMarkup\",\n \"aria-controls\": \"navbarNavAltMarkup\",\n \"aria-expanded\": \"false\",\n \"aria-label\": \"Toggle navigation\",\n children: /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_2__[\"jsxDEV\"])(\"span\", {\n className: \"navbar-toggler-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 16,\n columnNumber: 13\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 9,\n columnNumber: 11\n }, this), /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_2__[\"jsxDEV\"])(\"div\", {\n className: \"collapse navbar-collapse justify-content-end\",\n id: \"navbarNavAltMarkup\",\n children: /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_2__[\"jsxDEV\"])(\"div\", {\n className: \"navbar-nav\",\n children: [/*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_2__[\"jsxDEV\"])(\"a\", {\n className: \"nav-item nav-link active\",\n href: \"#home\",\n onClick: () => props.handlePageChange(\"Home\"),\n className: props.currentPage === \"Home\" ? \"nav-link active\" : \"nav-link\",\n children: [\"Home\", /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_2__[\"jsxDEV\"])(\"span\", {\n className: \"sr-only\",\n children: \"(current)\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 26,\n columnNumber: 21\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 23,\n columnNumber: 15\n }, this), /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_2__[\"jsxDEV\"])(\"a\", {\n className: \"nav-item nav-link active\",\n href: \"#about\",\n onClick: () => props.handlePageChange(\"About\"),\n className: props.currentPage === \"About\" ? \"nav-link active\" : \"nav-link\",\n children: \"About\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 29,\n columnNumber: 15\n }, this), /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_2__[\"jsxDEV\"])(\"a\", {\n className: \"nav-item nav-link active\",\n href: \"#projects\",\n onClick: () => props.handlePageChange(\"Projects\"),\n className: props.currentPage === \"Projects\" ? \"nav-link active\" : \"nav-link\",\n children: \"Projects\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 35,\n columnNumber: 15\n }, this), /*#__PURE__*/Object(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_2__[\"jsxDEV\"])(\"a\", {\n className: \"nav-item nav-link active\",\n href: \"#contact\",\n onClick: () => props.handlePageChange(\"Contact\"),\n className: props.currentPage === \"Contact\" ? \"nav-link active\" : \"nav-link\",\n children: \"Contact\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 41,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 22,\n columnNumber: 13\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 18,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 7,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 6,\n columnNumber: 7\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 5,\n columnNumber: 5\n }, this);\n}", "render() {\n return (\n <div className=\"App\">\n\n <nav className=\"Navbar\">\n <h2>btf</h2>\n <ul>\n <li>\n <Link to=\"/about\">about</Link>\n </li>\n <li>\n <Link to=\"/projects\">projects</Link>\n </li>\n <li>\n <Link to=\"/contacts\">contacts</Link>\n </li>\n </ul>\n </nav>\n\n <Switch>\n <Route exact path=\"/\">\n <h1>Home</h1>\n </Route>\n <Route path=\"/about\">\n <h1>About</h1>\n </Route>\n <Route path=\"/projects\">\n <h1>Projects</h1>\n </Route>\n <Route path=\"/contacts\">\n <h1>Contacts</h1>\n </Route>\n\n </Switch>\n\n </div>\n );\n }", "function renderAbout(){\n const tab = document.getElementById('tab');\n tab.textContent = '';\n tab.appendChild(createAbout());\n}", "render() {\n console.log('sef a', this.props)\n return (\n <div className=\"intro_container\">\n <div className=\"text_intro\">\n <p>More...</p>\n </div>\n <div className=\"intro_tabs\">\n <div className=\"news_bubble\">\n <img className=\"news_img\" src={feed} alt=\"\"/>\n <button onClick={() => this.props.router.history.push('/feed')} className=\"main_button_tab\">Feed</button>\n </div>\n <div className=\"friends_bubble\">\n <img className=\"friends_img\" src={chat} alt=\"\"/>\n <button onClick={() => this.props.router.history.push('/chat')} className=\"main_button_tab\">Chat</button>\n </div>\n <div className=\"space_station_bubble\">\n <img className=\"ss_img\" src={apod} alt=\"\"/>\n <button onClick={() => this.props.router.history.push('/apod')} className=\"main_button_tab\">APOD</button>\n </div>\n </div>\n <div className=\"bottom_footer\">\n \n </div>\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 NavBar(props) {\n const handleClick = tab => {\n props.dispatch(setCurrentTab(tab));\n };\n\n const handleLogOut = () => {\n props.dispatch(setAuthedUser('null'));\n props.dispatch(setCurrentTab('null'));\n };\n\n const { currentTab, authedUser } = props;\n return (\n <div className='navbar'>\n <Link\n to='/questions'\n onClick={() => handleClick('home')}\n className={`navbar-home-button ${\n currentTab === 'home' ? 'active' : 'passive'\n }`}\n >\n HOME\n </Link>\n <Link\n to='/add'\n onClick={() => handleClick('newQuestion')}\n className={`navbar-post-button ${\n currentTab === 'newQuestion' ? 'active' : 'passive'\n }`}\n >\n POST YOUR QUESTION\n </Link>\n <Link\n to='/leaderboard'\n onClick={() => handleClick('leaderboard')}\n className={`navbar-leaderboard-button ${\n currentTab === 'leaderboard' ? 'active' : 'passive'\n }`}\n >\n LEADERBOARD\n </Link>\n {authedUser !== 'null' && (\n <div>\n <NavAvatar />\n <Link\n to='/signin'\n style={{ textDecoration: 'none' }}\n onClick={handleLogOut}\n >\n <button className='logout-button'>LOG OUT</button>\n </Link>\n </div>\n )}\n </div>\n );\n}", "function ClassBottomTabs({ route }) {\n return (\n <Tab.Navigator\n //customize the bottom tabs using the customTabBarStyle\n //edit some of the parameters from the customTabBarStyle to suit the class that the user navigated to\n tabBarOptions={{\n ...customTabBarStyle,\n activeTintColor: route.params.tintColor,\n style: {\n backgroundColor: \"white\",\n },\n }}\n >\n <Tab.Screen\n name=\"Camera\"\n options={{\n //make the bottom tab icon a camera\n tabBarIcon: ({ color, size }) => (\n <Feather name=\"camera\" size={size} color={color} />\n ),\n }}\n >\n {/* Customize the header of the camera screen to suit the class that the user navigated to */}\n {(props) => (\n <CameraStackScreen\n {...props}\n title={route.params.title}\n backgroundColor={route.params.backgroundColor}\n iconName={route.params.iconName}\n />\n )}\n </Tab.Screen>\n <Tab.Screen\n name=\"Notes\"\n options={{\n //make the bottom tab icon a notes icon\n tabBarIcon: ({ color, size }) => (\n <SimpleLineIcons name=\"note\" size={size} color={color} />\n ),\n }}\n >\n {/* Customize the header of the library screen to suit the class that the user navigated to */}\n {(props) => (\n <LibraryStackScreen\n {...props}\n title={route.params.title}\n backgroundColor={route.params.backgroundColor}\n iconName={route.params.iconName}\n />\n )}\n </Tab.Screen>\n <Tab.Screen\n name=\"Folders\"\n options={{\n //make the bottom tab icon a folder\n tabBarIcon: ({ color, size }) => (\n <AntDesign name=\"folder1\" size={size} color={color} />\n ),\n }}\n >\n {/* Customize the header of the folders screen to suit the class that the user navigated to */}\n {(props) => (\n <FoldersStackScreen\n {...props}\n title={route.params.title}\n backgroundColor={route.params.backgroundColor}\n iconName={route.params.iconName}\n />\n )}\n </Tab.Screen>\n <Tab.Screen\n name=\"Planner\"\n options={{\n //make the bottom tab icon a calendar\n tabBarIcon: ({ color, size }) => (\n <FontAwesome5 name=\"calendar-check\" size={size} color={color} />\n ),\n }}\n >\n {/* Customize the header of the planner screen to suit the class that the user navigated to */}\n {(props) => (\n <PlannerStackScreen\n {...props}\n title={route.params.title}\n backgroundColor={route.params.backgroundColor}\n iconName={route.params.iconName}\n />\n )}\n </Tab.Screen>\n </Tab.Navigator>\n );\n}", "function App() {\n return (\n <>\n<LandingPage/>\n<LandingpageTab/>\n </>\n );\n}", "function About(){\n\treturn(\n\t\t<React.Fragment>\n\t\t\t<h1>About</h1>\n\t\t\t<p>This is the TodoList app v1.0.0. It is part of a React crash course</p>\n\t\t</React.Fragment> \n\t)\n}", "function App() {\n return (\n <div className=\"App\">\n <NavLinks />\n </div>\n );\n}", "function AppStack(){\n return(\n <Stack.Navigator>\n \n <Stack.Screen\n name='Home'\n options={{ headerTitle: props => <LogoTitle/> }}>\n {props => <TelaInicial />}\n </Stack.Screen>\n\n <Stack.Screen\n name='Detalhes'\n options={{title: 'Tela de Detalhes'}}>\n {props => <TelaDetalhes />}\n </Stack.Screen>\n </Stack.Navigator>\n );\n}", "function SupportStack() {\n return (\n <StackSupport.Navigator initialRouteName=\"Support\">\n <StackSupport.Screen\n name=\"Support\"\n component={SupportScreen}\n options={navOptionHandler}\n />\n </StackSupport.Navigator>\n );\n}", "function NavItems(props) {\r\n\r\n // states for drop down menu\r\n const [open, setOpen] = useState(false);\r\n\r\n // Drop down menu switch\r\n const openTab = () => setOpen(!open); \r\n\r\n // Case 1: The admin navigation item\r\n if(props.admin === true)\r\n {\r\n return (\r\n <li className=\"navItem\">\r\n <Link to=\"/admin\" className=\"navButton\" onClick={openTab}>\r\n <RemixIcons.RiAdminLine size=\"32\"/> \r\n \r\n {open && props.children}\r\n </Link>\r\n </li>\r\n );\r\n }\r\n\r\n // Case 2: Other admin navigation item\r\n else {\r\n return (\r\n <li className=\"navItem\">\r\n <Link to={props.path || '/#'} className=\"navButton\" onClick={openTab}>\r\n <props.icon size=\"32\"/> \r\n \r\n {open && props.children}\r\n </Link>\r\n </li>\r\n );\r\n }\r\n \r\n}", "function About () {\n return(\n <div>\n <HomeSection />\n <AboutCards />\n {/* <SocialMedia /> */}\n <Footer />\n </div>\n );\n}", "function DisplayNav() {\n switch (userInfo.accountType) {\n case 'E':\n return (<EmpNav />)\n\n case 'U':\n return (<UserNav />)\n\n default:\n return (<VisitNav />)\n }\n }", "function TabNavigator({ children }) {\n const portrait = usePortrait()\n\n return (\n <Navigator\n screenOptions={({ route }) => ({\n tabBarIcon: ({ color }) => {\n let iconName\n\n if (route.name === 'HomePage') {\n iconName = 'home'\n return (\n <Icon\n name={iconName}\n type='MaterialIcons'\n style={[portrait ? iconStylePortrait : {}, { fontSize: 26, color: color }]}\n />\n )\n } else if (route.name === 'MessageStack') {\n iconName = 'message'\n return (\n <Icon\n name={iconName}\n type='MaterialIcons'\n style={[portrait ? iconStylePortrait : {}, { fontSize: 26, color: color }]}\n />\n )\n } else if (route.name === 'New Post') {\n iconName = 'add-circle-outline'\n return (\n <Icon\n name={iconName}\n type='MaterialIcons'\n style={[portrait ? iconStylePortrait : {}, { fontSize: 26, color: color }]}\n />\n )\n } else if (route.name === 'Wallet') {\n iconName = 'account-balance-wallet'\n return (\n <Icon\n name={iconName}\n type='MaterialIcons'\n style={[portrait ? iconStylePortrait : {}, { fontSize: 26, color: color }]}\n />\n )\n } else if (route.name === 'Search') {\n iconName = 'search'\n return (\n <Icon\n name={iconName}\n type='MaterialIcons'\n style={[portrait ? iconStylePortrait : {}, { fontSize: 26, color: color }]}\n />\n )\n }\n }\n })}\n tabBarOptions={{\n activeTintColor: 'rgb(87, 141, 222)',\n inactiveTintColor: 'rgb(189, 189, 189)',\n style: { height: 58 },\n labelStyle: portrait ? labelStylePortrait : labelStyleLandscape\n }}\n >\n {children}\n </Navigator>\n )\n}", "function AppStack(){\n return(\n <Stack.Navigator>\n \n <Stack.Screen\n name='Home'\n options={{ headerTitle: props => <LogoTitle/> }}>\n {props => <TelaInicial />}\n </Stack.Screen>\n\n <Stack.Screen\n name='Detalhes'\n options={{title: 'Tela de Detalhes'}}>\n {props => <TelaDetalhes />}\n </Stack.Screen>\n\n <Stack.Screen\n name='Usuario'\n options={{title: 'Dados do Usuário'}}>\n {props => <TelaUsuario />}\n </Stack.Screen>\n\n\n </Stack.Navigator>\n\n );\n}", "function NavBar(props) {\n\tconst {classes, isMobile, pollingFailed} = props;\n\tconst homeLabel = pollingFailed ? (\n\t\t<span className={classes.errorLabel}>\n\t\t\tHome <Error />\n\t\t</span>\n\t) : (\n\t\t'Home'\n\t);\n\tlet [selectedIndex, setSelectedIndex] = useState(0);\n\n\treturn (\n\t\t<div className={classes.navBarContainer}>\n\t\t\t<Tabs\n\t\t\t\tclassName={classes.tabBar}\n\t\t\t\tindicatorColor=\"secondary\"\n\t\t\t\tvariant=\"fullWidth\"\n\t\t\t\tvalue={selectedIndex}\n\t\t\t>\n\t\t\t\t{isMobile\n\t\t\t\t\t? [\n\t\t\t\t\t\t\t<Tab\n\t\t\t\t\t\t\t\tkey=\"mobile-tab-dashboard\"\n\t\t\t\t\t\t\t\ticon={<Home />}\n\t\t\t\t\t\t\t\tcomponent={Link}\n\t\t\t\t\t\t\t\tto=\"/\"\n\t\t\t\t\t\t\t\tonClick={() => setSelectedIndex(0)}\n\t\t\t\t\t\t\t/>,\n\t\t\t\t\t\t\t<Tab\n\t\t\t\t\t\t\t\tkey=\"mobile-tab-admin\"\n\t\t\t\t\t\t\t\ticon={<Person />}\n\t\t\t\t\t\t\t\tcomponent={Link}\n\t\t\t\t\t\t\t\tto=\"/admin\"\n\t\t\t\t\t\t\t\tonClick={() => setSelectedIndex(1)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t ]\n\t\t\t\t\t: [\n\t\t\t\t\t\t\t<Tab\n\t\t\t\t\t\t\t\tkey=\"desktop-tab-dashboard\"\n\t\t\t\t\t\t\t\taria-label=\"Dashboard\"\n\t\t\t\t\t\t\t\tclassName={classes.tab}\n\t\t\t\t\t\t\t\tcolor=\"inherit\"\n\t\t\t\t\t\t\t\tlabel={homeLabel}\n\t\t\t\t\t\t\t\tcomponent={Link}\n\t\t\t\t\t\t\t\tto=\"/\"\n\t\t\t\t\t\t\t\tonClick={() => setSelectedIndex(0)}\n\t\t\t\t\t\t\t/>,\n\t\t\t\t\t\t\t<Tab\n\t\t\t\t\t\t\t\tkey=\"desktop-tab-admin\"\n\t\t\t\t\t\t\t\taria-label=\"Admin\"\n\t\t\t\t\t\t\t\tclassName={classes.tab}\n\t\t\t\t\t\t\t\tcolor=\"inherit\"\n\t\t\t\t\t\t\t\tlabel=\"Admin\"\n\t\t\t\t\t\t\t\tcomponent={Link}\n\t\t\t\t\t\t\t\tto=\"/admin\"\n\t\t\t\t\t\t\t\tonClick={() => setSelectedIndex(1)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t ]}\n\t\t\t</Tabs>\n\t\t</div>\n\t);\n}", "function AppStack(){\n return(\n <Stack.Navigator> \n <Stack.Screen\n name='Home'\n options={{ headerTitle: props => <LogoTitle/> }}>\n {props => <TelaInicial />}\n </Stack.Screen>\n\n <Stack.Screen\n name='Detalhes'\n options={{title: 'Tela de Detalhes'}}>\n {props => <TelaDetalhes />}\n </Stack.Screen>\n\n <Stack.Screen\n name='Usuario'\n options={{title: 'Dados do Usuário'}}>\n {props => <TelaUsuario />}\n </Stack.Screen>\n </Stack.Navigator>\n\n );\n}", "render() {\n return (\n <Navbar className = \"bp3-dark top-tabbar\">\n <NavbarGroup align = { Alignment.LEFT }>\n <Tabs\n animate = { true }\n large = { true }\n onChange = { this.change_tab }\n selectedTabId = { this.state.current_catagory }\n >\n <Tab id = \"General\" title = \"General\"/>\n <Tab id = \"Business\" title = \"Business\"/>\n <Tab id = \"Technology\" title = \"Technology\"/>\n <Tab id = \"Science\" title = \"Science\"/>\n <Tab id = \"Sports\" title = \"Sports\"/>\n <Tab id = \"Health\" title = \"Health\"/>\n <Tab id = \"Entertainment\" title = \"Entertainment\" />\n </Tabs>\n </NavbarGroup>\n </Navbar>\n );\n }", "function App() {\n return (\n <HashRouter>\n <ul className=\"header\">\n <li>\n <Link to=\"#home\">Accueil</Link>\n </li>\n <li>\n <Link to=\"#about\">A Propos</Link>\n </li>\n <li>\n <Link to=\"#skills\">Compétences</Link>\n </li>\n <li>\n <Link to=\"#parcours\">Parcours</Link>\n </li>\n <li>\n <Link to=\"#portfolio\">Portfolio</Link>\n </li>\n <li>\n <Link to=\"#contact\">Contact</Link>\n </li>\n </ul>\n\n <div className=\"content\">\n <Router>\n {/* A <Switch> looks through its children <Route>s and\n renders the first one that matches the current URL. */}\n <Switch>\n <Route path=\"/\">\n <Home />\n\n <About />\n <Skills />\n <Parcours />\n <Portfolio />\n <Contact />\n </Route>\n </Switch>\n </Router>\n </div>\n </HashRouter>\n );\n}", "render() {\n const { page } = this.state;\n const tabberStyles = [styles.tabbar];\n// if (Platform.OS === 'android') tabbarStyles.push(styles.androidTabbar);\n\n\n\n return (\n\n <View style={styles.container}>\n <Tabs\n selected={page}\n style={styles.tabbar}\n selectedStyle={{color:'red'}} onSelect={el=>this.setState({page:el.props.name})}\n >\n <Text name=\"first\">Home - {Platform.OS}</Text>\n <Text name=\"second\">Settings</Text>\n <Text name=\"third\">[X]</Text>\n </Tabs>\n\n\n <Text>eCom App &nbsp; &nbsp; | &nbsp; &nbsp; {page}</Text>\n\n\n\n <Text style={styles.instructions}>\n {'\\n'}{'\\n'} Android {'\\n'}\n Double tap R on your keyboard to reload,{'\\n'}\n Shake or press menu button for dev menu{'\\n'}\n --{'\\n'}\n iOS {'\\n'}\n Press Cmd+R to reload,{'\\n'}\n Cmd+D or shake for dev menu\n {'\\n'}\n —{'\\n'} {'\\n'}\n Jose and Mayur, do a quick demo - Prof. Moskal 🏈\n\n Hey, real quick\n </Text>\n\n </View>\n )\n }", "renderTabs() {\n return (\n <Tabs defaultActiveKey={1} id=\"tab\" >\n <Tab eventKey={1} title=\"Projects\">\n {this.renderProjs()}\n </Tab>\n <Tab eventKey={2} title=\"Users\">\n {this.renderUsers()}\n </Tab>\n <Tab eventKey={3} title=\"Search\">\n {this.renderSearch()}\n <ListGroup><br /><br />\n {this.renderResult()}\n </ListGroup>\n </Tab>\n </Tabs>\n );\n }", "render() {\n\n // Our primary navigator between the pre and post auth views\n // This navigator switches which screens it navigates based on\n // the existent of an access token. In the authorized view,\n // which right now only consists of the profile, you will likely\n // need to specify another set of screens or navigator; e.g. a\n // list of tabs for the Today, Exercises, and Profile views.\n let AuthStack = createStackNavigator();\n let Tab = createBottomTabNavigator();\n const Stack = createStackNavigator();\n const ProfileStack = createStackNavigator();\n const screenOptionStyle = {\n // headerStyle: {\n // backgroundColor: \"#9AC4F8\",\n // },\n // headerTintColor: \"white\",\n // headerBackTitle: \"Back\",\n };\n\n\n\n const ProfileStackNavigator = () => {\n return (\n <ProfileStack.Navigator screenOptions={screenOptionStyle}>\n <ProfileStack.Screen name=\"Profile\" options={{\n title: 'Profile',\n headerLeft: this.SignoutButton\n }} >\n {(props) => <ProfileView {...props} username={this.state.username} accessToken={this.state.accessToken} revokeAccessToken={this.revokeAccessToken} update={this.update} />}\n </ProfileStack.Screen>\n </ProfileStack.Navigator>\n );\n };\n\n const DayViewStackNavigator = () => {\n return (\n <Stack.Navigator screenOptions={screenOptionStyle}>\n <Stack.Screen name=\"Today\" options={{\n title: 'Today',\n headerLeft: this.SignoutButton\n }}>\n {(props) => <TodayView {...props} goalDailyActivity={this.state.goalDailyActivity} activities={this.state.activities} activityDone={this.state.activityDone} revokeAccessToken={this.revokeAccessToken} />}\n </Stack.Screen>\n </Stack.Navigator>\n );\n };\n\n // const ExercisesStackNavigator = (props) => {\n // return (\n // <ExercisesStack.Navigator screenOptions={screenOptionStyle}>\n // <ExercisesStack.Screen name=\"Exercises\" options={{\n // title: 'Exercises',\n // headerLeft: this.SignoutButton,\n // headerRight: ({ nv }) => <Text onPress={() => console.log(nv)}> hello</Text>,\n // }}>\n // {(props) => <ExercisesView {...props} username={this.state.username} accessToken={this.state.accessToken} revokeAccessToken={this.revokeAccessToken} />}\n // </ExercisesStack.Screen>\n // <ExercisesStack.Screen name=\"AddExercise\" options={{\n // title: 'Add Exercise'\n // }}>\n // {(props) => <AddExerciseView {...props} username={this.state.username} accessToken={this.state.accessToken} revokeAccessToken={this.revokeAccessToken} />}\n // </ExercisesStack.Screen>\n // </ExercisesStack.Navigator>\n // );\n // };\n\n\n const BottomTabNavigator = () => {\n return (\n <Tab.Navigator\n initialRouteName=\"Feed\"\n tabBarOptions={{\n activeTintColor: '#e91e63',\n }}\n >\n <Tab.Screen name=\"Today\" options={{\n tabBarLabel: 'Today',\n tabBarIcon: ({ color, size }) => (\n <MaterialIcons name=\"today\" size={size} color={color} />\n ),\n }} component={DayViewStackNavigator} />\n <Tab.Screen name=\"Profile\" options={{\n tabBarLabel: 'Profile',\n tabBarIcon: ({ color, size }) => (\n <MaterialCommunityIcons name=\"account\" color={color} size={size} />\n ),\n }} component={ProfileStackNavigator} />\n <Tab.Screen name=\"Exercises\" options={{\n tabBarLabel: 'Exercises',\n tabBarIcon: ({ color, size }) => (\n <FontAwesome5 name=\"running\" size={size} color={color} />\n ),\n }} >\n {(props) => <ExercisesStackNavigator {...props} username={this.state.username} accessToken={this.state.accessToken} revokeAccessToken={this.revokeAccessToken} update={this.update} data={this.state.allActivities}></ExercisesStackNavigator>}\n </Tab.Screen>\n\n\n </Tab.Navigator>);\n };\n\n\n return (\n <NavigationContainer>\n\n {!this.state.accessToken ? (\n <>\n <AuthStack.Navigator>\n <AuthStack.Screen\n name=\"Login\"\n options={{\n title: 'Fitness Tracker Welcome',\n }}\n >\n {(props) => <LoginView {...props} login={this.login} />}\n </AuthStack.Screen>\n\n <AuthStack.Screen\n name=\"SignUp\"\n options={{\n title: 'Fitness Tracker Signup',\n }}\n >\n {(props) => <SignupView {...props} />}\n </AuthStack.Screen>\n </AuthStack.Navigator>\n </>\n ) : (\n // <>\n // <AuthStack.Screen name=\"FitnessTracker\" options={{\n // headerLeft: this.SignoutButton\n // }}>\n // {(props) => <ProfileView {...props} username={this.state.username} accessToken={this.state.accessToken} revokeAccessToken={this.revokeAccessToken} />}\n // </AuthStack.Screen>\n // </>\n <BottomTabNavigator />\n )}\n </NavigationContainer >\n );\n }", "render() {\n return (\n <div className=\"Menu\">\n <nav>\n <ul>\n <li><a href=\"#home\">Home</a></li>\n <li><a href=\"#services\">Services</a></li>\n <li><a href=\"#innovation\">Innovation</a></li>\n <li><a href=\"#guestbook\">Guestbook</a></li>\n </ul>\n </nav>\n </div>\n );\n }", "function NavTabs() {\n return (\n <nav className=\"navbar fixed-top bg-dark navbar-dark navbar-expand my-nav\">\n <ul className=\"navbar-nav\">\n\n {/* <li className=\"navbar-nav flex-row ml-md-auto d-none d-md-flex nav-item\">\n\n </li> */}\n\n <li className=\"nav-item\">\n <Link\n to=\"/\"\n className={window.location.pathname === \"/\" ? \"nav-link active\" : \"nav-link\"}\n >\n About\n </Link>\n </li>\n <li className=\"nav-item\">\n <Link\n to=\"/products\"\n className={window.location.pathname === \"/products\" ? \"nav-link active\" : \"nav-link\"}\n >\n Products\n </Link>\n </li>\n <li className=\"nav-item\">\n <Link\n to=\"/services\"\n className={window.location.pathname === \"/services\" ? \"nav-link active\" : \"nav-link\"}\n >\n Services\n </Link>\n </li>\n <li className=\"nav-item\">\n <Link\n to=\"/subscription\"\n className={window.location.pathname === \"/subscription\" ? \"nav-link active\" : \"nav-link\"}\n >\n Subscription\n </Link>\n </li>\n <li className=\"nav-item\">\n <Link\n to=\"/contact\"\n className={window.location.pathname === \"/contact\" ? \"nav-link active\" : \"nav-link\"}\n >\n Contact\n </Link>\n </li>\n <li className=\"nav-item\">\n <a\n href=\"mailto:[email protected]\"\n >\n {/* <img className=\"email\" alt=\"email\" src={Email} /> */}\n </a>\n </li>\n </ul>\n <ul className=\"navbar-nav navbar-right ml-auto\">\n <li className=\"nav-item\">\n <Link to=\"/\" className={window.location.pathname === \"/\" ? \"nav-link active\" : \"nav-link\"}>\n Alison Bodhani\n </Link>\n </li>\n </ul>\n \n \n </nav>\n );\n}", "function NavBox() {\n\n return (\n <nav className=\"navbox\">\n <div className=\"nav-details\">\n <h1 className=\"nav-title\">Microblog</h1>\n <h4 className=\"nav-tagline\">Get into the Rithm of blogging!</h4>\n <div className=\"links\">\n <NavLink exact to=\"/\" className=\"link\">Blog</NavLink>\n <NavLink exact to=\"/new\" className=\"link\">Add a new post</NavLink>\n </div>\n </div>\n </nav>);\n\n}", "renderHomeLinks() {\n return (\n <div className='navContents'>\n {TokenServices.hasAuthToken() && <Nickname />}\n <div role=\"navigation\" className=\"burgerIcon\" id=\"burger\" onClick={this.burgerClick}> &#9776; </div>\n <ul aria-live=\"polite\" className=\"links null\" id=\"links\" onClick={this.burgerClick}>\n <li><Link to='/contacts'>Contacts</Link></li>\n <li><Link to='/alerts'>My Alerts</Link></li>\n <li><Link to='/delete-account'>Settings</Link></li>\n <li><Link onClick={this.signOut} to='/auth/login' >Log Out</Link></li>\n </ul>\n </div>\n )\n }", "handleShowAbout(){\n this.setState({ \n showAbout: true \n });\n }", "function TabLinks(props) {\n \n const state = useContext(UserContext);\n const { value, setValue } = state;\n\n const handleChange = (event, newValue) => {\n setValue(newValue);\n };\n\n const handleLinks = value => {\n props.history.replace(value)\n };\n\n return (\n <div style={{ flexGrow: \"1\", margin: \"0\"}}>\n <Tabs\n value={value}\n onChange={handleChange}\n indicatorColor=\"primary\"\n textColor=\"primary\"\n variant={$(window).width() < 769 ? \"fullWidth\" : \"standard\"}\n centered\n >\n <Tab label=\"Home\" className={\"tabs\"} onClick={() => handleLinks(\"/\")} />\n <Tab label={$(window).width() < 769 ? \"Upcoming\" : \"Upcoming Items\"} className={\"tabs\"} onClick={() => handleLinks(\"/upcoming\")} />\n <Tab label={$(window).width() < 769 ? \"Weapons\" : \"Weapon Search\"} className={\"tabs\"} onClick={() => handleLinks(\"/weaponsearch\")}/>\n <Tab label={$(window).width() < 769 ? \"Players\" : \"Player Information\"} className={\"tabs\"} onClick={() => handleLinks(\"/playersearch\")}/>\n </Tabs>\n </div>\n );\n}", "function App() {\n return (\n <>\n <NavBar />\n <Section1 />\n <Section2 /> \n <Section3 /> \n <Faq />\n <Subscribe />\n <Footer/>\n <Attribute/>\n </>\n );\n}", "function App() {\n return (\n <div className=\"App\">\n <Tabs></Tabs>\n </div>\n );\n}", "function About() {\n return (\n <div>\n <h2 className=\"switch-header\">About</h2>\n </div>\n );\n}", "function Nav() {\n return (\n <div>\n Nav<br/>\n <Link to='/dashboard'><button>Home</button></Link><br/>\n <Link to='/new'><button>New Post</button></Link><br/>\n <Link to='/'><button>Logout</button></Link><br/>\n </div>\n )\n}", "setStackTab() {\n }", "render() {\n return (\n <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>\n <Text style={{ marginTop:50, fontSize:25 }}>Home!</Text>\n <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>\n <TouchableOpacity style={styles.button} \n onPress={() => this.props.navigation.navigate('Settings')}>\n <Text>Go to settng Tab</Text>\n </TouchableOpacity>\n <TouchableOpacity style={styles.button} \n onPress={() => this.props.navigation.navigate('Details')}>\n <Text>Open Details Screen</Text>\n </TouchableOpacity>\n </View>\n </View>\n );\n }", "render() {\n\n return (\n <div className=\"settings-subnav\">\n <Tabs.Tabs className=\"grid-one\">\n <Tabs.Tab label=\"General\">\n <section className=\"grid-one\">\n <div className=\"grid-item\"><BasicCard/></div>\n <div className=\"grid-item\"><BasicCard/></div>\n <div className=\"grid-item\"><Toggle label=\"Toggle Stuff\" defaultToggled={true}/></div>\n </section>\n </Tabs.Tab>\n <Tabs.Tab label=\"Design\" >\n </Tabs.Tab>\n <Tabs.Tab label=\"Modules\" />\n <Tabs.Tab label=\"Notify\" />\n <Tabs.Tab label=\"Priveleges\" />\n </Tabs.Tabs>\n </div>\n // <DropDownMenu menuItems={menuItems} onChange={this.transitionToRoute} />\n );\n }", "function goToTab(tabName) {\n routingBase.goToMenuTab(tabName);\n }", "function NavBar () {\n\n return ( \n <nav className=\"navigation-items\">\n <div>\n <h1 id=\"header\">Forager's Recipe Book</h1>\n </div>\n <Link to=\"/home\"><h2>Home🏡</h2></Link>\n <Link to=\"/addform\"><h3>Add to the Collection!</h3></Link>\n <Link to=\"/about\"><h3>About</h3></Link> \n </nav>\n );\n}", "function Tabs() {\n const [toggleState, setToggleState] = useState(1);\n\n const toggleTab = (index) => {\n setToggleState(index);\n };\n\n return (\n <div className=\"container\">\n <div className=\"bloc-tabs\">\n <button className={toggleState === 1 ? \"tabs active-tabs\" : \"tabs\"} onClick={() => toggleTab(1)}>Upload Design</button>\n <button className={toggleState === 2 ? \"tabs active-tabs\" : \"tabs\"} onClick={() => toggleTab(2)}>Manage Design</button>\n <button className={toggleState === 3 ? \"tabs active-tabs\" : \"tabs\"} onClick={() => toggleTab(3)}>Find New Gig</button>\n </div>\n\n <div className=\"content-tabs\">\n <div className={toggleState === 1 ? \"content active-content\" : \"content\"}>\n <UploadDesign />\n </div>\n\n <div className={toggleState === 2 ? \"content active-content\" : \"content\"}>\n <img src=\"../../comingSoon.png\" alt=\"logo\"/>\n </div>\n\n <div className={toggleState === 3 ? \"content active-content\" : \"content\"}>\n <img src=\"../../comingSoon.png\" alt=\"logo\"/>\n </div>\n </div>\n </div>\n );\n}", "function App() {\n return (\n <div className=\"App\">\n <NavLink exact activeStyle={s} to=\"/\" style={navs}>\n HOME\n </NavLink>\n <NavLink exact activeStyle={s} to=\"/about\" style={navs}>\n ABOUT\n </NavLink>\n <NavLink exact activeStyle={s} to=\"/AvatarList\" style={navs}>\n AVATARLIST\n </NavLink>\n <div>\n <SwitchRoutes/>\n </div>\n </div>\n );\n}", "function Navigation() {\n\n //making the default useState the About page\n const [currentPage, setCurrentPage] = useState(\"About\");\n\n const renderPage = () => {\n if (currentPage === \"About\") {\n return <About />\n }\n if (currentPage === \"Portfolio\") {\n return <Portfolio />\n }\n if (currentPage === \"Skills\") {\n return <Skills />\n }\n if (currentPage === \"Contact\") {\n return <ContactInfo />\n }\n if (currentPage === \"Resume\") {\n return <Resume />\n }\n }\n\n //Function to update useState\n const handlePageChange = (page) => setCurrentPage(page);\n\n return (\n <>\n <Header currentPage={currentPage} handlePageChange={handlePageChange} />\n <main>\n {renderPage()}\n </main>\n <Footer />\n </>\n );\n \n}", "showLoggedInNav() {\n return (\n <nav>\n <NavLink exact to='/'>Jobly</NavLink>\n <NavLink exact to='/companies' >Companies</NavLink>\n <NavLink exact to='/jobs' >Jobs</NavLink>\n <NavLink exact to='/profile' >Profile</NavLink>\n <NavLink exact to='/' ><p onClick={this.props.logout}>Logout</p></NavLink>\n </nav>\n )\n }", "render () {\n\t\tlet { tabStates } = this.state;\n\t\tlet { project, diagram } = this.props;\n\t\tlet tabs = [];\n\n\t\ttabs.push(Tab(0, project ? project.name : 'No Project selected', ProjectMenu, this.props));\n\n\t\tif (project) {\n\t\t\ttabs.push(Tab(1, diagram ? diagram.name : 'No Diagram selected', DiagramMenu, this.props));\n\t\t\tif (diagram) {\n\t\t\t\ttabs.push(Tab(2, `Components [${diagram.type}]`, ComponentMenu, this.props));\n\t\t\t}\n\t\t}\n\n\t\treturn <div className=\"side\">\n\t\t\t<Tabs tabs={tabs} toggle={this.setTabState} states={tabStates}/>\n\t\t</div>;\n\t}", "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 AboutMe(props) {\n const { allProjects, allImages, allReadmes } = props;\n return (\n <React.Fragment>\n <div id=\"aboutMe\"></div>\n <AboutMeDescription />\n <AboutMeSkills />\n <Experience />\n <Projects\n allProjects={allProjects}\n allImages={allImages}\n allReadmes={allReadmes}\n />\n <Contact />\n </React.Fragment>\n )\n}", "render(){\n return(\n <Container>\n \n <StatusBar translucent={false} style = {styles.statusBar} barStyle = \"light-content\"/>\n\n <Header hasTabs style = {styles.header} noShadow = {true} androidStatusBarColor={'#D32F2F'}>\n <Left style = {{flex: 1}}>\n \n <Icon name='arrow-back' style={{color:'white'}} onPress={() => this.props.navigation.goBack()} />\n \n </Left>\n\n <Body style = {styles.title}>\n <Title> Hospital </Title>\n </Body>\n \n <Right style = {{flex: 1}}>\n \n <Icon name='search' style={{color:'white'}} />\n \n </Right>\n </Header>\n \n <Tabs initialPage={0}>\n <Tab tabStyle = {styles.inactiveTabStyle} textStyle = {styles.inactiveTabTextStyle} \n activeTabStyle = {styles.activeTabStyle} activeTextStyle = {styles.activeTabTextStyle} heading=\"Profile\">\n <HospitalPublicProfileInfo data = {this.state}/>\n </Tab>\n\n <Tab tabStyle = {styles.inactiveTabStyle} textStyle = {styles.inactiveTabTextStyle} \n activeTabStyle = {styles.activeTabStyle} activeTextStyle = {styles.activeTabTextStyle} heading=\"Blood requests\">\n </Tab>\n </Tabs>\n\n </Container>\n )\n }", "function Navigation({ currentPage, handlePageChange }) {\n return (\n <header>\n <nav className=\"navbar fixed-top navbar-expand-lg p-background-color\">\n <a \n className=\"navbar-brand p-font-color nav-brand-custom swing linear-wipe\" \n href=\"/\"> Brandon Ford's Portfolio\n </a>\n {/* <button \n className=\"navbar-toggler custom-toggler\" \n type=\"button\" \n data-toggle=\"collapse\" \n data-target=\"#navbarSupportedContent\" \n aria-controls=\"navbarSupportedContent\" \n aria-expanded=\"false\" \n aria-label=\"Toggle navigation\">\n <span\n className=\"navbar-toggler-icon\">\n </span>\n </button> */}\n <div className=\" navbar-collapse custom-toggler\" id=\"navbarSupportedContent\">\n <ul className=\"navbar-nav ml-auto\">\n <li className=\"nav-item\">\n <a\n href=\"#about\"\n onClick={() => handlePageChange('About')}\n // This is a conditional (ternary) operator that checks to see if the current page is \"Home\"\n // If it is, we set the current page to 'nav-link-active', otherwise we set it to 'nav-link'\n className={currentPage === 'About' ? 'nav-link p-font-color m-lc active' : 'nav-link p-font-color m-lc'}\n >\n About\n </a>\n </li>\n <li className=\"nav-item\">\n <a\n href=\"#projects\"\n onClick={() => handlePageChange('Projects')}\n // Check to see if the currentPage is `About`, and if so we use the active link class from bootstrap. Otherwise, we set it to a normal nav-link\n className={currentPage === 'Projects' ? 'nav-link p-font-color m-lc active' : 'nav-link p-font-color m-lc'}\n >\n Projects\n </a>\n </li>\n <li className=\"nav-item\">\n <a\n href=\"#contact\"\n onClick={() => handlePageChange('Contact')}\n // Check to see if the currentPage is `Blog`, and if so we use the active link class from bootstrap. Otherwise, we set it to a normal nav-link\n className={currentPage === 'Contact' ? 'nav-link p-font-color m-lc active' : 'nav-link p-font-color m-lc'}\n >\n Contact\n </a>\n </li>\n <li className=\"nav-item\">\n <a\n href=\"#resume\"\n onClick={() => handlePageChange('Resume')}\n // Check to see if the currentPage is `Contact`, and if so we use the active link class from bootstrap. Otherwise, we set it to a normal nav-link\n className={currentPage === 'Resume' ? 'nav-link p-font-color m-lc active' : 'nav-link p-font-color m-lc'}\n >\n Resume\n </a>\n </li>\n </ul>\n </div>\n </nav>\n </header>\n );\n}", "render() {\n return (\n <div className=\"appDiv\">\n <Link to=\"/\" className=\"navlink\">Home</Link>\n <br />\n <Link to=\"/contact\" className=\"navlink\">Contact</Link>\n <br />\n <Link to=\"/about\" className=\"navlink\">About</Link>\n <br />\n <Link to=\"/portfolio\" className=\"navlink\">Portfolio</Link>\n <br />\n <Link to=\"/resume\" className=\"navlink\">Resume</Link>\n <br />\n {this.props.children}\n </div>\n );\n }", "function Profile() {\n return (\n <Stack.Navigator\n screenOptions={{\n headerStyle: { backgroundColor: 'black' },\n headerTintColor: '#fff',\n }}\n >\n <Stack.Screen name=\"ProfileMenu\" component={ProfileMenu} options={{ title: \"Profile\"}}/>\n <Stack.Screen name=\"CreateClass\" component={CreateClass} options={{ title: \"Create a new class\"}}/>\n <Stack.Screen name=\"HostedClasses\" component={HostedClasses} options={{ title: \"Classes you're hosting\"}}/>\n <Stack.Screen name=\"TeacherViewClass\" component={TeacherViewClass} options={{ title: \"View your class\"}}/>\n <Stack.Screen name=\"TeacherEditProfile\" component={TeacherEditProfile} options={{ title: \"Edit Profile Bio\"}}/>\n <Stack.Screen name=\"TeacherProfile\" component={TeacherProfile} options={{ title: \"Your Bio\"}}/>\n <Stack.Screen name=\"Payments\" component={Payments} options={{ title: \"Your card details\"}}/>\n\n </Stack.Navigator>\n );\n}", "function Nav() {\n return (\n <nav className=\"nav\">\n <HorizontalNavbar />\n <VerticalNavbar />\n </nav>\n );\n}", "function Nav () {\n return (\n <ul className='nav'>\n <li>\n <NavLink exact activeClassName='active' to='/'>Home</NavLink>\n </li>\n <li>\n <NavLink activeClassName='active' to='/battle'>Battle</NavLink>\n </li>\n <li>\n <NavLink activeClassName='active' to='/popular'>Popular</NavLink>\n </li>\n </ul>\n )\n}", "function TabOneNavigator() {\n return (\n <TabOneStack.Navigator>\n <TabOneStack.Screen\n name=\"PlaylistAnalyserHome\"\n component={PlaylistAnalyser}\n options={{ headerTitle: 'Playlist Analyser' }}\n />\n <TabOneStack.Screen\n name=\"SearchSong\"\n component={SearchSong}\n options={{ headerTitle: 'Playlist Analyser' }}\n />\n <TabOneStack.Screen\n name=\"SearchPlaylist\"\n component={SearchPlaylist}\n options={{ headerTitle: 'Playlist Analyser' }}\n />\n <TabOneStack.Screen\n name=\"SearchPlaylistResults\"\n component={SearchPlaylistResults}\n options={{ headerTitle: 'Playlist Analyser' }}\n />\n <TabOneStack.Screen\n name=\"PlaylistResults\"\n component={PlaylistResults}\n options={{ headerTitle: 'Playlist Analyser' }}\n />\n </TabOneStack.Navigator>\n );\n}", "function NavBar({ currentPage, handlePageChange }) {\n return (\n <ul>\n <li>\n <a\n href=\"#home\"\n onClick={() => handlePageChange(\"Home\")}\n // if current page is === Home using ternary operator\n\n className={currentPage === \"Home\" ? \"nav-link active\" : \"nav-link\"}\n >\n Home\n </a>\n </li>\n <li>\n <a\n href=\"#about\"\n onClick={() => handlePageChange(\"About\")}\n // if current page is === About using ternary operator\n\n className={currentPage === \"About\" ? \"nav-link active\" : \"nav-link\"}\n >\n About\n </a>\n </li>\n <li>\n <a\n href=\"#projects\"\n onClick={() => handlePageChange(\"Projects\")}\n // if current page is === projects using ternary operator\n\n className={\n currentPage === \"Projects\" ? \"nav-link active\" : \"nav-link\"\n }\n >\n Projects\n </a>\n </li>\n <li>\n <a\n href=\"#resume\"\n onClick={() => handlePageChange(\"Resume\")}\n // if current page is === Resume using ternary operator\n\n className={currentPage === \"Resume\" ? \"nav-link active\" : \"nav-link\"}\n >\n Resume\n </a>\n </li>\n <li>\n <a\n href=\"#contact\"\n // if current page is === Contacts using ternary operator\n\n onClick={() => handlePageChange(\"Contact\")}\n className={currentPage === \"Contact\" ? \"nav-link active\" : \"nav-link\"}\n >\n Contact\n </a>\n </li>\n </ul>\n );\n}", "render() {\n const { activeItem } = this.state;\n\n return (\n <div\n className=\"ui large fixed stackable icon menu secondary main\"\n style={{ marginTop: \"5vh\" }}\n >\n <div className=\"item\">\n <Icon name=\"chess pawn\" />\n </div>\n\n <a className=\"item\">\n <Icon name=\"home\" />\n Home\n </a>\n <a className=\"item\" href={Resume} target=\"_blank\">\n <Icon name=\"file pdf outline\" />\n Resume\n </a>\n <a\n className=\"item\"\n href=\"https://github.com/stanleyyoang\"\n target=\"_blank\"\n >\n <Icon name=\"github\" />\n GitHub\n </a>\n </div>\n );\n }", "function Navigation(){\n return (<div className = \"menu\">\n <Link className = \"links\" to =\"/\">Home</Link>\n <Link className = \"links\" to = \"/about\">About</Link> \n </div>\n );\n}", "function AppStack() {\n return(\n <NavigationContainer>\n <appNavStack.Navigator>\n <appNavStack.Screen name=\"Home\" component={HomeScreen} />\n </appNavStack.Navigator>\n </NavigationContainer>\n );\n}", "function navigateToAbout() {\n return util.tapElementByCss(\"main.SettingsViewController ul li > button[value='about']\")\n .then(() => util.elementByCssDisplayed(\"main.AboutViewController.displayed\"));\n}", "homeClicked() {\n this.props.navChanged(\"Home\");\n }", "function App() {\n return (\n <Router>\n <div className=\"App\">\n <h2>React Router</h2>\n <nav>\n <Link to={'/Home'}>Home</Link>\n <Link to={'/About'}>Form</Link>\n <Link to={'/COntact'}>Contact</Link>\n \n </nav>\n <hr/>\n <Switch>\n <Route path='/Home' component={Home}/>\n <Route path='/About' component={About}/>\n <Route path='/Contact' component={Contact}/>\n </Switch>\n </div>\n </Router>\n );\n}", "function Navigation() {\n\n \n\n return (\n <div>\n\n\n <div className=\"nav\">\n <Link to=\"/\">&#60; Movies</Link>\n <Link to=\"/about\">About</Link>\n <img className=\"img\"\n src={logo}\n alt=\"profile\" />\n <Link to=\"/Home2\">Home</Link>\n <Link to=\"/Home2\">Join us</Link>\n </div>\n\n\n <div>\n <p className=\"grade_title\">Quick grade guide</p>\n <div className=\"grade\">\n <p>violent1 : bleeding </p>\n <p>violent2 : physical fighting </p>\n <p>violent3 : kill, gore </p>\n \n <p>nudity1 : kiss </p>\n <p>nudity2 : nudity </p>\n <p>nudity3 : sex scene </p>\n </div>\n <Link to=\"/Home2\">Detail</Link>\n \n </div>\n\n\n \n <div className=\"copyright\">\n <p>copyright ©shootingcorn All rights reserve. </p>\n </div>\n \n\n\n </div>\n\n\n );\n}", "showMainScreen(animated) {\n const createTabs = () => {\n let tabs = [\n {\n label: 'Charts',\n screen: 'app.ChartCatalogScreen',\n icon: require('../img/tabBarCharts.png'),\n selectedIcon: require('../img/tabBarCharts.png'),\n title: 'Charts',\n navigatorStyle: {\n navBarTranslucent: true,\n drawUnderTabBar: true,\n statusBarTextColorScheme: 'dark'\n }\n },\n {\n label: 'Profile',\n screen: 'app.ProfileScreen',\n icon: require('../img/tabBarProfile.png'),\n selectedIcon: require('../img/tabBarProfile.png'),\n title: 'Profile',\n navigatorStyle: {\n navBarHidden: true,\n statusBarTextColorScheme: 'dark'\n }\n }\n ];\n\n return tabs;\n };\n\n Navigation.startTabBasedApp({\n animationType: animated ? 'slide-down': 'none',\n tabs: createTabs(),\n tabsStyle: {\n tabBarTranslucent: true,\n tabBarButtonColor: colors.light,\n tabBarSelectedButtonColor: colors.primary,\n }\n });\n }", "render() {\n return (<header className=\"header\" id=\"myHeader\">\n <div>\n <nav className=\"topnav\" id=\"myTopnav\">\n <ul>\n <li>\n <div className=\"dropdown\">\n <button className=\"dropbtn\">\n Handle people\n <i className=\"fa fa-caret-down\"></i>\n </button>\n <div className=\"dropdown-content\">\n <Link to={\"/employer/usersList\"}>Users List</Link>\n <Link to={\"/employer/employeeList\"}>Employee List</Link>\n <Link to={\"/employer/addEmployee\"}>Add employee</Link>\n </div>\n </div>\n </li>\n <li>\n <div className=\"dropdown\">\n <button className=\"dropbtn\">\n tests\n <i className=\"fa fa-caret-down\"></i>\n </button>\n <div className=\"dropdown-content\">\n <Link to={\"/employer/tests\"}>current tests</Link>\n <Link to={\"/employer/addTest\"}>add tests</Link>\n </div>\n </div>\n </li>\n <li>\n <div className=\"dropdown\">\n <button className=\"dropbtn\">\n transactions\n <i className=\"fa fa-caret-down\"></i>\n </button>\n <div className=\"dropdown-content\">\n <Link to={\"/employer/userTransactions\"}>user transactions</Link>\n <Link to={\"/employer/myTransactions\"}>my transactions</Link>\n\n </div>\n </div>\n </li>\n <li></li>\n <li>\n <Link to={\"/employer/charge\"}>charge credit</Link>\n </li>\n <li>\n <Link to={\"/employer/messages\"}>messages</Link>\n </li>\n <li></li>\n <li></li>\n <li onClick={() => this.props.logOut()}>\n <Link to={\"/\"}>Log Out</Link>\n </li>\n\n <li>\n <a href=\"javascript:void(0);\" className=\"icon\" onClick={this.navbarResponsive}>\n <i className=\"fa fa-bars\"></i>\n </a>\n </li>\n </ul>\n </nav>\n\n </div>\n </header>)\n }", "navToOverview() {\n\t\tthis.props.history.push(\"/overview\");\n\t}", "function App() {\n return (\n <Router>\n <main>\n <nav className=\"navigation\">\n <ul>\n <li>\n <NavLink className=\"main-nav\"\n activeStyle={{ color: '#BB7043'}} to=\"/\" exact>HOME \n </NavLink>\n </li>\n <li>\n <NavLink className=\"main-nav\"\n activeStyle={{ color: '#BB7043'}} to=\"/entertainment\">ENTERTAINMENT\n </NavLink>\n </li>\n <li>\n <NavLink className=\"main-nav\"\n activeStyle={{ color: '#BB7043'}} to=\"/shop\">SHOP\n </NavLink>\n </li>\n <li>\n <NavLink className=\"main-nav\"\n activeStyle={{ color: '#BB7043'}} to=\"/events\">EVENTS\n </NavLink>\n </li>\n <li>\n <NavLink className=\"main-nav\"\n activeStyle={{ color: '#BB7043'}} to=\"/contact\">CONTACT\n </NavLink>\n </li>\n </ul>\n </nav>\n <Switch>\n <Route path=\"/\" exact>\n <Home />\n </Route>\n <Route path=\"/entertainment\">\n <Entertainment />\n </Route>\n <Route path=\"/shop\">\n <Shop />\n </Route>\n <Route path=\"/events\">\n <Events />\n </Route>\n <Route path=\"/contact\">\n <Contact />\n </Route>\n </Switch>\n\n <Footer />\n </main>\n </Router>\n );\n}", "onRender () {\n let Navigation = new NavigationView();\n App.navigationRegion.show(Navigation);\n Navigation.setItemAsActive(\"home\");\n }", "function App() {\n \n return (\n <Router>\n <div>\n <nav>\n <ul>\n <li>\n <Link to=\"/home\">Home</Link>\n </li>\n <li>\n <Link to=\"/about\">About</Link>\n </li>\n <li>\n <Link to=\"/contact\">Contact</Link>\n </li>\n </ul>\n </nav>\n </div>\n\n <Switch>\n <Route exact path=\"/home\">\n <Home />\n </Route>\n <Route path=\"/about\">\n <About />\n </Route>\n <Route exact path=\"/contact\">\n <Contact />\n </Route>\n <Route path=\"/contact/detail-contact\">\n <DetailContact />\n </Route>\n </Switch>\n\n \n </Router>\n );\n}", "handleClick() {\n\t\tthis.props.changePage(\"aboutSplunk\");\n\t}", "navigateToTab(tabIndex) {\n this.props.navigator.handleDeepLink({\n link: 'tab/' + tabIndex\n });\n this.props.navigator.dismissModal({animationType: 'slide-down'});\n }", "function Home() {\n return (\n <>\n <Helmet>\n <title>Web App by Raul Vap</title>\n <meta\n name='description'\n content='Dtech Academy, desarrolla tus habilidades tecnológicas'\n data-react-helmet='true'\n />\n </Helmet>\n <MainBanner />\n <HomeCourses />\n <HowMyCoursesWork />\n <ReviewsCourses />\n {/* <Courses /> */}\n </>\n );\n}", "function App() {\n \n return (\n <div className=\"App\">\n <Header /> \n\n <Switch>\n <Route exact path='/'>\n <Main url={url}/> \n </Route>\n \n <Route path='/about' component= { About } >\n </Route>\n\n {/* <Route path='/projects' component={ Projects }>\n </Route> */}\n\n <Route path='/designer' component={ Designer }>\n </Route>\n\n <Route path='/contact' component={ Contact }>\n </Route>\n\n <Route path='/resume' component={ Resume }>\n </Route>\n\n <Route path='/articles' component={ Articles }>\n </Route> \n\n </Switch>\n {/* <Footer /> */}\n </div>\n );\n}", "function Nav() {\n return (\n <ul className=\"nav\">\n <li>\n <NavLink exact activeClassName=\"active\" to=\"/\">\n Home\n </NavLink>\n </li>\n <li>\n <NavLink activeClassName=\"active\" to=\"/battle\">\n Battle\n </NavLink>\n </li>\n <li>\n <NavLink activeClassName=\"active\" to=\"/popular\">\n Popular\n </NavLink>\n </li>\n </ul>\n );\n}", "renderProjs() {\n return (\n <div className=\"projs\">\n <PageHeader>All Projects</PageHeader>\n <Tabs defaultActiveKey={1} id=\"projtab\" >\n <Tab eventKey={1} title=\"All Projects\">\n <ListGroup>\n {this.renderProjsList(this.state.projs)}\n </ListGroup>\n </Tab>\n <Tab eventKey={2} title=\"Completed Projects\">\n <ListGroup>\n {this.renderCompProjsList(this.state.projs)}\n </ListGroup>\n </Tab>\n <Tab eventKey={3} title=\"Active Projects\">\n <ListGroup>\n {this.renderActiveProjsList(this.state.projs)}\n </ListGroup>\n </Tab>\n <Tab eventKey={4} title=\"Pending Projects\">\n <ListGroup>\n {this.renderPendingProjsList(this.state.projs)}\n </ListGroup>\n </Tab>\n </Tabs>\n </div>\n );\n }", "function App (){\n return (\n <main>\n <Header />\n <Switch>\n <Route exact path=\"/\" component={Main} exact />\n <Route exact path=\"/pageHistory\" component={PageHistory} />\n <Route exact path=\"/help\" component={Help} />\n </Switch>\n </main>\n)\n}", "function ContentTabs (props) {\n return (\n <Tabs defaultActiveKey={1} animation={false} id=\"noanim-tab-example\">\n <Tab eventKey={1} title=\"Register\">\n <div className=\"tabContent\">\n <Form\n page={props.page}\n name={props.name}\n email={props.email}\n regCode={props.regCode}\n status={props.status}\n comments={props.comments}\n guests={props.guests}\n onInputChange={props.onInputChange}\n addRegistrant={props.addRegistrant}\n updateState={props.updateState}\n addGuest={props.addGuest}\n handleGuests={props.handleGuests}\n removeGuest={props.removeGuest}\n />\n </div>\n </Tab>\n <Tab eventKey={2} title=\"Details\">\n <Detail \n temperatures={props.temperatures}\n accordion={props.accordion}\n changeBool={props.changeBool}\n google_api={props.google_api}\n months={props.months}\n days={props.days}\n hours={props.hours}\n mins={props.mins}\n secs={props.secs}\n counter={props.counter}\n />\n </Tab>\n <Tab eventKey={3} title=\"Travel\">\n <Travel \n google_api={props.google_api}\n changeBool={props.changeBool}\n updateState={props.updateState}\n accordionAir={props.accordionAir}\n accordionBus={props.accordionBus}\n accordionCar={props.accordionCar}\n accordionStay={props.accordionStay}\n counter={props.counter}\n />\n </Tab>\n <Tab eventKey={4} title=\"Plans\">\n <Plans \n accordionCity={props.accordionCity}\n accordionFall={props.accordionFall}\n accordionHalloween={props.accordionHalloween}\n changeBool={props.changeBool}\n />\n </Tab>\n </Tabs>\n );\n}", "function TabTwoNavigator() {\n return (\n <TabTwoStack.Navigator>\n <TabTwoStack.Screen\n name=\"SongAnalyserHome\"\n component={SongAnalyser}\n options={{ headerTitle: 'Song Analyser' }}\n />\n <TabTwoStack.Screen\n name=\"SearchSong\"\n component={SearchSong}\n options={{ headerTitle: 'Song Analyser' }}\n />\n <TabTwoStack.Screen\n name=\"SongResults\"\n component={SongResults}\n options={{ headerTitle: 'Song Analyser' }}\n />\n </TabTwoStack.Navigator>\n );\n}", "render() {\n return (\n <Router>\n <div className=\"App\">\n {/* navbar is a bootstrap component which has been imported */}\n <Navbar bg=\"dark\" variant=\"dark\">\n <Navbar.Brand href=\"#home\">Music</Navbar.Brand>\n <Nav className=\"mr-auto\">\n <Nav.Link href=\"/\">Home</Nav.Link>\n <Nav.Link href=\"/list\">Albums</Nav.Link>\n <Nav.Link href=\"/add\">Add</Nav.Link>\n </Nav>\n </Navbar>\n <br />\n <Switch>\n {/* these links just display a different component */}\n <Route path=\"/\" component={Home} exact />\n <Route path=\"/add\" component={Add} />\n <Route path=\"/list\" component={List} />\n <Route path=\"/alter/:id\" component={Alter} />\n </Switch>\n </div>\n </Router>\n );\n }", "function Nav() {\n return (\n <nav className=\"nav row\" style={styles.navStyles}>\n <Link to=\"/ourstory\" style={styles.linkStyles}>\n <p>Our Story</p>\n </Link>\n <Link to=\"/location\" style={styles.linkStyles}>\n <p>Location</p>\n </Link>\n <Link to=\"/weddingparty\" style={styles.linkStyles}>\n <p>Wedding Party</p>\n </Link>\n <Link to=\"/photosofus\" style={styles.linkStyles}>\n <p>Photos of Us</p>\n </Link>\n <Link to=\"/covidq-a\" style={styles.linkStyles}>\n <p>COVID and Q & A </p>\n </Link>\n {/* <Link to=\"/registry\" style={styles.linkStyles}>\n <p>Registry</p>\n </Link> */}\n <Link to=\"/rsvp\" style={styles.linkStyles}>\n <p>RSVP</p>\n </Link>\n </nav>\n )\n}", "function Links(props) {\n return (\n <nav style={styles.nav}>\n <ul style={styles.item}>\n {/* <li onClick={() => props.scrollToBottom()} style={styles.link}>\n <img src={Email_Icon} style={styles.image} alt=\"email_icon\" />\n <p style={styles.text}>Email</p>\n </li> */}\n <li>\n <a\n href=\"https://www.linkedin.com/in/seanvilaysane/\"\n style={styles.link}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <img src={LinkedIn_Icon} style={styles.image} alt=\"linkedin_icon\" />\n <p style={styles.text}>LinkedIn</p>\n </a>\n </li>\n <li>\n <a\n href=\"https://github.com/sutthirath\"\n style={styles.link}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <img src={Github_Icon} style={styles.image} alt=\"github_icon\" />\n <p style={styles.text}>Github</p>\n </a>\n </li>\n {/* <li\n href={Resume}\n download=\"SutthirathSeanVilaysane\"\n style={styles.link}\n >\n <img src={Resume_Icon} style={styles.image} alt=\"resume_icon\" />\n <p style={styles.text}>Resume</p>\n </li> */}\n </ul>\n </nav>\n );\n}" ]
[ "0.70132256", "0.66482043", "0.63314754", "0.63214475", "0.6297563", "0.6234316", "0.6162473", "0.61617774", "0.6129372", "0.606334", "0.6059632", "0.6044198", "0.59987694", "0.5944048", "0.5923726", "0.58679473", "0.58668506", "0.58446765", "0.5799544", "0.57880574", "0.57877934", "0.5752579", "0.5748793", "0.57266784", "0.57110816", "0.5704802", "0.56894094", "0.5675071", "0.56496096", "0.56441873", "0.5624769", "0.56200975", "0.56169504", "0.5616865", "0.56165224", "0.56134653", "0.5601022", "0.5593653", "0.5589558", "0.55783844", "0.5575532", "0.5573418", "0.5565452", "0.55564207", "0.55544466", "0.55350673", "0.5525845", "0.5515782", "0.5507681", "0.5497373", "0.54866457", "0.5477476", "0.5474433", "0.54716635", "0.5463259", "0.54554635", "0.5448931", "0.5448688", "0.54367864", "0.5433373", "0.54313385", "0.54212284", "0.5420946", "0.5414562", "0.5406418", "0.53959143", "0.5380133", "0.53772944", "0.53760153", "0.5367257", "0.5350905", "0.53488183", "0.53413737", "0.53411734", "0.5331508", "0.5329832", "0.5329676", "0.5329039", "0.5325817", "0.5323417", "0.5321235", "0.5316895", "0.5316225", "0.53138554", "0.5308012", "0.53071314", "0.53021675", "0.53021383", "0.5302103", "0.5292993", "0.52924484", "0.52900493", "0.527718", "0.52725166", "0.5271646", "0.5269042", "0.52644885", "0.526408", "0.5256393", "0.525413" ]
0.688706
1
saveTestDriveInfo(null, name, company, phone,address,payment_type, car_name,car_company ,car_version,car_color, hopeTime, null,
function createTestDrive(testDrive){ var item = $('<div/>', { class: 'col-md-12 col-sm-12 col-xs-12 col-lg-12' }).appendTo($('#content')); item.css('width', '100%'); item.css('margin-top', '1%'); var titleName = $('<div/>', { class: 'col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item); titleName.html("姓名: ") var name = $('<input/>', { type: 'text', value: testDrive.name, class: 'col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item); var titlePhone = $('<div/>', { class: 'col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item); titlePhone.html("電話: ") var phone = $('<input/>', { type: 'text', value: testDrive.phone, class: 'col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item); var titleCompany = $('<div/>', { class: 'col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item); titleCompany.html("公司&機構: ") var company = $('<input/>', { type: 'text', value: testDrive.company, class: 'col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item); var titleCarCompany = $('<div/>', { class: 'col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item); titleCarCompany.html("車廠: ") var carCompany = $('<input/>', { type: 'text', value: testDrive.car_company, class: 'col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item); var titleCarName = $('<div/>', { class: 'col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item); titleCarName.html("車型: ") var carName = $('<input/>', { type: 'text', value: testDrive.car_name, class: 'col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item); var titleColor = $('<div/>', { class: 'col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item); titleColor.html("車色: ") var color = $('<input/>', { type: 'text', value: testDrive.car_color, class: 'col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item); // paymentType.append($("<option></option>").attr("value", "刷卡").text("刷卡")); var item2 = $('<div/>', { class: 'col-md-12 col-sm-12 col-xs-12 col-lg-12' }).appendTo($('#content')); item2.css('width', '100%'); item2.css('margin-top', '1%'); var titlePaymentType = $('<div/>', { class: 'col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item2); titlePaymentType.html("付款方式: ") var paymentType = $('<select/>', { class: 'col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item2); for(var j=0;j<paymentTypeValue.length;j++){ paymentType.append($("<option></option>").attr("value", paymentTypeValue[j]).text(paymentTypeValue[j])); if(paymentTypeValue[j] == testDrive.payment_type){ paymentType.val(paymentTypeValue[j]); // paymentType.attr(paymentTypeValue[j],true); } } var titleAddress = $('<div/>', { class: 'col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item2); titleAddress.html("地址: ") var address = $('<input/>', { type: 'text', value: testDrive.address, class: 'col-md-3 col-sm-3 col-xs-3 col-lg-3' }).appendTo(item2); var titleHopeTime = $('<div/>', { class: 'col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item2); titleHopeTime.html("試乘時間: ") var hopeTime = $('<input/>', { type: 'text', value: testDrive.hopeTime, class: 'col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item2); var titleStatus = $('<div/>', { class: 'col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item2); titleStatus.html("狀態: ") let orderReceive = 'receive'; let orderPending = 'pending'; let orderFailure = 'failure'; let orderSuccess = 'success'; var status = $('<select/>', { class: 'col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item2); for(var j=0;j<statusValue.length;j++){ status.append($("<option></option>").attr("value", statusValue[j]).text(statusValue[j])); if(statusValue[j] == testDrive.status){ status.val(statusValue[j]); // status.attr(statusValue[j],true); } } // status.append($("<option></option>").attr("value", "receive").text("receive")); // status.append($("<option></option>").attr("value", "pending").text("pending")); // status.append($("<option></option>").attr("value", "failure").text("failure")); // status.append($("<option></option>").attr("value", "success").text("success")); var change = $('<button/>', { class: 'btn btn-success col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item2); change.html("修改") var remove = $('<button/>', { id: testDrive._id, class: 'btn btn-danger col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item2); remove.html("刪除") setChangeClick(change, testDrive._id, name, phone, company,carCompany, carName, color, paymentType,address,hopeTime,status) setRemoveClick(remove, testDrive._id) // setAddClick(add, name, company, color, price, special_price, description) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createTestDrive()\n {\n console.log('Inside createTestDrive');\n createTestDriveSF({data:JSON.stringify(this.testDriveData)})\n .then(result1 =>{\n console.log('Inside result');\n if(result1.code===200)\n {\n\n this.testDriveId=result1.createdId;\n if(this.testDriveType==='C')\n {\n this.save();\n }\n this.loadSpinner=false;\n this.tostMessage(result1.message,result1.code,result1.status,result1.createdId);\n }\n else{\n this.loadSpinner=false;\n this.tostMessage(UI_Error_Message,result1.code,result1.status,this.recordId);\n }\n \n })\n .catch(error => {\n this.loadSpinner=false;\n this.error = error;\n this.tostMessage(UI_Error_Message,0,'Error','');\n });\n }", "function saveVehicle() {\n\n let type = \"\"\n let fuelType = \"\"\n let transmission = \"\"\n\n if ($(\"#chkPetrol\").is(\":checked\")) fuelType = \"petrol\"\n else if ($(\"#chkDiesal\").is(\":checked\")) fuelType = \"diesel\"\n\n if ($(\"#chkLuxury\").is(\":checked\")) type = \"luxury\"\n else if ($(\"#chkPremium\").is(\":checked\")) type = \"premium\"\n else if ($(\"#chkGeneral\").is(\":checked\")) type = \"general\"\n\n if ($(\"#chkGear\").is(\":checked\")) transmission = \"gear\"\n else if ($(\"#chkManual\").is(\":checked\")) transmission = \"manual\"\n\n const data = {\n \"vehicleNumber\": $(\"#inptVehicleNumber\").val(),\n \"vehicleCount\": 1,\n \"type\": type,\n \"fuelType\": fuelType,\n \"damageWaiver\": $(\"#inptDamagewaiver\").val(),\n \"freeMileageForMonth\": $(\"#inptFreeMilgForMonth\").val(),\n \"freeMileageForDay\": $(\"#inptFreeMilgForDay\").val(),\n \"monthlyRental\": $(\"#inptMonthlyRental\").val(),\n \"dailyRental\": $(\"#inptDailyRental\").val(),\n \"excessForMonth\": $(\"#inptExcessAmount\").val(),\n \"numberOfPassengers\": $(\"#inptNumberOfPasseneger\").val(),\n \"brandName\": $(\"#inptBrandName\").val(),\n \"frontImg\": \"asdasd\",\n \"backImg\": \"adasd\",\n \"leftImg\": \"adasd\",\n \"rightImg\": \"asdasdas\",\n \"transmission\": transmission,\n \"color\": $(\"#inptColor\").val(),\n \"vehicleStatus\": \"open\"\n }\n\n addNewVehicleOrUpdate(data)\n loadAllVehicleCountData()\n}", "static save(CarTracker) {\n return firestore.collection(collectionPath).doc(CarTracker.id).set({\n manufacturer: CarTracker.manufacturer,\n isDriving: CarTracker.isDriving,\n lastLocation: JSON.parse(JSON.stringify(CarTracker.lastLocation)),\n metersDriven: 0\n }).then(function () {\n broadcastMessage(\"added\");\n });\n }", "function saveCar(req, res){\n\t/*\n\tCreate a new car\n\t */\n\tvar newCar = new carModel.Car({\n\t\tplate: req.body.plate,\n\t\tcolor: req.body.color\t\t\n\t});\n\n\tnewCar.save(function(err, car){\n\t\tconsole.log(\"Inserted\" + car.plate);\n\t});\n\n\tconsole.log(\"SSS\" + req.body.plate);\n}", "function setDriverDetails(_licenseNo,_vehicleType,_experience) {\n\n return cryptoZombies.methods.setDriverDetails(_licenseNo,_vehicleType,_experience).send({from: account})\n .on(\"receipt\", function(receipt) {\n console.log(\"Successfully inserted Driver Details\");\n })\n .on(\"error\", function(error) {\n console.log(error);\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 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 changeVolInfo (name, address, email, phone, availability, activities){\n jCooper.volunteerInfo = (name + address + email + phone + availability + activities);\n console.log(jCooper.volunteerInfo); \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 saveOwnedcar(ownedcar) {\n if (ownedcar.primaryKey === \"\") {\n ownedcar.primaryKey = getNextOwnedcarKey();\n\n ownedcarsRootScope.ownedcarsData.push(jQuery.extend({}, ownedcar));\n\n } else {\n var oldOwnedcar = findOwnedcarByKey(ownedcar.primaryKey);\n oldOwnedcar.carId = ownedcar.carId;\n oldOwnedcar.colour = ownedcar.colour;\n oldOwnedcar.maxPower = ownedcar.maxPower;\n oldOwnedcar.powerLevel = ownedcar.powerLevel;\n oldOwnedcar.weightReductonLevel = ownedcar.weightReductonLevel;\n oldOwnedcar.dateAcquired = ownedcar.dateAcquired;\n }\n}", "function createVehicle(vehicle){\r\n\t\t\t \tVehicleService.createVehicle(vehicle)\r\n\t\t\t .then(\r\n\t\t\t \t\tfunction () {\r\n\t\t\t fetchAllVehicles();\r\n\t\t\t self.message = vehicle.vehicle_regno+\" vehicle reg no created..!\";\r\n\t\t\t \t\t\tsuccessAnimate('.success'); \t\t\t\r\n\t\t\t \t\t},\r\n\t\t\t \r\n\t\t\t function (errResponse) {\r\n\t\t\t /*console.error('Error while creating vehicle' + vehicle.vehicle_regno);*/\r\n\t\t\t }\r\n\t\t\t );\r\n\t\t\t }", "function Save() \n{\n /* var savearr = [holdname, playerlvl, health, mana, gold, savecoord];\n var savedata = JSON.stringify(savearr);*/\n savedatasw = 1;\n playerinfo.playername=playername;\n playerinfo.playerlvl=playerlvl;\n playerinfo.health=health;\n playerinfo.mana=mana;\n playerinfo.gold=gold;\n playerinfo.savecoord=savecoord;\n playerinfo.savedatasw=savedatasw;\n \n fs.writeFileSync(\"save.json\", JSON.stringify(playerinfo));\n \n return;\n}", "save() { \n console.log('Inside Save');\n console.log(this.testDriveId);\n if(this.padTOuched===true){\n this.showspinner = true;\n let pad = this.template.querySelector('[data-id=\"can\"]');\n let dataURL = pad.toDataURL();\n let strDataURI = dataURL.replace(/^data:image\\/(png|jpg);base64,/, \"\");\n console.log('Inside Save 1');\n console.log(strDataURI);\n console.log(this.testDriveId);\n //Calling server side action and passing base64 of signature and parent record Id to the server side method\n saveSignatureMethod({\n signatureBody: strDataURI,\n recordId: this.testDriveId\n })\n //Show toast message \n .then(() => {\n this.showspinner = false;\n this.dispatchEvent(\n new ShowToastEvent({\n title: 'SUCCESS',\n message: 'Signature registered successfully',\n variant: 'SUCCESS'\n })\n )\n })\n //after show toast message close quick action\n \n .then(() => {\n this.dispatchEvent(new CustomEvent('close'));\n this.showspinner = false;\n \n })\n \n //Catch error \n .catch(error => {\n this.dispatchEvent(\n new ShowToastEvent({\n title: 'Error on signature save',\n message: error.message.body,\n variant: 'error'\n })\n )\n })\n }else{\n this.dispatchEvent(\n new ShowToastEvent({\n title: 'Error:',\n message: 'Please add signature',\n variant: 'error'\n })\n )\n }\n }", "function saveData(data, classification, token)\n{\n\t// These lines will check what values are already logged on this drive and insert entries accordingly\n\tif (classification == DATE)\n\t{\n\t\tdata[\"Date\"] += token\n\t}\n\telse if (classification == TIME)\n\t{\n\t\tif (data[\"StartTime\"] == \"\")\n\t\t\tdata[\"StartTime\"] += token\n\t\telse if (data[\"EndTime\"] == \"\")\n\t\t\tdata[\"EndTime\"] += token\n\t}\n\telse if (classification == ODOMETER)\n\t{\n\t\tif (data[\"EndOdometer\"] == \"\")\n\t\t\tdata[\"EndOdometer\"] += token\n\t\telse if (data[\"StartOdometer\"] == \"\")\n\t\t{\n\t\t\tif (parseInt(token) > parseInt(data[\"EndOdometer\"]))\n\t\t\t{\n\t\t\t\tdata[\"StartOdometer\"] = data[\"EndOdometer\"]\n\t\t\t\tdata[\"EndOdometer\"] = token\n\t\t\t}\n\t\t\telse\n\t\t\t\tdata[\"StartOdometer\"] += token\n\t\t}\n\t}\n\telse if (classification == LOCATION)\n\t{\n\t\tdata[\"Destination\"] += token + \" \"\n\t}\n\telse if (classification == (DATE | TIME))\n\t{\n\t\tdata[\"DateOrTimeIsAmbiguous\"] = true\n\t\tif (data[\"StartTime\"] == \"\")\n\t\t\tdata[\"StartTime\"] += token\n\t\telse if (data[\"EndTime\"] == \"\")\n\t\t\tdata[\"EndTime\"] += token\n\t\telse if (data[\"StartOdometer\"] == \"\")\n\t\t\tdata[\"StartOdometer\"] += token\n\t\telse if (data[\"EndOdometer\"] == \"\")\n\t\t\tdata[\"EndOdometer\"] += token\n\n\t}\n}", "function saveJobCard() {\n retrieveValues();\n saveToServer();\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}", "saveExtra() { \n }", "async function createCar(){\n\n\nconst car = new Car({\n company: 'BMW', \n model: 'X7',\n price: 6000,\n year: 2024, \n sold: true,\n extras: ['4*4', 'Automatic'],\n //no hace falta poner la fecha\n})\n//Guardar Documento car en Base de Datos\n//Dentro de mongosee nos encontramos la operación\n//save para guardar un documento en la \n//base de datos.\nconst result = await car.save();\n\nconsole.log(result)\n}", "save() {}", "async function testGetGuideImage_savesFile() {\n}", "function addCar({ carName, carMake, carModel, carYear, carMPG, carPrice, owner }) {\n console.log(` Defining car: ${carYear} ${carMake} ${carModel}`);\n UserVehicles.collection.insert({ carName, carMake, carModel, carYear, carMPG, carPrice, owner });\n}", "save() {\r\n return Backendless.Data.of(DiningTiming).save(this);\r\n }", "saveBook(title, author, image, link, description){\n var newBook = {\n title: title,\n author: author,\n description: description,\n image: image,\n link: link\n };\n API.saveBook(newBook)\n .then(\n alert(\"Book saved!\")\n )\n .catch(err => console.log(err));\n }", "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}", "function saveInfo(data, uploadedDate) {\r\n return new Promise((resolve, reject) => {\r\n let query = 'INSERT INTO ' + table.MAIL_DASHBOARD + '(country, first_name, last_name, email, language, date, uploaded_date) VALUES (?, ?, ?, ?, ?, ?, ?)'\r\n\r\n db.query(query, [data.UserCountry, data.FirstName, data.LastName, data.Email, data.TestLanguage, data.CreatedDate, uploadedDate], (error, result, fields) => {\r\n if (error) {\r\n resolve(false)\r\n } else {\r\n resolve(true)\r\n }\r\n })\r\n }) \r\n}", "save() {\n }", "function file_save(file, callback) {\n var method = 'file.save';\n var timestamp = get_timestamp();\n var nonce = get_nonce();\n \n // Generating hash according to ServicesAPI Key method\n hash = get_hash(key, timestamp, domain, nonce, method);\n \n var file_content = json_encode(file);\n \n //array to pass all parameters\n var params = new Array(hash, domain, timestamp, nonce, file);\n \n var xhr = Titanium.Network.createHTTPClient();\n xhr.open(\"POST\",url);\n xhr.onload = callback;\n \n Titanium.API.info(\"xmlrpc: xml: \"+xml);\n xhr.send(xml);\n Titanium.API.info(\"xmlrpc: end\");\n}", "async CreateAsset(ctx, id, laborname, firstname, lastname,birthdate, location, dateandtime, result ) {\r\n const exists = await this.AssetExists(ctx, id);\r\n if (exists) {\r\n throw new Error(`The asset ${id} already exists`);\r\n }\r\n\r\n \r\n\t\tlet testedPersonObject = new TestedPerson( id,firstname,lastname, birthdate\r\n\t\t\r\n\t\t ,laborname,location,dateandtime,result);\r\n\t\t\t\t\t\t\t\t\t\t\t\t \r\n\t\ttestedPersonObject.docType = 'testedPerson';\t\t\t\t\t\t\t\t\t\t \r\n\t\t\r\n await ctx.stub.putState(id, Buffer.from(JSON.stringify(testedPersonObject)));\r\n return JSON.stringify(testedPersonObject);\r\n }", "save() {\n this._cloudObj.save({\n success: (obj) => {\n console.log(\"saved ingredient: \" + this._cloudObj.get(\"name\"))\n },\n error: (err) => {\n console.log(err);\n }\n });\n }", "function savefile(paramsubsidi, paraminshead){\r\n\t// Valida si es OneWorld\r\n\tvar featuresubs = nlapiGetContext().getFeature('SUBSIDIARIES');\r\n\r\n\t// Ruta de la carpeta contenedora\r\n\tvar FolderId = nlapiGetContext().getSetting('SCRIPT', 'custscript_lmry_pe_2016_rg_file_cabinet');\r\n\r\n\t// Almacena en la carpeta de Archivos Generados\r\n\tif (FolderId!='' && FolderId!=null) {\r\n\t\t// Extension del archivo\r\n\t\tvar fileext = '.txt';\r\n\t\tif ( paraminshead=='T' ) \r\n\t\t{\r\n\t\t\tfileext = '.csv';\r\n\t\t\t\r\n\t\t\t// Reemplaza la coma por blank space\r\n\t\t\tstrName1 = strName1.replace(/[,]/gi,' ');\r\n\t\t\t// Reemplaza la pipe por coma\r\n\t\t\tstrName1 = strName1.replace(/[|]/gi,',');\r\n\t\t\tif(strName2!=''){\r\n\t\t\t\t// Reemplaza la coma por blank space\r\n\t\t\t\tstrName2 = strName2.replace(/[,]/gi,' ');\r\n\t\t\t\t// Reemplaza la pipe por coma\r\n\t\t\t\tstrName2 = strName2.replace(/[|]/gi,',');\r\n\t\t\t}\r\n\t\t\tif(strName3!=''){\r\n\t\t\t\t// Reemplaza la coma por blank space\r\n\t\t\t\tstrName3 = strName3.replace(/[,]/gi,' ');\r\n\t\t\t\t// Reemplaza la pipe por coma\r\n\t\t\t\tstrName3 = strName3.replace(/[|]/gi,',');\r\n\t\t\t}\r\n\t\t\tif(strName4!=''){\r\n\t\t\t\t// Reemplaza la coma por blank space\r\n\t\t\t\tstrName4 = strName4.replace(/[,]/gi,' ');\r\n\t\t\t\t// Reemplaza la pipe por coma\r\n\t\t\t\tstrName4 = strName4.replace(/[|]/gi,',');\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Genera el nombre del archivo\r\n\t\tvar FileName = Name_File(paramsubsidi);\r\n\t\tvar NameFile = FileName + '(1)' + fileext;\r\n\t\tvar NameFile2 = FileName + '(2)' + fileext;\r\n\t\tvar NameFile3 = FileName + '(3)' + fileext;\r\n\t\tvar NameFile4 = FileName + '(4)' + fileext;\r\n\t\t\r\n\t\t// Crea el archivo\r\n\t\tvar File = nlapiCreateFile(NameFile, 'PLAINTEXT', strName1);\t\r\n\t\t\tFile.setFolder(FolderId);\r\n\t\t// Termina de grabar el archivo\r\n\t\tvar idfile = nlapiSubmitFile(File);\r\n\t\t// Trae URL de archivo generado\r\n\t\tvar idfile2 = nlapiLoadFile(idfile);\r\n\t\r\n\t\t// Segundo archivo generado\r\n\t\tif(strName2!=''){\r\n\t\t\tvar File2 = nlapiCreateFile(NameFile2, 'PLAINTEXT', strName2);\t\r\n\t\t\t \tFile2.setFolder(FolderId);\r\n\t\t\t// Termina de grabar el archivo\r\n\t\t\tvar idfile_2 = nlapiSubmitFile(File2);\r\n\t\t\t// Trae URL de archivo generado\r\n\t\t\tvar idfile2_2 = nlapiLoadFile(idfile_2);\r\n\t\t}\r\n\t\t\r\n\t\t// Tercer archivo generado\r\n\t\tif(strName3!=''){\r\n\t\t\tvar File3 = nlapiCreateFile(NameFile3, 'PLAINTEXT', strName3);\t\r\n\t\t\t\tFile3.setFolder(FolderId);\r\n\t\t\t// Termina de grabar el archivo\r\n\t\t\tvar idfile_3 = nlapiSubmitFile(File3);\r\n\t\t\t// Trae URL de archivo generado\r\n\t\t\tvar idfile2_3 = nlapiLoadFile(idfile_3);\r\n\t\t}\t\t\t\r\n\t\t\t\r\n\t\t// Cuarto archivo generado\r\n\t\tif(strName4!=''){\r\n\t\t\tvar File4 = nlapiCreateFile(NameFile4, 'PLAINTEXT', strName4);\t\r\n\t\t\t\tFile4.setFolder(FolderId);\r\n\t\t\t// Termina de grabar el archivo\r\n\t\t\tvar idfile_4 = nlapiSubmitFile(File4);\r\n\t\t\t// Trae URL de archivo generado\r\n\t\t\tvar idfile2_4 = nlapiLoadFile(idfile_4);\r\n\t\t}\t\t\t\r\n\r\n\t\tvar urlfile = '';\r\n\t\tvar urlfile_2 = '';\r\n\t\tvar urlfile_3 = '';\r\n\t\tvar urlfile_4 = '';\r\n\r\n\t\t// Obtenemo de las prefencias generales el URL de Netsuite (Produccion o Sandbox)\r\n\t\tvar getURL = objContext.getSetting('SCRIPT', 'custscript_lmry_netsuite_location');\r\n\t\tif (getURL!='' && getURL!=''){\r\n\t\t\turlfile = 'https://' + getURL;\r\n\t\t\turlfile_2 = 'https://' + getURL;\r\n\t\t\turlfile_3 = 'https://' + getURL;\r\n\t\t\turlfile_4 = 'https://' + getURL;\r\n\t\t}\r\n\r\n\t\t// Asigna el URL al link del log de archivos generados\r\n\t\turlfile += idfile2.getURL();\r\n\t\tif(strName2!=''){\r\n\t\t\turlfile_2 += idfile2_2.getURL();\r\n\t\t}\r\n\t\tif(strName3!=''){\r\n\t\t\turlfile_3 += idfile2_3.getURL();\r\n\t\t}\r\n\t\tif(strName4!=''){\r\n\t\t\turlfile_4 += idfile2_4.getURL();\r\n\t\t}\r\n\t\t\r\n\t\t//Genera registro personalizado como log\r\n\t\tif(idfile) {\r\n\t\t\tvar usuario = objContext.getName();\r\n\t\t\tvar subsidi = '';\r\n\t\t\t// Valida si es OneWorld \r\n\t\t\tif (featuresubs == false){\r\n\t\t\t\tvar company = nlapiLoadConfiguration('companyinformation'); \r\n\t\t\t\tvar\tnamecom = company.getFieldValue('companyname');\r\n\t\t\t\t\tcompany = null;\r\n\t\t\t\tsubsidi = namecom;\r\n\t\t\t}else{\r\n\t\t\t\tif (paramsubsidi!=null && paramsubsidi!='') {\r\n\t\t\t\t\tsubsidi = nlapiLookupField('subsidiary', paramsubsidi, 'legalname');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar tmdate = new Date();\r\n\t\t var myDate = nlapiDateToString(tmdate);\r\n\t\t var myTime = nlapiDateToString(tmdate, 'timeofday'); \r\n\t\t var current_date = myDate + ' ' + myTime;\r\n\t\t var myfile = NameFile;\r\n\t\t \r\n\t\t var record = nlapiLoadRecord('customrecord_lmry_pe_2016_rpt_genera_log', parainternal);\r\n\t\t\t\trecord.setFieldValue('custrecord_lmry_pe_2016_rg_name', NameFile);\r\n\t\t\t\trecord.setFieldValue('custrecord_lmry_pe_2016_rg_transaction', 'Registro de Ventas Electronico 2016');\r\n\t\t\t\trecord.setFieldValue('custrecord_lmry_pe_2016_rg_postingperiod', periodname);\r\n\t\t\t\tif (subsidi!='' && subsidi!=null){\r\n\t\t\t\t\trecord.setFieldValue('custrecord_lmry_pe_2016_rg_subsidiary', subsidi);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tsubsidi = record.getFieldValue('custrecord_lmry_pe_2016_rg_subsidiary');\r\n\t\t\t\t}\r\n\t\t\t\trecord.setFieldValue('custrecord_lmry_pe_2016_rg_url_file', urlfile);\r\n\t\t\t\trecord.setFieldValue('custrecord_lmry_pe_2016_rg_employee', usuario);\r\n\t\t\tnlapiSubmitRecord(record, true);\r\n\t\t\t\r\n\t\t\tif(strName2!=''){\r\n\t\t\t\tvar record2 = nlapiCreateRecord('customrecord_lmry_pe_2016_rpt_genera_log');\r\n\t\t\t\t\trecord2.setFieldValue('custrecord_lmry_pe_2016_rg_name', NameFile2);\r\n\t\t\t\t\trecord2.setFieldValue('custrecord_lmry_pe_2016_rg_transaction', 'Registro de Ventas Electronico 2016');\r\n\t\t\t\t\trecord2.setFieldValue('custrecord_lmry_pe_2016_rg_postingperiod', periodname);\r\n\t\t\t\t\trecord2.setFieldValue('custrecord_lmry_pe_2016_rg_subsidiary', subsidi);\r\n\t\t\t\t\trecord2.setFieldValue('custrecord_lmry_pe_2016_rg_url_file', urlfile_2);\r\n\t\t\t\t\trecord2.setFieldValue('custrecord_lmry_pe_2016_rg_employee', usuario);\r\n\t\t\t\tnlapiSubmitRecord(record2, true);\r\n\t\t\t\t\r\n\t\t\t\tmyfile = myfile + '\\n\\r' + NameFile2;\r\n\t\t\t}\r\n\t\t\tif(strName3!=''){\r\n\t\t\t\tvar record3 = nlapiCreateRecord('customrecord_lmry_pe_2016_rpt_genera_log');\r\n\t\t\t\t\trecord3.setFieldValue('custrecord_lmry_pe_2016_rg_name', NameFile3);\r\n\t\t\t\t\trecord3.setFieldValue('custrecord_lmry_pe_2016_rg_transaction', 'Registro de Ventas Electronico 2016');\r\n\t\t\t\t\trecord3.setFieldValue('custrecord_lmry_pe_2016_rg_postingperiod', periodname);\r\n\t\t\t\t\trecord3.setFieldValue('custrecord_lmry_pe_2016_rg_subsidiary', subsidi);\r\n\t\t\t\t\trecord3.setFieldValue('custrecord_lmry_pe_2016_rg_url_file', urlfile_3);\r\n\t\t\t\t\trecord3.setFieldValue('custrecord_lmry_pe_2016_rg_employee', usuario);\r\n\t\t\t\tnlapiSubmitRecord(record3, true);\r\n\t\t\t\t\r\n\t\t\t\tmyfile = myfile + '\\n\\r' + NameFile3;\r\n\t\t\t}\r\n\t\t\tif(strName4!=''){\r\n\t\t\t\tvar record4 = nlapiCreateRecord('customrecord_lmry_pe_2016_rpt_genera_log');\r\n\t\t\t\t\trecord4.setFieldValue('custrecord_lmry_pe_2016_rg_name', NameFile4);\r\n\t\t\t\t\trecord4.setFieldValue('custrecord_lmry_pe_2016_rg_transaction', 'Registro de Ventas Electronico 2016');\r\n\t\t\t\t\trecord4.setFieldValue('custrecord_lmry_pe_2016_rg_postingperiod', periodname);\r\n\t\t\t\t\trecord4.setFieldValue('custrecord_lmry_pe_2016_rg_subsidiary', subsidi);\r\n\t\t\t\t\trecord4.setFieldValue('custrecord_lmry_pe_2016_rg_url_file', urlfile_4);\r\n\t\t\t\t\trecord4.setFieldValue('custrecord_lmry_pe_2016_rg_employee', usuario);\r\n\t\t\t\tnlapiSubmitRecord(record4, true);\r\n\t\t\t\t\r\n\t\t\t\tmyfile = myfile + '\\n\\r' + NameFile4;\r\n\t\t\t}\r\n\r\n\t\t\t// Envia mail de conformidad al usuario\r\n\t\t\tsendrptuser('PE - Registro de Ventas', 3, myfile);\r\n\t\t}\r\n\t} else {\r\n\t\t// Debug\r\n\t\tnlapiLogExecution('ERROR', 'Creacion de PDF', 'No existe el folder');\r\n\t}\r\n}", "function WriteDB(the_record){\n connection.query('select count(id) from record', function (error, results, fields) {\n if (error) throw error\n var num = results[0]['count(id)'];\n var t1 = new Date();\n var time = t1.getFullYear() * 10000 + (t1.getMonth()+1)*100 + t1.getDate();\n\n connection.query(`INSERT INTO record(lineId, id, time) VALUES (\"${the_record.id}\", ${num}, ${time});`);\n connection.query(`INSERT INTO location(id, lat, lng, statu, address) VALUES (${num}, ${the_record.lat}, ${the_record.lon}, '0', '${the_record.address}');`);\n UploadFolder(oAuth2Client, num.toString(), num, the_record);\n })\n}", "function _saveDataToFile(data){\n\n}", "function saveCard() {\n\n // 2-1 return early if either of the required fields are empty\n if (!this.name || !this.note) {\n return\n }\n\n // 2-2 Create the payload object as stated in Airtable's api documentation\n const payload = {\n fields: {\n Name: this.name,\n Notes: this.note,\n Memorized: false, // Not necessary, but I like to be explicit\n Attachments: []\n }\n }\n\n // 2-3 Send the data\n axios.post(`https://api.airtable.com/v0/appgyWdA8yP0KXZr4/My%20Study%20Cards?api_key=${airtableKey}`, payload)\n .then((resp) => {\n\n if (resp.status === 200 && resp.data.id) {\n\n // 2-4 If we're successful, update the studyCards array\n this.studyCards.push(resp.data)\n\n // 2-5 Clear the form so we can create another task if we want.\n this.clearForm()\n\n } else {\n console.error('Unable to save card.', payload)\n }\n })\n}", "function calibration_save_current()\n{\n inc_busy();\n var selBox = document.getElementById(\"CalibrationFileList\");\n fileName = selBox.options[selBox.selectedIndex].value;\n var nameBox = document.getElementById(\"calibration_current_name\");\n var notesBox = document.getElementById(\"calibration_current_description\");\n var cameraBox = document.getElementById(\"calibration_current_camera\");\n var laserAngleBox = document.getElementById(\"calibration_current_angle\");\n var laserDistanceBox = document.getElementById(\"calibration_current_distance\");\n var pointsBox = document.getElementById(\"calibration_current_points\"); \n\n var toSend = \"[header]\\n\";\n toSend+=\"name = \"+nameBox.value+\"\\n\";\n toSend+=\"notes = \"+notesBox.value+\"\\n\";\n toSend+=\"camera = \"+cameraBox.value+\"\\n\";\n toSend+=\"laser-camera-distance = \"+laserDistanceBox.value+\"\\n\";\n toSend+=\"laser-camera-angle = \"+laserAngleBox.value+\"\\n\";\n toSend+=\"\\n[data]\\n\";\n\n for (var i=0; i < pointsBox.length; i++)\n {\n toSend += pointsBox.options[i].text + \"\\n\";\n }\n\n result = callback_post(\"/API/Calibration.save?file=\"+fileName, toSend)\n alert(result);\n dec_busy();\n}", "save(data){\nreturn this.post(Config.API_URL + Constant.REFFERAL_SAVE, data);\n}", "save(data){\nreturn this.post(Config.API_URL + Constant.AGENT_SAVE, data);\n}", "saveFile(addressData)\n {\n fs.writeFileSync('address.json',JSON.stringify(addressData))\n console.log(\"Data saved sucessfully...\")\n }", "saveAgentRefferal(data){\nreturn this.post(Config.API_URL + Constant.AGENT_SAVEAGENTREFFERAL, data);\n}", "saveCloud() {\n if (this.saveView.inputCloudStorage.value != Utilitary.currentScene.sceneName && !Scene.rename(this.saveView.inputCloudStorage, this.saveView.rulesName, this.saveView.dynamicName)) {\n }\n else {\n var name = this.saveView.inputCloudStorage.value;\n if (this.isFileCloudExisting(name)) {\n new Confirm(Utilitary.messageRessource.confirmReplace, (confirmCallback) => { this.replaceCloud(name, confirmCallback); });\n return;\n }\n else {\n var jsonScene = this.sceneCurrent.saveScene(true);\n var blob = new Blob([jsonScene], { type: \"application/json;charset=utf-8;\" });\n this.drive.tempBlob = blob;\n this.drive.createFile(Utilitary.currentScene.sceneName, null);\n }\n }\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 }", "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 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 saveSubmit(callback) {\n LIMSService.Entrusted.UpdateStatus_EntrustedVoucher_General({\n voucherid: _VoucherID,\n statusofsubmit: 'P',\n qualifedstring: $scope.qual\n }).$promise.then(function (req) {\n callback(req);\n }, function (errResponse) {\n callback(errResponse);\n });\n }", "function 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}", "saveData(gstr){\n\n \n\n }", "function saveOrderInDB(order, callback) {\n let data = order;\n let values = `'${data.date}', '${data.fname}', '${data.lname}', '${data.email}', ${data.phone}, '${data.location}', '${data.content}', '${data.remarks}', '${data.size}', '${data.shows}', '${data.images}'`;\n bl.dataFromCostumer.saveContactData(tableName, rows, values, function (err, done) {\n if (err) {\n callback(err);\n console.log(err);\n\n } else {\n callback(null, done);\n }\n\n });\n}", "function saveOptions()\r\n\t\t\t{\r\n\t\t\t\tvar valSrvFlavour=$('#ddServiceFlavour').val(); \r\n\t\t\t\t\r\n\t\t\t\tvar valCktType=$('#ddCircuitType').val(); \r\n\t\t\t\t\r\n\t\t\t\tvar valHeadEndCode=$('#txtHeadEndCode').val();\r\n\t\t\t\t\r\n\t\t\t\tif(valCktType==0)\r\n\t\t\t\t\t{valCktType=' ';}\r\n\t\t\t\t\r\n\t\t\t\tif(valSrvFlavour=='DC')\r\n\t\t\t\t\t{\r\n\t\t\t\t\tif(valCktType==0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\talert('Please Select Circuit Type !!');\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\tvar jsData={\r\n\t\t\t\t\t\tserviceFlavor:valSrvFlavour,\r\n\t\t\t\t\t\tcircuitType:valCktType,\r\n\t\t\t\t\t\theadEndCode:valHeadEndCode\t,\r\n\t\t\t\t\t\tserviceId:serviceId\r\n\t\t\t\t};\r\n\t\t\t\t\tvar res=jsonrpc.processes.saveDropNCarryData(jsData);\r\n\t\t\t\t\tif(res==1)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\talert('Data Saved Successfully !!');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\talert('Data Not Saved !!');\r\n\t\t\t\t\t\t}\t\r\n\t\t\t\t\t/*jQuery.noConflict();*/\t\t\t\t\t\r\n\t\t\t\t\t$('#dropNCarryDialog').dialog('close');\r\n\t\t\t\t\t //$('#dropNCarryDialog').empty();\r\n\t\t\t\t\t \r\n\t\t\t}", "#save() {\n const configuration = this.#parse();\n if (!configuration)\n return;\n\n const date = new Date();\n const config = {\n '#': 'Device configuration export',\n 'vendor': this.#device.getData().metadata.vendor,\n 'product': this.#device.getData().metadata.product,\n 'version': this.#device.getData().metadata.version,\n 'serial': this.#device.getData().metadata.serial,\n 'creator': window.location.href,\n 'date': date.toISOString(),\n 'configuration': configuration\n };\n\n const json = JSON.stringify(config, null, ' ');\n\n let filename = this.#device.getData().metadata.product;\n const name = this.#device.getData().system.name;\n if (name) {\n if (name.startsWith(filename))\n filename = name;\n\n else\n filename += '-' + name;\n }\n filename = filename.replace(/ /g, '-') + '.json';\n\n const url = URL.createObjectURL(new Blob([json], {\n type: 'application/json'\n }));\n\n // Temporarily create an anchor and download the file as URI.\n const a = document.createElement('a');\n a.href = url;\n a.download = filename;\n a.click();\n URL.revokeObjectURL(url);\n }", "function saveEquipment() {\n MeasuringEquipmentServiceCalibrator.saveEquipment(\n $scope.equipmentFormData).then(\n function (data) {\n if (data == 201) {\n $scope.closeModal();\n $scope.resetEquipmentForm();\n $rootScope.onTableHandling();\n }\n });\n }", "function recordTime() {\n var d = new Date();\n var formatDate = \"participant: \\t\" + participant_number;\n formatDate = formatDate + \"\\n\" + \"test type: \\t\" + test_type;\n formatDate = formatDate + \"\\n\" + \"start time: \\t\" + d.getFullYear() + \"-\" + (d.getMonth()+1) + \"-\" + d.getDate() + \"_\" + d.getHours() + \":\" + d.getMinutes() + \":\" + d.getSeconds() + \".\" + d.getMilliseconds();\n formatDate = formatDate + \"\\n\" + \"end time: \\t\"+ d.getFullYear() + \"-\" + (d.getMonth()+1) + \"-\" + d.getDate() + \"_\" + d.getHours() + \":\" + d.getMinutes() + \":\" + (d.getSeconds()+ (waiting_time/1000)) + \".\" + d.getMilliseconds();\n var blob = new Blob([formatDate], {type: \"text/plain;charset=utf-8\"});\n saveAs(blob, \"NU-test-\" + participant_number + \"-\" + test_type + \".txt\");\n}", "static async saveAccount(encryptedWalletJSON)\n {\n /* var password = acct.password;\n var dk = acct.dk;\n var name = 'eth_acct_'+acct.address;\n var options = {};\n\n var keyObject = keythereum.dump(password, new Buffer(dk.privateKey), new Buffer(dk.salt), new Buffer(dk.iv), {options});\n*/\n console.log('saving acct ', encryptedWalletJSON)\n\n var encryptedWallet = JSON.parse(encryptedWalletJSON);\n\n\n var address = encryptedWallet.address;\n\n if(!address.startsWith('0x')){\n address = '0x' + encryptedWallet.address;\n }\n\n var name = 'eth_acct_'+address;\n\n\n var storage = await StorageHelper.storeFile(name,encryptedWallet);\n\n\n return {success:true}\n }", "function save_and_export() {\r\n\r\n}", "function saveMeter()\r\n{\r\n\taddEntpMeter(arrEntp[gArrayIndex]);\r\n}", "function save(name, company, email, phone, message){\n let newInfo = info.push(); \n \n newInfo.set({\n name,\n company,\n email,\n phone,\n message\n })\n}", "function saveObservation() {\n\t//alert($(\"#listProj :selected\").text());\n\tvar methods = [],\n\t\tobj = $('#listSpec').find('#speciesSelect :selected');\n\t//alert(obj.val());\n\tcurObservation.Species = DBFuncs.SpeciesList[obj.val()];\n\t\n\tcurObservation.Project = $(\"#listProj :selected\").text(); // $(\"speciesSelect\");\n\t\n\tcurObservation.When = $('#dateField').val();\n\tcurObservation.Where = iMapMap.getObsLocation();\n\tcurObservation.Photos.push($('#largeImage').attr('src'));\n\t//alert($('#largeImage').attr('src'));\n\tcurObservation.save();\n\tgoHome();\n}", "function createObject(e){\n\t\n\t// create random object data\n\tvar object={\n\t\tname: 'PeppaTest Object' + Math.floor(Math.random()*100),\n\t\tstatus: 'created',\n\t\tcost: 2.99\n\t};\n\t\n\t// Now Save It\n\tapi.Object.Create('PeppaTest',object,function(r){\n\t\tif(r.success){\n\t\t\talert('New Object persisted to server');\n\t\t}\n\t});\t\n\t\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 }", "function saveTransfer() {\n retrieveValues();\n saveToServer();\n}", "async save() {\n const { newPosytText, saving } = this.state;\n if (saving || !newPosytText.length) return;\n // this.setState({ saving: true });\n // this.playSavingAnimation();\n const attrs = {};\n attrs.content = newPosytText.trim();\n const location = await this.currentLocation();\n if (location && location.coords) {\n attrs.location = [location.coords.latitude, location.coords.longitude].join(',');\n }\n this.close('up');\n segment.track('Posyt Create - Saving 1 - Request');\n ddp.call(\"posyts/create\", [attrs]).then(() => {\n // this.setState({ saving: false });\n segment.track('Posyt Create - Saving 2 - Success');\n }).catch((err) => {\n // this.setState({ saving: false });\n // Alert.alert('Error', err.reason, [{ text: 'OK' }]);\n segment.track('Posyt Create - Saving 2 - Error', { error: err.reason });\n bugsnag.notify(err);\n });\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}", "save(){\n //\n }", "saveItem() {\n\n }", "livelyPrepareSave() {\n }", "async function saveCompanyDataToPortolio(e) {\n e.preventDefault();\n\n alert(\"added \" + stockdata.Name +\" to watchlist.\");\n\n const companyDataFormVersion_2 = {\n company: companyName ? companyName : undefined,\n\t symbol: companySymbol ? companySymbol : undefined,\n\t priceAtPurchase: companyPurchasePrice ? companyPurchasePrice : undefined,\n\t sharesPurchased: companyShareCount ? companyShareCount : undefined,\n\t description: companyDescription ? companyDescription : undefined,\n };\n \n await axios.post(`${domain}stock_data/`, companyDataFormVersion_2);\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 saveToDataBase(data) {\n console.log(data);\n}", "function carBooking(\n name,\n phone,\n city,\n destination,\n tripdate,\n triptime,\n vehicle,\n person,\n bookingdate\n) {\n var newtaxiRef = taxiRef.push()\n newtaxiRef.set({\n name: name,\n phone: phone,\n city: city,\n destination: destination,\n tripdate: tripdate,\n triptime: triptime,\n vehicle: vehicle,\n person: person,\n bookingdate: bookingdate.toDateString(),\n })\n // showBooking()\n}", "savePayment() {\n // const requestConfig = {};\n const paymentId = this.cardSelected.paymentId\n ? this.cardSelected.paymentId\n : this.addedCard.paymentId;\n // requestConfig.headers = this.globals.getHeaders();\n // requestConfig.url = this.globals.getRestUrl('paymentDetails', 'cart');\n // requestConfig.method = 'put';\n // requestConfig.params = {\n // paymentDetailsId: paymentId,\n // };\n // this.generateRequest(\n // requestConfig,\n // this.handleSavePaymentResponse,\n // this.handleSavePaymentError,\n // );\n this.checkoutService.savePayment(\n {},\n this.handleSavePaymentResponse,\n this.handleSavePaymentError,\n paymentId,\n );\n this.$refs.spinner.showSpinner();\n }", "function saveAccount(account) {\t\t\n\tvar data\t= input('post','json','/GoShieldServices/goshield.svc/Account/Save','application/json; charset=UTF-8',JSON.stringify(account)); \t\n\treturn WL.Server.invokeHttp(data);\t\n}", "function saveData()\n{\n saveJSON(locationData, 'lastSearch');\n console.log('Saved ' + placeName +'.json');\n}", "function addRecord() {\n addMilkRecording(route.params.tagNum, date, parseFloat(milkProduced), parseFloat(protein), parseFloat(butterfat), parseFloat(cellCount), notes)\n .then(() => {\n ToastAndroid.show('Added Successfully', ToastAndroid.SHORT)\n navigation.goBack()\n }).catch(error => {\n alert(error.message)\n })\n }", "static async save() {\n\t\tfs.writeFileSync(FILE, JSON.stringify(Parking.data))\n\t}", "function couchDBSave (info) {\n\t $.couch.db(\"asdfix\").saveDoc(info, {\n\t success: function (info){\n\t console.log(info);\n\t alert(\"Data Has Been Saved!!\");\n\t window.location = $(\"index.html/#addSchd\");\n\t },\n\t error: function (status) {\n\t console.log(status);\n\t }\n\t });\n\t \n\t}", "function create_account(data,files)\r\n{var f=[];\r\n for(var i=0;i<3;i++)\r\n {\r\n if(files[i]==undefined)\r\n f[i]=null;\r\n else\r\n f[i]=files[i].filename;\r\n\r\n }\r\n var query='insert into info values (\"'+data.newemail+'\",\"'+data.pass+'\",\"'\r\n +data.firstname+'\",\"'+data.date+'\",\"'+data.month+'\",\"'+data.year+'\",\"'+data.address+'\",\"'+f[0]+'\",\"'+f[1]+'\",\"'+f[2]+'\")';\r\n\r\n con.query(query,function(err,response,feilds){\r\n if(err)\r\n throw err;\r\n return;\r\n });\r\n\r\n}", "saveFilesonDB(folderName,filesToUploadDBArray ) {\n console.log(\"TCL: saveFilesonDB -> folderName\", folderName) \n console.log(\"TCL: saveFilesonDB -> filesToUploadDBArray\", filesToUploadDBArray)\n\t\t\t\t\n\n // const {projectID} = this.props.match.params;\n const requestID = this.props.projectIntake.requirementsDefinition.Project_id || this.props.projectIntake.requirementsDefinition.Request_ID\n // const requestID = projectID.substr(projectID.indexOf('GSD')+3,projectID.length);\n const filesString = filesToUploadDBArray.join(',');\n // const currentUser = window.getCurrentSPUser();\n\n // Loomk For Files on SP FOlder\n saveProjectFiles(requestID, filesString, currentUser.userEmail).then((data)=>{\n console.log('TCL: saveFilesonDB -> data', data);\n \n\n })\n .catch((error)=> {\n\t\t\t\t\t\tconsole.log('TCL: saveFilesonDB -> error', error)\n \n })\n }", "function savePartyDetails(partyDetails) {\n debugger;\n vm.partyFactory.saveData(partyDetails);\n }", "function onSaveSuccess (response) {\n console.debug('BOOM', response);\n }", "function doSave() {\n debugger;\n var voucher = {\n \"ID\": 2,\n \"Text\": \"BP Tankstelle\",\n \"Date\": \"2017-06-27T14:30:04.8849651\",\n \"Amount\": 65,\n \"Paid\": false,\n \"Expense\": true,\n \"Remark\": true\n };\n var url = \"/api/vouchers/save/\";\n $.ajax({\n type: \"POST\",\n data: JSON.stringify(voucher),\n url: url,\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n success: function (msg) {\n output(\"query successful, data received: \" + JSON.stringify(msg));\n },\n error: onErr\n });\n}", "function addToDB(data, formatted, from){\n //Create new vehicle\n var newVehicle = new Vehicle({\n time: data.time,\n savedTime: Date.now(),\n formattedTime: formatTime(),\n energy: data.energy,\n energySpent:formatted ? lastEnergyLvl - data.energy : data.energySpent,\n gps:formatted ? getCoordinatesObj(data.gps) : data.gps,\n odo: data.odo,\n speed: data.speed,\n soc: data.soc\n });\n lastEnergyLvl = data.energy;\n //Save new vehicle to database \n newVehicle.save((err,savedVehicle) => {\n console.log(2)\n return err ? \n handleError(err, 'Saving Vehicle'):0;\n });\n}", "function storeWeather(bodyObj)\n{ \n let dat = new Date(0);\n let newObj = JSON.parse(bodyObj);\n let insObj = {};\n\n if (newObj.cod == '200')\n {\n insObj.country=newObj.sys.country;\n insObj.state='';\n insObj.city=newObj.name;\n insObj.longitude=newObj.coord.lon;\n insObj.latitude=newObj.coord.lat;\n insObj.weaDesc=newObj.weather[0].description;\n insObj.weaIcon=newObj.weather[0].icon + \".png\";\n insObj.avgTemp=(newObj.main.temp - 273.15).toFixed(2);\n insObj.minTemp=(newObj.main.temp_min - 273.15).toFixed(2);\n insObj.maxTemp=(newObj.main.temp_max - 273.15).toFixed(2);\n insObj.pressure=(newObj.main.pressure + \" Hetropascals\");\n insObj.humidity=newObj.main.humidity;\n insObj.windSpeed=newObj.wind.speed;\n insObj.windDegree=newObj.wind.deg; \n insObj.weatherDate=new Date(dat.setUTCSeconds(newObj.dt));\n dat = new Date(0);\n insObj.sunrise=new Date(dat.setUTCSeconds(newObj.sys.sunrise));\n dat = new Date(0);\n insObj.sunset=new Date(dat.setUTCSeconds(newObj.sys.sunset));\n \n console.log('Inserting data to Weather db....');\n let weatherRec = new WeatherData(insObj);\n let result = weatherRec.save();\n }\n}", "function registerTruck(truck){\n const {owner_id\n , truck_name\n , truck_img_url\n , cuisine_type\n , departure_time\n , truck_lat\n , truck_long\n , truck_location\n } = truck\n return db('trucks_table')\n .insert({owner_id\n , truck_name\n , truck_img_url\n , cuisine_type\n , departure_time\n , truck_lat\n , truck_long\n , truck_location\n })\n}", "function saveCf(){\n var panel = View.getControl('', 'sched_wr_cf_cf_form');\n record =panel.getFieldValues();\n //kb:3024805\n\tvar result = {};\n\t//Save craftsperson assignment. file='WorkRequestHandler.java';\n try {\n result = Workflow.callMethod(\"AbBldgOpsOnDemandWork-WorkRequestService-saveWorkRequestCraftsperson\", record);\n } \n catch (e) {\n Workflow.handleError(e);\n }\n View.getOpenerView().controllers.get(0).refreshGridPanel();\n if (result.code != 'executed') {\n Workflow.handleError(result);\n }\n}", "createVehicle(event) {\n event.preventDefault();\n const createVehicle = {\n vehicleId: this.state.vehicleId.value,\n vehicleDetails: {\n $class: \"org.equiv.VehicleDetails\",\n vehicleCategory: this.state.vehicleCategory.value,\n brand: this.state.brand.value,\n modelType: this.state.modelType.value,\n numberPlate: \"\",\n color: this.state.color.value,\n mileage: this.state.mileage.value,\n transmission: this.state.transmission.value,\n engineCap: this.state.engineCap.value,\n power: this.state.power.value,\n features: this.state.features.value,\n description: this.state.description.value\n },\n coe_expiry: this.state.coe_expiry.value,\n warranty_expiry: this.state.warranty_expiry.value,\n roadtax_expiry: this.state.roadtax_expiry.value,\n owner:\n \"resource:org.equiv.participants.assets.Seller#\" +\n this.state.owner.value,\n middleman:\n \"resource:org.equiv.participants.assets.Middleman#\" +\n this.state.middleman.value\n };\n EvaluatorCreateVehicle(createVehicle)\n .then(response => {\n notification.success({\n message: \"EquiV\",\n description: \"Vehicle Has been created!\"\n });\n window.location.reload();\n })\n .catch(error => {\n notification.error({\n message: \"EquiV\",\n description:\n error.message || \"Sorry! Something went wrong. Please try again!\"\n });\n });\n }", "async insertBasicPatientData(stub, args) \n {\n var basicPatient = \n {\n docType: 'basicPatient',\n name: args[0],\n address: args[1],\n zipCode: args[2],\n tel: args[3],\n healthCard: args[4],\n id: args[5]\n };\n await stub.putState(args[5], Buffer.from(JSON.stringify(basicPatient)));\n }", "function saveSpec() {\n updateGeneralspe();\n if (!iserror && !iserrorOwnpanel && !iserrorGeneralSpec && !isSingleError) {\n document.forms['specForm'].action = '${pageContext.request.contextPath}/specification/Specification.action?saveandBack=';\n document.forms['specForm'].submit();\n }\n }", "write_gameinfo() {\n console.log(`Boad.write_gameinfo()`);\n\n const gameinfo_json = JSON.stringify(this.gen_gameinfo());\n console.log(`Board.write_gameinfo():gameinfo_json=${gameinfo_json}`);\n\n const blob_gameinfo = new Blob([gameinfo_json],\n {\"type\": \"application/json\"});\n document.getElementById(\"write_gameinfo\").download = GAMEINFO_FILE;\n document.getElementById(\"write_gameinfo\").href\n = window.URL.createObjectURL(blob_gameinfo);\n }", "function guardar() {\r\n var nombre = ventana.document.getElementById(\"txtnom\").value;\r\n var apellidos = ventana.document.getElementById(\"txtape\").value;\r\n var foto = ventana.document.getElementById(\"txtfoto\").value;\r\n var funciones = ventana.document.getElementById(\"txtfunc\").value;\r\n var telefono = ventana.document.getElementById(\"txttel\").value;\r\n\r\n crearNuevoSocio(nombre, apellidos, foto, funciones, telefono);\r\n ventana.close();\r\n}", "async function saveData (data) {\r\n\ttry {\r\n\t\tlet newBook = new newBoek( {\r\n\t\t\ttitel: data.titel,\r\n\t\t\tauteur: data.auteur,\r\n\t\t\tgenre: data.genre,\r\n\t\t\tentryDate: Date()\r\n\t\t});\r\n\t\tawait newBook.save();\r\n\t\tconsole.log(`added book ${newBook}`);\r\n\t} catch (error) {\r\n\t\tconsole.log('saveData failed ' + error);\r\n\t}\r\n}", "function save(){\r\n\tutil.log(\"Data: Saving All...\");\r\n\t//Save Each\r\n\tutil.log(\"Data: Saving Done...\");\r\n}", "function saveNewShop(shop_info, newShop) {\n\n\tvar reviews = shop_info.reviews;\n\tvar geohash = encodeCoords(shop_info.geometry.location);\n\n\tnewShop.name = shop_info.name;\n\tnewShop.description = shop_info.description;\n\tnewShop.address = shop_info.formatted_address;\n\tnewShop.phone_number = shop_info.international_phone_number;\n\tnewShop.opening_hours = shop_info.opening_hours;\n\tnewShop.website = shop_info.website;\n\tnewShop.city = shop_info.city;\n\tnewShop.geolocation = {\n\t\t\tgeohash: geohash,\n\t\t\tlocation: shop_info.geometry.location\n\t\t};\n\tnewShop.hidden = shop_info.permanently_closed;\n\tnewShop.source = shop_info.source;\n\tnewShop.source_id = shop_info.place_id ? shop_info.place_id : shop_info.source_id;\n\tnewShop.rating = shop_info.rating ? shop_info.rating : 0;\n\tnewShop.price_level = shop_info.price_level ? shop_info.price_level : 0;\n\tnewShop.reviews_count = reviews ? reviews.length : 0;\n\n\tif(shop_info.photos && shop_info.photos.length > 0) \n\t\tnewShop.photos = shop_info.photos[0].photo_reference ? retrieveNewPhotos(shop_info.photos) : shop_info.photos;\n\telse \n\t\tnewShop.photos = [];\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 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 sys_bank_save() {\n var sysbank_name = $('#sysbank_name').val();\n var sysbank_address = $('#sysbank_address').val();\n var account_name = $('#account_name').val();\n var account_no = $('#account_no').val();\n var address = $('#address').val();\n if (sysbank_name.length !== 0) {\n var form_data = {\n sysbank_name: sysbank_name,\n sysbank_address: sysbank_address,\n account_name: account_name,\n account_no: account_no,\n address: address\n\n };\n $.post(\"models/model_credit_transfer.php\", {action: 'add_sysbank', form_data: form_data}, function (e) {\n alertifyMsgDisplay(e, 2000);\n sys_bank_form_reset();\n show_sysbsnk_save_btn();\n sys_bank_table();\n }, 'json');\n } else {\n alert(\"Enter Bank Name\");\n }\n}", "saveRental1() {\n //create variable\n var params = {\n //like parameter to getter in Csharp to get info\n owner: this.get('owner'),\n type: this.get('type'),\n city: this.get('city'),\n bedrooms: this.get('bedrooms'),\n image: this.get('image'),\n cost:this.get('cost'),\n latitude: this.get('latitude'),\n longitude: this.get('longitude')\n //When the field is not populated, its value will be undefined\n //**** undefined is not a valid JSON type. It'll prevent the record from being written to Firebase & cause an error.\n //For field that might be leave blank or undefined should add a conditional that sets them to \"\" or null;\n //example; this.get('owner'): \"\",\n };\n this.set('addNewRental', false);\n //after each field's value is collected, the form is hidden again)\n this.sendAction('saveRental2', params);\n //params in also build in Ember\n }", "save() {\r\n return Backendless.Data.of(Place).save(this);\r\n }", "function testSave(){\n setCurrentLangData();\n setCurrentData();\n saveData();\n}", "async confirmReservation(stub, args, thisClass) {\n if (args.length != 6) { \n\t\t\tthrow new Error('Incorrect number of arguments. Expecting 6.')\n\t\t}\n\t\tlet id = args[0] \n\t\tlet assetState = await stub.getState(id)\n\t\tif (assetState.toString()) {\n\t\t\tthrow new Error('This asset already exists: ' + id)\n\t\t}\n\t\tconsole.info('--- start insertAsset ---')\n\t\tlet Time = parseInt(args[1])\n\t\tlet OrgId = args[2] \n\t\tlet UserId = args[3] \n\t\tlet DoctorId = args[4] \n\t\tlet ReservationTime = parseInt(args[5])\n\n\t\tif (id.length <= 0){ \n\t\t\treturn shim.error('Argument id must be a non-empty string') \n\t\t}\n\t\tif (typeof Time !== \"number\") {\n\t\t\treturn shim.error('Time is not a number');\n\t\t}\n\t\tif (OrgId.length <= 0) { \n\t\t\tthrow new Error('Argument OrgId must be a non-empty string') \n\t\t}\n\t\tif (UserId.length <= 0) { \n\t\t\tthrow new Error('Argument UserId must be a non-empty string') \n\t\t}\n\t\tif (DoctorId.length <= 0) { \n\t\t\tthrow new Error('Argument DoctorId must be a non-empty string') \n\t\t}\n\t\tif (typeof ReservationTime !== \"number\") {\n\t\t\treturn shim.error('ReservationTime is not a number');\n\t\t}\n\n\t\tlet asset = {}\n\t\tasset.docType = \"reservation\"\n\t\tasset.id = id\n\t\tasset.Time = Time\n\t\tasset.OrgId = OrgId\n\t\tasset.UserId = UserId\n\t\tasset.DoctorId = DoctorId\n\t\tasset.ReservationTime = ReservationTime\n\t\tasset.Canceled = false \n\t\tasset.Rejected = false \n\n\t\tawait stub.putState(id, Buffer.from(JSON.stringify(asset)))\n\t\tlet indexName0 = \"OrgId~id\"\n\t\tlet OrgIdIdIndexKey = await stub.createCompositeKey(indexName0, [asset.OrgId, asset.id])\n\t\tconsole.info(OrgIdIdIndexKey)\n\t\tawait stub.putState(OrgIdIdIndexKey, Buffer.from(''))\n\t\tlet indexName1 = \"UserId~id\"\n\t\tlet UserIdIdIndexKey = await stub.createCompositeKey(indexName1, [asset.UserId, asset.id])\n\t\tconsole.info(UserIdIdIndexKey)\n\t\tawait stub.putState(UserIdIdIndexKey, Buffer.from(''))\n\t\tlet indexName2 = \"DoctorId~id\"\n\t\tlet DoctorIdIdIndexKey = await stub.createCompositeKey(indexName2, [asset.DoctorId, asset.id])\n\t\tconsole.info(DoctorIdIdIndexKey)\n\t\tawait stub.putState(DoctorIdIdIndexKey, Buffer.from(''))\n }", "function Drive() {\r\n}", "async function save(inpt,keyv) {\n \n var msg='Profile data saved. ';\n\n try {\n \n if( inpt[0][1] !='' ) {\n await keyv.set( 'name' , inpt[0][1] );\n msg+='Name: ' + await keyv.get('name') + ' | ';\n }\n\n if( inpt[1][1] !='' ) {\n await keyv.set( 'age' , inpt[1][1] );\n msg+='Age: ' + await keyv.get('age') + ' | ';\n }\n\n if( inpt[2][1] !='' ) {\n await keyv.set( 'country' , inpt[2][1] );\n msg+='Country: ' + await keyv.get('country') + ' | ';\n }\n\n\n if( isValidHttpUrl( inpt[3][1] ) ) {\n await keyv.set( 'picture' , inpt[3][1] );\n msg+='Picture: ' + await keyv.get('picture');\n } else {\n await keyv.set( 'picture' , '' );\n }\n\n\n } catch(err) {\n console.log ( 'There was a problem saving the profile values. ' + msg ); \n }\n\n return msg;\n}", "setDriveApi(drive) {\n this.drive = drive;\n this.save.drive = drive;\n this.load.drive = drive;\n }" ]
[ "0.5880701", "0.5599724", "0.5544241", "0.5538065", "0.5532087", "0.55165386", "0.5492696", "0.5472051", "0.5414778", "0.5405292", "0.53951526", "0.53929895", "0.5342391", "0.5330448", "0.5291325", "0.5285189", "0.52817065", "0.5269957", "0.5267587", "0.52499443", "0.524883", "0.52401674", "0.5238288", "0.5232693", "0.520004", "0.5190721", "0.5178086", "0.5164566", "0.5149019", "0.51439214", "0.514209", "0.51377463", "0.5124206", "0.5118798", "0.5114737", "0.5112201", "0.51110935", "0.51018745", "0.5095757", "0.508977", "0.50881445", "0.50860316", "0.5076404", "0.50697374", "0.506888", "0.5053984", "0.5040832", "0.5038991", "0.50366944", "0.50355273", "0.5032552", "0.5020753", "0.50131905", "0.50052285", "0.5001172", "0.49911582", "0.49884906", "0.4979324", "0.49765044", "0.4975693", "0.4974713", "0.49710298", "0.49622288", "0.49605215", "0.4956214", "0.49532327", "0.495208", "0.49508026", "0.49448717", "0.4935032", "0.49340147", "0.49303156", "0.49162227", "0.49141812", "0.49007353", "0.48972273", "0.4895801", "0.48934647", "0.48890448", "0.48864815", "0.4886003", "0.48857853", "0.48841533", "0.48745784", "0.48678195", "0.48667783", "0.4866442", "0.48647773", "0.4852772", "0.48520517", "0.4848345", "0.48470506", "0.4844534", "0.4835279", "0.48323852", "0.48317498", "0.48308071", "0.48263958", "0.48221898", "0.48162392" ]
0.4938808
69
returns true if some array alement is true
function some(arr, pred){ for(var i = 0; i < arr.length; i++){ if(pred(arr[i])) return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function testArray(array) {\n if (\n (array[0] === 1 || array[0] === 3) &&\n (array[1] === 1 || array[1] === 3)\n ) {\n return true;\n } else {\n return false;\n }\n}", "function some(array, test) {\n for (let element of array) {\n if (test(element)) {\n return true;\n }\n }\n\n return false;\n}", "function any(array, test) {\n var length = array.length;\n for (var i = 0; i < length; ++i) {\n if (test(array[i])) {\n return true;\n }\n }\n return false;\n}", "function containsTrue(array) {\n return array;\n}", "function any(func, array){\n for (var i=0; i<array.length; i++){\n\t if (func(array[i])) return true;\n }\n return false;\n }", "function all(array, pred) {\n for (var idx = 0, len = array.length; idx < len; idx++) {\n if (!pred(array[idx])) {\n return false;\n }\n }\n return true;\n }", "function isBooleanArray(arr) {\n return arr.every(function(element, index, array) {\n return isBoolean(element);\n });\n}", "function testBooleanLogic (arr){\n for (var i = 0; i < arr.length; i++) {\n if(arr[i] === true){\n return true;\n }\n }\n return false;\n}", "function all(array, pred) {\n for (var idx = 0, len = array.length; idx < len; idx++) {\n if (!pred(array[idx])) {\n return false;\n }\n }\n return true;\n }", "function all(array, pred) {\n for (var idx = 0, len = array.length; idx < len; idx++) {\n if (!pred(array[idx])) {\n return false;\n }\n }\n return true;\n }", "function some(array, f){\n\t// var status = false;\n\tfor (var i = 0; i < array.length; i++){\n\t\tif (f(array[i])) return true;\n\t}\n\treturn false;\n}", "function some(arr, evaluation) {\n\tvar flag = false;\n\t\tfor (var i = 0; i < arr.length; i++) {\n\t\tif (evaluation(arr[i])) {\n\t\t\tflag = true;\n\t\t\tbreak;\n\t\t};\n\t}\n\treturn flag;\n}", "function all(array, pred) {\n for (var idx = 0, len = array.length; idx < len; idx++) {\n if (!pred(array[idx])) {\n return false;\n }\n }\n return true;\n}", "function all(array, pred) {\n for (var idx = 0, len = array.length; idx < len; idx++) {\n if (!pred(array[idx])) {\n return false;\n }\n }\n return true;\n}", "function all(array, pred) {\n for (var idx = 0, len = array.length; idx < len; idx++) {\n if (!pred(array[idx])) {\n return false;\n }\n }\n return true;\n}", "function all(array, pred) {\n for (var idx = 0, len = array.length; idx < len; idx++) {\n if (!pred(array[idx])) {\n return false;\n }\n }\n return true;\n}", "function isInArray(elem,arr) {\n return (arr.slice(0,arr.length).indexOf(elem) > -1);\n }", "function hasArrayElement(arr) {\n for (var i=0; i<arr.length; i++) {\n if (Array.isArray(arr[i])) {\n return true;\n }\n }\n return false;\n}", "function checkArray(arr) {\n return arr.reduce(function(a, b){ return (a === b) ? a : false; });\n }", "function all(func, array){\n for (var i=0; i<array.length; i++){\n\t if (!func(array[i])) return false;\n }\n return true;\n }", "function haveAllData(array) { \n\n // should have a 2 element array\n if (_.isArray(array) && array.length === 2) \n\n // neither element should be empty\n if (! (_.isEmpty(array[0]) || _.isEmpty(array[1]))) \n return true;\n\n return false;\n}", "function check_array(arr, value, law)\n{\n var op = law;\n\n for (key_temp in arr)\n {\n if (op)\n {\n if (operators[op](arr[key_temp], value))\n {\n return true;\n }\n }\n }\n return false;\n}", "function array(numbers){\n for(let i=0;i<numbers.length;i++){\n if((numbers[i] === 1)||(numbers[i]===3)){\n return true;\n }\n }\n return false;\n }", "function check_array(arr, value, law)\r\n{\r\n var op = law;\r\n for (key_temp in arr)\r\n {\r\n if (op)\r\n {\r\n if (operators[op](arr[key_temp], value))\r\n {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n}", "function testAny(arr, fn) {\n for(var i=0;i<arr.length;i++) {\n if(fn(arr[i])) {\n return true;\n }\n }\n return false;\n }", "function isError(elem, index, array) {\n return elem[0] == true;\n }", "function some(arrayArg,test){\n//loop through the array \n for(var i=0; i<arrayArg.length; i++){\n//if the function ever evaluates to true within the loop then return true\n if(test(arrayArg[i]))\n return true;\n \t\t}\n //if the function never evaluates as true, then return false\n return false;\n }", "function arrayOf (rule, a) {\n\t return low.isArray(a) && a.every(rule)\n\t}", "function checkSubArrayBool(parentArray, childArray) {\n var bool = true;\n for (var element of childArray) {\n if (!parentArray.includes(element)) {\n bool = false;\n break;\n }\n }\n return bool;\n}", "function isInArray(array, element) {\r\n var i = 0;\r\n var risultato = false;\r\n while (i < array.length && risultato == false) {\r\n if (array[i] == element) {\r\n risultato = true;\r\n }\r\n i++;\r\n }\r\n return risultato;\r\n}", "function some(arr, func)\n{\n\tvar result = false;\n\tif (arr.length == 0) return result;\n\tfor (var i = 0; i < arr.length; i++)\n\t{\n\t\tif (func(arr[i], i, arr))\n\t\t{\n\t\t\tresult = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn result;\n}", "every(callback) {\n for (const ele of this.arr) {\n if (!callback(ele)) {\n return false;\n }\n }\n\n return true;\n }", "function tool_isInArray(item,arr) {\n\n\tfor(x=0;x<arr.length;x++) {\n\t\tif (arr[x] == item) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "anyHighlighted(arr) {\n\t\tfor (let i = 0; i < arr.length; i++) {\n\t\t\tif (arr[i])\n\t\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "function every(array, test) {\n for (var i = 0; i < array.length; i++) {\n if (!test(array[i])) {\n return false;\n }\n }\n return true;\n}", "function check(a,x){\nreturn a.some(element => element == x)\n}", "function every(arrayArg,test){\n//loop through the array \n for(var i=0; i<arrayArg.length; i++){\n//the array is accepted as an argument to the function argument (test)\n//if the function evaluates to false within the loop then return false\n if(!test(arrayArg[i]))\n return false;\n \t\t}\n//if the array is looped through and never false, then return true \n return true;\n }", "function every (array, f){\n for (var i =0; i<array.length; i++){ \n if (!f(array[i]))\n return false;\n }\n return true;\n}", "function is(arr){\n return typeof(arr) == \"object\" && arr.length >= 0;\n }", "function includesArray (arr, element) {\r\n var i = 0;\r\n while (i < arr.length) {\r\n if (arr[i] == element) {\r\n return true;\r\n }\r\n i++\r\n }\r\n return false;\r\n}", "function quickCheck(arr, elem) {\n if (arr.indexOf(elem) == -1) {\n return false \n } else {\n return true\n }\n }", "static allEqualElements(array) {\n let arrayBase = array[0]\n for (let i = 0; i < array.length; i++) {\n if (array[i] !== arrayBase) {\n return false\n }\n }\n return true;\n }", "function inArray(array,elemento) {\n var i =0;\n\n while (i < array.length) {\n if (array[i] == elemento) {\n return true;\n }\n i ++;\n }\n return false;\n}", "function isArray(array)\n{\n\treturn !!(array && array.constructor == Array);\n}", "function every(arr, func)\n{\n\tvar result = true;\n\tif (arr.length == 0) return result;\n\tfor (var i = 0; i < arr.length; i++)\n\t{\n\t\tif (!func(arr[i], i, arr))\n\t\t{\n\t\t\tresult = false;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn result;\n}", "function some(arr, f) {\n var i = 0;\n for (var k = 0; k < arr.length; k++) {\n if (f(arr[k], k, i++)) {\n return true;\n }\n }\n return false;\n }", "function some(array, callback) {\n const { length } = array;\n\n for (let index = 0; index < length; index += 1) {\n const value = array[index];\n\n if (callback(value, index, array)) {\n return true;\n }\n }\n\n return false;\n}", "function containsAll(arr){\r\n\tfor(let k=1; k<arguments.length;k++){\t\t//arguments object to pass arguments\r\n\t\tlet num=arguments[k];\r\n\t\tif(arr.indexOf(num)===-1){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n}", "function contains(array, elem) {\n\t return array.indexOf(elem) !== -1;\n\t}", "function every(arr, evaluation) {\n\tvar flag = true;\n\tfor (var i = 0; i < arr.length; i++) {\n\t\tif (!evaluation(arr[i])) {\n\t\t\tflag = false;\n\t\t\tbreak;\n\t\t};\n\t}\n\treturn flag;\n}", "function isInArray (element, array) {\n for (var i = 0; i < array.length; i++) {\n if (element == array[i]) {\n return true;\n }\n }\n return false;\n}", "isInArray(valor, array) {\r\n let existe = array;\r\n return existe.includes(valor);\r\n }", "function inArray(value, array){\n\t\t for(var i=0;i<array.length;i++){\n\t\t if(array[i]==value) {return false;}\n\t\t \t}\n\t\t\t}", "function isInArray (element, array) {\n for (var i = 0; i < array.length; i++) {\n if (element == array[i]) {\n return true;\n }\n\n }\n return false;\n}", "function inArray(el, arr) {\n return arr.indexOf(el) > -1;\n}", "function validate(array) {\n return array.some(a => a.some(b => b == 0));\n}", "function includesArray (arr, item) {\n for (let i = 0; i < arr.length; i++) {\n if (equalArrays(arr[i], item)) {\n return true;\n }\n }\n return false;\n}", "function every(array, predicate) {\n // go through each element of the array, and if the element noes not matches the predicate funtion return false\n for (let element of array) {\n if (!predicate(element)) return false;\n }\n //retrun true if we make it through the who loop.\n return true;\n}", "isValid(arr) {\n if(typeof(arr === 'string')){\n return arr !== ''\n }else{\n return arr.find((el) =>{\n return el === true\n })\n }\n }", "static allEqualElements(array) {\n let firstElement = array[0]\n for (let i = 1; i < array.length; i++) {\n if (array[i] !== firstElement) {\n return false;\n }\n }\n return true;\n }", "every(callback) {\r\n for (let i = 0; i < this.array.length; i++) {\r\n const item = this.array[i];\r\n if (!callback(item)) return false;\r\n }\r\n return true;\r\n }", "function checkSame(array) {\n \"use strict\";\n if (!endState) {\n if (array[0].length > 0 && allValuesSame(array)) {\n return true;\n }\n }\n return false;\n}", "function every1(arr, pred) {\n for (let el of arr) {\n if (!pred(el)) return false;\n }\n return true;\n}", "some(callback) {\n for (const ele of this.arr) {\n if (callback(ele)) {\n return true;\n }\n }\n\n return false;\n }", "function isUniform(array) {\n var result = true;\n array.forEach(function (element) {\n if (element !== array[0]) {\n result = false;\n }\n });\n console.log(result);\n}", "function containsAll(arr){\n for (let k = 1; k < arguments.length; k++){\n let num = arguments[k];\n if (arr.indexOf(num) === -1){\n return false;\n }\n }\n return true;\n}", "function some(arr, condition) {\n\tfor (var i = 0; i < arr.length; i++) {\n if (condition(arr[i])) {\n \treturn true;\n } //end if\n }//end for\n return false;\n}", "static hasValue(array, value) {\n for (var tI = 0; tI < array.length; tI++) {\n if (array[tI] === value) {\n return true;\n }\n }\n return false;\n }", "function isInArray(element, vect) {\n\tfor (var i = 0; i < vect.length; i++) {\n\t\tif (vect[i] == element) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "function one_in_array(arr) {\n if (arr.length < 1) return false;\n return (arr[0] == 1 || arr[arr.length - 1] == 1);\n}", "function eleContainsInArray(arr, element) {\n\t\tif (arr != null && arr.length > 0) {\n\t\t\tfor (var i = 0; i < arr.length; i++) {\n\t\t\t\tif (arr[i] == element) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function oneOf (arr, x) {\n\t if (!Array.isArray(arr)) {\n\t throw new Error('expected an array')\n\t }\n\t return arr.indexOf(x) !== -1\n\t}", "function arrayIsValid(_array_) {\n return _array_ && Array.isArray(_array_) && _array_.length > 0;\n}", "function arrayMatch(ar, ob) {\r\n for (var i = 0; i < ar.length; i++) {\r\n if (ar[i] == ob) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}", "arraysItemInArray(a, b) {\r\n for(let item of a) {\r\n if(b.includes(item)) return true;\r\n }\r\n return false;\r\n }", "function some(array, predicate){\n for (var i=0; i< array.length; i++){\n if (predicate(array[i])){\n return true;\n }\n }\n return false;\n}", "function some(arr, callback) {\n var length = arr.length;\n\n for (var i = 0; i < length; ++i) {\n if (callback(arr[i], i)) {\n return true;\n }\n }\n\n return false;\n }", "function elementsExist(elements_array) {\n for (var i in elements_array) {\n if ($(elements_array[i]).length == 0) {\n return false;\n }\n }\n return true;\n }", "function checkPositive(arr) {\n\n let b = arr.every((args) => args > 0)\n if (b == true) {\n return 'yes';\n }\n return 'no';\n}", "function every(array, test) {\n var it = true;\n array.forEach(function(value){\n if(test(value) === false){\n it = false;\n }\n });\n return it;\n}", "function hasItems(array) {\n return array[0] !== undefined \n}", "function inArr(arr, e){\n\tif(arr.length == 0)\n\t\treturn false;\n\treturn arr.indexOf(e) !== -1\n}", "function inArr(arr, e){\n\tif(arr.length == 0)\n\t\treturn false;\n\treturn arr.indexOf(e) !== -1\n}", "function countTrue(array) {\n let count = 0;\n for (let element of array) {\n if (element) {\n count++;\n }\n }\n return count;\n}", "function includes(array, element) {\n if (!array) {\n return false;\n }\n\n const length = array.length;\n\n for (let i = 0; i < length; i++) {\n if (array[i] === element) {\n return true;\n }\n }\n\n return false;\n}", "function arrCont(arr, x) {\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] === x) \n return true;\n }\n return false;\n}", "function containsElement(arr, x){\n for(var r = 0; r < arr.length; r++){\n if(r == x){\n return true;\n }else{\n return false;\n }\n }\n return containsElement;\n }", "function matchesOneIn(elem, array) {\n let len = array.length;\n for (let i = 0; i < len; i++) {\n if (matches(elem, array[i])) {\n return true;\n }\n }\n return false;\n}", "static is_data_array_ok(data){\n return this.is_1d_array(data) ||\n this.is_2d_array(data) ||\n this.is_3d_array(data) ||\n this.is_heat_map_suitable_data(data)\n }", "function X(t) {\n return !!t && \"arrayValue\" in t;\n}", "function solution1(givenArray){\n let setFromArray = new Set(givenArray);\n return givenArray.length === setFromArray.size ? true : false;\n}", "function isValid() {\r\n return inputsToArray.every(element => {\r\n return element.className == \"valid\";\r\n });\r\n}", "some(callback) {\r\n for (let i = 0; i < this.array.length; i++) {\r\n const item = this.array[i];\r\n if (callback(item)) return true;\r\n }\r\n return false;\r\n }", "function contains(array, elem) {\n return array.indexOf(elem) !== -1;\n}", "function contains(array, elem) {\n return array.indexOf(elem) !== -1;\n}", "function contains(array, elem) {\n return array.indexOf(elem) !== -1;\n}", "function contains(array, elem) {\n return array.indexOf(elem) !== -1;\n}", "function contains(array, elem) {\n return array.indexOf(elem) !== -1;\n}", "function contains(array, elem) {\n return array.indexOf(elem) !== -1;\n}", "function contains(array, elem) {\n return array.indexOf(elem) !== -1;\n}" ]
[ "0.7653934", "0.71862906", "0.715384", "0.71526366", "0.71422756", "0.7062995", "0.7021746", "0.7004266", "0.7001492", "0.7001492", "0.6984746", "0.6948215", "0.6933439", "0.6933439", "0.6933439", "0.6933439", "0.6917598", "0.6902217", "0.68888503", "0.6875712", "0.6872005", "0.68655574", "0.68626535", "0.6861289", "0.681417", "0.6772055", "0.6764075", "0.6749747", "0.6748809", "0.67450815", "0.67033136", "0.6701202", "0.6687526", "0.6683168", "0.66831076", "0.66454136", "0.66422963", "0.6633217", "0.6624611", "0.6605809", "0.6600603", "0.65923744", "0.6589187", "0.6588756", "0.65841496", "0.65642214", "0.6555599", "0.6547833", "0.6544421", "0.6543466", "0.65415907", "0.65389705", "0.6536681", "0.6531735", "0.65273356", "0.65229243", "0.6521715", "0.6521035", "0.65143", "0.6507077", "0.6506494", "0.65058094", "0.6498804", "0.6494029", "0.6485826", "0.64816886", "0.64800674", "0.6460386", "0.6454082", "0.64372337", "0.64343643", "0.64320457", "0.64289373", "0.6427464", "0.64262474", "0.6425147", "0.64191335", "0.6417049", "0.6414934", "0.6407637", "0.64037454", "0.63963145", "0.63963145", "0.63937014", "0.6379934", "0.6366884", "0.6366106", "0.63616705", "0.6360067", "0.6357947", "0.63545537", "0.63541645", "0.63504505", "0.63485265", "0.63485265", "0.63485265", "0.63485265", "0.63485265", "0.63485265", "0.63485265" ]
0.6836547
24
Scroll to Event Spaces section and set nav menu item as active
function goToSpaces() { var $spacesLink = $('a#link_to_spaces'); $('body, html').animate({ scrollTop: eventSpacesDest }, 800, function() { $spacesLink.addClass('site-nav-menu__link--active'); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scrNav() {\n var sTop = $(window).scrollTop();\n $('section').each(function () {\n var id = $(this).attr('id'),\n offset = $(this).offset().top - 1,\n height = $(this).height();\n if (sTop >= offset && sTop < offset + height) {\n link.removeClass('active');\n $('#navbar').find('[data-scroll=\"' + id + '\"]').addClass('active');\n }\n });\n }", "function navActive(){\n let navItem = document.querySelectorAll('li');\n for(let i=0;i<5;i++){\n navItem[i].scrollIntoView({behavior: \"smooth\", block: \"end\", inline: \"nearest\"});\n navItem[i].addEventListener('mouseover',function(e){//to appear or disappear active point\n setTimeout(()=>{\n //to remove active from other\n for(let j=0;j<navItem.length/2;j++){\n if(navItem[j].querySelector('span').className.indexOf('active')!=-1){\n navItem[j].querySelector('span').classList.remove('active');\n }\n }\n if(e.target.querySelector('span')!=null){\n e.target.querySelector('span').classList+=' active';}//to add active point}\n },200);\n \n });\n // to smooth return to top\n navItem[i].addEventListener('click',function(e){\n e.preventDefault();//prevent default to make smooth scroll\n // to go to the specific part which user want to go\n let partName = '#'+e.target.innerHTML.split('<')[0].toLowerCase();//get name of section we want to go \n let sectionName = document.querySelector(''+partName+'');//to go to specific part\n sectionName.scrollIntoView({behavior: \"smooth\", block: \"start\", inline: \"nearest\"});\n });\n }\n}", "function activateMenuOnScroll(){\n waq.$menu.$anchoredSections = $();\n for(i=0;i<waq.$menu.$links.length; i++){\n var $trigger = waq.$menu.$links.eq(i);\n var $section = $( '#' + $trigger.parent().attr('class').split(\" \")[0] );\n if($section.length) waq.$menu.$anchoredSections.push($section[0]);\n }\n if(waq.$menu.$anchoredSections.length){\n waq.$menu.$anchoredSections.scrollEvents({\n flag: 'anchor',\n offset: 150,\n topUp: function(e){\n var slug = e.selection.attr('id');\n var $target = waq.$menu.$links.parent().filter('.'+slug);\n waq.$menu.$links.parent().removeClass('active');\n if($target.length){\n $target.addClass('active');\n // window.location.replace('#!/'+slug);\n };\n },\n topDown: function(e){\n var slug = $(scrollEvents.selection[minMax(e.i-1,0,100)]).attr('id')\n var $target = waq.$menu.$links.parent().filter('.'+slug);\n waq.$menu.$links.parent().removeClass('active');\n if($target.length){\n $target.addClass('active');\n // window.location.replace('#!/'+slug);\n }\n }\n\n });\n }\n // dirty fix\n $win.on('load',function(){\n waq.$menu.$links.parent().removeClass('active');\n });\n }", "function SetActiveSection(e) {\r\n if (e.target.nodeName.toLowerCase() == 'li' || e.target.nodeName.toLowerCase() == 'a') {\r\n e.preventDefault();\r\n let element = document.querySelector(`#${e.target.dataset.section}`);\r\n if (element.scrollIntoView == undefined)\r\n element.scrollIntoViewIfNeeded(true);\r\n else\r\n element.scrollIntoView({ behavior: 'smooth', block: 'end' });\r\n const sectionsList = getAllSections();\r\n for (let section of sectionsList) {\r\n section.classList.remove('active-section');\r\n }\r\n element.classList.add('active-section');\r\n }\r\n}", "function setMenuActiveOnScroll() {\n for (let section of sectionsList) {\n if (isElementInViewport(section.children[0].children[0])) {\n setSectionActive(section.id);\n setMenuActive(section.id);\n }\n }\n}", "function opNavScroll() {\r\n\r\n if ($('.op-section')[0]) {\r\n\r\n var section = $(\".op-section\");\r\n var sections = {};\r\n var i = 0;\r\n\r\n Array.prototype.forEach.call(section, function(e) {\r\n sections[e.id] = e.offsetTop;\r\n });\r\n\r\n window.onscroll = function() {\r\n var scrollPosition = document.documentElement.scrollTop || document.body.scrollTop;\r\n\r\n for (i in sections) {\r\n if (sections[i] <= scrollPosition) {\r\n $('li.menu-item').removeClass('current_page_item');\r\n $('a[href*=' + i + ']').parent().addClass('current_page_item ');\r\n }\r\n }\r\n }\r\n\r\n }\r\n }", "function setActiveSection() {\n for (let i=0; i < sections.length; i++) {\n // Selects all the nav items and stores in NodeList\n const navItems = document.querySelectorAll('.menu__link');\n if (isInViewport(sections[i])) {\n sections[i].classList.add('active');\n // Removes all active classes from each navItem\n navItems.forEach(navItem => navItem.classList.remove('active'));\n // Adds active class to the navItem that matches the section that is in view\n navItems[i].classList.add('active');\n }\n else {\n // Removes active classes if the section is not in view\n sections[i].classList.remove('active');\n }\n }\n}", "function activateSection() {\n for (const sec of sections) {\n document.addEventListener('scroll', function () {\n let top = sec.getBoundingClientRect().top;\n if (top < 200 && top > -200) {\n sec.classList.add(\"your-active-class\");\n\n //Activate menu item paralell with active section\n for (const item of menuItems) {\n if (item.textContent === sec.getAttribute('data-nav')) {\n item.style.cssText = 'background: #333; color: #fff;';\n\n //Scrolling to top \n if (sec.getAttribute('data-nav') >= 'Section 2') {\n scrollToTop();\n } else {\n scrol.style = 'display : none';\n }\n\n }\n else {\n item.style = 'none';\n }\n }\n }\n else {\n sec.classList.remove(\"your-active-class\");\n }\n });\n }\n}", "function navigationClicks()\n{\n navigationBar.addEventListener('click',function(eventInfo)\n {\n var findSection=document.getElementById(eventInfo.target.dataset.nav);\n findSection.scrollIntoView();\n\n\n\n });\n}", "function scrollSection(evt) {\n evt.preventDefault();\n menuAnimation();\n\n switch(evt.currentTarget.id) {\n case 'menu-home':\n bodyarea.scrollIntoView({block: 'start', inline: 'start', behavior: 'smooth'});\n break;\n case 'menu-about':\n aboutsec.scrollIntoView({block: 'start', inline: 'nearest', behavior: 'smooth'});\n break;\n case 'menu-stats':\n statssec.scrollIntoView({block: 'start', inline: 'nearest', behavior: 'smooth'});\n break;\n case 'menu-video':\n videosec.scrollIntoView({block: 'start', inline: 'start', behavior: 'smooth'});\n break;\n case 'menu-gallery':\n gallerysec.scrollIntoView({block: 'start', inline: 'start', behavior: 'smooth'});\n break;\n case 'menu-market':\n marketsec.scrollIntoView({block: 'start', inline: 'nearest', behavior: 'smooth'});\n break;\n case 'menu-subscribe':\n subscribesec.scrollIntoView({block: 'start', inline: 'nearest', behavior: 'smooth'});\n break;\n default:\n break;\n }\n }", "function scrollToSection() {\n\n const designatedEvent = 'click';\n\n //add smooth scroll through style sheet to improve ux\n\n navMenu.addEventListener(designatedEvent, function (event) {\n const clickedSection = document.querySelector(`#${event.target.dataset.nav}`)\n clickedSection.scrollIntoView();\n });\n}", "function setSection() {\n\t$(\".main-nav a\").click(function(e){\n\t\te.preventDefault();\n\t\tvar sectionID = e.currentTarget.id + \"Section\";\n\n\t\t$(\"html, body\").animate({\n\t\t\tscrollTop: $(\"#\" + sectionID).offset().top +(-55)\n\t\t}, 1000)\n\t})\n}", "function scrollToSection(){\n if(event.target.nodeName==='A'){\n event.preventDefault();\n let section=document.querySelector(event.target.hash);\n changeActiveLink(section);\n secCoordinates=getCoords(section);\n window.scrollTo({\n left:secCoordinates.left,\n top:secCoordinates.top,\n behavior:\"smooth\"});\n }\n}", "function selectSection() {\n for (section of sections) {\n let rect = section.getBoundingClientRect();\n let navItem = document.querySelector('#navbar__list li a[data-id='+ section.getAttribute('id')+']')\n //calculate the position of each section using the getboundingclientrect function\n\n //then we need to compare that position with a value like 200 and -200\n // console.log(\"top:\" + rect.top, \"bottom:\" + rect.bottom, \"window:\" +window.scrollY)\n if(rect.top <= 200 && rect.top >= -200){\n //if true - add a class your-active-class to the active section\n section.classList.add(\"your-active-class\");\n navItem.classList.add(\"active\");\n }\n else {\n //if not then we need to remove the class your-active-class from the section\n section.classList.remove(\"your-active-class\");\n navItem.classList.remove('active');\n }\n }\n}", "function onScroll(event){\n\tvar scrollPosition = $(document).scrollTop();\n\t$('.schedule-menu a').each(function () {\n\t\tvar currentLink = $(this);\n\t\tvar refElement = $(currentLink.attr(\"href\"));\n\t\tif (refElement.position().top <= scrollPosition && refElement.position().top + refElement.height() > scrollPosition) {\n\t\t\t$('schedule-menu a').removeClass(\"active\");\n\t\t\tcurrentLink.addClass(\"active\");\n\t\t}\n\t\telse{\n\t\t\tcurrentLink.removeClass(\"active\");\n\t\t}\n\t});\n}", "function scrollToView(event){\n const listItem = event.target;\n const sectionId =listItem.getAttribute('name');\n const section = document.getElementById(sectionId);\n window.scrollTo({\n top: section.getBoundingClientRect().y + window.scrollY,\n behavior: 'smooth'\n });\n /*const listItems = document.querySelectorAll('li');\n for(let i=0; i<listItems.length; i++){\n if(listItem === listItems[i]){\n listItem.classList.add('active');\n } else {\n listItems[i].classList.remove('active');\n }\n }*/\n}", "function goto_section(event){\n\n let wantedSection = event.target.textContent;\n let found = undefined; \n \n for(section of sections){ \n (section.getAttribute(\"data-nav\") == wantedSection) && (found = section);\n }\n \n window.scrollTo({\n top: found.offsetTop - 100,\n behavior: 'smooth',\n }) \n \n}", "function scrollTo(event){\n if(event.target.parentNode.nodeName == 'LI' && event.target.tagName == 'SPAN' && event.target.classList.contains(\"menu__link\")){\n for ( let i = 0; i < sectionList.length; i++ ) {\n let section = sectionList[i];\n if(event.target.getAttribute('classList') == section.getAttribute('data-nav')){\n section.scrollIntoView({ behavior: \"smooth\"});\n break;\n }\n }\n }\n}", "function scrollMenuActive() {\n\n\t\t\t\t\t$('nav ul li a[href^=\"#\"]').each(function() {\n\n\t\t\t\t\t\tvar btn = $(this);\n\n\t\t\t\t\t\tif (isScrolledIntoView(btn.attr('active'))) {\n\t\t\t\t\t\t\tbtn.closest('li').addClass('active');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tbtn.closest('li').removeClass('active');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\n\t\t\t\t}", "function active(){\n \n sections.forEach(section =>{\n \tlet rectangle = section.getBoundingClientRect();\n if( rectangle.top >= 0 && rectangle.top <= 400 ){\n // Set sections as active\n document.querySelector('.your-active-class')?.classList.remove('your-active-class');\n section.classList.add(\"your-active-class\");\n\n const linklist = document.querySelectorAll('a');\n\n linklist.forEach( a => {\n if( a.textContent == section.getAttribute(\"data-nav\") ){\n \t document.querySelector('.activelink')?.classList.remove('activelink');\n a.classList.add('activelink');\n \t }\n });\n }\n });\n }", "function clicknav(){\n $(\"a,.clicknav\").click(function(event){\n var el = $($(this).data('clicknav'));\n var offset = $(this).data('clicknav-offset');\n\n if (typeof offset === 'undefined') {\n offset = 100;\n }\n\n if (!el[0]) {\n var href = $(this).attr('href');\n if (href[0] === '#') {\n el = $($(this).attr('href'));\n }\n }\n\n if (el[0]) {\n $('body,html').animate({'scrollTop':el.offset().top - offset},500,'swing');\n event.preventDefault();\n }\n });\n }", "function toggleActiveState() {\n document.addEventListener(\"scroll\", function (event) {\n const sections = document.querySelectorAll(\"section\");\n let links = document.querySelectorAll(\".menu__link\");\n for (const section of sections) {\n if(isElementOnScreen(section)) {\n section.classList.add('your-active-class') //\n links.forEach((link) => {\n const isActiveLink = link.getAttribute(\"href\") === section.id;\n link.classList.toggle(\"link__active\", isActiveLink);\n });\n } else {\n section.classList.remove(\"your-active-class\");\n }\n }\n });\n }", "function setURLandNav(){\n let\n s = document.querySelectorAll('nav ul li a'),\n a = document.querySelectorAll('section');\n \n if(s.length>0){\n Array.prototype.forEach.call(s, function(elm, idx){ \n removeClass(elm,'active');\n });\n \n Array.prototype.forEach.call(a, function(el, i){\n if(el.querySelector('h2')){\n if (elementInViewport(el.querySelector('h2'))) {\t\n console.log(el.querySelector('h2').textContent);\n Array.prototype.forEach.call(s, function(elm, idx){ \n if(elm.href.indexOf('#'+el.id)>-1 && Math.max(document.body.scrollTop,document.documentElement.scrollTop)>50){\t\n history.pushState(null, null, \"#\"+el.id);\t\n addClass(elm,'active');\n } else {\n removeClass(elm,'active');\n }\n });\n } \n } else {\n if (elementInViewport(el)) {\t\n Array.prototype.forEach.call(s, function(elm, idx){ \n if(elm.href.indexOf('#'+el.id)>-1 && Math.max(document.body.scrollTop,document.documentElement.scrollTop)>50){\t\n history.pushState(null, null, \"#\"+el.id);\t\n addClass(elm,'active');\n } else {\n removeClass(elm,'active');\n }\n });\n } \n }\n });\n if(Math.max(document.body.scrollTop,document.documentElement.scrollTop)<50){\n addClass(s[0],'active');\n }\n }\t \t\n }", "function toggleActiveClass() {\r\n allSections.forEach(sec => {\r\n let location = sec.getBoundingClientRect(); // get the section dimensions\r\n let allAnchors = document.querySelectorAll('.menu__link'); // store all anchors\r\n if (location.top > -50 && location.top < 250) { // condition for selecting section in viewport\r\n removeActiveClass(); // remove active classs from sections\r\n addActiveClass(sec); // applying active class to the section in viewport\r\n }\r\n allAnchors.forEach(link => {\r\n link.classList.remove('active__class');\r\n if (sec.getAttribute('data-nav') == link.textContent ) {\r\n link.classList.add('active__class');\r\n }\r\n });\r\n });\r\n}", "function scrollActive(){\n // Definimos la variable de pagina actual\n const scrollY = window.pageYOffset;\n //Por las secciones antes consideradas hacemos un ciclo mientras nos encontremos visualizando x seccion de la seccion\n sections.forEach(current => {\n const sectionHeight = current.offsetHeight;\n const sectionTop = current.offsetTop - 50;\n sectionId = current.getAttribute('id');\n\n if (scrollY > sectionTop && scrollY <= sectionTop+sectionHeight){\n document.querySelector('.nav__menu a[href*=' + sectionId +']').classList.add('active-link');\n }else{\n document.querySelector('.nav__menu a[href*=' + sectionId +']').classList.remove('active-link');\n }\n })\n}", "function active() {\r\n for (section of sections) {\r\n const navbar__menu = document.querySelector(`a[href=\"#${section.getAttribute(\"id\")}\"]`);\r\n if (Viewport(section)) {\r\n section.classList.add(\"your-active-class\");\r\n navItemLink.classList.add(\"menu__link__active\");\r\n \r\n } else {\r\n section.classList.remove(\"your-active-class\");\r\n navItemLink.classList.remove(\"menu__link__active\");\r\n }\r\n }\r\n }", "function setActiveElementOnScroll(){\n //listen to scroll events and set your-active-class class to section in view\n document.addEventListener('scroll', function(evt) {\n for (let i = 0; i < all_sections_list.length; i++){\n //Retrieve the active section\n const active_section = all_sections_list[i];\n //Add the section's title to the menu nav bar\n if (elementInViewport(active_section)) {\n console.log(active_section.querySelector('h2').innerHTML + ' is in the ViewPort');\n active_section.setAttribute('class', 'your-active-class');\n //set the respective menu link to it's active/hover state\n const active_section_title = active_section.querySelector('h2').innerHTML.toLowerCase();\n const active_section_id = active_section_title.replace(/\\s+/g, '');\n console.log('Active section ID: ' + active_section_id);\n const nav_bar_list_item = document.querySelector('#' + active_section_id + '_menu');\n nav_bar_list_item.classList.add('active_section');\n //Remove active-class from the other menu items (lazy method :/)\n if (i == 0){\n console.log(\"At section 1, removing active-class from other menu items\")\n const active_section_1 = all_sections_list[i+1];\n const active_section_2 = all_sections_list[i+2];\n const active_section_3 = all_sections_list[i+3];\n //remove 'active-class' from section one\n const active_section_title_1 = active_section_1.querySelector('h2').innerHTML.toLowerCase();\n const active_section_id_1 = active_section_title_1.replace(/\\s+/g, '');\n console.log('Active section ID: ' + active_section_id_1);\n const nav_bar_list_item_1 = document.querySelector('#' + active_section_id_1 + '_menu');\n if (nav_bar_list_item_1.classList.contains('active_section')){\n nav_bar_list_item_1.classList.remove('active_section')\n }\n \n //remove 'your-active-class' from section two\n const active_section_title_2 = active_section_2.querySelector('h2').innerHTML.toLowerCase();\n const active_section_id_2 = active_section_title_2.replace(/\\s+/g, '');\n console.log('Active section ID: ' + active_section_id_2);\n const nav_bar_list_item_2 = document.querySelector('#' + active_section_id_2 + '_menu');\n if (nav_bar_list_item_2.classList.contains('active_section')){\n nav_bar_list_item_2.classList.remove('active_section')\n }\n\n //remove 'your-active-class' from section 3\n const active_section_title_3 = active_section_3.querySelector('h2').innerHTML.toLowerCase();\n const active_section_id_3 = active_section_title_3.replace(/\\s+/g, '');\n console.log('Active section ID: ' + active_section_id_3);\n const nav_bar_list_item_3 = document.querySelector('#' + active_section_id_3 + '_menu');\n if (nav_bar_list_item_3.classList.contains('active_section')){\n nav_bar_list_item_3.classList.remove('active_section')\n }\n } else if (i == 1){\n console.log(\"At section 2, removing active-class from other menu items\")\n const active_section_1 = all_sections_list[i-1];\n const active_section_2 = all_sections_list[i+1];\n const active_section_3 = all_sections_list[i+2];\n //remove 'active-class' from section one\n const active_section_title_1 = active_section_1.querySelector('h2').innerHTML.toLowerCase();\n const active_section_id_1 = active_section_title_1.replace(/\\s+/g, '');\n console.log('Active section ID: ' + active_section_id_1);\n const nav_bar_list_item_1 = document.querySelector('#' + active_section_id_1 + '_menu');\n if (nav_bar_list_item_1.classList.contains('active_section')){\n nav_bar_list_item_1.classList.remove('active_section')\n }\n \n //remove 'your-active-class' from section two\n const active_section_title_2 = active_section_2.querySelector('h2').innerHTML.toLowerCase();\n const active_section_id_2 = active_section_title_2.replace(/\\s+/g, '');\n console.log('Active section ID: ' + active_section_id_2);\n const nav_bar_list_item_2 = document.querySelector('#' + active_section_id_2 + '_menu');\n if (nav_bar_list_item_2.classList.contains('active_section')){\n nav_bar_list_item_2.classList.remove('active_section')\n }\n\n //remove 'your-active-class' from section 3\n const active_section_title_3 = active_section_3.querySelector('h2').innerHTML.toLowerCase();\n const active_section_id_3 = active_section_title_3.replace(/\\s+/g, '');\n console.log('Active section ID: ' + active_section_id_3);\n const nav_bar_list_item_3 = document.querySelector('#' + active_section_id_3 + '_menu');\n if (nav_bar_list_item_3.classList.contains('active_section')){\n nav_bar_list_item_3.classList.remove('active_section')\n }\n } else if (i == 2){\n console.log(\"At section 3, removing active-class from other menu items\")\n const active_section_1 = all_sections_list[i-2];\n const active_section_2 = all_sections_list[i-1];\n const active_section_3 = all_sections_list[i+1];\n //remove 'active-class' from section one\n const active_section_title_1 = active_section_1.querySelector('h2').innerHTML.toLowerCase();\n const active_section_id_1 = active_section_title_1.replace(/\\s+/g, '');\n console.log('Active section ID: ' + active_section_id_1);\n const nav_bar_list_item_1 = document.querySelector('#' + active_section_id_1 + '_menu');\n if (nav_bar_list_item_1.classList.contains('active_section')){\n nav_bar_list_item_1.classList.remove('active_section')\n }\n \n //remove 'your-active-class' from section two\n const active_section_title_2 = active_section_2.querySelector('h2').innerHTML.toLowerCase();\n const active_section_id_2 = active_section_title_2.replace(/\\s+/g, '');\n console.log('Active section ID: ' + active_section_id_2);\n const nav_bar_list_item_2 = document.querySelector('#' + active_section_id_2 + '_menu');\n if (nav_bar_list_item_2.classList.contains('active_section')){\n nav_bar_list_item_2.classList.remove('active_section')\n }\n\n //remove 'your-active-class' from section 3\n const active_section_title_3 = active_section_3.querySelector('h2').innerHTML.toLowerCase();\n const active_section_id_3 = active_section_title_3.replace(/\\s+/g, '');\n console.log('Active section ID: ' + active_section_id_3);\n const nav_bar_list_item_3 = document.querySelector('#' + active_section_id_3 + '_menu');\n if (nav_bar_list_item_3.classList.contains('active_section')){\n nav_bar_list_item_3.classList.remove('active_section')\n }\n }else if (i == 3){\n console.log(\"At section 4, removing active-class from other menu items\")\n const active_section_1 = all_sections_list[i-3];\n const active_section_2 = all_sections_list[i-2];\n const active_section_3 = all_sections_list[i-1];\n //remove 'active-class' from section one\n const active_section_title_1 = active_section_1.querySelector('h2').innerHTML.toLowerCase();\n const active_section_id_1 = active_section_title_1.replace(/\\s+/g, '');\n console.log('Active section ID: ' + active_section_id_1);\n const nav_bar_list_item_1 = document.querySelector('#' + active_section_id_1 + '_menu');\n if (nav_bar_list_item_1.classList.contains('active_section')){\n nav_bar_list_item_1.classList.remove('active_section')\n }\n \n //remove 'your-active-class' from section two\n const active_section_title_2 = active_section_2.querySelector('h2').innerHTML.toLowerCase();\n const active_section_id_2 = active_section_title_2.replace(/\\s+/g, '');\n console.log('Active section ID: ' + active_section_id_2);\n const nav_bar_list_item_2 = document.querySelector('#' + active_section_id_2 + '_menu');\n if (nav_bar_list_item_2.classList.contains('active_section')){\n nav_bar_list_item_2.classList.remove('active_section')\n }\n\n //remove 'your-active-class' from section 3\n const active_section_title_3 = active_section_3.querySelector('h2').innerHTML.toLowerCase();\n const active_section_id_3 = active_section_title_3.replace(/\\s+/g, '');\n console.log('Active section ID: ' + active_section_id_3);\n const nav_bar_list_item_3 = document.querySelector('#' + active_section_id_3 + '_menu');\n if (nav_bar_list_item_3.classList.contains('active_section')){\n nav_bar_list_item_3.classList.remove('active_section')\n }\n }\n }else{\n console.log(\"Error checking whether element is in viewPort\")\n }\n }\n })\n}", "function setActive () {\n window.addEventListener('scroll', function (event) {\n let section = getActiveElem();\n section.classList.add('your-active-class');\n // set other sections as inactive\n for (let item of sectionList) {\n if (item.id != section.id & item.classList.contains('your-active-class')) {\n item.classList.remove('your-active-class');\n }\n }\n // set corresponding header style\n const active = document.querySelector('li > a[data-id=\"' + section.id + '\"]');\n active.classList.add('active__link');\n // remove from other headers\n const headers = document.querySelectorAll('.menu__link');\n for (let item of headers) {\n if (item.dataset.id != active.dataset.id & item.classList.contains('active__link')) {\n item.classList.remove('active__link');\n }\n };\n });\n}", "function addMenuActiveClassOnScrolling() {\n\n\t//Grab sections (targets) and menu links (trigers) for menu items to apply active links styles to\n\tconst sections = document.querySelectorAll('.resume__section'),\n\t\tmenu_links = document.querySelectorAll('.grid__header--nav--item');\n\n\t//Functions for adding and removing active class from links as appropriate\n\tconst makeActive = link => menu_links[link].classList.add('active');\n\n\tconst removeActive = link => menu_links[link].classList.remove('active');\n\n\tconst removeAllActive = () => [...Array(sections.length).keys()].forEach(link => removeActive(link));\n\n\t// change the active link a bit above the actual section\n\t// this way it will change as you're approaching the section rather\n\t// than waiting until the section has passed the top of the screen\n\tconst sectionMargin = 100;\n\n\t// keep track of the currently active link\n \t// use this so as not to change the active link over and over\n \t// as the user scrolls but rather only change when it becomes\n \t// necessary because the user is in a new section of the page\n\tlet currentActive = 0;\n\n\twindow.addEventListener('scroll', () => {\n\t\t/*\n\t\t\t// check in reverse order so we find the last section\n\t\t\t// that's present - checking in non-reverse order would\n\t\t\t// report true for all sections up to and including\n\t\t\t// the section currently in view\n\t\t\t//\n\t\t\t// Data in play:\n\t\t\t// window.scrollY - is the current vertical position of the window\n\t\t\t// sections - is a list of the dom nodes of the sections of the page\n\t\t\t// [...sections] turns this into an array so we can\n\t\t\t// use array options like reverse() and findIndex()\n\t\t\t// section.offsetTop - is the vertical offset of the section from the top of the page\n\t\t\t//\n\t\t\t// basically this lets us compare each section (by offsetTop) against the\n\t\t\t// viewport's current position (by window.scrollY) to figure out what section\n\t\t*/\n\n\t\t// the user is currently viewing\n\t\tconst current = sections.length - [...sections].reverse().findIndex(section => window.scrollY >= section.offsetTop - sectionMargin) - 1;\n\n\t\t// only if the section has changed\n \t// remove active class from all menu links\n \t// and then apply it to the link for the current section\n\n\t\tif (current !== currentActive) {\n\t\t\tremoveAllActive();\n\t\t\tcurrentActive = current;\n\t\t\tmakeActive(current);\n\t\t}\n\t}, false);\n}", "function setToActive () {\n window.addEventListener('scroll', function (event) {\n let section = getActiveSection();\n section.classList.add('your-active-class');\n // set other sections as inactive\n for ( i of sections) {\n if (i.id != section.id & i.classList.contains('your-active-class')) {\n i.classList.remove('your-active-class');\n }\n }\n // set the header style to list element\n const active = document.querySelector('li[data-nav=\"' + section.id + '\"]'); // get the corresponding list element\n active.classList.add('active__link'); // added to the css\n // remove from other list elements\n const elements = document.querySelectorAll('.menu__link');\n for ( i of elements) {\n if (i.dataset.nav != active.dataset.nav & i.classList.contains('active__link')) {\n i.classList.remove('active__link');\n }\n }\n })\n}", "function doActive(scroll_pos) {\r\n for (let num = 1; num <= sections.length; num++) {\r\n if (window.scrollY >= pos[num - 1] - 50 && window.scrollY <= pos[num - 1] + 500) {\r\n sections[num - 1].classList.add('your-active-class');\r\n a[num - 1].classList.add(\"active\");\r\n } else {\r\n sections[num - 1].classList.remove('your-active-class');\r\n a[num - 1].classList.remove(\"active\");\r\n }\r\n }\r\n}", "function _navigateToSection() {\n var to = this.getAttribute('data-ref');\n var nav = app.navigator();\n if (!isOnSameGroup.call(this, nav, to)) {\n _navigateToSlide.call(this, this.parentElement.getAttribute('data-ref'));\n nav = app.navigator();\n }\n\n var fromSection = d.querySelector('[data-page=\"' + nav.active() + '\"]');\n\n // Pasar a otro evento\n if (this.classList.contains('is-up')) {\n goIndex();\n return;\n }\n\n var to = nav.to.call(this), //nav.next(),\n toSection = d.querySelector('[data-page=\"' + to + '\"]');\n\n var index = getIndex(fromSection.parentElement.querySelectorAll('.section'), toSection);\n fromSection.parentElement.style.left = (index * -100) + 'vw';\n }", "function focusOnScroll() {\n sections.forEach(section => section.classList.remove('section-active'));\n if (isElementInViewport(heading)) {\n navList.childNodes[0].classList.add('nav-active');\n navList.childNodes.forEach((navLink, index) =>\n index && navLink.classList.remove('nav-active'));\n } else {\n const actIndex = sections.findIndex(section => isElementInViewport(section.childNodes[1].childNodes[1]));\n const actSection = sections[actIndex];\n const actLink = navList.childNodes[actIndex + 1];\n actSection && actSection.classList.add('section-active');\n actLink && actLink.classList.add('nav-active');\n navList.childNodes.forEach((navLink, index) =>\n index !== (actIndex + 1) && navLink.classList.remove('nav-active'));\n }\n}", "function addScrollListener(){\n document.addEventListener('scroll', function () {\n for (section of sections){\n const linkId = section.getAttribute('data-menu-item');\n const menuItem = document.getElementById(linkId);\n if (isInViewport(section)){\n console.log('in view ' + section.getAttribute('id'));\n section.classList.add(\"your-active-class\");\n menuItem.classList.add('active-link');\n }else{\n section.classList.remove(\"your-active-class\");\n menuItem.classList.remove('active-link');\n }\n }\n }, {\n passive: true\n });\n}", "function updateActive(){\n let currentView = document.documentElement.scrollTop;\n for ( let i = 0; i < sectionList.length; i++ ) {\n let section = sectionList[i];\n const navItem = document.getElementById(section.getAttribute('data-nav'));\n if(currentView >= section.offsetTop - 1 && currentView < section.offsetTop + section.offsetHeight - 1){\n if(!section.classList.contains('your-active-class')){\n section.classList.add('your-active-class');\n navItem.classList.add('active');\n }\n } else {\n section.classList.remove('your-active-class');\n navItem.classList.remove('active');\n }\n }\n}", "function clickHandler(event)\n {\n console.log(\"offers\" + document.getElementsByClassName(\"footer\")[0].offsetTop);\n // Get value of current clicked item\n const data = event.target.firstChild.data;\n // Find class of pressed element and move to the section\n Object.keys(NavItemsData).forEach(i => {\n if(NavItemsData[i].name == data)\n {\n document.getElementsByClassName(NavItemsData[i].position)[0].scrollIntoView({ behavior: 'smooth' });\n }\n });\n }", "function activeAsScroll(){\n let navStart =[document.querySelector('#direction').getBoundingClientRect().y,document.querySelector('#about').getBoundingClientRect().y,document.querySelector('#event').getBoundingClientRect().y\n ,document.querySelector('#contact').getBoundingClientRect().y];//to know at which y each section start\n let navItem = document.querySelectorAll('li');\n if(scrollValue <navStart[0]+50){\n removeActiveClass();//home part\n navItem[0].querySelector('span').classList+=' active';\n }else if(scrollValue >navStart[0]+50 && scrollValue<navStart[1]+50){\n removeActiveClass();//description part\n navItem[1].querySelector('span').classList+=' active';\n }else if(scrollValue >navStart[1] && scrollValue<navStart[2]+100){\n removeActiveClass();\n navItem[2].querySelector('span').classList+=' active';\n }else if(scrollValue >navStart[2]+50 && scrollValue<navStart[3]){\n removeActiveClass();// about part \n navItem[2].querySelector('span').classList+=' active';\n }else if(scrollValue >navStart[3]+50){\n removeActiveClass();\n navItem[3].querySelector('span').classList+=' active';\n }else{\n removeActiveClass();// contact part\n navItem[4].querySelector('span').classList+=' active';\n }\n}", "function makeSectionActive(){\n if (window.scrollY > navbarList.offsetTop){\n navbarList.classList.add('sticky');\n }else {\n\n navbarList.classList.remove('sticky');\n }\n for (let i =0; i < allSections.length; i++){\n if ( (window.scrollY+70 > allSections[i].offsetTop && i !== allSections.length-1 && window.scrollY+70 < allSections[i+1].offsetTop) || (window.scrollY+70 > allSections[i].offsetTop && i === allSections.length-1)){\n for (let navItem of navItems){\n if (navItem.innerText === allSections[i].getAttribute('data-nav')){\n navItem.classList.add('active');\n }else {\n navItem.classList.remove('active');\n }\n }\n }\n }\n}", "function setActive() {\n document.addEventListener(\"scroll\", function () {\n let items = menuItens.children;\n\n for (let i = 0; i < mainSections.length; i++) {\n if (\n i === mainSections.length - 1 &&\n window.innerHeight + window.scrollY >=\n document.body.offsetHeight\n ) {\n mainSections[i].classList.add(\"active\");\n items[i].classList.add(\"active\");\n } else if (\n mainSections[i].getBoundingClientRect().top <=\n window.innerHeight / 2 &&\n mainSections[i].getBoundingClientRect().top >=\n window.innerHeight / 2 - mainSections[i].offsetHeight\n ) {\n mainSections[i].classList.add(\"active\");\n items[i].classList.add(\"active\");\n } else {\n mainSections[i].classList.remove(\"active\");\n items[i].classList.remove(\"active\");\n }\n }\n });\n}", "function setSectionIntoViewActive(sections) {\n for (const section of sections) {\n // detect the navigation link that matches the current section\n const activeLink = document.querySelector(\n `a[href=\"#${section.getAttribute(\"id\")}\"]`\n );\n // checks if the current section is near top of viewport\n if (isTopSectionInViewport(section)) {\n // if it is, highlight menu link and section with active styles\n section.classList.add(\"active\");\n activeLink.classList.add(\"menu__link--active\");\n } else {\n // if it is not, remove active styles\n section.classList.remove(\"active\");\n activeLink.classList.remove(\"menu__link--active\");\n }\n }\n}", "function onScroll(event) {\r\n var scrollPosition = $(document).scrollTop();\r\n\r\n /* Cada vez que se referencia en el documento el selector (nav a) se active\r\n la funcion en el documento DOM y almacenamos en una variable la posicion */\r\n $('nav a').each(function () {\r\n var currentLink = $(this);\r\n\r\n\r\n /* almacenamos en una variable la referencia del elemento (href) */\r\n var refElement = $(currentLink.attr(\"href\"));\r\n\r\n /* Luego se realiza la validacion de la posicion del elemento */\r\n if (refElement.position().top <= scrollPosition && refElement.position().top + refElement.height() > scrollPosition) {\r\n $('nav a').removeClass(\"active\");\r\n currentLink.addClass(\"active\");\r\n }\r\n else {\r\n currentLink.removeClass(\"active\");\r\n }\r\n });\r\n }", "function onScroll(event){\n var scrollPos = $(document).scrollTop();\n $('nav ul li a, nav ul ul li a').each(function () {\n var currLink = $(this);\n var refElement = $(currLink.attr(\"href\"));\n if (refElement.position().top <= scrollPos && refElement.position().top + refElement.height() > scrollPos) {\n $('nav ul li a, nav ul ul li a').removeClass(\"active\");\n currLink.addClass(\"active\");\n }\n else{\n currLink.removeClass(\"active\");\n }\n });\n }", "function scrollToHighlight(){\n window.addEventListener(\"scroll\" , function(){\n mySections.forEach((section)=> {\n let view = section.getBoundingClientRect();\n if (view.top >= -250 && view.top <= 200) {\n //add active class to a specific section\n section.classList.add(\"your-active-class\");\n // to highlight a specific link in the nav-menue\n const allLinks = document.querySelectorAll(\"a\");\n allLinks.forEach((alink) => {\n alink.classList.remove(\"activeLink\");\n if(section.getAttribute(\"data-nav\") === alink.textContent){\n alink.classList.add(\"activeLink\");\n }\n })\n }\n else {\n //to remove all other active class from other sections\n section.classList.remove(\"your-active-class\");\n } \n })\n })\n}", "function scrollToSection(e) {\n navbarList.querySelectorAll('a[href^=\"#\"]').forEach(anchor => {\n e.preventDefault();\n if (anchor === e.target) {\n console.log(anchor);\n document.querySelector(e.target.getAttribute('href')).scrollIntoView({\n behavior: 'smooth',\n });\n }\n })\n}", "function addActiveSection() {\n sections.forEach(element => {\n element.classList.remove('your-active-class')\n if (isInView(element.getBoundingClientRect())) {\n element.classList.add('your-active-class');\n const val = element.getAttribute('data-nav')\n addActiveNav(val)\n }\n });\n}", "function makeActive() {\n for (const section of sections) {\n // if section is in Viewport, add \"your-active-class\"\n if (inViewport(section) === true) {\n const id = section.getAttribute(\"id\");\n document.querySelector(`#nav_${id}`).classList.add(\"active\");\n addActiveClass(section);\n // if section is not in Viewport, remove \"your-active-class\"\n } else {\n const id = section.getAttribute(\"id\");\n document.querySelector(`#nav_${id}`).classList.remove(\"active\");\n removeActiveClass(section);\n }\n }\n}", "function navActiveLink(windowScroll)\n {\n let sections = document.querySelectorAll(\".section\");\n sections.forEach((section) => {\n if(windowScroll >= section.offsetTop && windowScroll < (section.offsetTop + section.offsetHeight))\n {\n let sectionID = section.attributes.id.value;\n let navLink = $(`.navbar-collapse .navbar-nav li a[href='#${sectionID}']`);\n navLink.parent().addClass('active').siblings().removeClass('active');\n }\n });\n }", "function activeMenuItem($links) {\n var top = $(window).scrollTop(),\n windowHeight = $(window).height(),\n documentHeight = $(document).height(),\n cur_pos = top + 2,\n sections = $(\"section\"),\n nav = $links,\n nav_height = nav.outerHeight(),\n home = nav.find(\" > ul > li:first\");\n\n sections.each(function() {\n var top = $(this).offset().top - nav_height - 40,\n bottom = top + $(this).outerHeight();\n\n if (cur_pos >= top && cur_pos <= bottom) {\n nav.find(\"> ul > li > a\").parent().removeClass(\"active\");\n nav.find(\"a[href='#\" + $(this).attr('id') + \"']\").parent().addClass(\"active\");\n } else if (cur_pos === 2) {\n nav.find(\"> ul > li > a\").parent().removeClass(\"active\");\n home.addClass(\"active\");\n } else if ($(window).scrollTop() + windowHeight > documentHeight - 400) {\n nav.find(\"> ul > li > a\").parent().removeClass(\"active\");\n }\n });\n }", "function addActive() {\n sections.forEach(section => {\n const bounding = section.getBoundingClientRect();\n const sectionLink = document.querySelector(`a[href=\"#${section.getAttribute('id')}\"]`);\n const sectionHalfShown = section.offsetTop - (section.offsetHeight / 2);\n const sectionBehind = section.offsetTop + (section.offsetHeight / 2);\n if (\n (bounding.top >= 0) &&\n (bounding.left >= 0) &&\n (Math.floor(bounding.right) <= window.innerWidth) &&\n (window.pageYOffset > sectionHalfShown) && (window.pageYOffset <= sectionBehind)) {\n section.classList.add('active');\n sectionLink.classList.add('current');\n } else if (window.pageYOffset >= sectionBehind || window.pageYOffset < section.offsetTop) {\n section.classList.remove('active');\n sectionLink.classList.remove('current');\n }\n })\n}", "function setActive(section) {\n // Add \"active\" state to the section\n section.classList.add('active');\n const navId = section.dataset.navId;\n // Add \"active\" state to the nav item\n document.querySelector('#'+navId).classList.add('active')\n}", "function activeMenuItem($links) {\n var top = $(window).scrollTop(),\n windowHeight = $(window).height(),\n documentHeight = $(document).height(),\n cur_pos = top + 2,\n sections = $('section'),\n nav = $links,\n nav_height = nav.outerHeight(),\n home = nav.find(' > ul > li:first');\n\n sections.each(function () {\n var top = $(this).offset().top - nav_height - 40,\n bottom = top + $(this).outerHeight();\n\n if (cur_pos >= top && cur_pos <= bottom) {\n nav.find('> ul > li > a').parent().removeClass('active');\n nav\n .find(\"a[href='#\" + $(this).attr('id') + \"']\")\n .parent()\n .addClass('active');\n } else if (cur_pos === 2) {\n nav.find('> ul > li > a').parent().removeClass('active');\n home.addClass('active');\n } else if ($(window).scrollTop() + windowHeight > documentHeight - 400) {\n nav.find('> ul > li > a').parent().removeClass('active');\n }\n });\n }", "function dotnavigation() {\n\n var numSections = $('section').length;\n \n $('#dot-nav li a').removeClass('active').parent('li').removeClass('active');\n $('section').each(function (i, item) {\n var ele = $(item),nextTop;\n \n //console.log(ele.next().html());\n \n if (typeof ele.next().offset() != \"undefined\") {\n nextTop = ele.next().offset().top;\n } else\n {\n nextTop = $(document).height();\n }\n \n if (ele.offset() !== null) {\n thisTop = ele.offset().top - (nextTop - ele.offset().top) / numSections;\n } else\n {\n thisTop = 0;\n }\n \n var docTop = $(document).scrollTop();\n \n if (docTop >= thisTop && docTop < nextTop) {\n $('#dot-nav li').eq(i).addClass('active');\n }\n });\n }", "function scrollSelection(event) {\n if (event.target.nodeName == 'A') {\n const sectionId = event.target.getAttribute('data-id');\n const section = document.getElementById(sectionId);\n section.scrollIntoView({behavior: \"smooth\"});\n }\n}", "function bringActiveSectionToViewPort(){\n\n const designatedEvent = 'scroll';\n\n window.addEventListener(designatedEvent, () => {\n console.log('scroll is working');\n presentSection = sectionIsInViewPort();\n if (sectionIsInViewPort(presentSection)) {\n deActivateSectionsNotInViewPort();\n presentSection.classList.add(\"your-active-class\");\n } \n });\n}", "function SetAciveSectionOnViewport() {\r\n const sectionsList = getAllSections();\r\n let tops = [];\r\n let obj = {};\r\n for (let section of sectionsList) {\r\n section.classList.remove('active');\r\n document.querySelector(`#a${section.id.substring(0, 1).toUpperCase()}${section.id.substring(1, section.id.length)}`).classList.remove('menu__link__active');\r\n if (isInViewport(document.querySelector(`#${section.id}`))) {\r\n obj = { Id: section.id, top: document.querySelector(`#${section.id}`).offsetTop };\r\n tops.push(obj);\r\n }\r\n }\r\n if (tops.length == 0)\r\n return;\r\n let minTopObj = tops.reduce(function (prev, curr) {\r\n return prev.top < curr.top ? prev : curr;\r\n });\r\n document.querySelector(`#${minTopObj.Id}`).classList.add('active');\r\n document.querySelector(`#a${minTopObj.Id.substring(0, 1).toUpperCase()}${minTopObj.Id.substring(1, minTopObj.Id.length)}`).classList.add('menu__link__active');\r\n}", "function setActiveSect() {\n let dimensionsArr = {};\n landingPageSections.forEach((sect, index) => {\n let sectDimension = getElmDimensions(sect);\n dimensionsArr[getSectDistanceFromCenter(sectDimension).toFixed(0)] = index;\n });\n let currentlyActiveSectionIndex =\n dimensionsArr[Math.min(...Object.keys(dimensionsArr))],\n currentlyActiveSection = landingPageSections[currentlyActiveSectionIndex];\n if (currentlyActiveSection.classList.contains(\"currently__shown\")) {\n return;\n }\n document\n .querySelector(\".currently__shown\")\n .classList.remove(\"currently__shown\");\n document\n .querySelector(\".currently__active\")\n .classList.remove(\"currently__active\");\n document\n .querySelectorAll(\".menu__link\")\n [currentlyActiveSectionIndex].classList.add(\"currently__active\");\n currentlyActiveSection.classList.add(\"currently__shown\");\n}", "function clickonheads() {\r\n navbar.addEventListener(\"click\", function(event) {\r\n let chosensection = document.querySelector(\"#\" + event.target.dataset.nav)\r\n chosensection.scrollIntoView();\r\n });\r\n}", "function jumpto(sectionName){\n //window.location.hash = sectionName;\n document.getElementById(sectionName).scrollIntoView({behavior: 'smooth'});\n\n $('#dropdown').removeClass('show-dropdown');\n $('#dropdown').addClass('hide-dropdown');\n}", "function setActive() {\n document.addEventListener('scroll', function () {\n sectionList[0].classList.remove(\"active\")\n const sectionHeight = sectionList[0].offsetHeight;\n\n for (i = 0; i < sectionList.length; i++) {\n\n if (window.scrollY >= headerEl.offsetHeight + (sectionHeight * i) &&\n window.scrollY < headerEl.offsetHeight + (sectionHeight * (i + 1))\n ) {\n sectionList[i].classList.add('your-active-class');\n navbarList.children[i].classList.add('active');\n }\n else {\n sectionList[i].classList.remove('your-active-class');\n navbarList.children[i].classList.remove('active');\n }\n }\n\n })\n\n}", "function addActiveClass(selector, class_name) {\n const sections = document.querySelectorAll(selector);\n const menu_items = document.querySelectorAll('.menu__link')\n for (let i = 0; i < sections.length; i++) {\n const section = sections[i];\n const item = menu_items[i];\n document.addEventListener('scroll', function() {\n const sectionTitle = isInViewport(section);\n\n if(sectionTitle) {\n section.classList.add(class_name);\n item.classList.add(class_name)\n }\n else {\n section.classList.remove(class_name);\n item.classList.remove(class_name);\n }\n })\n }\n}", "function onScroll(){\n const scrollPos = $(document).scrollTop();\n $('.navbar-start a').each(function () {\n const currLink = $(this);\n const refElement = $(currLink.attr('href'));\n if (refElement.position().top <= scrollPos + 52 && refElement.position().top + refElement.height() > scrollPos) {\n $('.navbar-start ul li a').removeClass('active');\n currLink.addClass('active');\n } else{\n currLink.removeClass('active');\n }\n });\n }", "function addActive(){ \n for(let section of sectionList){\n let head=document.querySelector(`#${section.id} h2`);\n if(head.getBoundingClientRect().top <= window.innerHeight && head.getBoundingClientRect().top >=0){\n section.classList.add('your-active-class');\n changeActiveLink(section);\n }\n else{\n section.classList.remove('your-active-class');\n }\n }\n}", "function setActiveSection(){\n sections.forEach(function(section){\n const rect = section.getBoundingClientRect();// using bounding to get section's position in the view port\n\n\n if(rect.top>-270&&rect.top <458){\n // first we remove class from all sections\n sections.forEach(function(sc){\n sc.removeAttribute('class');\n \n });\n // then add class name to the Active section\n section.className = 'your-active-class';\n \n \n }\n \n });\n}", "function updateActiveSection(){\n\t\n\t//get cuurent location\n\tlet viewPortLocation = document.documentElement.scrollTop || document.body.scrollTop\n\t\n\tlet activeIndex = 0;\n\tlet minmiumDifference = 10000;\n\t\n\t//first thing to do is to clear all sections' classes\n\tfor(let i=0; i< sectionsList.length; i++){\n\t\tsectionsList[i].classList.remove('your-active-class');\n\t\tmyMenu.children[i].classList.remove('active-li');\n\t\t\n\t\t//calculate the difference between current location and section location\n\t\tlet diff = Math.abs(sectionsList[i].offsetTop - viewPortLocation);\n\t\tif(diff < minmiumDifference)\n\t\t{\n\t\t\tminmiumDifference = diff;\n\t\t\tindex = i;\n\t\t}\n\t}\n\t\n\t//choose current displayed section to be active\n\tsectionsList[index].classList.add('your-active-class');\n\tmyMenu.children[index].classList.add('active-li');\n}", "function setActiveClass() {\n for (let i = 0; i < sections.length; i++) { // i used this for loop insted of \"of\" so i can get the button and section using the same index insted of using 2 for loops\n let section = sections[i];\n let rectTop = section.getBoundingClientRect().top\n if (rectTop < 300 && rectTop > -400) {\n console.log(section.id + \" \" + rectTop)\n resetActiveElements() \n activeElemet = section\n activeButton = buttons[i]\n section.classList.add(\"your-active-class\")\n activeButton.classList.add(\"selected-button\")\n //window.history.pushState(\"\", \"/\", section.id );\n return\n }\n }\n\n resetActiveElements() // rmove the active elements if we scroll top and there is no section showd\n\n}", "function ScrollToAnchorID(e) {\n for (let section of Sections) {\n if (e.target.textContent == section.getAttribute('data-nav')) {\n let TopResponsive\n if (document.documentElement.clientWidth < 1000) {\n TopResponsive = 180;\n } else {\n TopResponsive = 120;\n }\n window.scrollTo({\n top: getOffset(section).top - TopResponsive,\n left: getOffset(section).left,\n behavior: 'smooth'\n });\n }\n }\n}", "function ActiveSection() {\n //add an event listenr of type scroll\n window.addEventListener(\"scroll\", () => {\n //loop through all the added sections to get the top of height for each section\n //to return the size of an element and its position relative to the viewport\n for (let i = 0; i < section_numbers.length; i++) {\n let rect = section_numbers[i].getBoundingClientRect();\n\n //determine if the user scrolling to the top for each section or not\n //by adding a condition needed to determine if the top of the needed section is greater than zero\n // or if the top is smaller than the needed height corrseponding to the view port\n if (rect.top > 0 && rect.top < 400) {\n //declare a variable that catch the data nav\n let DataNav = section_numbers[i].getAttribute(\"data-nav\");\n //if active section is found , remove the active class from the rest sections\n\n for (let j = 0; j < section_numbers.length; j++) {\n section_numbers[j].classList.remove(\"your-active-class\");\n }\n section_numbers[i].classList.add(\"your-active-class\");\n //declare a new varibale to collect all the added links to the list\n\n let Attached_links = document.querySelectorAll(\"a\");\n\n for (let k = 0; k < Attached_links.length; k++) {\n if (Attached_links[k] == DataNav) {\n for (let z = 0; z < Attached_links.length; k++) {\n Attached_links[z].classList.add(\"link-active-class\");\n }\n Attached_links[k].classList.add(\"link-active-class\");\n }\n }\n }\n }\n });\n}", "function scrollHandler() {\n const element = document.getElementById(\"navbar__list\");\n element.addEventListener(\"click\", (e) => {\n const href = element.getAttribute(\"href\");\n // Remove old active class and add the new active class\n const active = document.getElementsByClassName(\".your-active-class\");\n if (active !== null) {\n active.classList.remove(\".your-active-class\");\n }\n e.target.className = \"link__active\";\n element.scrollIntoView({ block: 'end', behavior: 'smooth' });\n });\n }", "function goTo(e, section){\n if (!jumpingToSection){\n\n // animateNav(e);\n\n switch (section){\n case 'home':\n jumpToSection(0,0);\n toggleContent('#front');\n setColors(['#4286f4', '#1b4b99', 'rgba(27, 75, 153,0.85)' ]);\n break;\n case 'about':\n jumpToSection(180,0);\n toggleContent('#back');\n setColors(['#f48c41', '#a55113', 'rgba(165, 81, 19,0.85)' ]);\n\n break;\n case 'skills':\n jumpToSection(90,0);\n toggleContent('#left');\n setColors(['#a054f7', '#6929b2', 'rgba(105, 41, 178,0.85)' ]);\n\n break;\n case 'projets':\n jumpToSection( -90,0);\n toggleContent('#right');\n setColors(['#8ee24d', '#549125', 'rgba(84, 145, 37,0.85)' ]);\n break;\n case 'experience':\n jumpToSection(0,-90);\n toggleContent('#top');\n setColors(['#e24852', '#a02028', 'rgba(160, 32, 40,0.85)' ]);\n break;\n case 'misc':\n jumpToSection(0,90);\n toggleContent('#bottom');\n setColors(['#f2d848', '#96841e', 'rgba(150, 132, 30,0.85)' ]);\n break;\n }\n }\n}", "function _navTo( n ) {\n\t\t// go to it\n\t\t$( \"#taxa > section\", _sandbox.context ).scrollTo( \"#\" + n.link.attr( \"id\" ), 100, { offset: -45 } );\n\t}", "function Activating() {\r\n window.addEventListener(\"scroll\", function(event) {\r\n let activatedsection = sectioninview();\r\n activatedsection.classList.add(\"your-active-class\");\r\n\r\n\r\n for (const element of allsections) {\r\n if (element.id != activatedsection.id & element.classList.contains(\"your-active-class\")) {\r\n element.classList.remove(\"your-active-class\");\r\n }\r\n }\r\n let activeli = document.querySelector(\"li[data-nav=\" + activatedsection.id + \"]\");\r\n activeli.classList.add(\"active_header\");\r\n\r\n const headers = document.querySelectorAll(\".menu__link\");\r\n for (const element of headers) {\r\n\r\n if (element.dataset.nav != activeli.dataset.nav & element.classList.contains(\"active_header\")) {\r\n element.classList.remove(\"active_header\");\r\n }\r\n };\r\n });\r\n}", "function respondToClick(e){\n sectionLoc = sectionList[e.target.getAttribute('id')-1];\n window.scrollTo({\n top: sectionLoc.offsetTop,\n behavior: \"smooth\",\n })\n}", "function scrollActive(){ \r\n $(\".scroll-sec\").each(function(ind, el) {\r\n if ($(window).scrollTop() > $(el).offset().top - $(\"header\").outerHeight() - 1) {\r\n $(\"nav ul li a\").removeClass('active'); \r\n $(\"nav ul li a[href='#\" + el.id + \"']\").addClass('active'); \r\n }\r\n else{\r\n $(\"nav ul li a[href='#\" + el.id + \"']\").removeClass('active');\r\n } \r\n });\r\n}", "function goToSection(_sectionName,offest){\n var section = document.getElementById(_sectionName) ;\n gsap.to(window, {duration: 1 , scrollTo: {y: section.offsetTop-offest}});\n\n}", "function onScroll(event) {\n let scrollPos = $(document).scrollTop();\n $(\".header__nav a\").each(function() {\n let currLink = $(this);\n let refElement = $(currLink.attr(\"href\"));\n if (\n refElement.position().top - 80 <= scrollPos &&\n refElement.position().top + refElement.height() + 180 > scrollPos\n ) {\n $(\".header__nav a\").removeClass(\"active\");\n currLink.addClass(\"active\");\n } else {\n currLink.removeClass(\"active\");\n }\n });\n }", "function scrollToSection(event) {\n event.preventDefault();\n var $section = $($(this).attr('href'));\n $('html, body').animate({\n scrollTop: $section.offset().top\n }, 700);\n }", "function function2(item1){ // start function \n \n item1.addEventListener('click',function(){ // add event type 'click' and listener function\n \n var elements = document.getElementById(item1.getAttribute('data-nav')); /* get the element by id and this id same like value of data-nav attribut for each link */\n elements.scrollIntoView({behavior:\"smooth\",block:\"start\"}); /* here i used scrollIntoView to scroll the appropriate section when clicking on nav-menu conected by value of id = data-nav */ \n });\n }", "scrollToActive () {\n if (!this._sidebar.classList.contains('sidebar-fixed') || this._scroller === null) return\n\n const active = this._sidebar.querySelector('.nav-item.active:not(.open) > .nav-link')\n try {\n active.scrollIntoView({ behavior: 'auto', block: 'end' })// or block: \"center\"?\n this._scroller.scrollTop = this._scroller.scrollTop + 30\n } catch (e) {}\n }", "function scroll() {\n const navMenu = document.querySelectorAll(\".navbar__menu\");\n for (let nav of navMenu) {\n {\n nav.addEventListener(\"click\", function() {\n for (i = 0; i < section; i++) {\n section[i].scrollIntoView({\n behavior: \"smooth\"\n });\n }\n });\n }\n }\n}", "function contentMenuScrollTo(){\n\t\"use strict\";\n\n\tif($j('nav.content_menu').length){\n\t\t\n\t\t$j(\"nav.content_menu ul.menu li a\").on('click', function(e){\n\t\t\te.preventDefault();\n\t\t\tvar $this = $j(this);\n\t\t\t\n\t\t\tif($j(this).parent().hasClass('active')){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tvar $target = $this.attr(\"href\");\n\t\t\tvar targetOffset = $j(\"div.wpb_row[data-q_id='\" + $target + \"'],section.parallax_section_holder[data-q_id='\" + $target + \"']\").offset().top - content_line_height - content_menu_top - content_menu_top_add;\n\t\t\t$j('html,body').stop().animate({scrollTop: targetOffset }, 500, 'swing', function(){\n\t\t\t\t$j('nav.content_menu ul li').removeClass('active');\n\t\t\t\t$this.parent().addClass('active');\n\t\t\t});\n\n\t\t\treturn false;\n\t\t});\n\t\t\n\t}\n}", "function clickHandler(e) {\n const header = document.getElementById(\"header\");\n header.style.display = \"none\";\n e.preventDefault();\n for( link of links){\n link.classList.remove('active-navlink');\n }\n mainNav.classList.contains('transparent')? mainNav.classList.remove('transparent'): null ;\n const href = this.getAttribute(\"href\");\n this.classList.add('active-navlink');\n console.log(\"I got cliked !\"+href);\n for (section of sections) { \n let sectionId = \"#\"+section.id ;\n if (href === sectionId ) {\n \n section.classList.add('visible');\n document.querySelector(href).scrollIntoView({\n behavior: \"instant\"\n });\n } else {\n section.classList.remove('visible');\n }\n }\n \n ( burger.style.display === \"none\") ? null : toggleNavbar();\n \n \n}", "function redrawDotNav(){\r\n var section1Top = 0;\r\n var section2Top = $('#news').offset().top;\r\n var section3Top = $('#about').offset().top;\r\n var section4Top = $('#login').offset().top;\r\n $('nav#primary a').removeClass('active');\r\n if($(window).scrollTop() >= section1Top && $(document).scrollTop() < section2Top){\r\n $('nav#primary a#home').addClass('active');\r\n } else if ($(window).scrollTop() >= section2Top && $(document).scrollTop() < section3Top){\r\n $('nav#primary a#news').addClass('active');\r\n } else if ($(window).scrollTop() >= section3Top && $(document).scrollTop() < section4Top){\r\n $('nav#primary a#about').addClass('active');\r\n } else if ($(window).scrollTop() >= section4Top){\r\n $('nav#primary a#login').addClass('active');\r\n }\r\n \r\n }", "watchActiveSection() {\n /**\n * Where content zone starts in document\n */\n const contentTopOffset = this.getScrollPadding();\n\n /**\n * Additional offset for correct calculation of active section\n *\n * Cause opening page with anchor could scroll almost\n * near to the target section and we need to add 1px to calculations\n */\n const activationOffset = 1;\n\n const detectSection = () => {\n /**\n * Calculate scroll position\n *\n * @todo research how not to use magic number\n */\n const scrollPosition = contentTopOffset + window.scrollY + activationOffset;\n\n /**\n * Find the nearest section above the scroll position\n */\n const section = this.tagsSectionsMap.filter((tag) => {\n return tag.top <= scrollPosition;\n }).pop();\n\n /**\n * If section found then set it as active\n */\n if (section) {\n const targetLink = section.tag.querySelector('a').getAttribute('href');\n\n this.setActiveItem(targetLink);\n } else {\n /**\n * Otherwise no active link will be highlighted\n */\n this.setActiveItem(null);\n }\n };\n\n /**\n * Define a flag to reduce number of calls to detectSection function\n */\n const throttledDetectSectionFunction = Decorators.throttle(() => {\n detectSection();\n }, 400);\n\n /**\n * Scroll listener\n */\n document.addEventListener('scroll', throttledDetectSectionFunction, {\n passive: true,\n });\n }", "function scrollToSec(){\n const navLinks = document.querySelectorAll(\"[data-link]\");\n navLinks.forEach((item)=>{\n item.addEventListener(\"click\", ()=>{\n let scrLink = document.getElementById(item.getAttribute(\"data-link\")); //scroll to link with Section ID\n scrLink.scrollIntoView({behavior:\"smooth\"});\n })\n })\n}", "function makeActive() {\n for (let sec of sections) {\n //let navbarAnchors = document.querySelectorAll();\n if (isInViewport(sec)) {\n // Apply active state on the current section and the corresponding Nav link.\n sec.classList.add('your-active-class');\n console.log(sec.getAttribute('id'));\n } else {\n // Remove active state from other section and corresponding Nav link.\n sec.classList.remove(\"your-active-class\");\n }\n }\n}", "function addactiveclass() {\n $(\"nav ul li a\").each(function () {\n var scrollPos = $(document).scrollTop();\n var currLink = $(this);\n var refElement = $(currLink.data(\"scroll\"));\n if (\n refElement.position().top <= scrollPos &&\n refElement.position().top + refElement.height() > scrollPos\n ) {\n $(\"nav ul li a\").removeClass(\"active\");\n currLink.addClass(\"active\");\n } else {\n currLink.removeClass(\"active\");\n }\n });\n }", "function go_targetd_section(e) {\r\n e = document.querySelector(\".\" + e).getBoundingClientRect().top;\r\n document.body.scrollTop = e;\r\n document.documentElement.scrollTop = e;\r\n}", "function main(){\r\n // build the nav\r\n createNav();\r\n\r\n // Add class 'active' to section when near top of viewport\r\n toggleActive();\r\n}", "_initNavbarClickHandler() {\n this._navbar = document.getElementById('navbar');\n\n this._navbar.addEventListener('click', (ev) => {\n ev.preventDefault();\n if (ev.target.tagName === 'A') {\n this._clearNavbarSelectedItems(this._navbar);\n\n const item = ev.target;\n const sectionName = item.getAttribute('data-section');\n if (sectionName) {\n const sectionElem = document.querySelector(`section[data-name=\"${sectionName}\"]`);\n if (sectionElem) {\n sectionElem.scrollIntoView();\n } else {\n document.vody.scrollIntoView();\n }\n }\n item.parentNode.classList.add('active');\n }\n }, true);\n }", "function nextSection() {\n var nav = app.navigator(),\n fromSection = d.querySelector('[data-page=\"' + nav.active() + '\"]');\n\n // Pasar a otro evento\n if (this.classList.contains('is-up')) {\n goIndex();\n return;\n }\n\n var to = nav.next(),\n toSection = d.querySelector('[data-page=\"' + to + '\"]');\n\n var index = getIndex(fromSection.parentElement.querySelectorAll('.section'), toSection);\n fromSection.parentElement.style.left = (index * -100) + 'vw';\n }", "function addCLassActive() {\n const links = document.querySelectorAll('a');\n\n \n\nwindow.addEventListener('scroll', function() {\n sections.forEach(section => {\n links.forEach(link => {\n if(link.dataset.scroll === section.id) {\n if(this.scrollY >= section.offsetTop && this.scrollY < (section.offsetTop + section.offsetHeight)){\n link.classList.add('active')\n console.log(this.scrollY, section.offsetTop, section.offsetTop+section.offsetHeight)\n } else {\n link.classList.remove('active');\n }\n}})})})}", "function onScroll(event) {\n var headerHeight = $('.header').outerHeight(true);\n var navHeight = $('.navigation').outerHeight(true);\n var scrollPos = $(document).scrollTop();\n $('.inside-look-component .navigation ul li a').each(function () {\n var currLink = $(this);\n var refElement = $(currLink.attr(\"href\"));\n //console.log($(currLink.attr(\"href\")));\n if (refElement.position().top <= scrollPos + headerHeight + navHeight - 3 && refElement.position().top + refElement.height() > scrollPos + headerHeight + navHeight - 95) {\n $('.inside-look-component .navigation ul li a').removeClass(\"active\");\n currLink.addClass(\"active\");\n }\n else {\n currLink.removeClass(\"active\");\n }\n });\n}", "function scrollToSection() {\n navbarList.addEventListener(\"click\", respondToClick); \n}", "function scrollToSection(event){\n if (event.target.nodeName === 'A'){\n event.preventDefault()\n let elementId = event.target.dataset.section\n let section = document.getElementById(elementId)\n section.scrollIntoView({behavior: \"smooth\", alignToTop: true})\n } \n}", "function addActive(){\t\t\n\t\t$(\".navbar-nav li\").each(function(index){\n\t\t\tvar currentSection = $(this).find(\"a\").attr(\"href\");\n\t\t\tif((window_scroll.scrollTop() > $(currentSection).offset().top - 150)){\t\t\t\t\t\n\t\t\t\t$(this).addClass(\"active\");\n\t\t\t\t$(\".navbar-nav li\").not(this).removeClass(\"active\");\t\t\t\t\t\n\t\t\t}\n\t\t});\n\t}", "function activateMenuAndNav(anchor, index){\n activateMenuElement(anchor);\n activateNavDots(anchor, index);\n }", "function activateMenuAndNav(anchor, index){\n activateMenuElement(anchor);\n activateNavDots(anchor, index);\n }", "function activateMenuAndNav(anchor, index){\n activateMenuElement(anchor);\n activateNavDots(anchor, index);\n }", "function activateMenuAndNav(anchor, index){\n activateMenuElement(anchor);\n activateNavDots(anchor, index);\n }", "function activateMenuAndNav(anchor, index){\n activateMenuElement(anchor);\n activateNavDots(anchor, index);\n }" ]
[ "0.71987575", "0.71234435", "0.7111826", "0.6995709", "0.6981383", "0.6973248", "0.69674563", "0.6956668", "0.69434655", "0.69379705", "0.69060916", "0.6904358", "0.68921554", "0.6879294", "0.6870658", "0.68653095", "0.6838673", "0.6837361", "0.68306917", "0.679816", "0.6784912", "0.6767822", "0.6756076", "0.6736046", "0.6712068", "0.6701319", "0.66962105", "0.6688344", "0.6681704", "0.6680931", "0.6678988", "0.66701365", "0.6668747", "0.6665704", "0.6619537", "0.6618169", "0.6614266", "0.66140306", "0.661065", "0.66054314", "0.6601967", "0.6590958", "0.6581886", "0.658061", "0.6578223", "0.6573889", "0.6557437", "0.6549046", "0.6547665", "0.65392345", "0.65369886", "0.65341276", "0.6531679", "0.6524976", "0.65145946", "0.6512827", "0.65102017", "0.65015763", "0.64966136", "0.6486248", "0.6470901", "0.64470595", "0.6434912", "0.64344174", "0.6434077", "0.64317", "0.6430899", "0.64291275", "0.64241904", "0.642268", "0.64225334", "0.6409986", "0.6404586", "0.6401528", "0.63935727", "0.63802737", "0.63687915", "0.6362899", "0.635228", "0.63498104", "0.63481295", "0.6343426", "0.63425845", "0.6337565", "0.63276535", "0.632758", "0.63265806", "0.6324965", "0.6323112", "0.6318759", "0.6311316", "0.6309904", "0.63051736", "0.6296696", "0.6292861", "0.62757057", "0.62757057", "0.62757057", "0.62757057", "0.62757057" ]
0.64135677
71
Load each set of carousel photos for all event spaces
function fetchPhotos(id) { // console.log('fetchPhotos',id) var directory = ''; var filePath = 'content/spaces/' + directory + '/carousel.php'; console.log('fetchPhotos',id,directory,filePath); // Load Stage photos if (id === 'thestage') { directory = 'stage'; filePath = 'content/spaces/' + directory + '/carousel.php'; if (stagePicsInPlace === 0) { loadCarousel(filePath, id); stagePicsInPlace++; } } // Load Hall photos else if (id === 'thehall') { directory = 'hall'; filePath = 'content/spaces/' + directory + '/carousel.php'; if (hallPicsInPlace === 0) { loadCarousel(filePath, id); hallPicsInPlace++; } } // Load Gallery photos else if (id === 'thegallery') { directory = 'lobby'; filePath = 'content/spaces/' + directory + '/carousel.php'; if (galleryPicsInPlace === 0) { loadCarousel(filePath, id); galleryPicsInPlace++; } } // Load Screening room photos else if (id === 'thescreeningroom') { directory = 'screening'; filePath = 'content/spaces/' + directory + '/carousel.php'; if (screeningPicsInPlace === 0) { loadCarousel(filePath, id); screeningPicsInPlace++; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadCarouselImages() \n{\n\n\tIMAGES = randomizeArray(IMAGES);\n\t\n\t//Imported IMAGES & CAPTIONS\n\t//From images.js\n\tSTART_INDEX = 0;\n\n\tfor(var i=0; i < IMAGES.length; i++)\n\t\taddImageWithCaption(IMAGES[i][1], IMAGES[i][2], IMAGES[i][0], START_INDEX == i);\n}", "function loadFurtherCarouselSlides(){\n\t$(\".carousel .item\").each(function(n) {\n\t\tif(!$(this).hasClass(\"loadfast\")){\n\t\t\timgURL = $(this).attr(\"data-image\");\n\t\t\tif(cloudinaryAccount){\n\t\t\t\tcloudinaryURL = \"http://res.cloudinary.com/\"+cloudinaryAccount+\"/image/fetch/w_\"+pixelFullWidth+\",q_88,f_auto,fl_progressive,fl_force_strip/\"+imgURL;\n\t\t\t\tpreload(cloudinaryURL);\n\t\t\t}\n\t\t}\n\t});\t\n}", "function loadAllImages() {\n var images = document.querySelectorAll('img[data-src]');\n\n for (var i = 0; i < images.length; i++) {\n ImageLoader.load(images[i]);\n }\n }", "function load_images() {\n data.each(function(frame) {\n var imgs = []\n frame.images.each(function(imgstr) {\n var img = new Image(IMG_WIDTH, IMG_HEIGHT);\n img.src = \"/img/\" + imgstr;\n img.style.float = \"left\";\n imgs.push(img); \n });\n frame['imageobjs'] = imgs;\n }) \n }", "function loadCarousel() {\n var carousel_images = [\n \"/Content/icons/png/1.jpg\",\n \"/Content/icons/png/2.jpg\",\n \"/Content/icons/png/3.jpg\",\n \"/Content/icons/png/4.jpg\",\n \"/Content/icons/png/5.jpg\",\n \"/Content/icons/png/6.jpg\",\n \"/Content/icons/png/7.jpg\",\n \"/Content/icons/png/8.jpg\"];\n\n $(window).load(function () {\n $(\"#photo_container\").isc({\n imgArray: carousel_images\n });\n });\n }", "function LoadCarouselImgs(){\n for ( var i = 0, phs = photoDB.length; i < phs; i++) { \n var newdiv = document.createElement('div');\n var position = i;\n newdiv.className = 'carousel-containter img' + position;\n newdiv.Name = i;\n newdiv.innerHTML = '<img class=\"carousel-img img' + position + '\" onclick=\"NewSelection(' + i + ', 0)\" id=\"imgID' + i + '\"src=\"' + photoDB[i].s_url + '\">';\n idname = \"img\" + position;\n newdiv.setAttribute(\"id\", idname);\n document.getElementById('main-carousel').appendChild(newdiv);\n };\n}", "function initGalleries() {\n for (let slideCounter = 0; slideCounter < galleries.length; slideCounter++) {\n let gallery = document.querySelector('#div' + slideCounter);\n\n // get the prev and next slide button elements of this gallery\n let nextSlide = gallery.querySelector('.next');\n let prevSlide = gallery.querySelector('.prev');\n\n nextSlide.addEventListener('click', event => {\n const grandMotherElId = event.target.parentElement.parentElement.id;\n const position = grandMotherElId.substring(3, grandMotherElId.length);\n\n slideIndex[position] += 1;\n showSlides(slideIndex[position], grandMotherElId);\n });\n\n prevSlide.addEventListener('click', event => {\n const grandMotherElId = event.target.parentElement.parentElement.id;\n const position = grandMotherElId.substring(3, grandMotherElId.length);\n\n slideIndex[position] -= 1;\n showSlides(slideIndex[position], grandMotherElId);\n });\n }\n showSlides();\n}", "function load_apps_info() {\n //identify carousel container\n var $carousel_container = $('.apps_carousel'); \n //set up the gathered images\n for(var i = 0; i < apps_array.length; i++){\n //not sure about adding 'real' class here\n image_array.push($('<img>').addClass('real').attr('src', apps_array[i].picture_source));\n $('#image_container').append(image_array[i]);\n }\n //initialize pictures\n initialize_app_pictures();\n //add the number links to the number bar\n create_number_links();\n //initialize the link buttons and modal\n update_modal_and_links(current_app_index);\n}", "function loadImages() {\n\t\t const button = document.querySelector('#loadImages');\n\t\t const container = document.querySelector('#image-container');\n\n\t\t button.addEventListener(\"click\", (event) => {\n\n\t\t const images = imageNames();\n\t\t images.forEach((image) => {\n\t\t requestFor(image, container).then(imageData => {\n\t\t const imageElement = imageData.imageElement;\n\t\t const imageSrc = imageData.objectURL;\n\t\t imageElement.src = imageSrc;\n\t\t });\n\t\t });\n\t\t });\n\t\t}", "function refreshImages() {\n var images = document.querySelectorAll('img[data-src]');\n\n for (var i = 0; i < images.length; i++) {\n ImageLoader.load(images[i]);\n }\n }", "loadImages(): void {\n let self = this;\n let items = this.getState().items;\n for (let i = 0; i < items.length; i++) {\n let item: ItemType = items[i];\n // Copy item config\n let config: ImageViewerConfigType = {...item.viewerConfig};\n if (_.isEmpty(config)) {\n config = makeImageViewerConfig();\n }\n let url = item.url;\n let image = new Image();\n image.crossOrigin = 'Anonymous';\n self.images.push(image);\n image.onload = function() {\n config.imageHeight = this.height;\n config.imageWidth = this.width;\n self.store.dispatch({type: types.LOAD_ITEM, index: item.index,\n config: config});\n };\n image.onerror = function() {\n alert(sprintf('Image %s was not found.', url));\n };\n image.src = url;\n }\n }", "componentDidLoad() {\r\n this.dxpCarouselSlide = this.findElements(this.element, 'dxp-image-slide', true);\r\n const imgs = [];\r\n let imgload = false;\r\n if (this.dxpCarouselSlide) {\r\n for (const i of Object.keys(this.dxpCarouselSlide)) {\r\n const dxpImg = this.findElements(this.dxpCarouselSlide[i], 'dxp-image');\r\n dxpImg.componentOnReady().then(res => {\r\n // add '0' before the index number of image till the 9 images, e.g.(01, 02,... 09)\r\n this.totalSlides.innerHTML = (this.dxpCarouselSlide.length < 10 ? '0' : '') + this.dxpCarouselSlide.length;\r\n this.applyWidthOnDxpImg();\r\n const img = this.findElements(res, 'img');\r\n imgs.push(img);\r\n if (!imgload) {\r\n imgload = true;\r\n imgs[0].addEventListener('load', () => {\r\n imgs[0].style.width = '100%';\r\n this.wrapDxpImg();\r\n this.slideShow(undefined);\r\n // Apply height on carousel container\r\n this.carouselContainer.style.height = `${this.slides[0].offsetHeight}px`;\r\n imgs[0].style.removeProperty('width');\r\n }, false);\r\n }\r\n });\r\n }\r\n }\r\n }", "function populateFigures() {\n var filename;\n var currentFig;\n if (figureCount === 3) {\n for (var i = 1; i < 4; i++) {\n filename = \"images/IMG_0\" + photoOrder[i] + \"sm.jpg\";\n currentFig = document.getElementsByTagName(\"img\")[i - 1];\n currentFig.src = filename;\n }\n } else {\n for (var i = 0; i < 5; i++) {\n filename = \"images/IMG_0\" + photoOrder[i] + \"sm.jpg\";\n currentFig = document.getElementsByTagName(\"img\")[i];\n currentFig.src = filename;\n }\n }\n}", "function setItems(events){\n var element = document.getElementById('eventsInnerItemsID');\n for(let i=0; i<events.length; i++){\n var div = document.createElement('div');\n div.classList.toggle('carousel-item');\n if(i==0){ div.classList.toggle('active'); }\n \n var img = document.createElement('img');\n img.setAttribute(\"src\", events[i].image);\n img.className = \"carousel__image\";\n div.appendChild(img);\n \n var caption = document.createElement('div');\n caption.className = \"carousel-caption\";\n var h3 = document.createElement('h3');\n h3.textContent = events[i].title;\n caption.appendChild(h3);\n var p = document.createElement('p');\n p.className = \"eventDescription\";\n p.innerHTML = events[i].description;\n caption.appendChild(p);\n div.appendChild(caption);\n \n var cover = document.createElement('div');\n cover.className = \"cover__carousel\";\n div.appendChild(cover);\n \n element.appendChild(div);\n }\n}", "function addFloorImages() {\n // images from preview pane\n var currentImages = $('#currentImages');\n // images from navigation carousel\n var navigationImages = $('#navigationImages');\n var floorNames = Object.keys(buildingFloors);\n floorNames.alphanumSort(true);\n // add floor images to carousels in alphanumeric order of floor names\n for (var i = 0; i < floorNames.length; i++) {\n var floorName = floorNames[i];\n var image = floorImages[floorName];\n var dataURL = image.dataURL;\n var imageStr = image.imageStr;\n var stageImage = $('<li><img class=\"currentImage\" src=\"' + dataURL + imageStr + '\"></li>');\n var navImage = $('<li><img data-internalid='+floorName+' class=\"navigationImage\" src=\"' + dataURL + imageStr + '\"></li>');\n currentImages.append(stageImage);\n navigationImages.append(navImage);\n // initialize canvas with lowest floor\n if (i === 0) {\n var currentFloor = stateManager.getCurrentFloor();\n currentFloor.globals.canvas.image = $('<img class=\"currentImage\" src=\"' + dataURL + imageStr + '\">')[0];\n }\n }\n setTimeout(function() {\n initCarousels();\n $('#loading').css('display', 'none');\n }, 0) \n}", "function loadImagesSeq() {\n\t\t const button = document.querySelector('#loadImagesSeq');\n\t\t const container = document.querySelector('#image-container');\n\t\t const promises = [];\n\t\t button.addEventListener(\"click\", (event) => {\n\n\t\t const images = imageNames();\n\n\t\t images.forEach((image) => {\n\t\t promises.push(requestInSeq(image, container));\n\t\t });\n\t\t console.log(promises);\n\t\t // when all promises are resolved then this promise is resolved.\n\t\t Promise.all(promises).then((imageDataObjs) => {\n\t\t console.log(imageDataObjs);\n\t\t imageDataObjs.forEach((imageData) => {\n\t\t const imageElement = imageData.imageElement;\n\t\t const imageSrc = imageData.objectURL;\n\t\t imageElement.src = imageSrc;\n\t\t });\n\n\t\t });\n\t\t });\n\n\n\t\t}", "function image_sources() {\n let img_add_count;\n let album_total = 4;\n for (img_add_count = 1; img_add_count <= album_total; img_add_count++) {\n album = document.getElementById('Album ' + img_add_count)\n album_img_src = 'Images\\\\Album ' + img_add_count + '.png'\n album.src = album_img_src\n }\n}", "function loadImages() {\n\t// for each image container\n\t$('.image-container').each(function() {\n\t\t// get medium-sized image filename\n\t\tvar img_filename = $('img', $(this)).attr('data-imglarge')\n\t\tvar img_med_filename = img_filename.substring(0, img_filename.indexOf('.png')) + '_medium.jpg'\n\n\t\t// // load medium-sized image\n\t\t// var imgLarge = new Image()\n\t\t// $(imgLarge).addClass('artwork')\n\t\t// \t.attr('src', img_med_filename)\n\t\t// \t.attr('data-imglarge', img_filename)\n\t\t// \t.attr('alt', $('.placeholder', $(this)).attr('alt'))\n\t\t// \t.on('load', () => {\n\t\t// \t\t$(imgLarge).addClass('loaded')\n\t\t// \t})\n\t\t// $(this).append($(imgLarge))\n\n\t\t// update placeholder image src\n\t\t$('.placeholder', $(this)).attr('src', img_med_filename)\n\t\t\t.attr('data-imglarge', img_filename)\n\t\t\t.css('filter', 'none')\n\t})\n\tconsole.log('window loaded!')\n}", "loadImages() {\n let loadCount = 0;\n let loadTotal = this.images.length;\n\n if (WP.shuffle) {\n this.images = this.shuffle(this.images);\n }\n\n const imageLoaded = (() => {\n loadCount++;\n\n if (loadCount >= loadTotal) {\n // All images loaded!\n this.setupCanvases();\n this.bindShake();\n this.loadingComplete();\n }\n }).bind(this);\n\n for (let image of this.images) {\n // Create img elements for each image\n // and save it on the object\n const size = this.getBestImageSize(image.src);\n image.img = document.createElement('img'); // image is global\n image.img.addEventListener('load', imageLoaded, false);\n image.img.src = image.src[size][0];\n }\n }", "function start_loadImages()\n {\n methods.loadImages(\n function() {\n methods.getDataURI();\n run_app();\n },\n imagesRack.imgList\n );\n }", "function initializeImageList(imageList) {\n pageObject.imagesList = imageList;\n pageObject.thumbnailList = thumbnailList;\n\n $(\".gallery-holder\").on(\"click tap\", function(evt) {\n $(\".gallery-holder\").css(\"display\", \"none\");\n $(\".gallery-background\").css(\"display\", \"none\");\n Android.handleBackButton();\n });\n\n $(\".gallery-closer-holder\").on(\"click tap\", function(evt) {\n evt.stopPropagation();\n $(\".gallery-holder\").css(\"display\", \"none\");\n $(\".gallery-background\").css(\"display\", \"none\");\n Android.handleBackButton();\n });\n\n $(\".gallery-image-holder img\").on(\"click tap\", function(evt) {\n evt.stopPropagation();\n const screenWidth = $(window).width();\n let index = pageObject.imageListIndex;\n if(evt.clientX < screenWidth / 2) {\n if(index == 0) index = pageObject.imagesList.length;\n openGallery(index - 1);\n } else {\n if(index == imageList.length - 1) index = -1;\n openGallery(index + 1);\n }\n });\n\n // hard codedly assign image sources to each element\n $(\".main-picture-holder img\").attr(\"src\", pageObject.thumbnailList[0]);\n $(\".main-picture-holder img\").css(\"opacity\", 0.0);\n $(\".main-picture-holder img\").on(\"load\", function(evt) {\n $(evt.target).fadeTo(300, 1.0);\n console.log(evt.target);\n });\n $(\".main-picture-holder img\").on(\"click tap\", function(evt) {\n openGallery(0);\n });\n $(\".single_thumbnail img\").each((i, element) => {\n const index = parseInt(i);\n $(element).attr(\"src\", pageObject.thumbnailList[index + 1]);\n $(element).css(\"opacity\", 0);\n $(element).on(\"load\", function(evt) {\n $(evt.target).fadeTo(300, 1.0);\n });\n $(element).on(\"click tap\", (evt) => {\n openGallery(index + 1)\n });\n });\n}", "initSlideshow() {\n this.imagesLoaded = 0;\n this.currentIndex = 0;\n this.setNextSlide();\n this.slides.each((idx, slide) => {\n $(\"<img>\")\n .on(\"load\", $.proxy(this.loadImage, this))\n .attr(\"src\", $(slide).attr(\"src\"));\n });\n }", "function findImagesToLoad() {\n\tsetLazyImagePositions.call(this);\n\tconst imagesToLoad = getImagesInView(this.images);\n\tloadImages.call(this, imagesToLoad);\n}", "loadImage() {\n this.imagesLoaded++;\n if (this.imagesLoaded >= this.slides.length) { this.playSlideshow() }\n }", "initSlideshow() {\n this.imagesLoaded = 0;\n this.currentIndex = 0;\n this.setNextSlide();\n this.slides.each((idx, slide) => {\n $('<img>').on('load', $.proxy(this.loadImage, this)).attr('src', $(slide).attr('src'));\n });\n }", "loadImage() {\n this.imagesLoaded++;\n if (this.imagesLoaded >= this.slides.length) {\n this.playSlideshow();\n }\n }", "function getPhotos() {\n imageCount = 0;\n ready = false;\n loader.hidden = false;\n if (random) {\n getRandomPhotos();\n } else {\n getSearchResults(query);\n }\n}", "function showImagesGallery(array) {\n\n //Inicio las variables en la primera posicion para activar esta posicion\n let htmlContentToAppend = `<div div class=\"carousel-item active\"><img src=\"` + array[0] + `\" class=\"d-block w-100\" alt=\"\"></div>`;\n let htmlContentSlide = `<li data-target=\"#carouselExampleIndicators\" data-slide-to=\"0\" class=\"active\"></li>`;\n\n for (let i = 1; i < array.length; i++) {\n let imageSrc = array[i];\n\n htmlContentSlide += `<li data-target=\"#carouselExampleIndicators\" data-slide-to=\"` + i + `\" class=\"active\"></li>`\n\n htmlContentToAppend += `\n <div class=\"carousel-item\">\n <img src=\"` + imageSrc + `\" class=\"d-block w-100\" alt=\"\">\n </div> \n `\n }\n document.getElementById(\"slides\").innerHTML = htmlContentSlide;\n document.getElementById(\"carrusel\").innerHTML = htmlContentToAppend;\n\n\n}", "function initSlidesImages(){\n\n\t\t\t\t\t\t\t\t\t// $('#ContentSliderItem').css('width', (items.length*width)+'px')\n\t\t\t\t\t\t\t\t\t$('#ContentSliderItem').css('width', (items.length)*560+'px')\n\n\t\t\t\t\t\t\t\t\tvar btnNext = $('#btnNextB')\n\t\t\t\t\t\t\t\t\tvar btnPrev = $('#btnPrevB')\n\n\t\t\t\t\t\t\t\t\tbtnNext.on('click', nextSlideB)\n\t\t\t\t\t\t\t\t\tbtnPrev.on('click', prevSlideB)\n\t\t\t\t\t\t\t\t}", "function buildCarousel() {\n for (persona in PERSONAS) {\n buildCarouselItem(PERSONAS[persona]);\n }\n}", "function imageCarouselChange(direction) {\r\n // first figure out where in the array the image currently is\r\n var imgSrcFull = document.getElementById(\"middle-image\").children[0].src;\r\n var storytellerNum = parseInt(imgSrcFull.substring(imgSrcFull.indexOf(\"/media/\") + 7,imgSrcFull.indexOf(\"/media/\") + 9));\r\n var imgSrc = imgSrcFull.substring(imgSrcFull.indexOf(\"/media/\") + 7,imgSrcFull.length);\r\n var eArray = arrayLayers.storyteller[storytellerNum];\r\n var last = 0;\r\n for (var key in eArray) {\r\n if (eArray[key].contentImage == imgSrc) var num = key;\r\n if (!(isNaN(key))) last++;\r\n }\r\n if (direction == \"right\") {\r\n if (eArray[parseInt(num) + 1]) {\r\n // load next\r\n carouselMid.innerHTML = imagePrefix + imageFolder + eArray[parseInt(num) + 1].contentImage + imageSuffix;\r\n }\r\n else {\r\n // if reach end, then load first\r\n carouselMid.innerHTML = imagePrefix + imageFolder + eArray[1].contentImage + imageSuffix;\r\n }\r\n }\r\n else {\r\n if (eArray[parseInt(num) - 1]) {\r\n // load previous\r\n carouselMid.innerHTML = imagePrefix + imageFolder + eArray[parseInt(num) - 1].contentImage + imageSuffix;\r\n }\r\n else {\r\n // if reach beginning, then load last\r\n carouselMid.innerHTML = imagePrefix + imageFolder + eArray[last].contentImage + imageSuffix;\r\n }\r\n }\r\n}", "function loadImages(imagesToLoad) {\n\timagesToLoad.forEach(lazyImage => {\n\t\tthis.fireLazyEvent(lazyImage.image);\n\t\tlazyImage.resolved = true;\n\t});\n}", "function displayPhotos () {\r\n imagesLoaded=0;\r\n totalImages = photosArray.length;\r\n// run function for each for each object in photosArray\r\n photosArray.forEach((photo) => {\r\n // create <a> to link to unsplash\r\n const item = document.createElement('a');\r\n // item.setAttribute('href', photo.links.html)\r\n // item.setAttribute('target', '_blank');\r\n setAttributes(item, {\r\n href: photo.links.html,\r\n target: '_blank'\r\n })\r\n // create <img> for photo\r\n const img = document.createElement('img');\r\n // img.setAttribute('src', photo.urls.regular);\r\n // img.setAttribute('alt', photo.alt_description);\r\n // img.setAttribute('title', photo.alt_description);\r\n setAttributes(img, {\r\n src : photo.urls.regular,\r\n alt: photo.alt_description,\r\n title: photo.alt_description\r\n })\r\n // add eventlistener, check when each load is finished\r\n img.addEventListener('load', imageLoaded);\r\n // put <img> inside <a> and put both inside of imageContainer\r\n item.appendChild(img);\r\n imageContainer.appendChild(item);\r\n })\r\n }", "function displayPhotos() {\n imagesLoaded = 0;\n totalImages = photosArray.length;\n // Run function for each object in photosArray\n photosArray.forEach((photo) => {\n // Create <a> to link to unsplash\n const $item = $(`<a href=\"${photo.links.html}\" target=\"_blank\"></a>`);\n\n // Create <img> for photo\n const $img = $(\n `<img src=\"${photo.urls.regular}\" alt=\"${photo.alt_description}\" title=\"${photo.alt_description}\" />`\n );\n\n // Event Listener, check when each is finished loading\n $img.on('load', imageLoaded);\n\n // Put <img> inside <a> then put both inside imageContainer element\n $item.append($img);\n $imageContainer.append($item);\n });\n }", "function loadFirstCarouselSlides(){\n\t$(\".carousel .item\").each(function(n) {\n\t\tif($(this).hasClass(\"loadfast\")){\n\t\t\timgURL = $(this).attr(\"data-image\");\n\t\t\tif(cloudinaryAccount){\n\t\t\t\tcloudinaryURL = \"http://res.cloudinary.com/\"+cloudinaryAccount+\"/image/fetch/w_\"+pixelFullWidth+\",q_88,f_auto,fl_progressive,fl_force_strip/\"+imgURL;\n\t\t\t\tpreload(cloudinaryURL);\n\t\t\t}\n\t\t}\n\t});\n}", "function showAllAssets() {\n\tfor (var i=0; i <= 15; i++) {\n\t\t$(\"#gallery\").append(\n\t\t\t\"<a class='\" + Assets[i].type +\n\t\t\t\"' id= '\" + Assets[i].embed +\n\t\t\t\"'href='\" + Assets[i].href +\n\t\t \t\"'><img src='\" + Assets[i].src + \n\t\t \t\"' alt='\" + Assets[i].alt + \"'></a>\"\n\t\t );\n\t}\n}", "function loadImages() {\n if (surveyLength > 24) {\n surveyEnd();\n }\n\n lastIndex = [];\n\n lastIndex.push(randomIndex1);\n lastIndex.push(randomIndex2);\n lastIndex.push(randomIndex3);\n\n //Re-assigning the variables for each picture\n randomIndexGenerator();\n\n //While loop to prevent double choices AND no prior choice repeats\n while (randomIndex1 === lastIndex[0] || randomIndex1 === lastIndex[1] || randomIndex1 === lastIndex[2] || randomIndex2 === lastIndex[0] || randomIndex2 === lastIndex[1] || randomIndex2 === lastIndex[2] || randomIndex3 === lastIndex[0] || randomIndex3 === lastIndex[1] || randomIndex3 === lastIndex[2] || randomIndex1 === randomIndex2 || randomIndex1 === randomIndex3 || randomIndex2 === randomIndex3) {\n randomIndexGenerator();\n }\n //Makes leftImg's src property equal to the fileName of the indexed item\n leftImg.src = catalogArray[randomIndex1].filePath;\n centerImg.src = catalogArray[randomIndex2].filePath;\n rightImg.src = catalogArray[randomIndex3].filePath;\n\n //Adds 1 to the display tally property of the indexed object\n catalogArray[randomIndex1].tallyDisplayed += 1;\n catalogArray[randomIndex2].tallyDisplayed += 1;\n catalogArray[randomIndex3].tallyDisplayed += 1;\n\n}", "function loadFlickrPhotos() {\n var photoSetId, photoSetName;\n photoSetId = this.id.substring(2); // remove \"ps\" prefix\n photoSetName = $(this).text();\n\n // Get all the photos associated with the given photoset id.\n $.getJSON('/photos/' + photoSetId).then(\n function (data) {\n $('#photos').empty();\n Object.keys(data).sort().forEach(function (title) {\n var photo = data[title];\n loadFlickrPhoto(photo);\n });\n });\n }", "function initCarouselControls() {\n\tvar imgWidth = 0;\t\t\n\t$('.jcarousel-img-container > img').load( function() {\t\t\n\t\t$(this).each( function(){\n\t\t\timgWidth += $(this).width();\n\t\t\tif ( imgWidth < (windowObj.width() * 0.6 )) {\n\t\t\t\t$('.jcarousel-next').fadeOut( 800 );\n\t\t\t} else {\n\t\t\t\t$('.jcarousel-next').fadeIn( 800 );\n\t\t\t}\n\t\t});\t\t\n\t});\n}", "function displayPhotos() {\n imagesLoaded = 0;\n\n totalImages = photosArray.length; //setting totalImages to lenght of photosArray\n console.log(\"TOTAL IMAGES: \", totalImages);\n //run function on each photo/ each photo is assigned to var called photo within an ARROW function\n photosArray.forEach((photo) => {\n\n //creates blank anchor element DIV to contain photos\n const anchorDIV = document.createElement('a');\n //CALLING HELPER FUNCTION INSTEAD OF USING REPEATING CODE\n setAttributes(anchorDIV, {\n href: photo.links.html,\n target: '_blank',\n })\n\n // Create img tag to call the photos\n const img = document.createElement('img');\n //CALLING HELPER FUNCTION INSTEAD OF USING REPEATING CODE\n setAttributes(img, {\n src: photo.urls.regular,\n alt: photo.alt_description,\n title: photo.alt_description,\n })\n\n //EVENT LISTENER - Check that photos have finished loading\n img.addEventListener('load', imageLoaded());\n\n //Add img to inside of anchorDIV.\n anchorDIV.appendChild(img);\n //Add anchorDIV (containing img) to image-container DIV \n imageContainer.appendChild(anchorDIV);\n });\n}", "function cacheImages() {\n let images = document.querySelectorAll('.lightbox__slide');\n for(let i = 0; i < images.length; i++) {\n cache.appendChild(images[i]);\n }\n}", "function addBootstrapPhotoGallery(images) {\n // TODO: MODULE_ADVENTURE_DETAILS\n // 1. Add the bootstrap carousel to show the Adventure images\n\n}", "function forEachLightboxImage(images, callback) {\n for (var i = 0; i < images.length; i++) {\n callback(images[i]);\n }\n } // 1. Attach listeners to the lightbox component", "function loadPhotos() {\n\n for(let i = 0; i < 10; i++) {\n fetch(`https://picsum.photos/500/500?random=${i}`)\n .then(x => {\n \n gallery.innerHTML += `\n <img src=\"${x.url}\" alt=\"\">\n `\n });\n }\n}", "function displayPhotos(){\n //13 reset imagesLoaded = 0\n imagesLoaded = 0;\n //10 \n totalImages = photosArray.length;\n //Run Function for eache pbject in photosArray\n photosArray.forEach((photo) => {\n //Create <a> to link to Unsplash\n const item = document.createElement('a');\n // item.setAttribute('href' , photo.links.html);\n // item.setAttribute('target' , '_blank');\n setAttributes(item, {\n href: photo.links.html,\n target: '_blank'\n });\n // Create <img> for photos\n const img = document.createElement('img');\n // img.setAttribute('src' , photo.urls.regular);\n // img.setAttribute('alt' , photo.alt_description);\n // img.setAttribute('title' , photo.alt_description);\n setAttributes(img, {\n src: photo.urls.regular,\n alt: photo.alt_description,\n title: photo.alt_description\n });\n //7 Event Listener, Check when each if finished loading\n img.addEventListener('load', imageLoaded);\n // Put <img> inside <a>, then put both inside imageContainer Element\n item.appendChild(img);\n imageContainer.appendChild(item);\n\n });\n}", "function carouselLoadPictures(xml) {\r\n\tsetTheParameters();\r\n\treadXml(xml);\r\n\txmldoc = null;\r\n\tif (booleanF2 == false) {\r\n\t\t//console.log(\"carousel\");\r\n\t\tYAHOO.widget.Carousel.prototype.STRINGS.NEXT_BUTTON_TEXT = \"<img src='right-enabled.gif'/> \";\r\n\t\tYAHOO.widget.Carousel.prototype.STRINGS.PREVIOUS_BUTTON_TEXT = \"<img src='left-enabled.gif'/> \";\r\n\t\tYAHOO.widget.Carousel.prototype.STRINGS.PAGER_PREFIX_TEXT = \"Go to page: \";\r\n\t\t//YAHOO.widget.Carousel.prototype.STRINGS.FIRST_PAGE= \"1\";\r\n\t\tg_jcarousel = new YAHOO.widget.Carousel(\"carousel\", {\r\n\t\t\tanimation : {\r\n\t\t\t\tspeed : 0.5,\r\n\t\t\t\teffect : null\r\n\t\t\t},\r\n\t\t\tnumVisible : one_stepCarousel,\r\n\t\t\tscrollInc : one_stepCarousel\r\n\t\t});\r\n\t\tg_jcarousel.addListener(\"afterScroll\", scrollEvtHandler);\r\n\t\tg_jcarousel.render();\r\n\t\tg_jcarousel.show();\r\n\t\tg_carouselTotalSize = g_carouselTotalSize + smallUrl.length;\r\n\t\t$(\".yui-carousel-nav\").css(\"background\", \"url('images/ui-bg_inset-hard_100_f5f8f9_1x30.png') repeat-x scroll 0 0 transparent\");\r\n\t\t$(\".yui-carousel-nav\").css(\"height\", \"30px\");\r\n\t\t//console.log(\"g_carouselTotalSize: \"+g_carouselTotalSize);\r\n\t\ttimeofUpload++;\r\n\t\tloadTheCarousel(0, g_jcarousel, smallUrl);\r\n\t\tbooleanF2 = true;\r\n\t}\r\n\tif (lastCarousel > g_carouselTotalSize - beforeLoad) {\r\n\t\tloadTheCarousel(g_carouselTotalSize, g_jcarousel, smallUrl);\r\n\t\tg_carouselTotalSize = g_carouselTotalSize + smallUrl.length;\r\n\t}\r\n\t// console.log(\"ready to execute is true\");\r\n\t// readyToExecute=true;\r\n}", "function loadImages(){\n prev_btnj.addClass('loading')\n next_btnj.addClass('loading')\n fs.readdir(dirname, (err, files) => {\n if (!err){\n images = files.filter(isImage)\n curIndex = images.indexOf(basename)\n prev_btnj.removeClass('loading')\n next_btnj.removeClass('loading')\n setBtn()\n }\n })\n}", "function lazyload() {\n\n // all the images with class lazyload\n\n var images = document.querySelectorAll(\"img.lazyload\");\n var i = images.length;\n\n // remove the event listener if there are no images with the class lazyload\n\n !i && window.removeEventListener(\"scroll\", lazyload);\n\n // loop de loop\n\n while (i--) {\n var wH = window.innerHeight;\n var offset = 100;\n var yPosition = images[i].getBoundingClientRect().top - wH;\n\n // if the top of the image is within 100px from the bottom of the viewport\n\n if (yPosition <= offset) {\n\n // replace the src with the data-src\n\n images[i].src = images[i].getAttribute(\"data-src\");\n\n // wait until the new image is loaded\n\n images[i].addEventListener('load', function() {\n\n // remove the class lazyload\n\n this.classList.remove(\"lazyload\");\n });\n\n }\n }\n }", "function displayPhotos() {\r\n imagesLoaded = 0;\r\n totalImage = photoArray.length;\r\n \r\n //run function for each array in photoArray\r\n photoArray.forEach((photo) => {\r\n //create <a> to link to unsplash\r\n const item = document.createElement('a');\r\n // item.setAttribute('href', photo.links.html);\r\n // item.setAttribute('target', '_blank');\r\n setAttributes(item, {\r\n href: photo.links.html,\r\n target: '_blank',\r\n });\r\n //create <img> for photo\r\n const img = document.createElement('img');\r\n // img.setAttribute('src', photo.urls.regular);\r\n // img.setAttribute('alt', photo.alt_description);\r\n // img.setAttribute('title', photo.alt_description);\r\n setAttributes(img, {\r\n src: photo.urls.regular,\r\n alt: photo.alt_description,\r\n title: photo.alt_description,\r\n });\r\n //eventlistener , check when each is finish loading\r\n img.addEventListener('load', imageLoaded);\r\n // put <img> inside <a>, then put both inside image-container\r\n item.appendChild(img);\r\n imageContainer.appendChild(item);\r\n });\r\n}", "gallerySelectorLoad() {\n\t\tlet gallerySelectorIds = [\n\t\t{ containerId: \"#gallerySelector__1-container\", gallerySelectorId: \"#gallerySelector__1\"}, \n\t\t{ containerId: \"#gallerySelector__2-container\", gallerySelectorId: \"#gallerySelector__2\"}, \n\t\t{ containerId: \"#gallerySelector__3-container\", gallerySelectorId: \"#gallerySelector__3\"}, \n\t\t{ containerId: \"#gallerySelector__4-container\", gallerySelectorId: \"#gallerySelector__4\"}\n\t\t];\n\t\tlet counter = 0;\n\t\tlet timer = setInterval( () => {\n\t\t\t$(gallerySelectorIds[counter].containerId).toggleClass('gallerySelector__section-container--slide-in');\n\t\t\t$(gallerySelectorIds[counter].containerId).toggleClass('gallerySelector__section-container');\n\t\t\tcounter++\n\t\t\tif(counter >= gallerySelectorIds.length) {\n\t\t\t\tclearInterval(timer);\n\t\t\t}\n\t\t}, 500);\n\t\tthis.props.store_timer(timer);\n\t}", "function loadImages() {\r\n\t\tremoveUnseenImages();\r\n\t\tvar sets = $['mapsettings'];\r\n\t\tvar range = getPixelRange();\r\n\t\tfor(var i=range.start.x; i<range.end.x && i<sets.resolutions[sets.zoom-1].width; i+=addi(i)) {\r\n\t\t\tfor(var j=range.start.y; j<range.end.y && j<sets.resolutions[sets.zoom-1].height; j+=256) {\r\n\t\t\t\tvar col = getColumn(i);\r\n\t\t\t\tif(!isLoaded(col,i,j)) { // Prevent already loaded images from being reloaded\r\n\t\t\t\t\tvar imgurl = sets.image_name.replace(/%Z/, sets.zoom );\r\n\t\t\t\t\timgurl = imgurl.replace(/%L/, sets.level);\r\n\t\t\t\t\timgurl = imgurl.replace(/%C/, col);\r\n\t\t\t\t\timgurl = imgurl.replace(/%X/, (i-firstInColumnLocation(col-1)));\r\n\t\t\t\t\timgurl = imgurl.replace(/%Y/, j);\r\n\t\t\t\t\timgurl = sets.image_dir + imgurl;\r\n\t\t\t\t\t$['mapsettings'].loaded[sets.zoom+\"-\"+col+\"-\"+i+\"-\"+j] = true;\r\n\t\t\t\t\tvar style = \"top: \" + j + \"px; left: \" + i + \"px;\"\r\n\t\t\t\t\tvar theClass = \"file\" + sets.zoom + \"-\" + col +\"-\" + i + \"-\" + j;\r\n\t\t\t\t\t$(\"<img/>\").attr(\"style\", style).attr('class',theClass).appendTo(\"#images\").hide();\r\n\t\t\t\t\t$(\"img.\" + theClass).load(function(e){ $(this).show(); }); // Only show the image once it is fully loaded\r\n\t\t\t\t\t$(\"img.\" + theClass).attr(\"src\", imgurl);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "loadImages(input_files) {\n this.stateMap.images_still_loading += input_files.length;\n for (let file of input_files) {\n const reader = new FileReader();\n reader.onload = () => {\n let image = new Image();\n image.onload = () => {\n spa.imagelistmodel.addImagebox(file.name,file.lastModified,image);\n this.imageLoadEnded();\n };\n image.onerror = () => {\n this.imageLoadEnded();\n };\n image.src = reader.result;\n };\n reader.onabort = () => {this.imageLoadEnded();};\n reader.onerror = () => {this.imageLoadEnded();};\n reader.readAsDataURL(file);\n }\n\n // tell loaderbox that images are being loaded\n spa.loaderbox.handleLoad();\n \n return true;\n }", "function showImagesEventHandler(e) {\n var app = UiApp.getActiveApplication();\n var panel = app.getElementById('panelForImages').clear();\n var info = Utilities.jsonParse(ScriptProperties.getProperty('info'));\n for (i in info) {\n if (info[i][0] == e.parameter.albumListBox) {\n var data = UrlFetchApp.fetch(URL + '/albumid/' + info[i][1], googleOAuth_()).getContentText();\n var xmlOutput = Xml.parse(data, false);\n var photos = xmlOutput.getElement().getElements('entry');\n for (j in photos) {\n panel.add(app.createImage(photos[j].getElement('content').getAttribute('src').getValue()));\n }\n }\n }\n return app;\n}", "function displayPhotos() {\n imagesLoaded = 0;\n totalImages = photosArray.length;\n\n // run function for each object in photosArray\n photosArray.forEach((photo) => {\n // create <a> to link to Unsplash\n const item = document.createElement('a');\n\n // set item attributes\n setAttributes(item, {\n href: photo.links.html,\n target: '_blank',\n });\n\n // create image for photo\n const img = document.createElement('img');\n\n // set image attributes\n setAttributes(img, {\n src: photo.urls.regular,\n alt: photo.alt_description,\n title: photo.alt_description,\n });\n\n // Event listerer, check when each is finished Loading\n img.addEventListener('load', imageLoaded);\n\n // put image inside anchor element <a>, the put both in imageContainer elements\n item.appendChild(img);\n imageContainer.appendChild(item);\n });\n}", "function lazyLoad(){\n\tvar $images = $('.lazy_load');\n\n\t$images.each(function(){\n\t\tvar $img = $(this),\n\t\t\tsrc = $img.attr('data-img');\n\t\t$img.attr('src',src);\n\t});\n}", "function loadImages() {\n $('img[data-src]').each(function () {\n var src = $(this).data('src');\n var style = $(this).data('style');\n $(this).attr('src', src);\n $(this).attr('style', style);\n });\n}", "loadImg() {\n let loadedCount = 0\n function onLoad() {\n loadedCount++\n if (loadedCount >= this.imgPaths.length) {\n this.flowStart()\n }\n }\n this.baseImages = this.imgPaths.map(path => {\n const image = new Image()\n image.onload = onLoad.bind(this)\n image.src = path\n return image\n })\n }", "loadAllImages (props = this.props) {\n const generateLoadDoneCallback = (srcType, imageSrc) => (err) => {\n // Give up showing image on error\n if (err) {\n return\n }\n\n // Don't rerender if the src is not the same as when the load started\n // or if the component has unmounted\n if (this.props[srcType] !== imageSrc || !this.mounted) {\n return\n }\n\n // Force rerender with the new image\n this.forceUpdate()\n }\n\n // Load the images\n this.getSrcTypes().forEach((srcType) => {\n const type = srcType.name\n\n // Load unloaded images\n if (props[type] && !this.isImageLoaded(props[type])) {\n this.loadImage(type, props[type], generateLoadDoneCallback(type, props[type]))\n }\n })\n }", "function populate_imgs(img_names){\r\n for (var i=0; i <= 3; i++) {\r\n var temp_url = '../static/img/diary/' + img_names[i];\r\n if (i % 2 == 0) {\r\n $( \".photos1\" ).append(`<img class=\\\"diaryImage\\\" src=\\\"${temp_url}\\\">`);\r\n } else {\r\n $( \".photos2\" ).append(`<div class=\\\"imageContainer\\\"> \r\n <img class=\\\"diaryImage\\\" src=\\\"${temp_url}\\\">\r\n </div>`);\r\n }\r\n nextImageToLoad = i + 1;\r\n }\r\n}", "preload() {\n const images = Object.keys(ASSET.IMAGE).map(\n (imgKey) => ASSET.IMAGE[imgKey]\n );\n for (let image of images) {\n this.load.image(image.KEY, image.ASSET);\n }\n }", "function loadAllImages() {\n $('.card').each(function() {\n var curDiv = $(this);\n\n loadImage(curDiv.attr('id'));\n createStrip(curDiv, curDiv.attr('data-number'));\n })\n}", "lazyLoad() {\n if(!this.state.loading && this.state.next) {\n const offset = this.state.offset + this.state.limit;\n this.getAlbums(offset);\n }\n }", "function initGallery(){\n console.trace('initGallery');\n let divGallery = document.getElementById('gallery');\n for ( let i = 1; i <= 7 ; i++){\n divGallery.innerHTML += `<img onclick=\"selectAvatar(event)\" \n class=\"avatar\" \n data-path=\"avatar${i}.png\"\n src=\"img/avatar${i}.png\">`;\n }\n}", "function LoadImages()\n{\n\tvar loadedImages = 0;\n\tvar numImages = 0;\n\tfor (var src in ImgList)\n\t{\n\t\tnumImages++;\n\t}\n\tfor (var src in ImgList)\n\t{\n\t\tImgs[src] = new Image();\n\t\tImgs[src].onload = function()\n\t\t{\n\t\t\tloadedImages = loadedImages +1;\n\t\t\tif(loadedImages >= numImages)\n\t\t\t{\n\t\t\t\t//Finished loading!\n\t\t\t\ttstsetup();\n\t\t\t\tImgsFinished = 1;\n\t\t\t}\n\t\t};\n\n\t\tif (src < 6)\n\t\t{\n\t\t\tImgs[src].src = ImgList[src];\n\t\t}\n\t\telse\n\t\t{\n\t\t\tImgs[src].src = ImgURL + ImgList[src];\n\t\t}\n\t}\n}", "function Gfotos() {\r\n const [currentImage, setCurrentImage] = useState(0);\r\n const [viewerIsOpen, setViewerIsOpen] = useState(false);\r\n\r\n const openLightbox = useCallback((event, { photo, index }) => {\r\n setCurrentImage(index);\r\n setViewerIsOpen(true);\r\n }, []);\r\n\r\n const closeLightbox = () => {\r\n setCurrentImage(0);\r\n setViewerIsOpen(false);\r\n };\r\n\r\n return (\r\n \r\n <>\r\n \r\n<MDBCarousel\r\n activeItem={1}\r\n length={3}\r\n showControls={true}\r\n showIndicators={true}\r\n className=\"z-depth-1\"\r\n >\r\n <MDBCarouselInner>\r\n <MDBCarouselItem itemId=\"1\">\r\n <MDBView>\r\n <img\r\n className=\"img-fluid m-x-auto d-block img-responsive\"\r\n src={ img1 }\r\n alt=\"First slide\"\r\n />\r\n </MDBView>\r\n </MDBCarouselItem>\r\n <MDBCarouselItem itemId=\"2\">\r\n <MDBView>\r\n <img\r\n className=\"d-block w-100\"\r\n src=\"https://mdbootstrap.com/img/Photos/Slides/img%20(129).jpg\"\r\n alt=\"Second slide\"\r\n />\r\n </MDBView>\r\n </MDBCarouselItem>\r\n <MDBCarouselItem itemId=\"3\">\r\n <MDBView>\r\n <img\r\n className=\"d-block w-100\"\r\n src=\"https://mdbootstrap.com/img/Photos/Slides/img%20(70).jpg\"\r\n alt=\"Third slide\"\r\n />\r\n </MDBView>\r\n </MDBCarouselItem>\r\n </MDBCarouselInner>\r\n <p></p>\r\n </MDBCarousel>\r\n <div>\r\n <div className=\"page-header\">\r\n <h1 id=\"timeline\"><strong>Miami Facility</strong></h1>\r\n </div>\r\n <Gallery photos={photos} onClick={openLightbox} />\r\n <ModalGateway>\r\n {viewerIsOpen ? (\r\n <Modal onClose={closeLightbox}>\r\n <Carousel\r\n currentIndex={currentImage}\r\n views={photos.map(x => ({\r\n ...x,\r\n srcset: x.srcSet,\r\n caption: x.title\r\n }))}\r\n />\r\n </Modal>\r\n ) : null}\r\n </ModalGateway>\r\n </div>\r\n \r\n <div>\r\n {/* <Footer /> */}\r\n </div>\r\n </>\r\n );\r\n}", "function loadImages(sources, callback) {    \n\t\tfor(var src in sources) {         \t// get num of sources\n        numImages++;\n        }\n    for(var src in sources) {\n        images[src] = new Image();\n\t\t\timages[src].onload = function() {\n\t\t\t\tif(++loadedImages >= numImages) {\n\t\t\t\tcallback(images);\n\t\t\t\t}\n\t\t\t};\n        images[src].src = sources[src];\n        }\n    }", "function displayPhotos() {\n loader.hidden = true;\n photos.forEach((photo) => {\n // Create Unspalsh page Link for the image\n const imageLink = document.createElement(\"a\");\n imageLink.setAttribute(\"href\", photo.links.html);\n imageLink.setAttribute(\"target\", \"_blank\");\n\n // Create image element\n const img = document.createElement(\"img\");\n img.setAttribute(\"src\", photo.urls.regular);\n img.setAttribute(\"alt\", photo.alt_description);\n img.setAttribute(\"title\", photo.alt_description);\n\n imageLink.appendChild(img);\n imageContainer.appendChild(imageLink);\n\n //event listner for image\n img.addEventListener(\"load\", imageLoaded);\n });\n}", "mount() {\n\t\t\tComponents.Slides.getSlides( true, false ).forEach( slide => {\n\t\t\t\tconst img = find( slide, 'img' );\n\n\t\t\t\tif ( img && img.src ) {\n\t\t\t\t\tcover( img );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\tSplide.on( 'lazyload:loaded', img => { cover( img ) } );\n\t\t}", "function initSliders() {\n\t\tvar $sliderList = $(sliderSelector);\n\t\tvar i = $sliderList.length;\n\t\tvar $slider;\n\t\tvar carousel;\n\n\t\twhile (i--) {\n\t\t\t$slider = $($sliderList[i]);\n\n\t\t\tif ($slider.data('loaded') !== 'true') {\n\t\t\t\tcarousel = new Carousel($slider);\n\t\t\t\tcarousel.init();\n\t\t\t}\n\t\t}\n\t}", "function initGalleryCarousel() {\n $('#gallery .carousel').slick({\n infinite: true,\n slidesToShow: 1,\n slidesToScroll: 1,\n autoplay: false\n });\n $('#gallery .thumbnails .thumb').click(function () {\n $('#gallery .carousel').slick('slickGoTo', $(this).attr('data-thumb'));\n });\n}", "function fillImages(){\n\tfor (var i = 0; i < planes.length; i++) {\n\t\tvar id = planes[i].id\n\t\tvar search = \"#\" + id + \" .slide-container\"\n\t\t$(search).css(\"background-image\", \"url('\" + buildUrl(id) + \"')\")\n\t\tconsole.log(buildUrl(id, slides[id]))\n\t\t\n\t}\n}", "function fBuildCarousel() {\n\t\t\t/**-----| JSON DATA |-----*/\n\t\t\tvar fContentDataAjax = function fContentDataAjax() {\n\t\t\t\tvar promise = $.get(\"./js/json/carouselImages.json\");\n\t\t\t\tpromise.then(function (data) {\n\t\t\t\t\tvar jx = 0;\n\t\t\t\t\tvar ji = 0;\n\t\t\t\t\t//let itemId = \"bikerId\"\n\t\t\t\t\tvar _iteratorNormalCompletion3 = true;\n\t\t\t\t\tvar _didIteratorError3 = false;\n\t\t\t\t\tvar _iteratorError3 = undefined;\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tfor (var _iterator3 = data.ContentDataMain[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n\t\t\t\t\t\t\tvar content = _step3.value;\n\n\t\t\t\t\t\t\t/**-----| Populate carousel container |-----**/\n\t\t\t\t\t\t\tvar _iteratorNormalCompletion4 = true;\n\t\t\t\t\t\t\tvar _didIteratorError4 = false;\n\t\t\t\t\t\t\tvar _iteratorError4 = undefined;\n\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tfor (var _iterator4 = content.images[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {\n\t\t\t\t\t\t\t\t\tvar images = _step4.value;\n\n\t\t\t\t\t\t\t\t\tcreateKarousel.fCreateCarousel(\"imgCarouselId\", images.imgName, images.imgTitle, images.imgDescription, ji, content.carouselIntervalTimer * 1000);\n\t\t\t\t\t\t\t\t\tji++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\t_didIteratorError4 = true;\n\t\t\t\t\t\t\t\t_iteratorError4 = err;\n\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tif (!_iteratorNormalCompletion4 && _iterator4.return) {\n\t\t\t\t\t\t\t\t\t\t_iterator4.return();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\t\tif (_didIteratorError4) {\n\t\t\t\t\t\t\t\t\t\tthrow _iteratorError4;\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} catch (err) {\n\t\t\t\t\t\t_didIteratorError3 = true;\n\t\t\t\t\t\t_iteratorError3 = err;\n\t\t\t\t\t} finally {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tif (!_iteratorNormalCompletion3 && _iterator3.return) {\n\t\t\t\t\t\t\t\t_iterator3.return();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\tif (_didIteratorError3) {\n\t\t\t\t\t\t\t\tthrow _iteratorError3;\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\t\t\t/*----- Invoke function -----*/\n\t\t\tfContentDataAjax();\n\t\t}", "function displayPhotos() {\n totalImages = photosArray.length;\n /* runs function for each object in the photosArray */\n photosArray.forEach((photo) => {\n /* <a> for Unsplash */\n const item = document.createElement(\"a\");\n setAttributes(item, {\n href: photo.links.html,\n target: \"_blank\",\n });\n /* Create image for photos */\n const img = document.createElement(\"img\");\n setAttributes(img, {\n src: photo.urls.regular,\n alt: photo.alt_description,\n title: photo.alt_description,\n });\n /* Event listener for finished loading */\n img.addEventListener(\"load\", imageLoad)\n /* puts image inside anchor then both inside imageContainer */\n item.appendChild(img);\n imageContainer.appendChild(item);\n });\n}", "function displayPhotos()\n{\n imageLoad=0;\n totalImages=photosArray.length;\n //Run function for each object in photoArray\n photosArray.forEach((photo)=>{\n const item=document.createElement('a');\n setAttributes(item,{\n href:photo.links.html,\n target:'_blank'});\n //<img> for photo\n const img=document.createElement('img');\n setAttributes(img,{\n src:photo.urls.regular,\n alt:photo.alt_description,\n title:photo.alt_description\n });\n //Event Listener when Each is finish Loading\n img.addEventListener('load',imageLoaded);\n //put img into <a>\n item.appendChild(img);\n imageContainer.appendChild(item);\n });\n\n}", "async function loadImagesIntoPage(userPhotoLibrary) {\n var imageDiv = document.getElementById(\"grid\");\n while (imageDiv.firstChild) {\n imageDiv.removeChild(imageDiv.firstChild);\n }\n\n // Generate image HTML\n var i = 0;\n for (i = 0; i < userPhotoLibrary.length; i++) {\n var img = document.createElement(\"img\");\n var imageUrl = 'https://img.rec.net/' + userPhotoLibrary[i].ImageName + '?width=500';\n img.setAttribute('data-src', imageUrl);\n img.classList.add(\"grid-image\");\n //img.src = \"\";\n\n var divGridItem = document.createElement(\"div\");\n divGridItem.classList.add(\"grid-item\");\n divGridItem.setAttribute('type', 'button');\n divGridItem.setAttribute('data-toggle', 'modal');\n divGridItem.setAttribute('data-target', '#imageDetailModal');\n divGridItem.setAttribute('onclick', 'loadDataImageDetailModal(' + userPhotoLibrary[i].Id + '); return false;');\n divGridItem.appendChild(img);\n\n if (userPhotoLibrary[i].CheerCount >= 1) {\n var divCheerContainer = document.createElement(\"div\");\n divCheerContainer.classList.add(\"imageCheerContainer\");\n divGridItem.appendChild(divCheerContainer);\n\n var cheerIcon = document.createElement(\"img\");\n cheerIcon.classList.add(\"imageCheerIcon\");\n cheerIcon.setAttribute('src', './images/cheer.png');\n\n // add image to container\n divCheerContainer.appendChild(cheerIcon);\n\n var cheerCount = document.createElement(\"div\");\n cheerCount.classList.add(\"imageCheerText\");\n cheerCount.innerText = userPhotoLibrary[i].CheerCount;\n\n // add div to container\n divCheerContainer.appendChild(cheerCount);\n }\n\n var src = document.getElementById(\"grid\");\n src.appendChild(divGridItem); // append Div\n }\n\n const targets = document.querySelectorAll('img');\n const lazyLoad = target => {\n let observer = {\n threshold: 1\n }\n const io = new IntersectionObserver((entries, observer) => {\n\n entries.forEach(entry => {\n\n if (entry.isIntersecting) {\n const img = entry.target;\n const src = img.getAttribute('data-src');\n\n if (img.hasAttribute('data-src')) {\n img.setAttribute('src', src);\n }\n observer.disconnect();\n }\n });\n });\n io.observe(target);\n };\n targets.forEach(lazyLoad);\n}", "function createGallery(gallery) {\n let order = gallery.order;\n let COUNT = 3;\n $('#title').append(gallery.title);\n $('#description').append(gallery.description);\n let content = \"\";\n for (var i = gallery.start; i <= gallery.end; i++) {\n if (order) {\n content += `<div class=\"col s12 m6 l4 center-align test\"><img class=\"thumbnail card hoverable responsive-img\" data-filename=\"${gallery.filename}\" data-index=\"${i}\" id=\"i${i}\" src=\"images/${gallery.filename}/${gallery.filename}-${i}.jpg\"></div>`;\n if (i % COUNT === 0 ) {\n $('#imagesOrder').append(`<div class=\"row imageRows\"> ${content} </div>`);\n content = \"\";\n disapearingImages(i);\n\n }\n } else {\n $('#imagesNoOrder').append(`<div class=\"card hoverable\"><div class=\"card-image\"><img class=\"thumbnail\" data-filename=\"${gallery.filename}\" data-index=\"${i}\" id=\"i${i}\" src=\"images/${gallery.filename}/${gallery.filename}-${i}.jpg\"></div></div>`);\n Materialize.fadeInImage(`#i${i}`);\n }\n }\n\n\n setTimeout(function() { Materialize.showStaggeredList('#menuList');}, 1000 );\n setTimeout(function(){$('.tap-target').tapTarget('open');}, 1000000) //timer for home screen for dialog.\n\n $('img').click(function(e) {\n let indexI = parseInt(e.target.getAttribute('data-index'));\n let filename = e.target.getAttribute('data-filename');\n let galleryS = JSON.parse(localStorage.getItem('g'));\n let gallery = findGallery(galleryS, filename);\n let final = generateSlides(gallery, indexI);\n var offset = $(this).offset();\n openGalleryFromPhoto(final.slides, {showHideOpacity: true, index: indexI - 1, getThumbBoundsFn: function(i) { \n var thumbnail = $('#i'+ (i + 1))[0], // find thumbnail\n pageYScroll = window.pageYOffset || document.documentElement.scrollTop,\n rect = thumbnail.getBoundingClientRect(); \n\n return {x:rect.left, y:rect.top + pageYScroll, w:rect.width};\n }});\n });\n\n if (window.innerWidth >= 600) {\n $('.imageRows').addClass('valign-wrapper');\n }\n }", "function displayPhotos() {\n loadedImages = 0;\n // set totalImages to the length of the array\n totalImages = photosArray.length;\n // Run function for each obj in photosArray\n photosArray.forEach((photo) => {\n // Create a link to unsplash\n const link = document.createElement(\"a\");\n // link.setAttribute(\"href\", photo.links.html);\n // link.target = \"_blank\";\n setAttributes(link, {\n href: photo.links.html,\n target: \"_blank\",\n });\n // Create an image tag to hold the image\n const image = document.createElement(\"img\");\n // image.src = photo.urls.regular;\n // image.setAttribute(\"alt\", photo.alt_description);\n // image.title = photo.alt_description;\n setAttributes(image, {\n src: photo.urls.regular,\n alt: photo.alt_description,\n title: photo.alt_description,\n });\n // Event Listener, check when each image has loaded\n image.addEventListener(\"load\", imageLoaded);\n // Put image into link, and then put both into the imageContainer\n link.appendChild(image);\n imageContainer.appendChild(link);\n });\n}", "function displayPhotos(){\n imagesLoaded = 0 ;\n totallImages = photosArray.length ;\n photosArray.forEach( photo => {\n\n // Create <a> to link to Unsplash\n const item = document.createElement('a');\n setAttributes(item,{\n href:photo.links.html,\n terget:'_blank'\n });\n // item.setAttribute('href', photo.links.html);\n // item.setAttribute('target','_blank');\n\n //create <img> tag for every image\n const img = document.createElement('img');\n\n setAttributes(img,{\n src: photo.urls.regular,\n alt: photo.alt_description,\n title: photo.alt_description,\n });\n img.addEventListener('load',imageLoaded);\n // img.setAttribute('src',photo.urls.regular);\n // img.setAttribute('alt',photo.alt_description);\n // img.setAttribute('title',photo.alt_description);\n\n //append <img> to <a> and to img container \n item.appendChild(img);\n imageContainer.appendChild(item)\n });\n}", "function init_article_carousels(){\n \n $.each($article_widgets, function(){\n $this = $(this);\n if($this.find('.widget-nav').hasClass('pagination'))\n init_article_carousel($this);\n });\n }", "function carousel_gallery_int (mc){\t\n\n\t\tmc.find(\".carousel_thumbails\").css({\"visibility\":\"hidden\", \"opacity\":0});\t\t\t\t\t\t\t\n\t\tvar current = 0,\t\t\t\t\t\n\t\t$carouselEl = mc.find(\".carousel_thumbails\"),\n\t\t$preview = $( mc.attr(\"data-link\") ),\n\t\t$carouselItems = $carouselEl.children(),\n\t\tisFullScreen = mc.hasClass(\"fullScreen\"),\n\t\tisSmoothResize = $preview.hasClass(\"smooth_resize\"),\n\t\tsmothFirstLod = true,\n\t\tnextBtn = $preview.find('.proj_next'),\n\t\tprevBtn = $preview.find('.proj_prev'),\n\t\tfullNextBtn = mc.parent().find(\".gallery_navigations a.next_button\"),\n\t\tfullPrevBtn = mc.parent().find(\".gallery_navigations a.previous_button\"),\n\t\tfullClosBtn = mc.parent().find(\".gallery_navigations a.thumbClose_btn\"),\n\t\t\n\t\tcarousel = $carouselEl.elastislide( {\n\t\t\tcurrent : current,\n\t\t\tminItems : 1,\n\t\t\tonClick : function( el, pos, evt ) {\n\t\t\t\tchangeImage( el, pos, isFullScreen);\n\t\t\t\tevt.preventDefault();\n\t\t\t},\n\t\t\tonReady : function() {\n\t\t\t\tmc.find(\".carousel_thumbails\").css({\"visibility\":\"visible\"}).animate({\"opacity\":1}, 200, \"easeInOutQuart\");\t\t\t\t \n\t\t\t\ttry{\n\t\t\t\t\tvar thu = $( mc.data(\"thu\"));\n\t\t\t\t\tvar sc = thu.find('.thumbClose_btn .btn_icon');\n\t\t\t\t\tvar cc = thu;\n\t\t\t\t\tthu.css({\"visibility\":\"visible\"});\n\t\t\t\t\t/*if(!isTouch && !self.mobile){\n\t\t\t\t\t\tthu.removeClass(\"mobileView\");\n\t\t\t\t\t\tif(thu.width()<15){\n\t\t\t\t\t\t\tsc.text(\"OPEN\");\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tsc.text(\"CLOSE\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{*/\n\t\t\t\t\tif(self.alignPgHor && !isTouch){\n\t\t\t\t\t\tele.mCustomScrollbar(\"update\");\n\t\t\t\t\t\tele.mCustomScrollbar(\"scrollTo\",\"top\");\t\n\t\t\t\t\t}\n\t\t\t\t\t\tthu.addClass(\"mobileView\");\n\t\t\t\t\t\tsc.children(\":first-child\").text(\"Thumbnails\");\t\n\t\t\t\t\t\t\n\t\t\t\t//\t}\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif(sc.data(\"firLod\") === undefined){\n\t\t\t\t\t\tsc.data(\"firLod\", true);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tprevBtn.css({\"opacity\":.5});\n\n\t\t\t\t\tnextBtn.click(function(){ goNextSlider(); });\t\t\t\t\t\n\t\t\t\t\tprevBtn.click(function(){ goPrevSlider(); });\n\t\t\t\t\tfullNextBtn.click(function(){ goNextSlider(); });\n\t\t\t\t\tfullPrevBtn.click(function(){ goPrevSlider(); });\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tfullNextBtn.hover(function(){\n\t\t\t\t\t\tmc.data(\"thu\").data(\"cHovBtn\", \"nx\");\n\t\t\t\t\t\tif(mc.data(\"thu\").hasClass(\"miniView\")){\n\t\t\t\t\t\t\tvar cur = $carouselEl.children().length-1 > $carouselEl.data(\"cur\") ? $carouselEl.data(\"cur\")+1 : 0;\n\t\t\t\t\t\t\tcarousel._slideToItem(cur);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\tfullPrevBtn.hover(function(){\n\t\t\t\t\t\tmc.data(\"thu\").data(\"cHovBtn\", \"pr\");\n\t\t\t\t\t\tif(mc.data(\"thu\").hasClass(\"miniView\")){\n\t\t\t\t\t\t\tvar cur = $carouselEl.data(\"cur\") > 0 ? $carouselEl.data(\"cur\")-1 : $carouselEl.children().length-1;\n\t\t\t\t\t\t\tcarousel._slideToItem(cur);\n\t\t\t\t\t\t}\n\t\t\t\t\t},function(){\n\t\t\t\t\t\tmc.data(\"thu\").data(\"cHovBtn\", \"nx\");\t\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\tfullClosBtn.click(function(){\t\t\t\t\t\t\n\t\t\t\t\t\tif(!mc.data(\"thu\").hasClass(\"miniView\")){\n\t\t\t\t\t\t\tvar ccc = $carouselEl.data(\"cur\");\n\t\t\t\t\t\t\tif($carouselEl.data(\"cur\") < 3 || $carouselEl.data(\"cur\") > $carouselEl.children().length-5){\n\t\t\t\t\t\t\t\tccc = $carouselEl.data(\"cur\") < 3 ? 3 : $carouselEl.children().length-5;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcarousel._slideTo(ccc);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t} catch(e){ }\n\t\t\t\t\t\n\t\t\t\t\tif($preview !== undefined){\n\t\t\t\t\t\ttry{\t\t \n\t\t\t\t\t\t$(function() {\t\n\t\t\t\t\t\t\t$preview.swipe( {\n\t\t\t\t\t\t\t\t//Generic swipe handler for all directions\n\t\t\t\t\t\t\t\tswipe:function(event, direction, distance, duration, fingerCount) {\n\t\t\t\t\t\t\t\t\tif(direction === \"left\"){\n\t\t\t\t\t\t\t\t\t\tgoNextSlider();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(direction === \"right\"){\n\t\t\t\t\t\t\t\t\t\tgoPrevSlider();\n\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\tallowPageScroll : \"vertical\",\n\t\t\t\t\t\t\t\t//Default is 75px, set to 0 for demo so any distance triggers swipe\n\t\t\t\t\t\t\t\tthreshold:swipeThreshold\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 }catch(e){}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tmc.data(\"thu\").data(\"cHovBtn\", \"nx\");\n\t\t\t\t\tchangeImage( $carouselItems.eq( current ), current, isFullScreen );\n\t\t\t\t} \n\t\t\t\t\t \n\t\t\t});\n\t\t\n\t\tvar interval;\n\t\t\n\t\tfunction goNextSlider(){\n\t\t\t\n\t\t\tif($carouselItems.length-1 > current){\t\t\t\t\t\t\t\n\t\t\t\t current = current+1;\t\n\t\t\t}else{\n\t\t\t\t current = 0;\n\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t$carouselItems.removeClass( 'current-img' );\n\t\t\t$carouselItems.eq( current ).addClass( 'current-img' );\n\t\t\tif(!$($carouselEl).parent().parent().parent().hasClass(\"withoutThumb\")){\n\t\t\t\tcarousel.setCurrent( current );\t\t\t\n\t\t\t\tcarousel._slideToItem(current);\t\t\t\t\t\n\t\t\t}\n\t\t\tchangeImage( $carouselItems.eq( current ), current, false );\t\t\t\n\t\t\tmc.data(\"thu\").data(\"cHovBtn\", \"nx\");\t\t\t \t\t\t\n\t\t}\n\t\t\n\t\tfunction goPrevSlider(){\n\t\t\tif(current > 0){\t\t\t\t\t\t\t\n\t\t\t\tcurrent = current - 1;\t\n\t\t\t}else{\n\t\t\t\tcurrent = $carouselItems.length-1;\n\t\t\t}\t\t\t\t\n\t\t\t$carouselItems.removeClass( 'current-img' );\n\t\t\t$carouselItems.eq( current ).addClass( 'current-img' );\n\t\t\tif(!$($carouselEl).parent().parent().parent().hasClass(\"withoutThumb\")){\n\t\t\t\tcarousel.setCurrent( current );\t\t\t\n\t\t\t\tcarousel._slideToItem(current);\n\t\t\t}\n\t\t\tchangeImage( $carouselItems.eq( current ), current, false );\t\t\t\n\t\t\tmc.data(\"thu\").data(\"cHovBtn\", \"px\");\n\t\t}\n\t\t\t\n\t\tfunction changeImage( el, pos, isFullScreen ) {\t\n\t\t\t\t\t\n\t\t\tif(isSmoothResize && !smothFirstLod){\n\t\t\t\t$preview.css({\"height\":$preview.height()+ parseInt($preview.css(\"padding-top\"))});\t\t\t\t\n\t\t\t}\t\n\t\t\t\n\t\t\t$(\"body\").mainFm('fullScreenGallery', $preview);\t\t\t\t\t\n\n\t\t\tvar nn = 0;\t\t\n\t\t\t\n\t\t\tvar inAnimat = $preview.attr(\"data-animated-in\") !== undefined ? $preview.attr(\"data-animated-in\") : aniInEff;\n\t\t\tvar outAnimat = $preview.attr(\"data-animated-in\") !== undefined ? $preview.attr(\"data-animated-out\") : aniOutEff;\t\t\t\n\t\t\t\t\t\n\t\t\t$preview.data(\"startLoaded\", false);\n\t\t\t\n\t\t\tfunction resetImg (mc, in_, out_){\n\t\t\t\t$preview.data(\"startLoaded\", true);\t\t\t\t\t\t\t\n\t\t\t\tmc.css({\"left\": -$preview.width()}).hide();\t\t\t\t\t\t \n\t\t\t\tmc.removeClass(in_ + out_);\t\n\t\t\t};\n\t\t\t\t\t\t \n\t\t\t$preview.find(\".carousel_item\").each(function(){\t\t\t\t\n\t\t\t\tif(\"#\"+$(this).attr(\"id\") != el.data( 'preview')){\n\t\t\t\t\tclearInterval(interval);\n\t\t\t\t\t\n\t\t\t\t\tif( $(this).css(\"display\") !== \"none\"){\n\t\t\t\t\t\tnn++;\n\t\t\t\t\t \n\t\t\t\t\t\t var kk = -5;\n\t\t\t\t\t\t var self = $(this);\n\t\t\t\t\t\t var aniInTyp = aniInEff;\n\t\t\t\t\t\t var aniOutTyp = aniOutEff;\n\t\t\t\t\t\t \n\t\t\t\t\t\t var mc_ = $(this);\n\t\t\t\t\t\t var jj = 0;\n\t\t\t\t\t\t \n\t\t\t\t\t\t$(this).find('[data-animated-out]').each(function(){\n\t\t\t\t\t\t var mc = mc_ = $(this);\n\t\t\t\t\t\t mc.stop();\n\t\t\t\t\t\t jj++;\n\t\t\t\t\t\t aniInTyp = mc.attr(\"data-animated-in\") !== undefined ? mc.attr(\"data-animated-in\") : aniInTyp;\n\t\t\t\t\t\t aniOutTyp = mc.attr(\"data-animated-out\") !== undefined ? mc.attr(\"data-animated-out\") : aniOutTyp;\n\t\t\t\t\t\t \n\t\t\t\t\t\t if(cssAnimate){\n\t\t\t\t\t\t \t\tmc.removeClass(aniInTyp).addClass(aniOutTyp).one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function(){\n\t\t\t\t\t\t\t \t\tresetImg($(this),aniInTyp, aniOutTyp );\t\t\t\t\t \n\t\t\t\t\t\t\t\t});\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t mc.animate({\"left\":-25, \"opacity\":0},500, \"easeInOutQuad\", function(){\n\t\t\t\t\t\t\t \tresetImg($(this),aniInTyp, aniOutTyp );\n\t\t\t\t\t\t\t });\n\t\t\t\t\t\t\t}\n\t\t\t\t\t });\n\t\t\t\t\t \n\t\t\t\t\t if(jj == 0){\t\t\n\t\t\t\t\t \n\t\t\t\t\t if(cssAnimate){\t\t\t \t\t\t\t \t\t\t\t\t \n\t\t\t\t\t\tmc_.removeClass(inAnimat).addClass(outAnimat).one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function(){\n\t\t\t\t\t\t\tresetImg($(this),inAnimat, outAnimat );\t\t\t\t \n\t\t\t\t\t\t});\t\t\t\t\t\t\n\t\t\t\t\t }else{\n\t\t\t\t\t\t mc_.animate({\"left\":-25, \"opacity\":0},500, \"easeInOutQuad\", function(){\n\t\t\t\t\t\t\t resetImg($(this),inAnimat, outAnimat );\n\t\t\t\t\t\t });\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t }\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t \n\t\t\t});\n\t\t\t\n\t\t\tif(nn === 0){\n\t\t\t\t$preview.data(\"startLoaded\", true);\n\t\t\t}\n\t\t\t\n\t\t\tinterval =\tsetInterval(function(){\n\n\t\t\t\tif($preview.data(\"startLoaded\") == undefined){\n\t\t\t\t\tclearInterval(interval); \n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($preview.data(\"startLoaded\")){\n\t\t\t\t\tclearInterval(interval); \n\t\t\t\t\t\n\t\t\t\t\t var itm = $preview.find(el.data('preview'));\t\n\t\t\t\t\t itm.css({\"left\": $preview.width()});\n\t\t\t\t\t \n\t\t\t\t\t itm.find(\"a.lazyload\").each(function(){\t\n\t\t\t\t\t\tvar dd = $(this);\t\t\n\t\t\t\t\t\t$(\"body\").mainFm('lazyLoadInt', $(this))\n\t\t\t\t\t });\n\t\t\t\t\t \n\t\t\t\t\t itm.find(\"a.lazyload_gallery\").each(function(){\n\t\t\t\t\t\t var dd2 = $(this);\t\t\n\t\t\t\t\t\t $(\"body\").mainFm('lazyLoadInt', $(this))\n\t\t\t\t\t });\n\t\t\t\t\t \n\t\t\t\t\t var pattern = $preview.find(\".overlayPattern\");\n\t\t\t\t\t if(!isTouch){\t\n\t\t\t\t\t\tpattern.show();\n\t\t\t\t\t\t $(this).find(\".addVideo\").each(function(){\n\t\t\t\t\t\t\t$(this).find(\".overlayPattern\").show();\n\t\t\t\t\t\t\tpattern.hide();\n\t\t\t\t\t\t});\n\t\t\t\t\t }else{\n\t\t\t\t\t\t pattern.hide();\n\t\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\t\t var kk = -5;\n\t\t\t\t\t var mc_ = itm;\n\t\t\t\t\t var leng = 0;\n\t\t\t\t\t var aniTyp = inAnimat;\n\t\t\t\t\t \t\t\t\t \n\t\t\t\t\t itm.find('[data-animated-in]').each(function(){\n\t\t\t\t\t\t var mc = mc_ = $(this);\n\t\t\t\t\t\t leng = leng + 1;\n\t\t\t\t\t\t mc.stop();\t\t\t\t\t\t\t\n\t\t\t\t\t\t var aniTyp = mc.attr(\"data-animated-in\") !== undefined ? mc.attr(\"data-animated-in\") : inAnimat;\n\t\t\t\t\t\t mc.data(\"in\", aniTyp)\n\t\t\t\t\t\t kk = !isNaN(mc.attr(\"data-animated-time\")) && mc.attr(\"data-animated-time\") > kk ? Number(mc.attr(\"data-animated-time\")) : kk+5;\n\t\t\t\t\t\t var aniTim = !isNaN(mc.attr(\"data-animated-time\")) ? 100*mc.attr(\"data-animated-time\") : 100*(kk);\t\t\t\t\t\t\n\t\t\t\t\t\t mc.removeClass(aniTyp);\n\t\t\t\t\t\t mc.css({\"visibility\":\"hidden\"});\t\t\t\t\t\t \n\t\t\t\t\t\t setTimeout(function(){\n\t\t\t\t\t\t\t if(cssAnimate){\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t mc.css({\"visibility\":\"visible\"}).removeClass(aniTyp).addClass(aniTyp).one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function(){\n\t\t\t\t\t\t\t\t\t $(this).removeClass($(this).data(\"in\"));\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t });\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t\t mc.css({\"opacity\":0, \"left\":-25, \"visibility\":\"visible\"}).show().animate({\"opacity\":1, \"left\":0},500, \"easeInOutQuad\", function(){\n\t\t\t\t\t\t\t\t\t $(this).removeClass($(this).data(\"in\"));\t\t\n\t\t\t\t\t\t\t\t });\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t }, aniTim );\t\t\t\t\t\t \t\t\t\n\t\t\t\t\t });\n\t\t\t\t\t \n\t\t\t\t\t if(leng === 0){\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(cssAnimate){ \t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t mc_.css({\"visibility\":\"visible\"}).removeClass(aniTyp).addClass(aniTyp).one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function(){\n\t\t\t\t\t\t\t\t$(this).removeClass(aniTyp);\n\t\t\t\t\t\t\t\tif(isSmoothResize){\n\t\t\t\t\t\t\t\t\t$preview.delay(100).animate({\"height\": $(this).height()+ parseInt($preview.css(\"padding-top\"))}, 500 , \"easeInOutQuart\", function(){\n\t\t\t\t\t\t\t\t\t\t$preview.css({\"height\": \"auto\"});\n\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\tsmothFirstLod = false;\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}else{\n\t\t\t\t\t\t\tmc_.show().css({\"visibility\":\"visible\"}).removeClass(aniTyp);\n\t\t\t\t\t\t\tif(isSmoothResize){\n\t\t\t\t\t\t\t\t$preview.animate({\"height\": mc_.height()+ parseInt($preview.css(\"padding-top\"))}, 500 , \"easeInOutQuart\", function(){\n\t\t\t\t\t\t\t\t\t$preview.css({\"height\": \"auto\"});\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsmothFirstLod = false;\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t\t if(isFullScreen){\t\t\n\t\t\t\t\t\t itm.show().css({\"left\": 0, \"opacity\":1}).find('.resize_align').each(function(){\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t $(\"body\").mainFm('resizeImg', $(this));\n\t\t\t\t\t\t\t $(\"body\").mainFm('scroll_update');\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t});\t\n\t\t\t\t\t\t\tif(cssAnimate){\n\t\t\t\t\t\t\t\t$preview.find(el.data('preview')).stop().css({\"left\": 0, \"opacity\":0}).show()[animateSyntax]({\"opacity\": 1}, 500, \"easeInOutQuart\");\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$preview.find(el.data('preview')).show().stop().css({\"left\": 25, \"opacity\":0}).animate({\"left\": 0, \"opacity\":1},500, \"easeInOutQuad\", function(){\n\t\t\t\t\t\t\t\t $(\"body\").mainFm('scroll_update');\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}else{\n\t\t\t\t\t\t\tif(cssAnimate){ \t\n\t\t\t\t\t\t\t\t$preview.find(el.data('preview')).show().stop().css({\"left\": 0});\n\t\t\t\t\t\t\t\t $(\"body\").mainFm('scroll_update');\t\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$preview.find(el.data('preview')).show().stop().css({\"left\": 25, \"opacity\":0}).animate({\"left\": 0, \"opacity\":1},500, \"easeInOutQuad\", function(){\n\t\t\t\t\t\t\t\t $(\"body\").mainFm('scroll_update');\t\t\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t }\n\t\t\t\t}\n\t\t\t}, 50);\t\t\t\t \n \n\t\t\t\t \n\t\t\t$carouselItems.removeClass( 'current-img' );\n\t\t\tel.addClass( 'current-img' );\n\t\t\tif(!$($carouselEl).parent().parent().parent().hasClass(\"withoutThumb\")){\n\t\t\t\tcarousel.setCurrent( pos );\t\n\t\t\t}\n\n\t\t\t$carouselEl.data(\"cur\",pos);\t\t\n\t\t\t\n\n\t\t\tprevBtn.css({\"opacity\":1});\n\t\t\tnextBtn.css({\"opacity\":1});\n\t\t\t\n\t\t\tif(pos > $carouselItems.length-2){\n\t\t\t\tnextBtn.css({\"opacity\":.5});\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif(pos < 1){\n\t\t\t\tprevBtn.css({\"opacity\":.5});\n\t\t\t}\t\n\t\t\t\n\t\t\tcurrent = pos;\n\t\t\t\t\t\n\t\t\tvar tim = $carouselEl.data(\"fLod\") === undefined ? 3500 : 1200;\n\t\t\t$carouselEl.data(\"fLod\" , true)\n\n\t\t\tsetTimeout(function(){\n\t\t\t\t\n\t\t\t\tif(mc.data(\"thu\").hasClass(\"miniView\")){\n\t\t\t\t\tif(mc.data(\"thu\").data(\"cHovBtn\") === \"nx\"){\n\t\t\t\t\t\tvar cur = $carouselItems.length-1 > pos ? pos+1 : 0;\t\t\t\t\t\t\n\t\t\t\t\t\tcarousel._slideToItem(cur);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tvar cur = pos > 0 ? pos-1 : $carouselItems.length-1;\n\t\t\t\t\t\tcarousel._slideToItem(cur);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},tim);\n\n\t\t}\n\t\t\n\t\t$carouselEl.data(\"fn\",changeImage);\n\t\t$carouselEl.data(\"pl\",carousel);\n\t\t\n\t\t\n}", "function slideShow (containerCount, imgsPerContainer) {\n for (let container = 0; container < containerCount; container++) {\n window.setInterval(function () {\n const id = `container-${container}`;\n const imgNum = Math.floor(Math.random() * imgsPerContainer) + container * imgsPerContainer;\n const imgNumPath = `http://letsmaketheworldabetterplace.org/img/${imgNum}.jpg`;\n document.getElementById(id).setAttribute('src', imgNumPath);\n }, 1000 + container * 333); // repeat forever, changing image name every 2-4 seconds\n }\n }", "function loadComponents() {\n var imageCount = images.length, img, child;\n for (var a = 0; a < columns; a++) {\n child = gameContainer.appendChild(document.createElement(\"div\"));\n child.className = \"child\";\n child.style.width = 100 / columns + \"%\";\n for (var i = 0; i < imageCount; i++) {\n img = child.appendChild(document.createElement(\"img\"));\n img.src = images[i];\n img.alt = String(i + 1);\n if (i == a) {\n img.className = \"default-img\";\n }\n }\n }\n }", "function getThumbnails() {\n if (isMobile) {\n loadSingleThumbnails(dayIndex);\n loadThumbCarousel(\"singleThumbnailsContainer\");\n return;\n }\n else {\n if (displaymode == \"D\") { //D - doublepage, S - singlepage\n loadThumbnails(dayIndex);\n loadThumbCarousel(\"thumbnailsContainer\");\n return;\n }\n else if (displaymode == \"S\") {\n loadSingleThumbnails(dayIndex);\n loadThumbCarousel(\"singleThumbnailsContainer\");\n }\n }\n\n //bottomThumbnail('thumbnailsContainer');\n //if (isFirstLoad) {\n // bottomAdShowHide();\n // isFirstLoad = false;\n //}\n\n //scrollThumbs(); // to apply carousel for scroll all thumbs\n }", "function addBootstrapPhotoGallery(images) {\n // TODO: MODULE_ADVENTURE_DETAILS\n // 1. Add the bootstrap carousel to show the Adventure images\n document.getElementById(\n \"photo-gallery\"\n ).innerHTML = `<div id=\"carouselExampleIndicators\" class=\"carousel slide\" data-ride=\"carousel\">\n <ol class=\"carousel-indicators\">\n <li data-target=\"#carouselExampleIndicators\" data-slide-to=\"0\" class=\"active\"></li>\n <li data-target=\"#carouselExampleIndicators\" data-slide-to=\"1\"></li>\n <li data-target=\"#carouselExampleIndicators\" data-slide-to=\"2\"></li>\n </ol>\n <div class=\"carousel-inner\">\n \n </div>\n <a class=\"carousel-control-prev\" href=\"#carouselExampleIndicators\" role=\"button\" data-slide=\"prev\">\n <span class=\"carousel-control-prev-icon\" aria-hidden=\"true\"></span>\n <span class=\"sr-only\">Previous</span>\n </a>\n <a class=\"carousel-control-next\" href=\"#carouselExampleIndicators\" role=\"button\" data-slide=\"next\">\n <span class=\"carousel-control-next-icon\" aria-hidden=\"true\"></span>\n <span class=\"sr-only\">Next</span>\n </a>\n</div>`;\n\n images.forEach((ele, index) => {\n if (index === 0) {\n //let carousel = document.querySelector(\".carousel-inner\");\n let div = document.createElement(\"div\");\n div.className = \"carousel-item active\";\n div.innerHTML = `<img class=\"img-responsive activity-card-image\" src=\"${ele}\">`;\n document.querySelector(\".carousel-inner\").appendChild(div);\n } else {\n //let carousel = document.querySelector(\".carousel-inner\");\n let div = document.createElement(\"div\");\n div.className = \"carousel-item\";\n div.innerHTML = `<img class=\"img-responsive activity-card-image\" src=\"${ele}\">`;\n document.querySelector(\".carousel-inner\").appendChild(div);\n }\n });\n console.log(images);\n}", "function initGallery() {\n let divGallery = document.getElementById(\"gallery\");\n for (let i = 1; i <= 7; i++) {\n divGallery.innerHTML += `<img onclick=\"selectAvatar(event)\" \n class=\"avatar\" \n data-path=\"img/avatar${i}.png\"\n src=\"img/avatar${i}.png\">`;\n }\n}", "function fetchImages() {\n const numPhotos = 18;\n const graphicPromises = [];\n const baseUrl =\n \"https://arcgis.github.io/arcgis-samples-javascript/sample-data/featurelayer-collection/photo-\";\n\n for (let i = 1; i <= numPhotos; i++) {\n const url = baseUrl + i.toString() + \".jpg\";\n const graphicPromise = exifToGraphic(url, i);\n graphicPromises.push(graphicPromise);\n }\n\n return promiseUtils.eachAlways(graphicPromises);\n}", "function initializeProducts(){\n for (var i=0;i<productPicsDisplay.length;i++){\n new ProductPic(productPicsDisplay[i]);\n }\n}", "function CargarImgs() {\r\n var pos1 = 0, pos2 = 0, con = 0;\r\n for (i=0; i<=6; i++) {\r\n for (j=pos1; j<=6; j++) {\r\n state.imgs[con] = new Image;\r\n state.imgs[con].src = ('/domino/'+ pos1 +'-'+ pos2 + '.PNG');\r\n state.imgs[con+28] = new Image;\r\n state.imgs[con+28].src = ('/domino/'+ pos2 +'-'+ pos1 + '.PNG');\r\n state.imgsv[con] = new Image;\r\n state.imgsv[con].src = ('/domino/'+ pos1 +'-'+ pos2 + 'v.PNG');\r\n state.imgsv[con+28] = new Image;\r\n state.imgsv[con+28].src = ('/domino/'+ pos2 +'-'+ pos1 + 'v.PNG');\r\n pos2++;\r\n con++;\r\n }\r\n pos1++;\r\n pos2 = pos1;\r\n }\r\n}", "function genCarouselImages(count) {\n var products = dataProvider.getProducts();\n var cnt = count; var list = [];//index to product array\n while(cnt > 0) {\n var prd_idx = Math.floor(Math.random() * products.length);\n if (!list.includes(prd_idx)) {\n list.push(prd_idx);\n cnt--;\n }\n }\n vm.carouselProductIndices = list;\nconsole.log(\"Carousel product indices ==> \" + vm.carouselProductIndices);\n var urls = [];\n for (var idx = 0; idx < list.length; idx++) {\n var pidx = list[idx];\n urls.push(products[pidx].image_url + 'full-image/' + products[pidx].images[0]);\n }\n vm.carouselImages = urls;\n }", "async getPhotos() {\n\n let pics = await MediaLibrary.getAssetsAsync({\n after: this.state.after,\n first: 50,\n sortBy: [[ MediaLibrary.SortBy.default, true ]]\n });\n\n let promises = [];\n for (var i = 0; i < pics['assets'].length; i++) {\n promises.push(MediaLibrary.getAssetInfoAsync(pics['assets'][i].id));\n }\n\n let a = await Promise.all(promises);\n\n let photos = [];\n for (var i = 0; i < promises.length; i++) {\n photos.push({\n id: a[i].id, // \"F719041D-8A97-4156-A2D9-E25C6CA263AC/L0/001\",\n uri: a[i].uri, // \"assets-library://asset/asset.JPG?id=F719041D-8A97-4156-A2D9-E25C6CA263AC&ext=JPG\",\n file: a[i].localUri, // \"file:///var/mobile/Media/DCIM/116APPLE/IMG_6677.JPG\",\n unix: a[i].creationTime\n });\n }\n\n if (this._isMounted) {\n this.setState((currentState) => {\n return {\n photos: [...currentState.photos, ...photos],\n after: pics['endCursor']\n };\n }, () => {\n // Repeat until the screen is full of images\n // then, we will load more photos with getMoreImages below\n if (this.state.photos.length < 40) {\n this.getPhotos();\n }\n });\n\n }\n }", "function renderImages() {\n $('.landing-page').addClass('hidden');\n $('.img-round').removeClass('hidden');\n updateSrcs();\n currentOffset+=100;\n }", "function addRemainingImageSlides(imageArray) {\n imageArray.forEach(src => {\n const img = `<img src=\"${src}\" alt=\"Photo from the 2021 KCC Foundation scholarship reception\">`;\n // Insert additional slides into both slider-instances\n $('#galleryTrack').slick('slickAdd', img); // The `...slick('slickAdd')` method takes a string of HTML as 2nd arg\n $('#galleryNav').slick('slickAdd', img);\n });\n}", "function fillCarousel() {\r\n\t\taddInsideHtml();\r\n\r\n\t\tfunction addInsideHtml() {\r\n\t\t\tvar ids = [\"101\", \"102\", \"103\", \"1122\", \"104\", \"105\", \"106\", \"107\", \"108\", \"109\", \"110\", \"111\", \"112\", \"113\", \"114\", \"115\", \"116\", \"117\", \"118\", \"119\", \"120\", \"121\", \"122\", \"123\"];\r\n\r\n\t\t\t// Set before looping inside!\r\n\t\t\tvar div_row = document.createElement(\"div\");\r\n\t\t\tdiv_row.classList.add(\"row\");\r\n\t\t\tvar div_item = document.createElement(\"div\");\r\n\t\t\tdiv_item.classList.add(\"carousel-item\", \"active\");\r\n\t\t\tdiv_item.appendChild(div_row);\r\n\t\t\t$(\"#container-bolin\")[0].appendChild(div_item);\r\n\r\n\t\t\tvar count = 0;\r\n\r\n\t\t\tfor (var i in ids) {\r\n\t\t\t\tvar id = ids[i];\r\n\t\t\t\t// Add Modals\r\n\t\t\t\tvar modal = generateModal(id);\r\n\t\t\t\t$(\"#modalsBulin\")[0].appendChild(modal);\r\n\t\t\t\t// Add Images\r\n\t\t\t\tvar res_img = addImages(id, count, div_row);\r\n\t\t\t\tcount = res_img[0];\r\n\t\t\t\tdiv_row = res_img[1];\r\n\t\t\t}\r\n\r\n\t\t\tfillChartsModal(ids);\r\n\r\n\t\t\t$('#carouselImages').carousel({\r\n\t\t\t\tinterval: 2800\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tfunction generateModal(id) {\r\n\t\t\tvar div_out_modal = document.createElement(\"div\");\r\n\t\t\tdiv_out_modal.classList.add(\"modal\", \"fade\");\r\n\t\t\tdiv_out_modal.setAttribute(\"id\", \"modal-\" + id)\r\n\t\t\tdiv_out_modal.setAttribute(\"tabindex\", \"-1\")\r\n\t\t\tdiv_out_modal.setAttribute(\"role\", \"dialog\")\r\n\t\t\tdiv_out_modal.setAttribute(\"aria-labelledby\", \"painting\" + id)\r\n\t\t\tdiv_out_modal.setAttribute(\"aria-hidden\", \"true\")\r\n\r\n\t\t\tvar div_modal_dialog = document.createElement(\"div\");\r\n\t\t\tdiv_modal_dialog.classList.add(\"modal-dialog\", \"modal-lg\");\r\n\t\t\tdiv_modal_dialog.setAttribute(\"role\", \"document\");\r\n\r\n\t\t\tvar div_modal_content = document.createElement(\"div\");\r\n\t\t\tdiv_modal_content.classList.add(\"modal-content\");\r\n\r\n\t\t\tvar div_modal_header = document.createElement(\"div\");\r\n\t\t\tdiv_modal_header.classList.add(\"modal-header\");\r\n\r\n\t\t\t// Body Modal\r\n\t\t\tvar modal_title = document.createElement(\"h4\");\r\n\t\t\tmodal_title.classList.add(\"modal-title\", \"w-100\");\r\n\t\t\tmodal_title.setAttribute(\"id\", \"painting\" + id);\r\n\t\t\tmodal_title.innerText = \"Emotions analysis\";\r\n\r\n\t\t\tdiv_modal_header.appendChild(modal_title);\r\n\r\n\t\t\tdiv_modal_content.appendChild(div_modal_header);\r\n\r\n\t\t\tvar div_modal_body = document.createElement(\"div\");\r\n\t\t\tdiv_modal_body.classList.add(\"modal-body\");\r\n\r\n\t\t\tvar canvas = document.createElement(\"canvas\");\r\n\t\t\tcanvas.setAttribute(\"id\", \"canvas-\" + id);\r\n\t\t\tdiv_modal_body.appendChild(canvas);\r\n\r\n\t\t\tdiv_modal_content.appendChild(div_modal_body);\r\n\r\n\t\t\t// Statistics\r\n\t\t\tvar statistics = document.createElement(\"div\");\r\n\t\t\tstatistics.classList.add(\"row\", \"mg-20-top\");\r\n\r\n\t\t\tvar statistics_left = document.createElement(\"div\");\r\n\t\t\tstatistics_left.classList.add(\"col\");\r\n\r\n\t\t\tvar statistics_right = document.createElement(\"div\");\r\n\t\t\tstatistics_right.classList.add(\"col\");\r\n\r\n\t\t\tvar canvas_line = document.createElement(\"canvas\");\r\n\t\t\tcanvas_line.setAttribute(\"id\", \"canvasline-\" + id);\r\n\t\t\tstatistics_right.appendChild(canvas_line);\r\n\r\n\t\t\tstatistics.appendChild(statistics_left);\r\n\t\t\tstatistics.appendChild(statistics_right);\r\n\r\n\t\t\tdiv_modal_body.appendChild(statistics);\r\n\r\n\t\t\tvar div_modal_footer = document.createElement(\"div\");\r\n\t\t\tdiv_modal_footer.classList.add(\"modal-footer\");\r\n\r\n\t\t\tvar button_footer = document.createElement(\"button\");\r\n\t\t\tbutton_footer.classList.add(\"btn\", \"sunny-morning-gradient\", \"btn-sm\");\r\n\t\t\tbutton_footer.setAttribute(\"data-dismiss\", \"modal\");\r\n\t\t\tbutton_footer.innerText = \"Close\";\r\n\r\n\t\t\tdiv_modal_footer.appendChild(button_footer);\r\n\t\t\tdiv_modal_content.appendChild(div_modal_footer);\r\n\r\n\t\t\tdiv_modal_dialog.appendChild(div_modal_content);\r\n\t\t\tdiv_out_modal.appendChild(div_modal_dialog);\r\n\t\t\treturn div_out_modal;\r\n\t\t}\r\n\r\n\t\tfunction addImages(id, count, div_row) {\r\n\t\t\t// Add dynamically all the images in carousel\r\n\t\t\tvar div = document.createElement(\"div\");\r\n\t\t\tdiv.classList.add(\"col\", \"work\");\r\n\r\n\t\t\tvar a = document.createElement(\"a\");\r\n\t\t\ta.setAttribute(\"id\", \"a-\" + id);\r\n\t\t\ta.setAttribute(\"data-toggle\", \"modal\");\r\n\t\t\ta.setAttribute(\"data-target\", \"modal-\" + id);\r\n\t\t\ta.classList.add(\"work-box\", \"imageBolin\");\r\n\r\n\t\t\ta.addEventListener(\"click\", function () {\r\n\t\t\t\t$(\"#modal-\" + id).modal('show');\r\n\t\t\t});\r\n\r\n\t\t\tvar img = document.createElement(\"img\");\r\n\t\t\timg.setAttribute(\"src\", \"/static/images/bolin/\" + id + \".jpg\");\r\n\r\n\t\t\ta.appendChild(img);\r\n\r\n\t\t\tvar div_inner = document.createElement(\"div\");\r\n\t\t\tdiv_inner.classList.add(\"overlay\");\r\n\r\n\t\t\tvar div_inner2 = document.createElement(\"div\");\r\n\t\t\tdiv_inner2.classList.add(\"overlay-caption\");\r\n\r\n\t\t\tvar p = document.createElement(\"p\");\r\n\t\t\tvar span = document.createElement(\"span\");\r\n\t\t\tspan.classList.add(\"icon\", \"icon-magnifying-glass\");\r\n\t\t\tp.appendChild(span);\r\n\r\n\t\t\tdiv_inner2.appendChild(p);\r\n\t\t\tdiv_inner.appendChild(div_inner2);\r\n\r\n\t\t\ta.appendChild(div_inner);\r\n\r\n\t\t\tdiv.appendChild(a);\r\n\r\n\t\t\tif (count != 0 & count % 6 == 0) {\r\n\t\t\t\tvar div_row = document.createElement(\"div\");\r\n\t\t\t\tdiv_row.classList.add(\"row\");\r\n\r\n\t\t\t\tvar div_item = document.createElement(\"div\");\r\n\t\t\t\tdiv_item.classList.add(\"carousel-item\");\r\n\r\n\t\t\t\tdiv_item.appendChild(div_row);\r\n\r\n\t\t\t\t$(\"#container-bolin\")[0].appendChild(div_item);\r\n\t\t\t}\r\n\t\t\tdiv_row.appendChild(div);\r\n\t\t\tcount = count + 1;\r\n\t\t\treturn [count, div_row];\r\n\t\t}\r\n\r\n\t\tfunction fillChartsModal(keys) {\r\n\t\t\tif (keys.length > 0) {\r\n\t\t\t\tvar id = keys[0];\r\n\t\t\t\tkeys = keys.slice(1);\r\n\t\t\t\tvar idPic = null;\r\n\r\n\t\t\t\tif (id == \"1122\")\r\n\t\t\t\t\tidPic = \"112\";\r\n\t\t\t\telse idPic = id;\r\n\r\n\r\n\t\t\t\t$.ajax({\r\n\t\t\t\t\turl: '/experiment/painting?id=' + idPic,\r\n\t\t\t\t\ttype: 'GET',\r\n\t\t\t\t\tsuccess: function (result) {\r\n\t\t\t\t\t\tvar datas = {}\r\n\r\n\t\t\t\t\t\tfor (var r in result) {\r\n\t\t\t\t\t\t\tdatas[r] = normalizeData(result[r]);\r\n\t\t\t\t\t\t\tdatas[r][\"name\"] = result[r][\"name\"];\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tvar datasMean = {\r\n\t\t\t\t\t\t\t\"name\": null,\r\n\t\t\t\t\t\t\t\"anger\": 0,\r\n\t\t\t\t\t\t\t\"contempt\": 0,\r\n\t\t\t\t\t\t\t\"disgust\": 0,\r\n\t\t\t\t\t\t\t\"fear\": 0,\r\n\t\t\t\t\t\t\t\"happiness\": 0,\r\n\t\t\t\t\t\t\t\"sadness\": 0,\r\n\t\t\t\t\t\t\t\"surprise\": 0\r\n\t\t\t\t\t\t};\r\n\r\n\t\t\t\t\t\tvar emotions = ['anger', 'contempt', 'disgust', 'fear', 'happiness', 'sadness', 'surprise']\r\n\t\t\t\t\t\tvar t = 0;\r\n\r\n\t\t\t\t\t\tfor (var i in datas) { // average to avoid time\r\n\t\t\t\t\t\t\tt++;\r\n\t\t\t\t\t\t\tdatasMean['name'] = datas[i]['name'];\r\n\t\t\t\t\t\t\tfor (var el in emotions) {\r\n\t\t\t\t\t\t\t\tvar emotion = emotions[el];\r\n\t\t\t\t\t\t\t\tdatasMean[emotion] = (((datasMean[emotion] * (t - 1)) / t) + datas[i][emotion] / t);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// Generate radar chart\r\n\t\t\t\t\t\tvar chartGenerated = fillChart('radar', `canvas-${id}`, datasMean['name'], datasMean);\r\n\r\n\t\t\t\t\t\tvar chartTimeGenerated = fillChartTime('line', `canvasline-${id}`, datas);\r\n\r\n\t\t\t\t\t\tfillChartsModal(keys);\r\n\t\t\t\t\t},\r\n\t\t\t\t\terror: function (error) { // error retrieve data of an image\r\n\t\t\t\t\t\tconsole.log(error);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\t// });\r\n\t\t\t} else return\r\n\r\n\t\t};\r\n\t}", "componentDidMount() {\n var arrOfPromises = [];\n\n gridItems.data.forEach((gridItem) => {\n arrOfPromises.push(\n new Promise((resolve, reject) => {\n let img = new Image();\n img.src = gridItem.src;\n img.addEventListener('load', function() {\n resolve(gridItem.id);\n });\n })\n )\n });\n\n // When all images are loaded then only call onAllImgsLoaded that would make the grid visible.\n Promise.all(arrOfPromises).then(values => {\n this.props.onAllImgsLoaded();\n });\n\n // make the images observe scrolling events. \n for (const imgRef of this.imgRefs) {\n try {\n this.observer.observe(imgRef.current);\n } catch (err) {\n console.log(err);\n }\n }\n }", "function initPictures() {\nif(DEBUG) alert('initPictures()');\n\tpictures = new DocumentCollection();\n\tpictures.assignEvent(appName);\n\tpictures.load();\n}", "function start () {\n // generate 3 non-duplicate, non-repeating from previous images\n previousImages = imageGroupGenerator(previousImages);\n renderImages(imageA);\n renderImages(imageB);\n renderImages(imageC);\n}", "function photoGallery(e1, e2) {\n var sync1 = $(e1);\n var sync2 = $(e2);\n\n sync1.owlCarousel({\n singleItem: true,\n slideSpeed: 1000,\n navigation: true,\n pagination: false,\n afterAction: syncPosition,\n responsiveRefreshRate: 200\n });\n\n sync2.owlCarousel({\n items: 3,\n itemsDesktop: [1550, 2],\n itemsDesktopSmall: [1199, 3],\n itemsTablet: [979, 3],\n itemsTabletSmall: [568, 3],\n itemsMobile: [321, 3],\n pagination: false,\n responsiveRefreshRate: 100,\n afterInit: function(el) {\n el.find(\".owl-item\").eq(0).addClass(\"synced\");\n }\n });\n\n function syncPosition(el) {\n var current = this.currentItem;\n $(e2)\n .find(\".owl-item\")\n .removeClass(\"synced\")\n .eq(current)\n .addClass(\"synced\")\n if ($(e2).data(\"owlCarousel\") !== undefined) {\n center(current)\n }\n }\n\n $(e2).on(\"click\", \".owl-item\", function(e) {\n e.preventDefault();\n var number = $(this).data(\"owlItem\");\n sync1.trigger(\"owl.goTo\", number);\n });\n\n function center(number) {\n var sync2visible = sync2.data(\"owlCarousel\").owl.visibleItems;\n var num = number;\n var found = false;\n for (var i in sync2visible) {\n if (num === sync2visible[i]) {\n var found = true;\n }\n }\n\n if (found === false) {\n if (num > sync2visible[sync2visible.length - 1]) {\n sync2.trigger(\"owl.goTo\", num - sync2visible.length + 2)\n } else {\n if (num - 1 === -1) {\n num = 0;\n }\n sync2.trigger(\"owl.goTo\", num);\n }\n } else if (num === sync2visible[sync2visible.length - 1]) {\n sync2.trigger(\"owl.goTo\", sync2visible[1])\n } else if (num === sync2visible[0]) {\n sync2.trigger(\"owl.goTo\", num - 1)\n }\n\n }\n\n }", "function getLoadedImages() {\r\n return images;\r\n }", "function showCarousel(num) {\n\t$(\"#carouselContainer\").show();\n\t// for (var i = 0; i < images[num].size; i++) {\n\t// \t$('#carouselContainer').append('<div class=\"item\"><img src=\"'+images[num][i]+'\" style=\"width:100%;\"></div>');\n\t// }\n\t//console.log(images[num].length);\n\tfor (var i = 0; i < images[num].length; i++) {\n\t\tif (i == 0) {\n\t\t\t$('.carousel-indicators').append('<li data-target=\"#myCarousel\" data-slide-to=\"'+i+'\" class=\"active\"></li>');\n\t\t\t$('.carousel-inner').append('<div class=\"item active\"><img src=\"'+images[num][i]+'\" class=\"carouselImage\"></img></div>');\n\t\t} else {\n\t\t\t$('.carousel-indicators').append('<li data-target=\"#myCarousel\" data-slide-to=\"'+i+'\"></li>');\n\t\t\t$('.carousel-inner').append('<div class=\"item\"><img src=\"'+images[num][i]+'\" class=\"carouselImage\"></img></div>');\n\t\t}\n\t}\n\t//$('.carousel-inner').append('<div class=\"item active\"><img src=\"'+images[num][1]+'\" class=\"carouselImage\"></img></div>');\n \t$(\".gallery-item\").css(\"z-index\", \"-1\");\n\t$(\".item>img\").height($(window).height()-51);\n\t$(\".carouselClose\").width(($(window).width()-$(\"#myCarousel\").width())/2);\n}", "function LoadSliderImages(sublist) {\n\t\t\tvar numImages = sublist.find('.item > a > .src').length;\n\t\t\tsublist.find('.item > a > .src').each(function(i) {\n\t\t\t\tvar img = new Image();\n\t\t\t\tvar imgSrc = $(this).html();\n\t\t\t\tvar imgAlt = $(this).parent().find('.alt').html();\n\t\n\t\t\t\t$(this).parent().append(img);\n\t\t\t \n\t\t\t\t// wrap our new image in jQuery, then:\n\t\t\t\t$(img).load(function () {\n\t\t\t\t\tnumImages--;\n\t\t\t\t\tif (numImages == 0) {\n\t\t\t\t\t\tSetSublist(sublist);\n\t\t\t\t\t}\n\t\t\t\t\t/*\n\t\t\t\t\tif (i == sublist.find('.item > a > .src').size() - 1) {\n\t\t\t\t\t\tSetSublist(sublist);\n\t\t\t\t\t}\n\t\t\t\t\t*/\n\t\t\t\t})\n\t\t\t\t.error(function () {\n\t\t\t\t// notify the user that the image could not be loaded\n\t\t\t\t})\n\t\t\t\t.attr('src', imgSrc).attr('alt', imgAlt);\n\t\t\t});\n\t\t}" ]
[ "0.69375914", "0.6784285", "0.6733166", "0.673027", "0.67277676", "0.6722266", "0.66847664", "0.6637117", "0.6633724", "0.6549185", "0.6547319", "0.6505008", "0.64773405", "0.6472952", "0.64249736", "0.6421355", "0.642083", "0.6407476", "0.64026946", "0.64008904", "0.63908917", "0.6379621", "0.6376883", "0.6371474", "0.6366697", "0.63649184", "0.6344171", "0.63343585", "0.63115233", "0.6249606", "0.6219642", "0.6201988", "0.6193592", "0.6184726", "0.6155312", "0.613728", "0.6130958", "0.6121501", "0.612087", "0.61131656", "0.6112052", "0.6111191", "0.6107197", "0.61022514", "0.60972375", "0.6096495", "0.6092451", "0.6090991", "0.60848165", "0.6081524", "0.6063287", "0.6054178", "0.6049425", "0.60493976", "0.60493535", "0.6047262", "0.60441154", "0.6040443", "0.6029164", "0.6020455", "0.60138845", "0.60092634", "0.6005559", "0.59984714", "0.59962916", "0.5976907", "0.5971887", "0.59698087", "0.5967333", "0.5966478", "0.595844", "0.5957515", "0.5953592", "0.5948096", "0.5947784", "0.5939211", "0.59376234", "0.59308493", "0.59304523", "0.5929024", "0.5920693", "0.59154576", "0.59086895", "0.5904687", "0.58940804", "0.5892666", "0.5892563", "0.58850306", "0.58817124", "0.58770955", "0.587441", "0.5872609", "0.5872366", "0.5866551", "0.58663815", "0.58655125", "0.5859964", "0.5858755", "0.5856608", "0.5854847" ]
0.63630664
26
Make nav sticky once user scrolls past intro section Set Event Spaces menu item have active appearance based on scroll position (above or below intro section)
function makeNavStickyOnScroll() { var $window = $(window); var $spacesLink = $('a#link_to_spaces'); // Override the standard nav bar by giving it id "homecoming-float" and removing "fixed" class $('.site-nav') .attr('id', 'homecoming-float') .removeClass('navbar-fixed-top'); // find the Y position of the intro section var intro_offset = $('section.intro').offset().top; $window.scroll(function windowScroll() { if ($window.scrollTop() >= intro_offset) { // Make site nav sticky once we scroll past intro section $('.site-nav') .attr('id', 'siteNav') .addClass('navbar-fixed-top'); // Add active class to Event Spaces menu item once we scroll past intro section $spacesLink.addClass('site-nav-menu__link--active'); } // un-sticky site nav and remove active class from Event Space menu item once we scroll above intro section if ($window.scrollTop() < intro_offset) { $('.site-nav') .attr('id', 'homecoming-float') .removeClass('navbar-fixed-top'); $spacesLink.removeClass('site-nav-menu__link--active'); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeSectionActive(){\n if (window.scrollY > navbarList.offsetTop){\n navbarList.classList.add('sticky');\n }else {\n\n navbarList.classList.remove('sticky');\n }\n for (let i =0; i < allSections.length; i++){\n if ( (window.scrollY+70 > allSections[i].offsetTop && i !== allSections.length-1 && window.scrollY+70 < allSections[i+1].offsetTop) || (window.scrollY+70 > allSections[i].offsetTop && i === allSections.length-1)){\n for (let navItem of navItems){\n if (navItem.innerText === allSections[i].getAttribute('data-nav')){\n navItem.classList.add('active');\n }else {\n navItem.classList.remove('active');\n }\n }\n }\n }\n}", "function setActive() {\n document.addEventListener(\"scroll\", function () {\n let items = menuItens.children;\n\n for (let i = 0; i < mainSections.length; i++) {\n if (\n i === mainSections.length - 1 &&\n window.innerHeight + window.scrollY >=\n document.body.offsetHeight\n ) {\n mainSections[i].classList.add(\"active\");\n items[i].classList.add(\"active\");\n } else if (\n mainSections[i].getBoundingClientRect().top <=\n window.innerHeight / 2 &&\n mainSections[i].getBoundingClientRect().top >=\n window.innerHeight / 2 - mainSections[i].offsetHeight\n ) {\n mainSections[i].classList.add(\"active\");\n items[i].classList.add(\"active\");\n } else {\n mainSections[i].classList.remove(\"active\");\n items[i].classList.remove(\"active\");\n }\n }\n });\n}", "function scrNav() {\n var sTop = $(window).scrollTop();\n $('section').each(function () {\n var id = $(this).attr('id'),\n offset = $(this).offset().top - 1,\n height = $(this).height();\n if (sTop >= offset && sTop < offset + height) {\n link.removeClass('active');\n $('#navbar').find('[data-scroll=\"' + id + '\"]').addClass('active');\n }\n });\n }", "function stickyNav()\n{\n window.addEventListener(\"scroll\", () =>\n {\n let header = document.querySelector(\"header\");\n\n header.classList.toggle(\"scrollActive\", window.scrollY > 0);\n });\n}", "function setToActive () {\n window.addEventListener('scroll', function (event) {\n let section = getActiveSection();\n section.classList.add('your-active-class');\n // set other sections as inactive\n for ( i of sections) {\n if (i.id != section.id & i.classList.contains('your-active-class')) {\n i.classList.remove('your-active-class');\n }\n }\n // set the header style to list element\n const active = document.querySelector('li[data-nav=\"' + section.id + '\"]'); // get the corresponding list element\n active.classList.add('active__link'); // added to the css\n // remove from other list elements\n const elements = document.querySelectorAll('.menu__link');\n for ( i of elements) {\n if (i.dataset.nav != active.dataset.nav & i.classList.contains('active__link')) {\n i.classList.remove('active__link');\n }\n }\n })\n}", "function activeAsScroll(){\n let navStart =[document.querySelector('#direction').getBoundingClientRect().y,document.querySelector('#about').getBoundingClientRect().y,document.querySelector('#event').getBoundingClientRect().y\n ,document.querySelector('#contact').getBoundingClientRect().y];//to know at which y each section start\n let navItem = document.querySelectorAll('li');\n if(scrollValue <navStart[0]+50){\n removeActiveClass();//home part\n navItem[0].querySelector('span').classList+=' active';\n }else if(scrollValue >navStart[0]+50 && scrollValue<navStart[1]+50){\n removeActiveClass();//description part\n navItem[1].querySelector('span').classList+=' active';\n }else if(scrollValue >navStart[1] && scrollValue<navStart[2]+100){\n removeActiveClass();\n navItem[2].querySelector('span').classList+=' active';\n }else if(scrollValue >navStart[2]+50 && scrollValue<navStart[3]){\n removeActiveClass();// about part \n navItem[2].querySelector('span').classList+=' active';\n }else if(scrollValue >navStart[3]+50){\n removeActiveClass();\n navItem[3].querySelector('span').classList+=' active';\n }else{\n removeActiveClass();// contact part\n navItem[4].querySelector('span').classList+=' active';\n }\n}", "function addMenuActiveClassOnScrolling() {\n\n\t//Grab sections (targets) and menu links (trigers) for menu items to apply active links styles to\n\tconst sections = document.querySelectorAll('.resume__section'),\n\t\tmenu_links = document.querySelectorAll('.grid__header--nav--item');\n\n\t//Functions for adding and removing active class from links as appropriate\n\tconst makeActive = link => menu_links[link].classList.add('active');\n\n\tconst removeActive = link => menu_links[link].classList.remove('active');\n\n\tconst removeAllActive = () => [...Array(sections.length).keys()].forEach(link => removeActive(link));\n\n\t// change the active link a bit above the actual section\n\t// this way it will change as you're approaching the section rather\n\t// than waiting until the section has passed the top of the screen\n\tconst sectionMargin = 100;\n\n\t// keep track of the currently active link\n \t// use this so as not to change the active link over and over\n \t// as the user scrolls but rather only change when it becomes\n \t// necessary because the user is in a new section of the page\n\tlet currentActive = 0;\n\n\twindow.addEventListener('scroll', () => {\n\t\t/*\n\t\t\t// check in reverse order so we find the last section\n\t\t\t// that's present - checking in non-reverse order would\n\t\t\t// report true for all sections up to and including\n\t\t\t// the section currently in view\n\t\t\t//\n\t\t\t// Data in play:\n\t\t\t// window.scrollY - is the current vertical position of the window\n\t\t\t// sections - is a list of the dom nodes of the sections of the page\n\t\t\t// [...sections] turns this into an array so we can\n\t\t\t// use array options like reverse() and findIndex()\n\t\t\t// section.offsetTop - is the vertical offset of the section from the top of the page\n\t\t\t//\n\t\t\t// basically this lets us compare each section (by offsetTop) against the\n\t\t\t// viewport's current position (by window.scrollY) to figure out what section\n\t\t*/\n\n\t\t// the user is currently viewing\n\t\tconst current = sections.length - [...sections].reverse().findIndex(section => window.scrollY >= section.offsetTop - sectionMargin) - 1;\n\n\t\t// only if the section has changed\n \t// remove active class from all menu links\n \t// and then apply it to the link for the current section\n\n\t\tif (current !== currentActive) {\n\t\t\tremoveAllActive();\n\t\t\tcurrentActive = current;\n\t\t\tmakeActive(current);\n\t\t}\n\t}, false);\n}", "function setActive () {\n window.addEventListener('scroll', function (event) {\n let section = getActiveElem();\n section.classList.add('your-active-class');\n // set other sections as inactive\n for (let item of sectionList) {\n if (item.id != section.id & item.classList.contains('your-active-class')) {\n item.classList.remove('your-active-class');\n }\n }\n // set corresponding header style\n const active = document.querySelector('li > a[data-id=\"' + section.id + '\"]');\n active.classList.add('active__link');\n // remove from other headers\n const headers = document.querySelectorAll('.menu__link');\n for (let item of headers) {\n if (item.dataset.id != active.dataset.id & item.classList.contains('active__link')) {\n item.classList.remove('active__link');\n }\n };\n });\n}", "function opNavScroll() {\r\n\r\n if ($('.op-section')[0]) {\r\n\r\n var section = $(\".op-section\");\r\n var sections = {};\r\n var i = 0;\r\n\r\n Array.prototype.forEach.call(section, function(e) {\r\n sections[e.id] = e.offsetTop;\r\n });\r\n\r\n window.onscroll = function() {\r\n var scrollPosition = document.documentElement.scrollTop || document.body.scrollTop;\r\n\r\n for (i in sections) {\r\n if (sections[i] <= scrollPosition) {\r\n $('li.menu-item').removeClass('current_page_item');\r\n $('a[href*=' + i + ']').parent().addClass('current_page_item ');\r\n }\r\n }\r\n }\r\n\r\n }\r\n }", "function setActive() {\n document.addEventListener('scroll', function () {\n sectionList[0].classList.remove(\"active\")\n const sectionHeight = sectionList[0].offsetHeight;\n\n for (i = 0; i < sectionList.length; i++) {\n\n if (window.scrollY >= headerEl.offsetHeight + (sectionHeight * i) &&\n window.scrollY < headerEl.offsetHeight + (sectionHeight * (i + 1))\n ) {\n sectionList[i].classList.add('your-active-class');\n navbarList.children[i].classList.add('active');\n }\n else {\n sectionList[i].classList.remove('your-active-class');\n navbarList.children[i].classList.remove('active');\n }\n }\n\n })\n\n}", "function setActiveElementOnScroll(){\n //listen to scroll events and set your-active-class class to section in view\n document.addEventListener('scroll', function(evt) {\n for (let i = 0; i < all_sections_list.length; i++){\n //Retrieve the active section\n const active_section = all_sections_list[i];\n //Add the section's title to the menu nav bar\n if (elementInViewport(active_section)) {\n console.log(active_section.querySelector('h2').innerHTML + ' is in the ViewPort');\n active_section.setAttribute('class', 'your-active-class');\n //set the respective menu link to it's active/hover state\n const active_section_title = active_section.querySelector('h2').innerHTML.toLowerCase();\n const active_section_id = active_section_title.replace(/\\s+/g, '');\n console.log('Active section ID: ' + active_section_id);\n const nav_bar_list_item = document.querySelector('#' + active_section_id + '_menu');\n nav_bar_list_item.classList.add('active_section');\n //Remove active-class from the other menu items (lazy method :/)\n if (i == 0){\n console.log(\"At section 1, removing active-class from other menu items\")\n const active_section_1 = all_sections_list[i+1];\n const active_section_2 = all_sections_list[i+2];\n const active_section_3 = all_sections_list[i+3];\n //remove 'active-class' from section one\n const active_section_title_1 = active_section_1.querySelector('h2').innerHTML.toLowerCase();\n const active_section_id_1 = active_section_title_1.replace(/\\s+/g, '');\n console.log('Active section ID: ' + active_section_id_1);\n const nav_bar_list_item_1 = document.querySelector('#' + active_section_id_1 + '_menu');\n if (nav_bar_list_item_1.classList.contains('active_section')){\n nav_bar_list_item_1.classList.remove('active_section')\n }\n \n //remove 'your-active-class' from section two\n const active_section_title_2 = active_section_2.querySelector('h2').innerHTML.toLowerCase();\n const active_section_id_2 = active_section_title_2.replace(/\\s+/g, '');\n console.log('Active section ID: ' + active_section_id_2);\n const nav_bar_list_item_2 = document.querySelector('#' + active_section_id_2 + '_menu');\n if (nav_bar_list_item_2.classList.contains('active_section')){\n nav_bar_list_item_2.classList.remove('active_section')\n }\n\n //remove 'your-active-class' from section 3\n const active_section_title_3 = active_section_3.querySelector('h2').innerHTML.toLowerCase();\n const active_section_id_3 = active_section_title_3.replace(/\\s+/g, '');\n console.log('Active section ID: ' + active_section_id_3);\n const nav_bar_list_item_3 = document.querySelector('#' + active_section_id_3 + '_menu');\n if (nav_bar_list_item_3.classList.contains('active_section')){\n nav_bar_list_item_3.classList.remove('active_section')\n }\n } else if (i == 1){\n console.log(\"At section 2, removing active-class from other menu items\")\n const active_section_1 = all_sections_list[i-1];\n const active_section_2 = all_sections_list[i+1];\n const active_section_3 = all_sections_list[i+2];\n //remove 'active-class' from section one\n const active_section_title_1 = active_section_1.querySelector('h2').innerHTML.toLowerCase();\n const active_section_id_1 = active_section_title_1.replace(/\\s+/g, '');\n console.log('Active section ID: ' + active_section_id_1);\n const nav_bar_list_item_1 = document.querySelector('#' + active_section_id_1 + '_menu');\n if (nav_bar_list_item_1.classList.contains('active_section')){\n nav_bar_list_item_1.classList.remove('active_section')\n }\n \n //remove 'your-active-class' from section two\n const active_section_title_2 = active_section_2.querySelector('h2').innerHTML.toLowerCase();\n const active_section_id_2 = active_section_title_2.replace(/\\s+/g, '');\n console.log('Active section ID: ' + active_section_id_2);\n const nav_bar_list_item_2 = document.querySelector('#' + active_section_id_2 + '_menu');\n if (nav_bar_list_item_2.classList.contains('active_section')){\n nav_bar_list_item_2.classList.remove('active_section')\n }\n\n //remove 'your-active-class' from section 3\n const active_section_title_3 = active_section_3.querySelector('h2').innerHTML.toLowerCase();\n const active_section_id_3 = active_section_title_3.replace(/\\s+/g, '');\n console.log('Active section ID: ' + active_section_id_3);\n const nav_bar_list_item_3 = document.querySelector('#' + active_section_id_3 + '_menu');\n if (nav_bar_list_item_3.classList.contains('active_section')){\n nav_bar_list_item_3.classList.remove('active_section')\n }\n } else if (i == 2){\n console.log(\"At section 3, removing active-class from other menu items\")\n const active_section_1 = all_sections_list[i-2];\n const active_section_2 = all_sections_list[i-1];\n const active_section_3 = all_sections_list[i+1];\n //remove 'active-class' from section one\n const active_section_title_1 = active_section_1.querySelector('h2').innerHTML.toLowerCase();\n const active_section_id_1 = active_section_title_1.replace(/\\s+/g, '');\n console.log('Active section ID: ' + active_section_id_1);\n const nav_bar_list_item_1 = document.querySelector('#' + active_section_id_1 + '_menu');\n if (nav_bar_list_item_1.classList.contains('active_section')){\n nav_bar_list_item_1.classList.remove('active_section')\n }\n \n //remove 'your-active-class' from section two\n const active_section_title_2 = active_section_2.querySelector('h2').innerHTML.toLowerCase();\n const active_section_id_2 = active_section_title_2.replace(/\\s+/g, '');\n console.log('Active section ID: ' + active_section_id_2);\n const nav_bar_list_item_2 = document.querySelector('#' + active_section_id_2 + '_menu');\n if (nav_bar_list_item_2.classList.contains('active_section')){\n nav_bar_list_item_2.classList.remove('active_section')\n }\n\n //remove 'your-active-class' from section 3\n const active_section_title_3 = active_section_3.querySelector('h2').innerHTML.toLowerCase();\n const active_section_id_3 = active_section_title_3.replace(/\\s+/g, '');\n console.log('Active section ID: ' + active_section_id_3);\n const nav_bar_list_item_3 = document.querySelector('#' + active_section_id_3 + '_menu');\n if (nav_bar_list_item_3.classList.contains('active_section')){\n nav_bar_list_item_3.classList.remove('active_section')\n }\n }else if (i == 3){\n console.log(\"At section 4, removing active-class from other menu items\")\n const active_section_1 = all_sections_list[i-3];\n const active_section_2 = all_sections_list[i-2];\n const active_section_3 = all_sections_list[i-1];\n //remove 'active-class' from section one\n const active_section_title_1 = active_section_1.querySelector('h2').innerHTML.toLowerCase();\n const active_section_id_1 = active_section_title_1.replace(/\\s+/g, '');\n console.log('Active section ID: ' + active_section_id_1);\n const nav_bar_list_item_1 = document.querySelector('#' + active_section_id_1 + '_menu');\n if (nav_bar_list_item_1.classList.contains('active_section')){\n nav_bar_list_item_1.classList.remove('active_section')\n }\n \n //remove 'your-active-class' from section two\n const active_section_title_2 = active_section_2.querySelector('h2').innerHTML.toLowerCase();\n const active_section_id_2 = active_section_title_2.replace(/\\s+/g, '');\n console.log('Active section ID: ' + active_section_id_2);\n const nav_bar_list_item_2 = document.querySelector('#' + active_section_id_2 + '_menu');\n if (nav_bar_list_item_2.classList.contains('active_section')){\n nav_bar_list_item_2.classList.remove('active_section')\n }\n\n //remove 'your-active-class' from section 3\n const active_section_title_3 = active_section_3.querySelector('h2').innerHTML.toLowerCase();\n const active_section_id_3 = active_section_title_3.replace(/\\s+/g, '');\n console.log('Active section ID: ' + active_section_id_3);\n const nav_bar_list_item_3 = document.querySelector('#' + active_section_id_3 + '_menu');\n if (nav_bar_list_item_3.classList.contains('active_section')){\n nav_bar_list_item_3.classList.remove('active_section')\n }\n }\n }else{\n console.log(\"Error checking whether element is in viewPort\")\n }\n }\n })\n}", "function Activating() {\r\n window.addEventListener(\"scroll\", function(event) {\r\n let activatedsection = sectioninview();\r\n activatedsection.classList.add(\"your-active-class\");\r\n\r\n\r\n for (const element of allsections) {\r\n if (element.id != activatedsection.id & element.classList.contains(\"your-active-class\")) {\r\n element.classList.remove(\"your-active-class\");\r\n }\r\n }\r\n let activeli = document.querySelector(\"li[data-nav=\" + activatedsection.id + \"]\");\r\n activeli.classList.add(\"active_header\");\r\n\r\n const headers = document.querySelectorAll(\".menu__link\");\r\n for (const element of headers) {\r\n\r\n if (element.dataset.nav != activeli.dataset.nav & element.classList.contains(\"active_header\")) {\r\n element.classList.remove(\"active_header\");\r\n }\r\n };\r\n });\r\n}", "function addScrollListener(){\n document.addEventListener('scroll', function () {\n for (section of sections){\n const linkId = section.getAttribute('data-menu-item');\n const menuItem = document.getElementById(linkId);\n if (isInViewport(section)){\n console.log('in view ' + section.getAttribute('id'));\n section.classList.add(\"your-active-class\");\n menuItem.classList.add('active-link');\n }else{\n section.classList.remove(\"your-active-class\");\n menuItem.classList.remove('active-link');\n }\n }\n }, {\n passive: true\n });\n}", "function doActive(scroll_pos) {\r\n for (let num = 1; num <= sections.length; num++) {\r\n if (window.scrollY >= pos[num - 1] - 50 && window.scrollY <= pos[num - 1] + 500) {\r\n sections[num - 1].classList.add('your-active-class');\r\n a[num - 1].classList.add(\"active\");\r\n } else {\r\n sections[num - 1].classList.remove('your-active-class');\r\n a[num - 1].classList.remove(\"active\");\r\n }\r\n }\r\n}", "function activateSection() {\n for (const sec of sections) {\n document.addEventListener('scroll', function () {\n let top = sec.getBoundingClientRect().top;\n if (top < 200 && top > -200) {\n sec.classList.add(\"your-active-class\");\n\n //Activate menu item paralell with active section\n for (const item of menuItems) {\n if (item.textContent === sec.getAttribute('data-nav')) {\n item.style.cssText = 'background: #333; color: #fff;';\n\n //Scrolling to top \n if (sec.getAttribute('data-nav') >= 'Section 2') {\n scrollToTop();\n } else {\n scrol.style = 'display : none';\n }\n\n }\n else {\n item.style = 'none';\n }\n }\n }\n else {\n sec.classList.remove(\"your-active-class\");\n }\n });\n }\n}", "function stickyMenu() {\n // Foncton qui ajoute la classe homemade-sticky\n var menu = document.getElementsByClassName(\"grid_header\")[0];\n var sticky = menu.offsetTop;\n // On active la classe seulement quand le scroll arrive à la possition (Y) du menu\n if (window.pageYOffset > sticky) {\n menu.classList.add(\"homemade-sticky\");\n } else {\n menu.classList.remove(\"homemade-sticky\");\n }\n}", "function handler() {\n let scrpos=window.pageYOffset || document.scrollingElement.scrollTop;\n let vh=window.innerHeight\n let homePos=scrpos+home.getBoundingClientRect().top;\n let aboutPos=scrpos+about.getBoundingClientRect().top;\n let servicesPos=scrpos+services.getBoundingClientRect().top;\n let portfolioPos=scrpos+portfolio.getBoundingClientRect().top;\n let contactPos=scrpos+contact.getBoundingClientRect().top;\n\n if(scrpos>=homePos && scrpos<=(homePos+home.clientHeight)){\n //make it active\n document.querySelector(\".menu-item.home a\").classList.add('active')\n document.querySelector(\".nav-item.home\").classList.add('active')\n\n //home paralax effect\n let parax=home.querySelectorAll('[data-paralax]');\n parax.forEach(elm=>{\n paralax(elm,scrpos)\n })\n }else{\n document.querySelector(\".menu-item.home a\").classList.remove('active')\n document.querySelector(\".nav-item.home\").classList.remove('active') \n }\n if(scrpos>=aboutPos && scrpos<=(aboutPos+about.clientHeight)){\n //just incase about me pGW DOES NOT occupiy the whole of viewport\n document.querySelector(\".menu-item.home a\").classList.remove('active')\n document.querySelector(\".nav-item.home\").classList.remove('active') \n \n //make it active\n document.querySelector(\".menu-item.about a\").classList.add('active')\n document.querySelector(\".nav-item.about\").classList.add('active')\n }else{\n document.querySelector(\".menu-item.about a\").classList.remove('active')\n document.querySelector(\".nav-item.about\").classList.remove('active')\n }\n if(scrpos>=servicesPos && scrpos<=(servicesPos+services.clientHeight)){\n //make it active\n document.querySelector(\".menu-item.services a\").classList.add('active')\n document.querySelector(\".nav-item.services\").classList.add('active')\n }else{\n document.querySelector(\".menu-item.services a\").classList.remove('active')\n document.querySelector(\".nav-item.services\").classList.remove('active')\n }\n if(scrpos>=portfolioPos && scrpos<=(portfolioPos+portfolio.clientHeight)){\n //make it active\n document.querySelector(\".menu-item.portfolio a\").classList.add('active')\n document.querySelector(\".nav-item.portfolio\").classList.add('active')\n }else{\n document.querySelector(\".menu-item.portfolio a\").classList.remove('active')\n document.querySelector(\".nav-item.portfolio\").classList.remove('active')\n }\n\n if(scrpos>=contactPos || scrpos>=(document.scrollingElement.scrollHeight-vh)){\n //make it active\n //disblae portfolio active class since contact me is not a full page section\n document.querySelector(\".menu-item.portfolio a\").classList.remove('active')\n document.querySelector(\".nav-item.portfolio\").classList.remove('active')\n\n document.querySelector(\".menu-item.contact-me a\").classList.add('active')\n document.querySelector(\".nav-item.contact-me\").classList.add('active')\n }else{\n document.querySelector(\".menu-item.contact-me a\").classList.remove('active')\n document.querySelector(\".nav-item.contact-me\").classList.remove('active')\n }\n}", "function onScroll(event) {\n var headerHeight = $('.header').outerHeight(true);\n var navHeight = $('.navigation').outerHeight(true);\n var scrollPos = $(document).scrollTop();\n $('.inside-look-component .navigation ul li a').each(function () {\n var currLink = $(this);\n var refElement = $(currLink.attr(\"href\"));\n //console.log($(currLink.attr(\"href\")));\n if (refElement.position().top <= scrollPos + headerHeight + navHeight - 3 && refElement.position().top + refElement.height() > scrollPos + headerHeight + navHeight - 95) {\n $('.inside-look-component .navigation ul li a').removeClass(\"active\");\n currLink.addClass(\"active\");\n }\n else {\n currLink.removeClass(\"active\");\n }\n });\n}", "function stickyNavigation() {\n if (window.scrollY > tab_nav_offSet) {\n tab_nav.classList.add(\"fixed\");\n\n if (window.scrollY > 361) {\n tab_nav_user.style.opacity = \"1\";\n } else {\n tab_nav_user.style.opacity = \"0\";\n }\n } else {\n tab_nav.classList.remove(\"fixed\");\n }\n}", "setStickyActive() {\n\t\twindow.addEventListener( 'scroll', function() {\n\t\t\tif ( 5 < ( window.pageYOffset ) ) {\n\t\t\t\tthis.header.classList.add( 'header__sticky-active' );\n\t\t\t} else {\n\t\t\t\tthis.header.classList.remove( 'header__sticky-active' );\n\t\t\t}\n\t\t});\n\t}", "function hasScrolled() {\n var st = $(this).scrollTop();\n // make sure the scroll event is larger than delta\n if (Math.abs(lastST - st) <= delta){\n return;\n }\n // if scrolling down or if above half the intro size\n // hide the sticky nav\n if (st > lastST || st < nHeight*2){\n $(\"nav\").css({ \"opacity\": 1 });\n $('.nav-sticky').css({ \"top\": -nHeight });\n } \n else {\n // else show the navigation on scroll up\n if(wWidth > breakMobile && st + $(window).height() < $(document).height()) {\n $(\"nav\").css({ \"opacity\": 0 });\n $('.nav-sticky').css({ \"top\": 0 });\n }\n }\n // set last scroll top\n lastST = st;\n }", "function stickyFunction() {\n\t\n if (window.pageYOffset > document.getElementById(\"menu\").offsetTop) {\n document.getElementById(\"menu\").classList.add(\"deslizante\");\n//\talert(\"Baja\");\n } else {\n document.getElementById(\"menu\").classList.remove(\"deslizante\");\n//\talert(\"Sube\");\n }\n}", "function onScroll(event) {\n let scrollPos = $(document).scrollTop();\n $(\".header__nav a\").each(function() {\n let currLink = $(this);\n let refElement = $(currLink.attr(\"href\"));\n if (\n refElement.position().top - 80 <= scrollPos &&\n refElement.position().top + refElement.height() + 180 > scrollPos\n ) {\n $(\".header__nav a\").removeClass(\"active\");\n currLink.addClass(\"active\");\n } else {\n currLink.removeClass(\"active\");\n }\n });\n }", "function redrawNav(){\r\n var article1Top = 0;\r\n // The top of each article is offset by half the distance to the previous article.\r\n var article2Top = $('#frontend-school').offset().top / 2;\r\n var article3Top = ($(document).height() - $('#experience').offset().top) / 2;\r\n $('nav.nav li').removeClass('active');\r\n if($(document).scrollTop() >= article1Top && $(document).scrollTop() < article2Top){\r\n $('li.general-info').addClass('active');\r\n } else if ($(document).scrollTop() >= article2Top && $(document).scrollTop() < article3Top){\r\n $('li.frontend-school').addClass('active');\r\n } else if ($(document).scrollTop() >= article3Top){\r\n $('li.experience').addClass('active');\r\n }\r\n \r\n }", "function toggleActiveState() {\n document.addEventListener(\"scroll\", function (event) {\n const sections = document.querySelectorAll(\"section\");\n let links = document.querySelectorAll(\".menu__link\");\n for (const section of sections) {\n if(isElementOnScreen(section)) {\n section.classList.add('your-active-class') //\n links.forEach((link) => {\n const isActiveLink = link.getAttribute(\"href\") === section.id;\n link.classList.toggle(\"link__active\", isActiveLink);\n });\n } else {\n section.classList.remove(\"your-active-class\");\n }\n }\n });\n }", "function setMenuActiveOnScroll() {\n for (let section of sectionsList) {\n if (isElementInViewport(section.children[0].children[0])) {\n setSectionActive(section.id);\n setMenuActive(section.id);\n }\n }\n}", "function activateMenuOnScroll(){\n waq.$menu.$anchoredSections = $();\n for(i=0;i<waq.$menu.$links.length; i++){\n var $trigger = waq.$menu.$links.eq(i);\n var $section = $( '#' + $trigger.parent().attr('class').split(\" \")[0] );\n if($section.length) waq.$menu.$anchoredSections.push($section[0]);\n }\n if(waq.$menu.$anchoredSections.length){\n waq.$menu.$anchoredSections.scrollEvents({\n flag: 'anchor',\n offset: 150,\n topUp: function(e){\n var slug = e.selection.attr('id');\n var $target = waq.$menu.$links.parent().filter('.'+slug);\n waq.$menu.$links.parent().removeClass('active');\n if($target.length){\n $target.addClass('active');\n // window.location.replace('#!/'+slug);\n };\n },\n topDown: function(e){\n var slug = $(scrollEvents.selection[minMax(e.i-1,0,100)]).attr('id')\n var $target = waq.$menu.$links.parent().filter('.'+slug);\n waq.$menu.$links.parent().removeClass('active');\n if($target.length){\n $target.addClass('active');\n // window.location.replace('#!/'+slug);\n }\n }\n\n });\n }\n // dirty fix\n $win.on('load',function(){\n waq.$menu.$links.parent().removeClass('active');\n });\n }", "function updateActive(){\n let currentView = document.documentElement.scrollTop;\n for ( let i = 0; i < sectionList.length; i++ ) {\n let section = sectionList[i];\n const navItem = document.getElementById(section.getAttribute('data-nav'));\n if(currentView >= section.offsetTop - 1 && currentView < section.offsetTop + section.offsetHeight - 1){\n if(!section.classList.contains('your-active-class')){\n section.classList.add('your-active-class');\n navItem.classList.add('active');\n }\n } else {\n section.classList.remove('your-active-class');\n navItem.classList.remove('active');\n }\n }\n}", "function scrollToHighlight(){\n window.addEventListener(\"scroll\" , function(){\n mySections.forEach((section)=> {\n let view = section.getBoundingClientRect();\n if (view.top >= -250 && view.top <= 200) {\n //add active class to a specific section\n section.classList.add(\"your-active-class\");\n // to highlight a specific link in the nav-menue\n const allLinks = document.querySelectorAll(\"a\");\n allLinks.forEach((alink) => {\n alink.classList.remove(\"activeLink\");\n if(section.getAttribute(\"data-nav\") === alink.textContent){\n alink.classList.add(\"activeLink\");\n }\n })\n }\n else {\n //to remove all other active class from other sections\n section.classList.remove(\"your-active-class\");\n } \n })\n })\n}", "function setScroll(){\n window.addEventListener(\"scroll\", ()=> {\n \n for (let i=0; i<navElements.length; ++i){\n let elementScroll = document.getElementById('section'+(i+1));\n let buttonNav = document.getElementById(\"section_nav\"+(i+1));\n if (isScrolledIntoView(elementScroll) ){\n elementScroll.classList.add(\"active\");\n buttonNav.style.background = \"orange\";\n \n }\n else{\n elementScroll.classList.remove(\"active\");\n buttonNav.style.background = \"white\";\n }\n \n }\n });\n}", "function stickyNav() {\n if(window.scrollY >= 150) {\n secondaryNav.classList.add(\"showSecondNav\")\n nav.classList.add(\"nodisplayXS\") \n } else {\n secondaryNav.classList.remove(\"showSecondNav\")\n nav.classList.remove(\"nodisplayXS\") \n \n }\n}", "function main(){\r\n // build the nav\r\n createNav();\r\n\r\n // Add class 'active' to section when near top of viewport\r\n toggleActive();\r\n}", "function stickyNav() {\n if ($(window).scrollTop() >= 100) {\n $(\".desktop-header\").addClass(\"header-sticky\");\n } else {\n $(\".desktop-header\").removeClass(\"header-sticky\");\n }\n }", "function stickyNav() {\n if (window.pageYOffset >= sticky) {\n nav.classList.add(\"sticky\");\n } else {\n nav.classList.remove(\"sticky\");\n }\n}", "function sticky_nav_scroll() {\n if (window.pageYOffset > 100 && w >= 500) {\n $('.nav').removeClass('display-none');\n $('body').addClass('body-margin-modifier');\n }\n else {\n $('.nav').addClass('display-none');\n $('body').removeClass('body-margin-modifier');\n }\n }", "function navCheck() {\n if (window.pageYOffset >= sticky) {\n navbar.classList.add(\"sticky\");\n quote.classList.add(\"pad\");\n $(\"#mlh-trust-badge\").css(\"visibility\", \"visible\");\n $(\"#mlh-trust-badge\").slideDown();\n document.body.style.backgroundColor = \"#000000\";\n } else {\n $('.cover').each(function(){\n $(this).css('margin-top', (-1 * $(window).scrollTop() / parseInt($(this).attr('speed'))));\n });\n navbar.classList.remove(\"sticky\");\n quote.classList.remove(\"pad\");\n $(\"#mlh-trust-badge\").slideUp();\n document.body.style.backgroundColor = \"#253A79\";\n }\n }", "function addCLassActive() {\n const links = document.querySelectorAll('a');\n\n \n\nwindow.addEventListener('scroll', function() {\n sections.forEach(section => {\n links.forEach(link => {\n if(link.dataset.scroll === section.id) {\n if(this.scrollY >= section.offsetTop && this.scrollY < (section.offsetTop + section.offsetHeight)){\n link.classList.add('active')\n console.log(this.scrollY, section.offsetTop, section.offsetTop+section.offsetHeight)\n } else {\n link.classList.remove('active');\n }\n}})})})}", "function sectop(){\r\n const sectop= document.querySelectorAll('SECTION');\r\n\r\n for (const sectiontop of sectop) {\r\n window.addEventListener(\"scroll\",function(){\r\n if (sectiontop.getBoundingClientRect().top< window.innerHeight&& sectiontop.getBoundingClientRect().bottom>window.innerHeight){\r\n sectiontop.classList.add('active');\r\n }\r\n else{\r\n sectiontop.classList.remove(\"active\");\r\n }\r\n\r\n\r\n });\r\n\r\n /*\r\n let y= sectiontop.getBoundingClientRect().top;\r\n paragraph.classList.add('read');*/\r\n }\r\n\r\n}", "function navActive(){\n let navItem = document.querySelectorAll('li');\n for(let i=0;i<5;i++){\n navItem[i].scrollIntoView({behavior: \"smooth\", block: \"end\", inline: \"nearest\"});\n navItem[i].addEventListener('mouseover',function(e){//to appear or disappear active point\n setTimeout(()=>{\n //to remove active from other\n for(let j=0;j<navItem.length/2;j++){\n if(navItem[j].querySelector('span').className.indexOf('active')!=-1){\n navItem[j].querySelector('span').classList.remove('active');\n }\n }\n if(e.target.querySelector('span')!=null){\n e.target.querySelector('span').classList+=' active';}//to add active point}\n },200);\n \n });\n // to smooth return to top\n navItem[i].addEventListener('click',function(e){\n e.preventDefault();//prevent default to make smooth scroll\n // to go to the specific part which user want to go\n let partName = '#'+e.target.innerHTML.split('<')[0].toLowerCase();//get name of section we want to go \n let sectionName = document.querySelector(''+partName+'');//to go to specific part\n sectionName.scrollIntoView({behavior: \"smooth\", block: \"start\", inline: \"nearest\"});\n });\n }\n}", "function navfixedScroll() {\n if (window.pageYOffset > sticky+200) {\n navbar.classList.add(\"sticky\")\n } else {\n navbar.classList.remove(\"sticky\");\n }\n }", "function redrawDotNav(){\n var half = $(window).height() / 2;\n var section1Top = 0;\n // The top of each section is offset by half the distance to the previous section.\n var section2Top = $('#about').offset().top - half;\n var section3Top = $('#features').offset().top - half;\n var section4Top = $('#demo').offset().top - half;\n var section5Top = $('#conclusion').offset().top - half;\n $('nav#primary a').removeClass('active');\n if($(document).scrollTop() >= section1Top && $(document).scrollTop() < section2Top){\n $('nav#primary a.home').addClass('active');\n } else if ($(document).scrollTop() >= section2Top && $(document).scrollTop() < section3Top){\n $('nav#primary a.about').addClass('active');\n } else if ($(document).scrollTop() >= section3Top && $(document).scrollTop() < section4Top){\n $('nav#primary a.features').addClass('active');\n } else if ($(document).scrollTop() >= section4Top && $(document).scrollTop() < section5Top){\n $('nav#primary a.demo').addClass('active');\n } else if ($(document).scrollTop() >= section5Top){\n $('nav#primary a.conclusion').addClass('active');\n }\n}", "function myNavBar(){\r\n if(window.pageYOffset >= sticky){\r\n navbar.classList.add(\"sticky\")\r\n } else{\r\n navbar.classList.remove(\"sticky\")\r\n }\r\n}", "function myFunction() {\r\n if (window.pageYOffset >= sticky) {\r\n navbar.classList.add(\"sticky-nav\");\r\n $('.anchor').addClass('offset1');\r\n \r\n } else {\r\n navbar.classList.remove(\"sticky-nav\");\r\n $('.anchor').removeClass('offset1');\r\n }\r\n }", "function myFunction() {\r\n if (window.pageYOffset >= sticky) {\r\n navbar.classList.add(\"sticky-nav\");\r\n $('.anchor').addClass('offset1');\r\n \r\n } else {\r\n navbar.classList.remove(\"sticky-nav\");\r\n $('.anchor').removeClass('offset1');\r\n }\r\n }", "function addSticky(){\n var ss = window.innerWidth;\n if (ss >= 1230) {\n if ( window.pageYOffset >= 124 ) {\n nav1.classList.add(\"sticky\");\n } else {\n nav1.classList.remove(\"sticky\");\n }\n } else {\n if ( window.pageYOffset >= 66 ) {\n nav2.classList.add(\"sticky\");\n } else {\n nav2.classList.remove(\"sticky\");\n }\n }\n}", "function stikyNav() {\n\n top = allWindow.scrollTop();\n\n if ( top >= 100 ) {\n navBar.addClass(\"nav-sticky\");\n\n } else {\n navBar.removeClass(\"nav-sticky\");\n }\n\n // SHow Also Scroll up Button\n if ( top >= 1000 ) {\n $('.scroll-up').addClass(\"show-up-btn\");\n } else {\n $('.scroll-up').removeClass(\"show-up-btn\");\n }\n }", "function stickyNav() {\n // Get the navbar\n var navbar = document.getElementById(\"navbar-section\");\n // Get the offset position of the navbar\n var sticky = navbar.offsetTop;\n if (window.pageYOffset > sticky) {\n navbar.classList.add(\"sticky\");\n $('#content').css('padding-top', '3rem');\n } else {\n navbar.classList.remove(\"sticky\");\n $('#content').css('padding-top', '0');\n }\n }", "function stickyFunction() {\n if (window.pageYOffset >= sticky) {\n $subMenu.addClass(\"sticky\");\n } else {\n $subMenu.removeClass(\"sticky\");\n }\n}", "function addActive(){ \n for(let section of sectionList){\n let head=document.querySelector(`#${section.id} h2`);\n if(head.getBoundingClientRect().top <= window.innerHeight && head.getBoundingClientRect().top >=0){\n section.classList.add('your-active-class');\n changeActiveLink(section);\n }\n else{\n section.classList.remove('your-active-class');\n }\n }\n}", "function stickyScroll() {\n if (window.pageYOffset >= sticky) {\n navbar.classList.add(\"sticky\")\n } else {\n navbar.classList.remove(\"sticky\");\n }\n }", "function activeClassAdder()\n{\n window.addEventListener('scroll',function(eventInfo)\n {\n // setting new active class\n var currentSection=sectionFinder();\n currentSection.classList.add('your-active-class');\n\n for(var pointer of allSections)\n {\n if(pointer.id!=currentSection.id && pointer.classList.contains('your-active-class'))\n {\n // removing old active class\n pointer.classList.remove('your-active-class');\n break;\n \n }\n\n }\n\n var currentHeading=document.querySelector('a[data-nav=\"'+currentSection.id+'\"]');\n\n // setting new active heading\n currentHeading.id='active-heading';\n\n this.console.log(currentSection.id+currentHeading.innerText);\n\n // removing old active heading\n\n const allHeadings=this.document.querySelectorAll('a.menu__link');\n\n for(var pointer of allHeadings)\n {\n if(pointer.dataset.nav!=currentHeading.dataset.nav && pointer.id=='active-heading')\n {\n pointer.id=\"\";\n }\n }\n\n });\n}", "function stickyMenu() {\r\n if (window.pageYOffset > sticky) {\r\n icons.classList.add(\"sticky\");\r\n } else {\r\n icons.classList.remove(\"sticky\");\r\n }\r\n }", "function activeSection (){\n /* a scroll event is attached to the window object, \n then when a section is in browser view adds 'your-active-class' to the class of that section.\n When no longer in view, remove the active style.*/\n window.addEventListener('scroll', function(){\n \n for(let x =0; x<sections.length;x++){\n //This method Returns the size of a section and its position relative to the viewport.\n /* if a section is scroll up(getBoundingClientRect().top < 0) and no longer in view or or a section is below the view or\n its top distance is greater than the window inner height remove the active state */\n if(sections[x].getBoundingClientRect().top < 0||(sections[x].getBoundingClientRect().top>window.innerHeight)){\n if( sections[x].classList.contains('your-active-class'))\n sections[x].classList.remove('your-active-class');\n \n } \n else{sections[x].classList.add('your-active-class');} \n }\n\n })\n \n}", "function setupNav() {\n\tvar section1Top = 0;\n\tvar section2Top \t= $('footer').offset().top - (($(document).height() - $('footer').offset().top) / 2);;\n\t\n\t$('nav li').removeClass('active');\n\t\n\tif($(document).scrollTop() >= section1Top && $(document).scrollTop() < section2Top){\n\t\t$('nav li.selected_work').addClass('active');\n\t} else if ($(document).scrollTop() >= section2Top){\n\t\t$('nav li.about').addClass('active');\n\t}\n\t\n\t// CHANGE THESE NUMBERS TO ADJUST THE POSITION OF THE NAV WHEN YOU HIT THE FOOTER\n\tif($(window).scrollTop() >= 14532) {\n\t\t$('header').css('position', 'absolute');\n\t\t$('header').css('top', 14552);\n\t} else {\n\t\t$('header').css('position', 'fixed');\n\t\t$('header').css('top', 20);\n\t}\n\t\n}", "_initScrollTracking() {\n let timeoutHandle = null;\n let lastActiveSection = null;\n window.addEventListener('scroll', (ev) => {\n clearTimeout(timeoutHandle);\n\n timeoutHandle = setTimeout(() => {\n const sections = document.getElementsByTagName('section');\n for (const section of sections) {\n // Finds the first section within the viewport, then breaks\n if (this._isInViewPort(section)) {\n if (section != lastActiveSection) {\n this._clearNavbarSelectedItems(this._navbar);\n\n const sectionName = section.getAttribute('data-name');\n\n this._selectItemForSection(navbar, sectionName);\n }\n \n lastActiveSection = section;\n break;\n }\n }\n }, 300);\n })\n }", "function toggleActiveClass() {\r\n allSections.forEach(sec => {\r\n let location = sec.getBoundingClientRect(); // get the section dimensions\r\n let allAnchors = document.querySelectorAll('.menu__link'); // store all anchors\r\n if (location.top > -50 && location.top < 250) { // condition for selecting section in viewport\r\n removeActiveClass(); // remove active classs from sections\r\n addActiveClass(sec); // applying active class to the section in viewport\r\n }\r\n allAnchors.forEach(link => {\r\n link.classList.remove('active__class');\r\n if (sec.getAttribute('data-nav') == link.textContent ) {\r\n link.classList.add('active__class');\r\n }\r\n });\r\n });\r\n}", "function myStickScrollFunction() {\n if (window.pageYOffset >= sticky) {\n topnav.classList.add(\"sticky\")\n } else {\n topnav.classList.remove(\"sticky\");\n }\n}", "function ActiveSection() {\n //add an event listenr of type scroll\n window.addEventListener(\"scroll\", () => {\n //loop through all the added sections to get the top of height for each section\n //to return the size of an element and its position relative to the viewport\n for (let i = 0; i < section_numbers.length; i++) {\n let rect = section_numbers[i].getBoundingClientRect();\n\n //determine if the user scrolling to the top for each section or not\n //by adding a condition needed to determine if the top of the needed section is greater than zero\n // or if the top is smaller than the needed height corrseponding to the view port\n if (rect.top > 0 && rect.top < 400) {\n //declare a variable that catch the data nav\n let DataNav = section_numbers[i].getAttribute(\"data-nav\");\n //if active section is found , remove the active class from the rest sections\n\n for (let j = 0; j < section_numbers.length; j++) {\n section_numbers[j].classList.remove(\"your-active-class\");\n }\n section_numbers[i].classList.add(\"your-active-class\");\n //declare a new varibale to collect all the added links to the list\n\n let Attached_links = document.querySelectorAll(\"a\");\n\n for (let k = 0; k < Attached_links.length; k++) {\n if (Attached_links[k] == DataNav) {\n for (let z = 0; z < Attached_links.length; k++) {\n Attached_links[z].classList.add(\"link-active-class\");\n }\n Attached_links[k].classList.add(\"link-active-class\");\n }\n }\n }\n }\n });\n}", "function setActiveSection() {\n for (let i=0; i < sections.length; i++) {\n // Selects all the nav items and stores in NodeList\n const navItems = document.querySelectorAll('.menu__link');\n if (isInViewport(sections[i])) {\n sections[i].classList.add('active');\n // Removes all active classes from each navItem\n navItems.forEach(navItem => navItem.classList.remove('active'));\n // Adds active class to the navItem that matches the section that is in view\n navItems[i].classList.add('active');\n }\n else {\n // Removes active classes if the section is not in view\n sections[i].classList.remove('active');\n }\n }\n}", "function stickyFunction() {\n if (window.pageYOffset >= sticky) {\n nav.style.position = \"sticky\";\n } else {\n nav.style.position = \"static\";\n }\n}", "function fijarMenu() {\n if (window.pageYOffset > sticky) {\n\n header.classList.remove(\"navigation-menu-show\");\n header.classList.add(\"sticky\");\n\n } else {\n\n header.classList.remove(\"sticky\");\n header.classList.add(\"navigation-menu-show\");\n }\n}", "function navScroll() {\n // init controller\n height = window.innerHeight;\n var controller = new ScrollMagic.Controller();\n\n // build scenes\n new ScrollMagic.Scene({triggerElement: \"#intro\"})\n .setClassToggle(\"#nav\", \"bg-sienna\") // add class toggle\n .addTo(controller);\n}", "function onScroll(event){\n var scrollPos = $(document).scrollTop();\n $('#nav a:not(#back-to-top)').each(function () {\n var currLink = $(this);\n var refElement = $(currLink.attr(\"href\"));\n if (refElement.position().top - 110 <= scrollPos && refElement.position().top + refElement.height() > scrollPos) {\n $('#nav ul li a').removeClass(\"active\");\n currLink.addClass(\"active\");\n }\n else{\n currLink.removeClass(\"active\");\n }\n });\n}", "function mySticky() {\n if (window.pageYOffset >= sticky) {\n navBar.classList.add(\"sticky\")\n } else {\n navBar.classList.remove(\"sticky\");\n }\n}", "function headerSticky(){\n\t\tvar windowPos=$(window).scrollTop();\n\t\tif( windowPos>20){\n\t\t\t// SCROLL\n\t\t\t$('.fixed-top').addClass(\"on-scroll\");\n\t\t\t$('#svg-normal').removeClass(\"svg-hidden\");\n\t\t\t$('#svg-branca').addClass(\"svg-hidden\");\n\t\t\t$('.nav-link ').addClass(\"my-menu-scroll\");\n\t\t} else {\n\t\t\t// FIXADO (É O INICIAL)\n\t\t\t$('.fixed-top').removeClass(\"on-scroll\");\n\t\t\t$('#svg-normal').addClass(\"svg-hidden\");\n\t\t\t$('#svg-branca').removeClass(\"svg-hidden\");\n\t\t\t$('.nav-link ').removeClass(\"my-menu-scroll\");\n\t\t}\n\t}", "function redrawDotNav(){\r\n var section1Top = 0;\r\n var section2Top = $('#news').offset().top;\r\n var section3Top = $('#about').offset().top;\r\n var section4Top = $('#login').offset().top;\r\n $('nav#primary a').removeClass('active');\r\n if($(window).scrollTop() >= section1Top && $(document).scrollTop() < section2Top){\r\n $('nav#primary a#home').addClass('active');\r\n } else if ($(window).scrollTop() >= section2Top && $(document).scrollTop() < section3Top){\r\n $('nav#primary a#news').addClass('active');\r\n } else if ($(window).scrollTop() >= section3Top && $(document).scrollTop() < section4Top){\r\n $('nav#primary a#about').addClass('active');\r\n } else if ($(window).scrollTop() >= section4Top){\r\n $('nav#primary a#login').addClass('active');\r\n }\r\n \r\n }", "function addActiveSection() {\n sections.forEach(element => {\n element.classList.remove('your-active-class')\n if (isInView(element.getBoundingClientRect())) {\n element.classList.add('your-active-class');\n const val = element.getAttribute('data-nav')\n addActiveNav(val)\n }\n });\n}", "function makeActive() {\n for (let i = 0; i < sectionCollection.length; i++) {\n let getNavLi = document.getElementsByClassName(\"navLi\");\n let box = sectionCollection[i].getBoundingClientRect();\n\n if (box.top <= 100 && box.bottom >= 100) {\n getNavLi[i].classList.add(\"active\");\n sectionCollection[i].classList.add(\"your-active-class\");\n } else {\n getNavLi[i].classList.remove(\"active\");\n sectionCollection[i].classList.remove(\"your-active-class\");\n }\n }\n}", "function selectSection() {\n for (section of sections) {\n let rect = section.getBoundingClientRect();\n let navItem = document.querySelector('#navbar__list li a[data-id='+ section.getAttribute('id')+']')\n //calculate the position of each section using the getboundingclientrect function\n\n //then we need to compare that position with a value like 200 and -200\n // console.log(\"top:\" + rect.top, \"bottom:\" + rect.bottom, \"window:\" +window.scrollY)\n if(rect.top <= 200 && rect.top >= -200){\n //if true - add a class your-active-class to the active section\n section.classList.add(\"your-active-class\");\n navItem.classList.add(\"active\");\n }\n else {\n //if not then we need to remove the class your-active-class from the section\n section.classList.remove(\"your-active-class\");\n navItem.classList.remove('active');\n }\n }\n}", "function onScroll(){\n const scrollPos = $(document).scrollTop();\n $('.navbar-start a').each(function () {\n const currLink = $(this);\n const refElement = $(currLink.attr('href'));\n if (refElement.position().top <= scrollPos + 52 && refElement.position().top + refElement.height() > scrollPos) {\n $('.navbar-start ul li a').removeClass('active');\n currLink.addClass('active');\n } else{\n currLink.removeClass('active');\n }\n });\n }", "function myFunction() {\n if (window.pageYOffset >= sticky) {\n nav.classList.add(\"sticky\")\n } else {\n nav.classList.remove(\"sticky\");\n }\n}", "function onScroll(event){\n\tvar scrollPosition = $(document).scrollTop();\n\t$('.schedule-menu a').each(function () {\n\t\tvar currentLink = $(this);\n\t\tvar refElement = $(currentLink.attr(\"href\"));\n\t\tif (refElement.position().top <= scrollPosition && refElement.position().top + refElement.height() > scrollPosition) {\n\t\t\t$('schedule-menu a').removeClass(\"active\");\n\t\t\tcurrentLink.addClass(\"active\");\n\t\t}\n\t\telse{\n\t\t\tcurrentLink.removeClass(\"active\");\n\t\t}\n\t});\n}", "function SetAciveSectionOnViewport() {\r\n const sectionsList = getAllSections();\r\n let tops = [];\r\n let obj = {};\r\n for (let section of sectionsList) {\r\n section.classList.remove('active');\r\n document.querySelector(`#a${section.id.substring(0, 1).toUpperCase()}${section.id.substring(1, section.id.length)}`).classList.remove('menu__link__active');\r\n if (isInViewport(document.querySelector(`#${section.id}`))) {\r\n obj = { Id: section.id, top: document.querySelector(`#${section.id}`).offsetTop };\r\n tops.push(obj);\r\n }\r\n }\r\n if (tops.length == 0)\r\n return;\r\n let minTopObj = tops.reduce(function (prev, curr) {\r\n return prev.top < curr.top ? prev : curr;\r\n });\r\n document.querySelector(`#${minTopObj.Id}`).classList.add('active');\r\n document.querySelector(`#a${minTopObj.Id.substring(0, 1).toUpperCase()}${minTopObj.Id.substring(1, minTopObj.Id.length)}`).classList.add('menu__link__active');\r\n}", "function focusOnScroll() {\n sections.forEach(section => section.classList.remove('section-active'));\n if (isElementInViewport(heading)) {\n navList.childNodes[0].classList.add('nav-active');\n navList.childNodes.forEach((navLink, index) =>\n index && navLink.classList.remove('nav-active'));\n } else {\n const actIndex = sections.findIndex(section => isElementInViewport(section.childNodes[1].childNodes[1]));\n const actSection = sections[actIndex];\n const actLink = navList.childNodes[actIndex + 1];\n actSection && actSection.classList.add('section-active');\n actLink && actLink.classList.add('nav-active');\n navList.childNodes.forEach((navLink, index) =>\n index !== (actIndex + 1) && navLink.classList.remove('nav-active'));\n }\n}", "myFunction () {\n var navbar = document.getElementById(\"navbar\");\n if (window.pageYOffset >= 197) {\n navbar.classList.add(\"sticky\");\n } \n else {\n navbar.classList.remove(\"sticky\");\n }\n }", "function myFunction() {\n if (window.pageYOffset > sticky) {\n nav.classList.add(\"sticky\");\n } else {\n nav.classList.remove(\"sticky\");\n }\n}", "function sticky_navigation() {\n var scroll_top = document.body.scrollTop; // our current vertical position from the top\n // if we've scrolled more than the navigation, change its position to fixed to stick to top,\n if ($(window).scrollTop() > 250 && $(window).width() >= 960) {\n topBar.addClass('scroll-top-bar');\n navCell.addClass('scroll-nav-tile');\n } else {\n topBar.removeClass('scroll-top-bar');\n navCell.removeClass('scroll-nav-tile');\n }\n }", "function addActiveClass(selector, class_name) {\n const sections = document.querySelectorAll(selector);\n const menu_items = document.querySelectorAll('.menu__link')\n for (let i = 0; i < sections.length; i++) {\n const section = sections[i];\n const item = menu_items[i];\n document.addEventListener('scroll', function() {\n const sectionTitle = isInViewport(section);\n\n if(sectionTitle) {\n section.classList.add(class_name);\n item.classList.add(class_name)\n }\n else {\n section.classList.remove(class_name);\n item.classList.remove(class_name);\n }\n })\n }\n}", "function onScroll(event) {\r\n var scrollPosition = $(document).scrollTop();\r\n\r\n /* Cada vez que se referencia en el documento el selector (nav a) se active\r\n la funcion en el documento DOM y almacenamos en una variable la posicion */\r\n $('nav a').each(function () {\r\n var currentLink = $(this);\r\n\r\n\r\n /* almacenamos en una variable la referencia del elemento (href) */\r\n var refElement = $(currentLink.attr(\"href\"));\r\n\r\n /* Luego se realiza la validacion de la posicion del elemento */\r\n if (refElement.position().top <= scrollPosition && refElement.position().top + refElement.height() > scrollPosition) {\r\n $('nav a').removeClass(\"active\");\r\n currentLink.addClass(\"active\");\r\n }\r\n else {\r\n currentLink.removeClass(\"active\");\r\n }\r\n });\r\n }", "function stick() {\n if (window.pageYOffset > sticky) {\n //changements\n menu.style.height = 0 + \"px\";\n topbar.style.height = 70 + \"px\";\n header.style.height = 96 + \"px\";\n header.style.padding = 0;\n header.style.marginTop = 0 + \"px\";\n header.classList.remove(\"top-anchor\");\n header.classList.add(\"stick-header\");\n illu_index.style.marginTop = 148 + \"px\";\n } else {\n //enlever les changements\n menu.style.height = 202 + \"px\";\n header.style.height = 96 + \"px\";\n header.classList.add(\"top-anchor\");\n header.classList.remove(\"stick-header\");\n header.style.padding = 2 + \"rem\";\n header.style.marginTop = 0 + \"px\";\n topbar.style.height = 150 + \"px\";\n illu_index.style.marginTop = 0 + \"px\";\n }\n}", "function onScroll(event){\n var scrollPos = $(document).scrollTop();\n $('nav ul li a, nav ul ul li a').each(function () {\n var currLink = $(this);\n var refElement = $(currLink.attr(\"href\"));\n if (refElement.position().top <= scrollPos && refElement.position().top + refElement.height() > scrollPos) {\n $('nav ul li a, nav ul ul li a').removeClass(\"active\");\n currLink.addClass(\"active\");\n }\n else{\n currLink.removeClass(\"active\");\n }\n });\n }", "function isViewThere() {\n const navbarSectionLink = document.querySelectorAll('.menu__link');\n for (const section of sections) {\n const sectionView = section.getBoundingClientRect();\n if (sectionView.top <= 150 && sectionView.bottom >= 150) {\n // Set sections as active\n const id = section.getAttribute('id');\n document.querySelector(`#${id}`).classList.add('active');\n section.classList.add('your-active-class');\n //Highlight the nav\n navbarSectionLink.forEach((item) => {\n item.classList.remove('activate-nav');\n if (item.getAttribute('href') == `#${id}`) {\n item.classList.add('activate-nav');\n }\n });\n } else {\n const id = section.getAttribute('id');\n document.querySelector(`#${id}`).classList.remove('active');\n section.classList.remove('your-active-class');\n }\n }\n}", "function active(){\n \n sections.forEach(section =>{\n \tlet rectangle = section.getBoundingClientRect();\n if( rectangle.top >= 0 && rectangle.top <= 400 ){\n // Set sections as active\n document.querySelector('.your-active-class')?.classList.remove('your-active-class');\n section.classList.add(\"your-active-class\");\n\n const linklist = document.querySelectorAll('a');\n\n linklist.forEach( a => {\n if( a.textContent == section.getAttribute(\"data-nav\") ){\n \t document.querySelector('.activelink')?.classList.remove('activelink');\n a.classList.add('activelink');\n \t }\n });\n }\n });\n }", "function mySticky() {\n if (window.pageYOffset >= sticky) {\n navbar.classList.add(\"sticky\");\n } else {\n navbar.classList.remove(\"sticky\");\n }\n}", "function myFunction() {\n if (window.pageYOffset >= stickyPoint) {\n header.classList.add(\"sticky-menu\");\n } else {\n header.classList.remove(\"sticky-menu\");\n }\n}", "function addActive() {\n sections.forEach(section => {\n const bounding = section.getBoundingClientRect();\n const sectionLink = document.querySelector(`a[href=\"#${section.getAttribute('id')}\"]`);\n const sectionHalfShown = section.offsetTop - (section.offsetHeight / 2);\n const sectionBehind = section.offsetTop + (section.offsetHeight / 2);\n if (\n (bounding.top >= 0) &&\n (bounding.left >= 0) &&\n (Math.floor(bounding.right) <= window.innerWidth) &&\n (window.pageYOffset > sectionHalfShown) && (window.pageYOffset <= sectionBehind)) {\n section.classList.add('active');\n sectionLink.classList.add('current');\n } else if (window.pageYOffset >= sectionBehind || window.pageYOffset < section.offsetTop) {\n section.classList.remove('active');\n sectionLink.classList.remove('current');\n }\n })\n}", "function myFunction() {\nif (window.pageYOffset >= sticky) {\n navbar.classList.add(\"sticky\")\n} else {\n navbar.classList.remove(\"sticky\");\n}\n}", "function stickyNav() {\n\t\tpos = $(window).scrollTop();\n\t\tif (pos > 0) {\n\t\t\t$('nav').addClass('scroll').css({ position: 'absolute', top: pos }).fadeIn();\n\t\t} else {\n\t\t\t$('nav').removeClass('scroll').css({ position: 'absolute', top: 0 }).show();\n\t\t}\n\t}", "function setURLandNav(){\n let\n s = document.querySelectorAll('nav ul li a'),\n a = document.querySelectorAll('section');\n \n if(s.length>0){\n Array.prototype.forEach.call(s, function(elm, idx){ \n removeClass(elm,'active');\n });\n \n Array.prototype.forEach.call(a, function(el, i){\n if(el.querySelector('h2')){\n if (elementInViewport(el.querySelector('h2'))) {\t\n console.log(el.querySelector('h2').textContent);\n Array.prototype.forEach.call(s, function(elm, idx){ \n if(elm.href.indexOf('#'+el.id)>-1 && Math.max(document.body.scrollTop,document.documentElement.scrollTop)>50){\t\n history.pushState(null, null, \"#\"+el.id);\t\n addClass(elm,'active');\n } else {\n removeClass(elm,'active');\n }\n });\n } \n } else {\n if (elementInViewport(el)) {\t\n Array.prototype.forEach.call(s, function(elm, idx){ \n if(elm.href.indexOf('#'+el.id)>-1 && Math.max(document.body.scrollTop,document.documentElement.scrollTop)>50){\t\n history.pushState(null, null, \"#\"+el.id);\t\n addClass(elm,'active');\n } else {\n removeClass(elm,'active');\n }\n });\n } \n }\n });\n if(Math.max(document.body.scrollTop,document.documentElement.scrollTop)<50){\n addClass(s[0],'active');\n }\n }\t \t\n }", "function stickyNav() {\n\tif ( $( '#sticky-nav' ).length ) {\n \n\t\tvar stickyNav = $('#sticky-nav');\n\t\tvar windowScrollTop = $(window).scrollTop();\n \n\t\tif ( windowScrollTop >= stickyNav.data( 'scroll-amount' ) ) {\n\t\t\tstickyNav.addClass( 'sticky-nav-visible' );\n\t\t} else {\n\t\t\tstickyNav.removeClass('sticky-nav-visible');\n\t\t}\n \n if ( windowScrollTop >= stickyNav.data( 'scroll-amount' ) - 250 ) {\n header.removeClass( 'header-' + header.data( 'skin' ) ).addClass( 'header-' + header.data( 'scroll-skin' ) );\n $('#wrapper').removeClass( 'topnav-top' );\n } else {\n header.removeClass( 'header-' + header.data( 'scroll-skin' ) ).addClass( 'header-' + header.data( 'skin' ) ).addClass( 'topnav-top' );\n $('#wrapper').addClass( 'topnav-top' );\n }\n\t}\n}", "function stickyNav() {\n\n if (window.pageYOffset >= sticky) {\n navbar.classList.add(\"sticky\");\n navLogo.style.display = \"block\";\n } else {\n navbar.classList.remove(\"sticky\");\n navLogo.style.display = \"none\";\n }\n}", "function navStickFuntion() {\n\t// Get the navbar\n\tvar navbar = document.getElementById(\"myHeader\");\n\n\t// Get the offset position of the navbar\n\tvar sticky = navbar.offsetTop;\n\tif (window.pageYOffset >= 128) {\n\t\tnavbar.classList.add(\"sticky\")\n\t} else {\n\t\tnavbar.classList.remove(\"sticky\");\n\t}\n}", "function myFunction() {\n if (window.pageYOffset >= sticky) {\n navbar.classList.add(\"sticky\")\n } else {\n navbar.classList.remove(\"sticky\");\n }\n }", "function initWindowScrollEvent() {\n // Listen for scroll events\n window.onscroll = function() { stick() };\n\n var navbar = document.querySelector('.header-wrapper');\n var sticky = navbar.offsetTop + 70; // 70 is the height of the footer\n\n function stick() {\n if (window.pageYOffset >= sticky) {\n toTopBtn.style.opacity = 1;\n // navbar.classList.add(\"fixed-top\");\n } else {\n toTopBtn.style.opacity = 0;\n // navbar.classList.remove(\"fixed-top\");\n }\n }\n }", "function addSticky() {\n if (window.pageYOffset >= sticky) {\n navbar.classList.add(\"sticky\")\n } else {\n navbar.classList.remove(\"sticky\");\n }\n}", "function initNavigation() {\n const mainNavLinks = gsap.utils.toArray(\".main-nav a\");\n const mainNavLinksRev = gsap.utils.toArray(\".main-nav a\").reverse();\n\n mainNavLinks.forEach((link) => {\n link.addEventListener(\"mouseleave\", (e) => {\n // add class\n link.classList.add(\"animate-out\");\n setTimeout(() => {\n // remove class\n link.classList.remove(\"animate-out\");\n }, 300);\n });\n });\n\n function navAnimation(direction) {\n // console.log(direction);\n\n // if (direction == 1) {\n // return gsap.to(mainNavLinks, {\n // duration: 1,\n // stagger: 0.5,\n // autoAlpha: 0,\n // y: 20,\n // });\n // } else {\n // return gsap.to(mainNavLinks, {\n // duration: 1,\n // stagger: 0.5,\n // autoAlpha: 1,\n // y: -20,\n // });\n // }\n\n // Shorter syntax ( logic same )\n const scrollingDown = direction === 1;\n const links = scrollingDown ? mainNavLinks : mainNavLinksRev;\n return gsap.to(links, {\n duration: 0.3,\n stagger: 0.05,\n autoAlpha: () => (scrollingDown ? 0 : 1),\n y: () => (scrollingDown ? 20 : 0),\n ease: \"Power4.out\",\n // scrub: true,\n });\n }\n\n ScrollTrigger.create({\n start: 100,\n end: \"bottom bottom-=20\",\n toggleClass: {\n targets: \"body\",\n className: \"has-scrolled\",\n },\n onEnter: ({ direction }) => navAnimation(direction),\n onLeaveBack: ({ direction }) => navAnimation(direction),\n // markers: true,\n });\n}", "function stickyNav(){\n\tvar height = window.innerHeight - 50;\n\tif (window.pageYOffset > height){\n\t\tvar navbar = document.getElementsByTagName('nav')[0];\n\t\tnavbar.classList.add('fixed');\n\t}\n\tif (window.pageYOffset < height){\n\t\tvar navbar = document.getElementsByTagName('nav')[0];\n\t\tnavbar.classList.remove('fixed');\n\t}\n}", "function topScroll() {\r\n if (window.pageYOffset >= sticky) {\r\n navbar.classList.add(\"sticky\")\r\n } else {\r\n navbar.classList.remove(\"sticky\");\r\n }\r\n }", "function myFunction() {\n if (window.pageYOffset >= sticky) {\n navbar.classList.add(\"sticky\")\n } else {\n navbar.classList.remove(\"sticky\");\n }\n }", "function onScroll(event) {\n if ($('.mobileWrapp').width() < 639) {\n // console.log('asd')\n var scrollPos = $(document).scrollTop() + 65\n } else {\n // console.log('qwe')\n var scrollPos = $(document).scrollTop() + 68\n }\n $('ul.nav-script li a.ancor').each(function() {\n var currLink = $(this)\n var refElement = $(currLink.attr('href'))\n if (refElement.position().top <= scrollPos && refElement.position().top + refElement.height() > scrollPos) {\n $('ul.nav-script li a.ancor').removeClass('active')\n currLink.addClass('active')\n } else {\n currLink.removeClass('active')\n }\n })\n}" ]
[ "0.7465809", "0.7365849", "0.7274808", "0.72692376", "0.72230685", "0.7198198", "0.71392465", "0.713246", "0.71000737", "0.709192", "0.70879257", "0.7043844", "0.70255977", "0.7004943", "0.69803566", "0.6876572", "0.68671125", "0.6852047", "0.6847967", "0.68453306", "0.68388116", "0.6835852", "0.6819264", "0.6813016", "0.678361", "0.67801607", "0.6772547", "0.67696106", "0.6750614", "0.6749341", "0.6740161", "0.6735742", "0.6727264", "0.6723871", "0.6718744", "0.670881", "0.67045766", "0.66992694", "0.66979563", "0.6694861", "0.66869533", "0.66822916", "0.6673807", "0.6673807", "0.667111", "0.6658535", "0.66543055", "0.66480803", "0.6647372", "0.6646494", "0.66453093", "0.6639395", "0.66367686", "0.663495", "0.6633475", "0.6631911", "0.6630789", "0.6627665", "0.6623171", "0.66073006", "0.6606677", "0.6597053", "0.65899944", "0.65873903", "0.6583824", "0.65671235", "0.6562254", "0.65593326", "0.65592444", "0.65546316", "0.6552359", "0.65438294", "0.6541406", "0.65409577", "0.653821", "0.65268564", "0.65222424", "0.65192205", "0.65161324", "0.65150875", "0.6511495", "0.6505599", "0.6503148", "0.6502238", "0.64899087", "0.64885515", "0.64867616", "0.6471041", "0.6464119", "0.6462324", "0.6459197", "0.64487314", "0.64445853", "0.6435631", "0.6433451", "0.64258516", "0.6425183", "0.64171773", "0.64059967", "0.6399091" ]
0.71677256
6
Debouncing function. Rate limits the function calls
function debounce(func, wait, immediate) { var timeout; return function() { var context = this, args = arguments; var later = function() { timeout = null; if (!immediate) func.apply(context, args); }; var callNow = immediate && !timeout; clearTimeout(timeout); timeout = setTimeout(later, wait); if (callNow) func.apply(context, args); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function debouncer( func , timeout ) {\nvar timeoutID , timeout = timeout || 200;\nreturn function () {\nvar scope = this , args = arguments;\nclearTimeout( timeoutID );\ntimeoutID = setTimeout( function () {\n func.apply( scope , Array.prototype.slice.call( args ) );\n} , timeout );\n}\n}", "static Debounce(func, threshold) {\n\t\tvar timeout;\n\t\n\t\treturn function debounced () {\n\t\t\t\n\t\t\tfunction delayed () {\n\t\t\t\tfunc.apply(this, arguments);\n\t\t\t\t\n\t\t\t\ttimeout = null; \n\t\t\t}\n\t \n\t\t\tif (timeout) clearTimeout(timeout);\n\t \n\t\t\ttimeout = setTimeout(delayed.bind(this), threshold || 100); \n\t\t};\n\t}", "function debounced(delay, fn) { \n let timerID\n return function (...args) {\n if (timerID) {\n clearTimeout(timerID);\n }\n timerID = setTimeout (() => {\n fn(...args);\n timerID = null;\n }, delay);\n }\n}", "function debouncer( func , timeout ) {\n\tvar timeoutID , timeout = timeout || 200;\n\treturn function () {\n\t\tvar scope = this , args = arguments;\n\t\tclearTimeout( timeoutID );\n\t\ttimeoutID = setTimeout( function () {\n\t\t\tfunc.apply( scope , Array.prototype.slice.call( args ) );\n\t\t} , timeout );\n\t}\n}", "function debouncer( func , timeout ) {\n var timeoutID;\n var timeoutVAR;\n\n if (timeout) {\n timeoutVAR = timeout;\n } else {\n timeoutVAR = 200;\n }\n\n return function() {\n var scope = this , args = arguments;\n clearTimeout( timeoutID );\n timeoutID = setTimeout( function () {\n func.apply( scope , Array.prototype.slice.call( args ) );\n }, timeoutVAR );\n };\n\n}", "function debouncer( func , timeout ) {\n var timeoutID;\n var timeoutVAR;\n\n if (timeout) {\n timeoutVAR = timeout;\n } else {\n timeoutVAR = 200;\n }\n\n return function() {\n var scope = this , args = arguments;\n clearTimeout( timeoutID );\n timeoutID = setTimeout( function () {\n func.apply( scope , Array.prototype.slice.call( args ) );\n }, timeoutVAR );\n };\n\n}", "function debounce(fn, ms){\n let startTime = 0;\n return function(){\n if (!startTime){ //run in the first call\n fn.apply(null, arguments);\n startTime = Date.now();\n }\n else if (Date.now() - startTime >= ms){ //check if ms amount time passed from the last call\n fn.apply(null, arguments);\n startTime = Date.now();\n }\n else {\n return;\n }\n } \n}", "function debounce( fn, threshold ) {\r\n var timeout;\r\n return function debounced() {\r\n if ( timeout ) {\r\n clearTimeout( timeout );\r\n }\r\n function delayed() {\r\n fn();\r\n timeout = null;\r\n }\r\n timeout = setTimeout( delayed, threshold || 100 );\r\n }\r\n}", "static debouncer(func, tOut) {\n\t\tvar timeoutID, timeout = tOut || 200;\n\t\treturn function () {\n\t\t\tlet scope = window,\n\t\t\t\targs = arguments;\n\t\t\tclearTimeout(timeoutID);\n\t\t\ttimeoutID = setTimeout(() => {\n\t\t\t\tfunc\n\t\t\t\t\t.apply(scope, Array.prototype.slice.call(args));\n\t\t\t}, timeout);\n\t\t};\n\t}", "debounce(fn, quietMillis, bindedThis) {\n let isWaiting = false;\n return function func() {\n if (isWaiting) return;\n\n if (bindedThis === undefined) {\n bindedThis = this;\n }\n\n fn.apply(bindedThis, arguments);\n isWaiting = true;\n\n setTimeout(function () {\n isWaiting = false;\n }, quietMillis);\n };\n }", "function debounce( fn, threshold ) {\n var timeout;\n threshold = threshold || 100;\n return function debounced() {\n clearTimeout( timeout );\n var args = arguments;\n var _this = this;\n function delayed() {\n fn.apply( _this, args );\n }\n timeout = setTimeout( delayed, threshold );\n };\n }", "function debounce( fn, threshold ) {\n var timeout;\n threshold = threshold || 100;\n return function debounced() {\n clearTimeout( timeout );\n var args = arguments;\n var _this = this;\n function delayed() {\n fn.apply( _this, args );\n }\n timeout = setTimeout( delayed, threshold );\n };\n }", "function debounce(fn) {\n\t if (!App.vars.debounceTimer) fn.call(this);\n\t if (App.vars.debounceTimer) global.clearTimeout(App.vars.debounceTimer);\n\t App.vars.debounceTimer = global.setTimeout(function() {\n\t App.vars.debounceTimer = null;\n\t fn.call(this);\n\t }, App.setup.debounce);\n\t}", "function debounce(f, delay = 80) {\n let timer\n return function() {\n if (timer) {\n clearTimeout(timer)\n }\n timer = setTimeout(_ => f.apply(this, arguments), delay)\n }\n}", "function debounce(fn, threshold) {\r\n var timeout;\r\n return function debounced() {\r\n if (timeout) {\r\n clearTimeout(timeout);\r\n }\r\n function delayed() {\r\n fn();\r\n timeout = null;\r\n }\r\n timeout = setTimeout(delayed, threshold || 100);\r\n };\r\n}", "function debounce( fn, threshold ) {\n var timeout;\n return function debounced() {\n if ( timeout ) {\n clearTimeout( timeout );\n }\n function delayed() {\n fn();\n timeout = null;\n }\n setTimeout( delayed, threshold || 100 );\n };\n}", "function debounce(fun, delay, immediate) {\n // triggers on either leading edge or trailing edge\n var timeout;\n return function() {\n var context = this,\n args = arguments;\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(function() {\n // when immediate is true, we just reset the timeout to null so that\n // the debounced function can run again when delay ms has passed\n timeout = null;\n if(!immediate) fun.apply(context, args);\n }, delay);\n if(callNow) fun.apply(context, args);\n };\n }", "function debounce(fn, threshold) {\n var timeout;\n return function debounced() {\n if (timeout) {\n clearTimeout(timeout);\n }\n\n function delayed() {\n fn();\n timeout = null;\n }\n setTimeout(delayed, threshold || 100);\n }\n } // end used for packery: debounce", "function debounce( fn, threshold ) {\n var timeout;\n return function debounced() {\n if ( timeout ) {\n clearTimeout( timeout );\n }\n function delayed() {\n fn();\n timeout = null;\n }\n timeout = setTimeout( delayed, threshold || 100 );\n }\n}", "function debounce( fn, threshold ) {\n var timeout;\n return function debounced() {\n if ( timeout ) {\n clearTimeout( timeout );\n }\n function delayed() {\n fn();\n timeout = null;\n }\n timeout = setTimeout( delayed, threshold || 100 );\n }\n}", "function debounce(func, threshold, execAsap) {\n var timeout;\n\n return function debounced() {\n var obj = this, args = arguments;\n function delayed() {\n if (!execAsap) {\n func.apply(obj, args);\n }\n timeout = null;\n }\n\n if (timeout) {\n clearTimeout(timeout);\n } else if (execAsap) {\n func.apply(obj, args);\n }\n timeout = setTimeout(delayed, threshold || 100);\n };\n }", "function debounce(fn, threshold) {\n var timeout;\n return function debounced() {\n if (timeout) {\n clearTimeout(timeout);\n }\n function delayed() {\n fn();\n timeout = null;\n }\n timeout = setTimeout(delayed, threshold || 100);\n }\n}", "function debounce( fn, threshold ) {\n var timeout;\n return function debounced() {\n if ( timeout ) {\n clearTimeout( timeout );\n }\n function delayed() {\n fn();\n timeout = null;\n }\n setTimeout( delayed, threshold || 100 );\n };\n }", "function debounce(fn, threshold) {\n var timeout;\n threshold = threshold || 100;\n return function debounced() {\n clearTimeout(timeout);\n var args = arguments;\n var _this = this;\n function delayed() {\n fn.apply(_this, args);\n }\n timeout = setTimeout(delayed, threshold);\n };\n }", "function debounce(fn, threshold) {\n var timeout;\n return function debounced() {\n if (timeout) {\n clearTimeout(timeout);\n }\n\n function delayed() {\n fn();\n timeout = null;\n }\n timeout = setTimeout(delayed, threshold || 1000);\n }\n }", "function debounce(func, wait, context) {\n\t var timer;\n\n\t return function debounced() {\n\t var context = $scope,\n\t args = Array.prototype.slice.call(arguments);\n\t $timeout.cancel(timer);\n\t timer = $timeout(function() {\n\t timer = undefined;\n\t func.apply(context, args);\n\t }, wait || 10);\n\t };\n\t }", "function debounce(fn, threshold) {\n var timeout;\n threshold = threshold || 100;\n return function debounced() {\n clearTimeout(timeout);\n var args = arguments;\n var _this = this;\n function delayed() {\n fn.apply(_this, args);\n }\n timeout = setTimeout(delayed, threshold);\n };\n}", "function wrapper(){var self=this;var elapsed=Number(new Date())-lastExec;var args=arguments;// Execute `callback` and update the `lastExec` timestamp.\nfunction exec(){lastExec=Number(new Date());callback.apply(self,args);}// If `debounceMode` is true (at begin) this is used to clear the flag\n// to allow future `callback` executions.\nfunction clear(){timeoutID=undefined;}if(debounceMode&&!timeoutID){// Since `wrapper` is being called for the first time and\n// `debounceMode` is true (at begin), execute `callback`.\nexec();}// Clear any existing timeout.\nif(timeoutID){clearTimeout(timeoutID);}if(debounceMode===undefined&&elapsed>delay){// In throttle mode, if `delay` time has been exceeded, execute\n// `callback`.\nexec();}else if(noTrailing!==true){// In trailing throttle mode, since `delay` time has not been\n// exceeded, schedule `callback` to execute `delay` ms after most\n// recent execution.\n//\n// If `debounceMode` is true (at begin), schedule `clear` to execute\n// after `delay` ms.\n//\n// If `debounceMode` is false (at end), schedule `callback` to\n// execute after `delay` ms.\ntimeoutID=setTimeout(debounceMode?clear:exec,debounceMode===undefined?delay-elapsed:delay);}}// Return the wrapper function.", "function debounce(fn, threshold) {\n var timeout;\n return function debounced() {\n if (timeout) {\n clearTimeout(timeout);\n }\n\n function delayed() {\n fn();\n timeout = null;\n }\n timeout = setTimeout(delayed, threshold || 100);\n };\n }", "function debounce(func, threshold, execAsap)\n{\n\tvar timeout;\n\n\treturn function debounced() {\n\t\tvar obj = this, args = arguments;\n\t\tfunction delayed () {\n\t\t\tif (!execAsap)\n\t\t\t\tfunc.apply(obj, args);\n\t\t\ttimeout = null;\n\t\t};\n\n\t\tif (timeout)\n\t\t\tclearTimeout(timeout);\n\t\telse if (execAsap)\n\t\t\tfunc.apply(obj, args);\n\n\t\ttimeout = setTimeout(delayed, threshold || 300);\n\t};\n}", "function throttle(fn, ms){\n let isCoolDown = false;\n let prevArg, prevThis;\n return function bounced(){\n if (isCoolDown){\n prevArg = arguments;\n prevThis = this\n return;\n }\n fn.apply(this, arguments);\n isCoolDown = true;\n setTimeout(() => {\n isCoolDown = false;\n if (prevArg) {\n bounced.apply(prevThis, prevArg);\n prevArg = prevThis = null;\n }\n }, ms);\n }\n}", "function debounce(fn, threshold) {\n var timeout;\n return function debounced() {\n if (timeout) {\n clearTimeout(timeout);\n }\n\n function delayed() {\n fn();\n timeout = null;\n }\n timeout = setTimeout(delayed, threshold || 100);\n }\n }", "function debounce(func, wait, context) {\n\t\t\t\t\tvar timer;\n\t\t\t\t\treturn function debounced() {\n\t\t\t\t\t\tvar context = $scope,\n\t\t\t\t\t\t\targs = Array.prototype.slice.call(arguments);\n\t\t\t\t\t\t$timeout.cancel(timer);\n\t\t\t\t\t\ttimer = $timeout(function() {\n\t\t\t\t\t\t\ttimer = undefined;\n\t\t\t\t\t\t\tfunc.apply(context, args);\n\t\t\t\t\t\t}, wait || 10);\n\t\t\t\t\t};\n\t \t\t\t}", "function debounce(func) {\n var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 166;\n var timeout;\n\n function debounced() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n } // eslint-disable-next-line consistent-this\n\n\n var that = this;\n\n var later = function later() {\n func.apply(that, args);\n };\n\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n }\n\n debounced.clear = function () {\n clearTimeout(timeout);\n };\n\n return debounced;\n}", "function debounce(func) {\n var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 166;\n var timeout;\n\n function debounced() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n } // eslint-disable-next-line consistent-this\n\n\n var that = this;\n\n var later = function later() {\n func.apply(that, args);\n };\n\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n }\n\n debounced.clear = function () {\n clearTimeout(timeout);\n };\n\n return debounced;\n}", "function debounce(func, wait, context) {\n var timer;\n return function debounced() {\n var context = $scope,\n args = Array.prototype.slice.call(arguments);\n $timeout.cancel(timer);\n timer = $timeout(function() {\n timer = undefined;\n func.apply(context, args);\n }, wait || 10);\n };\n }", "function debounce(fn, delay) {\n var timer = null;\n return function () {\n var context = this, args = arguments;\n clearTimeout(timer);\n timer = setTimeout(function () {\n fn.apply(context, args);\n }, delay);\n };\n}", "function debounce(func) {\n var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 166;\n var timeout;\n\n function debounced() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n // eslint-disable-next-line consistent-this\n var that = this;\n\n var later = function later() {\n func.apply(that, args);\n };\n\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n }\n\n debounced.clear = function () {\n clearTimeout(timeout);\n };\n\n return debounced;\n }", "function debounce(f, t) {\n return f;\n}", "function debounce() {\n var fn = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : noop;\n var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300;\n\n var timer = null;\n\n return function () {\n var context = this;\n var args = arguments;\n\n if (timer) {\n clearTimeout(timer);\n }\n\n timer = setTimeout(function () {\n fn.apply(context, args);\n }, delay);\n };\n }", "function debounce(func, delay = 500) {\n let timer\n return () => {\n clearTimeout(timer)\n timer = setTimeout(() => {\n func()\n }, delay)\n }\n }", "function debounce(func, wait, context) {\n var timer;\n return function debounced() {\n var context = $scope,\n args = Array.prototype.slice.call(arguments);\n $timeout.cancel(timer);\n timer = $timeout(function() {\n timer = undefined;\n func.apply(context, args);\n }, wait || 10);\n };\n }", "function debounce(fn, delay) {\n var timer = null;\n\n return function () {\n var context = this,\n args = arguments;\n\n window.clearTimeout(timer);\n\n timer = window.setTimeout(function () {\n fn.apply(context, args);\n }, delay);\n };\n }", "function debounce(func) {\n var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 166;\n var timeout;\n\n function debounced() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n // eslint-disable-next-line consistent-this\n var that = this;\n\n var later = function later() {\n func.apply(that, args);\n };\n\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n }\n\n debounced.clear = function () {\n clearTimeout(timeout);\n };\n\n return debounced;\n}", "function debounce(func) {\n var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 166;\n var timeout;\n\n function debounced() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n // eslint-disable-next-line consistent-this\n var that = this;\n\n var later = function later() {\n func.apply(that, args);\n };\n\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n }\n\n debounced.clear = function () {\n clearTimeout(timeout);\n };\n\n return debounced;\n}", "function debounce(func) {\n var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 166;\n var timeout;\n\n function debounced() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n // eslint-disable-next-line consistent-this\n var that = this;\n\n var later = function later() {\n func.apply(that, args);\n };\n\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n }\n\n debounced.clear = function () {\n clearTimeout(timeout);\n };\n\n return debounced;\n}", "function debounce(func) {\n var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 166;\n var timeout;\n\n function debounced() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n // eslint-disable-next-line consistent-this\n var that = this;\n\n var later = function later() {\n func.apply(that, args);\n };\n\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n }\n\n debounced.clear = function () {\n clearTimeout(timeout);\n };\n\n return debounced;\n}", "function debounce(func) {\n var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 166;\n var timeout;\n\n function debounced() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n // eslint-disable-next-line consistent-this\n var that = this;\n\n var later = function later() {\n func.apply(that, args);\n };\n\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n }\n\n debounced.clear = function () {\n clearTimeout(timeout);\n };\n\n return debounced;\n}", "function debounce(func) {\n var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 166;\n var timeout;\n\n function debounced() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n // eslint-disable-next-line consistent-this\n var that = this;\n\n var later = function later() {\n func.apply(that, args);\n };\n\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n }\n\n debounced.clear = function () {\n clearTimeout(timeout);\n };\n\n return debounced;\n}", "function debounce(func) {\n var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 166;\n var timeout;\n\n function debounced() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n // eslint-disable-next-line consistent-this\n var that = this;\n\n var later = function later() {\n func.apply(that, args);\n };\n\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n }\n\n debounced.clear = function () {\n clearTimeout(timeout);\n };\n\n return debounced;\n}", "function debounce(func) {\n var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 166;\n var timeout;\n\n function debounced() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n // eslint-disable-next-line consistent-this\n var that = this;\n\n var later = function later() {\n func.apply(that, args);\n };\n\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n }\n\n debounced.clear = function () {\n clearTimeout(timeout);\n };\n\n return debounced;\n}", "function debounce(func) {\n var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 166;\n var timeout;\n\n function debounced() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n // eslint-disable-next-line consistent-this\n var that = this;\n\n var later = function later() {\n func.apply(that, args);\n };\n\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n }\n\n debounced.clear = function () {\n clearTimeout(timeout);\n };\n\n return debounced;\n}", "function debounce(func) {\n var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 166;\n var timeout;\n\n function debounced() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n // eslint-disable-next-line consistent-this\n var that = this;\n\n var later = function later() {\n func.apply(that, args);\n };\n\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n }\n\n debounced.clear = function () {\n clearTimeout(timeout);\n };\n\n return debounced;\n}", "function debounce(func) {\n var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 166;\n var timeout;\n\n function debounced() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n // eslint-disable-next-line consistent-this\n var that = this;\n\n var later = function later() {\n func.apply(that, args);\n };\n\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n }\n\n debounced.clear = function () {\n clearTimeout(timeout);\n };\n\n return debounced;\n}", "function debounce(func) {\n var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 166;\n var timeout;\n\n function debounced() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n // eslint-disable-next-line consistent-this\n var that = this;\n\n var later = function later() {\n func.apply(that, args);\n };\n\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n }\n\n debounced.clear = function () {\n clearTimeout(timeout);\n };\n\n return debounced;\n}", "function debounce(func) {\n var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 166;\n var timeout;\n\n function debounced() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n // eslint-disable-next-line consistent-this\n var that = this;\n\n var later = function later() {\n func.apply(that, args);\n };\n\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n }\n\n debounced.clear = function () {\n clearTimeout(timeout);\n };\n\n return debounced;\n}", "function debounce (fn, delay) {\n var timer = null\n\n return function () {\n var context = this\n var args = arguments\n clearTimeout(timer)\n timer = setTimeout(function () {\n fn.apply(context, args)\n }, delay)\n }\n}", "function debounce(callback, delay){\n var timer;\n return function(){\n var args = arguments;\n var context = this;\n clearTimeout(timer);\n timer = setTimeout(function(){\n callback.apply(context, args);\n }, delay);\n }\n }", "function debounce(func) {\n var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 166;\n var timeout;\n\n function debounced() {\n var _this = this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var later = function later() {\n func.apply(_this, args);\n };\n\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n }\n\n debounced.clear = function () {\n clearTimeout(timeout);\n };\n\n return debounced;\n}", "function pnDebounce(func, wait, immediate) {\r\n var timeout;\r\n return function() {\r\n var context = this,\r\n args = arguments;\r\n var later = function() {\r\n timeout = null;\r\n if ( !immediate ) {\r\n func.apply(context, args);\r\n }\r\n };\r\n var callNow = immediate && !timeout;\r\n clearTimeout(timeout);\r\n timeout = setTimeout(later, wait || 200);\r\n if ( callNow ) {\r\n func.apply(context, args);\r\n }\r\n };\r\n }", "throttle(fn, delay) {\n let timer;\n return function () {\n if (!timer) {\n timer = setTimeout(() => {\n timer = null;\n fn.apply(this, arguments);\n }, delay);\n }\n };\n }", "function debounce(fn, node, delay) {\n return function () {\n clearTimeout(timer);\n timer = setTimeout(function () { fn(node); }, delay);\n };\n} // end debounce", "function makeDebouncer(delay) {\n var timeout\n return function(domain) {\n clearTimeout(timeout)\n timeout = setTimeout(function() {\n getInstitutions(domain)\n }, delay)\n }\n }", "function makeDebouncer(delay) {\n var timeout\n return function(domain) {\n clearTimeout(timeout)\n timeout = setTimeout(function() {\n getInstitutions(domain)\n }, delay)\n }\n }", "function debounce(func, wait, context) {\n\t\t\t\tvar timer;\n\t\t\t\treturn function debounced() {\n\t\t\t\t\tvar context = scope,\n\t\t\t\t\t\targs = Array.prototype.slice.call(arguments);\n\t\t\t\t\t\t$timeout.cancel(timer);\n\t\t\t\t\t\ttimer = $timeout(function() {\n\t\t\t\t\t\t timer = undefined;\n\t\t\t\t\t\t func.apply(context, args);\n\t\t\t\t\t\t}, wait || 10);\n\t\t\t \t};\n\t\t\t}", "function debounce(func, wait, context) {\n var timer;\n return function debounced() {\n var context = $scope,\n args = Array.prototype.slice.call(arguments);\n $timeout.cancel(timer);\n timer = $timeout(function() {\n timer = undefined;\n func.apply(context, args);\n }, wait || 10);\n };\n }", "function debounce(func, wait, context) {\n var timer;\n return function debounced() {\n var context = $scope,\n args = Array.prototype.slice.call(arguments);\n $timeout.cancel(timer);\n timer = $timeout(function() {\n timer = undefined;\n func.apply(context, args);\n }, wait || 10);\n };\n }", "get debounce() { return this._debounce; }", "get debounce() { return this._debounce; }", "get debounce() { return this._debounce; }", "function debounce$1(func) {\n var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 166;\n var timeout;\n\n function debounced() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n // eslint-disable-next-line consistent-this\n var that = this;\n\n var later = function later() {\n func.apply(that, args);\n };\n\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n }\n\n debounced.clear = function () {\n clearTimeout(timeout);\n };\n\n return debounced;\n}", "function debounce(func, wait, context) {\n var timer;\n\n return function debounced() {\n var context = $scope,\n args = Array.prototype.slice.call(arguments);\n \n $timeout.cancel(timer);\n timer = $timeout(function () {\n timer = undefined;\n func.apply(context, args);\n }, wait || 10);\n };\n }", "function debounce(func, wait, context) {\n var timer;\n return function debounced() {\n var context = $scope,\n args = Array.prototype.slice.call(arguments);\n $timeout.cancel(timer);\n timer = $timeout(function () {\n timer = undefined;\n func.apply(context, args);\n }, wait || 10);\n };\n }", "function debounce(func, wait, context) {\n var timer;\n return function debounced() {\n var context = $scope,\n args = Array.prototype.slice.call(arguments);\n $timeout.cancel(timer);\n timer = $timeout(function() {\n timer = undefined;\n func.apply(context, args);\n }, wait || 10);\n };\n }", "function debounce(func, wait, context) {\n var timer;\n return function debounced() {\n var context = $scope,\n args = Array.prototype.slice.call(arguments);\n $timeout.cancel(timer);\n timer = $timeout(function() {\n timer = undefined;\n func.apply(context, args);\n }, wait || 10);\n };\n }", "function debounce(func, wait, context) {\n var timer;\n return function debounced() {\n var context = vm,\n args = Array.prototype.slice.call(arguments);\n $timeout.cancel(timer);\n timer = $timeout(function() {\n timer = undefined;\n func.apply(context, args);\n }, wait || 10);\n };\n }", "function debounce(func, wait, context) {\n var timer;\n return function debounced() {\n var context,\n args = Array.prototype.slice.call(arguments);\n $timeout.cancel(timer);\n timer = $timeout(function() {\n timer = undefined;\n func.apply(context, args);\n }, wait || 10);\n };\n }", "function debounce(func, wait, context) {\n var timer;\n\n return function debounced() {\n var context = $scope,\n args = Array.prototype.slice.call(arguments);\n $timeout.cancel(timer);\n timer = $timeout(function () {\n timer = undefined;\n func.apply(context, args);\n }, wait || 10);\n };\n }", "function debounce(func, wait, context) {\n var timer;\n return function debounced() {\n var context = $scope,\n args = Array.prototype.slice.call(arguments);\n $timeout.cancel(timer);\n timer = $timeout(function() {\n timer = undefined;\n func.apply(context, args);\n }, wait || 10);\n };\n }", "function debounce(func, wait, context) {\n var timer;\n return function debounced() {\n var context = $scope,\n args = Array.prototype.slice.call(arguments);\n $timeout.cancel(timer);\n timer = $timeout(function() {\n timer = undefined;\n func.apply(context, args);\n }, wait || 10);\n };\n }", "function debounce(func, wait, context) {\n var timer;\n return function debounced() {\n var context = $scope,\n args = Array.prototype.slice.call(arguments);\n $timeout.cancel(timer);\n timer = $timeout(function() {\n timer = undefined;\n func.apply(context, args);\n }, wait || 10);\n };\n }", "function throttle(callback, delay) {\n let previousCall = new Date().getTime();\n return function () {\n let time = new Date().getTime();\n\n if (time - previousCall >= delay) {\n previousCall = time;\n callback.apply(null, arguments);\n }\n };\n }", "function throttle (callback, delay) {\n var previousCall = new Date().getTime();\n return function () {\n var time = new Date().getTime();\n\n if (time - previousCall >= delay) {\n previousCall = time;\n callback.apply(null, arguments);\n }\n };\n }", "function debounce(func, wait, context) {\n var timer;\n\n return function debounced() {\n var context = $scope,\n args = Array.prototype.slice.call(arguments);\n $timeout.cancel(timer);\n timer = $timeout(function() {\n timer = undefined;\n func.apply(context, args);\n }, wait || 10);\n };\n }", "function debounce(func, wait, context) {\n var timer;\n return function debounced() {\n var context = $scope\n , args = Array.prototype.slice.call(arguments);\n $timeout.cancel(timer);\n timer = $timeout(function () {\n timer = undefined;\n func.apply(context, args);\n }, wait || 10);\n };\n }", "function fastDebounce(delay) {\n return observable => _rxjsCompatUmdMin.Observable.create(observer => {\n const debouncedNext = (0, _debounce.default)(x => observer.next(x), delay);\n const subscription = observable.subscribe(debouncedNext, observer.error.bind(observer), observer.complete.bind(observer));\n return new _UniversalDisposable.default(subscription, debouncedNext);\n });\n}", "function debounce (func, wait, context) {\n var timer;\n\n return function debounced () {\n var context = $scope,\n args = Array.prototype.slice.call(arguments);\n $timeout.cancel(timer);\n timer = $timeout(function () {\n timer = undefined;\n func.apply(context, args);\n }, wait || 10);\n };\n }", "function debounce(func, wait, context) {\n var timer;\n return function debounced() {\n var context = vm,\n args = Array.prototype.slice.call(arguments);\n $timeout.cancel(timer);\n timer = $timeout(function () {\n timer = undefined;\n func.apply(context, args);\n }, wait || 10);\n };\n }", "function debounce(func, wait, context) {\n var timer;\n\n return function debounced() {\n var context = $scope,\n args = Array.prototype.slice.call(arguments);\n $timeout.cancel(timer);\n timer = $timeout(function() {\n timer = undefined;\n func.apply(context, args);\n }, wait || 10);\n };\n }", "function debounce(func, wait, context) {\n var timer;\n\n return function debounced() {\n var context = $scope,\n args = Array.prototype.slice.call(arguments);\n $timeout.cancel(timer);\n timer = $timeout(function() {\n timer = undefined;\n func.apply(context, args);\n }, wait || 10);\n };\n }", "function debounce(func, wait, context) {\n var timer;\n\n return function debounced() {\n var context = $scope,\n args = Array.prototype.slice.call(arguments);\n $timeout.cancel(timer);\n timer = $timeout(function() {\n timer = undefined;\n func.apply(context, args);\n }, wait || 10);\n };\n }", "function debounce(func, wait, context) {\n var timer;\n\n return function debounced() {\n var context = $scope,\n args = Array.prototype.slice.call(arguments);\n $timeout.cancel(timer);\n timer = $timeout(function() {\n timer = undefined;\n func.apply(context, args);\n }, wait || 10);\n };\n }", "function debounce(func, wait, context) {\n var timer;\n\n return function debounced() {\n var context = $scope,\n args = Array.prototype.slice.call(arguments);\n $timeout.cancel(timer);\n timer = $timeout(function() {\n timer = undefined;\n func.apply(context, args);\n }, wait || 10);\n };\n }", "function throttle(callback, delay) {\n var previousCall = new Date().getTime();\n return function() {\n var time = new Date().getTime();\n\n if ((time - previousCall) >= delay) {\n previousCall = time;\n callback.apply(null, arguments);\n }\n };\n }", "function throttle(callback, delay) {\n var previousCall = new Date().getTime();\n return function() {\n var time = new Date().getTime();\n\n if ((time - previousCall) >= delay) {\n previousCall = time;\n callback.apply(null, arguments);\n }\n };\n }", "function throttle(callback, delay) {\n var previousCall = new Date().getTime();\n return function() {\n var time = new Date().getTime();\n\n if ((time - previousCall) >= delay) {\n previousCall = time;\n callback.apply(null, arguments);\n }\n };\n }", "function throttle(callback, delay) {\n var previousCall = new Date().getTime();\n return function() {\n var time = new Date().getTime();\n\n if ((time - previousCall) >= delay) {\n previousCall = time;\n callback.apply(null, arguments);\n }\n };\n }", "function throttle(callback, delay) {\n var previousCall = new Date().getTime();\n return function() {\n var time = new Date().getTime();\n\n if ((time - previousCall) >= delay) {\n previousCall = time;\n callback.apply(null, arguments);\n }\n };\n }", "function throttle(callback, delay) {\n var previousCall = new Date().getTime();\n return function() {\n var time = new Date().getTime();\n\n if ((time - previousCall) >= delay) {\n previousCall = time;\n callback.apply(null, arguments);\n }\n };\n }", "function throttle(callback, delay) {\n var previousCall = new Date().getTime();\n return function() {\n var time = new Date().getTime();\n\n if ((time - previousCall) >= delay) {\n previousCall = time;\n callback.apply(null, arguments);\n }\n };\n }", "function debounce(f, ms) {\n\n var timer = null;\n\n return function(...args) {\n var onComplete = function() {\n f.apply(this, args);\n timer = null;\n }\n\n if (timer) {\n clearTimeout(timer);\n }\n\n timer = setTimeout(onComplete, ms);\n };\n}" ]
[ "0.7666417", "0.7353457", "0.71261024", "0.7053938", "0.70075107", "0.70075107", "0.692892", "0.67667377", "0.6740276", "0.67399776", "0.670116", "0.670116", "0.6700426", "0.6692834", "0.6687424", "0.6655648", "0.66498077", "0.66437876", "0.6636098", "0.6636098", "0.6624735", "0.66247153", "0.66235924", "0.6583152", "0.65778124", "0.6569836", "0.65694", "0.6565869", "0.6555092", "0.6550768", "0.6549438", "0.65468735", "0.6545216", "0.6535531", "0.6535531", "0.6530341", "0.6528004", "0.6513176", "0.6511259", "0.65009034", "0.6488244", "0.6480682", "0.6478412", "0.64706194", "0.64706194", "0.64706194", "0.64706194", "0.64706194", "0.64706194", "0.64706194", "0.64706194", "0.64706194", "0.64706194", "0.64706194", "0.64706194", "0.64706194", "0.6462157", "0.6460397", "0.6446651", "0.64460194", "0.64406264", "0.64348936", "0.64347583", "0.64347583", "0.64275575", "0.6427452", "0.64234644", "0.64174724", "0.64174724", "0.64174724", "0.6415642", "0.6378005", "0.6373807", "0.6370647", "0.6370647", "0.6369717", "0.63687193", "0.63661665", "0.6362425", "0.6362425", "0.6362425", "0.635878", "0.6344556", "0.6333972", "0.6330972", "0.6319945", "0.6307288", "0.63054097", "0.63041943", "0.63041943", "0.63041943", "0.63041943", "0.63041943", "0.62979907", "0.62979907", "0.62979907", "0.62979907", "0.62979907", "0.62979907", "0.62979907", "0.6297874" ]
0.0
-1
'GET' request an url, and call callback with JSON data
function request(url, callback) { var xmlhttp = new XMLHttpRequest(); xmlhttp.open('GET', url, true); xmlhttp.send(); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var data = JSON.parse(xmlhttp.responseText); callback(data); } }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get(url, callback) {}", "function jsonGet(url, callback) {\r\n var xhr = new XMLHttpRequest();\r\n\r\n xhr.open('GET', url, true);\r\n xhr.setRequestHeader('Content-Type', 'application/json');\r\n\r\n xhr.onreadystatechange = callback;\r\n\r\n xhr.send();\r\n}", "function getData(url, callback) {\r\n var xhttp = new XMLHttpRequest();\r\n xhttp.onreadystatechange = function() {\r\n if (this.readyState == 4 && this.status == 200) {\r\n if (callback) {\r\n callback(JSON.parse(xhttp.response));\r\n }\r\n }\r\n };\r\n xhttp.open(\"GET\", url, true);\r\n xhttp.send();\r\n}", "function request(){\n\n var xhr = GethttpRequest();\n xhr.open('GET', url, true);\n xhr.responseType = 'json';\n xhr.onload = function() {\n var status = xhr.status;\n if (status == 200) {\n callback(status, xhr.response);\n } else {\n callback(status);\n }\n };\n xhr.send();\n }", "function ajaxCall(url, callback) {\n var ajax=new XMLHttpRequest();\n ajax.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n callback(JSON.parse(this.responseText));\n }\n };\n ajax.open(\"GET\", url, true);\n ajax.send();\n}", "function ajax_get(url, callback) {\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.onreadystatechange = function() {\n if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\n //console.log('responseText:' + xmlhttp.responseText);\n try {\n var data = JSON.parse(xmlhttp.responseText);\n } catch (err) {\n //console.log(err.message + \" in \" + xmlhttp.responseText);\n return;\n }\n callback(data);\n }\n };\n\n xmlhttp.open(\"GET\", url, true);\n xmlhttp.send();\n}", "function getJSON(myUrl, view) { // function that allows us to request json from a url; executes when we query our api\n var request = new XMLHttpRequest();\n request.open('GET', myUrl, true);\n\n request.onload = function() {\n if (request.status >= 200 && request.status < 400) {\n var data = JSON.parse(request.responseText);\n handleData(data, view); //once the data is parsed handle the data\n } else {\n console.log('The target server returned an error');\n }\n };\n\n request.onerror = function() {\n console.log('There was a connection error');\n };\n request.send()\n }", "function get(url, data, callback) {\n var requestUrl = url + '?' + data;\n request.get(requestUrl, function(error, response, body) {\n callback(response.statusCode, body);\n });\t\n}", "function SendToFiWareGet(url, callback)\n{\n\tvar req = new XMLHttpRequest();\n\treq.onreadystatechange = function(e)\n\t{\n\t\tif (this.readyState == 4 && this.status == 200)\n\t\t{\n\t\t\ttry \n\t\t\t{\n\t\t\t\tvar json = JSON.parse(this.responseText);\n\t\t\t}\n\t\t\tcatch (e)\n\t\t\t{\n\t\t\t\talert(this.responseText);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcallback(json);\n\t\t}\n\t}\n\treq.open(\"GET\", url);\n\treq.send();\n}", "function getData(url, callback) {\n http.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n callback(this);\n }\n };\n http.open(\"GET\", url, true);\n http.send();\n}", "function getJSON(url, callback) { //replacement for $.getJSON\n\thttps.get(url, (response) => {\n\t\tvar body = '';\n\t\tresponse.on('data', function(d) {\n\t\t\tbody += d;\n\t\t});\n\t\tresponse.on('end', function() {\n\t\t\tcallback(null, JSON.parse(body));\n\t\t});\n\t}).on('error', function(e) { //e is a common convention for error, which is why the functino is named e\n\t\tcallback(e);\n\t});\n}", "function requestJSON(url,callback) {\n var xmlhttp = new XMLHttpRequest();\n\n xmlhttp.onreadystatechange = function () {\n if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\n var res = JSON.parse(xmlhttp.responseText);\n try {\n callback(res);\n }\n catch (err) {\n console.log(err.message);\n }\n }\n }\n\n xmlhttp.open(\"GET\", url, true);\n xmlhttp.send();\n}", "function httpGet(url, callback, params){\n \n console.log(\"Http GET to url: \"+url)\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() { \n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n callback(xmlHttp.responseText, params);\n }\n xmlHttp.open(\"GET\", url, true);\n xmlHttp.send(null);\n}", "function getData(url, callback){\r\n\r\n $.get(url, function(data)\r\n {\r\n \tcallback(data);\r\n }); \r\n}", "function get(url, callback)\n {\n getfunction(url, callback);\n }", "function ajax_get_request(callback, url) {\r\n var xhr = new XMLHttpRequest();\r\n xhr.onreadystatechange = function(){\r\n if (callback && xhr.readyState == XMLHttpRequest.DONE\r\n && (xhr.status == 200 || xhr.status == 0))\r\n {\r\n callback(xhr.responseText);\r\n }\r\n };\r\n xhr.open(\"GET\", url, true);\r\n xhr.send();\r\n}", "function doRequest(url, data, callback) {\n callback({ url, data });\n }", "function callJson(callback) {\n var directory = window.location.href + '/getJSON';\n var xobj = new XMLHttpRequest();\n xobj.open('GET', directory, true); // Replace 'my_data' with the path to your file\n xobj.onreadystatechange = function() {\n if (xobj.readyState == 4 && xobj.status == \"200\") {\n // Required use of an anonymous callback as .open will NOT return a value but simply returns undefined in asynchronous mode\n callback(xobj.responseText);\n }\n };\n xobj.send(null);\n}", "function getJSON(url, callback){\n // create XMLHttp request\n const xhr = new XMLHttpRequest();\n // open a request\n xhr.open('GET', url);\n // create a callback function for the callback parameter\n xhr.onload = () => {\n // conditional that checks if xhr request was success\n if(xhr.status === 200){\n let data = JSON.parse(xhr.responseText);\n return callback(data);\n }\n };\n // send the request\n xhr.send();\n}", "function getJsonData(url, callback){\n request.get({\n headers: {'User-Agent': h.browser()},\n url: url\n }, function (error, response, body) {\n\n if (error) throw new Error(url + ' did not respond');\n\n parseString(body, function (err, result, title) {\n callback(result);\n });\n });\n}", "function get(url, callback) {\n try {\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function() {\n if (xhr.readyState === 4) {\n callback(xhr.responseText);\n }\n };\n\n xhr.open(\"GET\", url, true);\n xhr.send();\n } catch (e) {\n console.log(e);\n }\n}", "static _GET(url, cb) {\n jQuery.ajax({\n url: url,\n type: \"GET\",\n })\n .done(function(data, textStatus, jqXHR) {\n Layer.logs.save(\"AJAX get done : \" + jqXHR.statusText + \" \" + jqXHR.status);\n if (jqXHR.responseJSON) {\n cb.setProps(jqXHR.responseJSON);\n } else {\n cb.setHtml(data);\n }\n })\n .fail(function(jqXHR, textStatus, errorThrown) {\n Layer.logs.save(\"AJAX get error : \" + errorThrown);\n })\n .always(function() {\n /* ... */\n Layer.logs.save(\"Executed AJAX get with url : \" + url);\n });\n }", "function GET(url) {\n\tvar xhr = new XMLHttpRequest();\n\txhr.open('GET', url);\n\txhr.send();\n\txhr.onload = function() {\n\t var json = xhr.responseText; // Response\n\t json = json.replace(/^[^(]*\\(([\\S\\s]+)\\);?$/, '$1'); // Turn JSONP in JSON\n\t json = JSON.parse(json); // Parse JSON\n\t\tdisplay(json);\n\t};\n}", "function getJSON(requestURL, callback) {\n request({\n url: requestURL,\n json: true\n }, function(error, response, data) {\n // Calls callback passed by one of the API functions\n callback(error, data);\n });\n}", "function getJson(url, callback) {\n\n\t\tif (!window.XMLHttpRequest) {\n\t\t\t// Not worth it\n\t\t\tcallback({'error': 'Use a modern browser, jeez'});\n\t\t}\n\n\t\tvar xmlhttp = new XMLHttpRequest();\n\n\t\txmlhttp.onreadystatechange = function () {\n\t\t\tif (xmlhttp.readyState == XMLHttpRequest.DONE ) {\n\t\t\t\tif (xmlhttp.status == 200) {\n\t\t\t\t\tcallback (JSON.parse(xmlhttp.responseText));\n\t\t\t\t}\n\t\t\t\telse if (xmlhttp.status == 400) {\n\t\t\t\t\tcallback({'error': 'There was an error 400'});\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tcallback({'error': 'There was an error'});\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\txmlhttp.open('GET', url, true);\n\t\txmlhttp.setRequestHeader('Content-Type', 'application/json');\n\t\txmlhttp.send();\n\t}", "function getJSON(url, callback)\n{\n this.bindFunction = function(caller, object) {\n return function() {\n return caller.apply(object, [object]);\n };\n };\n\n this.stateChange = function (object) {\n if (this.request.readyState == 4) {\n var json = null;\n try {\n json = JSON.parse(this.request.responseText);\n } catch (e) {\n json = null;\n }\n this.callback(json);\n }\n };\n\n this.getRequest = function() {\n if (window.ActiveXObject)\n return new ActiveXObject('Microsoft.XMLHTTP');\n else if (window.XMLHttpRequest)\n return new XMLHttpRequest();\n return false;\n };\n\n var data = arguments[2];\n var postbody = [];\n if (data) {\n for (var name in data) {\n var value = encodeURIComponent(data[name]);\n postbody.push(name + \"=\" + value);\n }\n }\n\n this.postBody = postbody.join(\"&\");\n this.callback = callback;\n this.url = url;\n this.request = this.getRequest();\n\n if(this.request) {\n var req = this.request;\n req.onreadystatechange = this.bindFunction(this.stateChange, this);\n req.open(\"POST\", url, true);\n req.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\n req.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n req.send(this.postBody);\n }\n}", "function ajaxGet(url, callback) {\n var req = new XMLHttpRequest();\n req.open(\"GET\", url);\n req.addEventListener(\"load\", function () {\n if (req.status >= 200 && req.status < 400) {\n //Call the callback function with the request response in parameter\n callback(req.responseText);\n } else {\n console.error(req.status + \" \" + req.statusText + \" \" + url);\n }\n });\n req.addEventListener(\"error\", function () {\n console.error(\"Error with this URL : \" + url);\n });\n req.send(null);\n}", "get(url,cb){\n fetch(url)\n .then(response=>{\n response.json().then(data=>{\n cb(data)\n })\n })\n }", "function ajax_get_callback(url, callback) {\n var xhr = createCORSRequest(\"GET\", url);\n xhr.onload = function() {\n callback(xhr.responseText);\n }\n xhr.send();\n}", "function loadData(url, callback){\n\t$.getJSON(url, callback);\n\tconsole.log(url);\n}", "function getJSON(url, _callback) {\n var request = new XMLHttpRequest();\n\n request.open('GET', url, true);\n request.setRequestHeader('Accept', 'application/json');\n request.send();\n\n request.onreadystatechange = function() {\n if (request.readyState === XMLHttpRequest.DONE) {\n _callback(JSON.parse(request.response));\n }\n }\n}", "function GetURLResponse(url, callback) {\n\n\n $.getJSON(url + \"&callback=?\", function(parsedJSON) {\n\n var outPutResults = \"\";\n outPutResults = parsedJSON.toString();\n\n results(outPutResults);\n\n })\n}", "function apiGetJsonClbk( fullapilink, callbackfn ) {\n\n const xhr = new XMLHttpRequest();\n\n xhr.responseType = 'json';\n \n xhr.onreadystatechange = () => { if (xhr.readyState === XMLHttpRequest.DONE) { \n\n console.log( xhr.response );\n\n callbackfn( xhr.response ); \n \n } };\n\n xhr.open( 'GET', fullapilink );\n\n xhr.send();\n\n}", "function doGet(url, callback) {\n\tmakeCall(\"GET\", url, null, callback);\n}", "function getJSON (url,callback) {\n 'use strict';\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, true);\n xhr.responseType = 'json';\n xhr.onload = function () {\n var status = xhr.status;\n if (status === 200){\n callback(null, xhr.response);\n }\n else {\n callback(status, xhr.response);\n }\n };\n xhr.send();\n}", "function httpGet(url, callback){\n\n //if typeof callback isnt 'function'\n if (typeof callback !== 'function') {\n //fail with '2nd parameter should be callback fn(err,data)'\n throw new Error('2nd parameter should be callback fn(err,data)');\n };\n\n //ajax get file\n var xmlhttp = create_HttpRequest();\n //declare valid xmlhttp.data_callback\n xmlhttp.data_callback = callback; //store callback here\n xmlhttp.onload = Local_OnLoad; //default, next fn\n xmlhttp.onerror = Local_OnError;\n //xmlhttp.setRequestHeader('content-type', 'applicattion/json');\n console.log('GET', url);\n xmlhttp.open('GET', url, true);\n xmlhttp.send();\n }", "function getJson(url, callback) {\n let httpRequest = new XMLHttpRequest();\n\n httpRequest.onreadystatechange = function() {\n if (httpRequest.readyState === XMLHttpRequest.DONE) {\n if (httpRequest.status === 200) {\n return callback(JSON.parse(httpRequest.responseText));\n } else {\n console.log(\"Error\", httpRequest.status, \"on GET\", url);\n return callback(null);\n }\n }\n };\n httpRequest.open(\"GET\", url);\n httpRequest.setRequestHeader(\"Accept\", \"application/json\");\n httpRequest.send();\n}", "function fetchGet(url, callback) {\n var raiz = document.getElementById(\"hdfOculto\").value;\n var urlAbsoluta = window.location.protocol + \"//\" +\n window.location.host + raiz + url;\n //devuelde un Json\n fetch(urlAbsoluta).then(res => res.json())\n .then(res => {\n callback(res);\n })\n .catch(err => {\n console.log(err);\n })\n\n}", "load (url, callback) {\n\n\t\tvar jsonLoadedCallbackFn = callback;\n\n\t\tvar request = new XMLHttpRequest();\n\t\trequest.onload = function (e) {\n\t\t\tthis.on_REPLY.apply(this, [e, jsonLoadedCallbackFn]);\n\t\t}.bind(this);\n\t\trequest.onerror = this.on_LOAD_ERROR.bind(this);\n\t\trequest.open('GET', url, true);\n\t\trequest.responseType = 'json';\n\t\trequest.send();\n\t}", "get(url, data = {}, succCb = null, errCb = null) {\n return this.request('GET', url, data, succCb, errCb);\n }", "function ajaxGet(method, url, cb) {\n var callback = cb || function (data){};\n\n var request = new XMLHttpRequest();\n\n request.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n\n callback(this.responseText);\n\n }\n };\n\n request.open(method, url);\n request.send();\n\n}", "function httpGet(url, callback) {\n\thttp.get(url, function(res) {\n\t\tvar chunks = [];\n\t\tres.on('data', function(chunk) {\n\t\t\tchunks.push(chunk);\n\t\t});\n\t\tres.on('end', function() {\n\t\t\tvar body = chunks.join('');\n\t\t\t//If it is a string, parse to JSON\n\t\t\tif(typeof body === 'string') {\n\t\t\t\tbody = JSON.parse(body);\n\t\t\t}\n\t\t\t//Pass JSON response to callback\n\t\t\tcallback(body);\n\t\t});\n });\n}", "function getData(callback) {\r\n $.ajax({\r\n type: \"get\",\r\n url: \"/core/dataparser.py\",\r\n dataType: \"json\",\r\n success: callback,\r\n error: function(request, status, error) {\r\n alert(status);\r\n }\r\n });\r\n}", "function getJSON(url, callback) {\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", url, true);\n xhr.onload = function (e) {\n if (xhr.readyState === 4) {\n if (xhr.status === 200) {\n var res = xhr.responseText;\n // Executes your callback with the\n // response already parsed into JSON\n callback(JSON.parse(res));\n } else { // Server responded with some error\n console.error(xhr.statusText);\n } // End of verifying response status\n } // Please read: http://www.w3schools.com/ajax/...\n // .../ajax_xmlhttprequest_onreadystatechange.asp\n }; // End of what to do when the response is answered\n \n // What to do if there's an error with the request\n xhr.onerror = function (e) {\n console.error(xhr.statusText);\n }; // End of error handling\n \n // Send the request to the server\n xhr.send(null);\n}", "function getData(url, callback) {\n\n fetch(url)\n .then(res => res.json())\n .then(data => {\n\n callback(data);\n\n })\n .catch(error => console.log(error));\n}", "static GET(url, cb) {\n jQuery.ajax({\n url: url,\n type: \"GET\",\n })\n .done(function(data, textStatus, jqXHR) {\n Layer.logs.save(\"AJAX get done : \" + jqXHR.statusText + \" \" + jqXHR.status);\n return cb(data);\n })\n .fail(function(jqXHR, textStatus, errorThrown) {\n Layer.logs.save(\"AJAX get error : \" + errorThrown);\n return errorThrown;\n })\n .always(function() {\n /* ... */\n Layer.logs.save(\"Executed AJAX get with url : \" + url);\n });\n }", "function get(url, callback) {\n\tlet xhr = new XMLHttpRequest();\n\txhr.open('GET', url, true);\n\txhr.onload = () => {\n\t\tlet data = JSON.parse(xhr.responseText);\n\t\tcallback(data);\n\t}\n\txhr.onerror = () => {\n\t\tconsole.log('Transaction Failed');\n\t}\n\txhr.send();\n}", "function ajaxGet(url, callback) {\n var req = new XMLHttpRequest();\n req.open(\"GET\", url);\n req.addEventListener(\"load\", function () {\n if (req.status >= 200 && req.status < 400) {\n // Call of callback function\n callback(req.responseText);\n } else {\n console.error(req.status + \" \" + req.statusText + \" \" + url);\n }\n });\n req.addEventListener(\"error\", function () {\n console.error(\"Erreur réseau avec l'URL \" + url);\n });\n req.send(null);\n}", "function ajaxGet(url, callback) {\n\tvar req = new XMLHttpRequest();\n\treq.open('GET', url);\n\treq.addEventListener('load', function() {\n\t\tif (req.status >= 200 && req.status < 400) {\n\t\t\t// Appelle la fonction callback en lui passant la réponse en paramètre\n\t\t\tcallback(req.responseText);\n\t\t} else {\n\t\t\tconsole.error(req.status + ' ' + req.statusText + ' ' + url);\n\t\t}\n\t});\n\treq.addEventListener('error', function() {\n\t\tconsole.error('Erreur réseau avec l\\'URL ' + url);\n\t});\n\treq.send(null);\n}", "function getSomeData(url) {\n ajax(url, function onResponse(resp) {\n console.log(\n `Response (from ${url}): ${resp}`\n );\n });\n }", "function CreateCallback(url, callback)\n{\n var http = GetHttpObject();\n http.open(\"GET\", url, true);\n \n http.onreadystatechange = function() \n {\n\t if (http.readyState == 4) \n\t {\n\t if (http.responseText.length > 0 && callback != null)\n callback(http.responseText);\n\t }\n };\n \n http.send(null);\n}", "function httpGet (callback) {\n console.log(\"real call of api here\");\n\n var url = getUrlFromForm();\n\n var request = new XMLHttpRequest();\n request.open('GET', url);\n request.onreadystatechange = () => {\n if (request.readyState === XMLHttpRequest.DONE) {\n callback(JSON.parse(request.response));\n }\n }\n\n request.send();\n}", "function getJSON(requestURL,process_function, args){\n\n var request = new XMLHttpRequest();\n request.open('GET', requestURL);\n request.responseType = 'json';\n request.send();\n\n request.onload = function() {\n if(request.status != 200) {\n linkError();\n return;\n }\n console.log(request.status);\n }\n \n}", "function getJson(url, successCallback, errorCallback) {\n\n // ToDo: Add code to get JSON data from a URI\n var request = new XMLHttpRequest();\n request.open('GET.html', url, true);\n request.setRequestHeader('Accept', 'application/json');\n request.onload = function () {\n if (this.status >= 200 && this.status < 400) {\n var data = JSON.parse(this.response);\n successCallback(data);\n } else {\n errorCallback(this);\n }\n };\n\n request.onerror = function () {\n errorCallback(this);\n };\n\n request.send();\n }", "function getData(url, successHandler, errorHandler){\n var data, status;\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", url, true); //asynchronous get request\n xhr.onreadystatechange = function(){\n if(xhr.readyState == 4){\n status = xhr.status;\n if(status == 200){\n data = JSON.parse(xhr.responseText); //parsing the json document to js object\n successHandler && successHandler(data); //data handling callback when the request status is ok\n }else{\n errorHandler && errorHandler(status); //error handling callback otherwise\n }\n }\n };\n xhr.send();\n }", "function getJSON(url, success) {\n getUri({url: url, success: function(text) {\n if (success) {\n success(text);\n }\n }});\n}", "function httpGetAsync(theUrl, callback) {\n let xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() { \n if (xmlHttp.readyState == 4 && xmlHttp.status == 200) \n callback(xmlHttp.responseText);\n }\n xmlHttp.open(\"GET\", theUrl, true); // true for asynchronous \n xmlHttp.send(null);\n}", "function jsonGet(url, args, access_token, cb) {\n if (args != null) {\n url = url + '?' + stringify(args)\n }\n const req = request(\n url,\n {\n method: 'GET',\n headers: {\n 'Accept': 'application/json',\n 'Authorization': `Bearer ${access_token}`\n }\n },\n (res) => { fetchResult(res, url, cb) }\n )\n\n req.on('error', (e) => {\n logger.error(`Request error for ${url}: ${e}`)\n cb(e, null, null)\n })\n req.end()\n}", "function getJSON(url, callback) {\n let xhr = new XMLHttpRequest();\n xhr.open('GET', url, true);\n xhr.responseType = 'json';\n xhr.onload = function() {\n let status = xhr.status;\n if (status === 200) {\n callback(null, xhr.response);\n } else {\n callback(status, xhr.response);\n }\n };\n xhr.send();\n}", "function requestJSON(url, callback) {\n $.ajax({\n url: url,\n complete: function(xhr) {\n callback.call(null, xhr.responseJSON);\n }\n });\n }", "function httpGetAsync(theUrl, callback) {\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() {\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n callback(xmlHttp.responseText);\n }\n xmlHttp.open(\"GET\", theUrl, true); // true for asynchronous\n xmlHttp.send(null);\n}", "function requestJSON(url, callback) {\r\n $.ajax({\r\n url: url,\r\n complete: function(xhr) {\r\n callback.call(null, xhr.responseJSON);\r\n }\r\n });\r\n }", "function request(HttpRequest, URL, callback) {\n var req = new HttpRequest();\n\n req.onload = function (e) {\n var response = JSON.parse(e.currentTarget.responseText);\n callback(response);\n };\n\n req.open('GET', URL);\n req.send();\n }", "function httpGetAsync(theUrl, callback) {\n var xmlHttp = new XMLHttpRequest();\n\n xmlHttp.onreadystatechange = function() { \n if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {\n callback(xmlHttp.responseText);\n }\n }\n xmlHttp.open(\"GET\", theUrl, true); // true for asynchronous \n xmlHttp.send(null);\n}", "static _getDataFromURL(url, successCallback) {\n nanoajax.ajax({url: url}, (code, responseText) => {\n if(code >= 200 && code < 300){\n successCallback(responseText);\n }\n });\n }", "function httpGetAsync(theUrl, callback) {\n\tvar xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() { \n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n callback(xmlHttp.responseText);\n }\n xmlHttp.open(\"GET\", theUrl, true); // true for asynchronous \n xmlHttp.send(null);\n}", "function httpGetAsync(theUrl, callback)\n{\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() { \n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n callback(xmlHttp.responseText);\n\t\tif(xmlHttp.status == 400)\n\t\t\terror();\n\t\tif(xmlHttp.status == 404)\n\t\t\terror();\n }\n xmlHttp.open(\"GET\", \"https://cors-anywhere.herokuapp.com/\" + theUrl, true); // true for asynchronous \n xmlHttp.send(null);\n}", "function get(url, callback) {\n var request = new XMLHttpRequest();\n request.open(\"GET\", url);\n request.onreadystatechange = function() {\n // if the request is complete and was successful\n if (request.readyState === 4 && request.status === 200) {\n var type = request.getResponseHeader('Content-Type');\n if (type.indexOf('xml') !== -1 && request.responseXML) {\n callback(request.responseXML); \n } else if (type === 'application/json') {\n callback(JSON.parse(request.responseText));\n } else {\n callback(request.responseText);\n }\n }\n };\n request.send(null); \n}", "function loadJSON(callback, endpoint, loadingFakeData=false) { \n\n console.log(\"Creating GET request for JSON\");\n\n var xobj = new XMLHttpRequest();\n xobj.overrideMimeType(\"application/json\");\n xobj.open('GET', endpoint, true); // Replace 'my_data' with the path to your file\n xobj.onreadystatechange = function () {\n if (xobj.readyState == 4 && xobj.status == \"200\") {\n // Required use of an anonymous callback as .open will NOT return a value but simply returns undefined in asynchronous mode\n callback(xobj.responseText, loadingFakeData);\n }else{\n console.log(\"Could not fetch data! Status \" + xobj.status);\n }\n };\n xobj.send(null); \n }", "function httpGetAsync(theUrl, callback) {\n\n\tvar xmlHttp = new XMLHttpRequest();\n\txmlHttp.onreadystatechange = function () {\n\t\tif (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n\t\t\tcallback(xmlHttp.responseText);\n\t}\n\txmlHttp.open(\"GET\", theUrl, true); // true for asynchronous\n\txmlHttp.send(null);\n}", "function http_GET(url) {\n\tvar xmlHttp = new XMLHttpRequest();\n\txmlHttp.open(\"GET\", url, false); // false for synchronous request\n\txmlHttp.send(null);\n\tvar text = xmlHttp.responseText;\n\treturn JSON.parse(text);\n\n\t\n}", "httpGetAsync(theUrl, callback){\n var xmlHttp = new XMLHttpRequest()\n xmlHttp.onreadystatechange = function() {\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n callback(xmlHttp.responseText)\n }\n xmlHttp.open(\"GET\", theUrl, true)\n xmlHttp.send(null)\n }", "function get(url, callback) {\n\tvar request = new XMLHttpRequest(); // Create new request\n\trequest.open(\"GET\", url); // Specify URL to fetch\n\trequest.onreadystatechange = function() { // Define event listener\n\t\t// If the request is compete and was successful\n\t\tif (request.readyState === 4 && request.status === 200) {\n\t\t\t// Get the type of the response\n\t\t\tvar type = request.getResponseHeader(\"Content-Type\");\n\t\t\t// Check type so we don't get HTML documents in the future\n\t\t\tif (type.indexOf(\"xml\") !== -1 && request.responseXML)\n\t\t\t\tcallback(request.responseXML); // Document response\n\t\t\telse if (type === \"application/json\")\n\t\t\t\tcallback(JSON.parse(request.responseText)); // JSON response\n\n\t\t\telse\n\t\t\t\tcallback(request.responseText); // String response\n\t\t}\n\t};\n\trequest.send(null); // Send the request now\n}", "function httpGetAsync(url, callback)\n{\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() { \n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n callback(xmlHttp.response);\n }\n xmlHttp.open(\"GET\", url, true); // true for asynchronous \n xmlHttp.send(null);\n}", "function fetchData(url_api, callback) {\n let xhttp = new XMLHttpRequest();\n //Open the connection via GET\n xhttp.open(\"GET\", url_api, true);\n //Verify if call is ready\n xhttp.onreadystatechange = function (event) {\n //Verify if call is complete\n if (xhttp.readyState === 4) {\n //Verify if status is OK\n if (xhttp.status === 200) {\n //trigger callback,first parameter(error) is null cause call was ok\n //second parameter is the response parsed to JSON\n callback(null, JSON.parse(xhttp.responseText));\n } else {\n //if response status is not 200 then return error\n const error = new Error(\"Error \" + url_api);\n return callback(error, null);\n }\n }\n };\n xhttp.send();\n}", "function get_request(url,callback)\n{\n var xhttp = new XMLHttpRequest();\n // executed every time the status of the XMLHttpRequest object changes\n xhttp.onreadystatechange = function () {\n // readyState 4 == DONE\n // status 200 == successful_request\n if (this.readyState == 4 && this.status == 200){\n if (typeof callback == \"function\") {\n callback.apply(xhttp);\n }\n }\n }\n\n xhttp.open(\"GET\",url,false);\n xhttp.send();\n}", "function fetchData(url,callback) { \r\n\tvar xhr = new XMLHttpRequest(); \r\n\txhr.open(\"GET\", url, true); \r\n\txhr.onreadystatechange = function() { \r\n\t\tif (xhr.readyState == 4) {\r\n\t\t\tvar data = xhr.responseText;\t\t \r\n\t\t\tcallback(data); \r\n\t\t} else { \r\n callback(null); \r\n\t\t} \r\n\t} \r\n\txhr.send(); \r\n}", "function jsonrequest(url,cFunction){\t\n\tlet request = new XMLHttpRequest();\n\trequest.responseType = \"json\";\n\trequest.onreadystatechange = function() {\n\t if (this.readyState == 4 && this.status == 200) {\n\t cFunction(this); //send xhr object to callback function\n\t }\n\t};\n\trequest.open(\"GET\", url, true); \n\trequest.send();\n}", "function get( url, cb, args ) {\r\n if( args ) cb = make_caller( cb, args );\r\n var rq = new XMLHttpRequest();\r\n rq.onload = function(){ try{ cb(rq.responseText); }catch( e ){alert( e );} };\r\n rq.overrideMimeType( 'text/html; charset=ISO-8859-1');\r\n if( url.match( /^\\// ) )\r\n url = host + url;\r\n rq.open( 'GET', url );\r\n rq.send( null );\r\n}", "function httpreqcall(url, callback) {\n //console.log('url:'+url);\n request(url, function (error, response, body) {\n // console.log('error:', error); // Print the error if one occurred\n // console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received\n // console.log('body:', body); // Print the HTML for the Google homepage.\n //res.json(body);\n //console.log(JSON.stringify(response));\n if (error) {\n console.log('Could not find routes for this house');\n return callback('');\n }\n //console.log(body);\n //var temp = JSON.parse(body);\n callback(body);\n });\n }", "function fetcher(URL, callback) {\n fetch(URL)\n .then(response => response.json())\n .then(json => callback(json))\n}", "function request(url) {\n var req = new XMLHttpRequest();\n req.responseType = 'json';\n req.open('GET', url, false);\n req.send();\n return req.status == 200 ? req.response : null;\n}", "function loadJSON(url, callback) { \n var xobj = new XMLHttpRequest();\n xobj.overrideMimeType(\"application/json\");\n xobj.open('GET', url, true);\n xobj.onreadystatechange = function () {\n if (xobj.readyState == 4 && xobj.status == \"200\") {\n callback(JSON.parse(xobj.responseText));\n }\n };\n xobj.send(null); \n }", "function httpGetAsync(url, callback) {\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() {\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n callback(xmlHttp.responseText);\n };\n xmlHttp.open('GET', url, true);\n xmlHttp.send(null);\n}", "static get (data, callback = f => f) {\n return createRequest({\n url: this.HOST + this.URL,\n data,\n method: 'GET',\n responseType: 'json',\n callback (e, response) {\n if (e === null && response) {\n callback(e, response);\n } else {\n console.error(e);\n };\n }\n });\n }", "function getJSON(){\n console.log(\"GET\");\n\n var api_url = _api_url; \n httpGetAsync(api_url,function(resp){\n console.log(resp);\n console.log(\"data returned successfully\");\n })\n }", "function fetch (url, callback) {\n var xhr = new XMLHttpRequest();\n \n xhr.addEventListener('load', function () {\n if (xhr.status === 200) {\n var response = JSON.parse(xhr.responseText);\n return callback(response);\n }else{\n alert('There is no Results');\n }\n });\n \n xhr.open('GET', url);\n xhr.send();\n}", "function httpGet(url, callback) {\n var request = http.get(url);\n\n request.on(\"response\", function(response) {\n var receivedData = \"\";\n\n response.setEncoding(\"utf8\");\n response.on(\"data\", function (chunk) {\n receivedData += chunk;\n });\n response.on(\"end\", function () {\n callback(response, receivedData);\n });\n });\n }", "function getJSON(url, callback) {\n let request = new XMLHttpRequest();\n request.open('GET', url, true);\n\n request.onload = function() {\n if (this.status >= 200 && this.status < 400) {\n callback(JSON.parse(this.response));\n } else {\n conosle.log(\"GitHub Cards Update error: \" + this.response);\n }\n };\n\n request.onerror = function() {\n console.log(\"GitHub Cards could not connect to Github!\");\n };\n\n request.send()\n }", "function getData(url, callback, trigger) {\n $.ajax({\n url: url,\n context: document.body\n }).done(function(data) {\n if (typeof callback == 'function') {\n callback(data, trigger);\n }\n else {\n return data;\n }\n });\n}", "function getTheJson(apiUrl, cb){\r\n ajaxFunctions.ready(\r\n ajaxFunctions.ajaxRequest(reqMethod, apiUrl, true, function(data){\r\n cb(data);\r\n })\r\n ); \r\n }", "function httpGetAsync(theUrl, callback, logenabled)\n{\t\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() { \n if (xmlHttp.readyState == 4 && xmlHttp.status == 200){\n \t//Always a JSON ..\n \tvar rpcjson = JSON.parse(xmlHttp.responseText);\n \t\n \t//Do we log it..\n \tif(Minima.logging && logenabled){\n \t\tvar logstring = JSON.stringify(rpcjson, null, 2).replace(/\\\\n/g,\"\\n\");\n \t\tMinima.log(theUrl+\"\\n\"+logstring);\n \t}\n \t\n \t//Send it to the callback function..\n \tif(callback){\n \t\tcallback(rpcjson);\n \t}\n }\n }\n xmlHttp.open(\"GET\", theUrl, true); // true for asynchronous \n xmlHttp.send(null);\n}", "function _get (url, callback, ignoreCache) {\r\n \r\n // let's not be wasteful, though\r\n if (!ignoreCache && _cache[url]) {\r\n callback(_cache[url]);\r\n return;\r\n }\r\n\r\n _xhr.open('GET', url);\r\n _xhr.onreadystatechange = function () {\r\n if (_xhr.readyState == 4) {\r\n if (_xhr.status == 200) {\r\n var json_response = JSON.parse(_xhr.responseText);\r\n if (!ignoreCache) {\r\n _cache[url] = json_response;\r\n }\r\n callback(json_response);\r\n }\r\n }\r\n };\r\n _xhr.send(null);\r\n }", "function request(url, callback, id) {\n $.get(url).done(\n function(data, status, jqXHR) {\n callback({status: 200, id: id, text: jqXHR.responseText});\n }\n );\n}", "function getAjaxData(url, callback) {\n // Create new ajax call with the js function called XMLHttpRequest\n const request = new XMLHttpRequest();\n request.addEventListener('load', function () {\n // This in here is our callback function\n // Check our server responsecode, 200 means ok, success: https://en.wikipedia.org/wiki/List_of_HTTP_status_codes \n if (this.status === 200) {\n callback(JSON.parse(request.responseText));\n } else {\n console.log('Something is probably wrong with the url');\n }\n });\n\n request.addEventListener('error', function () {\n console.log('Server error like timeout');\n });\n\n // initializes a request with an http method\n request.open(\"GET\", url);\n // Sends the request \n request.send();\n}", "function fetchJson(myUrl) {\n log(\"JSONP request URL: \" + myUrl);\n $.ajax({\n // myUrl aleady has all the parameters/data applied\n url: myUrl,\n // The name of the callback parameter, as specified by the YQL service\n jsonp: \"callback\",\n // Tell jQuery we're expecting JSONP\n dataType: \"jsonp\",\n // If timeout is reached, error condition is called:\n timeout: ajaxTimeout,\n // Work with the response - Note: for jsonp all data is sent to the callback function.\n success: function( jsonData ) {\n renderResponse(jsonData);\n },\n error: function (request, textStatus, errorThrown) {\n log(\"Ajax JSONP error, timeout reached: \" + errorThrown);\n $('#searchResults').html('<p class=\"noMatches\">The search server is taking longer than expected to respond. ' +\n 'Please check your network connection and/or try again later.</p>');\n $('#loadMsg').hide();\n $('#footerView').show();\n }\n });\n}", "function loadUrlData(url, callback){\n console.log('Loading data from url: ' + url);\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url);\n xhr.onload = function() {\n if (xhr.status === 200) {\n console.log(\"Received successful response, calling callback.\")\n callback(xhr.responseText);\n } else {\n console.log(\"Request failed to load the data.\" + xhr.status);\n }\n };\n xhr.send();\n}", "function getJson(uri, to, myarg) {\r\n doJsonReq(\"GET\", uri, null, to, myarg);\r\n}", "function httpGet(theUrl, callback){\n request(theUrl, function (error, response, body){\n\n\t\tif (!error && response.statusCode == 200){\n\t\t \tcallback(body) // Call the callback function passed in\n\t\t}else if(response.statusCode == 403){\n\t\t\tconsole.log('ACCESS DENIED: This probably means you ran out of requests on your API key for now.')\n\t\t}\n\t})\n}", "function getData(type, cb) {\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200) {\n cb(JSON.parse(this.responseText));\n }\n };\n\n xhr.open(\"GET\", baseURL + type + \"&app_id=\" + API_APP + \"&app_key=\" + API_KEY + \"&to=24\");\n xhr.send();\n}" ]
[ "0.78543854", "0.78474337", "0.7731454", "0.7632696", "0.7539297", "0.7533426", "0.7480702", "0.74681365", "0.7466682", "0.74615675", "0.7448217", "0.7424495", "0.74029636", "0.7398302", "0.7366457", "0.7339989", "0.73132175", "0.72810423", "0.7279093", "0.72603595", "0.7253938", "0.72253656", "0.71923137", "0.71703196", "0.7168688", "0.7163443", "0.7161844", "0.7160116", "0.7139251", "0.71334225", "0.7131796", "0.7119347", "0.71146435", "0.7114101", "0.7086103", "0.70847565", "0.707", "0.70596313", "0.703903", "0.7037342", "0.7035122", "0.70272297", "0.7026591", "0.70245147", "0.70084274", "0.70041674", "0.69883025", "0.69770676", "0.69759566", "0.69710386", "0.69690436", "0.69671947", "0.69666356", "0.6958045", "0.6954601", "0.6949778", "0.69458246", "0.6938769", "0.6935912", "0.69355655", "0.692344", "0.6920858", "0.6920812", "0.6917556", "0.6898983", "0.6882617", "0.6879308", "0.68746495", "0.6873346", "0.6872941", "0.6868339", "0.6856977", "0.6853903", "0.6849129", "0.6848498", "0.68315333", "0.6829312", "0.6824802", "0.6822435", "0.6811627", "0.6806642", "0.6806286", "0.6792953", "0.6774619", "0.676682", "0.6765113", "0.676488", "0.6755897", "0.6753317", "0.67475736", "0.67455304", "0.6745015", "0.6742097", "0.6740296", "0.67346644", "0.67333287", "0.6729282", "0.67292494", "0.67231727", "0.6716347" ]
0.7996012
0
make a horizon chart
function horizon() { var hrz = context.horizon(); if (type === 'm') { return hrz.extent([0, 2]) .colors(['black', 'black', 'teal', '#dd1144']); } else if (type === 'v') { return hrz; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initHorizontalChart() {\n console.log(\"initHorizontalChart\");\n\n // ordinal.rangeRoundBands(interval, padding, outerPadding)\n // computes range values so as to divide the chart area into evenly-spaced, evenly-sized bands\n // assures integers for pixel; values (avoids aliasing)\n // padding: space between bars\n // outerpadding: space before and after bars collection\n\n // ======= data granularity =======\n var vowels = [\"A\", \"E\", \"I\", \"O\", \"U\"];\n\n // ======= chart formatting =======\n var margin = {top: 20, right: 20, bottom: 30, left: 40},\n width = 720 - margin.left - margin.right, // outer width of chart\n height = 500 - margin.top - margin.bottom; // outer height of chart\n\n // ======= scale mapping (data to display) =======\n var x = d3.scale.ordinal() // function that sorts data alphabetically\n .rangeRoundBands([0, width], .1); // .1 specifies space between bars\n\n var y = d3.scale.linear() // function that maps data domain (below) to output range\n .range([height, 0]); // fits max data value into max chart height\n\n // ======= scale label formating =======\n var xAxis = d3.svg.axis() // existing x scale function is bound to xAxis\n .scale(x) // x scale becomes scale function of xAxis object\n .orient(\"bottom\"); // specifies location of axis (top/bottom/left/right)\n\n var yAxis = d3.svg.axis()\n .scale(y) // existing y scale function is bound to yAxis as yAxis function\n .orient(\"left\") // specifies location of axis (top/bottom/left/right)\n .ticks(10, \"%\"); // spacing (10px) and format (%) for ticks\n\n // ======= build svg objects =======\n var svg = d3.select(\"#chartHorizontal\").append(\"svg\") // create and append svg element to container\n .attr(\"width\", width + margin.left + margin.right) // offset chart top/left/right/bottom by margin dimensions\n .attr(\"height\", height + margin.top + margin.bottom)\n .append(\"g\") // g element is parent svg object\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n // ======= get remote data file =======\n d3.tsv(\"data2.tsv\", stringToInt, function(error, dataSet) {\n if (error) throw error;\n\n // ======= get x/y domains (input), bind to ranges (output scale objects) =======\n x.domain(dataSet.map(function(d) { return d.letter; })); // get letter value from data object\n y.domain([0, d3.max(dataSet, function(d) { return d.frequency; })]); // get frequency value from data object\n\n // ======= X scale =======\n svg.append(\"g\") // new \"g\" element contains scale produced by xAxis object methods\n .attr(\"class\", \"x axis\") // \"x\" and \"axis\" classes for general and specific styles\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(xAxis); // calls xAxis methods to create scale\n\n // ======= Y scale (with title) =======\n svg.append(\"g\") // new \"g\" element contains scale produced by yAxis object methods\n .attr(\"class\", \"y axis\") // \"y\" and \"axis\" classes for general and specific styles\n .call(yAxis) // calls yAxis methods to create scale\n .append(\"text\") // append \"Frequency\" scale label to scale\n .attr(\"transform\", \"rotate(-90)\") // rotate label to fit\n .attr(\"y\", 10) // y location of label (moves on x axis due to rotation)\n .attr(\"dy\", \".71em\") // location tweak\n .style(\"text-anchor\", \"end\") // position based on end of text string (vs start of text)\n .text(\"Frequency\"); // text content (\"Frequency\")\n\n // ======= rects for bar graph =======\n svg.selectAll(\".bar\") // new \"g\" element containers to hold rect and text elements\n .data(dataSet)\n .enter().append(\"rect\")\n .attr(\"class\", \"bar\") // enable styling of rects via class name\n .attr(\"x\", function(d) { return x(d.letter); }) // x scale function maps range location (\"x\") to domain\n .attr(\"width\", x.rangeBand()) // rangeBand function spaces bars and inserts padding\n .attr(\"y\", function(d) { return y(d.frequency); }) // y scale function maps range location (\"y\") to domain\n .attr(\"height\", function(d) { return height - y(d.frequency); }) // calculated from height - value\n .style({'fill': function(d, i) { // toggle bar colors (index even/odd)\n var vowelCheck = $.inArray(d.letter, vowels);\n if (vowelCheck > -1) {\n whichColor = 'rebeccapurple';\n } else {\n whichColor = (i % 2 == 0) ? \"#556B2F\":\"#808000\";\n }\n return whichColor;\n }\n });\n });\n\n // ======= stringToInt =======\n function stringToInt(d) {\n // console.log(\"stringToInt\");\n d.frequency = +d.frequency;\n return d;\n }\n}", "function drawHorizon() {\n push();\n\n // the horizon line\n horizonYAnchor = (hGridNum / 10) * gridH;\n horizonTopY = horizonYAnchor / 2;\n\n fill(greenC);\n beginShape();\n curveVertex(0, horizonYAnchor);\n curveVertex(0, horizonYAnchor);\n curveVertex(width / 2, horizonTopY);\n curveVertex(width, horizonYAnchor);\n curveVertex(width, horizonYAnchor);\n vertex(width, height);\n vertex(0, height);\n vertex(0, horizonYAnchor);\n endShape(CLOSE);\n\n //debug\n //debugE(gridW * (floor(hGridNum/2)-3), trackY);\n //debugE(0, horizonYAnchor);\n //debugE(canvasW / 2, horizonYAnchor / 2);\n //debugE(canvasW, horizonYAnchor)\n pop();\n}", "function horizontalChart(num1, num2, num3) {\n var star = '*';\n return star.repeat(num1) + \"\\n\" + star.repeat(num2) + \"\\n\" + star.repeat(num3);\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 createChart(options) {\n var data;\n var highLow;\n\n if (options.distributeSeries) {\n data = Chartist.normalizeData(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y');\n data.normalized.series = data.normalized.series.map(function (value) {\n return [value];\n });\n } else {\n data = Chartist.normalizeData(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y');\n } // Create new svg element\n\n\n this.svg = Chartist.createSvg(this.container, options.width, options.height, options.classNames.chart + (options.horizontalBars ? ' ' + options.classNames.horizontalBars : '')); // Drawing groups in correct order\n\n var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup);\n var seriesGroup = this.svg.elem('g');\n var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup);\n\n if (options.stackBars && data.normalized.series.length !== 0) {\n // If stacked bars we need to calculate the high low from stacked values from each series\n var serialSums = Chartist.serialMap(data.normalized.series, function serialSums() {\n return Array.prototype.slice.call(arguments).map(function (value) {\n return value;\n }).reduce(function (prev, curr) {\n return {\n x: prev.x + (curr && curr.x) || 0,\n y: prev.y + (curr && curr.y) || 0\n };\n }, {\n x: 0,\n y: 0\n });\n });\n highLow = Chartist.getHighLow([serialSums], options, options.horizontalBars ? 'x' : 'y');\n } else {\n highLow = Chartist.getHighLow(data.normalized.series, options, options.horizontalBars ? 'x' : 'y');\n } // Overrides of high / low from settings\n\n\n highLow.high = +options.high || (options.high === 0 ? 0 : highLow.high);\n highLow.low = +options.low || (options.low === 0 ? 0 : highLow.low);\n var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);\n var valueAxis, labelAxisTicks, labelAxis, axisX, axisY; // We need to set step count based on some options combinations\n\n if (options.distributeSeries && options.stackBars) {\n // If distributed series are enabled and bars need to be stacked, we'll only have one bar and therefore should\n // use only the first label for the step axis\n labelAxisTicks = data.normalized.labels.slice(0, 1);\n } else {\n // If distributed series are enabled but stacked bars aren't, we should use the series labels\n // If we are drawing a regular bar chart with two dimensional series data, we just use the labels array\n // as the bars are normalized\n labelAxisTicks = data.normalized.labels;\n } // Set labelAxis and valueAxis based on the horizontalBars setting. This setting will flip the axes if necessary.\n\n\n if (options.horizontalBars) {\n if (options.axisX.type === undefined) {\n valueAxis = axisX = new Chartist.AutoScaleAxis(Chartist.Axis.units.x, data.normalized.series, chartRect, Chartist.extend({}, options.axisX, {\n highLow: highLow,\n referenceValue: 0\n }));\n } else {\n valueAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data.normalized.series, chartRect, Chartist.extend({}, options.axisX, {\n highLow: highLow,\n referenceValue: 0\n }));\n }\n\n if (options.axisY.type === undefined) {\n labelAxis = axisY = new Chartist.StepAxis(Chartist.Axis.units.y, data.normalized.series, chartRect, {\n ticks: labelAxisTicks\n });\n } else {\n labelAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data.normalized.series, chartRect, options.axisY);\n }\n } else {\n if (options.axisX.type === undefined) {\n labelAxis = axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data.normalized.series, chartRect, {\n ticks: labelAxisTicks\n });\n } else {\n labelAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data.normalized.series, chartRect, options.axisX);\n }\n\n if (options.axisY.type === undefined) {\n valueAxis = axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data.normalized.series, chartRect, Chartist.extend({}, options.axisY, {\n highLow: highLow,\n referenceValue: 0\n }));\n } else {\n valueAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data.normalized.series, chartRect, Chartist.extend({}, options.axisY, {\n highLow: highLow,\n referenceValue: 0\n }));\n }\n } // Projected 0 point\n\n\n var zeroPoint = options.horizontalBars ? chartRect.x1 + valueAxis.projectValue(0) : chartRect.y1 - valueAxis.projectValue(0); // Used to track the screen coordinates of stacked bars\n\n var stackedBarValues = [];\n labelAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n valueAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n\n if (options.showGridBackground) {\n Chartist.createGridBackground(gridGroup, chartRect, options.classNames.gridBackground, this.eventEmitter);\n } // Draw the series\n\n\n data.raw.series.forEach(function (series, seriesIndex) {\n // Calculating bi-polar value of index for seriesOffset. For i = 0..4 biPol will be -1.5, -0.5, 0.5, 1.5 etc.\n var biPol = seriesIndex - (data.raw.series.length - 1) / 2; // Half of the period width between vertical grid lines used to position bars\n\n var periodHalfLength; // Current series SVG element\n\n var seriesElement; // We need to set periodHalfLength based on some options combinations\n\n if (options.distributeSeries && !options.stackBars) {\n // If distributed series are enabled but stacked bars aren't, we need to use the length of the normaizedData array\n // which is the series count and divide by 2\n periodHalfLength = labelAxis.axisLength / data.normalized.series.length / 2;\n } else if (options.distributeSeries && options.stackBars) {\n // If distributed series and stacked bars are enabled we'll only get one bar so we should just divide the axis\n // length by 2\n periodHalfLength = labelAxis.axisLength / 2;\n } else {\n // On regular bar charts we should just use the series length\n periodHalfLength = labelAxis.axisLength / data.normalized.series[seriesIndex].length / 2;\n } // Adding the series group to the series element\n\n\n seriesElement = seriesGroup.elem('g'); // Write attributes to series group element. If series name or meta is undefined the attributes will not be written\n\n seriesElement.attr({\n 'ct:series-name': series.name,\n 'ct:meta': Chartist.serialize(series.meta)\n }); // Use series class from series data or if not set generate one\n\n seriesElement.addClass([options.classNames.series, series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex)].join(' '));\n data.normalized.series[seriesIndex].forEach(function (value, valueIndex) {\n var projected, bar, previousStack, labelAxisValueIndex; // We need to set labelAxisValueIndex based on some options combinations\n\n if (options.distributeSeries && !options.stackBars) {\n // If distributed series are enabled but stacked bars aren't, we can use the seriesIndex for later projection\n // on the step axis for label positioning\n labelAxisValueIndex = seriesIndex;\n } else if (options.distributeSeries && options.stackBars) {\n // If distributed series and stacked bars are enabled, we will only get one bar and therefore always use\n // 0 for projection on the label step axis\n labelAxisValueIndex = 0;\n } else {\n // On regular bar charts we just use the value index to project on the label step axis\n labelAxisValueIndex = valueIndex;\n } // We need to transform coordinates differently based on the chart layout\n\n\n if (options.horizontalBars) {\n projected = {\n x: chartRect.x1 + valueAxis.projectValue(value && value.x ? value.x : 0, valueIndex, data.normalized.series[seriesIndex]),\n y: chartRect.y1 - labelAxis.projectValue(value && value.y ? value.y : 0, labelAxisValueIndex, data.normalized.series[seriesIndex])\n };\n } else {\n projected = {\n x: chartRect.x1 + labelAxis.projectValue(value && value.x ? value.x : 0, labelAxisValueIndex, data.normalized.series[seriesIndex]),\n y: chartRect.y1 - valueAxis.projectValue(value && value.y ? value.y : 0, valueIndex, data.normalized.series[seriesIndex])\n };\n } // If the label axis is a step based axis we will offset the bar into the middle of between two steps using\n // the periodHalfLength value. Also we do arrange the different series so that they align up to each other using\n // the seriesBarDistance. If we don't have a step axis, the bar positions can be chosen freely so we should not\n // add any automated positioning.\n\n\n if (labelAxis instanceof Chartist.StepAxis) {\n // Offset to center bar between grid lines, but only if the step axis is not stretched\n if (!labelAxis.options.stretch) {\n projected[labelAxis.units.pos] += periodHalfLength * (options.horizontalBars ? -1 : 1);\n } // Using bi-polar offset for multiple series if no stacked bars or series distribution is used\n\n\n projected[labelAxis.units.pos] += options.stackBars || options.distributeSeries ? 0 : biPol * options.seriesBarDistance * (options.horizontalBars ? -1 : 1);\n } // Enter value in stacked bar values used to remember previous screen value for stacking up bars\n\n\n previousStack = stackedBarValues[valueIndex] || zeroPoint;\n stackedBarValues[valueIndex] = previousStack - (zeroPoint - projected[labelAxis.counterUnits.pos]); // Skip if value is undefined\n\n if (value === undefined) {\n return;\n }\n\n var positions = {};\n positions[labelAxis.units.pos + '1'] = projected[labelAxis.units.pos];\n positions[labelAxis.units.pos + '2'] = projected[labelAxis.units.pos];\n\n if (options.stackBars && (options.stackMode === 'accumulate' || !options.stackMode)) {\n // Stack mode: accumulate (default)\n // If bars are stacked we use the stackedBarValues reference and otherwise base all bars off the zero line\n // We want backwards compatibility, so the expected fallback without the 'stackMode' option\n // to be the original behaviour (accumulate)\n positions[labelAxis.counterUnits.pos + '1'] = previousStack;\n positions[labelAxis.counterUnits.pos + '2'] = stackedBarValues[valueIndex];\n } else {\n // Draw from the zero line normally\n // This is also the same code for Stack mode: overlap\n positions[labelAxis.counterUnits.pos + '1'] = zeroPoint;\n positions[labelAxis.counterUnits.pos + '2'] = projected[labelAxis.counterUnits.pos];\n } // Limit x and y so that they are within the chart rect\n\n\n positions.x1 = Math.min(Math.max(positions.x1, chartRect.x1), chartRect.x2);\n positions.x2 = Math.min(Math.max(positions.x2, chartRect.x1), chartRect.x2);\n positions.y1 = Math.min(Math.max(positions.y1, chartRect.y2), chartRect.y1);\n positions.y2 = Math.min(Math.max(positions.y2, chartRect.y2), chartRect.y1);\n var metaData = Chartist.getMetaData(series, valueIndex); // Create bar element\n\n bar = seriesElement.elem('line', positions, options.classNames.bar).attr({\n 'ct:value': [value.x, value.y].filter(Chartist.isNumeric).join(','),\n 'ct:meta': Chartist.serialize(metaData)\n });\n this.eventEmitter.emit('draw', Chartist.extend({\n type: 'bar',\n value: value,\n index: valueIndex,\n meta: metaData,\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n chartRect: chartRect,\n group: seriesElement,\n element: bar\n }, positions));\n }.bind(this));\n }.bind(this));\n this.eventEmitter.emit('created', {\n bounds: valueAxis.bounds,\n chartRect: chartRect,\n axisX: axisX,\n axisY: axisY,\n svg: this.svg,\n options: options\n });\n }", "function appendAxes() {\n graphImg\n .append(\"g\")\n .call(xAxis)\n .attr(\"class\", \"xAxis\")\n .attr(\n \"transform\",\n \"translate(0,\" + (displayHeight - margin - labelArea) + \")\"\n );\n graphImg\n .append(\"g\")\n .call(yAxis)\n .attr(\"class\", \"yAxis\")\n .attr(\"transform\", \"translate(\" + (margin + labelArea) + \", 0)\");\n }", "function horizontalChart (a, b, c) {\n let empty = \"\";\n let star = \"* \";\n let newLine = \"\\n\";\n for (let i = 0; i < a; i++) {\n empty += star;\n }\n empty += newLine;\n for (let j = 0; j < b; j++) {\n empty += star;\n }\n empty += newLine; \n for (let k = 0; k < c; k++) {\n empty += star;\n }\n empty += newLine;\n return empty; \n}", "generateHor(h,w)\n\t{\n\t\tfor(var y = 0; y < h ; y++)\n\t\t{\n\t\t\tfor(var x = 0; x < w-1 ; x++)\n\t\t\t{\n\t\t\t\tvar a = new Dot(x,y);\n\t\t\t\tvar b = new Dot(x+1,y);\n\t\t\t\tvar l = new Line(a,b);\n\t\t\t\tthis.lines.set(l.toString(), l);\n\t\t\t}\n\t\t}\n\t}", "function createChart(options) {\n this.data = Chartist.normalizeData(this.data);\n var data = {\n raw: this.data,\n normalized: options.distributeSeries ? Chartist.getDataArray(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y').map(function (value) {\n return [value];\n }) : Chartist.getDataArray(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y')\n };\n\n var highLow;\n\n // Create new svg element\n this.svg = Chartist.createSvg(\n this.container,\n options.width,\n options.height,\n options.classNames.chart + (options.horizontalBars ? ' ' + options.classNames.horizontalBars : '')\n );\n\n // Drawing groups in correct order\n var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup);\n var seriesGroup = this.svg.elem('g');\n var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup);\n\n if (options.stackBars && data.normalized.length !== 0) {\n // If stacked bars we need to calculate the high low from stacked values from each series\n var serialSums = Chartist.serialMap(data.normalized, function serialSums() {\n return Array.prototype.slice.call(arguments).map(function (value) {\n return value;\n }).reduce(function (prev, curr) {\n return {\n x: prev.x + (curr && curr.x) || 0,\n y: prev.y + (curr && curr.y) || 0\n };\n }, { x: 0, y: 0 });\n });\n\n highLow = Chartist.getHighLow([serialSums], Chartist.extend({}, options, {\n referenceValue: 0\n }), options.horizontalBars ? 'x' : 'y');\n } else {\n highLow = Chartist.getHighLow(data.normalized, Chartist.extend({}, options, {\n referenceValue: 0\n }), options.horizontalBars ? 'x' : 'y');\n }\n // Overrides of high / low from settings\n highLow.high = +options.high || (options.high === 0 ? 0 : highLow.high);\n highLow.low = +options.low || (options.low === 0 ? 0 : highLow.low);\n\n var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);\n\n var valueAxis,\n labelAxisTicks,\n labelAxis,\n axisX,\n axisY;\n\n // We need to set step count based on some options combinations\n if (options.distributeSeries && options.stackBars) {\n // If distributed series are enabled and bars need to be stacked, we'll only have one bar and therefore should\n // use only the first label for the step axis\n labelAxisTicks = data.raw.labels.slice(0, 1);\n } else {\n // If distributed series are enabled but stacked bars aren't, we should use the series labels\n // If we are drawing a regular bar chart with two dimensional series data, we just use the labels array\n // as the bars are normalized\n labelAxisTicks = data.raw.labels;\n }\n\n // Set labelAxis and valueAxis based on the horizontalBars setting. This setting will flip the axes if necessary.\n if (options.horizontalBars) {\n if (options.axisX.type === undefined) {\n valueAxis = axisX = new Chartist.AutoScaleAxis(Chartist.Axis.units.x, data, chartRect, Chartist.extend({}, options.axisX, {\n highLow: highLow,\n referenceValue: 0\n }));\n } else {\n valueAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data, chartRect, Chartist.extend({}, options.axisX, {\n highLow: highLow,\n referenceValue: 0\n }));\n }\n\n if (options.axisY.type === undefined) {\n labelAxis = axisY = new Chartist.StepAxis(Chartist.Axis.units.y, data, chartRect, {\n ticks: labelAxisTicks\n });\n } else {\n labelAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data, chartRect, options.axisY);\n }\n } else {\n if (options.axisX.type === undefined) {\n labelAxis = axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data, chartRect, {\n ticks: labelAxisTicks\n });\n } else {\n labelAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data, chartRect, options.axisX);\n }\n\n if (options.axisY.type === undefined) {\n valueAxis = axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data, chartRect, Chartist.extend({}, options.axisY, {\n highLow: highLow,\n referenceValue: 0\n }));\n } else {\n valueAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data, chartRect, Chartist.extend({}, options.axisY, {\n highLow: highLow,\n referenceValue: 0\n }));\n }\n }\n\n // Projected 0 point\n var zeroPoint = options.horizontalBars ? (chartRect.x1 + valueAxis.projectValue(0)) : (chartRect.y1 - valueAxis.projectValue(0));\n // Used to track the screen coordinates of stacked bars\n var stackedBarValues = [];\n\n labelAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n valueAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n\n // Draw the series\n data.raw.series.forEach(function (series, seriesIndex) {\n // Calculating bi-polar value of index for seriesOffset. For i = 0..4 biPol will be -1.5, -0.5, 0.5, 1.5 etc.\n var biPol = seriesIndex - (data.raw.series.length - 1) / 2;\n // Half of the period width between vertical grid lines used to position bars\n var periodHalfLength;\n // Current series SVG element\n var seriesElement;\n\n // We need to set periodHalfLength based on some options combinations\n if (options.distributeSeries && !options.stackBars) {\n // If distributed series are enabled but stacked bars aren't, we need to use the length of the normaizedData array\n // which is the series count and divide by 2\n periodHalfLength = labelAxis.axisLength / data.normalized.length / 2;\n } else if (options.distributeSeries && options.stackBars) {\n // If distributed series and stacked bars are enabled we'll only get one bar so we should just divide the axis\n // length by 2\n periodHalfLength = labelAxis.axisLength / 2;\n } else {\n // On regular bar charts we should just use the series length\n periodHalfLength = labelAxis.axisLength / data.normalized[seriesIndex].length / 2;\n }\n\n // Adding the series group to the series element\n seriesElement = seriesGroup.elem('g');\n\n // Write attributes to series group element. If series name or meta is undefined the attributes will not be written\n seriesElement.attr({\n 'ct:series-name': series.name,\n 'ct:meta': Chartist.serialize(series.meta)\n });\n\n // Use series class from series data or if not set generate one\n seriesElement.addClass([\n options.classNames.series,\n (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex))\n ].join(' '));\n\n data.normalized[seriesIndex].forEach(function (value, valueIndex) {\n var projected,\n bar,\n previousStack,\n labelAxisValueIndex;\n\n // We need to set labelAxisValueIndex based on some options combinations\n if (options.distributeSeries && !options.stackBars) {\n // If distributed series are enabled but stacked bars aren't, we can use the seriesIndex for later projection\n // on the step axis for label positioning\n labelAxisValueIndex = seriesIndex;\n } else if (options.distributeSeries && options.stackBars) {\n // If distributed series and stacked bars are enabled, we will only get one bar and therefore always use\n // 0 for projection on the label step axis\n labelAxisValueIndex = 0;\n } else {\n // On regular bar charts we just use the value index to project on the label step axis\n labelAxisValueIndex = valueIndex;\n }\n\n // We need to transform coordinates differently based on the chart layout\n if (options.horizontalBars) {\n projected = {\n x: chartRect.x1 + valueAxis.projectValue(value && value.x ? value.x : 0, valueIndex, data.normalized[seriesIndex]),\n y: chartRect.y1 - labelAxis.projectValue(value && value.y ? value.y : 0, labelAxisValueIndex, data.normalized[seriesIndex])\n };\n } else {\n projected = {\n x: chartRect.x1 + labelAxis.projectValue(value && value.x ? value.x : 0, labelAxisValueIndex, data.normalized[seriesIndex]),\n y: chartRect.y1 - valueAxis.projectValue(value && value.y ? value.y : 0, valueIndex, data.normalized[seriesIndex])\n }\n }\n\n // If the label axis is a step based axis we will offset the bar into the middle of between two steps using\n // the periodHalfLength value. Also we do arrange the different series so that they align up to each other using\n // the seriesBarDistance. If we don't have a step axis, the bar positions can be chosen freely so we should not\n // add any automated positioning.\n if (labelAxis instanceof Chartist.StepAxis) {\n // Offset to center bar between grid lines, but only if the step axis is not stretched\n if (!labelAxis.options.stretch) {\n projected[labelAxis.units.pos] += periodHalfLength * (options.horizontalBars ? -1 : 1);\n }\n // Using bi-polar offset for multiple series if no stacked bars or series distribution is used\n projected[labelAxis.units.pos] += (options.stackBars || options.distributeSeries) ? 0 : biPol * options.seriesBarDistance * (options.horizontalBars ? -1 : 1);\n }\n\n // Enter value in stacked bar values used to remember previous screen value for stacking up bars\n previousStack = stackedBarValues[valueIndex] || zeroPoint;\n stackedBarValues[valueIndex] = previousStack - (zeroPoint - projected[labelAxis.counterUnits.pos]);\n\n // Skip if value is undefined\n if (value === undefined) {\n return;\n }\n\n var positions = {};\n positions[labelAxis.units.pos + '1'] = projected[labelAxis.units.pos];\n positions[labelAxis.units.pos + '2'] = projected[labelAxis.units.pos];\n\n if (options.stackBars && (options.stackMode === 'accumulate' || !options.stackMode)) {\n // Stack mode: accumulate (default)\n // If bars are stacked we use the stackedBarValues reference and otherwise base all bars off the zero line\n // We want backwards compatibility, so the expected fallback without the 'stackMode' option\n // to be the original behaviour (accumulate)\n positions[labelAxis.counterUnits.pos + '1'] = previousStack;\n positions[labelAxis.counterUnits.pos + '2'] = stackedBarValues[valueIndex];\n } else {\n // Draw from the zero line normally\n // This is also the same code for Stack mode: overlap\n positions[labelAxis.counterUnits.pos + '1'] = zeroPoint;\n positions[labelAxis.counterUnits.pos + '2'] = projected[labelAxis.counterUnits.pos];\n }\n\n // Limit x and y so that they are within the chart rect\n positions.x1 = Math.min(Math.max(positions.x1, chartRect.x1), chartRect.x2);\n positions.x2 = Math.min(Math.max(positions.x2, chartRect.x1), chartRect.x2);\n positions.y1 = Math.min(Math.max(positions.y1, chartRect.y2), chartRect.y1);\n positions.y2 = Math.min(Math.max(positions.y2, chartRect.y2), chartRect.y1);\n\n // Create bar element\n bar = seriesElement.elem('line', positions, options.classNames.bar).attr({\n 'ct:value': [value.x, value.y].filter(Chartist.isNum).join(','),\n 'ct:meta': Chartist.getMetaData(series, valueIndex)\n });\n\n this.eventEmitter.emit('draw', Chartist.extend({\n type: 'bar',\n value: value,\n index: valueIndex,\n meta: Chartist.getMetaData(series, valueIndex),\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n chartRect: chartRect,\n group: seriesElement,\n element: bar\n }, positions));\n }.bind(this));\n }.bind(this));\n\n this.eventEmitter.emit('created', {\n bounds: valueAxis.bounds,\n chartRect: chartRect,\n axisX: axisX,\n axisY: axisY,\n svg: this.svg,\n options: options\n });\n }", "function createChart(options) {\n\t this.data = Chartist.normalizeData(this.data);\n\t var data = {\n\t raw: this.data,\n\t normalized: options.distributeSeries ? Chartist.getDataArray(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y').map(function(value) {\n\t return [value];\n\t }) : Chartist.getDataArray(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y')\n\t };\n\t\n\t var highLow;\n\t\n\t // Create new svg element\n\t this.svg = Chartist.createSvg(\n\t this.container,\n\t options.width,\n\t options.height,\n\t options.classNames.chart + (options.horizontalBars ? ' ' + options.classNames.horizontalBars : '')\n\t );\n\t\n\t // Drawing groups in correct order\n\t var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup);\n\t var seriesGroup = this.svg.elem('g');\n\t var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup);\n\t\n\t if(options.stackBars && data.normalized.length !== 0) {\n\t // If stacked bars we need to calculate the high low from stacked values from each series\n\t var serialSums = Chartist.serialMap(data.normalized, function serialSums() {\n\t return Array.prototype.slice.call(arguments).map(function(value) {\n\t return value;\n\t }).reduce(function(prev, curr) {\n\t return {\n\t x: prev.x + (curr && curr.x) || 0,\n\t y: prev.y + (curr && curr.y) || 0\n\t };\n\t }, {x: 0, y: 0});\n\t });\n\t\n\t highLow = Chartist.getHighLow([serialSums], Chartist.extend({}, options, {\n\t referenceValue: 0\n\t }), options.horizontalBars ? 'x' : 'y');\n\t } else {\n\t highLow = Chartist.getHighLow(data.normalized, Chartist.extend({}, options, {\n\t referenceValue: 0\n\t }), options.horizontalBars ? 'x' : 'y');\n\t }\n\t // Overrides of high / low from settings\n\t highLow.high = +options.high || (options.high === 0 ? 0 : highLow.high);\n\t highLow.low = +options.low || (options.low === 0 ? 0 : highLow.low);\n\t\n\t var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);\n\t\n\t var valueAxis,\n\t labelAxisTicks,\n\t labelAxis,\n\t axisX,\n\t axisY;\n\t\n\t // We need to set step count based on some options combinations\n\t if(options.distributeSeries && options.stackBars) {\n\t // If distributed series are enabled and bars need to be stacked, we'll only have one bar and therefore should\n\t // use only the first label for the step axis\n\t labelAxisTicks = data.raw.labels.slice(0, 1);\n\t } else {\n\t // If distributed series are enabled but stacked bars aren't, we should use the series labels\n\t // If we are drawing a regular bar chart with two dimensional series data, we just use the labels array\n\t // as the bars are normalized\n\t labelAxisTicks = data.raw.labels;\n\t }\n\t\n\t // Set labelAxis and valueAxis based on the horizontalBars setting. This setting will flip the axes if necessary.\n\t if(options.horizontalBars) {\n\t if(options.axisX.type === undefined) {\n\t valueAxis = axisX = new Chartist.AutoScaleAxis(Chartist.Axis.units.x, data, chartRect, Chartist.extend({}, options.axisX, {\n\t highLow: highLow,\n\t referenceValue: 0\n\t }));\n\t } else {\n\t valueAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data, chartRect, Chartist.extend({}, options.axisX, {\n\t highLow: highLow,\n\t referenceValue: 0\n\t }));\n\t }\n\t\n\t if(options.axisY.type === undefined) {\n\t labelAxis = axisY = new Chartist.StepAxis(Chartist.Axis.units.y, data, chartRect, {\n\t ticks: labelAxisTicks\n\t });\n\t } else {\n\t labelAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data, chartRect, options.axisY);\n\t }\n\t } else {\n\t if(options.axisX.type === undefined) {\n\t labelAxis = axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data, chartRect, {\n\t ticks: labelAxisTicks\n\t });\n\t } else {\n\t labelAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data, chartRect, options.axisX);\n\t }\n\t\n\t if(options.axisY.type === undefined) {\n\t valueAxis = axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data, chartRect, Chartist.extend({}, options.axisY, {\n\t highLow: highLow,\n\t referenceValue: 0\n\t }));\n\t } else {\n\t valueAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data, chartRect, Chartist.extend({}, options.axisY, {\n\t highLow: highLow,\n\t referenceValue: 0\n\t }));\n\t }\n\t }\n\t\n\t // Projected 0 point\n\t var zeroPoint = options.horizontalBars ? (chartRect.x1 + valueAxis.projectValue(0)) : (chartRect.y1 - valueAxis.projectValue(0));\n\t // Used to track the screen coordinates of stacked bars\n\t var stackedBarValues = [];\n\t\n\t labelAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n\t valueAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n\t\n\t // Draw the series\n\t data.raw.series.forEach(function(series, seriesIndex) {\n\t // Calculating bi-polar value of index for seriesOffset. For i = 0..4 biPol will be -1.5, -0.5, 0.5, 1.5 etc.\n\t var biPol = seriesIndex - (data.raw.series.length - 1) / 2;\n\t // Half of the period width between vertical grid lines used to position bars\n\t var periodHalfLength;\n\t // Current series SVG element\n\t var seriesElement;\n\t\n\t // We need to set periodHalfLength based on some options combinations\n\t if(options.distributeSeries && !options.stackBars) {\n\t // If distributed series are enabled but stacked bars aren't, we need to use the length of the normaizedData array\n\t // which is the series count and divide by 2\n\t periodHalfLength = labelAxis.axisLength / data.normalized.length / 2;\n\t } else if(options.distributeSeries && options.stackBars) {\n\t // If distributed series and stacked bars are enabled we'll only get one bar so we should just divide the axis\n\t // length by 2\n\t periodHalfLength = labelAxis.axisLength / 2;\n\t } else {\n\t // On regular bar charts we should just use the series length\n\t periodHalfLength = labelAxis.axisLength / data.normalized[seriesIndex].length / 2;\n\t }\n\t\n\t // Adding the series group to the series element\n\t seriesElement = seriesGroup.elem('g');\n\t\n\t // Write attributes to series group element. If series name or meta is undefined the attributes will not be written\n\t seriesElement.attr({\n\t 'ct:series-name': series.name,\n\t 'ct:meta': Chartist.serialize(series.meta)\n\t });\n\t\n\t // Use series class from series data or if not set generate one\n\t seriesElement.addClass([\n\t options.classNames.series,\n\t (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex))\n\t ].join(' '));\n\t\n\t data.normalized[seriesIndex].forEach(function(value, valueIndex) {\n\t var projected,\n\t bar,\n\t previousStack,\n\t labelAxisValueIndex;\n\t\n\t // We need to set labelAxisValueIndex based on some options combinations\n\t if(options.distributeSeries && !options.stackBars) {\n\t // If distributed series are enabled but stacked bars aren't, we can use the seriesIndex for later projection\n\t // on the step axis for label positioning\n\t labelAxisValueIndex = seriesIndex;\n\t } else if(options.distributeSeries && options.stackBars) {\n\t // If distributed series and stacked bars are enabled, we will only get one bar and therefore always use\n\t // 0 for projection on the label step axis\n\t labelAxisValueIndex = 0;\n\t } else {\n\t // On regular bar charts we just use the value index to project on the label step axis\n\t labelAxisValueIndex = valueIndex;\n\t }\n\t\n\t // We need to transform coordinates differently based on the chart layout\n\t if(options.horizontalBars) {\n\t projected = {\n\t x: chartRect.x1 + valueAxis.projectValue(value && value.x ? value.x : 0, valueIndex, data.normalized[seriesIndex]),\n\t y: chartRect.y1 - labelAxis.projectValue(value && value.y ? value.y : 0, labelAxisValueIndex, data.normalized[seriesIndex])\n\t };\n\t } else {\n\t projected = {\n\t x: chartRect.x1 + labelAxis.projectValue(value && value.x ? value.x : 0, labelAxisValueIndex, data.normalized[seriesIndex]),\n\t y: chartRect.y1 - valueAxis.projectValue(value && value.y ? value.y : 0, valueIndex, data.normalized[seriesIndex])\n\t }\n\t }\n\t\n\t // If the label axis is a step based axis we will offset the bar into the middle of between two steps using\n\t // the periodHalfLength value. Also we do arrange the different series so that they align up to each other using\n\t // the seriesBarDistance. If we don't have a step axis, the bar positions can be chosen freely so we should not\n\t // add any automated positioning.\n\t if(labelAxis instanceof Chartist.StepAxis) {\n\t // Offset to center bar between grid lines, but only if the step axis is not stretched\n\t if(!labelAxis.options.stretch) {\n\t projected[labelAxis.units.pos] += periodHalfLength * (options.horizontalBars ? -1 : 1);\n\t }\n\t // Using bi-polar offset for multiple series if no stacked bars or series distribution is used\n\t projected[labelAxis.units.pos] += (options.stackBars || options.distributeSeries) ? 0 : biPol * options.seriesBarDistance * (options.horizontalBars ? -1 : 1);\n\t }\n\t\n\t // Enter value in stacked bar values used to remember previous screen value for stacking up bars\n\t previousStack = stackedBarValues[valueIndex] || zeroPoint;\n\t stackedBarValues[valueIndex] = previousStack - (zeroPoint - projected[labelAxis.counterUnits.pos]);\n\t\n\t // Skip if value is undefined\n\t if(value === undefined) {\n\t return;\n\t }\n\t\n\t var positions = {};\n\t positions[labelAxis.units.pos + '1'] = projected[labelAxis.units.pos];\n\t positions[labelAxis.units.pos + '2'] = projected[labelAxis.units.pos];\n\t\n\t if(options.stackBars && (options.stackMode === 'accumulate' || !options.stackMode)) {\n\t // Stack mode: accumulate (default)\n\t // If bars are stacked we use the stackedBarValues reference and otherwise base all bars off the zero line\n\t // We want backwards compatibility, so the expected fallback without the 'stackMode' option\n\t // to be the original behaviour (accumulate)\n\t positions[labelAxis.counterUnits.pos + '1'] = previousStack;\n\t positions[labelAxis.counterUnits.pos + '2'] = stackedBarValues[valueIndex];\n\t } else {\n\t // Draw from the zero line normally\n\t // This is also the same code for Stack mode: overlap\n\t positions[labelAxis.counterUnits.pos + '1'] = zeroPoint;\n\t positions[labelAxis.counterUnits.pos + '2'] = projected[labelAxis.counterUnits.pos];\n\t }\n\t\n\t // Limit x and y so that they are within the chart rect\n\t positions.x1 = Math.min(Math.max(positions.x1, chartRect.x1), chartRect.x2);\n\t positions.x2 = Math.min(Math.max(positions.x2, chartRect.x1), chartRect.x2);\n\t positions.y1 = Math.min(Math.max(positions.y1, chartRect.y2), chartRect.y1);\n\t positions.y2 = Math.min(Math.max(positions.y2, chartRect.y2), chartRect.y1);\n\t\n\t // Create bar element\n\t bar = seriesElement.elem('line', positions, options.classNames.bar).attr({\n\t 'ct:value': [value.x, value.y].filter(Chartist.isNum).join(','),\n\t 'ct:meta': Chartist.getMetaData(series, valueIndex)\n\t });\n\t\n\t this.eventEmitter.emit('draw', Chartist.extend({\n\t type: 'bar',\n\t value: value,\n\t index: valueIndex,\n\t meta: Chartist.getMetaData(series, valueIndex),\n\t series: series,\n\t seriesIndex: seriesIndex,\n\t axisX: axisX,\n\t axisY: axisY,\n\t chartRect: chartRect,\n\t group: seriesElement,\n\t element: bar\n\t }, positions));\n\t }.bind(this));\n\t }.bind(this));\n\t\n\t this.eventEmitter.emit('created', {\n\t bounds: valueAxis.bounds,\n\t chartRect: chartRect,\n\t axisX: axisX,\n\t axisY: axisY,\n\t svg: this.svg,\n\t options: options\n\t });\n\t }", "function verticalGridlines() {\n return d3.axisBottom(lineChart.xAxis)\n .ticks(lineChart.years.length)\n}", "function createChart(options) {\n var data;\n var highLow;\n\n if (options.distributeSeries) {\n data = Chartist.normalizeData(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y');\n data.normalized.series = data.normalized.series.map(function (value) {\n return [value];\n });\n } else {\n data = Chartist.normalizeData(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y');\n }\n\n // Create new svg element\n this.svg = Chartist.createSvg(\n this.container,\n options.width,\n options.height,\n options.classNames.chart + (options.horizontalBars ? ' ' + options.classNames.horizontalBars : '')\n );\n\n // Drawing groups in correct order\n var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup);\n var seriesGroup = this.svg.elem('g');\n var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup);\n\n if (options.stackBars && data.normalized.series.length !== 0) {\n\n // If stacked bars we need to calculate the high low from stacked values from each series\n var serialSums = Chartist.serialMap(data.normalized.series, function serialSums() {\n return Array.prototype.slice.call(arguments).map(function (value) {\n return value;\n }).reduce(function (prev, curr) {\n return {\n x: prev.x + (curr && curr.x) || 0,\n y: prev.y + (curr && curr.y) || 0\n };\n }, {x: 0, y: 0});\n });\n\n highLow = Chartist.getHighLow([serialSums], options, options.horizontalBars ? 'x' : 'y');\n\n } else {\n\n highLow = Chartist.getHighLow(data.normalized.series, options, options.horizontalBars ? 'x' : 'y');\n }\n\n // Overrides of high / low from settings\n highLow.high = +options.high || (options.high === 0 ? 0 : highLow.high);\n highLow.low = +options.low || (options.low === 0 ? 0 : highLow.low);\n\n var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);\n\n var valueAxis,\n labelAxisTicks,\n labelAxis,\n axisX,\n axisY;\n\n // We need to set step count based on some options combinations\n if (options.distributeSeries && options.stackBars) {\n // If distributed series are enabled and bars need to be stacked, we'll only have one bar and therefore should\n // use only the first label for the step axis\n labelAxisTicks = data.normalized.labels.slice(0, 1);\n } else {\n // If distributed series are enabled but stacked bars aren't, we should use the series labels\n // If we are drawing a regular bar chart with two dimensional series data, we just use the labels array\n // as the bars are normalized\n labelAxisTicks = data.normalized.labels;\n }\n\n // Set labelAxis and valueAxis based on the horizontalBars setting. This setting will flip the axes if necessary.\n if (options.horizontalBars) {\n if (options.axisX.type === undefined) {\n valueAxis = axisX = new Chartist.AutoScaleAxis(Chartist.Axis.units.x, data.normalized.series, chartRect, Chartist.extend({}, options.axisX, {\n highLow: highLow,\n referenceValue: 0\n }));\n } else {\n valueAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data.normalized.series, chartRect, Chartist.extend({}, options.axisX, {\n highLow: highLow,\n referenceValue: 0\n }));\n }\n\n if (options.axisY.type === undefined) {\n labelAxis = axisY = new Chartist.StepAxis(Chartist.Axis.units.y, data.normalized.series, chartRect, {\n ticks: labelAxisTicks\n });\n } else {\n labelAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data.normalized.series, chartRect, options.axisY);\n }\n } else {\n if (options.axisX.type === undefined) {\n labelAxis = axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data.normalized.series, chartRect, {\n ticks: labelAxisTicks\n });\n } else {\n labelAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data.normalized.series, chartRect, options.axisX);\n }\n\n if (options.axisY.type === undefined) {\n valueAxis = axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data.normalized.series, chartRect, Chartist.extend({}, options.axisY, {\n highLow: highLow,\n referenceValue: 0\n }));\n } else {\n valueAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data.normalized.series, chartRect, Chartist.extend({}, options.axisY, {\n highLow: highLow,\n referenceValue: 0\n }));\n }\n }\n\n // Projected 0 point\n var zeroPoint = options.horizontalBars ? (chartRect.x1 + valueAxis.projectValue(0)) : (chartRect.y1 - valueAxis.projectValue(0));\n // Used to track the screen coordinates of stacked bars\n var stackedBarValues = [];\n\n labelAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n valueAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n\n if (options.showGridBackground) {\n Chartist.createGridBackground(gridGroup, chartRect, options.classNames.gridBackground, this.eventEmitter);\n }\n\n // Draw the series\n data.raw.series.forEach(function (series, seriesIndex) {\n // Calculating bi-polar value of index for seriesOffset. For i = 0..4 biPol will be -1.5, -0.5, 0.5, 1.5 etc.\n var biPol = seriesIndex - (data.raw.series.length - 1) / 2;\n // Half of the period width between vertical grid lines used to position bars\n var periodHalfLength;\n // Current series SVG element\n var seriesElement;\n\n // We need to set periodHalfLength based on some options combinations\n if (options.distributeSeries && !options.stackBars) {\n // If distributed series are enabled but stacked bars aren't, we need to use the length of the normaizedData array\n // which is the series count and divide by 2\n periodHalfLength = labelAxis.axisLength / data.normalized.series.length / 2;\n } else if (options.distributeSeries && options.stackBars) {\n // If distributed series and stacked bars are enabled we'll only get one bar so we should just divide the axis\n // length by 2\n periodHalfLength = labelAxis.axisLength / 2;\n } else {\n // On regular bar charts we should just use the series length\n periodHalfLength = labelAxis.axisLength / data.normalized.series[seriesIndex].length / 2;\n }\n\n // Adding the series group to the series element\n seriesElement = seriesGroup.elem('g');\n\n // Write attributes to series group element. If series name or meta is undefined the attributes will not be written\n seriesElement.attr({\n 'ct:series-name': series.name,\n 'ct:meta': Chartist.serialize(series.meta)\n });\n\n // Use series class from series data or if not set generate one\n seriesElement.addClass([\n options.classNames.series,\n (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex))\n ].join(' '));\n\n data.normalized.series[seriesIndex].forEach(function (value, valueIndex) {\n var projected,\n bar,\n previousStack,\n labelAxisValueIndex;\n\n // We need to set labelAxisValueIndex based on some options combinations\n if (options.distributeSeries && !options.stackBars) {\n // If distributed series are enabled but stacked bars aren't, we can use the seriesIndex for later projection\n // on the step axis for label positioning\n labelAxisValueIndex = seriesIndex;\n } else if (options.distributeSeries && options.stackBars) {\n // If distributed series and stacked bars are enabled, we will only get one bar and therefore always use\n // 0 for projection on the label step axis\n labelAxisValueIndex = 0;\n } else {\n // On regular bar charts we just use the value index to project on the label step axis\n labelAxisValueIndex = valueIndex;\n }\n\n // We need to transform coordinates differently based on the chart layout\n if (options.horizontalBars) {\n projected = {\n x: chartRect.x1 + valueAxis.projectValue(value && value.x ? value.x : 0, valueIndex, data.normalized.series[seriesIndex]),\n y: chartRect.y1 - labelAxis.projectValue(value && value.y ? value.y : 0, labelAxisValueIndex, data.normalized.series[seriesIndex])\n };\n } else {\n projected = {\n x: chartRect.x1 + labelAxis.projectValue(value && value.x ? value.x : 0, labelAxisValueIndex, data.normalized.series[seriesIndex]),\n y: chartRect.y1 - valueAxis.projectValue(value && value.y ? value.y : 0, valueIndex, data.normalized.series[seriesIndex])\n }\n }\n\n // If the label axis is a step based axis we will offset the bar into the middle of between two steps using\n // the periodHalfLength value. Also we do arrange the different series so that they align up to each other using\n // the seriesBarDistance. If we don't have a step axis, the bar positions can be chosen freely so we should not\n // add any automated positioning.\n if (labelAxis instanceof Chartist.StepAxis) {\n // Offset to center bar between grid lines, but only if the step axis is not stretched\n if (!labelAxis.options.stretch) {\n projected[labelAxis.units.pos] += periodHalfLength * (options.horizontalBars ? -1 : 1);\n }\n // Using bi-polar offset for multiple series if no stacked bars or series distribution is used\n projected[labelAxis.units.pos] += (options.stackBars || options.distributeSeries) ? 0 : biPol * options.seriesBarDistance * (options.horizontalBars ? -1 : 1);\n }\n\n // Enter value in stacked bar values used to remember previous screen value for stacking up bars\n previousStack = stackedBarValues[valueIndex] || zeroPoint;\n stackedBarValues[valueIndex] = previousStack - (zeroPoint - projected[labelAxis.counterUnits.pos]);\n\n // Skip if value is undefined\n if (value === undefined) {\n return;\n }\n\n var positions = {};\n positions[labelAxis.units.pos + '1'] = projected[labelAxis.units.pos];\n positions[labelAxis.units.pos + '2'] = projected[labelAxis.units.pos];\n\n if (options.stackBars && (options.stackMode === 'accumulate' || !options.stackMode)) {\n // Stack mode: accumulate (default)\n // If bars are stacked we use the stackedBarValues reference and otherwise base all bars off the zero line\n // We want backwards compatibility, so the expected fallback without the 'stackMode' option\n // to be the original behaviour (accumulate)\n positions[labelAxis.counterUnits.pos + '1'] = previousStack;\n positions[labelAxis.counterUnits.pos + '2'] = stackedBarValues[valueIndex];\n } else {\n // Draw from the zero line normally\n // This is also the same code for Stack mode: overlap\n positions[labelAxis.counterUnits.pos + '1'] = zeroPoint;\n positions[labelAxis.counterUnits.pos + '2'] = projected[labelAxis.counterUnits.pos];\n }\n\n // Limit x and y so that they are within the chart rect\n positions.x1 = Math.min(Math.max(positions.x1, chartRect.x1), chartRect.x2);\n positions.x2 = Math.min(Math.max(positions.x2, chartRect.x1), chartRect.x2);\n positions.y1 = Math.min(Math.max(positions.y1, chartRect.y2), chartRect.y1);\n positions.y2 = Math.min(Math.max(positions.y2, chartRect.y2), chartRect.y1);\n\n var metaData = Chartist.getMetaData(series, valueIndex);\n\n // Create bar element\n bar = seriesElement.elem('line', positions, options.classNames.bar).attr({\n 'ct:value': [value.x, value.y].filter(Chartist.isNumeric).join(','),\n 'ct:meta': Chartist.serialize(metaData)\n });\n\n this.eventEmitter.emit('draw', Chartist.extend({\n type: 'bar',\n value: value,\n index: valueIndex,\n meta: metaData,\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n chartRect: chartRect,\n group: seriesElement,\n element: bar\n }, positions));\n }.bind(this));\n }.bind(this));\n\n this.eventEmitter.emit('created', {\n bounds: valueAxis.bounds,\n chartRect: chartRect,\n axisX: axisX,\n axisY: axisY,\n svg: this.svg,\n options: options\n });\n }", "function createChart(options) {\n var data;\n var highLow;\n\n if(options.distributeSeries) {\n data = Chartist.normalizeData(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y');\n data.normalized.series = data.normalized.series.map(function(value) {\n return [value];\n });\n } else {\n data = Chartist.normalizeData(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y');\n }\n\n // Create new svg element\n this.svg = Chartist.createSvg(\n this.container,\n options.width,\n options.height,\n options.classNames.chart + (options.horizontalBars ? ' ' + options.classNames.horizontalBars : '')\n );\n\n // Drawing groups in correct order\n var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup);\n var seriesGroup = this.svg.elem('g');\n var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup);\n\n if(options.stackBars && data.normalized.series.length !== 0) {\n\n // If stacked bars we need to calculate the high low from stacked values from each series\n var serialSums = Chartist.serialMap(data.normalized.series, function serialSums() {\n return Array.prototype.slice.call(arguments).map(function(value) {\n return value;\n }).reduce(function(prev, curr) {\n return {\n x: prev.x + (curr && curr.x) || 0,\n y: prev.y + (curr && curr.y) || 0\n };\n }, {x: 0, y: 0});\n });\n\n highLow = Chartist.getHighLow([serialSums], options, options.horizontalBars ? 'x' : 'y');\n\n } else {\n\n highLow = Chartist.getHighLow(data.normalized.series, options, options.horizontalBars ? 'x' : 'y');\n }\n\n // Overrides of high / low from settings\n highLow.high = +options.high || (options.high === 0 ? 0 : highLow.high);\n highLow.low = +options.low || (options.low === 0 ? 0 : highLow.low);\n\n var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);\n\n var valueAxis,\n labelAxisTicks,\n labelAxis,\n axisX,\n axisY;\n\n // We need to set step count based on some options combinations\n if(options.distributeSeries && options.stackBars) {\n // If distributed series are enabled and bars need to be stacked, we'll only have one bar and therefore should\n // use only the first label for the step axis\n labelAxisTicks = data.normalized.labels.slice(0, 1);\n } else {\n // If distributed series are enabled but stacked bars aren't, we should use the series labels\n // If we are drawing a regular bar chart with two dimensional series data, we just use the labels array\n // as the bars are normalized\n labelAxisTicks = data.normalized.labels;\n }\n\n // Set labelAxis and valueAxis based on the horizontalBars setting. This setting will flip the axes if necessary.\n if(options.horizontalBars) {\n if(options.axisX.type === undefined) {\n valueAxis = axisX = new Chartist.AutoScaleAxis(Chartist.Axis.units.x, data.normalized.series, chartRect, Chartist.extend({}, options.axisX, {\n highLow: highLow,\n referenceValue: 0\n }));\n } else {\n valueAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data.normalized.series, chartRect, Chartist.extend({}, options.axisX, {\n highLow: highLow,\n referenceValue: 0\n }));\n }\n\n if(options.axisY.type === undefined) {\n labelAxis = axisY = new Chartist.StepAxis(Chartist.Axis.units.y, data.normalized.series, chartRect, {\n ticks: labelAxisTicks\n });\n } else {\n labelAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data.normalized.series, chartRect, options.axisY);\n }\n } else {\n if(options.axisX.type === undefined) {\n labelAxis = axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data.normalized.series, chartRect, {\n ticks: labelAxisTicks\n });\n } else {\n labelAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data.normalized.series, chartRect, options.axisX);\n }\n\n if(options.axisY.type === undefined) {\n valueAxis = axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data.normalized.series, chartRect, Chartist.extend({}, options.axisY, {\n highLow: highLow,\n referenceValue: 0\n }));\n } else {\n valueAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data.normalized.series, chartRect, Chartist.extend({}, options.axisY, {\n highLow: highLow,\n referenceValue: 0\n }));\n }\n }\n\n // Projected 0 point\n var zeroPoint = options.horizontalBars ? (chartRect.x1 + valueAxis.projectValue(0)) : (chartRect.y1 - valueAxis.projectValue(0));\n // Used to track the screen coordinates of stacked bars\n var stackedBarValues = [];\n\n labelAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n valueAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n\n if (options.showGridBackground) {\n Chartist.createGridBackground(gridGroup, chartRect, options.classNames.gridBackground, this.eventEmitter);\n }\n\n // Draw the series\n data.raw.series.forEach(function(series, seriesIndex) {\n // Calculating bi-polar value of index for seriesOffset. For i = 0..4 biPol will be -1.5, -0.5, 0.5, 1.5 etc.\n var biPol = seriesIndex - (data.raw.series.length - 1) / 2;\n // Half of the period width between vertical grid lines used to position bars\n var periodHalfLength;\n // Current series SVG element\n var seriesElement;\n\n // We need to set periodHalfLength based on some options combinations\n if(options.distributeSeries && !options.stackBars) {\n // If distributed series are enabled but stacked bars aren't, we need to use the length of the normaizedData array\n // which is the series count and divide by 2\n periodHalfLength = labelAxis.axisLength / data.normalized.series.length / 2;\n } else if(options.distributeSeries && options.stackBars) {\n // If distributed series and stacked bars are enabled we'll only get one bar so we should just divide the axis\n // length by 2\n periodHalfLength = labelAxis.axisLength / 2;\n } else {\n // On regular bar charts we should just use the series length\n periodHalfLength = labelAxis.axisLength / data.normalized.series[seriesIndex].length / 2;\n }\n\n // Adding the series group to the series element\n seriesElement = seriesGroup.elem('g');\n\n // Write attributes to series group element. If series name or meta is undefined the attributes will not be written\n seriesElement.attr({\n 'ct:series-name': series.name,\n 'ct:meta': Chartist.serialize(series.meta)\n });\n\n // Use series class from series data or if not set generate one\n seriesElement.addClass([\n options.classNames.series,\n (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex))\n ].join(' '));\n\n data.normalized.series[seriesIndex].forEach(function(value, valueIndex) {\n var projected,\n bar,\n previousStack,\n labelAxisValueIndex;\n\n // We need to set labelAxisValueIndex based on some options combinations\n if(options.distributeSeries && !options.stackBars) {\n // If distributed series are enabled but stacked bars aren't, we can use the seriesIndex for later projection\n // on the step axis for label positioning\n labelAxisValueIndex = seriesIndex;\n } else if(options.distributeSeries && options.stackBars) {\n // If distributed series and stacked bars are enabled, we will only get one bar and therefore always use\n // 0 for projection on the label step axis\n labelAxisValueIndex = 0;\n } else {\n // On regular bar charts we just use the value index to project on the label step axis\n labelAxisValueIndex = valueIndex;\n }\n\n // We need to transform coordinates differently based on the chart layout\n if(options.horizontalBars) {\n projected = {\n x: chartRect.x1 + valueAxis.projectValue(value && value.x ? value.x : 0, valueIndex, data.normalized.series[seriesIndex]),\n y: chartRect.y1 - labelAxis.projectValue(value && value.y ? value.y : 0, labelAxisValueIndex, data.normalized.series[seriesIndex])\n };\n } else {\n projected = {\n x: chartRect.x1 + labelAxis.projectValue(value && value.x ? value.x : 0, labelAxisValueIndex, data.normalized.series[seriesIndex]),\n y: chartRect.y1 - valueAxis.projectValue(value && value.y ? value.y : 0, valueIndex, data.normalized.series[seriesIndex])\n }\n }\n\n // If the label axis is a step based axis we will offset the bar into the middle of between two steps using\n // the periodHalfLength value. Also we do arrange the different series so that they align up to each other using\n // the seriesBarDistance. If we don't have a step axis, the bar positions can be chosen freely so we should not\n // add any automated positioning.\n if(labelAxis instanceof Chartist.StepAxis) {\n // Offset to center bar between grid lines, but only if the step axis is not stretched\n if(!labelAxis.options.stretch) {\n projected[labelAxis.units.pos] += periodHalfLength * (options.horizontalBars ? -1 : 1);\n }\n // Using bi-polar offset for multiple series if no stacked bars or series distribution is used\n projected[labelAxis.units.pos] += (options.stackBars || options.distributeSeries) ? 0 : biPol * options.seriesBarDistance * (options.horizontalBars ? -1 : 1);\n }\n\n // Enter value in stacked bar values used to remember previous screen value for stacking up bars\n previousStack = stackedBarValues[valueIndex] || zeroPoint;\n stackedBarValues[valueIndex] = previousStack - (zeroPoint - projected[labelAxis.counterUnits.pos]);\n\n // Skip if value is undefined\n if(value === undefined) {\n return;\n }\n\n var positions = {};\n positions[labelAxis.units.pos + '1'] = projected[labelAxis.units.pos];\n positions[labelAxis.units.pos + '2'] = projected[labelAxis.units.pos];\n\n if(options.stackBars && (options.stackMode === 'accumulate' || !options.stackMode)) {\n // Stack mode: accumulate (default)\n // If bars are stacked we use the stackedBarValues reference and otherwise base all bars off the zero line\n // We want backwards compatibility, so the expected fallback without the 'stackMode' option\n // to be the original behaviour (accumulate)\n positions[labelAxis.counterUnits.pos + '1'] = previousStack;\n positions[labelAxis.counterUnits.pos + '2'] = stackedBarValues[valueIndex];\n } else {\n // Draw from the zero line normally\n // This is also the same code for Stack mode: overlap\n positions[labelAxis.counterUnits.pos + '1'] = zeroPoint;\n positions[labelAxis.counterUnits.pos + '2'] = projected[labelAxis.counterUnits.pos];\n }\n\n // Limit x and y so that they are within the chart rect\n positions.x1 = Math.min(Math.max(positions.x1, chartRect.x1), chartRect.x2);\n positions.x2 = Math.min(Math.max(positions.x2, chartRect.x1), chartRect.x2);\n positions.y1 = Math.min(Math.max(positions.y1, chartRect.y2), chartRect.y1);\n positions.y2 = Math.min(Math.max(positions.y2, chartRect.y2), chartRect.y1);\n\n var metaData = Chartist.getMetaData(series, valueIndex);\n\n // Create bar element\n bar = seriesElement.elem('line', positions, options.classNames.bar).attr({\n 'ct:value': [value.x, value.y].filter(Chartist.isNumeric).join(','),\n 'ct:meta': Chartist.serialize(metaData)\n });\n\n this.eventEmitter.emit('draw', Chartist.extend({\n type: 'bar',\n value: value,\n index: valueIndex,\n meta: metaData,\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n chartRect: chartRect,\n group: seriesElement,\n element: bar\n }, positions));\n }.bind(this));\n }.bind(this));\n\n this.eventEmitter.emit('created', {\n bounds: valueAxis.bounds,\n chartRect: chartRect,\n axisX: axisX,\n axisY: axisY,\n svg: this.svg,\n options: options\n });\n }", "function createChart(options) {\n var data;\n var highLow;\n\n if(options.distributeSeries) {\n data = Chartist.normalizeData(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y');\n data.normalized.series = data.normalized.series.map(function(value) {\n return [value];\n });\n } else {\n data = Chartist.normalizeData(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y');\n }\n\n // Create new svg element\n this.svg = Chartist.createSvg(\n this.container,\n options.width,\n options.height,\n options.classNames.chart + (options.horizontalBars ? ' ' + options.classNames.horizontalBars : '')\n );\n\n // Drawing groups in correct order\n var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup);\n var seriesGroup = this.svg.elem('g');\n var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup);\n\n if(options.stackBars && data.normalized.series.length !== 0) {\n\n // If stacked bars we need to calculate the high low from stacked values from each series\n var serialSums = Chartist.serialMap(data.normalized.series, function serialSums() {\n return Array.prototype.slice.call(arguments).map(function(value) {\n return value;\n }).reduce(function(prev, curr) {\n return {\n x: prev.x + (curr && curr.x) || 0,\n y: prev.y + (curr && curr.y) || 0\n };\n }, {x: 0, y: 0});\n });\n\n highLow = Chartist.getHighLow([serialSums], options, options.horizontalBars ? 'x' : 'y');\n\n } else {\n\n highLow = Chartist.getHighLow(data.normalized.series, options, options.horizontalBars ? 'x' : 'y');\n }\n\n // Overrides of high / low from settings\n highLow.high = +options.high || (options.high === 0 ? 0 : highLow.high);\n highLow.low = +options.low || (options.low === 0 ? 0 : highLow.low);\n\n var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);\n\n var valueAxis,\n labelAxisTicks,\n labelAxis,\n axisX,\n axisY;\n\n // We need to set step count based on some options combinations\n if(options.distributeSeries && options.stackBars) {\n // If distributed series are enabled and bars need to be stacked, we'll only have one bar and therefore should\n // use only the first label for the step axis\n labelAxisTicks = data.normalized.labels.slice(0, 1);\n } else {\n // If distributed series are enabled but stacked bars aren't, we should use the series labels\n // If we are drawing a regular bar chart with two dimensional series data, we just use the labels array\n // as the bars are normalized\n labelAxisTicks = data.normalized.labels;\n }\n\n // Set labelAxis and valueAxis based on the horizontalBars setting. This setting will flip the axes if necessary.\n if(options.horizontalBars) {\n if(options.axisX.type === undefined) {\n valueAxis = axisX = new Chartist.AutoScaleAxis(Chartist.Axis.units.x, data.normalized.series, chartRect, Chartist.extend({}, options.axisX, {\n highLow: highLow,\n referenceValue: 0\n }));\n } else {\n valueAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data.normalized.series, chartRect, Chartist.extend({}, options.axisX, {\n highLow: highLow,\n referenceValue: 0\n }));\n }\n\n if(options.axisY.type === undefined) {\n labelAxis = axisY = new Chartist.StepAxis(Chartist.Axis.units.y, data.normalized.series, chartRect, {\n ticks: labelAxisTicks\n });\n } else {\n labelAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data.normalized.series, chartRect, options.axisY);\n }\n } else {\n if(options.axisX.type === undefined) {\n labelAxis = axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data.normalized.series, chartRect, {\n ticks: labelAxisTicks\n });\n } else {\n labelAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data.normalized.series, chartRect, options.axisX);\n }\n\n if(options.axisY.type === undefined) {\n valueAxis = axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data.normalized.series, chartRect, Chartist.extend({}, options.axisY, {\n highLow: highLow,\n referenceValue: 0\n }));\n } else {\n valueAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data.normalized.series, chartRect, Chartist.extend({}, options.axisY, {\n highLow: highLow,\n referenceValue: 0\n }));\n }\n }\n\n // Projected 0 point\n var zeroPoint = options.horizontalBars ? (chartRect.x1 + valueAxis.projectValue(0)) : (chartRect.y1 - valueAxis.projectValue(0));\n // Used to track the screen coordinates of stacked bars\n var stackedBarValues = [];\n\n labelAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n valueAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n\n if (options.showGridBackground) {\n Chartist.createGridBackground(gridGroup, chartRect, options.classNames.gridBackground, this.eventEmitter);\n }\n\n // Draw the series\n data.raw.series.forEach(function(series, seriesIndex) {\n // Calculating bi-polar value of index for seriesOffset. For i = 0..4 biPol will be -1.5, -0.5, 0.5, 1.5 etc.\n var biPol = seriesIndex - (data.raw.series.length - 1) / 2;\n // Half of the period width between vertical grid lines used to position bars\n var periodHalfLength;\n // Current series SVG element\n var seriesElement;\n\n // We need to set periodHalfLength based on some options combinations\n if(options.distributeSeries && !options.stackBars) {\n // If distributed series are enabled but stacked bars aren't, we need to use the length of the normaizedData array\n // which is the series count and divide by 2\n periodHalfLength = labelAxis.axisLength / data.normalized.series.length / 2;\n } else if(options.distributeSeries && options.stackBars) {\n // If distributed series and stacked bars are enabled we'll only get one bar so we should just divide the axis\n // length by 2\n periodHalfLength = labelAxis.axisLength / 2;\n } else {\n // On regular bar charts we should just use the series length\n periodHalfLength = labelAxis.axisLength / data.normalized.series[seriesIndex].length / 2;\n }\n\n // Adding the series group to the series element\n seriesElement = seriesGroup.elem('g');\n\n // Write attributes to series group element. If series name or meta is undefined the attributes will not be written\n seriesElement.attr({\n 'ct:series-name': series.name,\n 'ct:meta': Chartist.serialize(series.meta)\n });\n\n // Use series class from series data or if not set generate one\n seriesElement.addClass([\n options.classNames.series,\n (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex))\n ].join(' '));\n\n data.normalized.series[seriesIndex].forEach(function(value, valueIndex) {\n var projected,\n bar,\n previousStack,\n labelAxisValueIndex;\n\n // We need to set labelAxisValueIndex based on some options combinations\n if(options.distributeSeries && !options.stackBars) {\n // If distributed series are enabled but stacked bars aren't, we can use the seriesIndex for later projection\n // on the step axis for label positioning\n labelAxisValueIndex = seriesIndex;\n } else if(options.distributeSeries && options.stackBars) {\n // If distributed series and stacked bars are enabled, we will only get one bar and therefore always use\n // 0 for projection on the label step axis\n labelAxisValueIndex = 0;\n } else {\n // On regular bar charts we just use the value index to project on the label step axis\n labelAxisValueIndex = valueIndex;\n }\n\n // We need to transform coordinates differently based on the chart layout\n if(options.horizontalBars) {\n projected = {\n x: chartRect.x1 + valueAxis.projectValue(value && value.x ? value.x : 0, valueIndex, data.normalized.series[seriesIndex]),\n y: chartRect.y1 - labelAxis.projectValue(value && value.y ? value.y : 0, labelAxisValueIndex, data.normalized.series[seriesIndex])\n };\n } else {\n projected = {\n x: chartRect.x1 + labelAxis.projectValue(value && value.x ? value.x : 0, labelAxisValueIndex, data.normalized.series[seriesIndex]),\n y: chartRect.y1 - valueAxis.projectValue(value && value.y ? value.y : 0, valueIndex, data.normalized.series[seriesIndex])\n }\n }\n\n // If the label axis is a step based axis we will offset the bar into the middle of between two steps using\n // the periodHalfLength value. Also we do arrange the different series so that they align up to each other using\n // the seriesBarDistance. If we don't have a step axis, the bar positions can be chosen freely so we should not\n // add any automated positioning.\n if(labelAxis instanceof Chartist.StepAxis) {\n // Offset to center bar between grid lines, but only if the step axis is not stretched\n if(!labelAxis.options.stretch) {\n projected[labelAxis.units.pos] += periodHalfLength * (options.horizontalBars ? -1 : 1);\n }\n // Using bi-polar offset for multiple series if no stacked bars or series distribution is used\n projected[labelAxis.units.pos] += (options.stackBars || options.distributeSeries) ? 0 : biPol * options.seriesBarDistance * (options.horizontalBars ? -1 : 1);\n }\n\n // Enter value in stacked bar values used to remember previous screen value for stacking up bars\n previousStack = stackedBarValues[valueIndex] || zeroPoint;\n stackedBarValues[valueIndex] = previousStack - (zeroPoint - projected[labelAxis.counterUnits.pos]);\n\n // Skip if value is undefined\n if(value === undefined) {\n return;\n }\n\n var positions = {};\n positions[labelAxis.units.pos + '1'] = projected[labelAxis.units.pos];\n positions[labelAxis.units.pos + '2'] = projected[labelAxis.units.pos];\n\n if(options.stackBars && (options.stackMode === 'accumulate' || !options.stackMode)) {\n // Stack mode: accumulate (default)\n // If bars are stacked we use the stackedBarValues reference and otherwise base all bars off the zero line\n // We want backwards compatibility, so the expected fallback without the 'stackMode' option\n // to be the original behaviour (accumulate)\n positions[labelAxis.counterUnits.pos + '1'] = previousStack;\n positions[labelAxis.counterUnits.pos + '2'] = stackedBarValues[valueIndex];\n } else {\n // Draw from the zero line normally\n // This is also the same code for Stack mode: overlap\n positions[labelAxis.counterUnits.pos + '1'] = zeroPoint;\n positions[labelAxis.counterUnits.pos + '2'] = projected[labelAxis.counterUnits.pos];\n }\n\n // Limit x and y so that they are within the chart rect\n positions.x1 = Math.min(Math.max(positions.x1, chartRect.x1), chartRect.x2);\n positions.x2 = Math.min(Math.max(positions.x2, chartRect.x1), chartRect.x2);\n positions.y1 = Math.min(Math.max(positions.y1, chartRect.y2), chartRect.y1);\n positions.y2 = Math.min(Math.max(positions.y2, chartRect.y2), chartRect.y1);\n\n var metaData = Chartist.getMetaData(series, valueIndex);\n\n // Create bar element\n bar = seriesElement.elem('line', positions, options.classNames.bar).attr({\n 'ct:value': [value.x, value.y].filter(Chartist.isNumeric).join(','),\n 'ct:meta': Chartist.serialize(metaData)\n });\n\n this.eventEmitter.emit('draw', Chartist.extend({\n type: 'bar',\n value: value,\n index: valueIndex,\n meta: metaData,\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n chartRect: chartRect,\n group: seriesElement,\n element: bar\n }, positions));\n }.bind(this));\n }.bind(this));\n\n this.eventEmitter.emit('created', {\n bounds: valueAxis.bounds,\n chartRect: chartRect,\n axisX: axisX,\n axisY: axisY,\n svg: this.svg,\n options: options\n });\n }", "function createChart(options) {\n var data;\n var highLow;\n\n if(options.distributeSeries) {\n data = Chartist.normalizeData(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y');\n data.normalized.series = data.normalized.series.map(function(value) {\n return [value];\n });\n } else {\n data = Chartist.normalizeData(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y');\n }\n\n // Create new svg element\n this.svg = Chartist.createSvg(\n this.container,\n options.width,\n options.height,\n options.classNames.chart + (options.horizontalBars ? ' ' + options.classNames.horizontalBars : '')\n );\n\n // Drawing groups in correct order\n var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup);\n var seriesGroup = this.svg.elem('g');\n var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup);\n\n if(options.stackBars && data.normalized.series.length !== 0) {\n\n // If stacked bars we need to calculate the high low from stacked values from each series\n var serialSums = Chartist.serialMap(data.normalized.series, function serialSums() {\n return Array.prototype.slice.call(arguments).map(function(value) {\n return value;\n }).reduce(function(prev, curr) {\n return {\n x: prev.x + (curr && curr.x) || 0,\n y: prev.y + (curr && curr.y) || 0\n };\n }, {x: 0, y: 0});\n });\n\n highLow = Chartist.getHighLow([serialSums], options, options.horizontalBars ? 'x' : 'y');\n\n } else {\n\n highLow = Chartist.getHighLow(data.normalized.series, options, options.horizontalBars ? 'x' : 'y');\n }\n\n // Overrides of high / low from settings\n highLow.high = +options.high || (options.high === 0 ? 0 : highLow.high);\n highLow.low = +options.low || (options.low === 0 ? 0 : highLow.low);\n\n var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);\n\n var valueAxis,\n labelAxisTicks,\n labelAxis,\n axisX,\n axisY;\n\n // We need to set step count based on some options combinations\n if(options.distributeSeries && options.stackBars) {\n // If distributed series are enabled and bars need to be stacked, we'll only have one bar and therefore should\n // use only the first label for the step axis\n labelAxisTicks = data.normalized.labels.slice(0, 1);\n } else {\n // If distributed series are enabled but stacked bars aren't, we should use the series labels\n // If we are drawing a regular bar chart with two dimensional series data, we just use the labels array\n // as the bars are normalized\n labelAxisTicks = data.normalized.labels;\n }\n\n // Set labelAxis and valueAxis based on the horizontalBars setting. This setting will flip the axes if necessary.\n if(options.horizontalBars) {\n if(options.axisX.type === undefined) {\n valueAxis = axisX = new Chartist.AutoScaleAxis(Chartist.Axis.units.x, data.normalized.series, chartRect, Chartist.extend({}, options.axisX, {\n highLow: highLow,\n referenceValue: 0\n }));\n } else {\n valueAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data.normalized.series, chartRect, Chartist.extend({}, options.axisX, {\n highLow: highLow,\n referenceValue: 0\n }));\n }\n\n if(options.axisY.type === undefined) {\n labelAxis = axisY = new Chartist.StepAxis(Chartist.Axis.units.y, data.normalized.series, chartRect, {\n ticks: labelAxisTicks\n });\n } else {\n labelAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data.normalized.series, chartRect, options.axisY);\n }\n } else {\n if(options.axisX.type === undefined) {\n labelAxis = axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data.normalized.series, chartRect, {\n ticks: labelAxisTicks\n });\n } else {\n labelAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data.normalized.series, chartRect, options.axisX);\n }\n\n if(options.axisY.type === undefined) {\n valueAxis = axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data.normalized.series, chartRect, Chartist.extend({}, options.axisY, {\n highLow: highLow,\n referenceValue: 0\n }));\n } else {\n valueAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data.normalized.series, chartRect, Chartist.extend({}, options.axisY, {\n highLow: highLow,\n referenceValue: 0\n }));\n }\n }\n\n // Projected 0 point\n var zeroPoint = options.horizontalBars ? (chartRect.x1 + valueAxis.projectValue(0)) : (chartRect.y1 - valueAxis.projectValue(0));\n // Used to track the screen coordinates of stacked bars\n var stackedBarValues = [];\n\n labelAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n valueAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n\n if (options.showGridBackground) {\n Chartist.createGridBackground(gridGroup, chartRect, options.classNames.gridBackground, this.eventEmitter);\n }\n\n // Draw the series\n data.raw.series.forEach(function(series, seriesIndex) {\n // Calculating bi-polar value of index for seriesOffset. For i = 0..4 biPol will be -1.5, -0.5, 0.5, 1.5 etc.\n var biPol = seriesIndex - (data.raw.series.length - 1) / 2;\n // Half of the period width between vertical grid lines used to position bars\n var periodHalfLength;\n // Current series SVG element\n var seriesElement;\n\n // We need to set periodHalfLength based on some options combinations\n if(options.distributeSeries && !options.stackBars) {\n // If distributed series are enabled but stacked bars aren't, we need to use the length of the normaizedData array\n // which is the series count and divide by 2\n periodHalfLength = labelAxis.axisLength / data.normalized.series.length / 2;\n } else if(options.distributeSeries && options.stackBars) {\n // If distributed series and stacked bars are enabled we'll only get one bar so we should just divide the axis\n // length by 2\n periodHalfLength = labelAxis.axisLength / 2;\n } else {\n // On regular bar charts we should just use the series length\n periodHalfLength = labelAxis.axisLength / data.normalized.series[seriesIndex].length / 2;\n }\n\n // Adding the series group to the series element\n seriesElement = seriesGroup.elem('g');\n\n // Write attributes to series group element. If series name or meta is undefined the attributes will not be written\n seriesElement.attr({\n 'ct:series-name': series.name,\n 'ct:meta': Chartist.serialize(series.meta)\n });\n\n // Use series class from series data or if not set generate one\n seriesElement.addClass([\n options.classNames.series,\n (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex))\n ].join(' '));\n\n data.normalized.series[seriesIndex].forEach(function(value, valueIndex) {\n var projected,\n bar,\n previousStack,\n labelAxisValueIndex;\n\n // We need to set labelAxisValueIndex based on some options combinations\n if(options.distributeSeries && !options.stackBars) {\n // If distributed series are enabled but stacked bars aren't, we can use the seriesIndex for later projection\n // on the step axis for label positioning\n labelAxisValueIndex = seriesIndex;\n } else if(options.distributeSeries && options.stackBars) {\n // If distributed series and stacked bars are enabled, we will only get one bar and therefore always use\n // 0 for projection on the label step axis\n labelAxisValueIndex = 0;\n } else {\n // On regular bar charts we just use the value index to project on the label step axis\n labelAxisValueIndex = valueIndex;\n }\n\n // We need to transform coordinates differently based on the chart layout\n if(options.horizontalBars) {\n projected = {\n x: chartRect.x1 + valueAxis.projectValue(value && value.x ? value.x : 0, valueIndex, data.normalized.series[seriesIndex]),\n y: chartRect.y1 - labelAxis.projectValue(value && value.y ? value.y : 0, labelAxisValueIndex, data.normalized.series[seriesIndex])\n };\n } else {\n projected = {\n x: chartRect.x1 + labelAxis.projectValue(value && value.x ? value.x : 0, labelAxisValueIndex, data.normalized.series[seriesIndex]),\n y: chartRect.y1 - valueAxis.projectValue(value && value.y ? value.y : 0, valueIndex, data.normalized.series[seriesIndex])\n }\n }\n\n // If the label axis is a step based axis we will offset the bar into the middle of between two steps using\n // the periodHalfLength value. Also we do arrange the different series so that they align up to each other using\n // the seriesBarDistance. If we don't have a step axis, the bar positions can be chosen freely so we should not\n // add any automated positioning.\n if(labelAxis instanceof Chartist.StepAxis) {\n // Offset to center bar between grid lines, but only if the step axis is not stretched\n if(!labelAxis.options.stretch) {\n projected[labelAxis.units.pos] += periodHalfLength * (options.horizontalBars ? -1 : 1);\n }\n // Using bi-polar offset for multiple series if no stacked bars or series distribution is used\n projected[labelAxis.units.pos] += (options.stackBars || options.distributeSeries) ? 0 : biPol * options.seriesBarDistance * (options.horizontalBars ? -1 : 1);\n }\n\n // Enter value in stacked bar values used to remember previous screen value for stacking up bars\n previousStack = stackedBarValues[valueIndex] || zeroPoint;\n stackedBarValues[valueIndex] = previousStack - (zeroPoint - projected[labelAxis.counterUnits.pos]);\n\n // Skip if value is undefined\n if(value === undefined) {\n return;\n }\n\n var positions = {};\n positions[labelAxis.units.pos + '1'] = projected[labelAxis.units.pos];\n positions[labelAxis.units.pos + '2'] = projected[labelAxis.units.pos];\n\n if(options.stackBars && (options.stackMode === 'accumulate' || !options.stackMode)) {\n // Stack mode: accumulate (default)\n // If bars are stacked we use the stackedBarValues reference and otherwise base all bars off the zero line\n // We want backwards compatibility, so the expected fallback without the 'stackMode' option\n // to be the original behaviour (accumulate)\n positions[labelAxis.counterUnits.pos + '1'] = previousStack;\n positions[labelAxis.counterUnits.pos + '2'] = stackedBarValues[valueIndex];\n } else {\n // Draw from the zero line normally\n // This is also the same code for Stack mode: overlap\n positions[labelAxis.counterUnits.pos + '1'] = zeroPoint;\n positions[labelAxis.counterUnits.pos + '2'] = projected[labelAxis.counterUnits.pos];\n }\n\n // Limit x and y so that they are within the chart rect\n positions.x1 = Math.min(Math.max(positions.x1, chartRect.x1), chartRect.x2);\n positions.x2 = Math.min(Math.max(positions.x2, chartRect.x1), chartRect.x2);\n positions.y1 = Math.min(Math.max(positions.y1, chartRect.y2), chartRect.y1);\n positions.y2 = Math.min(Math.max(positions.y2, chartRect.y2), chartRect.y1);\n\n var metaData = Chartist.getMetaData(series, valueIndex);\n\n // Create bar element\n bar = seriesElement.elem('line', positions, options.classNames.bar).attr({\n 'ct:value': [value.x, value.y].filter(Chartist.isNumeric).join(','),\n 'ct:meta': Chartist.serialize(metaData)\n });\n\n this.eventEmitter.emit('draw', Chartist.extend({\n type: 'bar',\n value: value,\n index: valueIndex,\n meta: metaData,\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n chartRect: chartRect,\n group: seriesElement,\n element: bar\n }, positions));\n }.bind(this));\n }.bind(this));\n\n this.eventEmitter.emit('created', {\n bounds: valueAxis.bounds,\n chartRect: chartRect,\n axisX: axisX,\n axisY: axisY,\n svg: this.svg,\n options: options\n });\n }", "function createChart(options) {\n var data;\n var highLow;\n\n if(options.distributeSeries) {\n data = Chartist.normalizeData(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y');\n data.normalized.series = data.normalized.series.map(function(value) {\n return [value];\n });\n } else {\n data = Chartist.normalizeData(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y');\n }\n\n // Create new svg element\n this.svg = Chartist.createSvg(\n this.container,\n options.width,\n options.height,\n options.classNames.chart + (options.horizontalBars ? ' ' + options.classNames.horizontalBars : '')\n );\n\n // Drawing groups in correct order\n var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup);\n var seriesGroup = this.svg.elem('g');\n var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup);\n\n if(options.stackBars && data.normalized.series.length !== 0) {\n\n // If stacked bars we need to calculate the high low from stacked values from each series\n var serialSums = Chartist.serialMap(data.normalized.series, function serialSums() {\n return Array.prototype.slice.call(arguments).map(function(value) {\n return value;\n }).reduce(function(prev, curr) {\n return {\n x: prev.x + (curr && curr.x) || 0,\n y: prev.y + (curr && curr.y) || 0\n };\n }, {x: 0, y: 0});\n });\n\n highLow = Chartist.getHighLow([serialSums], options, options.horizontalBars ? 'x' : 'y');\n\n } else {\n\n highLow = Chartist.getHighLow(data.normalized.series, options, options.horizontalBars ? 'x' : 'y');\n }\n\n // Overrides of high / low from settings\n highLow.high = +options.high || (options.high === 0 ? 0 : highLow.high);\n highLow.low = +options.low || (options.low === 0 ? 0 : highLow.low);\n\n var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);\n\n var valueAxis,\n labelAxisTicks,\n labelAxis,\n axisX,\n axisY;\n\n // We need to set step count based on some options combinations\n if(options.distributeSeries && options.stackBars) {\n // If distributed series are enabled and bars need to be stacked, we'll only have one bar and therefore should\n // use only the first label for the step axis\n labelAxisTicks = data.normalized.labels.slice(0, 1);\n } else {\n // If distributed series are enabled but stacked bars aren't, we should use the series labels\n // If we are drawing a regular bar chart with two dimensional series data, we just use the labels array\n // as the bars are normalized\n labelAxisTicks = data.normalized.labels;\n }\n\n // Set labelAxis and valueAxis based on the horizontalBars setting. This setting will flip the axes if necessary.\n if(options.horizontalBars) {\n if(options.axisX.type === undefined) {\n valueAxis = axisX = new Chartist.AutoScaleAxis(Chartist.Axis.units.x, data.normalized.series, chartRect, Chartist.extend({}, options.axisX, {\n highLow: highLow,\n referenceValue: 0\n }));\n } else {\n valueAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data.normalized.series, chartRect, Chartist.extend({}, options.axisX, {\n highLow: highLow,\n referenceValue: 0\n }));\n }\n\n if(options.axisY.type === undefined) {\n labelAxis = axisY = new Chartist.StepAxis(Chartist.Axis.units.y, data.normalized.series, chartRect, {\n ticks: labelAxisTicks\n });\n } else {\n labelAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data.normalized.series, chartRect, options.axisY);\n }\n } else {\n if(options.axisX.type === undefined) {\n labelAxis = axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data.normalized.series, chartRect, {\n ticks: labelAxisTicks\n });\n } else {\n labelAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data.normalized.series, chartRect, options.axisX);\n }\n\n if(options.axisY.type === undefined) {\n valueAxis = axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data.normalized.series, chartRect, Chartist.extend({}, options.axisY, {\n highLow: highLow,\n referenceValue: 0\n }));\n } else {\n valueAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data.normalized.series, chartRect, Chartist.extend({}, options.axisY, {\n highLow: highLow,\n referenceValue: 0\n }));\n }\n }\n\n // Projected 0 point\n var zeroPoint = options.horizontalBars ? (chartRect.x1 + valueAxis.projectValue(0)) : (chartRect.y1 - valueAxis.projectValue(0));\n // Used to track the screen coordinates of stacked bars\n var stackedBarValues = [];\n\n labelAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n valueAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n\n if (options.showGridBackground) {\n Chartist.createGridBackground(gridGroup, chartRect, options.classNames.gridBackground, this.eventEmitter);\n }\n\n // Draw the series\n data.raw.series.forEach(function(series, seriesIndex) {\n // Calculating bi-polar value of index for seriesOffset. For i = 0..4 biPol will be -1.5, -0.5, 0.5, 1.5 etc.\n var biPol = seriesIndex - (data.raw.series.length - 1) / 2;\n // Half of the period width between vertical grid lines used to position bars\n var periodHalfLength;\n // Current series SVG element\n var seriesElement;\n\n // We need to set periodHalfLength based on some options combinations\n if(options.distributeSeries && !options.stackBars) {\n // If distributed series are enabled but stacked bars aren't, we need to use the length of the normaizedData array\n // which is the series count and divide by 2\n periodHalfLength = labelAxis.axisLength / data.normalized.series.length / 2;\n } else if(options.distributeSeries && options.stackBars) {\n // If distributed series and stacked bars are enabled we'll only get one bar so we should just divide the axis\n // length by 2\n periodHalfLength = labelAxis.axisLength / 2;\n } else {\n // On regular bar charts we should just use the series length\n periodHalfLength = labelAxis.axisLength / data.normalized.series[seriesIndex].length / 2;\n }\n\n // Adding the series group to the series element\n seriesElement = seriesGroup.elem('g');\n\n // Write attributes to series group element. If series name or meta is undefined the attributes will not be written\n seriesElement.attr({\n 'ct:series-name': series.name,\n 'ct:meta': Chartist.serialize(series.meta)\n });\n\n // Use series class from series data or if not set generate one\n seriesElement.addClass([\n options.classNames.series,\n (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex))\n ].join(' '));\n\n data.normalized.series[seriesIndex].forEach(function(value, valueIndex) {\n var projected,\n bar,\n previousStack,\n labelAxisValueIndex;\n\n // We need to set labelAxisValueIndex based on some options combinations\n if(options.distributeSeries && !options.stackBars) {\n // If distributed series are enabled but stacked bars aren't, we can use the seriesIndex for later projection\n // on the step axis for label positioning\n labelAxisValueIndex = seriesIndex;\n } else if(options.distributeSeries && options.stackBars) {\n // If distributed series and stacked bars are enabled, we will only get one bar and therefore always use\n // 0 for projection on the label step axis\n labelAxisValueIndex = 0;\n } else {\n // On regular bar charts we just use the value index to project on the label step axis\n labelAxisValueIndex = valueIndex;\n }\n\n // We need to transform coordinates differently based on the chart layout\n if(options.horizontalBars) {\n projected = {\n x: chartRect.x1 + valueAxis.projectValue(value && value.x ? value.x : 0, valueIndex, data.normalized.series[seriesIndex]),\n y: chartRect.y1 - labelAxis.projectValue(value && value.y ? value.y : 0, labelAxisValueIndex, data.normalized.series[seriesIndex])\n };\n } else {\n projected = {\n x: chartRect.x1 + labelAxis.projectValue(value && value.x ? value.x : 0, labelAxisValueIndex, data.normalized.series[seriesIndex]),\n y: chartRect.y1 - valueAxis.projectValue(value && value.y ? value.y : 0, valueIndex, data.normalized.series[seriesIndex])\n }\n }\n\n // If the label axis is a step based axis we will offset the bar into the middle of between two steps using\n // the periodHalfLength value. Also we do arrange the different series so that they align up to each other using\n // the seriesBarDistance. If we don't have a step axis, the bar positions can be chosen freely so we should not\n // add any automated positioning.\n if(labelAxis instanceof Chartist.StepAxis) {\n // Offset to center bar between grid lines, but only if the step axis is not stretched\n if(!labelAxis.options.stretch) {\n projected[labelAxis.units.pos] += periodHalfLength * (options.horizontalBars ? -1 : 1);\n }\n // Using bi-polar offset for multiple series if no stacked bars or series distribution is used\n projected[labelAxis.units.pos] += (options.stackBars || options.distributeSeries) ? 0 : biPol * options.seriesBarDistance * (options.horizontalBars ? -1 : 1);\n }\n\n // Enter value in stacked bar values used to remember previous screen value for stacking up bars\n previousStack = stackedBarValues[valueIndex] || zeroPoint;\n stackedBarValues[valueIndex] = previousStack - (zeroPoint - projected[labelAxis.counterUnits.pos]);\n\n // Skip if value is undefined\n if(value === undefined) {\n return;\n }\n\n var positions = {};\n positions[labelAxis.units.pos + '1'] = projected[labelAxis.units.pos];\n positions[labelAxis.units.pos + '2'] = projected[labelAxis.units.pos];\n\n if(options.stackBars && (options.stackMode === 'accumulate' || !options.stackMode)) {\n // Stack mode: accumulate (default)\n // If bars are stacked we use the stackedBarValues reference and otherwise base all bars off the zero line\n // We want backwards compatibility, so the expected fallback without the 'stackMode' option\n // to be the original behaviour (accumulate)\n positions[labelAxis.counterUnits.pos + '1'] = previousStack;\n positions[labelAxis.counterUnits.pos + '2'] = stackedBarValues[valueIndex];\n } else {\n // Draw from the zero line normally\n // This is also the same code for Stack mode: overlap\n positions[labelAxis.counterUnits.pos + '1'] = zeroPoint;\n positions[labelAxis.counterUnits.pos + '2'] = projected[labelAxis.counterUnits.pos];\n }\n\n // Limit x and y so that they are within the chart rect\n positions.x1 = Math.min(Math.max(positions.x1, chartRect.x1), chartRect.x2);\n positions.x2 = Math.min(Math.max(positions.x2, chartRect.x1), chartRect.x2);\n positions.y1 = Math.min(Math.max(positions.y1, chartRect.y2), chartRect.y1);\n positions.y2 = Math.min(Math.max(positions.y2, chartRect.y2), chartRect.y1);\n\n var metaData = Chartist.getMetaData(series, valueIndex);\n\n // Create bar element\n bar = seriesElement.elem('line', positions, options.classNames.bar).attr({\n 'ct:value': [value.x, value.y].filter(Chartist.isNumeric).join(','),\n 'ct:meta': Chartist.serialize(metaData)\n });\n\n this.eventEmitter.emit('draw', Chartist.extend({\n type: 'bar',\n value: value,\n index: valueIndex,\n meta: metaData,\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n chartRect: chartRect,\n group: seriesElement,\n element: bar\n }, positions));\n }.bind(this));\n }.bind(this));\n\n this.eventEmitter.emit('created', {\n bounds: valueAxis.bounds,\n chartRect: chartRect,\n axisX: axisX,\n axisY: axisY,\n svg: this.svg,\n options: options\n });\n }", "function createChart(options) {\n var data;\n var highLow;\n\n if(options.distributeSeries) {\n data = Chartist.normalizeData(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y');\n data.normalized.series = data.normalized.series.map(function(value) {\n return [value];\n });\n } else {\n data = Chartist.normalizeData(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y');\n }\n\n // Create new svg element\n this.svg = Chartist.createSvg(\n this.container,\n options.width,\n options.height,\n options.classNames.chart + (options.horizontalBars ? ' ' + options.classNames.horizontalBars : '')\n );\n\n // Drawing groups in correct order\n var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup);\n var seriesGroup = this.svg.elem('g');\n var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup);\n\n if(options.stackBars && data.normalized.series.length !== 0) {\n\n // If stacked bars we need to calculate the high low from stacked values from each series\n var serialSums = Chartist.serialMap(data.normalized.series, function serialSums() {\n return Array.prototype.slice.call(arguments).map(function(value) {\n return value;\n }).reduce(function(prev, curr) {\n return {\n x: prev.x + (curr && curr.x) || 0,\n y: prev.y + (curr && curr.y) || 0\n };\n }, {x: 0, y: 0});\n });\n\n highLow = Chartist.getHighLow([serialSums], options, options.horizontalBars ? 'x' : 'y');\n\n } else {\n\n highLow = Chartist.getHighLow(data.normalized.series, options, options.horizontalBars ? 'x' : 'y');\n }\n\n // Overrides of high / low from settings\n highLow.high = +options.high || (options.high === 0 ? 0 : highLow.high);\n highLow.low = +options.low || (options.low === 0 ? 0 : highLow.low);\n\n var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);\n\n var valueAxis,\n labelAxisTicks,\n labelAxis,\n axisX,\n axisY;\n\n // We need to set step count based on some options combinations\n if(options.distributeSeries && options.stackBars) {\n // If distributed series are enabled and bars need to be stacked, we'll only have one bar and therefore should\n // use only the first label for the step axis\n labelAxisTicks = data.normalized.labels.slice(0, 1);\n } else {\n // If distributed series are enabled but stacked bars aren't, we should use the series labels\n // If we are drawing a regular bar chart with two dimensional series data, we just use the labels array\n // as the bars are normalized\n labelAxisTicks = data.normalized.labels;\n }\n\n // Set labelAxis and valueAxis based on the horizontalBars setting. This setting will flip the axes if necessary.\n if(options.horizontalBars) {\n if(options.axisX.type === undefined) {\n valueAxis = axisX = new Chartist.AutoScaleAxis(Chartist.Axis.units.x, data.normalized.series, chartRect, Chartist.extend({}, options.axisX, {\n highLow: highLow,\n referenceValue: 0\n }));\n } else {\n valueAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data.normalized.series, chartRect, Chartist.extend({}, options.axisX, {\n highLow: highLow,\n referenceValue: 0\n }));\n }\n\n if(options.axisY.type === undefined) {\n labelAxis = axisY = new Chartist.StepAxis(Chartist.Axis.units.y, data.normalized.series, chartRect, {\n ticks: labelAxisTicks\n });\n } else {\n labelAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data.normalized.series, chartRect, options.axisY);\n }\n } else {\n if(options.axisX.type === undefined) {\n labelAxis = axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data.normalized.series, chartRect, {\n ticks: labelAxisTicks\n });\n } else {\n labelAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data.normalized.series, chartRect, options.axisX);\n }\n\n if(options.axisY.type === undefined) {\n valueAxis = axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data.normalized.series, chartRect, Chartist.extend({}, options.axisY, {\n highLow: highLow,\n referenceValue: 0\n }));\n } else {\n valueAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data.normalized.series, chartRect, Chartist.extend({}, options.axisY, {\n highLow: highLow,\n referenceValue: 0\n }));\n }\n }\n\n // Projected 0 point\n var zeroPoint = options.horizontalBars ? (chartRect.x1 + valueAxis.projectValue(0)) : (chartRect.y1 - valueAxis.projectValue(0));\n // Used to track the screen coordinates of stacked bars\n var stackedBarValues = [];\n\n labelAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n valueAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n\n if (options.showGridBackground) {\n Chartist.createGridBackground(gridGroup, chartRect, options.classNames.gridBackground, this.eventEmitter);\n }\n\n // Draw the series\n data.raw.series.forEach(function(series, seriesIndex) {\n // Calculating bi-polar value of index for seriesOffset. For i = 0..4 biPol will be -1.5, -0.5, 0.5, 1.5 etc.\n var biPol = seriesIndex - (data.raw.series.length - 1) / 2;\n // Half of the period width between vertical grid lines used to position bars\n var periodHalfLength;\n // Current series SVG element\n var seriesElement;\n\n // We need to set periodHalfLength based on some options combinations\n if(options.distributeSeries && !options.stackBars) {\n // If distributed series are enabled but stacked bars aren't, we need to use the length of the normaizedData array\n // which is the series count and divide by 2\n periodHalfLength = labelAxis.axisLength / data.normalized.series.length / 2;\n } else if(options.distributeSeries && options.stackBars) {\n // If distributed series and stacked bars are enabled we'll only get one bar so we should just divide the axis\n // length by 2\n periodHalfLength = labelAxis.axisLength / 2;\n } else {\n // On regular bar charts we should just use the series length\n periodHalfLength = labelAxis.axisLength / data.normalized.series[seriesIndex].length / 2;\n }\n\n // Adding the series group to the series element\n seriesElement = seriesGroup.elem('g');\n\n // Write attributes to series group element. If series name or meta is undefined the attributes will not be written\n seriesElement.attr({\n 'ct:series-name': series.name,\n 'ct:meta': Chartist.serialize(series.meta)\n });\n\n // Use series class from series data or if not set generate one\n seriesElement.addClass([\n options.classNames.series,\n (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex))\n ].join(' '));\n\n data.normalized.series[seriesIndex].forEach(function(value, valueIndex) {\n var projected,\n bar,\n previousStack,\n labelAxisValueIndex;\n\n // We need to set labelAxisValueIndex based on some options combinations\n if(options.distributeSeries && !options.stackBars) {\n // If distributed series are enabled but stacked bars aren't, we can use the seriesIndex for later projection\n // on the step axis for label positioning\n labelAxisValueIndex = seriesIndex;\n } else if(options.distributeSeries && options.stackBars) {\n // If distributed series and stacked bars are enabled, we will only get one bar and therefore always use\n // 0 for projection on the label step axis\n labelAxisValueIndex = 0;\n } else {\n // On regular bar charts we just use the value index to project on the label step axis\n labelAxisValueIndex = valueIndex;\n }\n\n // We need to transform coordinates differently based on the chart layout\n if(options.horizontalBars) {\n projected = {\n x: chartRect.x1 + valueAxis.projectValue(value && value.x ? value.x : 0, valueIndex, data.normalized.series[seriesIndex]),\n y: chartRect.y1 - labelAxis.projectValue(value && value.y ? value.y : 0, labelAxisValueIndex, data.normalized.series[seriesIndex])\n };\n } else {\n projected = {\n x: chartRect.x1 + labelAxis.projectValue(value && value.x ? value.x : 0, labelAxisValueIndex, data.normalized.series[seriesIndex]),\n y: chartRect.y1 - valueAxis.projectValue(value && value.y ? value.y : 0, valueIndex, data.normalized.series[seriesIndex])\n }\n }\n\n // If the label axis is a step based axis we will offset the bar into the middle of between two steps using\n // the periodHalfLength value. Also we do arrange the different series so that they align up to each other using\n // the seriesBarDistance. If we don't have a step axis, the bar positions can be chosen freely so we should not\n // add any automated positioning.\n if(labelAxis instanceof Chartist.StepAxis) {\n // Offset to center bar between grid lines, but only if the step axis is not stretched\n if(!labelAxis.options.stretch) {\n projected[labelAxis.units.pos] += periodHalfLength * (options.horizontalBars ? -1 : 1);\n }\n // Using bi-polar offset for multiple series if no stacked bars or series distribution is used\n projected[labelAxis.units.pos] += (options.stackBars || options.distributeSeries) ? 0 : biPol * options.seriesBarDistance * (options.horizontalBars ? -1 : 1);\n }\n\n // Enter value in stacked bar values used to remember previous screen value for stacking up bars\n previousStack = stackedBarValues[valueIndex] || zeroPoint;\n stackedBarValues[valueIndex] = previousStack - (zeroPoint - projected[labelAxis.counterUnits.pos]);\n\n // Skip if value is undefined\n if(value === undefined) {\n return;\n }\n\n var positions = {};\n positions[labelAxis.units.pos + '1'] = projected[labelAxis.units.pos];\n positions[labelAxis.units.pos + '2'] = projected[labelAxis.units.pos];\n\n if(options.stackBars && (options.stackMode === 'accumulate' || !options.stackMode)) {\n // Stack mode: accumulate (default)\n // If bars are stacked we use the stackedBarValues reference and otherwise base all bars off the zero line\n // We want backwards compatibility, so the expected fallback without the 'stackMode' option\n // to be the original behaviour (accumulate)\n positions[labelAxis.counterUnits.pos + '1'] = previousStack;\n positions[labelAxis.counterUnits.pos + '2'] = stackedBarValues[valueIndex];\n } else {\n // Draw from the zero line normally\n // This is also the same code for Stack mode: overlap\n positions[labelAxis.counterUnits.pos + '1'] = zeroPoint;\n positions[labelAxis.counterUnits.pos + '2'] = projected[labelAxis.counterUnits.pos];\n }\n\n // Limit x and y so that they are within the chart rect\n positions.x1 = Math.min(Math.max(positions.x1, chartRect.x1), chartRect.x2);\n positions.x2 = Math.min(Math.max(positions.x2, chartRect.x1), chartRect.x2);\n positions.y1 = Math.min(Math.max(positions.y1, chartRect.y2), chartRect.y1);\n positions.y2 = Math.min(Math.max(positions.y2, chartRect.y2), chartRect.y1);\n\n var metaData = Chartist.getMetaData(series, valueIndex);\n\n // Create bar element\n bar = seriesElement.elem('line', positions, options.classNames.bar).attr({\n 'ct:value': [value.x, value.y].filter(Chartist.isNumeric).join(','),\n 'ct:meta': Chartist.serialize(metaData)\n });\n\n this.eventEmitter.emit('draw', Chartist.extend({\n type: 'bar',\n value: value,\n index: valueIndex,\n meta: metaData,\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n chartRect: chartRect,\n group: seriesElement,\n element: bar\n }, positions));\n }.bind(this));\n }.bind(this));\n\n this.eventEmitter.emit('created', {\n bounds: valueAxis.bounds,\n chartRect: chartRect,\n axisX: axisX,\n axisY: axisY,\n svg: this.svg,\n options: options\n });\n }", "function createChart(options) {\n var data;\n var highLow;\n\n if(options.distributeSeries) {\n data = Chartist.normalizeData(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y');\n data.normalized.series = data.normalized.series.map(function(value) {\n return [value];\n });\n } else {\n data = Chartist.normalizeData(this.data, options.reverseData, options.horizontalBars ? 'x' : 'y');\n }\n\n // Create new svg element\n this.svg = Chartist.createSvg(\n this.container,\n options.width,\n options.height,\n options.classNames.chart + (options.horizontalBars ? ' ' + options.classNames.horizontalBars : '')\n );\n\n // Drawing groups in correct order\n var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup);\n var seriesGroup = this.svg.elem('g');\n var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup);\n\n if(options.stackBars && data.normalized.series.length !== 0) {\n\n // If stacked bars we need to calculate the high low from stacked values from each series\n var serialSums = Chartist.serialMap(data.normalized.series, function serialSums() {\n return Array.prototype.slice.call(arguments).map(function(value) {\n return value;\n }).reduce(function(prev, curr) {\n return {\n x: prev.x + (curr && curr.x) || 0,\n y: prev.y + (curr && curr.y) || 0\n };\n }, {x: 0, y: 0});\n });\n\n highLow = Chartist.getHighLow([serialSums], options, options.horizontalBars ? 'x' : 'y');\n\n } else {\n\n highLow = Chartist.getHighLow(data.normalized.series, options, options.horizontalBars ? 'x' : 'y');\n }\n\n // Overrides of high / low from settings\n highLow.high = +options.high || (options.high === 0 ? 0 : highLow.high);\n highLow.low = +options.low || (options.low === 0 ? 0 : highLow.low);\n\n var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);\n\n var valueAxis,\n labelAxisTicks,\n labelAxis,\n axisX,\n axisY;\n\n // We need to set step count based on some options combinations\n if(options.distributeSeries && options.stackBars) {\n // If distributed series are enabled and bars need to be stacked, we'll only have one bar and therefore should\n // use only the first label for the step axis\n labelAxisTicks = data.normalized.labels.slice(0, 1);\n } else {\n // If distributed series are enabled but stacked bars aren't, we should use the series labels\n // If we are drawing a regular bar chart with two dimensional series data, we just use the labels array\n // as the bars are normalized\n labelAxisTicks = data.normalized.labels;\n }\n\n // Set labelAxis and valueAxis based on the horizontalBars setting. This setting will flip the axes if necessary.\n if(options.horizontalBars) {\n if(options.axisX.type === undefined) {\n valueAxis = axisX = new Chartist.AutoScaleAxis(Chartist.Axis.units.x, data.normalized.series, chartRect, Chartist.extend({}, options.axisX, {\n highLow: highLow,\n referenceValue: 0\n }));\n } else {\n valueAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data.normalized.series, chartRect, Chartist.extend({}, options.axisX, {\n highLow: highLow,\n referenceValue: 0\n }));\n }\n\n if(options.axisY.type === undefined) {\n labelAxis = axisY = new Chartist.StepAxis(Chartist.Axis.units.y, data.normalized.series, chartRect, {\n ticks: labelAxisTicks\n });\n } else {\n labelAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data.normalized.series, chartRect, options.axisY);\n }\n } else {\n if(options.axisX.type === undefined) {\n labelAxis = axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data.normalized.series, chartRect, {\n ticks: labelAxisTicks\n });\n } else {\n labelAxis = axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data.normalized.series, chartRect, options.axisX);\n }\n\n if(options.axisY.type === undefined) {\n valueAxis = axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data.normalized.series, chartRect, Chartist.extend({}, options.axisY, {\n highLow: highLow,\n referenceValue: 0\n }));\n } else {\n valueAxis = axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data.normalized.series, chartRect, Chartist.extend({}, options.axisY, {\n highLow: highLow,\n referenceValue: 0\n }));\n }\n }\n\n // Projected 0 point\n var zeroPoint = options.horizontalBars ? (chartRect.x1 + valueAxis.projectValue(0)) : (chartRect.y1 - valueAxis.projectValue(0));\n // Used to track the screen coordinates of stacked bars\n var stackedBarValues = [];\n\n labelAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n valueAxis.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n\n if (options.showGridBackground) {\n Chartist.createGridBackground(gridGroup, chartRect, options.classNames.gridBackground, this.eventEmitter);\n }\n\n // Draw the series\n data.raw.series.forEach(function(series, seriesIndex) {\n // Calculating bi-polar value of index for seriesOffset. For i = 0..4 biPol will be -1.5, -0.5, 0.5, 1.5 etc.\n var biPol = seriesIndex - (data.raw.series.length - 1) / 2;\n // Half of the period width between vertical grid lines used to position bars\n var periodHalfLength;\n // Current series SVG element\n var seriesElement;\n\n // We need to set periodHalfLength based on some options combinations\n if(options.distributeSeries && !options.stackBars) {\n // If distributed series are enabled but stacked bars aren't, we need to use the length of the normaizedData array\n // which is the series count and divide by 2\n periodHalfLength = labelAxis.axisLength / data.normalized.series.length / 2;\n } else if(options.distributeSeries && options.stackBars) {\n // If distributed series and stacked bars are enabled we'll only get one bar so we should just divide the axis\n // length by 2\n periodHalfLength = labelAxis.axisLength / 2;\n } else {\n // On regular bar charts we should just use the series length\n periodHalfLength = labelAxis.axisLength / data.normalized.series[seriesIndex].length / 2;\n }\n\n // Adding the series group to the series element\n seriesElement = seriesGroup.elem('g');\n\n // Write attributes to series group element. If series name or meta is undefined the attributes will not be written\n seriesElement.attr({\n 'ct:series-name': series.name,\n 'ct:meta': Chartist.serialize(series.meta)\n });\n\n // Use series class from series data or if not set generate one\n seriesElement.addClass([\n options.classNames.series,\n (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex))\n ].join(' '));\n\n data.normalized.series[seriesIndex].forEach(function(value, valueIndex) {\n var projected,\n bar,\n previousStack,\n labelAxisValueIndex;\n\n // We need to set labelAxisValueIndex based on some options combinations\n if(options.distributeSeries && !options.stackBars) {\n // If distributed series are enabled but stacked bars aren't, we can use the seriesIndex for later projection\n // on the step axis for label positioning\n labelAxisValueIndex = seriesIndex;\n } else if(options.distributeSeries && options.stackBars) {\n // If distributed series and stacked bars are enabled, we will only get one bar and therefore always use\n // 0 for projection on the label step axis\n labelAxisValueIndex = 0;\n } else {\n // On regular bar charts we just use the value index to project on the label step axis\n labelAxisValueIndex = valueIndex;\n }\n\n // We need to transform coordinates differently based on the chart layout\n if(options.horizontalBars) {\n projected = {\n x: chartRect.x1 + valueAxis.projectValue(value && value.x ? value.x : 0, valueIndex, data.normalized.series[seriesIndex]),\n y: chartRect.y1 - labelAxis.projectValue(value && value.y ? value.y : 0, labelAxisValueIndex, data.normalized.series[seriesIndex])\n };\n } else {\n projected = {\n x: chartRect.x1 + labelAxis.projectValue(value && value.x ? value.x : 0, labelAxisValueIndex, data.normalized.series[seriesIndex]),\n y: chartRect.y1 - valueAxis.projectValue(value && value.y ? value.y : 0, valueIndex, data.normalized.series[seriesIndex])\n }\n }\n\n // If the label axis is a step based axis we will offset the bar into the middle of between two steps using\n // the periodHalfLength value. Also we do arrange the different series so that they align up to each other using\n // the seriesBarDistance. If we don't have a step axis, the bar positions can be chosen freely so we should not\n // add any automated positioning.\n if(labelAxis instanceof Chartist.StepAxis) {\n // Offset to center bar between grid lines, but only if the step axis is not stretched\n if(!labelAxis.options.stretch) {\n projected[labelAxis.units.pos] += periodHalfLength * (options.horizontalBars ? -1 : 1);\n }\n // Using bi-polar offset for multiple series if no stacked bars or series distribution is used\n projected[labelAxis.units.pos] += (options.stackBars || options.distributeSeries) ? 0 : biPol * options.seriesBarDistance * (options.horizontalBars ? -1 : 1);\n }\n\n // Enter value in stacked bar values used to remember previous screen value for stacking up bars\n previousStack = stackedBarValues[valueIndex] || zeroPoint;\n stackedBarValues[valueIndex] = previousStack - (zeroPoint - projected[labelAxis.counterUnits.pos]);\n\n // Skip if value is undefined\n if(value === undefined) {\n return;\n }\n\n var positions = {};\n positions[labelAxis.units.pos + '1'] = projected[labelAxis.units.pos];\n positions[labelAxis.units.pos + '2'] = projected[labelAxis.units.pos];\n\n if(options.stackBars && (options.stackMode === 'accumulate' || !options.stackMode)) {\n // Stack mode: accumulate (default)\n // If bars are stacked we use the stackedBarValues reference and otherwise base all bars off the zero line\n // We want backwards compatibility, so the expected fallback without the 'stackMode' option\n // to be the original behaviour (accumulate)\n positions[labelAxis.counterUnits.pos + '1'] = previousStack;\n positions[labelAxis.counterUnits.pos + '2'] = stackedBarValues[valueIndex];\n } else {\n // Draw from the zero line normally\n // This is also the same code for Stack mode: overlap\n positions[labelAxis.counterUnits.pos + '1'] = zeroPoint;\n positions[labelAxis.counterUnits.pos + '2'] = projected[labelAxis.counterUnits.pos];\n }\n\n // Limit x and y so that they are within the chart rect\n positions.x1 = Math.min(Math.max(positions.x1, chartRect.x1), chartRect.x2);\n positions.x2 = Math.min(Math.max(positions.x2, chartRect.x1), chartRect.x2);\n positions.y1 = Math.min(Math.max(positions.y1, chartRect.y2), chartRect.y1);\n positions.y2 = Math.min(Math.max(positions.y2, chartRect.y2), chartRect.y1);\n\n var metaData = Chartist.getMetaData(series, valueIndex);\n\n // Create bar element\n bar = seriesElement.elem('line', positions, options.classNames.bar).attr({\n 'ct:value': [value.x, value.y].filter(Chartist.isNumeric).join(','),\n 'ct:meta': Chartist.serialize(metaData)\n });\n\n this.eventEmitter.emit('draw', Chartist.extend({\n type: 'bar',\n value: value,\n index: valueIndex,\n meta: metaData,\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n chartRect: chartRect,\n group: seriesElement,\n element: bar\n }, positions));\n }.bind(this));\n }.bind(this));\n\n this.eventEmitter.emit('created', {\n bounds: valueAxis.bounds,\n chartRect: chartRect,\n axisX: axisX,\n axisY: axisY,\n svg: this.svg,\n options: options\n });\n }", "function componentBarsHorizontal () {\n\n /* Default Properties */\n var width = 400;\n var height = 500;\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 var xScale = void 0;\n var yScale = void 0;\n var colorScale = void 0;\n var classed = \"barsHorizontal\";\n\n /**\n * Initialise Data and Scales\n *\n * @private\n * @param {Array} data - Chart data.\n */\n function init(data) {\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 if (typeof xScale === \"undefined\") {\n xScale = d3.scaleLinear().domain(valueExtent).range([0, height]).nice();\n }\n\n if (typeof yScale === \"undefined\") {\n yScale = d3.scaleBand().domain(columnKeys).rangeRound([0, width]).padding(0.15);\n }\n }\n\n /**\n * Constructor\n *\n * @constructor\n * @alias barsHorizontal\n * @param {d3.selection} selection - The chart holder D3 selection.\n */\n function my(selection) {\n init(selection.data());\n selection.each(function () {\n\n // Update series group\n var seriesGroup = d3.select(this);\n seriesGroup.classed(classed, true).attr(\"id\", function (d) {\n return d.key;\n }).on(\"mouseover\", function (d) {\n dispatch.call(\"customSeriesMouseOver\", this, d);\n }).on(\"click\", function (d) {\n dispatch.call(\"customSeriesClick\", this, d);\n });\n\n // Add bars to series\n var bars = seriesGroup.selectAll(\".bar\").data(function (d) {\n return d.values;\n });\n\n bars.enter().append(\"rect\").classed(\"bar\", true).attr(\"fill\", function (d) {\n return colorScale(d.key);\n }).attr(\"width\", yScale.bandwidth()).attr(\"y\", function (d) {\n return yScale(d.key);\n }).attr(\"height\", yScale.bandwidth()).on(\"mouseover\", function (d) {\n dispatch.call(\"customValueMouseOver\", this, d);\n }).on(\"click\", function (d) {\n dispatch.call(\"customValueClick\", this, d);\n }).merge(bars).transition().ease(transition.ease).duration(transition.duration).attr(\"x\", 0).attr(\"width\", function (d) {\n return xScale(d.value);\n });\n\n bars.exit().transition().style(\"opacity\", 0).remove();\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 * 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 my;\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 my;\n };\n\n /**\n * X Scale Getter / Setter\n *\n * @param {d3.scale} _v - D3 scale.\n * @returns {*}\n */\n my.xScale = function (_v) {\n if (!arguments.length) return xScale;\n xScale = _v;\n return my;\n };\n\n /**\n * Y Scale Getter / Setter\n *\n * @param {d3.scale} _v - D3 scale.\n * @returns {*}\n */\n my.yScale = function (_v) {\n if (!arguments.length) return yScale;\n yScale = _v;\n return my;\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 horizontalAxis(x, y) {\n newPath(); // Nueva ruta de gráficos\n arrow(x - 20, y, x + 240, y); // Dibuja el eje horizontal\n var t0 = Math.ceil(tU); // hora del primer tick (s)\n var x0 = x + pixT * (t0 - tU); // posición del primer tic \n for (var i = 0; i <= 10; i++) { // para todos los ticks ... \n var xT = x0 + i * pixT; // Coordenada horizontal de la marca\n line(xT, y - 3, xT, y + 3); // dibujar tick\n if (xT >= x + 5 && xT <= x + 215 // Si la marca no está demasiado a la izquierda o a la derecha ...\n &&\n (t0 + i <= 100 || (t0 + i) % 2 == 0)) // ... y espacio para etiquetado disponible ...\n alignText(\"\" + (t0 + i), 1, xT, y + 13); // ... hacer etiquetado\n }\n alignText(symbolTime, 1, DX + 230, DY + 18); // inscripción (t)\n alignText(text16, 1, DX + 230, DY + 30); // especificación de la (s) unidad (es)\n}", "function createAndDisplayXAxis(data) {\n\n\t// Get oldest date (that is, date of first tweet in the data)\n\tvar oldestDate = new Date(data[data.length - 1].CurrentTweetDate);\n\t// Get newest date (that is, date of latest tweet in the data)\n\tvar newestDate = new Date(data[0].CurrentTweetDate);\n\t// Add 2 weeks at beginning and end of axis for prettier display\n\toldestDate.setDate(oldestDate.getDate() - 14); // go back 14 days\n\tnewestDate.setDate(newestDate.getDate() + 14); // go forward 14 days\n\n\t// Set x-scale domain from newest and oldest date\n\txScale.domain([oldestDate, newestDate]);\n}", "function displayAxisTitles (options) {\n var xTitle = $(\"<h3></h3\").attr( {\"id\": \"xtitle\",\n \"class\": \"axistitle\"});\n xTitle.text(options.xaxistitle);\n var yTitle = $(\"<h3></h3\").attr( {\"id\": \"ytitle\",\n \"class\": \"axistitle\"});\n yTitle.text(options.yaxistitle);\n $(\"#chartarea\").append(xTitle,yTitle);\n\n $(\"#xtitle\").css({\n \"align-self\": \"center\",\n \"margin\": \"2px\",\n \"padding\": \"5px\",\n \"position\": \"absolute\",\n \"top\": \"105%\",\n \"font-size\": \"medium\"\n });\n\n$(\"#ytitle\").css( {\n \"left\": \"-20%\",\n \"margin\": \"2px\",\n \"padding\": \"2px\",\n \"position\": \"absolute\",\n \"top\":\"50%\",\n \"transform\": \"rotate(-90deg)\",\n \"font-size\": \"medium\"\n });\n\n}", "function createChart(options){var data;var highLow;if(options.distributeSeries){data=Chartist.normalizeData(this.data,options.reverseData,options.horizontalBars?'x':'y');data.normalized.series=data.normalized.series.map(function(value){return [value];});}else {data=Chartist.normalizeData(this.data,options.reverseData,options.horizontalBars?'x':'y');}// Create new svg element\nthis.svg=Chartist.createSvg(this.container,options.width,options.height,options.classNames.chart+(options.horizontalBars?' '+options.classNames.horizontalBars:''));// Drawing groups in correct order\nvar gridGroup=this.svg.elem('g').addClass(options.classNames.gridGroup);var seriesGroup=this.svg.elem('g');var labelGroup=this.svg.elem('g').addClass(options.classNames.labelGroup);if(options.stackBars&&data.normalized.series.length!==0){// If stacked bars we need to calculate the high low from stacked values from each series\nvar serialSums=Chartist.serialMap(data.normalized.series,function serialSums(){return Array.prototype.slice.call(arguments).map(function(value){return value;}).reduce(function(prev,curr){return {x:prev.x+(curr&&curr.x)||0,y:prev.y+(curr&&curr.y)||0};},{x:0,y:0});});highLow=Chartist.getHighLow([serialSums],options,options.horizontalBars?'x':'y');}else {highLow=Chartist.getHighLow(data.normalized.series,options,options.horizontalBars?'x':'y');}// Overrides of high / low from settings\nhighLow.high=+options.high||(options.high===0?0:highLow.high);highLow.low=+options.low||(options.low===0?0:highLow.low);var chartRect=Chartist.createChartRect(this.svg,options,defaultOptions.padding);var valueAxis,labelAxisTicks,labelAxis,axisX,axisY;// We need to set step count based on some options combinations\nif(options.distributeSeries&&options.stackBars){// If distributed series are enabled and bars need to be stacked, we'll only have one bar and therefore should\n// use only the first label for the step axis\nlabelAxisTicks=data.normalized.labels.slice(0,1);}else {// If distributed series are enabled but stacked bars aren't, we should use the series labels\n// If we are drawing a regular bar chart with two dimensional series data, we just use the labels array\n// as the bars are normalized\nlabelAxisTicks=data.normalized.labels;}// Set labelAxis and valueAxis based on the horizontalBars setting. This setting will flip the axes if necessary.\nif(options.horizontalBars){if(options.axisX.type===undefined){valueAxis=axisX=new Chartist.AutoScaleAxis(Chartist.Axis.units.x,data.normalized.series,chartRect,Chartist.extend({},options.axisX,{highLow:highLow,referenceValue:0}));}else {valueAxis=axisX=options.axisX.type.call(Chartist,Chartist.Axis.units.x,data.normalized.series,chartRect,Chartist.extend({},options.axisX,{highLow:highLow,referenceValue:0}));}if(options.axisY.type===undefined){labelAxis=axisY=new Chartist.StepAxis(Chartist.Axis.units.y,data.normalized.series,chartRect,{ticks:labelAxisTicks});}else {labelAxis=axisY=options.axisY.type.call(Chartist,Chartist.Axis.units.y,data.normalized.series,chartRect,options.axisY);}}else {if(options.axisX.type===undefined){labelAxis=axisX=new Chartist.StepAxis(Chartist.Axis.units.x,data.normalized.series,chartRect,{ticks:labelAxisTicks});}else {labelAxis=axisX=options.axisX.type.call(Chartist,Chartist.Axis.units.x,data.normalized.series,chartRect,options.axisX);}if(options.axisY.type===undefined){valueAxis=axisY=new Chartist.AutoScaleAxis(Chartist.Axis.units.y,data.normalized.series,chartRect,Chartist.extend({},options.axisY,{highLow:highLow,referenceValue:0}));}else {valueAxis=axisY=options.axisY.type.call(Chartist,Chartist.Axis.units.y,data.normalized.series,chartRect,Chartist.extend({},options.axisY,{highLow:highLow,referenceValue:0}));}}// Projected 0 point\nvar zeroPoint=options.horizontalBars?chartRect.x1+valueAxis.projectValue(0):chartRect.y1-valueAxis.projectValue(0);// Used to track the screen coordinates of stacked bars\nvar stackedBarValues=[];labelAxis.createGridAndLabels(gridGroup,labelGroup,this.supportsForeignObject,options,this.eventEmitter);valueAxis.createGridAndLabels(gridGroup,labelGroup,this.supportsForeignObject,options,this.eventEmitter);if(options.showGridBackground){Chartist.createGridBackground(gridGroup,chartRect,options.classNames.gridBackground,this.eventEmitter);}// Draw the series\ndata.raw.series.forEach(function(series,seriesIndex){// Calculating bi-polar value of index for seriesOffset. For i = 0..4 biPol will be -1.5, -0.5, 0.5, 1.5 etc.\nvar biPol=seriesIndex-(data.raw.series.length-1)/2;// Half of the period width between vertical grid lines used to position bars\nvar periodHalfLength;// Current series SVG element\nvar seriesElement;// We need to set periodHalfLength based on some options combinations\nif(options.distributeSeries&&!options.stackBars){// If distributed series are enabled but stacked bars aren't, we need to use the length of the normaizedData array\n// which is the series count and divide by 2\nperiodHalfLength=labelAxis.axisLength/data.normalized.series.length/2;}else if(options.distributeSeries&&options.stackBars){// If distributed series and stacked bars are enabled we'll only get one bar so we should just divide the axis\n// length by 2\nperiodHalfLength=labelAxis.axisLength/2;}else {// On regular bar charts we should just use the series length\nperiodHalfLength=labelAxis.axisLength/data.normalized.series[seriesIndex].length/2;}// Adding the series group to the series element\nseriesElement=seriesGroup.elem('g');// Write attributes to series group element. If series name or meta is undefined the attributes will not be written\nseriesElement.attr({'ct:series-name':series.name,'ct:meta':Chartist.serialize(series.meta)});// Use series class from series data or if not set generate one\nseriesElement.addClass([options.classNames.series,series.className||options.classNames.series+'-'+Chartist.alphaNumerate(seriesIndex)].join(' '));data.normalized.series[seriesIndex].forEach(function(value,valueIndex){var projected,bar,previousStack,labelAxisValueIndex;// We need to set labelAxisValueIndex based on some options combinations\nif(options.distributeSeries&&!options.stackBars){// If distributed series are enabled but stacked bars aren't, we can use the seriesIndex for later projection\n// on the step axis for label positioning\nlabelAxisValueIndex=seriesIndex;}else if(options.distributeSeries&&options.stackBars){// If distributed series and stacked bars are enabled, we will only get one bar and therefore always use\n// 0 for projection on the label step axis\nlabelAxisValueIndex=0;}else {// On regular bar charts we just use the value index to project on the label step axis\nlabelAxisValueIndex=valueIndex;}// We need to transform coordinates differently based on the chart layout\nif(options.horizontalBars){projected={x:chartRect.x1+valueAxis.projectValue(value&&value.x?value.x:0,valueIndex,data.normalized.series[seriesIndex]),y:chartRect.y1-labelAxis.projectValue(value&&value.y?value.y:0,labelAxisValueIndex,data.normalized.series[seriesIndex])};}else {projected={x:chartRect.x1+labelAxis.projectValue(value&&value.x?value.x:0,labelAxisValueIndex,data.normalized.series[seriesIndex]),y:chartRect.y1-valueAxis.projectValue(value&&value.y?value.y:0,valueIndex,data.normalized.series[seriesIndex])};}// If the label axis is a step based axis we will offset the bar into the middle of between two steps using\n// the periodHalfLength value. Also we do arrange the different series so that they align up to each other using\n// the seriesBarDistance. If we don't have a step axis, the bar positions can be chosen freely so we should not\n// add any automated positioning.\nif(labelAxis instanceof Chartist.StepAxis){// Offset to center bar between grid lines, but only if the step axis is not stretched\nif(!labelAxis.options.stretch){projected[labelAxis.units.pos]+=periodHalfLength*(options.horizontalBars?-1:1);}// Using bi-polar offset for multiple series if no stacked bars or series distribution is used\nprojected[labelAxis.units.pos]+=options.stackBars||options.distributeSeries?0:biPol*options.seriesBarDistance*(options.horizontalBars?-1:1);}// Enter value in stacked bar values used to remember previous screen value for stacking up bars\npreviousStack=stackedBarValues[valueIndex]||zeroPoint;stackedBarValues[valueIndex]=previousStack-(zeroPoint-projected[labelAxis.counterUnits.pos]);// Skip if value is undefined\nif(value===undefined){return;}var positions={};positions[labelAxis.units.pos+'1']=projected[labelAxis.units.pos];positions[labelAxis.units.pos+'2']=projected[labelAxis.units.pos];if(options.stackBars&&(options.stackMode==='accumulate'||!options.stackMode)){// Stack mode: accumulate (default)\n// If bars are stacked we use the stackedBarValues reference and otherwise base all bars off the zero line\n// We want backwards compatibility, so the expected fallback without the 'stackMode' option\n// to be the original behaviour (accumulate)\npositions[labelAxis.counterUnits.pos+'1']=previousStack;positions[labelAxis.counterUnits.pos+'2']=stackedBarValues[valueIndex];}else {// Draw from the zero line normally\n// This is also the same code for Stack mode: overlap\npositions[labelAxis.counterUnits.pos+'1']=zeroPoint;positions[labelAxis.counterUnits.pos+'2']=projected[labelAxis.counterUnits.pos];}// Limit x and y so that they are within the chart rect\npositions.x1=Math.min(Math.max(positions.x1,chartRect.x1),chartRect.x2);positions.x2=Math.min(Math.max(positions.x2,chartRect.x1),chartRect.x2);positions.y1=Math.min(Math.max(positions.y1,chartRect.y2),chartRect.y1);positions.y2=Math.min(Math.max(positions.y2,chartRect.y2),chartRect.y1);var metaData=Chartist.getMetaData(series,valueIndex);// Create bar element\nbar=seriesElement.elem('line',positions,options.classNames.bar).attr({'ct:value':[value.x,value.y].filter(Chartist.isNumeric).join(','),'ct:meta':Chartist.serialize(metaData)});this.eventEmitter.emit('draw',Chartist.extend({type:'bar',value:value,index:valueIndex,meta:metaData,series:series,seriesIndex:seriesIndex,axisX:axisX,axisY:axisY,chartRect:chartRect,group:seriesElement,element:bar},positions));}.bind(this));}.bind(this));this.eventEmitter.emit('created',{bounds:valueAxis.bounds,chartRect:chartRect,axisX:axisX,axisY:axisY,svg:this.svg,options:options});}", "function SVGRowChart() {\r\n }", "function createChart(h){\n\tvar chart = d3.select(\"#d3chart\")\n\t .attr(\"width\", barWidth+2*x)\n\t .attr(\"height\", barHeight+2*x);\n\t\n\tchart.append(\"rect\")\n\t .attr(\"id\", 'emptyRect')\n\t .attr(\"width\", barWidth+2*x)\n\t .attr(\"height\", barHeight+2*x)\n\t .attr(\"stroke-width\",2*x)\n\t .attr(\"stroke\",\"rgb(12, 244, 75)\");\n\n\tchart.append(\"rect\")\n\t .attr(\"id\",'fullRect')\n\t .attr(\"width\", barWidth)\n\t .attr(\"height\",0);\t\n}", "function 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}", "function SVGStackedRowChart() {\r\n }", "function horizontalChart3() {\n var star = '';\n for (var i = 0; i < arguments.length; i++) {\n for (j = 0; j < arguments[i]; j++) {\n star += \"*\";\n }\n star += '\\n';\n }\n return star;\n}", "function drawChart() {\n stroke(0);\n yAxis();\n xAxis();\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}", "function horizontalChart () {\n var row = '';\n for (var i = 0; i < arguments.length; i++){\n for (var j = 0; j < arguments[i]; j++){\n row += '*';\n }\n console.log(row);\n row = '';\n }\n}", "function horizontalChart2(num1, num2, num3) {\n var star = '';\n for (var i = 0; i < num1; i++) {\n star += '*';\n }\n star += '\\n';\n for (var i = 0; i < num2; i++) {\n star += '*';\n }\n star += '\\n';\n for (var i = 0; i < num3; i++) {\n star += '*';\n }\n return star;\n}", "function drawOutdoorType() {\n var data = new google.visualization.DataTable();\n data.addColumn('number', 'Year');\n data.addColumn('number', 'Top Rope');\n data.addColumn('number', 'Trad Follow');\n\t data.addColumn('number', 'Sport');\n data.addColumn('number', 'Trad Lead');\n\t data.addColumn('number', 'Trad Lead Swap');\n\n data.addRows([\n [2010, 16, 0, 2, 0, 0],\n [2011, 25, 8, 26, 23, 13],\n [2012, 51, 7, 12, 17, 35],\n [2013, 17, 0, 4, 7, 23],\n [2014, 50, 16, 11, 24, 35],\n [2015, 14, 0, 8, 9, 3], \n [2016, 1, 0, 0, 0, 0],\n [2017, 25, 0, 10, 8, 0]\n ]);\n\n var options = {\n title: 'Type of Climbs',\n\t\ttitleTextStyle: {\n\t\t\tcolor: '#000000',\n\t\t\tfontSize: 16,\n\t\t\tfontName: 'Arial',\n\t\t\tbold: true\n\t\t},\n isStacked: true,\n\t\tlegend: { position: 'bottom', maxLines: 3 },\n\t\theight: 300,\n\t\twidth: 700,\n hAxis: {\n title: 'Years',\n\t\t viewWindow: {\n min: [2009],\n max: [2018]\n },\n\t\t format: '####',\n\t\t ticks: [2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017]\n },\n vAxis: {\n title: 'Number of Routes'\n },\n\t\tchartArea: {left:50, width: 600},\n\t\tcolors: ['#38ACEC', '#4CC417', '#800000', '#FFA500', '#B93B8F'] //only need 5 colors for 5 types\n };\n\n var chart = new google.visualization.ColumnChart(document.getElementById('outdoorType'));\n chart.draw(data, options);\n}", "function createDiagramMoney(categoriesArr, linesArr, textTitle) {\n // plugin options \n\n Highcharts.setOptions({\n colors: ['green', 'blue', 'red', 'aqua', 'black', 'gray']\n })\n\n $('#container_diagram_money').highcharts({\n plotOptions: {\n series: {\n lineWidth: 3,\n marker: {\n symbol: 'circle',\n\n }\n }\n },\n title: {\n text: textTitle\n },\n chart: {\n type: 'line',\n\n },\n subtitle: {\n\n },\n xAxis: {\n categories: categoriesArr,\n gridLineDashStyle: 'ShortDot',\n gridLineWidth: 1\n },\n yAxis: {\n gridLineDashStyle: 'ShortDot',\n title: {\n text: ''\n }\n },\n tooltip: {\n valueSuffix: ' грн.'\n },\n legend: {\n layout: 'horizontal',\n align: 'center',\n verticalAlign: 'bottom',\n y: 50,\n padding: 3,\n itemMarginTop: 5,\n itemMarginBottom: 5,\n itemStyle: {\n lineHeight: '14px'\n }\n },\n series: linesArr\n });\n }", "function gridXaxis() {\t\t\n return d3.axisBottom(x)\n .ticks(5)\n}", "function drawAxes() {\n canvas.select(\"#layer1\").append(\"g\")\n .attr(\"class\", \"grid\")\n .attr(\"transform\", \"translate(0,\" + h + \")\")\n .call(xAxis);\n canvas.select(\"#layer1\").append(\"g\")\n .attr(\"class\", \"grid\")\n .call(yAxis);\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 drawHeatTitles() {\n\n const xMiddle = heatMargin.left + midpoint(heatScales.x.range());\n const yMiddle = heatMargin.top + midpoint(heatScales.y.range());\n\n const xTitleGroup = heatSvg.append('g');\n const xTitle = xTitleGroup.append('text')\n .attr('class', 'axis-title')\n .attr(\"id\", \"axis-title\")\n .text('Call Type Groups');\n\n xTitle.attr('x', xMiddle);\n xTitle.attr('y', 0 + heatMargin.top - 18);\n xTitle.attr('dy', -4);\n xTitle.attr('text-anchor', 'middle');\n\n const yTitleGroup = heatSvg.append('g');\n yTitleGroup.attr('transform', translate(4, yMiddle));\n\n const yTitle = yTitleGroup.append('text')\n .attr('class', 'axis-title')\n .attr(\"id\", \"axis-title\")\n .text('Neighborhoods')\n .attr('x', 0)\n .attr('y', 0)\n .attr('dy', -350)\n .attr('dx', 0);\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 createXAxis() {\n return d3.svg.axis().scale(that.x).orient('bottom').ticks(chart.xAxis.tickCount);\n }", "function createXAxis() {\n return d3.svg.axis().scale(that.x).orient('bottom').ticks(chart.xAxis.tickCount);\n }", "function createLineNewChart(title, data, color, chartDiv) {\n let container = _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_15__[/* create */ \"h\"](chartDiv, _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_15__[/* Container */ \"b\"]);\n container.layout = \"horizontal\";\n container.fixedWidthGrid = true;\n container.width = _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_15__[/* percent */ \"k\"](100);\n container.height = _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_15__[/* percent */ \"k\"](100);\n let chart = container.createChild(_amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_16__[/* XYChart */ \"j\"]);\n chart.width = _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_15__[/* percent */ \"k\"](45);\n chart.height = 70;\n chart.data = data;\n chart.padding(20, 5, 2, 5);\n let categoryAxis = chart.xAxes.push(new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_16__[/* CategoryAxis */ \"a\"]());\n categoryAxis.renderer.grid.template.location = 0;\n categoryAxis.renderer.grid.template.disabled = true;\n categoryAxis.renderer.baseGrid.disabled = true;\n categoryAxis.renderer.labels.template.disabled = true;\n categoryAxis.cursorTooltipEnabled = false;\n categoryAxis.dataFields.category = \"Period\";\n let valueAxis = chart.yAxes.push(new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_16__[/* ValueAxis */ \"i\"]());\n valueAxis.min = 0;\n valueAxis.renderer.grid.template.disabled = true;\n valueAxis.renderer.baseGrid.disabled = true;\n valueAxis.renderer.labels.template.disabled = true;\n valueAxis.cursorTooltipEnabled = false;\n chart.cursor = new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_16__[/* XYCursor */ \"k\"]();\n chart.cursor.lineY.disabled = true;\n chart.cursor.behavior = \"none\";\n let series = chart.series.push(new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_16__[/* LineSeries */ \"e\"]());\n series.tooltipText = \"{Period}: [bold]{value}\";\n series.dataFields.categoryX = \"Period\";\n series.dataFields.valueY = \"value\";\n series.tensionX = 0.8;\n series.strokeWidth = 1;\n series.stroke = '#fff'; // render data points as bullets\n\n let bullet = series.bullets.push(new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_16__[/* CircleBullet */ \"b\"]());\n bullet.circle.opacity = 1;\n bullet.circle.fill = color;\n bullet.circle.propertyFields.opacity = \"opacity\";\n bullet.circle.radius = 3;\n return chart;\n }", "function createLineNewChart(title, data, color, chartDiv) {\n let container = _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_15__[/* create */ \"h\"](chartDiv, _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_15__[/* Container */ \"b\"]);\n container.layout = \"horizontal\";\n container.fixedWidthGrid = true;\n container.width = _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_15__[/* percent */ \"k\"](100);\n container.height = _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_15__[/* percent */ \"k\"](100);\n let chart = container.createChild(_amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_16__[/* XYChart */ \"j\"]);\n chart.width = _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_15__[/* percent */ \"k\"](45);\n chart.height = 70;\n chart.data = data;\n chart.padding(20, 5, 2, 5);\n let categoryAxis = chart.xAxes.push(new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_16__[/* CategoryAxis */ \"a\"]());\n categoryAxis.renderer.grid.template.location = 0;\n categoryAxis.renderer.grid.template.disabled = true;\n categoryAxis.renderer.baseGrid.disabled = true;\n categoryAxis.renderer.labels.template.disabled = true;\n categoryAxis.cursorTooltipEnabled = false;\n categoryAxis.dataFields.category = \"Period\";\n let valueAxis = chart.yAxes.push(new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_16__[/* ValueAxis */ \"i\"]());\n valueAxis.min = 0;\n valueAxis.renderer.grid.template.disabled = true;\n valueAxis.renderer.baseGrid.disabled = true;\n valueAxis.renderer.labels.template.disabled = true;\n valueAxis.cursorTooltipEnabled = false;\n chart.cursor = new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_16__[/* XYCursor */ \"k\"]();\n chart.cursor.lineY.disabled = true;\n chart.cursor.behavior = \"none\";\n let series = chart.series.push(new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_16__[/* LineSeries */ \"e\"]());\n series.tooltipText = \"{Period}: [bold]{value}\";\n series.dataFields.categoryX = \"Period\";\n series.dataFields.valueY = \"value\";\n series.tensionX = 0.8;\n series.strokeWidth = 1;\n series.stroke = '#fff'; // render data points as bullets\n\n let bullet = series.bullets.push(new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_16__[/* CircleBullet */ \"b\"]());\n bullet.circle.opacity = 1;\n bullet.circle.fill = color;\n bullet.circle.propertyFields.opacity = \"opacity\";\n bullet.circle.radius = 3;\n return chart;\n }", "function createLineNewChart(title, data, color, chartDiv) {\n let container = _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_13__[/* create */ \"h\"](chartDiv, _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_13__[/* Container */ \"b\"]);\n container.layout = \"horizontal\";\n container.fixedWidthGrid = true;\n container.width = _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_13__[/* percent */ \"k\"](100);\n container.height = _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_13__[/* percent */ \"k\"](100);\n let chart = container.createChild(_amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_14__[/* XYChart */ \"j\"]);\n chart.width = _amcharts_amcharts4_core__WEBPACK_IMPORTED_MODULE_13__[/* percent */ \"k\"](45);\n chart.height = 70;\n chart.data = data;\n chart.padding(20, 5, 2, 5);\n let categoryAxis = chart.xAxes.push(new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_14__[/* CategoryAxis */ \"a\"]());\n categoryAxis.renderer.grid.template.location = 0;\n categoryAxis.renderer.grid.template.disabled = true;\n categoryAxis.renderer.baseGrid.disabled = true;\n categoryAxis.renderer.labels.template.disabled = true;\n categoryAxis.cursorTooltipEnabled = false;\n categoryAxis.dataFields.category = \"Period\";\n let valueAxis = chart.yAxes.push(new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_14__[/* ValueAxis */ \"i\"]());\n valueAxis.min = 0;\n valueAxis.renderer.grid.template.disabled = true;\n valueAxis.renderer.baseGrid.disabled = true;\n valueAxis.renderer.labels.template.disabled = true;\n valueAxis.cursorTooltipEnabled = false;\n chart.cursor = new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_14__[/* XYCursor */ \"k\"]();\n chart.cursor.lineY.disabled = true;\n chart.cursor.behavior = \"none\";\n let series = chart.series.push(new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_14__[/* LineSeries */ \"e\"]());\n series.tooltipText = \"{Period}: [bold]{value}\";\n series.dataFields.categoryX = \"Period\";\n series.dataFields.valueY = \"value\";\n series.tensionX = 0.8;\n series.strokeWidth = 1;\n series.stroke = '#fff'; // render data points as bullets\n\n let bullet = series.bullets.push(new _amcharts_amcharts4_charts__WEBPACK_IMPORTED_MODULE_14__[/* CircleBullet */ \"b\"]());\n bullet.circle.opacity = 1;\n bullet.circle.fill = color;\n bullet.circle.propertyFields.opacity = \"opacity\";\n bullet.circle.radius = 3;\n return chart;\n }", "function makeGraph (list) {\n\n var divHeight = 100\n\n var maxValue = _.max(list)\n\n var normalize = LinScale([0, maxValue], [0, divHeight])\n\n function drawMagnitude (mag) {\n return h('div.point', { style: {\n 'height': normalize(mag) + 'px'\n , 'width': '1px' \n , 'float': 'left'\n , 'padding':'1px' \n , 'background-color': '#3ee'\n }\n })\n }\n\n function maxValueAxis (v) {\n return h('div', { style: {\n 'position':'absolute'\n , 'bottom': '10px'\n , 'left': '0'\n , 'font-size': '8pt'\n , 'font-style': 'italic'\n , 'color': '#ccc'\n }}\n , v)\n }\n return h('div', { \n style: {\n 'overflow': 'hidden'\n , 'padding-bottom': '30px'\n , 'position': 'relative'\n }}, [\n list.map(drawMagnitude) \n , maxValueAxis(maxValue)\n ])\n}", "function salesHeatmap() {}", "function SizeChart() {\n\t\t// #### Chart Area ####\n\t\tme.g_chartArea.minX = 23;\n\t\tme.g_chartArea.minY = 23;\n\t\tme.g_chartArea.maxX = 54;\n\t\tme.g_chartArea.maxY = 54;\n\n\t\t// #### XAxis ####\n\t\tif (me.g_xAxis != null) {\n\t\t\tme.g_xAxis.minX = 20;\n\t\t\tme.g_xAxis.minY = 80;\n\t\t\tme.g_xAxis.maxX = 60;\n\t\t\tme.g_xAxis.maxY = 20;\n\t\t} else {\n\t\t\tme.g_chartArea.maxY += 20;\n\t\t}\n\n\t\t// #### YAxis ####\n\t\tif (me.g_yAxis != null) {\n\t\t\tme.g_yAxis.minX = 0;\n\t\t\tme.g_yAxis.minY = 20;\n\t\t\tme.g_yAxis.maxX = 20;\n\t\t\tme.g_yAxis.maxY = 60;\n\t\t\tif (me.g_xAxis == null) {\n\t\t\t\tme.g_yAxis.maxY += 20;\n\t\t\t}\n\t\t} else {\n\t\t\tif (me.g_xAxis != null) {\n\t\t\t\tme.g_xAxis.minX -= 20;\n\t\t\t\tme.g_xAxis.maxX += 20;\n\t\t\t}\n\t\t\tme.g_chartArea.minX -= 20;\n\t\t\tme.g_chartArea.maxX += 20;\n\t\t}\n\n\t\t// #### Legend ####\n\t\tif (me.g_legend != undefined) {\n\t\t\t// Dimentions\n\t\t\tme.g_legend.minX = 80;\n\t\t\tme.g_legend.minY = 20;\n\t\t\tme.g_legend.maxX = 20;\n\t\t\tme.g_legend.maxY = 80;\n\t\t} else {\n\t\t\tif (me.g_xAxis != null) me.g_xAxis.maxX += 20;\n\t\t\tme.g_chartArea.maxX += 20;\n\t\t}\n\n\t\tif (me.g_title == null) {\n\t\t\tif (me.g_legend != undefined) {\n\t\t\t\tme.g_legend.minY -= 20;\n\t\t\t\tme.g_legend.maxY += 20;\n\t\t\t}\n\t\t\tif (me.g_yAxis != null) {\n\t\t\t\tme.g_yAxis.minY -= 20;\n\t\t\t\tme.g_yAxis.maxY += 20;\n\t\t\t}\n\t\t\tme.g_chartArea.minY -= 20;\n\t\t\tme.g_chartArea.maxY += 20;\n\t\t}\n\t}", "function SVGStackedColumnChart() {\r\n }", "function make_x_gridlines() {\r\n return d3.axisBottom(xTime)\r\n }", "function make_x_gridlines() {\r\n return d3.axisBottom(xTime)\r\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 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 addChartToDashboard(name, type, sheets, row, col, lastRow, lastCol, vCol, compareStepsBack) {\n var chartBuilder = sheets['charts'].newChart();\n chartBuilder\n .setOption('title', name)\n .setOption('width', 800)\n .setOption('height', 349)\n .setOption('colors', ['#fa9d1c', '#00507d'])\n .setPosition(row, col, 0, 0);\n\n switch (type) {\n case \"column\":\n var statsRow = (vCol - 2) * 12 + 1;\n // First range for a column chart is always the same column with QS from 1 to 10.\n var dataRanges = [sheets['dataH'].getRange(1, 1, 11, 1)];\n if (compareStepsBack && lastCol > 2) {\n // The column for comparison is either the specified number of columns behind lastCol, or 2 (the first column with data).\n dataRanges.push(sheets['dataH'].getRange(statsRow, Math.max(2, lastCol - compareStepsBack), 11, 1));\n }\n dataRanges.push(sheets['dataH'].getRange(statsRow, lastCol, 11, 1));\n chartBuilder = chartBuilder.asColumnChart();\n break;\n case \"line\":\n var dataRanges = [sheets['dataV'].getRange(5, 1, lastRow - 2, 1), sheets['dataV'].getRange(5, vCol, lastRow - 2, 1)];\n chartBuilder = chartBuilder.asLineChart();\n chartBuilder.setOption(\"vAxis.maxValue\", 10);\n chartBuilder.setOption(\"vAxis.ticks\", [0, 2, 4, 6, 8, 10]);\n chartBuilder.setLegendPosition(Charts.Position.NONE);\n break;\n }\n\n for (var i in dataRanges) chartBuilder.addRange(dataRanges[i]);\n sheets['charts'].insertChart(chartBuilder.build());\n}", "function drawchart() {\r\n const filters = getFilters();\r\n const drawData = filterData(\r\n filters[\"startDate\"],\r\n filters[\"endDate\"],\r\n filters[\"provincesFilter\"]\r\n );\r\n timeLapseChart = new TimeLapseChart(\"timelapse-chart\");\r\n timeLapseChart\r\n .setTitle(\"COVID-19 ARGENTINA - EVOLUCIÓN EN EL TIEMPO\")\r\n .setColumnsStyles(columnNames)\r\n .addDatasets(drawData)\r\n .render();\r\n}", "function make_x_grid() {\n return d3.axisBottom(x).ticks(20);\n }", "function buildLineGraph(data) {\n var vis = d3.select('#visualisation'),\n xAxis = d3.svg.axis().scale(buildXScale(data)),\n yAxis = d3.svg.axis().scale(buildYScale(data));\n\n vis.append(\"svg:g\")\n .attr(\"transform\", \"translate(0,\" + (config.HEIGHT - (2 * config.MARGINS.bottom)) + \")\")\n .call(xAxis);\n\n }", "function createAxis() {\n for (var i = 0; i < picArray.length; i++) {\n titleArray.push(picArray[i].title);\n clickArray.push(picArray[i].clicked);\n viewArray.push(picArray[i].viewed);\n }\n}", "function createChart(options){var data=Chartist.normalizeData(this.data,options.reverseData,true);// Create new svg object\nthis.svg=Chartist.createSvg(this.container,options.width,options.height,options.classNames.chart);// Create groups for labels, grid and series\nvar gridGroup=this.svg.elem('g').addClass(options.classNames.gridGroup);var seriesGroup=this.svg.elem('g');var labelGroup=this.svg.elem('g').addClass(options.classNames.labelGroup);var chartRect=Chartist.createChartRect(this.svg,options,defaultOptions.padding);var axisX,axisY;if(options.axisX.type===undefined){axisX=new Chartist.StepAxis(Chartist.Axis.units.x,data.normalized.series,chartRect,Chartist.extend({},options.axisX,{ticks:data.normalized.labels,stretch:options.fullWidth}));}else {axisX=options.axisX.type.call(Chartist,Chartist.Axis.units.x,data.normalized.series,chartRect,options.axisX);}if(options.axisY.type===undefined){axisY=new Chartist.AutoScaleAxis(Chartist.Axis.units.y,data.normalized.series,chartRect,Chartist.extend({},options.axisY,{high:Chartist.isNumeric(options.high)?options.high:options.axisY.high,low:Chartist.isNumeric(options.low)?options.low:options.axisY.low}));}else {axisY=options.axisY.type.call(Chartist,Chartist.Axis.units.y,data.normalized.series,chartRect,options.axisY);}axisX.createGridAndLabels(gridGroup,labelGroup,this.supportsForeignObject,options,this.eventEmitter);axisY.createGridAndLabels(gridGroup,labelGroup,this.supportsForeignObject,options,this.eventEmitter);if(options.showGridBackground){Chartist.createGridBackground(gridGroup,chartRect,options.classNames.gridBackground,this.eventEmitter);}// Draw the series\ndata.raw.series.forEach(function(series,seriesIndex){var seriesElement=seriesGroup.elem('g');// Write attributes to series group element. If series name or meta is undefined the attributes will not be written\nseriesElement.attr({'ct:series-name':series.name,'ct:meta':Chartist.serialize(series.meta)});// Use series class from series data or if not set generate one\nseriesElement.addClass([options.classNames.series,series.className||options.classNames.series+'-'+Chartist.alphaNumerate(seriesIndex)].join(' '));var pathCoordinates=[],pathData=[];data.normalized.series[seriesIndex].forEach(function(value,valueIndex){var p={x:chartRect.x1+axisX.projectValue(value,valueIndex,data.normalized.series[seriesIndex]),y:chartRect.y1-axisY.projectValue(value,valueIndex,data.normalized.series[seriesIndex])};pathCoordinates.push(p.x,p.y);pathData.push({value:value,valueIndex:valueIndex,meta:Chartist.getMetaData(series,valueIndex)});}.bind(this));var seriesOptions={lineSmooth:Chartist.getSeriesOption(series,options,'lineSmooth'),showPoint:Chartist.getSeriesOption(series,options,'showPoint'),showLine:Chartist.getSeriesOption(series,options,'showLine'),showArea:Chartist.getSeriesOption(series,options,'showArea'),areaBase:Chartist.getSeriesOption(series,options,'areaBase')};var smoothing=typeof seriesOptions.lineSmooth==='function'?seriesOptions.lineSmooth:seriesOptions.lineSmooth?Chartist.Interpolation.monotoneCubic():Chartist.Interpolation.none();// Interpolating path where pathData will be used to annotate each path element so we can trace back the original\n// index, value and meta data\nvar path=smoothing(pathCoordinates,pathData);// If we should show points we need to create them now to avoid secondary loop\n// Points are drawn from the pathElements returned by the interpolation function\n// Small offset for Firefox to render squares correctly\nif(seriesOptions.showPoint){path.pathElements.forEach(function(pathElement){var point=seriesElement.elem('line',{x1:pathElement.x,y1:pathElement.y,x2:pathElement.x+0.01,y2:pathElement.y},options.classNames.point).attr({'ct:value':[pathElement.data.value.x,pathElement.data.value.y].filter(Chartist.isNumeric).join(','),'ct:meta':Chartist.serialize(pathElement.data.meta)});this.eventEmitter.emit('draw',{type:'point',value:pathElement.data.value,index:pathElement.data.valueIndex,meta:pathElement.data.meta,series:series,seriesIndex:seriesIndex,axisX:axisX,axisY:axisY,group:seriesElement,element:point,x:pathElement.x,y:pathElement.y});}.bind(this));}if(seriesOptions.showLine){var line=seriesElement.elem('path',{d:path.stringify()},options.classNames.line,true);this.eventEmitter.emit('draw',{type:'line',values:data.normalized.series[seriesIndex],path:path.clone(),chartRect:chartRect,index:seriesIndex,series:series,seriesIndex:seriesIndex,seriesMeta:series.meta,axisX:axisX,axisY:axisY,group:seriesElement,element:line});}// Area currently only works with axes that support a range!\nif(seriesOptions.showArea&&axisY.range){// If areaBase is outside the chart area (< min or > max) we need to set it respectively so that\n// the area is not drawn outside the chart area.\nvar areaBase=Math.max(Math.min(seriesOptions.areaBase,axisY.range.max),axisY.range.min);// We project the areaBase value into screen coordinates\nvar areaBaseProjected=chartRect.y1-axisY.projectValue(areaBase);// In order to form the area we'll first split the path by move commands so we can chunk it up into segments\npath.splitByCommand('M').filter(function onlySolidSegments(pathSegment){// We filter only \"solid\" segments that contain more than one point. Otherwise there's no need for an area\nreturn pathSegment.pathElements.length>1;}).map(function convertToArea(solidPathSegments){// Receiving the filtered solid path segments we can now convert those segments into fill areas\nvar firstElement=solidPathSegments.pathElements[0];var lastElement=solidPathSegments.pathElements[solidPathSegments.pathElements.length-1];// Cloning the solid path segment with closing option and removing the first move command from the clone\n// We then insert a new move that should start at the area base and draw a straight line up or down\n// at the end of the path we add an additional straight line to the projected area base value\n// As the closing option is set our path will be automatically closed\nreturn solidPathSegments.clone(true).position(0).remove(1).move(firstElement.x,areaBaseProjected).line(firstElement.x,firstElement.y).position(solidPathSegments.pathElements.length+1).line(lastElement.x,areaBaseProjected);}).forEach(function createArea(areaPath){// For each of our newly created area paths, we'll now create path elements by stringifying our path objects\n// and adding the created DOM elements to the correct series group\nvar area=seriesElement.elem('path',{d:areaPath.stringify()},options.classNames.area,true);// Emit an event for each area that was drawn\nthis.eventEmitter.emit('draw',{type:'area',values:data.normalized.series[seriesIndex],path:areaPath.clone(),series:series,seriesIndex:seriesIndex,axisX:axisX,axisY:axisY,chartRect:chartRect,index:seriesIndex,group:seriesElement,element:area});}.bind(this));}}.bind(this));this.eventEmitter.emit('created',{bounds:axisY.bounds,chartRect:chartRect,axisX:axisX,axisY:axisY,svg:this.svg,options:options});}", "function drawWowChart(distance, air_temperature, datetimes, rainfall) {\n var data = new google.visualization.DataTable();\n data.addColumn('datetime', 'datetime');\n data.addColumn('number', 'air_temp');\n data.addColumn('number', 'rainfall');\n for (i = air_temperature.length - 1; i >= 0; i--) {\n var date_str = datetimes[i];\n var my_date = new Date(date_str);\n data.addRow([my_date,\n air_temperature[i], \n rainfall[i],\n ]);\n }\n var options = {\n title: 'WOW Site ' + distance + ' km away',\n legend: {position: 'bottom'},\n height: 400,\n };\n var chart = new google.visualization.LineChart(document.getElementById('wow_line_chart'));\n chart.draw(data, options);\n}", "function make_x_gridlines() {\n return d3.axisBottom(x)\n .ticks(30);\n }", "function horizontalScale() {\n if (svg.element.select('.horizontalScale')) svg.element.select('.horizontalScale').remove()\n if (ruler.container) ruler.container.remove()\n ruler.container = svg.element\n .append('g')\n .attr('transform', 'translate(' + [ruler.y, ruler.x] + ')')\n .attr('class', 'horizontalScale')\n\n ruler.container.append('path')\n .attr('d', d => 'M' + ruler.padding + ',10L' + (ruler.width + ruler.padding) + ',10')\n .attr('stroke-width', 1)\n .attr('stroke', '#000')\n\n ruler.element = ruler.container\n .append('text')\n .attr('class', 'ruler-text')\n .attr('x', ruler.width / 2 + ruler.padding)\n .attr('y', 36)\n .attr('font-family', 'sans-serif')\n .text('')\n .attr('font-size', '14px')\n .attr('fill', '#000')\n .attr('text-anchor', 'middle')\n }", "function makeChart() {\n this.chartPanel = new Ext.Window({\n width: 600,\n height: 450,\n title: \"Profil altimetrique\",\n html: '<div id=\"chartcontainer\"></div>',\n cls: 'chart-panel',\n closable: true,\n closeAction: 'hide'\n });\n\n chartPanel.show();\n chartPanel.hide();\n\n this.chart = new Highcharts.Chart({\n chart: {\n renderTo: 'chartcontainer',\n type: 'line'\n },\n width: '590px',\n height: '355px',\n title: {\n text: 'Profile altimétrique'\n },\n tooltip: {\n formatter: function() {\n return '<b>' + this.key + '</b><br/>' +\n this.x + 'km à ' + this.y + 'm';\n }\n },\n xAxis: {\n title: {\n text: 'Distance [km]'\n },\n plotLines: [{\n value: 0,\n width: 1,\n color: '#808080'\n }]\n },\n yAxis: {\n title: {\n text: 'Elévation [m]'\n },\n plotLines: [{\n value: 0,\n width: 1,\n color: '#808080'\n }],\n series: null\n }\n });\n}", "function createAxes() {\n //create x axis svg\n xAxisSVG = diagramG.append('g')\n .style('fill', 'none')\n .style('shape-rendering', 'crispEdges')\n .attr('transform', 'translate(0,' + (height - margin.bottom - margin.top) + ')')\n .attr('class', 'eve-x-axis')\n .call(xAxis);\n\n //create y axis left svg\n yAxisSVG = diagramG.append('g')\n .style('fill', 'none')\n .style('shape-rendering', 'crispEdges')\n .attr('transform', 'translate(0)')\n .attr('class', 'eve-y-axis')\n .call(yAxis);\n\n //set axes styling\n updateAxisStyle();\n }", "function startChart(){\n\tgoogle.load('visualization', '1', { packages: ['corechart'], callback: function() {\n\t\tvar date = new Date(), \t\t\n\t\tarr=[];\n\t\n\t\tminutes = date.getMinutes()+'';\n\t\tif (minutes.length < 2){ minutes = '0'+minutes;}\n\t\tarr.push(date.getHours() + ':' + minutes);\n\t\tfor(var i=0;i<9;i++){\n\t\t date.setMinutes(date.getMinutes() - interval);\n\t\t minutes = date.getMinutes()+'';\n\t\t if (minutes.length < 2){ minutes = '0'+minutes;}\n\t\t arr.push(date.getHours() + ':' + minutes);\n\t\t}\n\t\t\n\t\tvar data = new google.visualization.DataTable();\n\t\t\tdata.addColumn('string', '');\n\t data.addColumn('number', 'Configurations');\n\t data.addRows(10);\n\t for (var i=9, j=0; i>=0; i--, j++){\n\t\t data.setValue(j, 0, arr[i]);\n\t }\n\t \n\t for (var i=0; i<10; i++){\n\t\t data.setValue(i, 1, 0);\n\t }\n\t \n\t var chartData = count();\n\n\t var totalMax = Math.max.apply(null, chartData);\n\t var totalMin = Math.min.apply(null, chartData);;\n\t \n\t var roundingExp = Math.floor(Math.log(totalMax) / Math.LN10);\n\t var roundingDec = Math.pow(10,roundingExp);\n\n\t var newMax = Math.ceil(totalMax/roundingDec)*roundingDec;\n\t var newMin = Math.floor(totalMin/roundingDec)*roundingDec;\n\n\t var range = newMax - newMin;\n\t var gridLines = 5;\n\t for (var i = 2; i <= 5; ++i) {\n\t if ( Math.round(range/i) === range/i) {\n\t gridLines = i;\n\t }\n\t } \n\t \n\t var options = {\n\t title: 'Recent configurations created',\n\t width: '825',\n\t height: '500',\n\t hAxis: {title: 'Time of day'},\n\t vAxis: {title: 'Quantity', format: '#', viewWindow: {min:0}, gridlines:{count: gridLines}},\n\t animation:{\n\t duration: 450,\n\t easing: 'out'\n\t }\n\t };\n\t var chart = new google.visualization.LineChart(document.getElementById('chart1'));\n\t var index = 0;\n\t var drawChart = function() {\n\t \tif (index < chartData.length) {\n\t \t\tdata.setValue(index, 1, chartData[index++]);\n\t chart.draw(data, options);\n\t \t}\n\t };\n\t\n\t google.visualization.events.addListener(chart, 'animationfinish', drawChart);\n\t chart.draw(data, options);\n\t drawChart();\n\t\t}\n\t});\n}", "function make_x_gridlines() {\t\t\n return d3.axisBottom(x)\n .ticks(5)\n }", "drawAxes(hlabel, hs, he, vlabel, vs, ve, w, h) {\n h = h || this.height;\n w = w || this.width;\n\n this.line(0, 0, w, 0);\n this.line(0, 0, 0, h);\n\n const hpos = 0 - 5;\n this.text(`${hlabel} →`, w / 2, hpos, this.CENTER);\n this.text(hs, 0, hpos, this.CENTER);\n this.text(he, w, hpos, this.CENTER);\n\n const vpos = -10;\n this.text(`${vlabel}\\n↓`, vpos, h / 2, this.RIGHT);\n this.text(vs, vpos, 0 + 5, this.RIGHT);\n this.text(ve, vpos, h, this.RIGHT);\n }", "function createHorizontal(trigEl, durat, tween) {\n return new ScrollMagic.Scene({\n triggerElement: trigEl,\n triggerHook: \"onLeave\",\n duration: durat,\n })\n .setPin(trigEl)\n .setTween(tween)\n /*.addIndicators({\n colorTrigger: \"white\",\n colorStart: \"white\",\n colorEnd: \"white\",\n })*/\n .addTo(controller);\n }", "function createDiagram(categoriesArr, linesArr, textTitle) {\n if ($('body').width() < 767) {\n var legendLayout = 'horizontal',\n legendVAlign = 'bottom',\n offsetY = 0,\n legendAlign = 'center'\n } else {\n var legendLayout = 'vertical',\n legendVAlign = 'top',\n offsetY = 50,\n legendAlign = 'right'\n }\n\n $('#container_diagram').highcharts({\n plotOptions: {\n series: {\n marker: {\n symbol: 'circle',\n\n }\n }\n },\n title: {\n text: textTitle\n },\n chart: {\n type: 'line',\n\n },\n subtitle: {\n\n },\n xAxis: {\n categories: categoriesArr,\n gridLineDashStyle: 'ShortDot',\n gridLineWidth: 1\n },\n yAxis: {\n gridLineDashStyle: 'ShortDot',\n title: {\n text: ''\n }\n },\n tooltip: {\n valueSuffix: ' л'\n },\n legend: {\n layout: legendLayout,\n align: legendAlign,\n verticalAlign: legendVAlign,\n y: offsetY,\n padding: 3,\n itemMarginTop: 5,\n itemMarginBottom: 5,\n itemStyle: {\n lineHeight: '14px'\n }\n },\n series: linesArr\n });\n }", "function addAxes(parent, config, data) {\n var axes = parent.append('svg:g');\n axes.append('svg:line')\n .attr('class', 'vertical axis')\n .attr('x1', config.left)\n .attr('x2', config.left)\n .attr('y1', config.top)\n .attr('y2', config.bottom);\n axes.append('svg:line')\n .attr('class', 'horizontal axis')\n .attr('x1', config.left)\n .attr('x2', config.right)\n .attr('y1', config.bottom)\n .attr('y2', config.bottom);\n\n return axes;\n }", "createXAxis(data) {\n\n if (!data || data.length === 0) return;\n\n this.svg.selectAll('.xLabel').data(data).enter().append('text')\n .attr('class', 'xLabel')\n .attr('x', (d) => {return this.x(d.x)})\n .attr('y', this.height)\n .attr('fill', this.theme.value)\n .style('text-anchor', 'middle')\n .style('font-size', 10)\n .text((d) => {return this.props.xAxisTransform(d.x)})\n\n }", "function SVGStackedAreaChart() {\r\n }", "function make_x_gridlines() {\n return d3.axisBottom(x)\n\n }", "function createChart(options) {\n var seriesGroups = [],\n normalizedData = Chartist.normalizeDataArray(Chartist.getDataArray(this.data, options.reverseData), this.data.labels.length),\n normalizedPadding = Chartist.normalizePadding(options.chartPadding, defaultOptions.padding),\n highLow;\n\n // Create new svg element\n this.svg = Chartist.createSvg(this.container, options.width, options.height, options.classNames.chart);\n\n if(options.stackBars) {\n // If stacked bars we need to calculate the high low from stacked values from each series\n var serialSums = Chartist.serialMap(normalizedData, function serialSums() {\n return Array.prototype.slice.call(arguments).reduce(Chartist.sum, 0);\n });\n\n highLow = Chartist.getHighLow([serialSums]);\n } else {\n highLow = Chartist.getHighLow(normalizedData);\n }\n // Overrides of high / low from settings\n highLow.high = +options.high || (options.high === 0 ? 0 : highLow.high);\n highLow.low = +options.low || (options.low === 0 ? 0 : highLow.low);\n\n var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);\n\n var valueAxis,\n labelAxis;\n\n if(options.horizontalBars) {\n labelAxis = new Chartist.StepAxis(\n Chartist.Axis.units.y,\n chartRect,\n function timeAxisTransform(projectedValue) {\n projectedValue.pos = chartRect.y1 - projectedValue.pos;\n return projectedValue;\n },\n {\n x: normalizedPadding.left + options.axisY.labelOffset.x + (this.supportsForeignObject ? -10 : 0),\n y: options.axisY.labelOffset.y - chartRect.height() / this.data.labels.length\n },\n {\n stepCount: this.data.labels.length,\n stretch: options.fullHeight\n }\n );\n\n valueAxis = new Chartist.LinearScaleAxis(\n Chartist.Axis.units.x,\n chartRect,\n function valueAxisTransform(projectedValue) {\n projectedValue.pos = chartRect.x1 + projectedValue.pos;\n return projectedValue;\n },\n {\n x: options.axisX.labelOffset.x,\n y: chartRect.y1 + options.axisX.labelOffset.y + (this.supportsForeignObject ? 5 : 20)\n },\n {\n highLow: highLow,\n scaleMinSpace: options.axisX.scaleMinSpace,\n referenceValue: 0\n }\n );\n } else {\n labelAxis = new Chartist.StepAxis(\n Chartist.Axis.units.x,\n chartRect,\n function timeAxisTransform(projectedValue) {\n projectedValue.pos = chartRect.x1 + projectedValue.pos;\n return projectedValue;\n },\n {\n x: options.axisX.labelOffset.x,\n y: chartRect.y1 + options.axisX.labelOffset.y + (this.supportsForeignObject ? 5 : 20)\n },\n {\n stepCount: this.data.labels.length\n }\n );\n\n valueAxis = new Chartist.LinearScaleAxis(\n Chartist.Axis.units.y,\n chartRect,\n function valueAxisTransform(projectedValue) {\n projectedValue.pos = chartRect.y1 - projectedValue.pos;\n return projectedValue;\n },\n {\n x: normalizedPadding.left + options.axisY.labelOffset.x + (this.supportsForeignObject ? -10 : 0),\n y: options.axisY.labelOffset.y + (this.supportsForeignObject ? -15 : 0)\n },\n {\n highLow: highLow,\n scaleMinSpace: options.axisY.scaleMinSpace,\n referenceValue: 0\n }\n );\n }\n\n // Start drawing\n var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup),\n gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup),\n // Projected 0 point\n zeroPoint = options.horizontalBars ? (chartRect.x1 + valueAxis.projectValue(0).pos) : (chartRect.y1 - valueAxis.projectValue(0).pos),\n // Used to track the screen coordinates of stacked bars\n stackedBarValues = [];\n\n Chartist.createAxis(\n labelAxis,\n this.data.labels,\n chartRect,\n gridGroup,\n labelGroup,\n this.supportsForeignObject,\n options,\n this.eventEmitter\n );\n\n Chartist.createAxis(\n valueAxis,\n valueAxis.bounds.values,\n chartRect,\n gridGroup,\n labelGroup,\n this.supportsForeignObject,\n options,\n this.eventEmitter\n );\n\n // Draw the series\n this.data.series.forEach(function(series, seriesIndex) {\n // Calculating bi-polar value of index for seriesOffset. For i = 0..4 biPol will be -1.5, -0.5, 0.5, 1.5 etc.\n var biPol = seriesIndex - (this.data.series.length - 1) / 2,\n // Half of the period width between vertical grid lines used to position bars\n periodHalfLength = chartRect[labelAxis.units.len]() / normalizedData[seriesIndex].length / 2;\n\n seriesGroups[seriesIndex] = this.svg.elem('g');\n\n // Write attributes to series group element. If series name or meta is undefined the attributes will not be written\n seriesGroups[seriesIndex].attr({\n 'series-name': series.name,\n 'meta': Chartist.serialize(series.meta)\n }, Chartist.xmlNs.uri);\n\n // Use series class from series data or if not set generate one\n seriesGroups[seriesIndex].addClass([\n options.classNames.series,\n (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex))\n ].join(' '));\n\n normalizedData[seriesIndex].forEach(function(value, valueIndex) {\n var projected = {\n x: chartRect.x1 + (options.horizontalBars ? valueAxis : labelAxis).projectValue(value, valueIndex, normalizedData[seriesIndex]).pos,\n y: chartRect.y1 - (options.horizontalBars ? labelAxis : valueAxis).projectValue(value, valueIndex, normalizedData[seriesIndex]).pos\n },\n bar,\n previousStack;\n\n // Offset to center bar between grid lines\n projected[labelAxis.units.pos] += periodHalfLength * (options.horizontalBars ? -1 : 1);\n // Using bi-polar offset for multiple series if no stacked bars are used\n projected[labelAxis.units.pos] += options.stackBars ? 0 : biPol * options.seriesBarDistance * (options.horizontalBars ? -1 : 1);\n\n // Enter value in stacked bar values used to remember previous screen value for stacking up bars\n previousStack = stackedBarValues[valueIndex] || zeroPoint;\n stackedBarValues[valueIndex] = previousStack - (zeroPoint - projected[labelAxis.counterUnits.pos]);\n\n var positions = {};\n positions[labelAxis.units.pos + '1'] = projected[labelAxis.units.pos];\n positions[labelAxis.units.pos + '2'] = projected[labelAxis.units.pos];\n // If bars are stacked we use the stackedBarValues reference and otherwise base all bars off the zero line\n positions[labelAxis.counterUnits.pos + '1'] = options.stackBars ? previousStack : zeroPoint;\n positions[labelAxis.counterUnits.pos + '2'] = options.stackBars ? stackedBarValues[valueIndex] : projected[labelAxis.counterUnits.pos];\n\n bar = seriesGroups[seriesIndex].elem('line', positions, options.classNames.bar).attr({\n 'value': value,\n 'meta': Chartist.getMetaData(series, valueIndex)\n }, Chartist.xmlNs.uri);\n\n this.eventEmitter.emit('draw', Chartist.extend({\n type: 'bar',\n value: value,\n index: valueIndex,\n chartRect: chartRect,\n group: seriesGroups[seriesIndex],\n element: bar\n }, positions));\n }.bind(this));\n }.bind(this));\n\n this.eventEmitter.emit('created', {\n bounds: valueAxis.bounds,\n chartRect: chartRect,\n svg: this.svg,\n options: options\n });\n }", "function make_x_gridlines() { \n return d3.axisBottom(x)\n .ticks(10)\n }", "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 make_x_gridlines() {\t\t\r\n\t\treturn d3.axisBottom(x)\r\n\t\t\t.ticks(20)\r\n\t}", "function SVGColumnChart() {\r\n }", "function chart(selection) {\n selection.each(function(data) {\n var availableWidth = width - margin.left - margin.right,\n availableHeight = height - margin.top - margin.bottom,\n container = d3.select(this);\n\n\n //------------------------------------------------------------\n // Setup Scales\n\n x .domain(xDomain || d3.extent(data[0].values.map(getX).concat(forceX) ));\n\n if (padData)\n x.range(xRange || [availableWidth * .5 / data[0].values.length, availableWidth * (data[0].values.length - .5) / data[0].values.length ]);\n else\n x.range(xRange || [0, availableWidth]);\n\n y .domain(yDomain || [\n d3.min(data[0].values.map(getLow).concat(forceY)),\n d3.max(data[0].values.map(getHigh).concat(forceY))\n ])\n .range(yRange || [availableHeight, 0]);\n\n // If scale's domain don't have a range, slightly adjust to make one... so a chart can show a single data point\n if (x.domain()[0] === x.domain()[1])\n x.domain()[0] ?\n x.domain([x.domain()[0] - x.domain()[0] * 0.01, x.domain()[1] + x.domain()[1] * 0.01])\n : x.domain([-1,1]);\n\n if (y.domain()[0] === y.domain()[1])\n y.domain()[0] ?\n y.domain([y.domain()[0] + y.domain()[0] * 0.01, y.domain()[1] - y.domain()[1] * 0.01])\n : y.domain([-1,1]);\n\n //------------------------------------------------------------\n\n\n //------------------------------------------------------------\n // Setup containers and skeleton of chart\n\n var wrap = d3.select(this).selectAll('g.nv-wrap.nv-ohlcBar').data([data[0].values]);\n var wrapEnter = wrap.enter().append('g').attr('class', 'nvd3 nv-wrap nv-ohlcBar');\n var defsEnter = wrapEnter.append('defs');\n var gEnter = wrapEnter.append('g');\n var g = wrap.select('g');\n\n gEnter.append('g').attr('class', 'nv-ticks');\n\n wrap.attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');\n\n //------------------------------------------------------------\n\n\n container\n .on('click', function(d,i) {\n dispatch.chartClick({\n data: d,\n index: i,\n pos: d3.event,\n id: id\n });\n });\n\n\n defsEnter.append('clipPath')\n .attr('id', 'nv-chart-clip-path-' + id)\n .append('rect');\n\n wrap.select('#nv-chart-clip-path-' + id + ' rect')\n .attr('width', availableWidth)\n .attr('height', availableHeight);\n\n g .attr('clip-path', clipEdge ? 'url(#nv-chart-clip-path-' + id + ')' : '');\n\n\n\n var ticks = wrap.select('.nv-ticks').selectAll('.nv-tick')\n .data(function(d) { return d });\n\n ticks.exit().remove();\n\n\n var ticksEnter = ticks.enter().append('path')\n .attr('class', function(d,i,j) { return (getOpen(d,i) > getClose(d,i) ? 'nv-tick negative' : 'nv-tick positive') + ' nv-tick-' + j + '-' + i })\n .attr('d', function(d,i) {\n var w = (availableWidth / data[0].values.length) * .9;\n return 'm0,0l0,'\n + (y(getOpen(d,i))\n - y(getHigh(d,i)))\n + 'l'\n + (-w/2)\n + ',0l'\n + (w/2)\n + ',0l0,'\n + (y(getLow(d,i)) - y(getOpen(d,i)))\n + 'l0,'\n + (y(getClose(d,i))\n - y(getLow(d,i)))\n + 'l'\n + (w/2)\n + ',0l'\n + (-w/2)\n + ',0z';\n })\n .attr('transform', function(d,i) { return 'translate(' + x(getX(d,i)) + ',' + y(getHigh(d,i)) + ')'; })\n //.attr('fill', function(d,i) { return color[0]; })\n //.attr('stroke', function(d,i) { return color[0]; })\n //.attr('x', 0 )\n //.attr('y', function(d,i) { return y(Math.max(0, getY(d,i))) })\n //.attr('height', function(d,i) { return Math.abs(y(getY(d,i)) - y(0)) })\n .on('mouseover', function(d,i) {\n d3.select(this).classed('hover', true);\n dispatch.elementMouseover({\n point: d,\n series: data[0],\n pos: [x(getX(d,i)), y(getY(d,i))], // TODO: Figure out why the value appears to be shifted\n pointIndex: i,\n seriesIndex: 0,\n e: d3.event\n });\n\n })\n .on('mouseout', function(d,i) {\n d3.select(this).classed('hover', false);\n dispatch.elementMouseout({\n point: d,\n series: data[0],\n pointIndex: i,\n seriesIndex: 0,\n e: d3.event\n });\n })\n .on('click', function(d,i) {\n dispatch.elementClick({\n //label: d[label],\n value: getY(d,i),\n data: d,\n index: i,\n pos: [x(getX(d,i)), y(getY(d,i))],\n e: d3.event,\n id: id\n });\n d3.event.stopPropagation();\n })\n .on('dblclick', function(d,i) {\n dispatch.elementDblClick({\n //label: d[label],\n value: getY(d,i),\n data: d,\n index: i,\n pos: [x(getX(d,i)), y(getY(d,i))],\n e: d3.event,\n id: id\n });\n d3.event.stopPropagation();\n });\n\n ticks\n .attr('class', function(d,i,j) { return (getOpen(d,i) > getClose(d,i) ? 'nv-tick negative' : 'nv-tick positive') + ' nv-tick-' + j + '-' + i })\n d3.transition(ticks)\n .attr('transform', function(d,i) { return 'translate(' + x(getX(d,i)) + ',' + y(getHigh(d,i)) + ')'; })\n .attr('d', function(d,i) {\n var w = (availableWidth / data[0].values.length) * .9;\n return 'm0,0l0,'\n + (y(getOpen(d,i))\n - y(getHigh(d,i)))\n + 'l'\n + (-w/2)\n + ',0l'\n + (w/2)\n + ',0l0,'\n + (y(getLow(d,i))\n - y(getOpen(d,i)))\n + 'l0,'\n + (y(getClose(d,i))\n - y(getLow(d,i)))\n + 'l'\n + (w/2)\n + ',0l'\n + (-w/2)\n + ',0z';\n })\n //.attr('width', (availableWidth / data[0].values.length) * .9 )\n\n\n //d3.transition(ticks)\n //.attr('y', function(d,i) { return y(Math.max(0, getY(d,i))) })\n //.attr('height', function(d,i) { return Math.abs(y(getY(d,i)) - y(0)) });\n //.order(); // not sure if this makes any sense for this model\n\n });\n\n return chart;\n }", "function chart(selection) {\n selection.each(function(data) {\n var availableWidth = width - margin.left - margin.right,\n availableHeight = height - margin.top - margin.bottom,\n container = d3.select(this);\n\n\n //------------------------------------------------------------\n // Setup Scales\n\n x .domain(xDomain || d3.extent(data[0].values.map(getX).concat(forceX) ));\n\n if (padData)\n x.range(xRange || [availableWidth * .5 / data[0].values.length, availableWidth * (data[0].values.length - .5) / data[0].values.length ]);\n else\n x.range(xRange || [0, availableWidth]);\n\n y .domain(yDomain || [\n d3.min(data[0].values.map(getLow).concat(forceY)),\n d3.max(data[0].values.map(getHigh).concat(forceY))\n ])\n .range(yRange || [availableHeight, 0]);\n\n // If scale's domain don't have a range, slightly adjust to make one... so a chart can show a single data point\n if (x.domain()[0] === x.domain()[1])\n x.domain()[0] ?\n x.domain([x.domain()[0] - x.domain()[0] * 0.01, x.domain()[1] + x.domain()[1] * 0.01])\n : x.domain([-1,1]);\n\n if (y.domain()[0] === y.domain()[1])\n y.domain()[0] ?\n y.domain([y.domain()[0] + y.domain()[0] * 0.01, y.domain()[1] - y.domain()[1] * 0.01])\n : y.domain([-1,1]);\n\n //------------------------------------------------------------\n\n\n //------------------------------------------------------------\n // Setup containers and skeleton of chart\n\n var wrap = d3.select(this).selectAll('g.nv-wrap.nv-ohlcBar').data([data[0].values]);\n var wrapEnter = wrap.enter().append('g').attr('class', 'nvd3 nv-wrap nv-ohlcBar');\n var defsEnter = wrapEnter.append('defs');\n var gEnter = wrapEnter.append('g');\n var g = wrap.select('g');\n\n gEnter.append('g').attr('class', 'nv-ticks');\n\n wrap.attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');\n\n //------------------------------------------------------------\n\n\n container\n .on('click', function(d,i) {\n dispatch.chartClick({\n data: d,\n index: i,\n pos: d3.event,\n id: id\n });\n });\n\n\n defsEnter.append('clipPath')\n .attr('id', 'nv-chart-clip-path-' + id)\n .append('rect');\n\n wrap.select('#nv-chart-clip-path-' + id + ' rect')\n .attr('width', availableWidth)\n .attr('height', availableHeight);\n\n g .attr('clip-path', clipEdge ? 'url(#nv-chart-clip-path-' + id + ')' : '');\n\n\n\n var ticks = wrap.select('.nv-ticks').selectAll('.nv-tick')\n .data(function(d) { return d });\n\n ticks.exit().remove();\n\n\n var ticksEnter = ticks.enter().append('path')\n .attr('class', function(d,i,j) { return (getOpen(d,i) > getClose(d,i) ? 'nv-tick negative' : 'nv-tick positive') + ' nv-tick-' + j + '-' + i })\n .attr('d', function(d,i) {\n var w = (availableWidth / data[0].values.length) * .9;\n return 'm0,0l0,'\n + (y(getOpen(d,i))\n - y(getHigh(d,i)))\n + 'l'\n + (-w/2)\n + ',0l'\n + (w/2)\n + ',0l0,'\n + (y(getLow(d,i)) - y(getOpen(d,i)))\n + 'l0,'\n + (y(getClose(d,i))\n - y(getLow(d,i)))\n + 'l'\n + (w/2)\n + ',0l'\n + (-w/2)\n + ',0z';\n })\n .attr('transform', function(d,i) { return 'translate(' + x(getX(d,i)) + ',' + y(getHigh(d,i)) + ')'; })\n //.attr('fill', function(d,i) { return color[0]; })\n //.attr('stroke', function(d,i) { return color[0]; })\n //.attr('x', 0 )\n //.attr('y', function(d,i) { return y(Math.max(0, getY(d,i))) })\n //.attr('height', function(d,i) { return Math.abs(y(getY(d,i)) - y(0)) })\n .on('mouseover', function(d,i) {\n d3.select(this).classed('hover', true);\n dispatch.elementMouseover({\n point: d,\n series: data[0],\n pos: [x(getX(d,i)), y(getY(d,i))], // TODO: Figure out why the value appears to be shifted\n pointIndex: i,\n seriesIndex: 0,\n e: d3.event\n });\n\n })\n .on('mouseout', function(d,i) {\n d3.select(this).classed('hover', false);\n dispatch.elementMouseout({\n point: d,\n series: data[0],\n pointIndex: i,\n seriesIndex: 0,\n e: d3.event\n });\n })\n .on('click', function(d,i) {\n dispatch.elementClick({\n //label: d[label],\n value: getY(d,i),\n data: d,\n index: i,\n pos: [x(getX(d,i)), y(getY(d,i))],\n e: d3.event,\n id: id\n });\n d3.event.stopPropagation();\n })\n .on('dblclick', function(d,i) {\n dispatch.elementDblClick({\n //label: d[label],\n value: getY(d,i),\n data: d,\n index: i,\n pos: [x(getX(d,i)), y(getY(d,i))],\n e: d3.event,\n id: id\n });\n d3.event.stopPropagation();\n });\n\n ticks\n .attr('class', function(d,i,j) { return (getOpen(d,i) > getClose(d,i) ? 'nv-tick negative' : 'nv-tick positive') + ' nv-tick-' + j + '-' + i })\n d3.transition(ticks)\n .attr('transform', function(d,i) { return 'translate(' + x(getX(d,i)) + ',' + y(getHigh(d,i)) + ')'; })\n .attr('d', function(d,i) {\n var w = (availableWidth / data[0].values.length) * .9;\n return 'm0,0l0,'\n + (y(getOpen(d,i))\n - y(getHigh(d,i)))\n + 'l'\n + (-w/2)\n + ',0l'\n + (w/2)\n + ',0l0,'\n + (y(getLow(d,i))\n - y(getOpen(d,i)))\n + 'l0,'\n + (y(getClose(d,i))\n - y(getLow(d,i)))\n + 'l'\n + (w/2)\n + ',0l'\n + (-w/2)\n + ',0z';\n })\n //.attr('width', (availableWidth / data[0].values.length) * .9 )\n\n\n //d3.transition(ticks)\n //.attr('y', function(d,i) { return y(Math.max(0, getY(d,i))) })\n //.attr('height', function(d,i) { return Math.abs(y(getY(d,i)) - y(0)) });\n //.order(); // not sure if this makes any sense for this model\n\n });\n\n return chart;\n }", "function chart(selection) {\n selection.each(function(data) {\n var availableWidth = width - margin.left - margin.right,\n availableHeight = height - margin.top - margin.bottom,\n container = d3.select(this);\n\n\n //------------------------------------------------------------\n // Setup Scales\n\n x .domain(xDomain || d3.extent(data[0].values.map(getX).concat(forceX) ));\n\n if (padData)\n x.range(xRange || [availableWidth * .5 / data[0].values.length, availableWidth * (data[0].values.length - .5) / data[0].values.length ]);\n else\n x.range(xRange || [0, availableWidth]);\n\n y .domain(yDomain || [\n d3.min(data[0].values.map(getLow).concat(forceY)),\n d3.max(data[0].values.map(getHigh).concat(forceY))\n ])\n .range(yRange || [availableHeight, 0]);\n\n // If scale's domain don't have a range, slightly adjust to make one... so a chart can show a single data point\n if (x.domain()[0] === x.domain()[1])\n x.domain()[0] ?\n x.domain([x.domain()[0] - x.domain()[0] * 0.01, x.domain()[1] + x.domain()[1] * 0.01])\n : x.domain([-1,1]);\n\n if (y.domain()[0] === y.domain()[1])\n y.domain()[0] ?\n y.domain([y.domain()[0] + y.domain()[0] * 0.01, y.domain()[1] - y.domain()[1] * 0.01])\n : y.domain([-1,1]);\n\n //------------------------------------------------------------\n\n\n //------------------------------------------------------------\n // Setup containers and skeleton of chart\n\n var wrap = d3.select(this).selectAll('g.nv-wrap.nv-ohlcBar').data([data[0].values]);\n var wrapEnter = wrap.enter().append('g').attr('class', 'nvd3 nv-wrap nv-ohlcBar');\n var defsEnter = wrapEnter.append('defs');\n var gEnter = wrapEnter.append('g');\n var g = wrap.select('g');\n\n gEnter.append('g').attr('class', 'nv-ticks');\n\n wrap.attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');\n\n //------------------------------------------------------------\n\n\n container\n .on('click', function(d,i) {\n dispatch.chartClick({\n data: d,\n index: i,\n pos: d3.event,\n id: id\n });\n });\n\n\n defsEnter.append('clipPath')\n .attr('id', 'nv-chart-clip-path-' + id)\n .append('rect');\n\n wrap.select('#nv-chart-clip-path-' + id + ' rect')\n .attr('width', availableWidth)\n .attr('height', availableHeight);\n\n g .attr('clip-path', clipEdge ? 'url(#nv-chart-clip-path-' + id + ')' : '');\n\n\n\n var ticks = wrap.select('.nv-ticks').selectAll('.nv-tick')\n .data(function(d) { return d });\n\n ticks.exit().remove();\n\n\n var ticksEnter = ticks.enter().append('path')\n .attr('class', function(d,i,j) { return (getOpen(d,i) > getClose(d,i) ? 'nv-tick negative' : 'nv-tick positive') + ' nv-tick-' + j + '-' + i })\n .attr('d', function(d,i) {\n var w = (availableWidth / data[0].values.length) * .9;\n return 'm0,0l0,'\n + (y(getOpen(d,i))\n - y(getHigh(d,i)))\n + 'l'\n + (-w/2)\n + ',0l'\n + (w/2)\n + ',0l0,'\n + (y(getLow(d,i)) - y(getOpen(d,i)))\n + 'l0,'\n + (y(getClose(d,i))\n - y(getLow(d,i)))\n + 'l'\n + (w/2)\n + ',0l'\n + (-w/2)\n + ',0z';\n })\n .attr('transform', function(d,i) { return 'translate(' + x(getX(d,i)) + ',' + y(getHigh(d,i)) + ')'; })\n //.attr('fill', function(d,i) { return color[0]; })\n //.attr('stroke', function(d,i) { return color[0]; })\n //.attr('x', 0 )\n //.attr('y', function(d,i) { return y(Math.max(0, getY(d,i))) })\n //.attr('height', function(d,i) { return Math.abs(y(getY(d,i)) - y(0)) })\n .on('mouseover', function(d,i) {\n d3.select(this).classed('hover', true);\n dispatch.elementMouseover({\n point: d,\n series: data[0],\n pos: [x(getX(d,i)), y(getY(d,i))], // TODO: Figure out why the value appears to be shifted\n pointIndex: i,\n seriesIndex: 0,\n e: d3.event\n });\n\n })\n .on('mouseout', function(d,i) {\n d3.select(this).classed('hover', false);\n dispatch.elementMouseout({\n point: d,\n series: data[0],\n pointIndex: i,\n seriesIndex: 0,\n e: d3.event\n });\n })\n .on('click', function(d,i) {\n dispatch.elementClick({\n //label: d[label],\n value: getY(d,i),\n data: d,\n index: i,\n pos: [x(getX(d,i)), y(getY(d,i))],\n e: d3.event,\n id: id\n });\n d3.event.stopPropagation();\n })\n .on('dblclick', function(d,i) {\n dispatch.elementDblClick({\n //label: d[label],\n value: getY(d,i),\n data: d,\n index: i,\n pos: [x(getX(d,i)), y(getY(d,i))],\n e: d3.event,\n id: id\n });\n d3.event.stopPropagation();\n });\n\n ticks\n .attr('class', function(d,i,j) { return (getOpen(d,i) > getClose(d,i) ? 'nv-tick negative' : 'nv-tick positive') + ' nv-tick-' + j + '-' + i })\n d3.transition(ticks)\n .attr('transform', function(d,i) { return 'translate(' + x(getX(d,i)) + ',' + y(getHigh(d,i)) + ')'; })\n .attr('d', function(d,i) {\n var w = (availableWidth / data[0].values.length) * .9;\n return 'm0,0l0,'\n + (y(getOpen(d,i))\n - y(getHigh(d,i)))\n + 'l'\n + (-w/2)\n + ',0l'\n + (w/2)\n + ',0l0,'\n + (y(getLow(d,i))\n - y(getOpen(d,i)))\n + 'l0,'\n + (y(getClose(d,i))\n - y(getLow(d,i)))\n + 'l'\n + (w/2)\n + ',0l'\n + (-w/2)\n + ',0z';\n })\n //.attr('width', (availableWidth / data[0].values.length) * .9 )\n\n\n //d3.transition(ticks)\n //.attr('y', function(d,i) { return y(Math.max(0, getY(d,i))) })\n //.attr('height', function(d,i) { return Math.abs(y(getY(d,i)) - y(0)) });\n //.order(); // not sure if this makes any sense for this model\n\n });\n\n return chart;\n }", "function DiscreteHorizSlider (params) {\n if (!params.numBins) {\n throw 'discrete horizontal slider needs an integer number of bins';\n }\n this.numBins = params.numBins\n this.binSize = Math.floor(params.width / this.numBins);\n this.lineWidth = 4;\n this.renderWidth = this.binSize - this.lineWidth;\n this.currentBin = 0;\n this.lastBin = -99;\n this.binBorderColor = params.binBorderColor;\n \n Slider.call(this, params);\n \n var oldStyle = this.g2d.fillStyle;\n this.g2d.fillStyle = this.binBorderColor;\n for (var i = 0; i <= this.numBins; i++) {\n this.g2d.fillRect(\n Math.floor(i * this.binSize), 0, this.lineWidth, this.height\n );\n }\n this.g2d.fillStyle = oldStyle;\n }", "function make_x_gridlines() {\t\t\n return d3.axisBottom(xScale)\n .ticks(10)\n }", "function createChart(options) {\n var seriesGroups = [],\n normalizedData = Chartist.normalizeDataArray(Chartist.getDataArray(this.data, options.reverseData), this.data.labels.length),\n normalizedPadding = Chartist.normalizePadding(options.chartPadding, defaultOptions.padding);\n\n // Create new svg object\n this.svg = Chartist.createSvg(this.container, options.width, options.height, options.classNames.chart);\n\n var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);\n\n var highLow = Chartist.getHighLow(normalizedData);\n // Overrides of high / low from settings\n highLow.high = +options.high || (options.high === 0 ? 0 : highLow.high);\n highLow.low = +options.low || (options.low === 0 ? 0 : highLow.low);\n\n var axisX = new Chartist.StepAxis(\n Chartist.Axis.units.x,\n chartRect,\n function xAxisTransform(projectedValue) {\n projectedValue.pos = chartRect.x1 + projectedValue.pos;\n return projectedValue;\n },\n {\n x: options.axisX.labelOffset.x,\n y: chartRect.y1 + options.axisX.labelOffset.y + (this.supportsForeignObject ? 5 : 20)\n },\n {\n stepCount: this.data.labels.length,\n stretch: options.fullWidth\n }\n );\n\n var axisY = new Chartist.LinearScaleAxis(\n Chartist.Axis.units.y,\n chartRect,\n function yAxisTransform(projectedValue) {\n projectedValue.pos = chartRect.y1 - projectedValue.pos;\n return projectedValue;\n },\n {\n x: normalizedPadding.left + options.axisY.labelOffset.x + (this.supportsForeignObject ? -10 : 0),\n y: options.axisY.labelOffset.y + (this.supportsForeignObject ? -15 : 0)\n },\n {\n highLow: highLow,\n scaleMinSpace: options.axisY.scaleMinSpace\n }\n );\n\n // Start drawing\n var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup),\n gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup);\n\n Chartist.createAxis(\n axisX,\n this.data.labels,\n chartRect,\n gridGroup,\n labelGroup,\n this.supportsForeignObject,\n options,\n this.eventEmitter\n );\n\n Chartist.createAxis(\n axisY,\n axisY.bounds.values,\n chartRect,\n gridGroup,\n labelGroup,\n this.supportsForeignObject,\n options,\n this.eventEmitter\n );\n\n // Draw the series\n this.data.series.forEach(function(series, seriesIndex) {\n seriesGroups[seriesIndex] = this.svg.elem('g');\n\n // Write attributes to series group element. If series name or meta is undefined the attributes will not be written\n seriesGroups[seriesIndex].attr({\n 'series-name': series.name,\n 'meta': Chartist.serialize(series.meta)\n }, Chartist.xmlNs.uri);\n\n // Use series class from series data or if not set generate one\n seriesGroups[seriesIndex].addClass([\n options.classNames.series,\n (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex))\n ].join(' '));\n\n var pathCoordinates = [];\n\n normalizedData[seriesIndex].forEach(function(value, valueIndex) {\n var p = {\n x: chartRect.x1 + axisX.projectValue(value, valueIndex, normalizedData[seriesIndex]).pos,\n y: chartRect.y1 - axisY.projectValue(value, valueIndex, normalizedData[seriesIndex]).pos\n };\n pathCoordinates.push(p.x, p.y);\n\n //If we should show points we need to create them now to avoid secondary loop\n // Small offset for Firefox to render squares correctly\n if (options.showPoint) {\n var point = seriesGroups[seriesIndex].elem('line', {\n x1: p.x,\n y1: p.y,\n x2: p.x + 0.01,\n y2: p.y\n }, options.classNames.point).attr({\n 'value': value,\n 'meta': Chartist.getMetaData(series, valueIndex)\n }, Chartist.xmlNs.uri);\n\n this.eventEmitter.emit('draw', {\n type: 'point',\n value: value,\n index: valueIndex,\n group: seriesGroups[seriesIndex],\n element: point,\n x: p.x,\n y: p.y\n });\n }\n }.bind(this));\n\n // TODO: Nicer handling of conditions, maybe composition?\n if (options.showLine || options.showArea) {\n var smoothing = typeof options.lineSmooth === 'function' ?\n options.lineSmooth : (options.lineSmooth ? Chartist.Interpolation.cardinal() : Chartist.Interpolation.none()),\n path = smoothing(pathCoordinates);\n\n if(options.showLine) {\n var line = seriesGroups[seriesIndex].elem('path', {\n d: path.stringify()\n }, options.classNames.line, true).attr({\n 'values': normalizedData[seriesIndex]\n }, Chartist.xmlNs.uri);\n\n this.eventEmitter.emit('draw', {\n type: 'line',\n values: normalizedData[seriesIndex],\n path: path.clone(),\n chartRect: chartRect,\n index: seriesIndex,\n group: seriesGroups[seriesIndex],\n element: line\n });\n }\n\n if(options.showArea) {\n // If areaBase is outside the chart area (< low or > high) we need to set it respectively so that\n // the area is not drawn outside the chart area.\n var areaBase = Math.max(Math.min(options.areaBase, axisY.bounds.max), axisY.bounds.min);\n\n // We project the areaBase value into screen coordinates\n var areaBaseProjected = chartRect.y1 - axisY.projectValue(areaBase).pos;\n\n // Clone original path and splice our new area path to add the missing path elements to close the area shape\n var areaPath = path.clone();\n // Modify line path and add missing elements for area\n areaPath.position(0)\n .remove(1)\n .move(chartRect.x1, areaBaseProjected)\n .line(pathCoordinates[0], pathCoordinates[1])\n .position(areaPath.pathElements.length)\n .line(pathCoordinates[pathCoordinates.length - 2], areaBaseProjected);\n\n // Create the new path for the area shape with the area class from the options\n var area = seriesGroups[seriesIndex].elem('path', {\n d: areaPath.stringify()\n }, options.classNames.area, true).attr({\n 'values': normalizedData[seriesIndex]\n }, Chartist.xmlNs.uri);\n\n this.eventEmitter.emit('draw', {\n type: 'area',\n values: normalizedData[seriesIndex],\n path: areaPath.clone(),\n chartRect: chartRect,\n index: seriesIndex,\n group: seriesGroups[seriesIndex],\n element: area\n });\n }\n }\n }.bind(this));\n\n this.eventEmitter.emit('created', {\n bounds: axisY.bounds,\n chartRect: chartRect,\n svg: this.svg,\n options: options\n });\n }", "function createChart(options) {\n var data = Chartist.normalizeData(this.data, options.reverseData, true);\n\n // Create new svg object\n this.svg = Chartist.createSvg(this.container, options.width, options.height, options.classNames.chart);\n // Create groups for labels, grid and series\n var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup);\n var seriesGroup = this.svg.elem('g');\n var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup);\n\n var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);\n var axisX, axisY;\n\n if (options.axisX.type === undefined) {\n axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data.normalized.series, chartRect, Chartist.extend({}, options.axisX, {\n ticks: data.normalized.labels,\n stretch: options.fullWidth\n }));\n } else {\n axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data.normalized.series, chartRect, options.axisX);\n }\n\n if (options.axisY.type === undefined) {\n axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data.normalized.series, chartRect, Chartist.extend({}, options.axisY, {\n high: Chartist.isNumeric(options.high) ? options.high : options.axisY.high,\n low: Chartist.isNumeric(options.low) ? options.low : options.axisY.low\n }));\n } else {\n axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data.normalized.series, chartRect, options.axisY);\n }\n\n axisX.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n axisY.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n\n if (options.showGridBackground) {\n Chartist.createGridBackground(gridGroup, chartRect, options.classNames.gridBackground, this.eventEmitter);\n }\n\n // Draw the series\n data.raw.series.forEach(function (series, seriesIndex) {\n var seriesElement = seriesGroup.elem('g');\n\n // Write attributes to series group element. If series name or meta is undefined the attributes will not be written\n seriesElement.attr({\n 'ct:series-name': series.name,\n 'ct:meta': Chartist.serialize(series.meta)\n });\n\n // Use series class from series data or if not set generate one\n seriesElement.addClass([\n options.classNames.series,\n (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex))\n ].join(' '));\n\n var pathCoordinates = [],\n pathData = [];\n\n data.normalized.series[seriesIndex].forEach(function (value, valueIndex) {\n var p = {\n x: chartRect.x1 + axisX.projectValue(value, valueIndex, data.normalized.series[seriesIndex]),\n y: chartRect.y1 - axisY.projectValue(value, valueIndex, data.normalized.series[seriesIndex])\n };\n pathCoordinates.push(p.x, p.y);\n pathData.push({\n value: value,\n valueIndex: valueIndex,\n meta: Chartist.getMetaData(series, valueIndex)\n });\n }.bind(this));\n\n var seriesOptions = {\n lineSmooth: Chartist.getSeriesOption(series, options, 'lineSmooth'),\n showPoint: Chartist.getSeriesOption(series, options, 'showPoint'),\n showLine: Chartist.getSeriesOption(series, options, 'showLine'),\n showArea: Chartist.getSeriesOption(series, options, 'showArea'),\n areaBase: Chartist.getSeriesOption(series, options, 'areaBase')\n };\n\n var smoothing = typeof seriesOptions.lineSmooth === 'function' ?\n seriesOptions.lineSmooth : (seriesOptions.lineSmooth ? Chartist.Interpolation.monotoneCubic() : Chartist.Interpolation.none());\n // Interpolating path where pathData will be used to annotate each path element so we can trace back the original\n // index, value and meta data\n var path = smoothing(pathCoordinates, pathData);\n\n // If we should show points we need to create them now to avoid secondary loop\n // Points are drawn from the pathElements returned by the interpolation function\n // Small offset for Firefox to render squares correctly\n if (seriesOptions.showPoint) {\n\n path.pathElements.forEach(function (pathElement) {\n var point = seriesElement.elem('line', {\n x1: pathElement.x,\n y1: pathElement.y,\n x2: pathElement.x + 0.01,\n y2: pathElement.y\n }, options.classNames.point).attr({\n 'ct:value': [pathElement.data.value.x, pathElement.data.value.y].filter(Chartist.isNumeric).join(','),\n 'ct:meta': Chartist.serialize(pathElement.data.meta)\n });\n\n this.eventEmitter.emit('draw', {\n type: 'point',\n value: pathElement.data.value,\n index: pathElement.data.valueIndex,\n meta: pathElement.data.meta,\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n group: seriesElement,\n element: point,\n x: pathElement.x,\n y: pathElement.y\n });\n }.bind(this));\n }\n\n if (seriesOptions.showLine) {\n var line = seriesElement.elem('path', {\n d: path.stringify()\n }, options.classNames.line, true);\n\n this.eventEmitter.emit('draw', {\n type: 'line',\n values: data.normalized.series[seriesIndex],\n path: path.clone(),\n chartRect: chartRect,\n index: seriesIndex,\n series: series,\n seriesIndex: seriesIndex,\n seriesMeta: series.meta,\n axisX: axisX,\n axisY: axisY,\n group: seriesElement,\n element: line\n });\n }\n\n // Area currently only works with axes that support a range!\n if (seriesOptions.showArea && axisY.range) {\n // If areaBase is outside the chart area (< min or > max) we need to set it respectively so that\n // the area is not drawn outside the chart area.\n var areaBase = Math.max(Math.min(seriesOptions.areaBase, axisY.range.max), axisY.range.min);\n\n // We project the areaBase value into screen coordinates\n var areaBaseProjected = chartRect.y1 - axisY.projectValue(areaBase);\n\n // In order to form the area we'll first split the path by move commands so we can chunk it up into segments\n path.splitByCommand('M').filter(function onlySolidSegments(pathSegment) {\n // We filter only \"solid\" segments that contain more than one point. Otherwise there's no need for an area\n return pathSegment.pathElements.length > 1;\n }).map(function convertToArea(solidPathSegments) {\n // Receiving the filtered solid path segments we can now convert those segments into fill areas\n var firstElement = solidPathSegments.pathElements[0];\n var lastElement = solidPathSegments.pathElements[solidPathSegments.pathElements.length - 1];\n\n // Cloning the solid path segment with closing option and removing the first move command from the clone\n // We then insert a new move that should start at the area base and draw a straight line up or down\n // at the end of the path we add an additional straight line to the projected area base value\n // As the closing option is set our path will be automatically closed\n return solidPathSegments.clone(true)\n .position(0)\n .remove(1)\n .move(firstElement.x, areaBaseProjected)\n .line(firstElement.x, firstElement.y)\n .position(solidPathSegments.pathElements.length + 1)\n .line(lastElement.x, areaBaseProjected);\n\n }).forEach(function createArea(areaPath) {\n // For each of our newly created area paths, we'll now create path elements by stringifying our path objects\n // and adding the created DOM elements to the correct series group\n var area = seriesElement.elem('path', {\n d: areaPath.stringify()\n }, options.classNames.area, true);\n\n // Emit an event for each area that was drawn\n this.eventEmitter.emit('draw', {\n type: 'area',\n values: data.normalized.series[seriesIndex],\n path: areaPath.clone(),\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n chartRect: chartRect,\n index: seriesIndex,\n group: seriesElement,\n element: area\n });\n }.bind(this));\n }\n }.bind(this));\n\n this.eventEmitter.emit('created', {\n bounds: axisY.bounds,\n chartRect: chartRect,\n axisX: axisX,\n axisY: axisY,\n svg: this.svg,\n options: options\n });\n }", "function constructChart() {\n var data = chartData = new google.visualization.DataTable();\n\n data.addColumn('datetime', 'time');\n data.addColumn('number', 'consumption');\n data.addColumn('number', 'prediction');\n // to make prediction always dotted\n data.addColumn({type:'boolean',role:'certainty'});\n\n chartOptions = {\n title: 'Consumption predictions',\n height: 600,\n theme: 'maximized',\n pointSize: 3,\n series: [{\n color: 'blue'\n }, {\n color: 'grey',\n lineWidth: 1\n }]\n };\n\n chart = new google.visualization.LineChart(document.getElementById('prediction-chart'));\n\n scrollTo(6, ' .chart');\n\n }", "function chart(selection) {\n selection.each(function(data) {\n\n var multibar = nv.models.multiBarHorizontal()\n , x\n , y\n , transitionDuration = 250\n ;\n\n var availableWidth = (width || parseInt(container.style('width')) || 960)\n - margin.left - margin.right\n , availableHeight = (height || parseInt(container.style('height')) || 400)\n - margin.top - margin.bottom\n , container = d3.select(this)\n ;\n\n chart.update = function() { container.transition().duration(transitionDuration).call(chart) };\n chart.container = this;\n\n\n //------------------------------------------------------------\n // Setup Scales\n\n x = multibar.xScale();\n y = multibar.yScale();\n\n //------------------------------------------------------------\n\n\n //------------------------------------------------------------\n // Setup containers and skeleton of chart\n\n var wrap = container.selectAll('g.nv-wrap.nv-ganttChart').data([data]);\n var wrapEnter = wrap.enter().append('g').attr('class', 'nvd3 nv-wrap nv-ganttChart');\n var gEnter = wrapEnter.append('g');\n var g = wrap.select('g')\n\n gEnter.append(\"rect\").style('opacity', 0);\n gEnter.append('g').attr('class', 'nv-mainWrap');\n gEnter.append('g').attr('class', 'nv-x nv-axis');\n gEnter.append('g').attr('class', 'nv-y nv-axis');\n\n wrap.attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');\n g.select(\"rect\").attr('width', availableWidth).attr('height', availableHeight);\n\n //------------------------------------------------------------\n // Setup main components\n\n multibar\n .disabled(data.map(function(series) { return series.disabled }))\n .width(availableWidth)\n .height(availableHeight)\n .color(data.map(function(d,i) {\n return d.color || color(d, i);\n }).filter(function(d,i) { return !data[i].disabled }))\n\n var barsWrap = g.select('.nv-barsWrap')\n .datum(data.filter(function(d) { return !d.disabled }))\n\n barsWrap.transition().call(multibar);\n\n //------------------------------------------------------------\n // Setup axes\n\n if (showXAxis) {\n xAxis\n .scale(d3.scale.linear())\n .ticks( availableHeight / 24 )\n .tickSize(-availableWidth, 0);\n\n g.select('.nv-x.nv-axis').transition()\n .call(xAxis);\n\n var xTicks = g.select('.nv-x.nv-axis').selectAll('g');\n\n xTicks\n .selectAll('line, text')\n .style('opacity', 1)\n }\n\n if (showYAxis) {\n yAxis\n .scale(y)\n .ticks( availableWidth / 100 )\n .tickSize( -availableHeight, 0);\n\n g.select('.nv-y.nv-axis')\n .attr('transform', 'translate(0,' + availableHeight + ')');\n g.select('.nv-y.nv-axis').transition()\n .call(yAxis);\n }\n\n\n //------------------------------------------------------------\n // Handle events\n\n dispatch.on('changeState', function(e) {\n\n if (typeof e.disabled !== 'undefined') {\n data.forEach(function(series,i) {\n series.disabled = e.disabled[i];\n });\n\n state.disabled = e.disabled;\n }\n\n selection.call(chart);\n });\n\n\n });\n\n return chart;\n }", "function addAxes() {\n\t// x axis\n\tsvgLine.append(\"g\")\n\t\t .attr(\"class\", \"axis\")\n\t\t .attr(\"transform\", \"translate(0,\" + height + \")\")\n\t\t .call(xAxis);\n\n \t// y axis\n\tsvgLine.append(\"g\")\n\t\t\t .attr(\"class\", \"axis\")\n\t\t\t .call(yAxis);\n\n \t// x axis label\n \tsvgLine.append(\"text\")\n\t\t\t .attr(\"fill\", \"#000\")\n\t\t\t .attr(\"x\", width)\n\t\t\t .attr(\"y\", height - 12)\n\t\t\t .attr(\"dy\", \"0.71em\")\n\t\t\t .style(\"text-anchor\", \"end\")\n\t\t\t .text(\"Age\");\n\n \t// y axis label\n\tsvgLine.append(\"text\")\n\t\t\t .attr(\"fill\", \"#000\")\n\t\t\t .attr(\"transform\", \"rotate(-90)\")\n\t\t\t .attr(\"y\", 6)\n\t\t\t .attr(\"dy\", \"0.71em\")\n\t\t\t .style(\"text-anchor\", \"end\")\n\t\t\t .text(\"Avg. Weekly Alcohol Consumption\");\n}", "function make_x_gridlines() {\t\t\n return d3.axisBottom(x)\n .ticks(10)\n}", "function make_x_gridlines() {\t\t\n return d3.axisBottom(x)\n .ticks(10)\n}", "function make_x_gridlines() {\n return d3.axisBottom(XScale)\n .ticks(turns)\n }", "function weeklyChart () {\n\n var ctx = document.getElementById(\"myChart\");\n var myChart = new Chart(ctx, {\n type: 'line',\n data: {\n labels: ['16-22', '23-29', '30-5', '6-12', '13-19', '20-26', '27-3', '4-10','11-17', '18-24','25-31'],\n datasets: [{\n\n data: [750, 1250, 1000,1250, 1750, 1500, 1750, 1250, 1000, 2250, 1250, 750],\n borderWidth: 1,\n tension: 0,\n backgroundColor: 'rgba(151, 145, 222, 0.3)',\n responsive: true,\n }]\n },\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero:true\n }\n }]\n },\n legend: {display: false}\n }\n\n });\n}", "function makeMasterChart() {\n var data = new google.visualization.DataTable();\n\n var splitResult;\n var splitDate;\n var rowCount = 0;\n\n // Declare columns\n data.addColumn('date', 'Date');\n \n \n for(var i=0; i<checkedResults.length; i++)\n {\n data.addColumn('number', checkedResults[i].location);\n\n for(var j=0; j<checkedResults[i].data.length; j++)\n {\n splitDate = checkedResults[i].data[j].date.split(\"-\");\n\n data.addRow();\n data.setCell(rowCount, 0, new Date(splitDate[0], splitDate[1] - 1, splitDate[2]));\n data.setCell(rowCount, i + 1, checkedResults[i].data[j].value);\n rowCount = rowCount + 1;\n }\n }\n\n\n\n var options = {\n // chartArea: {'width': '67%', 'height': '60%'},\n title: \"Site Data\",\n hAxis: { title: 'Date (M/Y)', format: 'M/yy' },\n vAxis: { title: 'Measured Value' },\n chartArea: { width: \"60%\", height: \"70%\" },\n legend: { textStyle: { fontSize: 10 } },\n lineWidth: 0, \n pointSize: 5,\n height: 400,\n width: 850\n\n };\n\n var chart = new google.visualization.LineChart(document.getElementById('trendChartsMaster'));\n chart.draw(data, options);\n\n}", "function xAxis() {\t\t\n return d3.axisBottom(x)\n .tickSize(-height)\n .tickFormat(\"\")\n \n}", "function createChart(parentDiv,data){\n console.log(data);\n var m = 2; // number of cases\n var max = 0;\n n = 0; // number of segments\n\n // find number of segments\n for(var i=0; i<m; i++) {\n for(var j=0; j<data[i].length; j++) {\n data[i][j].caseId = i; // used for update\n n = Math.max(n,data[i][j].segment);\n max = Math.max(max,data[i][j].mean);\n }\n }\n n = n+1;\n\n console.log(n);\n\n\n y = d3.scale.linear()\n .domain([0, max])\n .range([height, 0]);\n\n var x0 = d3.scale.ordinal()\n .domain(d3.range(n))\n .rangeBands([0, width], .2);\n\n var x1 = d3.scale.ordinal()\n .domain(d3.range(m))\n .rangeBands([0, x0.rangeBand()]);\n\n var z = d3.scale.category10();\n\n var xAxis = d3.svg.axis()\n .scale(x0)\n .orient(\"bottom\");\n\n var yAxis = d3.svg.axis()\n .scale(y)\n .orient(\"left\");\n\n parent = parentDiv.append(\"svg\")\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", height + margin.top + margin.bottom)\n var svg = parent.append(\"svg:g\")\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n svg.append(\"g\")\n .attr(\"class\", \"y axis\")\n .call(yAxis);\n\n svg.append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(xAxis);\n\n svg.append(\"g\").selectAll(\"g\")\n .data(d3.range(m))\n .enter().append(\"g\")\n .style(\"fill\", function(d, i) { return z(i); })\n .attr(\"transform\", function(d, i) { return \"translate(\" + x1(i) + \",0)\"; })\n .selectAll(\"rect\")\n .data(function(d,i) {\n console.log(i);\n return data[i%2];\n })\n .enter().append(\"rect\")\n .attr(\"caseId\", function(d) {return d.caseId})\n .attr(\"segmentId\", function(d) {return d.segment})\n .attr(\"class\", \"caseRect\")\n .attr(\"width\", x1.rangeBand())\n .attr(\"height\", function(d) {return y(0)-y(d.mean);})\n .attr(\"x\", function(d, i) { return x0(i); })\n .attr(\"y\", function(d) { return y(d.mean); })\n .on(\"mouseover\", function(d,i) {\n if(bus.map.highlightSegment(i)) {\n svg.selectAll(\"rect\").style(\"opacity\",0.5);\n d3.select(this).style(\"opacity\",1.0);\n }\n })\n .on(\"mouseout\", function() {\n svg.selectAll(\"rect\").style(\"opacity\",1.0);\n bus.map.highlightSegment(-1);\n });\n\n svg.append(\"text\")\n .text(\"Mean (mph)\")\n .attr(\"x\", margin.left/2)\n .attr(\"y\", -margin.top/2)\n .attr(\"text-anchor\", \"middle\")\n\n svg.append(\"text\")\n .text(\"Segments\")\n .attr(\"x\", width/2)\n .attr(\"y\", height + margin.top + margin.bottom/4)\n .attr(\"text-anchor\", \"middle\")\n\n // in order for saveImage to work, style must be in the element itself, and not inhereted\n // svg.selectAll(\"path\").attr(\"style\", \"fill: none; stroke: #0000\");\n // svg.selectAll(\".y axis\").selectAll(\"text\").attr(\"style\", \"font: 12px sans-serif; text-anchor: end;\");\n // svg.selectAll(\".x axis\").selectAll(\"text\").attr(\"style\", \"font: 12px sans-serif; text-anchor: middle;\");\n svg.append(\"defs\").append(\"style\").attr(\"type\", \"text/css\").text(\"path {fill: none; stroke: #000000} text {font: 12px sans-serif}\");\n }", "function draw(data, dataAttr, max, div, title, titleOffset, titleModifier) {\n\n\t\t\t titleOffset = parseInt(titleOffset);\n\t\t\t\tvar margin = {\n\t\t\t\t\t\t\"top\": 10,\n\t\t\t\t\t\t\"right\": 10,\n\t\t\t\t\t\t\"bottom\": 50,\n\t\t\t\t\t\t\"left\": 50\n\t\t\t\t\t},\n\t\t\t\t\twidth = 440,\n\t\t\t\t\theight = 160;\n\t\t\t\t\tbarWidth = 10;\n\n\t\t\t\tvar x = d3.scale.ordinal()\n\t\t\t\t\t.domain(data.month.map(function(d) {\n\t\t\t\t\t\treturn d.substring(0, 3);}))\n\t\t\t\t\t.rangeRoundBands([0, width/2], 0);\n\n\t\t\t\tvar y = d3.scale.linear()\n\t\t\t\t // SET Y AXIS HEIGHT\n\t\t\t\t\t.domain([0, (max)])\n\t\t\t\t\t.range([height, 0]);\n\n\t\t\t\tvar xAxis = d3.svg.axis()\n\t\t\t\t .scale(x)\n\t\t\t\t\t.orient(\"bottom\");\n\n\t\t\t\tvar yAxis = d3.svg.axis()\n\t\t\t\t .scale(y)\n\t\t\t\t\t.orient(\"left\");\n\n\t\t\t\tvar svgContainer = d3.select(div).append(\"svg\")\n\t\t\t\t\t.attr(\"class\", \"chart\")\n\t\t\t\t\t.attr(\"width\", width + margin.left + margin.right)\n\t\t\t\t\t.attr(\"height\", height + margin.top + margin.bottom).append(\"g\")\n\t\t\t\t\t\t.attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.right + \")\");\n\t\t\t\t\n\t\t\t\t// CREATE TOOL TIP\n\t\t\t\tvar tip = d3.tip()\n\t\t\t\t .attr('class', 'd3-tip')\n\t\t\t\t .offset([-10, 0])\n\t\t\t\t .html(function(d) {\n\t\t\t\t\treturn \"<strong>Value:</strong> <span style='color:red'>\" + parseFloat(d).toFixed(2) + \"</span>\";\n\t\t\t\t\t\n\t\t\t\t })\n\n\t\t\t\tsvgContainer.call(tip);\n\n\t\t\t\tsvgContainer.append(\"g\")\n\t\t\t\t\t.attr(\"class\", \"x axis\")\n\t\t\t\t\t.attr(\"transform\", \"translate( 0,\" + height + \")\")\n\t\t\t\t\t.call(xAxis)\n\t\t\t\t\t.selectAll(\"text\") \n .style(\"text-anchor\", \"end\")\n .attr(\"dx\", \"-.8em\")\n .attr(\"dy\", \".15em\")\n .attr(\"transform\", function(d) {\n return \"rotate(-65)\" \n });\n\n\t\t\t\tsvgContainer.append(\"g\")\n\t\t\t\t\t.attr(\"class\", \"y axis\").call(yAxis)\n\t\t\t\t\t.append(\"text\")\n\t\t\t\t\t\t.attr(\"x\", (width / titleOffset + titleModifier)) \n\t\t\t\t\t\t.attr(\"y\", 10)\n\t\t\t\t\t\t.attr(\"text-anchor\", \"center\") \n\t\t\t\t\t\t.style(\"font-size\", \"16px\") \n\t\t\t\t\t\t.text(title);\n\t\t\t\t\t\t\n\t\t\t\tsvgContainer.selectAll(\".bar\").data(dataAttr).enter().append(\"rect\")\n\t\t\t\t\t.attr(\"class\", \"bar\")\n\t\t\t\t\t.attr(\"x\", function(d, i) {\n\t\t\t\t\t\treturn i * x.rangeBand() + (x.rangeBand()/2) -(barWidth/2);\n\t\t\t\t\t})\n\t\t\t\t\t.attr(\"y\", function(d) {\n\t\t\t\t\t\treturn y(d);\n\t\t\t\t\t})\n\t\t\t\t\t.attr(\"width\", barWidth)\n\t\t\t\t\t.attr(\"height\", function(d) {\n\t\t\t\t\t\treturn height -y(d);\n\t\t\t\t\t})\n\t\t\t\t\t.on('mouseover', tip.show)\n\t\t\t\t\t.on('mouseout', tip.hide)\n\n }", "function drawHorizon(previousHorizon) {\n let newHorizon = [];\n previousHorizon.forEach(item => {\n index = previousHorizon.indexOf(item);\n // Copy terrain (first word) from previous horizon's item or adjacent item if in bounds and succeeds percentage chance:\n if (index === 0) {\n if (chance(75)) {\n newHorizon.push(nthWord(chance(50) ? previousHorizon[index] : previousHorizon[index+1], 1));\n } else {\n // Otherwise generate random terrain:\n newHorizon.push(getRandArrItem(terrain));\n }\n } else if (index === previousHorizon.length-1) {\n if (chance(75)) {\n newHorizon.push(nthWord(chance(50) ? previousHorizon[index] : previousHorizon[index-1], 1));\n } else {\n newHorizon.push(getRandArrItem(terrain));\n }\n } else {\n if (chance(75)) {\n if (chance(50)) {\n newHorizon.push(nthWord(previousHorizon[index+1], 1));\n } else if (chance(50)) {\n newHorizon.push(nthWord(previousHorizon[index-1], 1));\n } else {\n newHorizon.push(nthWord(previousHorizon[index], 1));\n }\n } else {\n newHorizon.push(getRandArrItem(terrain));\n }\n }\n });\n\n // Add entities to new horizon:\n for (let i = 0; i < newHorizon.length; i++) {\n newHorizon[i] = createEntities(newHorizon[i]);\n }\n return newHorizon;\n}", "function 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}", "function make_xMajor_gridlines() {\n return d3.axisBottom(x)\n .ticks(xGridLength)\n }", "function createChart(options) {\n var data = Chartist.normalizeData(this.data, options.reverseData, true);\n\n // Create new svg object\n this.svg = Chartist.createSvg(this.container, options.width, options.height, options.classNames.chart);\n // Create groups for labels, grid and series\n var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup);\n var seriesGroup = this.svg.elem('g');\n var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup);\n\n var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);\n var axisX, axisY;\n\n if(options.axisX.type === undefined) {\n axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data.normalized.series, chartRect, Chartist.extend({}, options.axisX, {\n ticks: data.normalized.labels,\n stretch: options.fullWidth\n }));\n } else {\n axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data.normalized.series, chartRect, options.axisX);\n }\n\n if(options.axisY.type === undefined) {\n axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data.normalized.series, chartRect, Chartist.extend({}, options.axisY, {\n high: Chartist.isNumeric(options.high) ? options.high : options.axisY.high,\n low: Chartist.isNumeric(options.low) ? options.low : options.axisY.low\n }));\n } else {\n axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data.normalized.series, chartRect, options.axisY);\n }\n\n axisX.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n axisY.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n\n if (options.showGridBackground) {\n Chartist.createGridBackground(gridGroup, chartRect, options.classNames.gridBackground, this.eventEmitter);\n }\n\n // Draw the series\n data.raw.series.forEach(function(series, seriesIndex) {\n var seriesElement = seriesGroup.elem('g');\n\n // Write attributes to series group element. If series name or meta is undefined the attributes will not be written\n seriesElement.attr({\n 'ct:series-name': series.name,\n 'ct:meta': Chartist.serialize(series.meta)\n });\n\n // Use series class from series data or if not set generate one\n seriesElement.addClass([\n options.classNames.series,\n (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex))\n ].join(' '));\n\n var pathCoordinates = [],\n pathData = [];\n\n data.normalized.series[seriesIndex].forEach(function(value, valueIndex) {\n var p = {\n x: chartRect.x1 + axisX.projectValue(value, valueIndex, data.normalized.series[seriesIndex]),\n y: chartRect.y1 - axisY.projectValue(value, valueIndex, data.normalized.series[seriesIndex])\n };\n pathCoordinates.push(p.x, p.y);\n pathData.push({\n value: value,\n valueIndex: valueIndex,\n meta: Chartist.getMetaData(series, valueIndex)\n });\n }.bind(this));\n\n var seriesOptions = {\n lineSmooth: Chartist.getSeriesOption(series, options, 'lineSmooth'),\n showPoint: Chartist.getSeriesOption(series, options, 'showPoint'),\n showLine: Chartist.getSeriesOption(series, options, 'showLine'),\n showArea: Chartist.getSeriesOption(series, options, 'showArea'),\n areaBase: Chartist.getSeriesOption(series, options, 'areaBase')\n };\n\n var smoothing = typeof seriesOptions.lineSmooth === 'function' ?\n seriesOptions.lineSmooth : (seriesOptions.lineSmooth ? Chartist.Interpolation.monotoneCubic() : Chartist.Interpolation.none());\n // Interpolating path where pathData will be used to annotate each path element so we can trace back the original\n // index, value and meta data\n var path = smoothing(pathCoordinates, pathData);\n\n // If we should show points we need to create them now to avoid secondary loop\n // Points are drawn from the pathElements returned by the interpolation function\n // Small offset for Firefox to render squares correctly\n if (seriesOptions.showPoint) {\n\n path.pathElements.forEach(function(pathElement) {\n var point = seriesElement.elem('line', {\n x1: pathElement.x,\n y1: pathElement.y,\n x2: pathElement.x + 0.01,\n y2: pathElement.y\n }, options.classNames.point).attr({\n 'ct:value': [pathElement.data.value.x, pathElement.data.value.y].filter(Chartist.isNumeric).join(','),\n 'ct:meta': Chartist.serialize(pathElement.data.meta)\n });\n\n this.eventEmitter.emit('draw', {\n type: 'point',\n value: pathElement.data.value,\n index: pathElement.data.valueIndex,\n meta: pathElement.data.meta,\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n group: seriesElement,\n element: point,\n x: pathElement.x,\n y: pathElement.y\n });\n }.bind(this));\n }\n\n if(seriesOptions.showLine) {\n var line = seriesElement.elem('path', {\n d: path.stringify()\n }, options.classNames.line, true);\n\n this.eventEmitter.emit('draw', {\n type: 'line',\n values: data.normalized.series[seriesIndex],\n path: path.clone(),\n chartRect: chartRect,\n index: seriesIndex,\n series: series,\n seriesIndex: seriesIndex,\n seriesMeta: series.meta,\n axisX: axisX,\n axisY: axisY,\n group: seriesElement,\n element: line\n });\n }\n\n // Area currently only works with axes that support a range!\n if(seriesOptions.showArea && axisY.range) {\n // If areaBase is outside the chart area (< min or > max) we need to set it respectively so that\n // the area is not drawn outside the chart area.\n var areaBase = Math.max(Math.min(seriesOptions.areaBase, axisY.range.max), axisY.range.min);\n\n // We project the areaBase value into screen coordinates\n var areaBaseProjected = chartRect.y1 - axisY.projectValue(areaBase);\n\n // In order to form the area we'll first split the path by move commands so we can chunk it up into segments\n path.splitByCommand('M').filter(function onlySolidSegments(pathSegment) {\n // We filter only \"solid\" segments that contain more than one point. Otherwise there's no need for an area\n return pathSegment.pathElements.length > 1;\n }).map(function convertToArea(solidPathSegments) {\n // Receiving the filtered solid path segments we can now convert those segments into fill areas\n var firstElement = solidPathSegments.pathElements[0];\n var lastElement = solidPathSegments.pathElements[solidPathSegments.pathElements.length - 1];\n\n // Cloning the solid path segment with closing option and removing the first move command from the clone\n // We then insert a new move that should start at the area base and draw a straight line up or down\n // at the end of the path we add an additional straight line to the projected area base value\n // As the closing option is set our path will be automatically closed\n return solidPathSegments.clone(true)\n .position(0)\n .remove(1)\n .move(firstElement.x, areaBaseProjected)\n .line(firstElement.x, firstElement.y)\n .position(solidPathSegments.pathElements.length + 1)\n .line(lastElement.x, areaBaseProjected);\n\n }).forEach(function createArea(areaPath) {\n // For each of our newly created area paths, we'll now create path elements by stringifying our path objects\n // and adding the created DOM elements to the correct series group\n var area = seriesElement.elem('path', {\n d: areaPath.stringify()\n }, options.classNames.area, true);\n\n // Emit an event for each area that was drawn\n this.eventEmitter.emit('draw', {\n type: 'area',\n values: data.normalized.series[seriesIndex],\n path: areaPath.clone(),\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n chartRect: chartRect,\n index: seriesIndex,\n group: seriesElement,\n element: area\n });\n }.bind(this));\n }\n }.bind(this));\n\n this.eventEmitter.emit('created', {\n bounds: axisY.bounds,\n chartRect: chartRect,\n axisX: axisX,\n axisY: axisY,\n svg: this.svg,\n options: options\n });\n }", "function createChart(options) {\n var data = Chartist.normalizeData(this.data, options.reverseData, true);\n\n // Create new svg object\n this.svg = Chartist.createSvg(this.container, options.width, options.height, options.classNames.chart);\n // Create groups for labels, grid and series\n var gridGroup = this.svg.elem('g').addClass(options.classNames.gridGroup);\n var seriesGroup = this.svg.elem('g');\n var labelGroup = this.svg.elem('g').addClass(options.classNames.labelGroup);\n\n var chartRect = Chartist.createChartRect(this.svg, options, defaultOptions.padding);\n var axisX, axisY;\n\n if(options.axisX.type === undefined) {\n axisX = new Chartist.StepAxis(Chartist.Axis.units.x, data.normalized.series, chartRect, Chartist.extend({}, options.axisX, {\n ticks: data.normalized.labels,\n stretch: options.fullWidth\n }));\n } else {\n axisX = options.axisX.type.call(Chartist, Chartist.Axis.units.x, data.normalized.series, chartRect, options.axisX);\n }\n\n if(options.axisY.type === undefined) {\n axisY = new Chartist.AutoScaleAxis(Chartist.Axis.units.y, data.normalized.series, chartRect, Chartist.extend({}, options.axisY, {\n high: Chartist.isNumeric(options.high) ? options.high : options.axisY.high,\n low: Chartist.isNumeric(options.low) ? options.low : options.axisY.low\n }));\n } else {\n axisY = options.axisY.type.call(Chartist, Chartist.Axis.units.y, data.normalized.series, chartRect, options.axisY);\n }\n\n axisX.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n axisY.createGridAndLabels(gridGroup, labelGroup, this.supportsForeignObject, options, this.eventEmitter);\n\n if (options.showGridBackground) {\n Chartist.createGridBackground(gridGroup, chartRect, options.classNames.gridBackground, this.eventEmitter);\n }\n\n // Draw the series\n data.raw.series.forEach(function(series, seriesIndex) {\n var seriesElement = seriesGroup.elem('g');\n\n // Write attributes to series group element. If series name or meta is undefined the attributes will not be written\n seriesElement.attr({\n 'ct:series-name': series.name,\n 'ct:meta': Chartist.serialize(series.meta)\n });\n\n // Use series class from series data or if not set generate one\n seriesElement.addClass([\n options.classNames.series,\n (series.className || options.classNames.series + '-' + Chartist.alphaNumerate(seriesIndex))\n ].join(' '));\n\n var pathCoordinates = [],\n pathData = [];\n\n data.normalized.series[seriesIndex].forEach(function(value, valueIndex) {\n var p = {\n x: chartRect.x1 + axisX.projectValue(value, valueIndex, data.normalized.series[seriesIndex]),\n y: chartRect.y1 - axisY.projectValue(value, valueIndex, data.normalized.series[seriesIndex])\n };\n pathCoordinates.push(p.x, p.y);\n pathData.push({\n value: value,\n valueIndex: valueIndex,\n meta: Chartist.getMetaData(series, valueIndex)\n });\n }.bind(this));\n\n var seriesOptions = {\n lineSmooth: Chartist.getSeriesOption(series, options, 'lineSmooth'),\n showPoint: Chartist.getSeriesOption(series, options, 'showPoint'),\n showLine: Chartist.getSeriesOption(series, options, 'showLine'),\n showArea: Chartist.getSeriesOption(series, options, 'showArea'),\n areaBase: Chartist.getSeriesOption(series, options, 'areaBase')\n };\n\n var smoothing = typeof seriesOptions.lineSmooth === 'function' ?\n seriesOptions.lineSmooth : (seriesOptions.lineSmooth ? Chartist.Interpolation.monotoneCubic() : Chartist.Interpolation.none());\n // Interpolating path where pathData will be used to annotate each path element so we can trace back the original\n // index, value and meta data\n var path = smoothing(pathCoordinates, pathData);\n\n // If we should show points we need to create them now to avoid secondary loop\n // Points are drawn from the pathElements returned by the interpolation function\n // Small offset for Firefox to render squares correctly\n if (seriesOptions.showPoint) {\n\n path.pathElements.forEach(function(pathElement) {\n var point = seriesElement.elem('line', {\n x1: pathElement.x,\n y1: pathElement.y,\n x2: pathElement.x + 0.01,\n y2: pathElement.y\n }, options.classNames.point).attr({\n 'ct:value': [pathElement.data.value.x, pathElement.data.value.y].filter(Chartist.isNumeric).join(','),\n 'ct:meta': Chartist.serialize(pathElement.data.meta)\n });\n\n this.eventEmitter.emit('draw', {\n type: 'point',\n value: pathElement.data.value,\n index: pathElement.data.valueIndex,\n meta: pathElement.data.meta,\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n group: seriesElement,\n element: point,\n x: pathElement.x,\n y: pathElement.y\n });\n }.bind(this));\n }\n\n if(seriesOptions.showLine) {\n var line = seriesElement.elem('path', {\n d: path.stringify()\n }, options.classNames.line, true);\n\n this.eventEmitter.emit('draw', {\n type: 'line',\n values: data.normalized.series[seriesIndex],\n path: path.clone(),\n chartRect: chartRect,\n index: seriesIndex,\n series: series,\n seriesIndex: seriesIndex,\n seriesMeta: series.meta,\n axisX: axisX,\n axisY: axisY,\n group: seriesElement,\n element: line\n });\n }\n\n // Area currently only works with axes that support a range!\n if(seriesOptions.showArea && axisY.range) {\n // If areaBase is outside the chart area (< min or > max) we need to set it respectively so that\n // the area is not drawn outside the chart area.\n var areaBase = Math.max(Math.min(seriesOptions.areaBase, axisY.range.max), axisY.range.min);\n\n // We project the areaBase value into screen coordinates\n var areaBaseProjected = chartRect.y1 - axisY.projectValue(areaBase);\n\n // In order to form the area we'll first split the path by move commands so we can chunk it up into segments\n path.splitByCommand('M').filter(function onlySolidSegments(pathSegment) {\n // We filter only \"solid\" segments that contain more than one point. Otherwise there's no need for an area\n return pathSegment.pathElements.length > 1;\n }).map(function convertToArea(solidPathSegments) {\n // Receiving the filtered solid path segments we can now convert those segments into fill areas\n var firstElement = solidPathSegments.pathElements[0];\n var lastElement = solidPathSegments.pathElements[solidPathSegments.pathElements.length - 1];\n\n // Cloning the solid path segment with closing option and removing the first move command from the clone\n // We then insert a new move that should start at the area base and draw a straight line up or down\n // at the end of the path we add an additional straight line to the projected area base value\n // As the closing option is set our path will be automatically closed\n return solidPathSegments.clone(true)\n .position(0)\n .remove(1)\n .move(firstElement.x, areaBaseProjected)\n .line(firstElement.x, firstElement.y)\n .position(solidPathSegments.pathElements.length + 1)\n .line(lastElement.x, areaBaseProjected);\n\n }).forEach(function createArea(areaPath) {\n // For each of our newly created area paths, we'll now create path elements by stringifying our path objects\n // and adding the created DOM elements to the correct series group\n var area = seriesElement.elem('path', {\n d: areaPath.stringify()\n }, options.classNames.area, true);\n\n // Emit an event for each area that was drawn\n this.eventEmitter.emit('draw', {\n type: 'area',\n values: data.normalized.series[seriesIndex],\n path: areaPath.clone(),\n series: series,\n seriesIndex: seriesIndex,\n axisX: axisX,\n axisY: axisY,\n chartRect: chartRect,\n index: seriesIndex,\n group: seriesElement,\n element: area\n });\n }.bind(this));\n }\n }.bind(this));\n\n this.eventEmitter.emit('created', {\n bounds: axisY.bounds,\n chartRect: chartRect,\n axisX: axisX,\n axisY: axisY,\n svg: this.svg,\n options: options\n });\n }" ]
[ "0.6576366", "0.6515155", "0.6300424", "0.6260759", "0.61928976", "0.6131376", "0.6125039", "0.6079667", "0.6016706", "0.60162926", "0.60162246", "0.6012936", "0.5994601", "0.5994601", "0.5994601", "0.5994601", "0.5994601", "0.5994601", "0.5935575", "0.59330875", "0.5905058", "0.5902822", "0.5886017", "0.5859823", "0.5854532", "0.5841205", "0.5839117", "0.58383846", "0.5801132", "0.57943404", "0.57919943", "0.57721615", "0.5770051", "0.5760604", "0.57528305", "0.5746087", "0.5737102", "0.5735464", "0.57309335", "0.5726439", "0.5726439", "0.57084787", "0.57084787", "0.57028323", "0.5701122", "0.5676636", "0.5674766", "0.56747276", "0.56548053", "0.56548053", "0.5638507", "0.5635901", "0.56256384", "0.56251365", "0.56154454", "0.56121016", "0.56037265", "0.55956954", "0.5572212", "0.5567943", "0.5550275", "0.5549235", "0.55486", "0.55423063", "0.554089", "0.55397546", "0.5537154", "0.55310637", "0.55250335", "0.5523504", "0.5521995", "0.55191934", "0.5516871", "0.5506165", "0.5504026", "0.55029684", "0.549623", "0.54940164", "0.54940164", "0.54940164", "0.54935884", "0.54835904", "0.54825485", "0.54804724", "0.5479077", "0.5470655", "0.54654086", "0.54553217", "0.54553217", "0.54453826", "0.5443322", "0.5442293", "0.5433135", "0.5428114", "0.54250354", "0.5424066", "0.54230213", "0.54223484", "0.5421688", "0.5421688" ]
0.71342796
0
sample output: ['enUS', 'enGB']
function getBrowserLocales(options = {}) { const defaultOptions = { languageCodeOnly: false } const opt = { ...defaultOptions, ...options } const browserLocales = navigator.languages === undefined ? [navigator.language] : navigator.languages if (!browserLocales) { return undefined } return browserLocales.map((locale) => { const trimmedLocale = locale.trim() return opt.languageCodeOnly ? trimmedLocale.split(/-|_/)[0] : trimmedLocale }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDropDownStrings(){\n\tlet ret=dropDownStrings['en']\n\tlet lang = document.documentElement.lang.split('-')[0]||'en'\n\tif( lang!='en' && !!dropDownStrings[lang] ){\n\t\tfor(let [k,v] of Object.entries(dropDownStrings[ lang ])){\n\t\t\tret[k]=v\n\t\t}\n\t}\n\twrite2log('Using drop down strings for ' + lang )\n\treturn ret\n}", "function chooseLocale(names){var i=0,j,next,locale,split;while(i<names.length){split=normalizeLocale(names[i]).split('-');j=split.length;next=normalizeLocale(names[i+1]);next=next?next.split('-'):null;while(j>0){locale=loadLocale(split.slice(0,j).join('-'));if(locale){return locale;}if(next&&next.length>=j&&compareArrays(split,next,true)>=j-1){//the next array item is better than a shallower substring of this one\nbreak;}j--;}i++;}return globalLocale;}", "function chooseLocale(names){var i=0,j,next,locale,split;while(i < names.length) {split = normalizeLocale(names[i]).split('-');j = split.length;next = normalizeLocale(names[i + 1]);next = next?next.split('-'):null;while(j > 0) {locale = loadLocale(split.slice(0,j).join('-'));if(locale){return locale;}if(next && next.length >= j && compareArrays(split,next,true) >= j - 1){ //the next array item is better than a shallower substring of this one\nbreak;}j--;}i++;}return globalLocale;}", "function getAvailableLanguages(){\n\tvar signlanguage = new Array();\n\n\t// TODO: Get dynamically\n\t//\n\tsignlanguage[0] = \"american sign language\";\n\tsignlanguage[1] = \"german sign language\";\n\tsignlanguage[2] = \"international sign language\";\n\treturn signlanguage;\n}", "function listLanguages() {\n return languageNames.concat()\n}", "function chooseLocale(names){var i=0,j,next,locale,split;while(i<names.length){split=normalizeLocale(names[i]).split('-');j=split.length;next=normalizeLocale(names[i+1]);next=next?next.split('-'):null;while(j>0){locale=loadLocale(split.slice(0,j).join('-'));if(locale){return locale;}if(next&&next.length>=j&&compareArrays(split,next,true)>=j-1){//the next array item is better than a shallower substring of this one\nbreak;}j--;}i++;}return null;}", "function getCurrenciesToInclude () {\n let currencies = [];\n supportedLocales.forEach(item => {\n let curr = item.currency;\n if (typeof curr === 'string') {\n currencies.push(curr);\n } else {\n currencies.push(...curr);\n }\n });\n return [...new Set(currencies)].sort();\n}", "function getAllCulturesAlphabetically() {\r\n var cultures = [];\r\n var culture;\r\n \r\n for ( var languageCode in Globalize.cultures) {\r\n culture = Globalize.cultures[languageCode];\r\n if (languageCode != \"default\") {\r\n cultures.push(culture);\r\n }\r\n }\r\n\r\n function sortAlphabetically(a, b) {\r\n var al = a.language;\r\n var bl = b.language;\r\n return al < bl ? -1 : (al > bl ? 1 : 0);\r\n }\r\n cultures.sort(sortAlphabetically);\r\n return cultures;\r\n }", "function chooseLocale(names){var i=0,j,next,locale,split;while(i<names.length){split=normalizeLocale(names[i]).split('-');j=split.length;next=normalizeLocale(names[i+1]);next=next?next.split('-'):null;while(j>0){locale=loadLocale(split.slice(0,j).join('-'));if(locale){return locale;}if(next&&next.length>=j&&compareArrays(split,next,true)>=j-1){//the next array item is better than a shallower substring of this one\r\n\tbreak;}j--;}i++;}return null;}", "function chooseLocale(names){var i=0,j,next,locale,split;while(i<names.length){split=normalizeLocale(names[i]).split('-');j=split.length;next=normalizeLocale(names[i+1]);next=next?next.split('-'):null;while(j>0){locale=loadLocale(split.slice(0,j).join('-'));if(locale){return locale;}if(next&&next.length>=j&&compareArrays(split,next,true)>=j-1){//the next array item is better than a shallower substring of this one\r\n\tbreak;}j--;}i++;}return null;}", "function chooseLocale(names) {\n\t var i = 0, j, next, locale, split;\n\t\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return globalLocale;\n\t }", "function chooseLocale(names) {\n\t var i = 0, j, next, locale, split;\n\t\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return globalLocale;\n\t }", "function chooseLocale(names) {\n\t var i = 0, j, next, locale, split;\n\t\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return globalLocale;\n\t }", "function chooseLocale(names) {\n\t var i = 0, j, next, locale, split;\n\t\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return globalLocale;\n\t }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n}", "function availableCountry() {\n let countries = [];\n Object.values(tdata).forEach(value => {\n let country = value.country.toUpperCase();\n if(countries.indexOf(country) !== -1) {\n\n }\n else {\n countries.push(country);\n }\n });\n return countries;\n}", "function chooseLocale(names) {\n var i = 0,j,next,locale,split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function listLanguages() {\n return high.listLanguages()\n}", "function getStrings(){\n\t\t//console.log('getString', lang, str, translations[lang][str])\n\t\tlet lang=document.documentElement.lang.split('-')[0]||'en' \n\t\tif(!translations[lang]) lang='en'\n\t\treturn translations[lang]\n\t}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n\t var i = 0, j, next, locale, split;\n\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return globalLocale;\n\t }", "function chooseLocale(names) {\n\t var i = 0, j, next, locale, split;\n\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return globalLocale;\n\t }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function getCatCountries() {\n\tvar categories = \"\";\n\tvar listValues = getCategoryValues([\"catPaysFrance\", \"catPaysItalie\", \"catPaysCanada\", \"catPaysUSA\", \"catPaysEspagne\"]);\n\tif (listValues != \"\")\n\t\tcategories = \"(@tppays==(\" + listValues + \"))\";\n\t\n\treturn categories;\n}", "function chooseLocale(names) {\r\n var i = 0, j, next, locale, split;\r\n\r\n while (i < names.length) {\r\n split = normalizeLocale(names[i]).split('-');\r\n j = split.length;\r\n next = normalizeLocale(names[i + 1]);\r\n next = next ? next.split('-') : null;\r\n while (j > 0) {\r\n locale = loadLocale(split.slice(0, j).join('-'));\r\n if (locale) {\r\n return locale;\r\n }\r\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\r\n //the next array item is better than a shallower substring of this one\r\n break;\r\n }\r\n j--;\r\n }\r\n i++;\r\n }\r\n return globalLocale;\r\n }", "getFallbacks(langKey) {\n let fallbacks = ['en'];\n switch (langKey) {\n case 'pt':\n fallbacks.unshift('pt-PT');\n break;\n case 'pt-PT':\n fallbacks.unshift('pt');\n break;\n // no default\n }\n return fallbacks;\n }", "function getCountries() {\n return [{\n name: \"India\",\n code: \"IN\"\n },\n {\n name: \"United States\",\n code: \"USA\"\n }];\n}", "function chooseLocale(names) {\n var i = 0,\n j,\n next,\n locale,\n split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n\n if (locale) {\n return locale;\n }\n\n if (next && next.length >= j && commonPrefix(split, next) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n\n j--;\n }\n\n i++;\n }\n\n return globalLocale;\n }", "function chooseLocale(names) {\n\t var i = 0, j, next, locale, split;\n\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return globalLocale;\n\t}", "function chooseLocale(names) {\n var i = 0,\n j,\n next,\n locale,\n split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n\n if (locale) {\n return locale;\n }\n\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n\n j--;\n }\n\n i++;\n }\n\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0,\n j,\n next,\n locale,\n split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n\n if (locale) {\n return locale;\n }\n\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n\n j--;\n }\n\n i++;\n }\n\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0,\n j,\n next,\n locale,\n split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n\n if (locale) {\n return locale;\n }\n\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n\n j--;\n }\n\n i++;\n }\n\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0,\n j,\n next,\n locale,\n split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n\n if (locale) {\n return locale;\n }\n\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n\n j--;\n }\n\n i++;\n }\n\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0,\n j,\n next,\n locale,\n split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n\n if (locale) {\n return locale;\n }\n\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n\n j--;\n }\n\n i++;\n }\n\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0,\n j,\n next,\n locale,\n split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n\n if (locale) {\n return locale;\n }\n\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n\n j--;\n }\n\n i++;\n }\n\n return globalLocale;\n}", "function chooseLocale(names) {\n\t var i = 0,\n\t j,\n\t next,\n\t locale,\n\t split;\n\t\n\t while (i < names.length) {\n\t split = normalizeLocale(names[i]).split('-');\n\t j = split.length;\n\t next = normalizeLocale(names[i + 1]);\n\t next = next ? next.split('-') : null;\n\t while (j > 0) {\n\t locale = loadLocale(split.slice(0, j).join('-'));\n\t if (locale) {\n\t return locale;\n\t }\n\t if (\n\t next &&\n\t next.length >= j &&\n\t commonPrefix(split, next) >= j - 1\n\t ) {\n\t //the next array item is better than a shallower substring of this one\n\t break;\n\t }\n\t j--;\n\t }\n\t i++;\n\t }\n\t return globalLocale;\n\t }", "function getOmniCurrencyCd(siteCd) {\n var arrSiteCd = new Array(\"ae\", \"ae_ar\", \"africa_en\", \"africa_fr\", \"africa_pt\", \"ar\", \"at\", \"au\", \"baltic\", \"be\", \"be_fr\", \"bg\", \"br\", \"ca\", \"ca_fr\", \"ch\", \"ch_fr\", \"cl\", \"cn\", \"co\", \"cz\", \"de\", \"dk\", \"ee\", \"eg\", \"es\", \"eu\", \"fi\", \"fr\", \"global\", \"gr\", \"hk\", \"hk_en\", \"hr\", \"hu\", \"id\", \"ie\", \"il\", \"in\", \"iran\", \"it\", \"jp\", \"sec\", \"kz_ru\", \"latin\", \"latin_en\", \"levant\", \"lt\", \"lv\", \"mea_ar\", \"mea_en\", \"mx\", \"my\", \"n_africa\", \"nl\", \"no\", \"nz\", \"pe\", \"ph\", \"pk\", \"pl\", \"pt\", \"ro\", \"rs\", \"ru\", \"sa\", \"sa_en\", \"se\", \"sg\", \"sk\", \"th\", \"tr\", \"tw\", \"ua\", \"ua_ru\", \"uk\", \"us\", \"ve\", \"vn\", \"za\");\n var arrCurrencyCd = new Array(\"AED\", \"AED\", \"USD\", \"USD\", \"USD\", \"ARS\", \"EUR\", \"AUD\", \"USD\", \"EUR\", \"EUR\", \"BGN\", \"BRL\", \"CAD\", \"CAD\", \"CHF\", \"CHF\", \"CLP\", \"CNY\", \"COP\", \"CZK\", \"EUR\", \"DKK\", \"EUR\", \"EGP\", \"EUR\", \"EUR\", \"EUR\", \"EUR\", \"USD\", \"EUR\", \"HKD\", \"HKD\", \"HRK\", \"HUF\", \"IDR\", \"EUR\", \"ILS\", \"INR\", \"IRR\", \"EUR\", \"JPY\", \"KRW\", \"KZT\", \"PAB\", \"PAB\", \"LBP\", \"LTL\", \"LVL\", \"USD\", \"USD\", \"MXN\", \"MYR\", \"USD\", \"EUR\", \"NOK\", \"NZD\", \"PEN\", \"PHP\", \"PKR\", \"PLN\", \"EUR\", \"RON\", \"RSD\", \"RUB\", \"SAR\", \"SAR\", \"SEK\", \"SGD\", \"EUR\", \"THB\", \"TRY\", \"TWD\", \"UAH\", \"UAH\", \"GBP\", \"USD\", \"VEF\", \"VND\", \"ZAR\");\n var currencyCd = \"\";\n try {\n for (var i = 0; i < arrSiteCd.length; i++) {\n if (siteCd == arrSiteCd[i]) {\n currencyCd = arrCurrencyCd[i];\n break;\n }\n }\n } catch (e) {\n currencyCd = \"USD\";\n }\n return currencyCd;\n}", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }", "function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return globalLocale;\n }" ]
[ "0.66592526", "0.6597174", "0.6582076", "0.6476799", "0.6366767", "0.6334615", "0.6235662", "0.62213993", "0.6158191", "0.6158191", "0.612126", "0.612126", "0.612126", "0.612126", "0.610048", "0.610048", "0.610048", "0.610048", "0.610048", "0.610048", "0.610048", "0.6095584", "0.60816765", "0.60751945", "0.60644305", "0.606334", "0.6062896", "0.6062896", "0.6059929", "0.6049536", "0.60151464", "0.60035384", "0.6003451", "0.6000232", "0.599925", "0.59966445", "0.59966445", "0.59966445", "0.59966445", "0.59966445", "0.5996605", "0.5982267", "0.59704655", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063", "0.5961063" ]
0.0
-1
Message will only be produced if there is an issue with the username/email attempt
render() { return ( <div> <h2>{this.state.message}</h2> <form onSubmit={this.handleSubmit} className='registration-form'> <div className='username'> <label htmlFor='username'>Username</label> <input type='text' className='input-words' name='username' onChange={this.handleChange} placeholder='Enter Username' /> </div> <div className='email'> <label htmlFor='email'>Email</label> <input type='email' className='input-words' name='email' onChange={this.handleChange} placeholder='Enter Email' /> </div> <div className='password'> <label htmlFor='password'>Password</label> <input type='password' className='input-words' name='password' onChange={this.handleChange} placeholder='Enter Password' /> </div> <div className='currentZip'> <label htmlFor='currentZip'>Zip Code</label> <input type='number' className='input-words' name='currentZip' onChange={this.handleChange} placeholder='Current Zip' /> </div> <div className='walkabilityImportance'> <label htmlFor='walkabilityImportance'>Importance of Walkability</label> <input type='number' className='input-numbers' name='walkabilityImportance' min='1' max='5' onChange={this.handleChange} placeholder='1 - 5' /> </div> <div className='medianDesiredAge'> <label htmlFor='medianDesiredAge'>Desired Median Age</label> <input type='number' className='input-words' name='medianDesiredAge' onChange={this.handleChange} placeholder='Desired Age of Neighbors' /> </div> <div className='medianAgeImportance'> <label htmlFor='medianAgeImportance'>Importance of Neighborhood Age</label> <input type='number' className='input-numbers' name='medianAgeImportance' min='1' max='5' onChange={this.handleChange} placeholder='1 - 5' /> </div> <div className='diversityImportance'> <label htmlFor='diversityImportance'>Importance of Diversity</label> <input type='number' className='input-numbers' name='diversityImportance' min='1' max='5' onChange={this.handleChange} placeholder='1 - 5' /> </div> <div className='houseValueImportance'> <label htmlFor='houseValueImportance'>Importance of House Costs to Income</label> <input type='number' className='input-numbers' name='houseValueImportance' min='1' max='5' onChange={this.handleChange} placeholder='1 - 5' /> </div> <div className='desiredWeather'> <label htmlFor='desiredWeather'>Desired Weather: 1 for Colder, 2 for the Same, 3 for Warmer</label> <input type='number' className='input-numbers' name='desiredWeather' onChange={this.handleChange} placeholder='1, 2, or 3' /> </div> <div className='weatherImportance'> <label htmlFor='weatherImportance'>Importance of Weather</label> <input type='number' className='input-numbers' name='weatherImportance' min='1' max='5' onChange={this.handleChange} placeholder='1 - 5' /> </div> <div className='nearbyAmenities'> <label htmlFor='nearbyAmenities'>Important Things Nearby</label> <input type='text' className='input-words' name='nearbyAmenities' min='1' max='5' onChange={this.handleChange} placeholder='What Do You Want To Live Near' /> </div> <div className='amenitiesImportance'> <label htmlFor='amenitiesImportance'>Importance of Those Things</label> <input type='number' className='input-numbers' name='amenitiesImportance' min='1' max='5' onChange={this.handleChange} placeholder='1 - 5' /> </div> <button>Register</button> </form> <button onClick={this.props.hideReg}>Already Registered?</button> </div> ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function accountCreationMessage (req, res, next) {\n let registeredUser = req.registeredUser\n let status = registeredUser.admin ? 'admin' : registeredUser.company.host ? 'staff' : 'user'\n req.resJson.message = !registeredUser.hashedPassword\n ? `Contact record for '${registeredUser.email}' without login privilege is created`\n : `${status} account '${registeredUser.email}' registered successfully. Privilege is supplied for 24 hours`\n return next()\n}", "checkForm() {\n // set empty string to make it easy to return + boolean to check whether it's successful\n var isSuccess = true;\n var message = \"\";\n\n var patt = new RegExp(\"@\")\n if (!patt.test(this.email)) {\n isSuccess = false;\n message += \"Email\\n\"\n }\n\n // return it with appropriate message\n if (isSuccess) {\n return \"Successfully Submitted!\";\n }\n else {\n return \"You must correct:\\n\" + message;\n }\n }", "function submitForgotUsername(){\n\ttry{\n\t\tvar license = $.txtfieldLicense.value;\n\t\tlicense = license.replace(/&(?!amp;)/g, '&amp;'​);\n\t var\tmail = $.txtfieldMail.value;\n\t var\temiratesid = $.txtfieldEmirateId.value.replace(/[-]/gi, \"\");\n\t Ti.API.info('emiratesid '+emiratesid);\n\t var\tmobile = $.txtfieldMobile.value.replace(/[-]/gi, \"\");\n\t var\tpassport = $.txtfieldPassport.value;\n\t passport = passport.replace(/&(?!amp;)/g, '&amp;'​);\n\t var lblEmiratesPassport;\n\t \n\tif($.imgIndividual.image === Alloy.Globals.path.radioActive){\n\t\tif(emiratesid === \"\" && passport === \"\"){\n\t\t\tutilities.showAlert(Alloy.Globals.selectedLanguage.forgotUsername,Alloy.Globals.selectedLanguage.validateHintText,function(){});\n\t\t}else if(mail === \"\"){\n\t\t \tutilities.showAlert(Alloy.Globals.selectedLanguage.forgotUsername,Alloy.Globals.selectedLanguage.mailId,function(){});\n\t\t}else if(mobile === \"\"){\n\t\t utilities.showAlert(Alloy.Globals.selectedLanguage.forgotUsername,Alloy.Globals.selectedLanguage.mobileNumber,function(){});\n\t\t}else if (emiratesid !== \"\" && emiratesid.length < 15) {\n\t\t\t$.txtfieldEmirateId.value = \"\";\n\t\t \tutilities.showAlert(Alloy.Globals.selectedLanguage.forgotUsername,Alloy.Globals.selectedLanguage.invalidEmiratesId,function(){});\n\t\t}\n\t\telse if (mobile.length !== 10 && mobile.value !== \"\") {\n\t\t \tutilities.showAlert(Alloy.Globals.selectedLanguage.forgotUsername,Alloy.Globals.selectedLanguage.mobileLength,function(){});\n\t\t}else{\n\t\t\ttry{\n\t\t\t\tlblEmiratesPassport = (emiratesid !== \"\")?emiratesid:passport;\n\t\t\t\thttpManager.forgetUsername(function(result){\n\t\t\t\tvar rootNode = result.getElementsByTagName(\"output\");\n\t\t\t\tvar ns =\"http://ForgetUserName\";\n\t\t\t\t//var subNode = result.response.getElementsByTagNameNS(\"ns1:Status\");\n\t\t\t\tif(rootNode.length > 0){\n\t\t\t\t\tvar status = result.getElementsByTagNameNS(ns, \"Status\").item(0).textContent;\n\t\t\t\t\t\n\t\t\t\t\tif(status === \"Success\"){\n\t\t\t\t\t\tAlloy.Globals.hideLoading();\n\t\t\t\t\t\tvar alertView = Ti.UI.createAlertDialog({\n\t\t\t\t\t\t\ttitle : Alloy.Globals.selectedLanguage.appTitle,\n\t\t\t\t\t\t\tmessage : (Alloy.Globals.isEnglish)?result.getElementsByTagNameNS(ns, \"Message_EN\").item(0).textContent:result.getElementsByTagNameNS(ns, \"Message_AR\").item(0).textContent,\n\t\t\t\t\t\t\tbuttonNames : [Alloy.Globals.selectedLanguage.ok]\n\t\t\t\t\t\t});\n\t\t\t\t\t\talertView.addEventListener('click', function(e) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (e.index == 0) {\n\t\t\t\t\t\t\t\tvar winMenu = Alloy.createController('UserManagement/winLogin',{\n\t\t\t\t\t\t\t\t\tisFromLeftPanel : false\n\t\t\t\t\t\t\t\t}).getView();\n\t\t\t\t\t\t\t\tAlloy.Globals.openWindow(winMenu);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\talertView.show();\n\t\t\t\t\t}else if(status === \"Failure\"){\n\t\t\t \t\t\tAlloy.Globals.hideLoading();\n\t\t\t \t\t\tvar alertView = Ti.UI.createAlertDialog({\n\t\t\t\t\t\t\t\ttitle : Alloy.Globals.selectedLanguage.appTitle,\n\t\t\t\t\t\t\t\tmessage : (Alloy.Globals.isEnglish)?result.getElementsByTagNameNS(ns, \"Message_EN\").item(0).textContent:result.getElementsByTagNameNS(ns, \"Message_AR\").item(0).textContent,\n\t\t\t\t\t\t\t\tbuttonNames : [Alloy.Globals.selectedLanguage.ok]\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\talertView.show();\n\t\t\t \t\t}\n\t\t\t\t}else{\n\t\t \t\tvar alertView = Ti.UI.createAlertDialog({\n\t\t\t\t\t\ttitle : Alloy.Globals.selectedLanguage.appTitle,\n\t\t\t\t\t\tmessage : Alloy.Globals.selectedLanguage.serviceError,\n\t\t\t\t\t\tbuttonNames : [Alloy.Globals.selectedLanguage.ok]\n\t\t\t\t });\n\t\t\t\t alertView.show();\n\t\t \t Alloy.Globals.hideLoading();\n\t\t \t}\n\t\t\t\tAlloy.Globals.hideLoading();\n\t\t\t},1,mail,mobile,lblEmiratesPassport);\n\t\t\t}catch(e){\n\t\t\t\tTi.API.info('Error '+e.message);\n\t\t\t}\n\t\t}\n\t}else if($.imgEstablishment.image === Alloy.Globals.path.radioActive){\n\t\tif(license === \"\"){\n\t\t utilities.showAlert(Alloy.Globals.selectedLanguage.forgotUsername,Alloy.Globals.selectedLanguage.licenseNumber,function(){});\n\t }else if(mail === \"\"){\n\t\t \tutilities.showAlert(Alloy.Globals.selectedLanguage.forgotUsername,Alloy.Globals.selectedLanguage.mailId,function(){});\n\t\t}else if(mobile === \"\"){\n\t\t utilities.showAlert(Alloy.Globals.selectedLanguage.forgotUsername,Alloy.Globals.selectedLanguage.mobileNumber,function(){});\n\t\t}\n\t\t// else if (isNaN(mobile)) {\n\t\t \t// utilities.showAlert(Alloy.Globals.selectedLanguage.forgotUsername,Alloy.Globals.selectedLanguage.invalidMobile,function(){});\n\t\t// }\n\t\telse if (mobile.length !== 10 && mobile.value !== \"\") {\n\t\t \tutilities.showAlert(Alloy.Globals.selectedLanguage.forgotUsername,Alloy.Globals.selectedLanguage.mobileLength,function(){});\n\t\t}else{\n\t\t\ttry{\n\t\t\t\thttpManager.forgetUsername(function(result){\n\t\t\t\tvar rootNode = result.getElementsByTagName(\"output\");\n\t\t\t\tvar ns =\"http://ForgetUserName\";\n\t\t\t\t//var subNode = result.getElementsByTagName(\"ns1:Status\");\n\t\t\t\tvar ns =\"http://ForgetUserName\";\n\t\t \tif(rootNode.length > 0){\n\t\t \t\t\t \t\t\n\t\t \t\tvar status = result.getElementsByTagNameNS(ns, \"Status\").item(0).textContent;\n\t\t \t\t\n\t\t \t\tif(status === \"Success\"){\n\t\t \t\t\t\n\t\t \t\t\tvar alert = Ti.UI.createAlertDialog({\n\t\t\t\t\t\t\ttitle : Alloy.Globals.selectedLanguage.appTitle,\n\t\t\t\t\t\t\tmessage : (Alloy.Globals.isEnglish)?result.getElementsByTagNameNS(ns, \"Message_EN\").item(0).textContent:result.getElementsByTagNameNS(ns, \"Message_AR\").item(0).textContent,\n\t\t\t\t\t\t\tbuttonNames : [Alloy.Globals.selectedLanguage.ok]\n\t\t\t\t\t\t});\n\t\t\t\t\t\talert.addEventListener('click', function(e) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (e.index == 0) {\n\t\t\t\t\t\t\t\tvar winMenu = Alloy.createController('UserManagement/winLogin',{\n\t\t\t\t\t\t\t\t\tisFromLeftPanel : false\n\t\t\t\t\t\t\t\t}).getView();\n\t\t\t\t\t\t\t\tAlloy.Globals.openWindow(winMenu);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\talert.show();\n\t\t \t\t}else if(status === \"Failure\"){\n\t\t\t \t\t\tAlloy.Globals.hideLoading();\n\t\t\t \t\t\tvar alert = Ti.UI.createAlertDialog({\n\t\t\t\t\t\t\t\ttitle : Alloy.Globals.selectedLanguage.appTitle,\n\t\t\t\t\t\t\t\tmessage : (Alloy.Globals.isEnglish)?result.getElementsByTagNameNS(ns, \"Message_EN\").item(0).textContent:result.getElementsByTagNameNS(ns, \"Message_AR\").item(0).textContent,\n\t\t\t\t\t\t\t\tbuttonNames : [Alloy.Globals.selectedLanguage.ok]\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\talert.show();\n\t\t\t \t}\n\t\t \t}else{\n\t\t \t\tvar alert = Ti.UI.createAlertDialog({\n\t\t\t\t\ttitle : Alloy.Globals.selectedLanguage.appTitle,\n\t\t\t\t\t//title:\"tset\",\n\t\t\t\t\tmessage : Alloy.Globals.selectedLanguage.serviceError,\n\t\t\t\t\tbuttonNames : [Alloy.Globals.selectedLanguage.ok]\n\t\t\t\t });\n\t\t\t\t alert.show();\n\t\t \t Alloy.Globals.hideLoading();\n\t\t \t}\n\t\t \tAlloy.Globals.hideLoading();\n\t\t\t},2,mail,mobile,license);\n\t\t\t}catch(e){\n\t\t\t\tTi.API.info('Error '+e.message);\n\t\t\t}\n\t\t}\n\t}\n\t}catch(e){\n\t\tTi.API.info('Error in submit forget data function '+JSON.stringify(e));\n\t}\n}", "function validateUser()\n\t{\n\t\tvar msg = '';\n\t\tif($scope.password != $scope.confirm_password){\n\t\t\tmsg = msg + \"\\n\"+$i18next.t(\"validate_confirm_password\");\n\t\t}\n\t\tif($scope.password.length < 8){\n\t\t\tmsg = msg + \"\\n\"+$i18next.t(\"validate_password\");\n\t\t}\n\t\tif($scope.username.length <4){\n\t\t\tmsg = msg + \"\\n\"+$i18next.t(\"validate_username\");\n\t\t}\n\t\tif (!/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test($scope.email)){\n\t\t\tmsg = msg + \"\\n\"+$i18next.t(\"validate_email\");\n\t\t}\n\t\treturn msg;\n\t}", "function error(){\n return \"Invaild e-mail or password!\";\n }", "function handleRecoverPassword(){\n if(emailValid()){\n console.log(`send me my password to: ${email}`)\n setEmail('')\n }else{\n console.log('invalid')\n }\n }", "function checkEmail() {}", "function emailSuccess() {}", "function onGetUserNameFail(sender, args) {\n alert('Failed to get user name. Error:' + args.get_message());\n }", "function onGetUserNameFail(sender, args) {\n alert('Failed to get user name. Error:' + args.get_message());\n }", "function onGetUserNameFail(sender, args) {\n alert('Failed to get user name. Error:' + args.get_message());\n }", "function onGetUserNameFail(sender, args) {\n alert('Failed to get user name. Error:' + args.get_message());\n }", "error () {\n return this.username.trim().length < 7 ? 'Please enter a longer username' : ''\n }", "userExists(){\n // set Status for previous view in case server validation failed \n this.displayMode = 'none';\n this.isAgreed = false;\n // add xhr message into form error validation message object - will be shown on screen\n for(let i in this.messageService.xhr.warn){\n this.addform.emailid.$setValidity(i, !this.messageService.xhr.warn[i]);\n }\n\n this.abortForm = true;\n }", "function fixEmail() {\n var decision = Browser.msgBox(\"WARNING\", \"Are you sure you want to change your email?\", Browser.Buttons.YES_NO);\n if (decision == 'yes') {\n var email = Browser.inputBox('Enter email');\n var password = Browser.inputBox('Enter password');\n\t\tUserProperties.setProperty('email', email);\n\t\tUserProperties.setProperty('password', password);\n\t}\n}", "function checkEmail () {\n var scriptProps = PropertiesService.getScriptProperties();\n var myEmail = scriptProps.getProperty('userEmail');\n if (myEmail == null) {\n return '✗ You still need to set up your email address. Go to 🔍 Career Hacking™ > 📧 Set Email Address.';\n } else {\n return 'Your follow-up reminders will be send to ' + myEmail + '. To have them sent to a different address, go to\\n🔍 Career Hacking™ > 📧 Set Email Address.'\n } \n}", "checkUsernameAndEmail(req, res, next){\n\n db.query(queries.selectUserWithUsernameAndEmail, [req.body.username, req.body.email], (err, result, fields) => {\n\n if (err) throw err;\n\n if (result.length == 0){\n res.status(400).send(`User with username ${req.body.username} and email ${req.body.email} does not exist.`);\n } else {\n next();\n }\n });\n \n }", "function usernameValidate() {\r\n\t\tif (username.value != \"\") {\r\n\t\t\talertUsername.innerHTML = \"\";\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "function faqEnroll() {\n if ( $('#mce-EMAIL').val() == \"\" ) {\n\t handleLoginFailure({code: \"NOLOGIN_NOEMAIL\"});\n\t return;\n };\n register( $('#mc-embedded-subscribe-form') );\n }", "function validateUsername(username){\n var result = true;\n if (username == \"\")\n {\n message = \"Username is required\";\n result = false;\n console.log(message);\n }\n else if(!(/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(username)))\n {\n message = \"Please enter a valid email address\";\n result = false;\n console.log(message);\n }\n return result;\n}", "function validateInput() {\n // Get the users vales from the DOM\n const nameInput = document.getElementById(\"name-input\").value;\n const emailInput = document.getElementById(\"email-input\").value;\n const messageInput = document.getElementById(\"message-box\").value;\n\n // If any of them are blank show an error message\n if (!nameInput) userMessage(\"Please fill out the name field\", true);\n else if (!emailInput) userMessage(\"Please fill out the email field\", true);\n else if (!emailInput.includes('@')) userMessage(\"Please enter a valid email address\", true);\n else if (!emailInput.includes('.')) userMessage(\"Please enter a valid email address\", true);\n else if (!messageInput) userMessage(\"Please fill out the message field\", true);\n else userMessage(\"<p>Thank you for your message!</p> <p>You have instantly become a member of our cooking community!</p>\", false);\n}", "function sendMessage(id_email){\r\n if(validateEmail(id_email)){\r\n alert(\"Message sent succesfully\");\r\n\r\n }else{\r\n alert(\"Message not sent. Be sure to have typed an email address\");\r\n\r\n }\r\n}", "function checkUsername(message) {\n // If the username has been taken, and a new one (with a number on the end) has been assigned\n // try to Ghost the other user\n if (client.nick.match(new RegExp(settings.client.user + '[0-9]+'))) {\n client.say('nickserv', 'ghost ' + settings.client.user + ' ' + settings.client.pass);\n }\n}", "function attemptContact() {\n \"use strict\";\n var variables = getVariables();\n if (variables) {\n sendEmail(variables);\n }\n}", "function emailTaken() {\n\t\n\tvar val = document.getElementById(\"email\").value;\t\n\tvar err = document.getElementById(\"email-error\");\t\n\terr.innerHTML = \"Email already registered.<br> Click <a href=\\\"login.html\\\">here</a> to login.\";\n\terr.style.visibility = \"visible\";\n\n}", "function findUsername() {\r\n \t \t\r\n \tUserService.findUserbyName(self.user.username)\r\n \t\t.then(\r\n\t \t\t\tfunction (response) {\r\n\t \t\t\t\tconsole.log(response.status);\r\n\t \t\t\t\tif(response.status == 200) {\r\n\t \t\t\t\t\t\r\n\t \t\t\t\t\tif(response.data != \"\") {\r\n\t\t \t\t\t\t\tif(response.data.obsolete == \"SUPER_ADMIN\") {\r\n\t\t \t\t\t\t\t\tself.message = \"Kindly contact your technical person..!\";\r\n\t\t \t\t\t\t\t\tsuccessforgot_AnimateOpen('.success-forgot');\r\n\t \t\t\t\t \t\t\r\n\t\t \t\t\t\t\t} else if (response.data.obsolete == \"MANAGER\") {\r\n\t\t \t\t\t\t\t\tif(response.data.employeeMaster.emp_email==null){\r\n\t\t \t\t\t\t\t\t\tself.message = \"Password reset link sent to your E-mail\";\r\n\t\t \t\t\t\t\t\t}else{\r\n\t\t \t\t\t\t\t\t\tself.message = \"Password reset link sent to your E-mail : \" + response.data.employeeMaster.emp_email;\r\n\t\t \t\t\t\t\t\t}\r\n\t\t \t\t\t\t\t\t\r\n\t\t \t\t\t\t\t\tsuccessforgot_AnimateOpen('.success-forgot');\r\n\t\t \t\t\t\t\t} else {\r\n\t\t \t\t\t\t\t\tconsole.log(response.data.obsolete);\r\n\t\t \t\t\t\t\t\tif(response.data.active != 'Y') {\r\n\t\t \t\t\t\t\t\t\tself.message = \"Kindly contact your manager..! Manager contact no is \"+ response.data.active;\r\n\t\t\t \t\t\t\t\t\tsuccessforgot_AnimateOpen('.success-forgot');\t\t\r\n\t\t \t\t\t\t\t\t} else {\r\n\t\t \t\t\t\t\t\t\tself.message = \"Kindly contact your manager..!\";\r\n\t\t\t \t\t\t\t\t\tsuccessforgot_AnimateOpen('.success-forgot');\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} else {\r\n\t\t \t\t\t\t\tself.message = \"User name does not match..!\";\r\n\t\t \t\t\t\t}\r\n\t \t\t\t\t\t\r\n\t \t\t\t\t\t\r\n\t \t\t\t\t} else if(response.status == 226) {\r\n\t \t\t\t\t\t\r\n\t \t\t\t\t\tself.message = \"Link already sent to your registered E-mail id..!\";\r\n\t \t\t\t\t\tsuccessforgot_AnimateOpen('.failure-forgot');\r\n\t \t\t\t\t} else {\r\n\t \t\t\t\t\tself.message = \"Invalid username..!\";\r\n\t \t\t\t\t\tsuccessAnimate('.failure');\r\n\t \t\t\t\t\tclear_username();\r\n\t \t\t\t\t}\r\n\t \t\t\t\t\r\n\t \t\t\t\t\r\n\t \t\t\t},\r\n\t \t\t\tfunction(errResponse) {\r\n\t \t\t\t\tconsole.log(errResponse);\r\n\t \t\t\t}\r\n \t\t\t);\r\n }", "validateEmail() {\n const len = this.state.email.length;\n if (len>8) return \"success\";\n else if(len>3) return \"warning\";\n else if(len>0) return \"error\";\n }", "function handleSignup(email, password) {\n // Check if the email exists\n\n // Save the user to the database\n db.saveUser({email, password}); // simple user object\n\n // Send the welcome email\n}", "function onGetUserNameFail(sender, args) {\n alert('Failed to get user name. Error:' + args.get_message());\n}", "function onGetUserNameFail(sender, args) {\n alert('Failed to get user name. Error:' + args.get_message());\n}", "handleOk() {\n const { email } = this.state;\n if (!this.validateEmail(email)) {\n message.error('Please enter valid eamil');\n return;\n }\n firebase.auth().sendPasswordResetEmail(email).then(() => {\n message.success('Password reset email has been sent.');\n }).catch((err) => {\n message.error(err.message);\n });\n this.setState({\n showModal: false,\n });\n }", "function validateNewUserData() {\n !newUser.username || !newUser.password || !newUser.confirmPassword || !newUser.name || !newUser.email ?\n alert('All fields are required. Please fill out accordingly.') :\n newUser.password !== newUser.confirmPassword ? alert('Your passwords don\\'t match!') : postNewUserData();\n }", "function emailCheck(){\n return false;\n }", "function notDefaultUsername(f, defaultUsername, defaultUsernameMessage) {\r\n // If username for comment is default username then display error message and return false\r\n if (f.msg_author.value == defaultUsername || f.msg_author.value == '') {\r\n alert(defaultUsernameMessage);\r\n return false;\r\n }\r\n // By default return true\r\n return true;\r\n}", "function getInvalidUsernameResponse(username) {\n return 'Invalid username: ' + username + '. Should match: min-length=3 max-length=20 no-whitespace';\n}", "function tryEmail() {\n emailTimeSent = new Date();\n emailSentSuccess = true;\n try {\n emailMessage = sendResponseEmail(respEmail, validResults, dataFileName, emailDate, formUrl);\n } catch (error) {\n emailSentSuccess = false;\n }\n }", "function SparkEmailSignupNotification(email, res, memberCount, username, src) {\n console.log('[Spark] Sending signup notification email to admins..');\n \n transporter.sendMail({\n from: '\"Imperium42\" <[email protected]>',\n to: adminEmails, // []\n subject: '[MC] +1 Subscriber (' + email + ') >> ' + memberCount + ' members (from ' + src + ')!',\n text: 'Username: ' + username + ' ~ Rock on, i42!',\n html: '<span style=\"font-weight:bold;\">Username: </span>' + username + '<br><br>Rock On, i42!'\n }, (err, info) => {\n if (err) {\n var errSend = '[MC] **ERR @ SparkEmailSignupNotification: ' + J(err);\n console.log(errSend);\n if (res) \n res.send(errSend);\n } else {\n console.log( '[Spark] Success: ' + J(info) );\n if (res)\n res.send('Success (' + info[\"accepted\"] + ')!')\n }\n });\n}", "function handleEmail(event) {\n // Prevent the form submitting and refreshing the page\n event.preventDefault();\n\n // Select the input field\n const inputField = document.querySelector(\".inputs__input\");\n\n // Select the input field label (will be used to display the error message)\n const inputFieldLabel = document.querySelector(\"label[for='text-input']\");\n\n // Hide the error message and reset its color\n inputFieldLabel.style.display = \"none\";\n inputFieldLabel.style.color = \"red\";\n\n // Extract the input from inputField\n const userInput = inputField.value;\n\n // Create a regex to test for a valid email\n const regex = /[a-zA-z0-9_\\.]+@[a-zA-Z0-9_\\.\\-]+[.][a-z]{3}/i;\n\n // Check if field is empty\n if (!userInput) {\n inputFieldLabel.style.display = \"inline\";\n inputFieldLabel.innerText = \"Oops! Please add your email\";\n }\n // Check if the email is valid\n else if (!regex.test(userInput)) {\n inputFieldLabel.style.display = \"inline\";\n inputFieldLabel.innerText = \"Oops! Please check your email\";\n }\n // Otherwise, let the user in\n else {\n inputFieldLabel.style.display = \"inline\";\n inputFieldLabel.style.color = \"green\";\n inputFieldLabel.innerText = \"You're in!\";\n }\n }", "validateAcknowledger() {\n var acknowledger = this.state.acknowledger;\n if (acknowledger === \"\") {\n return null;\n }\n if (document.getElementById(\"acknowledger\")) {\n if (\n !this.state.users.some(function(user) {\n return user.fullName === acknowledger;\n })\n ) {\n return \"error\";\n }\n }\n return \"success\";\n }", "checkUsername(username, email, for_user_id) {\n\n return Nilavu.ajax('/users/check_email', {\n data: {\n username,\n email,\n for_user_id\n }\n });\n }", "function userEmail() {\n return (req, res, next) => {\n const { email } = req.body;\n //if no email, please enter one\n if (!email) {\n return res.json({ no_email_provided: \"please enter an email\" });\n }\n //send email back to user\n req.email = email;\n //next stack\n next();\n };\n}", "function isOkEmail() {\n\n //The program looks there is the right format.\n let indexOfAt = emailUser.value.indexOf('@');\n let textBeforeAt = emailUser.value.slice(0, indexOfAt);\n let textAfterAt = emailUser.value.slice(indexOfAt+1, emailUser.value.length);\n let indexOfDot = textAfterAt.indexOf('.');\n let textBeforeDot = textAfterAt.slice(0, indexOfDot);\n let textAfterDot = textAfterAt.slice(indexOfDot+1, emailUser.value.length);\n\n //fThe program that there are all the elements and later the right format\n if (emailUser.value === \"\") {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_mailEmpty_EM');\n okEmail = false;\n } else if (!emailUser.value.includes('@')) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_no_At_EM');\n return false;\n } else if(textAfterAt.length == 0 || (textAfterAt.length == 1 && indexOfDot == 0)) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_no_domain_EM');\n return false;\n } else if (!emailUser.value.includes('.')) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_no_dot_EM');\n return false;\n } else if (emailUser.value.includes(' ')) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_blank_Space_EM');\n return false;\n } else if (textBeforeAt.length === 0) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_bad_Format_EM');\n return false;\n } else if (textBeforeDot.length === 0) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_bad_Format_EM');\n return false;\n } else if (textAfterDot.length === 0) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_bad_Format_EM');\n return false;\n } else {\n clearAllEmailErrors();\n return true;\n }\n }", "function isEmailTaken(){\n return new Promise(function(resolve, reject){\n mysql.pool.getConnection(function(err, connection){\n if(err){return reject(err)};\n\n connection.query({\n sql: 'SELECT email FROM deepmes_auth_login WHERE email=?',\n values: [fields.email+'@sunpowercorp.com']\n }, function(err, results){\n if(err){return reject(err)};\n\n if(typeof results[0] !== 'undefined' && results[0] !== null && results.length > 0){\n let emailTaken = 'Email is already taken.';\n reject(emailTaken);\n } else {\n resolve();\n }\n\n });\n\n connection.release();\n\n });\n });\n }", "function validateEmail(){\n\tvar re = /^([\\w-]+(?:\\.[\\w-]+)*)@((?:[\\w-]+\\.)*\\w[\\w-]{0,66})\\.([a-z]{2,6}(?:\\.[a-z]{2})?)$/i;\n var result = re.test($.txtfieldMail.value);\n if(result == 0){\n \t$.txtfieldMail.value = \"\";\n \tutilities.showAlert(Alloy.Globals.selectedLanguage.forgotUsername,Alloy.Globals.selectedLanguage.invalidmail,function(){});\n }\n}", "function handleEmail(e) {\n e.preventDefault();\n const emailSent = e.target.elements[0].value;\n if (emailIsValid(emailSent)) {\n alert('Thanks for your subscription! :D');\n } else {\n alert('Your e-mail is incorrect. Try again :(');\n }\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 error_message(){\n\n console.log(\"in error message\");\n console.log(notification);\n \n //incorrect login notice\n if(notification==\"incorrect_login\"){\n document.getElementById(\"incorrect_msg\").style.color='red';\n document.getElementById(\"incorrect_msg\").innerHTML=\"&ensp;&ensp;&#9432;&emsp;Incorrect username or password, try again!\";\n };\n\n //session expire login\n if(notification==\"session_expire\"){\n document.getElementById(\"incorrect_msg\").style.color='red';\n //document.getElementById(\"username\").style.color=red;\n //document.getElementById(\"password\").style.color=red;\n document.getElementById(\"incorrect_msg\").innerHTML=\"&ensp;&ensp;&#9432;&emsp;Session expired, please login again!\";\n };\n }", "function warnValidateEmail(){\n var emailAddress = $('#emailAddressValue').val();\n var defaultDisplayName = \"dumval\";\n\n if (emailAddress!='' && checkEmailAddress(emailAddress)){\n validateUser(emailAddress,defaultDisplayName,function(data){\n var i,len;\n for (i=0,len=data.length;i<len;i++){\n if (data[i]=='email_address'){\n $('#emailAddressMessage').html(\"<p style=\\\"color:red;\\\">This email address is already taken.</p>\");\n }\n }\n });\n }\n}", "verifyUserEmail( userId, email = '' ) {\n \"use strict\";\n try {\n Accounts.sendVerificationEmail( userId );\n return {\n msgSuccess: true,\n message : \"Verification email sent, check your email to verify your account before login\"\n };\n }\n catch( error ) {\n return error.reason + \": Could not sent verification message\";\n }\n }", "checkUsernameAvailability(e) {\n e.preventDefault();\n this.setState({ isCheckingUsername: true });\n\n checkUsernameAvailability(this.state.formFields[USERNAME_ID])\n .then(response => {\n if (!response.usernameExists) {\n // Assumes the username is available.\n\n generateSuccessDialog(\n 'Click on continue to start filling out the required details for your account.',\n 'Continue'\n ).then(() => {\n this.setState({ isUsernameChosen: true, isCheckingUsername: false });\n });\n } else {\n // Assumes the username is not available.\n\n swal({\n title: 'Username is not available',\n text: 'Please use a different username',\n type: 'error',\n });\n\n this.setState({ isCheckingUsername: false });\n }\n })\n .catch(error => {\n // Assumes that the server has failed to check the username's availability.\n\n generateErrorDialog('There was a problem checking the availability of this username.');\n this.setState({ isCheckingUsername: false })\n })\n }", "function setuserMsg() {\n var role = masterData.getUserRole();\n self.isSubsriber = (role.is_subscriber == \"1\") ? true : false;\n self.isAdmin = (role.is_admin == \"1\") ? true : false;\n self.userMsg = (self.isSubsriber) ? 'You have reached the matter hosting limit for your current subscription.' : 'You have reached the matter hosting limit for your current subscription. Please contact the subscribing managing partner to increase the matter hosting capacity.';\n }", "handleSubmitSignup(e) {\n\t\te.preventDefault();\n\t\tvar usernameInput = this.refs.signupusername.value;\n\t\tvar emailInput = this.refs.signupemail.value;\n\t\tvar passwordInput = this.refs.signuppasswordone.value;\n\t\tvar confirmPasswordInput = this.refs.signuppasswordtwo.value;\n\n\t\t//Check if the passwords entered match.\n\t\tif (passwordInput !== confirmPasswordInput) {\n\t\t\tthis.setState({errorMessage: \"Your passswords don't match.\"});\n\t\t\treturn;\n\t\t}\n\t\t//Check if the username is one word and doesn't contain characters it shouldnt.\n\t\tif (!/^[A-Z0-9_-]{3,30}$/i.test(usernameInput)) {\n\t\t\tthis.setState({errorMessage: \"Your username isn't of the right format, it should be one word and contain only these '-' and '_' special characters. It should also be between 3 and 30 characters.\"});\n\t\t\treturn;\n\t\t}\n\t\t// Check if the username is off the right length > 3 characters and <= 30\n\t\t// characters.\n\t\tif (usernameInput.length > 30 || usernameInput.length < 3) {\n\t\t\tthis.setState({errorMessage: \"Your username should be longer than 3 characters and less than 30, which yours is not.\"});\n\t\t\treturn;\n\t\t}\n\t\t//Check if the email is in an email format, I don't like the html warning thing\n\t\tif (!/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$/i.test(emailInput)) {\n\t\t\tthis.setState({errorMessage: \"Your email is not in the format of an actual email.\"});\n\t\t\treturn;\n\t\t}\n\n\t\tthis.props.signUpUser(usernameInput, passwordInput, emailInput);\n\n\t}", "function disp_alert(email) {\n alert(email + \", login successfulled.\");\n }", "function checkUsername(username){\r\n\t\t\t\r\n\t\t\tvar user_check = 0;\r\n\t\t\tif (self.user.user_id != null) {\r\n\t\t\t\t\r\n\t\t\t\tif(username == self.usernameupdateCheck) {\r\n\t\t\t\t\tuser_check = 1;\r\n\t\t\t\t\t\r\n\t\t\t\t\tself.errorUsername = false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ( user_check == 0 ) {\r\n\t\t\t\t\r\n\t\t\t\tUserService.checkUsername(username)\r\n\t\t\t\t.then(\r\n\t\t\t\t\t\tfunction(response) {\r\n\t\t\t\t\t\t\tif( response.status == 200 ) {\r\n\t\t\t\t\t\t\t\tself.errorUsername = true;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tself.errorUsername = false;\r\n\t\t\t\t\t\t\t\tconsole.log(response.status);\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t}, function (errResponse) {\r\n\t\t\t\t\t\t\tconsole.log(errResponse);\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}\r\n\t\t\t\r\n\t\t\t\r\n\t\t}", "function mensagemErro(email, passi) {\r\n let mensagem = \"\"\r\n\r\n if (email) { //Ou seja o email não existe\r\n mensagem = \"O mail que introduziu não existe\"\r\n }\r\n else if (passi) { //Se o mail existe mas a pass é true, então é porque o mail e a pass não correspondem\r\n mensagem = \"A password está errada\"\r\n }\r\n\r\n return mensagem\r\n}", "sendForgotPasswordEmail() {\n let userObj = {\n email: this.state.emailAddress\n }\n\n API.sendForgotPasswordEmail(userObj)\n .then(response => {\n if (!response.data.error) {\n this.setState({ serverErrorMessage: \"An email has been sent.\"});\n } else {\n this.setState({ serverErrorMessage: response.data.error })\n }\n })\n }", "function validateUser(name, email) {\n if (name === \"\" || name.length < 2) {\n return \"Username is too short (minimum 2 characters)\"\n }\n if (email === \"\" || !email.includes(\"@\")) {\n return \"Please enter a valid email\"\n }\n return true\n}", "function postsValidatedEmail() {\r\n if ($(\"#email\").val().length === 0) {\r\n //sets the background\r\n sendState(on, \"email\");\r\n\r\n //adds the data to the array\r\n addDataAllErrors(allErrorMess[0]);\r\n } else if (!validateEmail($(\"#email\").val())) {\r\n //sets the background\r\n sendState(on, \"email\");\r\n\r\n //adds the data to the array\r\n addDataAllErrors(allErrorMess[1]);\r\n\r\n //resets the email field\r\n $(\"#email\").val(\"\");\r\n } else {\r\n //Value validated put an element like a \"tick\"\r\n //image next to the element\r\n\r\n //sends the state and the object source\r\n sendState(off, \"email\");\r\n //clears the element\r\n $(\"#lblEmailError\").html(\"\");\r\n console.log(`the email element entered is correct!`);\r\n }\r\n }", "function resendEmail(){\n $('#createAccountSubmitMessage').html(\"Loading...\");\n resendVerifyEmail($('#emailAddressValue').val(),function(tf){\n if (tf){\n $('#createAccountSubmitMessage').html(createAccountMessage);\n } else {\n var dumStr = '<p>An error has occurred: Unable to find email address in database. Please try creating account again.<p>';\n $('#createAccountSubmitMessage').html(dumStr);\n }\n });\n}", "function registerUser(e) {\n e.preventDefault();\n const userName = nameInputResiter.value;\n const userEmail = emailInputRegister.value;\n const userPassword = passwordInputRegister.value;\n\n // check if all input is not entered!\n if (userName === \"\" && userEmail === \"\" && userPassword === \"\") {\n window.alert(\"Please enter your information before registering!\");\n } else if (userName === \"\") {\n window.alert(\"Please enter your full name before registering!\");\n } else if (userEmail === \"\") {\n window.alert(\"Please enter your email before registering!\");\n } else if (userPassword === \"\") {\n window.alert(\"Please enter your password before registering!\");\n }\n // it is required the user enters a password greater than 6 characters\n else if (userPassword.length < 6) {\n window.alert(\"Password must be greater than 6 characters to register!\");\n } else {\n // register the user then redirect them to the main page.\n auth\n .createUserWithEmailAndPassword(userEmail, userPassword)\n .then((userResult) => {\n return userResult.user.updateProfile({ displayName: userName });\n })\n .catch((error) => {\n window.alert(\"Error registering! Please try again!\");\n });\n }\n}", "ensureSignupNotification() {\n if (!this.state.isLoginPath && !this.signupNotificationSent) {\n this.props.notificationCenter.pushNotification({\n type: 'info',\n duration: 10000,\n heading: 'About that email field',\n message: (\n <>\n <p>\n This is merely a demo, so don't worry about entering your{' '}\n <b>email</b>.\n </p>\n <p>\n - it is only used as a login credential (no account confirmation\n email will be sent, etc.).\n </p>\n </>\n ),\n });\n\n this.signupNotificationSent = true;\n }\n }", "function notify() {\n\tif (httpRequest.readyState == 4 && httpRequest.status == 200) { // value 'status' equal 200 means request successfully.\n\t\tvar username = document.getElementById(\"username\");\n\t\tvar result = document.getElementById(\"result\");\n\t\tconsole.log(\"responseText=\" + httpRequest.responseText);\n\t\tif (httpRequest.responseText == \"true\") {\n\t\t\tresult.innerHTML = \"*Username is exist! Please enter another username.\";\n\t\t} else {\n\t\t\tif (username.value != \"\") {\n\t\t\t\tresult.innerHTML = \"Account \" + username.value + \" created successfully!\";\t\n\t\t\t}\n\t\t}\n\t}\n}", "function validateEmail() {\n\tvar emailInput = document.getElementById(\"userEmail\");\n var errorMsg = document.getElementById(\"errorMsg\");\n var emailCheck = /^[_\\w\\-]+(\\.[_\\w\\-]+)*@[\\w\\-]+(\\.[\\w\\-]+)*(\\.[\\D]{2,6})$/;\n \n try {\n\n\tif (emailCheck.test(emailInput.value) === false) {\n\t throw \"Please provide a valid email address\";\n }\n\n // convert email address to lowercase\n\temailInput.value = emailInput.value.toLowerCase();\n\t // copy valid email value to profile object\n\tuserInfo.email = emailInput.value;\n\t//set emailValid to true\t\n\temailValid = true;\n\t//remove input styling\n\temailInput.style.background = \"\";\n }\n catch(msg) {\n\t\t// display error message\n\t\terrorMsg.innerHTML = msg;\n\t\terrorMsg.style.display = \"block\";\n\t\t// change input style\n\t\temailInput.style.background = \"rgb(255,233,233)\";\n\t\temailValid = false; //set emailValid to false\n\t\tdelete userInfo['email']; //delete email from userInfo object\n }\n}", "function signup() {\n var username = document.getElementById('username-field').value;\n var password = document.getElementById('pwd-field').value;\n\n\n if (username === null || username.length < 1)\n displayErrorWithText(\"Please enter a valid username\");\n else if (password.length < 6)\n displayErrorWithText('Password must be atleast 6 characters long');\n else if (!password.match(\"[A-Z]\")) displayErrorWithText('Password must contain one capital letter');\n else if (!password.match(\"[^A-z0-9]\"))\n displayErrorWithText('Password must contain one non-alphanumeric character');\n else {\n var errorNotif = document.getElementById('error-notif');\n errorNotif.style.top = -10 + 'px';\n }\n}", "function checkFormSubmit() {\n var errCode = getURLVar(\"error\");\n if (errCode !== false) {\n if (errCode == \"0\") {\n $('#errorMSG').css(\"color\", \"green\");\n $('#errorMSG').html('Success! Thanks for contacting us.');\n } else if (errCode == \"1\") {\n $('#errorMSG').css(\"color\", \"red\");\n $('#errorMSG').html('Please complete all fields.');\n } else if (errCode == \"2\") {\n $('#errorMSG').css(\"color\", \"red\");\n $('#errorMSG').html('Please enter a valid email address.');\n }\n }\n }", "function sendUser(email, password) {\n // Get current Firebase user\n firebase.auth().onAuthStateChanged(function(user) {\n if (user) {\n // User is signed in.\n let credential = firebase.auth.EmailAuthProvider.credential(\n user.email,\n password\n );\n\n // Prompt the user to re-provide their sign-in credentials\n user.reauthenticateWithCredential(credential).then(function() {\n // User re-authenticated.\n if(email !== false){\n user.updateEmail(email).then(function() {\n // Update successful.\n console.log(\"Email Update successful\")\n }).catch(function(error) {\n // An error happened.\n let errorCode = error.code;\n let errorMessage = error.message;\n\n // Consoling error messages\n console.log(errorCode);\n console.log(errorMessage);\n });\n }\n\n if(password !== false){\n user.updatePassword(password).then(function() {\n // Update successful.\n console.log(\"Password Update successful\")\n }).catch(function(error) {\n // An error happened.\n let errorCode = error.code;\n let errorMessage = error.message;\n\n // Consoling error messages\n console.log(errorCode);\n console.log(errorMessage);\n });\n }\n }).catch(function(error) {\n // An error happened.\n let errorCode = error.code;\n let errorMessage = error.message;\n\n // Consoling error messages\n console.log(errorCode);\n console.log(errorMessage);\n });\n\n\n // show alert\n document.querySelector('.successful-register').style.display = 'block';\n\n } else {\n // No user is signed in.\n }\n });\n}", "function loginMessage (req, res, next) {\n let status = req.registeredUser.admin ? 'admin' : req.registeredUser.company.host ? 'staff' : 'user'\n req.resJson.message = `account token with ${status} privilege is supplied for 24 hours`\n return next()\n}", "function confirmCreateAccount() {\n // TODO directives should specify private (invite-only) vs internal (request) vs public (allow) accounts\n return form.ask({\n label: \"We don't recognize that address. Do you want to create a new account? [Y/n] \"\n , type: 'text' // TODO boolean with default Y or N\n }).then(function (result) {\n if (!result.input) {\n result.input = 'Y';\n }\n\n // TODO needs backup address if email is on same domain as login\n result.input = result.input.toLowerCase();\n\n if ('y' !== result.input) {\n return getCurrentUserEmail();\n }\n\n if (!sameProvider) {\n return { node: email, type: 'email' };\n }\n\n return form.ask({\n label: \"What's your recovery email (or cloud mail) address? \", type: 'email'\n }).then(function (recoveryResult) {\n return {\n node: email\n , type: 'name'\n , recovery: recoveryResult.result || recoveryResult.input\n };\n });\n });\n }", "function validateUserRegistrationForm() {\n\tconsole.log(`# validating recipient registration...`);\n}", "function checkUsername(req,res,next){\n var uname=req.body.uname;\n var checkusernameemail=userModule.findOne({username:uname});\n checkusernameemail.exec((err,data)=>{\n if (err) throw err;\n if(data){\n return res.render('signup', { title: 'Password Management System', msg:'UserName Already Exit !'}); \n }\n next(); \n });\n\n }", "function checkUsername(req,res,next){\n var uname=req.body.uname;\n var checkusernameemail=userModule.findOne({username:uname});\n checkusernameemail.exec((err,data)=>{\n if (err) throw err;\n if(data){\n return res.render('signup', { title: 'Password Management System', msg:'UserName Already Exit !'}); \n }\n next(); \n });\n\n }", "wrong(messageId) {\n if (!user.user) {\n return\n }\n return wrongMessage({\n variables: {\n userId: user.user.id,\n messageId,\n dummy: getDummy(),\n }\n })\n }", "function emailSend(){\n var email = document.getElementById('email_submission');\n var name = document.getElementById('name_submission');\n var message = document.getElementById('message_submission');\n var successOrNot = document.getElementById('success_email');\n\n if (!email.value || !name.value || !message.value){\n /* This will print an error because there is nothing in those fields */\n successOrNot.innerHTML = \"You didn't fill everything out!\";\n } else {\n successOrNot.innerHTML = \"Success! Email sent!\";\n }\n\n}", "function signupFailed(err) {\n vm.error = err.data;\n vm.messages.error = vm.error.message;\n // enable signup\n vm.enabled = true;\n }", "confirmSubmission(){\n var userCheck = false //boolean for checking if the username is good to submit\n var emailCheck = false //boolean for checking if the email is good to submit\n var passCheck = false //boolean for checking if the password is good to submit\n\n //if the username field is blank, display an error\n var currentText = \"\";\n if(this.state.username === \"\" || this.state.usernameError === true){\n if(this.state.username === \"\"){\n currentText += \"No username entered. \";\n }\n else{\n currentText += \"Problem found with username. \";\n }\n this.setState({\n usernameError: true\n });\n }\n //otherwise, the username is declared as being ok to submit\n else{\n userCheck = true\n this.setState({\n usernameError: false\n });\n }\n //if the email field is blank, display an error\n if(this.state.email=== \"\" || this.state.emailError === true){\n currentText += \"No email address entered. \";\n this.setState({\n emailError: true\n });\n }\n //otherwise, the email is declared as being ok to submit\n else{\n emailCheck = true\n this.setState({\n emailError: false\n });\n }\n //if there are any errors relating to the password, display an alert\n if((this.state.passwordError === true && this.state.confrimPasswordError === true) || ((this.state.password===\"\" && this.state.confirmPassword === \"\"))){\n if(this.state.password === \"\" && this.state.confirmPassword === \"\"){\n currentText += \"No password entered. \";\n }\n else{\n currentText += \"Password error found. \";\n }\n this.setState({\n passwordError: true,\n confrimPasswordError: true\n });\n }\n //otherwise, the password is declared as being ok to submit\n else{\n passCheck = true\n this.setState({\n passwordError: false,\n confrimPasswordError: false\n });\n }\n\n //if the username, password, and email are ok submit, call the send request function to contact the server\n if(userCheck && emailCheck && passCheck){\n this.sendRequest();\n }\n else{\n this.setState({\n displayAlert: true,\n alertText: currentText\n })\n }\n }", "function isUsernameTaken(){\n return new Promise(function(resolve, reject){\n mysql.pool.getConnection(function(err, connection){\n if(err){return reject(err)};\n \n connection.query({\n sql: 'SELECT username FROM deepmes_auth_login WHERE username=?',\n values: [fields.username]\n }, function(err, results){\n if(err){return reject(err)};\n \n if(typeof results[0] !== 'undefined' && results[0] !== null && results.length > 0){\n let usernameTaken = 'Username is already taken.';\n reject(usernameTaken);\n } else {\n resolve();\n }\n\n });\n\n connection.release();\n\n });\n });\n }", "function generateError(user) {\n $('.form-control')[0].value = ''\n $('.failed-request')[0].innerHTML = user.name + ' is not a valid user'\n $('.failed-request').fadeIn(200);\n $('.failed-request').fadeToggle(4000);\n }", "function sendResponseEmail (recipientEmail, errorObj, dataFileName, submissionTime, formUrl) {\n Logger.log('Function sendResponseEmail has been reached.');\n var successSubject = 'Authorized Vaccination Scheduler Form - Successful Submission';\n var failSubject = 'Authorized Vaccination Scheduler Form - Submission Error';\n var dupeSubject = 'Authorized Vaccination Scheduler Form - Duplicate Request Received';\n var subject = '';\n var message = '';\n \n //if submission was for an individual user account...\n if (!bulk) {\n Logger.log('Not bulk.');\n //...and submission was not a duplicate, then compose success email\n if (!isIndivDupe) { \n subject = successSubject;\n var userInfo = 'User Name: ' + userFirst + ' ' + userLast + '<br>User Email: ' + userEmail + '<br>User Organization: ' + userOrg;\n message = \"Your submission on \" + submissionTime + \" to the \" + '<a href=\\\"' + formUrl + '\">Authorized Schedulers New User Signup</a>' + \" form was successful!<br><br>The following information has been received:<br><br>\" + userInfo + \"<br><br>Please note: It may take up to 24 hours for users to receive their account log-in credentials. Credentials will be sent directly to the email address(es) you provided. Please do not resubmit this form.<br><br>If after 24 hours user(s) have not received the account credentials, first, users should check their spam folders. If nothing is there, please reply and let us know the accounts that are missing.<br><br>-Vaccine Command Center Equity Team<br>\"; \n \n //...and submission was a duplicate, then compose duplicate email \n } else {\n Logger.log('Is dupe');\n subject = dupeSubject;\n message = \"An account has already been requested for the email address \" + userEmail + \". The original request was made by \" + origRespFirst + \" \" + origRespLast + \" on \" + origTime + \" with the following information:<br><br>\"\n + \"User Name: \" + origUserFirst + \" \" + origUserLast + \"<br>User Email: \" + origUserEmail + \"<br>User Organization: \" + origUserOrg + \"<br><br>\"\n + \"Please note: It may take up to 24 hours for users to receive their account log-in credentials. Credentials will be sent directly to the email address provided. Please do not resubmit this form.<br><br>If after 24 hours user(s) have not received the account credentials, first, users should check their spam folders. If nothing is there, please reply and let us know the accounts that are missing.<br><br>-Vaccine Command Center Equity Team<br>\";\n Logger.log('Message: ' + message);\n } \n \n //if submission was a bulk upload...\n } else if (bulk) {\n \n //...and submission was valid, then compose success email\n if (isValid) {\n subject = successSubject;\n message = \"Your submission of \" + dataFileName + \" on \" + submissionTime + \" to the \" + '<a href=\\\"' + formUrl + '\">Authorized Schedulers New User Signup</a>' + \" form was successful!<br><br>Please note: It may take up to 24 hours for users to receive their account log-in credentials. Credentials will be sent directly to the email address(es) you provided. Please do not resubmit this form.<br><br>If after 24 hours user(s) have not received the account credentials, first, users should check their spam folders. If nothing is there, please reply and let us know the accounts that are missing.<br><br>-Vaccine Command Center Equity Team<br>\";\n \n //...and submission was invalid, then compose fail email \n } else {\n \n subject = failSubject;\n \n // combine failStrings into one message\n var errorString = '';\n Object.values(errorObj).forEach(validObj => {\n if (!validObj.valid) {\n errorString += validObj.failString;\n }\n });\n \n //set the message\n message = \"Your submission of \" + dataFileName + \" on \" + submissionTime + \" to the Authorized Schedulers New User Signup form failed for the following reasons:<br>\" + errorString + \"<br>Please resubmit with corrections at \" + formUrl + \", thank you!<br><br>-Vaccine Command Center Equity Team<br>\"; \n } //close invalid \n \n } //close bulk\n \n //set the components of the email\n var emailTemplate = {\n to: recipientEmail,\n subject: subject,\n htmlBody: message,\n name: 'NYC Vaccine Command Center Equity Team',\n replyTo: '[email protected]'\n }\n \n //send the email\n MailApp.sendEmail(emailTemplate);\n return message; \n }", "function deny (){\n mess = \"User Name taken. Incorrect Password for \";\n userVal = userName;\n console.log('UN taken/Incorrect Password for: ' + userName);\n return userVal;\n}", "username (value) {\n // min length 1\n if (!value || value.length < 1) {\n return 'You must provide a username.';\n }\n // max length 40\n else if (value.length > 40) {\n return 'Username can only be 40 characters long.';\n }\n return null;\n }", "isValidSubmission() {\n let firstName = this.state.form[\"first_name\"];\n let lastName = this.state.form[\"last_name\"];\n let email = this.state.form[\"email\"];\n let password = this.state.form[\"password\"];\n let confirmPassword = this.state.form[\"confirm_password\"];\n\n let unsuccessfulLoginAttemptMsg = \"\";\n\n if (firstName.length < 2) {\n unsuccessfulLoginAttemptMsg = \"First Name cannot be less than 2 letters\";\n } else if (lastName.length < 2) {\n unsuccessfulLoginAttemptMsg = \"Last Name cannot be less than 2 letters\";\n } else if (!validateEmail(email)) {\n unsuccessfulLoginAttemptMsg = \"Invalid Email\";\n } else if (password !== confirmPassword) {\n unsuccessfulLoginAttemptMsg = \"Passwords do not Match\";\n } else if (!this.state.termsAgreed) {\n unsuccessfulLoginAttemptMsg = \"Please accept the Terms & Agreements\";\n }\n\n if (unsuccessfulLoginAttemptMsg !== \"\") {\n this.setState({\n unsuccessfulLoginAttemptMsg: unsuccessfulLoginAttemptMsg,\n })\n return false;\n }\n \n\n return true;\n }", "function checkUsername() {\n if (!that.username) {\n var api = new HueApi(that.ip_address);\n api.createUser(that.ip_address, null, null, function(err, user) {\n \n // try and help explain this particular error\n if (err && err.message == \"link button not pressed\")\n throw \"Please press the link button on your Philips Hue bridge, then start the HomeBridge server within 30 seconds.\";\n \n if (err) throw err;\n \n throw \"Created a new username \" + JSON.stringify(user) + \" for your Philips Hue. Please add it to your config.json then start the HomeBridge server again: \";\n });\n }\n else {\n getLights();\n }\n }", "function onCheckUsernameResponse(response, request)\n{\n let username = $$(\"input[name='username']\");\n if (request.lastUsername !== username.value)\n {\n return;\n }\n\n // Username hasn't changed\n if (response.value == \"1\")\n {\n // It's available!\n username.style.backgroundColor = \"rgb(63, 100, 69)\";\n username.title = \"Username available\";\n }\n else\n {\n // It exists!\n username.style.backgroundColor = \"rgb(100, 66, 69)\";\n username.title = \"Username already exists\";\n }\n}", "function checkUsername() {\n var pattern = /^[a-zA-Z]*$/;\n var username = $modalUsername.val();\n if (pattern.test(username) && username !== '') {\n $usernameError.hide();\n $modalUsername.css(\"border-bottom\",\"2px solid #34F458\");\n } else {\n $usernameError.html(\"Should only contain letters\");\n $usernameError.show();\n $modalUsername.css(\"border-bottom\",\"2px solid #F90A0A\");\n usernameError = true;\n }\n }", "function logForm()\n{\n if(userEmail1.value == \"\"){\n userEmail1.style.borderColor = \"#dddddd\";\n userEmail1.focus();\n emailError.innerHTML = \"please enter your email\";\n return false;\n }\n\n if(userPass.value == \"\"){\n userPass.style.borderColor = \"#dddddd\";\n userPass.focus();\n userPassErr.innerHTML = \"please enter your password\";\n return false;\n }\n \n}", "static async signup() {\n let email = rl.questionEMail(chalk.bold(\"Email: \"));\n let password = rl.questionNewPassword(chalk.bold('Password: '), {\n mask: '', \n min: 6,\n confirmMessage: \"Enter the same password again: \",\n unmatchMessage: \"Passwords did not match. Try again. To re-enter the first password, input only Enter.\",\n limitMessage: \"Password must be at least 6 characters. Please try again.\"\n });\n let errorCode;\n let errorMessage;\n spinner = ora(\"Signing up...\").start();\n await firebase.auth().createUserWithEmailAndPassword(email, password).catch((error) => {\n errorCode = error.code;\n errorMessage = error.message;\n }).then(async () => {\n let checkUser = firebase.auth().currentUser;\n if(checkUser){\n let name = checkUser.email.substring(0, checkUser.email.indexOf(\"@\"));\n let newUser = await UserService.createUser(checkUser.uid, name, checkUser.email);\n spinner.succeed(chalk.green(\"New user created: \", newUser.name));\n }\n else {\n spinner.fail(chalk.red(\"Failed to create user...\"));\n if(errorCode == 'auth/email-already-in-use')\n console.log(chalk.red(\"Email in use\"));\n else \n console.log(chalk.red(errorMessage));\n }\n });\n }", "function validateUsername(user) {\n userEntered = user.value;\n globaluser = userEntered;\n // The username must be at least 6 characters long\n if (userEntered.length < 6) {\n document.getElementById(\"usernameGroup\").classList.remove(\"has-success\");\n document.getElementById(\"usernameGroup\").classList.add(\"has-error\");\n document.getElementById(\"usernameError\").innerHTML=\"Username must contain at least 6 letters..\";\n document.getElementById(\"usernameError\").classList.remove(\"hidden-message\");\n document.getElementById(\"usernameError\").classList.add(\"shown-message\");\n boolu = false;\n }\n // Username must NOT contain any spaces\n else if (!(/^\\S{3,}$/.test(userEntered))) {\n document.getElementById(\"usernameGroup\").classList.remove(\"has-success\");\n document.getElementById(\"usernameGroup\").classList.add(\"has-error\");\n document.getElementById(\"usernameError\").innerHTML=\"Username must not contain spaces.\";\n document.getElementById(\"usernameError\").classList.remove(\"hidden-message\");\n document.getElementById(\"usernameError\").classList.add(\"shown-message\");\n boolu = false;\n }\n else {\n // green\n document.getElementById(\"usernameGroup\").classList.remove(\"has-error\");\n document.getElementById(\"usernameGroup\").classList.add(\"has-success\");\n boolu = true;\n }\n}", "createAccount () {\n // Getting our email and password values\n var email = this.refs.email.value;\n var password = this.refs.password.value;\n var confirmPassword = this.refs.confirmPassword.value;\n \n // Checking if the client has put the same password in both\n // input fields which were asking for the password\n if (password === confirmPassword) {\n // Checking if the client has met the minimum character\n // length for a password\n if (password.length >= 6) {\n firebase.auth().createUserWithEmailAndPassword(email, password).catch(function(error) {\n // Handle Errors here.\n var errorCode = error.code;\n var errorMessage = error.message;\n console.log(errorCode, errorMessage);\n });\n console.log('Account registered!');\n } else {\n alert('Passwords must be at least 6 characters long!')\n }\n } else {\n alert('Your passwords do not match!')\n }\n }", "function validateEmail(req, res, next) {\n knex('users').where('email', req.body.email).first().then(email => {\n //if email exists already, exits with 400 and a message\n if (email) {\n res.set('Content-Type', 'text/plain');\n res.status(400).send('Email already exists');\n return;\n }\n req.email = email;\n next();\n });\n }", "handleSubmit(e) {\n e.preventDefault();\n\n\n let email = e.target.children[0].children[1].value;\n console.log(this.props);\n //we add validation on the front end so that user has to enter in the required field before clicking submit\n //TODO\n if (!email) {\n alert(\"Please enter in the required field!\");\n } else {\n return _resetPasswordEmail(email).then(res => {\n console.log(\"message sent from server if success2: \", res);\n //TODO\n //prompt users to check their email\n this.props.openModal();\n document.getElementById('email').value=\"\";\n });\n }\n }", "function submitForm(e) {\n const userDate = username.value.trim();\n const mailData = mail.value.trim();\n const passData = pass.value.trim();\n\n if (userDate === \"\") {\n inputChecker(username, \"enter you user name\", 1500);\n }\n if (mailData === \"\") {\n inputChecker(mail, \"enter you mail address\", 1500);\n }\n if (passData === \"\") {\n inputChecker(pass, \"enter you passeord\", 1500);\n }\n}", "function postSave(err) {\n if (err) {\n return response.send({\n success: true,\n msg: \"There was a problem validating your account.\"\n });\n }\n\n // Send confirmation text message\n var message = 'You did it! Login was successful :)';\n user.sendMessage(message, function(err) {\n if (err) {\n return response.send({\n success: true,\n msg: \"You are logged in, but we could not send you a text message. Our bad.\"\n });\n }\n // show success page\n response.send({\n success: true,\n msg: message\n });\n });\n }", "checkEmail(req, res, next){\n\n if (req.body.email){\n\n db.query(queries.selectUserWithEmail, [req.body.email], (err, results, fields) => {\n\n if (err) throw err;\n \n if (results.length == 0){\n next();\n } else {\n res.status(400).send(\"Email already exists.\");\n }\n });\n } else {\n \n res.status(400).send(\"Email field is empty.\");\n }\n \n }", "function checkforblank(){\n \n var errormessage = \"\";\n\n if(document.getElementById(\"txtname\").value == \"\")\n {\n \n errormessage += \"Enter your full Name \\n\";\n \n }\n\n if(document.getElementById(\"txtuname\").value == \"\")\n {\n \n errormessage += \"Enter your UserName \\n\";\n }\n\n if(document.getElementById(\"txtemail1\").value == \"\")\n {\n errormessage += \"Please Enter your Email \\n\";\n }\n \n if(document.getElementById(\"password1\").value == \"\")\n {\n errormessage += \"Please Enter a Suitable Password \\n\";\n }\n\n if(document.getElementById(\"txtno\").value == \"\")\n {\n errormessage += \"Please Enter a Phone Number with 10 Digits \\n\";\n }\n \n if(document.getElementById(\"txtaddress\").value == \"\")\n {\n errormessage += \"Please Enter an Address for us to Deliver \\n\";\n }\n\n if(errormessage != \"\")\n {\n alert(errormessage);\n return false;\n }\n\n }", "function validateEmail() {\n var pattern = /^([a-zA-Z])+([0-9a-zA-Z_\\.\\-])+\\@+(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,5}$)$/;\n var user_email = document.getElementById(\"user_email\");\n\n if (user_email.value === \"\") {\n document.getElementById(\"alert_email\").innerHTML =\n \"this field cannot be empty\";\n\n return false;\n } else if (!user_email.value.match(pattern)) {\n document.getElementById(\"alert_email\").innerHTML =\n \"please enter valid email address\";\n\n return false;\n }\n document.getElementById(\"alert_email\").innerHTML = \"\";\n return true;\n}", "function thanked(err, reply) {\n if (err !== undefined) {\n console.log(err.message);\n } else {\n console.log('Follower thanked sucessfully!');\n }\n}", "usernameAfterDelay() {\n if (this.username.value.length < 3) {\n this.showValidationError(this.username, \"Username must be 3 characters long\")\n }\n\n // We use Axios to send asynch checks if the username has been taken already\n // The server will process this request and will send a response with either true or false\n if (!this.username.errors) {\n axios.post(\"/doesUsernameExists\", {_csrf: this._csrf, username: this.username.value}).then((response) => {\n if (response.data) {\n this.showValidationError(this.username, \"Username Already Taken\")\n this.username.isUnique = false\n } else {\n this.username.isUnique = true\n }\n }).catch(() => {\n // Technical difficulty\n console.log(\"Please try again later\")\n })\n }\n\n }", "function usernameBad(button, usernameField){\n window.alert(\"Username already in use\")\n button.disabled = true;\n}", "function displayPossError () {\n const emailRegex = /^\\w+@\\w+\\.[A-Za-z]{3}$/;\n $(\".tooltip\").hide();\n\n // Error if no text is entere\n if ($(\"#mail\").val() === \"\") {\n $(\".tooltip\").eq(0).show();\n }\n\n // Error if text is not a valid email\n else if (emailRegex.test($(\"#mail\").val()) === false) {\n $(\".tooltip\").eq(1).show();\n }\n}", "async resendSignUp() {\n const { username } = this.state\n await Auth.resendSignUp(username)\n .then(() => console.log('Confirmation code resent successfully'))\n .catch(err => {\n if (!err.message) {\n console.log('Error requesting new confirmation code: ', err)\n Alert.alert('Error requesting new confirmation code: ', err)\n } else {\n console.log('Error requesting new confirmation code: ', err.message)\n Alert.alert('Error requesting new confirmation code: ', err.message)\n }\n })\n }", "function validateUserInfo() {\n if (userEmail.value === lsEmail && userPass.value === lsPass) {\n alert(\"You're logged in!\");\n } else {\n alert(\n \"Sorry, either your email or password is incorrect. Please try again!\"\n );\n }\n}" ]
[ "0.64434016", "0.6386315", "0.6381213", "0.632322", "0.6307758", "0.6225147", "0.6188439", "0.61776865", "0.6166889", "0.6166889", "0.6166889", "0.6166889", "0.61600834", "0.61356026", "0.6121422", "0.6086535", "0.6084098", "0.6079379", "0.606915", "0.6032477", "0.6031461", "0.6020295", "0.5993969", "0.5989006", "0.5957223", "0.5956211", "0.59500885", "0.59465075", "0.594475", "0.594475", "0.5944503", "0.5910473", "0.5900607", "0.58995223", "0.58960766", "0.58921343", "0.5886085", "0.58733267", "0.58539915", "0.5851948", "0.58470696", "0.58433026", "0.583613", "0.5834572", "0.58318096", "0.58295727", "0.58119273", "0.58040714", "0.5801504", "0.58009297", "0.579871", "0.5796545", "0.57955736", "0.5791853", "0.5789744", "0.57824373", "0.57783085", "0.57770574", "0.57752824", "0.5774818", "0.5771695", "0.5770275", "0.5759555", "0.57586074", "0.57538664", "0.5743993", "0.57419795", "0.57273465", "0.5722244", "0.57210106", "0.57210106", "0.5720833", "0.5720001", "0.57163525", "0.571289", "0.57063437", "0.57040375", "0.5700361", "0.5696827", "0.569492", "0.5687524", "0.5685635", "0.5677189", "0.56759197", "0.5675723", "0.56739193", "0.5667328", "0.5667088", "0.56662554", "0.56518334", "0.5650149", "0.5648553", "0.5648546", "0.56479025", "0.5640665", "0.56367457", "0.56349725", "0.5626946", "0.5626779", "0.5626189", "0.56260186" ]
0.0
-1
This command remove 1 or more Tasks
function action(args, env) { // Prompt for tasks if ( args.length === 0 ) { prompt('Task:', _promptFinished); } // Process Tasks else { for ( let i = 0; i < args[0].length; i++ ) { _process(args[0][i], i+1, args[0].length); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteTask(tasks, uuid)\n {\n var i = 0;\n console.error('tasks', tasks);\n\n for (; i < tasks.length; i++)\n {\n if (uuid == tasks[i].uuid)\n {\n tasks.splice(i, 1);\n i--;\n }\n }\n return tasks;\n }", "removeTask () {\n\t\tthis.deleter.addEventListener('click', (e) => {\n\t\t\tfetch('/items/'+e.target.parentNode.parentNode.parentNode.childNodes[0].getAttribute('data-task'), {\n\t\t\t\tmethod: 'DELETE',\n\t\t\t\theaders: {\n\t\t\t\t'Accept': 'application/json',\n\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t},\n\t\t\t\t\n\t\t\t})\n\t\t\t.then(res => res.text()) \n\t\t\t.then(res => console.log(res))\n\t\t\t.catch(error => console.error(error));\n\t\t\te.target.parentNode.parentNode.parentNode.remove();\n\t\t\tupdateProgess(numberOfCompletedTasks());\n\t\t});\n\n\t\t// We need to also remove tasks from the backend\n\t}", "deleteTask(taskId) {\n let newTasks = [];\n this.tasks.forEach(task => {\n if (task.id !== taskId) {\n newTasks.push(task);\n }\n });\n this.tasks = newTasks;\n }", "deleteAllTasks () {\r\n this.eliminatedTask.splice(0, this.eliminatedTask.length);\r\n }", "deleteTask(taskId) {\n // Create an empty array and store it in a new variable, newTasks\n const newTasks = [];\n\n // Loop over the tasks\n for (let i = 0; i < this.tasks.length; i++) {\n // Get the current task in the loop\n const task = this.tasks[i];\n\n // Check if the task id is not the task id passed in as a parameter\n if (task.id !== taskId) {\n // Push the task to the newTasks array\n newTasks.push(task);\n }\n }\n\n // Set this.tasks to newTasks\n this.tasks = newTasks;\n }", "function deleteAllTasks() {\n todoDb.remove({}, { multi: true }, function (error, todo) {\n clearDatabase();\n getTodos();\n });\n}", "static clearDone () {\n withTasks(tasks, (task) => {\n if (task.isPreloaded && task.pDone > task.pTotal - 3) {\n this.remove(task.$id)\n }\n })\n }", "deleteTask(taskId) {\n const newTasks = [];\n this.tasks.forEach((item) => {\n if (item.Id !== taskId) {\n newTasks.push(item);\n }\n });\n this.tasks = newTasks;\n }", "function removeTask(){\n\t\t$(\".remove\").unbind(\"click\").click(function(){\n\t\t\tvar single = $(this).closest(\"li\");\n\t\t\t\n\t\t\ttoDoList.splice(single.index(), 1);\n\t\t\tsingle.remove();\n\t\t\ttoDoCount();\n\t\t\tnotToDoCount();\n\t\t\taddClear();\n\t\t});\n\t}", "function clearTasks(){\n item.parentNode.removeChild(item);\n }", "function deleteTasks(){\n\n //loop through task array to remove finished arrays\n for(let i = 0; i < taskArr.length; i++)\n {\n //checks if task is finished\n let isFinished = taskArr[i].finished;\n\n //removes task from task array\n if(isFinished === 1)\n {\n taskArr.splice(i, 1);\n i--;\n };\n \n };\n\n //loop through task array to adjust position\n for(let i = 0; i < taskArr.length; i++)\n {\n taskArr[i].position = i + 1;\n };\n\n //rewrites list with new positions and only unfinished tasks\n rewritesList();\n}", "cancelTask(i){\n \n this.$delete(this.taskList, i);\n for (let i = 0; i < this.taskList.length; i++) {\n const element = this.taskList[i];\n this.done.unshift(element);\n }\n console.log(this.done);\n console.log(this.taskList);\n }", "function deleteTasks() {\n const mutateCursor = getCursorToMutate();\n if (mutateCursor) {\n clickTaskMenu(mutateCursor, 'task-overflow-menu-delete', false);\n } else {\n withUnique(\n openMoreMenu(),\n 'li[data-action-hint=\"multi-select-toolbar-overflow-menu-delete\"]',\n click,\n );\n }\n }", "function deleteAllTasksFromDatabase () {\n firebase.database().ref('tasks').remove()\n updateCount()\n}", "function resetTasks() {\n\t\t\tfor (var i = 0; i < vm.tasks.length; i++) {\n\t\t\t\ttasks.removeTask(vm.tasks[i]);\t\n\t\t\t}\n\t\t}", "function deleteTask (e){\n for (var i = 0 ; i< loginUser.tasks.length; i ++){\n if(parseInt(loginUser.tasks[i].id) === parseInt(e.target.getAttribute('data-id'))){\n if(loginUser.tasks[i].status === false){\n taskToDo--;\n $('#countOfTask').text('').text('Task to do: '+ taskToDo);\n }\n loginUser.tasks.splice(i, 1);\n $('#task' + e.target.getAttribute('data-id')).remove();\n collectionOfUser.update(\n {\n id : loginUser.id,\n tasks : loginUser.tasks\n },\n function(user){\n loginUser = user;\n },\n error \n );\n }\n }\n }", "function removeTask(e) {\n\n const elementValue = e.target.parentNode.getElementsByTagName(\"p\")[0].innerHTML;\n \n const tasksArray = Array.from(getLocalStorageTasks());\n\n tasksArray.forEach(task => {\n if (task == elementValue) {\n const filteredArray = tasksArray.filter(item => item != elementValue);\n \n setLocalStorage(filteredArray);\n\n // we need to fetch done tasks from local storage\n // then copy the elements + add the completed one\n // set new array to localStorage complete tasks\n //setCompleteTasksLocalStorage()\n refreshTasks();\n }\n })\n}", "removeTask(e) {\n const index = e.target.parentNode.dataset.key;\n this.tasks.removeTask(index);\n this.renderTaskList(this.tasks.tasks);\n this.clearInputs();\n }", "delete_all() {\n Meteor.call('tasks.removeAll');\n }", "deleteTask(taskId) {\n // Create an empty array and store it in a new variable, newTasks\n const newTasks = [];\n console.log( `taskId: ${taskId}` );\n\n // Loop over the tasks\n for (let i = 0; i < this.tasks.length; i++) {\n // Get the current task in the loop\n const task = this.tasks[i];\n\n // Check if the task id is not the task id passed in as a parameter\n if (task.id !== taskId) {\n // Push the task to the newTasks array\n newTasks.push(task);\n }\n }\n\n // Set this.tasks to newTasks\n this.tasks = newTasks;\n console.log(this.tasks);\n }", "doTaskUndone(target) {\n let index = [...target.parentElement.children].indexOf(target);\n this.doneTaskArr.splice(index - 1, 1);\n this.undoneTaskArr.push(target.children[0].value);\n this.taskToLocal(\"undoneTask\", this.undoneTaskArr);\n this.taskToLocal(\"doneTask\", this.doneTaskArr);\n const task = new Task(target.children[0].value);\n this.taskListUnDone.appendChild(task.createUndoneTask());\n target.remove();\n }", "function deleteTask(taskListIndex) {\n\n taskList.splice(taskListIndex, 1);\n\n\n listTasks()\n}", "function deleteTask(a,b) {\r\n taskList.splice(a,3)\r\n return taskList;\r\n\r\n }", "static async removeTask(id) {\n let result = await Task.findOneAndDelete({id}).exec()\n return result\n }", "function removeTasks() {\n let child = lists.lastElementChild;\n let childs = listOfChecked.lastElementChild;\n while (child) {\n lists.removeChild(child);\n child = lists.lastElementChild;\n }\n while (childs) {\n listOfChecked.removeChild(childs);\n childs = listOfChecked.lastElementChild;\n }\n}", "removeTask(taskId) {\n const dbRef = firebase.database().ref();\n dbRef.child(taskId).remove();\n }", "'tasks.remove'(taskId) {\n check(taskId, String);\n\n const task = Tasks.findOne(taskId);\n if (task.private && task.owner !== this.userId) {\n // If the task is private, make sure only the owner can delete it\n throw new Meteor.Error('not-authorized');\n }\n\n Tasks.remove(taskId);\n }", "function removeTask(elem) {\n elem.parentNode.parentNode.removeChild(elem.parentNode);\n LIST[elem.id].trash = true;\n}", "deleteTask(id) {\n var index = this.list.map(i => i.id).indexOf(id);\n this.list.splice(index, 1);\n ls.deleteItem(id);\n }", "function taskDeletor(idel) {\n\t\tconst currentTask = tasks.find( el => el.id == idel);\n\t\tlet taskIndex = tasks.indexOf(currentTask);\n\t\ttasks.splice(taskIndex, 1);;\n\t}", "function clearTasks(e) {\n //taskList.innerHTML = ''\n while (taskList.firstChild) {\n taskList.removeChild(taskList.firstChild)\n }\n //clear all tasks from local storage\n clearAllTasksFromLS()\n}", "function removeTask(e) {\n\te.target.parentElement.parentNode.removeChild(e.target.parentElement);\n}", "function deleteTask() {\n this.parentNode.parentNode.removeChild(this.parentNode);\n }", "function deleteTask()\n {\n var child = this.parentNode.parentNode;\n var parent = child.parentNode;\n parent.removeChild(child);\n var id= parent.id;\n var value = child.innerText;\n if (id == \"taskList\")\n {\n obj.taskListArr.splice(obj.taskListArr.indexOf(value), 1);\n }\n else \n {\n obj.taskCompletedArr.splice(obj.taskCompletedArr.indexOf(value), 1);\n } \n dataStorageUpdt();\n }", "function removeTask(object) {\n var task_index = Number(object.getAttribute('task_index'));\n let id = Math.abs((tasksList.length - 1) - task_index);\n tasksList = tasksList.filter((val, index) => index != id);\n const finalData = generateTasksList();\n document.getElementById(\"divTasksList\").innerHTML = finalData;\n console.log(tasksList);\n}", "deleteTask(taskId) {\n\t\tconst todos = this.getAndParse('tasks');\n\t\tconst filteredTodos = todos.filter(task => task.id !== taskId);\n\t\tthis.stringifyAndSet(filteredTodos, 'tasks');\n\t}", "function removeTask(event) {\n\n let id = event.target.dataset.id;\n let tareaEliminar = event.target.parentNode;\n console.log(tareaEliminar);\n\n tareaEliminar.parentNode.removeChild(tareaEliminar)\n\n //buscar en el array la posicion\n let posicionBorrar = tasks.findIndex(task => {\n return task.titulo == id\n })\n\n console.log(posicionBorrar);\n tasks.splice(posicionBorrar, 1)\n}", "function clearTasks() {\r\n //CLEAR TASKS FROM THE DOM\r\n while (taskList.firstChild) {\r\n taskList.removeChild(taskList.firstChild);\r\n }\r\n //CLEAR TASKS FROM LOCAL STORAGE\r\n clearAllLS();\r\n}", "function removeTask(lnk) {\n\tvar id = lnk.href.match(/task=(\\d+)\\&?/)[1];\n\n\tvar index = findId(id);\n\tif(index != -1) {\n\t\thideCurrentTask();\n\t\t\n\t\tvar new_tasks = [];\n\t\tfor(var i=0; i<tasks.length; i++) {\n\t\t\tif(i != index)//Delete the index'th item\n\t\t\t\tnew_tasks.push(tasks[i]);\n\t\t}\n\t\ttasks = new_tasks;\n\t\t\n\t\tif(!tasks.length) {\n\t\t\t$(\"controls\").innerHTML = t(\"There are no more tasks left\");\n\t\t\t\n\t\t} else {\n\t\t\tvar id = tasks[current_task];\n\t\t\tif(id) $(\"task-\"+id).className = \"active\";\n\t\t}\n\t}\n}", "function removeTask(task, taskList) {\n newArr = [];\n for (var i = 0; i < taskList.length; ++i) {\n if (task.eID === taskList[i].eID) {\n newArr = taskList.slice(i, i + 1);\n return newArr;\n }\n }\n}", "function removeTask(e){\n // get the parent list item to remove\n var taskItem = e.target.parentElement;\n taskList.removeChild(taskItem);\n}", "delete() { all = all.filter(task => task.id !== this.id) }", "function removeTask(e) {\n\tupdateSidebar(e);\n\t\n\t//updating task description\n\tupdateTaskDescription(e);\n\t\n\te.target.parentElement.parentNode.removeChild(e.target.parentElement);\n}", "function deleteTask(event)\n{\n //gets button id\n let id = event.target.id;\n\n //gets task position from button id\n let taskPosition = id.replace(/\\D/g,'');\n\n //removes task from task array\n taskArr.splice(taskPosition - 1, 1); \n\n //loop through task array to adjust position\n for(let i = 0; i < taskArr.length; i++)\n {\n taskArr[i].position = i + 1;\n };\n\n //rewrites task list\n rewritesList();\n}", "function deleteTask() {\n this.parentNode.parentNode.removeChild(this.parentNode);\n}", "function removeTask(e) {\n e.parentNode.parentNode.parentNode.removeChild(e.parentNode.parentNode)\n}", "function deleteTask(task) {\n var index = myArray.indexOf[task];\n myArray.splice(index, 1);\n return myArray.length;\n}", "function clearTasks(e) {\n const tasks = Array.from(taskList.children);\n if (tasks.length > 0){\n if (confirm('Clear all tasks?')) {\n tasks.forEach(function (task){\n task.remove();\n });\n }\n }\n taskInput.value = '';\n filter.value = '';\n localStorage.removeItem('tasks');\n\n e.preventDefault();\n}", "function deleteTasksByTeamByRange(options, allTasks, myTasks)\n {\n var calls = [];\n\n Teams.getTasksRange(options)\n .then(function (tasks)\n {\n if(tasks.length == 0)\n {\n $rootScope.notifier.error($rootScope.ui.planboard.noTasksFounded);\n $rootScope.statusBar.off();\n }\n else if (tasks.error)\n {\n $rootScope.notifier.error(result.error);\n }\n else\n {\n angular.forEach(tasks, function (task)\n {\n\n allTasks = deleteTask(allTasks, task.uuid);\n myTasks = deleteTask(myTasks, task.uuid);\n\n calls.push(\n TeamUp._\n (\n 'taskDelete',\n {second: task.uuid},\n task\n )\n );\n });\n\n $q.all(calls)\n .then(function (result)\n {\n if (result.error)\n {\n console.log('failed to remove task ', task);\n }\n else\n {\n var group = ($scope.section == 'teams')\n ? $scope.currentTeam\n : $scope.currentClientGroup;\n\n $scope.getTasks(\n $scope.section,\n group,\n moment($scope.timeline.range.start).valueOf(),\n moment($scope.timeline.range.end).valueOf()\n );\n $rootScope.notifier.success($rootScope.ui.planboard.tasksDeleted(options));\n }\n $rootScope.statusBar.off();\n });\n }\n });\n }", "deleteByTaskId(id, callback) {\n try {\n id = new ObjectID(id)\n } catch (err) {\n callback(null)\n }\n collection.deleteMany({task: id}, callback)\n }", "function deleteTask(currentTask) {\n console.log(\"Delete task\");\n console.log(\"---task to be deleted: \" + currentTask.task);\n\n setTasks(\n tasks.filter((task) => {\n // console.log(\"\")\n return task.id !== currentTask.id;\n })\n );\n }", "function clearTasks() {\n\t\t\tlongTasks = [];\n\n\t\t\tlongTasksTime = 0;\n\t\t}", "function deleteTask(id) {\n listTask = listTask.filter(function(item) {\n return item.id != id;\n });\n\n addToLocalStorage(listTask);\n}", "function removeTask(e) {\n e.currentTarget.parentNode.remove();\n}", "function deleteTask(id){\r\n // Remove from DOM\r\n let item = document.getElementById(id);\r\n item.remove();\r\n\r\n // Remove from backend\r\n let dataSend = \"deleteTask=exec&id=\" + id;\r\n return apiReq(dataSend, 3);\r\n}", "function clearAllTasks() {\r\n\tvar allTasks = document.getElementsByTagName('li');\r\n\tfor(var i=allTasks.length-1; i >= 0; i--) {\r\n\t\tallTasks[i].parentNode.removeChild(allTasks[i]);\r\n\t}\r\n}", "function deleteTask(task) {\n var position = toDoList.indexOf(task);\n if (position > -1) {\n return toDoList.splice(position, 1);\n }\n else {\n console.log(\"task is not in our list!\");\n }\n}", "function deleteTask(el) {\n\tel.parentNode.remove();\n}", "function clearDoneTasks() {\r\n\tvar doneTasks = document.getElementsByClassName('done');\r\n\tfor(var i=doneTasks.length-1; i >= 0; i--) {\r\n\t\tdoneTasks[i].parentNode.removeChild(doneTasks[i]);\r\n\t}\r\n}", "function removeTask(e) {\n if (e.target.classList.contains('remove-task')) {\n e.target.parentElement.remove();\n }\n\n //Remove from Storage \n removeTaskLocalStorage(e.target.parentElement.textContent);\n}", "deleteTaskById (id) {\n const taskListCopy = [...this.state.tasks];\n let tasksCompleted = this.state.tasksCompleted;\n\n taskListCopy.forEach((taskObj, index) => {\n if(taskObj.id === id) {\n taskListCopy.splice(index, 1);\n tasksCompleted--;\n }\n })\n this.setState( {tasks: taskListCopy, tasksCompleted} );\n }", "function clearTask(id) {\n \"use strict\";\n tasks.splice(id, 1);\n displayTasks.tasksReload();\n }", "function removeTask(Event) {\n //Set animation to fade-out\n Event.path[2].style.animationName = \"fade-out\";\n\n //Remove task from the board after 1.6s\n setTimeout(function() {\n Event.path[2].remove();\n }, 1600);\n\n //Remove task from tasks array\n for (var i = 0; i < tasks.length; i++) {\n if (tasks[i].id == Event.target.id) {\n console.log(\n \"*REMOVED* task id: \" + tasks[i].id + \" task title: \" + tasks[i].title\n );\n tasks.splice(i, 1);\n }\n }\n\n //Update the local storage with the new tasks array\n localStorage.setItem(\"task\", JSON.stringify(tasks));\n}", "function removeTask(event){\n // Get the index of the task to be removed\n let index = findIndexById(event.target.parentElement.id);\n\n // Confirm if the user wants to remove said task\n if(confirm(`Do you want to remove this task? \"${toDos[index].content}\"`)){\n // Use splice to delete the task object and reorder the array then update local storage\n toDos.splice(index, 1);\n ls.setJSON(key, JSON.stringify(toDos));\n\n // Update the list displayed to the user\n displayList();\n }\n}", "deleteSubtask(event) {\n\n let idToDelete = event.target.name;\n let subtasks = this.subtasks;\n let subtaskIndex;\n let recordIdToDelete;\n\n this.processing = true;\n\n for (let i = 0; i < subtasks.length; i++) {\n if (idToDelete === subtasks[i].id) {\n subtaskIndex = i;\n }\n }\n\n recordIdToDelete = subtasks[subtaskIndex].recordId;\n\n deleteSubtask({recordId: recordIdToDelete})\n .then(result => {\n if (result) {\n subtasks.splice(subtaskIndex, 1);\n } else {\n }\n })\n .catch(error => console.log(error))\n .finally(() => this.processing = false);\n this.subtasks = event.target.querySelector(refreshSubtaskList);\n }", "function flush() {\n if (tasks.length > 0) {\n tasks.splice(0, tasks.length);\n }\n }", "function deleteTask(id){\n API.deleteTask(id)\n .then(()=>{\n getTasks();\n }).catch();\n }", "static removeTask(project, task) {\n const qSelector = `#delete-project${project.id}-task${task.id}`\n console.log(qSelector)\n const taskDeleteBtn = document.querySelector(qSelector)\n taskDeleteBtn.addEventListener('click', () => {\n project.removeTask(task);\n DomOutput.loadTaskList(project);\n })\n }", "removeTask(target) {\n if (!target.classList.contains(\"todo-list__btn-remove\")) return;\n let li = target.parentElement;\n if (li.classList.contains(\"todo-list__item--done\")) {\n let index = [...li.parentElement.children].indexOf(li);\n this.doneTaskArr.splice(index - 1, 1);\n this.taskToLocal(\"doneTask\", this.doneTaskArr);\n li.remove();\n } else {\n let index = [...li.parentElement.children].indexOf(li);\n this.undoneTaskArr.splice(index - 1, 1);\n this.taskToLocal(\"undoneTask\", this.undoneTaskArr);\n li.remove();\n }\n }", "function deleteTask(e) {\n let index = this.dataset.index;\n let tyList = this.parentElement.parentElement.parentElement;\n if (tyList.getAttribute(\"id\") == \"lists\") {\n tasks.splice(index, 1);\n localStorage.setItem(\"tasks\", JSON.stringify(tasks));\n render(lists, tasks);\n }\n if (tyList.getAttribute(\"id\") == \"listOfChecked\") {\n tasksChecked.splice(index, 1);\n localStorage.setItem(\"tasksChecked\", JSON.stringify(tasksChecked));\n render(listOfChecked, tasksChecked);\n }\n}", "function removeDOMTask(event, list = inbox) {\n \n if (event.target.tagName === 'A') {\n // remover tarea de la lista, (se necesita el índice)\n list.removeTask(getTaskIndex(event), tasksContainerElement); \n }\n}", "function delTask(e) {\n e.parentNode.remove()\n}", "function deleteTasks(taskId){\n $.ajax({\n url: '/tasks/' + taskId,\n type: 'DELETE',\n success: function(response){\n console.log(response);\n getTasks();\n } // end success\n }); //end ajax\n}", "function removeDOMTask (e, list = inbox) {\n\t// Se comprueba que se pulso el enlace (nombre de la etiqueta en mayuscula)\n\tif (e.target.tagName === 'A') {\n\t\t// Remover tarea de la lista (se necesita el indice)\n\t\tlist.removeTask(getTaskIndex(e), taskContainerElement);\n\t}\n\n\t// console.log('remove');\n}", "function removeTask(e) {\n // Clicking on the delete button causes the removal of that list item\n if (e.target.parentElement.classList.contains('delete-item')){\n e.target.parentElement.parentElement.remove();\n removeLocalStorage(e.target.parentElement.parentElement.textContent);\n // Refresh the list to mirror local storage contents as all duplicates are removed\n getTasks(e);\n }\n e.preventDefault();\n}", "function delete_task(e) {\n console.log('delete task btn pressed...');\n e.target.parentElement.remove();\n\n }", "function clearTasks(e){\n //taskList.innerHTML = '';\n while(taskList.firstChild){\n taskList.removeChild(taskList.firstChild);\n }\n let deletedTasks;\n \n deletedTasks = localStorage.getItem('tasks')\n \n localStorage.setItem('deletedTasks',deletedTasks)\n localStorage.removeItem('tasks')\n //localStorage.clear()\n e.preventDefault()\n}", "function deleteTask(id) {\r\n let Note = document.getElementById(id); \r\n //removes note from page\r\n document.getElementById(\"shoeNotesFromLS\").removeChild(Note); \r\n let indexOfTaskToRemove = tasks.findIndex(task => task.id === id);\r\n //removes from array of tasks\r\n tasks.splice(indexOfTaskToRemove, 1);\r\n //removes from array in local storage\r\n if (tasks.length != 0) {\r\n localStorage.tasks = JSON.stringify(tasks);\r\n }\r\n else {\r\n localStorage.removeItem(\"tasks\");\r\n }\r\n \r\n}", "function clearComTasks() {\r\n //CLEAR TASKS FROM THE DOM\r\n while (completed.firstChild) {\r\n completed.removeChild(completed.firstChild);\r\n }\r\n //CLEAR TASKS FROM LOCAL STORAGE\r\n clearAllLS();\r\n}", "function deleteTask(id) {\n const updatedTasks = tasks.filter((task) => task.taskId !== id);\n setTasks(updatedTasks);\n }", "function CompleteTask() \n{ \n var listItem = this.parentNode;\n var ul = listItem.parentNode;\n var tarInd = listItem.querySelector(\"p\");\n\n ul.removeChild(listItem);\n\n taskArr.splice([tarInd.value],1);\n\n console.log(taskArr);\n}", "deleteTask(task) {\n const deleteItem = task.key;\n const deleteRef = firebase.database().ref(`${this.props.userId}/${deleteItem}`);\n deleteRef.remove();\n }", "function deleteTask() {\n const buttonDelete = document.querySelectorAll('.button-delete')\n buttonDelete.forEach(button => {\n button.onclick = function (event) {\n event.path.forEach(el => {\n if (el.classList?.contains(listItemClass)) {\n let id = +el.id\n listTask = listTask.filter(task => {\n if (task.id === id) {\n el.remove()\n return false\n }\n return true\n })\n showInfoNoTask()\n }\n })\n setTaskValue()\n localStorage.setItem('listTask', JSON.stringify(listTask))\n }\n })\n }", "function deleteTask(projectid, taskid) {\n data.projects[projectid].tasks.splice(taskid, 1);\n }", "removeTask(taskId) {\n var temp = this.state.taskArray;\n temp.splice(taskId, 1);\n this.setState({taskArray: temp})\n }", "function removeTaskLocalStorage(task) {\n //Get Tasks from storage\n let tasks = getTaskFromStorage();\n\n //Remove the X from the remove button\n\n const taskDelete = task.substring(0, task.length - 1);\n // console.log(taskDelete);\n\n //Look through the all tasks & delete them\n tasks.forEach(function (taskLS, index) {\n if (taskDelete === taskLS) {\n tasks.splice(index, 1);\n }\n });\n\n //Save the new array data to Local Storage\n localStorage.setItem('tasks', JSON.stringify(tasks));\n\n}", "doTaskDone(target) {\n let index = [...target.parentElement.children].indexOf(target);\n this.undoneTaskArr.splice(index - 1, 1);\n this.doneTaskArr.push(target.children[0].value);\n this.taskToLocal(\"undoneTask\", this.undoneTaskArr);\n this.taskToLocal(\"doneTask\", this.doneTaskArr);\n const task = new Task(target.children[0].value);\n this.taskListDone.appendChild(task.createDoneTask());\n target.remove();\n }", "function deleteCompletedTasks() {\n setcompletedTodos([]);\n }", "function clearTask(){\n // this one way of doing it \n //taskList.innerHTML=\" \";\n \n // this is the best way to do it cause its faster\n while(taskList.firstChild){\n taskList.removeChild(taskList.firstChild);\n }\n // clear from all from local storage\n clearTasksFromLocalStorage();\n }", "function removeTask(button) {\n let li = button.parentNode;\n /* \n let ul = li.parentNode;\n ul.removeChild(li);\n */\n li.remove();\n}", "function handleClearTasks() {\n const newTasks = tasks.filter(task => !task.complete)\n setTasks(newTasks)\n }", "function removeTask(e) {\n\tif (e.target.parentElement.classList.contains('delete-item')) {\n\t\tif (confirm('Are You Sure?')) {\n\t\t\te.target.parentElement.parentElement.remove();\n\t\t\t/*Ako parentElement ima klasu delete-item onda hocu da...*/\n\n\t\t\t//-Remove from LS-//\n\t\t\tremoveTasksFromLocalStorage(e.target.parentElement.parentElement);//Funkcija za brisanje iz LS\n\t\t}\n\t}\n}", "function clearTasks(e) {\n taskList.innerHTML = \"\";\n}", "function removeTodoById(id, li) {\n connection.remove({\n from: 'tasks',\n where: {\n id: id\n }\n }).then(() => {\n li.remove()\n // alert('Todo removed')\n })\n}", "function removeCompleted(index) {\n // gets todos from local storage\n const todos = _store__WEBPACK_IMPORTED_MODULE_0__.default.getTasks();\n\n todos.splice(index, 1);\n\n _store__WEBPACK_IMPORTED_MODULE_0__.default.setTasks(todos);\n}", "function removeTaskFromLs(taskItem){\n let tasks;\n if(localStorage.getItem('tasks') === null){\n tasks = [];\n }else{\n tasks = JSON.parse(localStorage.getItem('tasks'));\n }\n\n tasks.forEach((task, index) => {\n if(taskItem.textContent === task){\n tasks.splice(index, 1);\n }\n });\n\n localStorage.setItem('tasks', JSON.stringify(tasks));\n}", "function deleteTask(del){\n\t$.delete(\"http:localhost:8080/deleteTask\",\n\t\tdel,\n\t\tfunction(data, status){\n\t\t});\n}", "function delete_task(task_id) {\n fetch(`delete/${task_id}`, {\n method: 'DELETE'\n })\n var task = document.getElementById(`${task_id}`);\n task.remove();\n }", "function removeTaskData(s,id)\n{\n const tasks = $(\"body\").data().tasks;\n if (s === \"tasklist\")\n {\n delete tasks.active[id];\n }\n else if (s === \"archivelist\")\n {\n delete tasks.archive[id];\n }\n else\n {\n developerError(\"removeTaskData() called with invalid task type\");\n }\n}", "function deleteTask(id) {\n // Delete it in DB\n todoListService\n .deleteTask(id)\n .then((response) => console.log(response))\n .catch((error) => console.error(error));\n\n // Filter out the remaining Tasks based on the task Id\n const remainingTasks = tasks.filter((task) => id !== task.id);\n // Update the state\n setTasks(remainingTasks);\n }", "deleteTask(task) {\n const taskArray = [...this.state.tasks];\n const index = taskArray.map(t => t.text).indexOf(task);\n\n taskArray.splice(index, 1);\n\n this.setState({ tasks: taskArray });\n }" ]
[ "0.7358061", "0.72974175", "0.71213925", "0.70832986", "0.6977794", "0.69294983", "0.69193834", "0.69031036", "0.68707055", "0.6836908", "0.68129915", "0.6802903", "0.6799288", "0.67796594", "0.6774586", "0.6758109", "0.6710263", "0.6707952", "0.67012024", "0.6701122", "0.66954714", "0.66742754", "0.66649187", "0.6652127", "0.6647617", "0.6641506", "0.6600303", "0.66001683", "0.65824956", "0.65607285", "0.65551686", "0.6546243", "0.6545964", "0.654321", "0.6500503", "0.6492532", "0.6488107", "0.6487995", "0.64699984", "0.64553756", "0.6454805", "0.64528054", "0.64491636", "0.6436922", "0.6398254", "0.63812757", "0.6367368", "0.6366527", "0.63619626", "0.6359583", "0.6351953", "0.63431644", "0.63420373", "0.63400966", "0.6338294", "0.63362527", "0.63254505", "0.63190454", "0.63132346", "0.63078845", "0.630729", "0.6296107", "0.62888813", "0.62871575", "0.62662345", "0.62601274", "0.62543", "0.6235035", "0.6234825", "0.62305075", "0.6230098", "0.6228538", "0.6221373", "0.62186235", "0.62054604", "0.62033194", "0.6193415", "0.6183871", "0.61831343", "0.6181208", "0.61775994", "0.6171369", "0.6168523", "0.6164171", "0.61606646", "0.61571616", "0.61438835", "0.6132946", "0.6129858", "0.6129132", "0.61276174", "0.6125865", "0.61234516", "0.61032844", "0.6102532", "0.6100453", "0.6093979", "0.6082496", "0.6074277", "0.6069909", "0.6067052" ]
0.0
-1
Process the returned answers
function _promptFinished(answers) { for ( let i = 0; i < answers.length; i++ ) { let answer = answers[i]; _process(answer[0], i+1, answers.length); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processAnswers(answers) {\n\tconsole.log(\"Does this look right?\", answers);\n}", "function process_answer_submission(){\n answer = given_answer();\n correct = is_correct_answer(answer,question_on_screen);\n update_question_result(correct);\n counter++;\n}", "function processResponse(inQuestion, inAnswers) {\n var userAnswer = prompt(inQuestion).toLowerCase();\n for (var answerIndex = 0; answerIndex < inAnswers.length; answerIndex++) {\n if (userAnswer === inAnswers[answerIndex])\n return 'Correct!';\n }\n return 'Incorrect';\n}", "function reply_processed( result ) {\n\n\t\t\tvar storename;\n\t\t\tvar name_map = {\n\t\t\t\t'goals_set_up' : 'test_goals',\n\t\t\t\t'goal_value' : 'test_goal_value',\n\t\t\t\t'demographic_data' : 'test_demographic',\n\t\t\t\t'events' : 'test_events',\n\t\t\t\t'enhanced_ecommerce' : 'test_ecom',\n\t\t\t\t'adwords_linked' : 'test_adwords',\n\t\t\t\t'channel_groups' : 'test_channelgroups',\n\t\t\t\t'content_groups' : 'test_contentgroups',\n\t\t\t\t'setup_correct' : 'test_setup',\n\t\t\t\t'filltering_spam' : 'test_spam',\n\t\t\t\t'raw_or_testing_view' : 'test_raw',\n\t\t\t\t'total_sessions' : 'test_sessions',\n\t\t\t\t'bounce_rate' : 'test_bouncerate',\n\t\t\t\t'top_hostname' : 'test_tophost',\n\t\t\t\t'channel' : 'test_majority_channel',\n\t\t\t\t'sessions' : 'test_majority_session',\n\t\t\t\t'percentage' : 'test_majority_percentage',\n\t\t\t}\n\t\t\tfor (var attrname in result) {\n\t\t\t\tconsole.log(attrname);\n\t\t\t\t// map results to storage format\n\t\t\t\tstorename = name_map[attrname];\n\t\t\t\tresults[storename] = result[attrname];\n\t\t\t}\n\n\t\t\treplies++;\n\t\t\tif ( 4 === replies ) {\n\t\t\t\tjQuery( '#analytucsaudit_message').hide();\n\t\t\t\tjQuery( '#analytucsaudit_results').show();\n\t\t\t\tequal_tests_height();\n\n\t\t\t\tvar data = {\n\t\t\t\t\t\t'action' : 'analyticsaudit_save',\n\t\t\t\t\t\t'website' : domain,\n\t\t\t\t\t\t'email' : jQuery('#analytucsaudit_email').attr('data-email'),\n\t\t\t\t\t\t'gtm' : jQuery('#analytucsaudit_gtm').is(\":checked\"),\n\t\t\t\t\t\t'tableau' : jQuery('#analytucsaudit_tableau').is(\":checked\"),\n\t\t\t\t\t\t'bigquery' : jQuery('#analytucsaudit_bigquery').is(\":checked\"),\n\t\t\t\t\t\t'datastudio' : jQuery('#analytucsaudit_datastudio').is(\":checked\"),\n\t\t\t\t\t\t'unsure' : jQuery('#analytucsaudit_unsure').is(\":checked\"),\n\t\t\t\t\t\t'ecom' : jQuery('#analytucsaudit_ecom').is(\":checked\"),\n\t\t\t\t\t\t'lead' : jQuery('#analytucsaudit_lead').is(\":checked\"),\n\t\t\t\t\t\t'publisher' : jQuery('#analytucsaudit_publisher').is(\":checked\"),\n\t\t\t\t};\n\t\t\t\tfor (var attrname in results) {\n\t\t\t\t\tdata[attrname] = results[attrname];\n\t\t\t\t}\n\n\t\t\t\tjQuery.post(analyticsaudit_vars.ajax_url, data, function(response) {\n\t\t\t\t});\n\n\t\t\t}\n\t\t}", "function ProcessAnswers(options, data) {\r\n \r\n // Unfortunately we need to manually sort the answers because the API does not do this for us and then\r\n // convert the answers into a map where the key becomes the answer's ID\r\n var sorted_answers = data['answers'].sort(function (a, b) { return b['score'] - a['score']; });\r\n var answer_key = {};\r\n $.each(sorted_answers, function(key, value) { answer_key[value['answer_id']] = value; });\r\n \r\n // Add different answers to the output list depending on the 'answers' option\r\n var output_answers = [];\r\n if(options['answers'] == 'all')\r\n output_answers = sorted_answers;\r\n else if(options['answers'] == 'accepted') {\r\n \r\n if(typeof data['accepted_answer_id'] != 'undefined' && typeof answer_key[data['accepted_answer_id']] != 'undefined')\r\n output_answers.push(answer_key[data['accepted_answer_id']]);\r\n else\r\n output_answers.push(sorted_answers[0]);\r\n }\r\n else {\r\n \r\n var id_list = options['answers'].split(',');\r\n $.each(id_list, function(key, value) {\r\n \r\n if(typeof answer_key[value] != 'undefined')\r\n output_answers.push(answer_key[value]);\r\n \r\n });\r\n }\r\n \r\n // Concatenate the output to the question\r\n var html = '';\r\n \r\n if(output_answers.length)\r\n $.each(output_answers, function(key, value) { html += GenerateAnswerHTML(options, value); });\r\n else\r\n html += '<div class=\"hr\" /><p class=\"tip\">No answers matched the specified criteria.</p>';\r\n \r\n return html;\r\n }", "function handleAnswerOnScreen(res, app) {\n if (res.length == 0) {\n app.ask(RESPONSE_NO_OFFER_MATCHING[lang]);\n } else if (res.length == 1) {\n showOneOffer(app, res[0], RESPONSE_THIS_OFFER_MATCHES[lang]);\n } else if (res.length > 1 && res.length <= 10) {\n answerWithCarousel(app, res);\n } else if (res.length > 10 && res.length <= 30) {\n answerWithList(app, res);\n } else if (res.length > 30) {\n app.ask(RESPONSE_TOO_MANY_OFFERS[lang]);\n }\n}", "function processAnswer() {\n // remove every answer from the answerArray, parse it and add the information to the model\n while (answerArray.length > 0) {\n var answer = answerArray.shift();\n console.log('Answer received: ' + answer);\n try {\n var antwort = JSON.parse(answer.trim());\n if (!antwort.com) {\n // don't shot (N)ACKs in last response, they have a seperate property\n properties.lastResponse = answer;\n }\n if (antwort.info) {\n /**\n * answer possibility 1: answer to sys:2-command\n * {\"info\":[\n * {\"id\":\"Position\",\"val\":\"2855\"},\n * {\"id\":\"Error Number\",\"val\":\"0x00000000\"},\n * {\"id\":\"Error Counter\",\"val\":\"0\"},\n * {\"id\":\"Prod. Version\",\"val\":\"24.1\"},\n * {\"id\":\"FW Version\",\"val\":\"0.3\"},\n * {\"id\":\"Seq. Version\",\"val\":\"0.0\"}\n * ]}\n */\n antwort.info.forEach(function (element, index) {\n switch (element.id) {\n case 'Position':\n properties.position = element.val;\n break;\n case 'Error Number':\n properties.errorNumber = element.val;\n break;\n case 'Error Counter':\n properties.errorCounter = element.val;\n break;\n case 'Prod. Version':\n properties.prodVersion = element.val;\n break;\n case 'FW Version':\n properties.fwVersion = element.val;\n break;\n case 'Seq. Version':\n properties.sequenceVersion = element.val;\n break;\n default:\n properties[element.id] = element.val;\n console.log('Unknown info-Parameter: ' + element.id);\n break;\n }\n if (index == antwort.info.length - 1) {\n // properties have been updated, they can be added to the model\n myself.addValue(properties);\n }\n }); // forEach element in antwort.info\n } // antwort.info\n if (antwort.com && antwort.com.id == 'state') {\n /**\n * answer possibility 2: answer is a ACK or NACK\n * {\"com\":{\"id\":\"state\",\"val\":\"ACK\"}}\n */\n properties.lastACK = antwort.com.val;\n myself.addValue(properties);\n } // antwort.com\n if (antwort.par) {\n /**\n * answer possibility 3: answer to cmd:2-command\n * {\"par\":{\"id\":0,\"cmd\":0,\"val\":2500}}\n * {\"par\":{\"id\":1,\"cmd\":0,\"val\":10000}}\n * {\"par\":{\"id\":2,\"cmd\":0,\"val\":10000}}\n * {\"par\":{\"id\":3,\"cmd\":0,\"val\":152000}}\n * {\"par\":{\"id\":4,\"cmd\":0,\"val\":162}}\n * {\"par\":{\"id\":5,\"cmd\":0,\"val\":389}}\n * {\"par\":{\"id\":6,\"cmd\":0,\"val\":45000}}\n * {\"par\":{\"id\":7,\"cmd\":0,\"val\":0}}\n */\n switch (antwort.par.id) {\n case 0:\n properties.maxSpeed = antwort.par.val;\n break;\n case 1:\n properties.maxAccel = antwort.par.val;\n break;\n case 2:\n properties.maxDecel = antwort.par.val;\n break;\n case 3:\n properties.intersectionSpeed = antwort.par.val;\n break;\n case 4:\n properties.startGradient = antwort.par.val;\n break;\n case 5:\n properties.endGradient = antwort.par.val;\n break;\n case 6:\n properties.pwm = antwort.par.val;\n break;\n default:\n console.log('Answer with unknown par id: ' + JSON.stringify(antwort.par.id));\n properties[antwort.par.id] = antwort.par.val;\n break;\n }\n myself.addValue(properties);\n } // antwort.par\n }\n catch (e) {\n // Could not parse answer from motor, i.e. it wasn't a JSON object (happens after sys:1 command)\n properties.lastResponse = answer;\n myself.addValue(properties);\n console.error('Failed to parse answer from motor!');\n console.error(e);\n }\n } // while answerArray.length > 0\n if (commands.length >= 1) {\n var command = commands.shift() + '\\n';\n port.write(command, function (err) {\n if (err) {\n return console.log('Error on write: ', err.message);\n }\n console.log('Command sent: ' + command);\n // Clear the scheduled timeout handler (needed if many requests arrive in a short period)\n clearTimeout(timer);\n // Setup the timeout handler\n timer = setTimeout(function () {\n // This function will be called after <timeoutTime> milliseconds (approximately)\n // Clear the local timer variable, indicating the timeout has been triggered.\n timer = null;\n // Execute the callback with an error argument (i.e. set the isOnline property to false)\n timeoutHandler(true);\n }, timeoutTime);\n }); // port.write\n } // if\n} // processAnswer", "function evaluateAnswers(answer) {\n\n\tif(answer === answers[0].answer.toUpperCase()) {\n\t\tcorrectAnswer = answers[0].isCorrect;\n\t}\n\n\telse if(answer === answers[1].answer.toUpperCase()) {\n\t\tcorrectAnswer = answers[1].isCorrect;\n\t}\n\telse if(answer === answers[2].answer.toUpperCase()) {\n\t\tcorrectAnswer = answers[2].isCorrect;\n\t}\n\telse if(answer === answers[3].answer.toUpperCase()) {\n\t\tcorrectAnswer = answers[3].isCorrect;\n\t}\n\n\telse {\n\t\tunanswered = true;\n\t}\n}", "function processQuizzAnswer(){\n\t\t//console.log(\"scenarioController.processQuizzAnswer\");\n\t\t\n\t\tvar scenarioPlay=m_scenarioContext.getCurrentScenarioPlay();\n\t\t\n\t\t// Get the current MCQ to be processed\n\t\tvar mcq = scenarioPlay.getMCQ();\n\t\t\n\t\tvar userResponses = new Array();\n\t\tvar validResponses = new Array();\n\t\tvar validAnswer=true;\t\t\n\t\t\n\t\t// Determine it the answer was right\n\t\tfor (var i=0; i < mcq.answers.length; i++ ){\n\t\t\tvar userAnswer=document.getElementById(\"ValpoppMCQanswer\" + (i+1));\n\n\t\t\t// User answers\n\t\t\tif (userAnswer.checked){\n\t\t\t\tuserResponses[i]=true;\n\t\t\t}else{\n\t\t\t\tuserResponses[i]=false;\n\t\t\t}\n\t\t\t\n\t\t\t// Valid answers\n\t\t\tif (mcq.answers[i].valid){\n\t\t\t\tvalidResponses[i]=true;\n\t\t\t}else{\n\t\t\t\tvalidResponses[i]=false;\t\t\t\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\t// Determine if all the user answer is right\n\t\t\tif (userResponses[i]!=validResponses[i]){\n\t\t\t\tvalidAnswer=false;\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\tvar html=htmlBuilder.getMCQResults(mcq, userResponses, validResponses, validAnswer);\n\t\t\n\t\t// Set quiz state to ready because the user already answer the quiz\n\t\tscenarioPlay.setQuizReady(true);\n\t\t\n\t\t// Send to the model the user responses\n\t\tscenarioPlay.setQuizAnswers(userResponses);\n\t\t\n\t\tscenarioView.showQuizCorrections(html);\n\t}", "function processAnswer () {\n return questionName = bot(questionName);\n}", "function process(data) {\n console.log(data)\n\n var q = data.results;\n \n //using jquery get the output div and set it \n //into a var called output\n var output = $(\"#output\");\n\n //using array.map, write a block that outputs each\n //question, and inside of that, maps each answer choice, like:\n\n var z = q.map( (h,index) => {\n //append the question into the div + \"<br>\"\n //append the correct answer into the div + \"<br>\"\n output.append(h.question + \"<br>\")\n output.append(createRadio(index,h.correct_answer))\n output.append(h.correct_answer + \"<br>\")\n\n //map again over the incorrect answers array\n //append each incorrect answer into the div + \"<br>\"\n var zz = h.incorrect_answers.map((a) => {\n output.append(createRadio(index,a)); \n output.append(a + \"<br>\");\n })\n })\n \n}", "function getAnswers(){\n\t\t//go through array, asking the user each question\n\t\tfor(var i = 0; i < questions.length; i++){\n\t\t\t//Get the user's answer\n\t\t\tanswers[i] = prompt(questions[i]);\n\t\t\t//Process the user's answer\n\t\t\tif(i === questions.length - 1){ //the last question is not a yes or no question\n\t\t\t\t//convert the user's last answer to a number type\n\t\t\t\tanswers[i] = parseInt(answers[i]);\n\t\t\t\t//console.log(answers[i]);\n\t\t\t\t//verify the user entered one of the correct numbers\n\t\t\t\tif(answers[i] !== 23 && answers[i] !== 65 && answers[i] !== 93){ \n\t\t\t\t\tresultEl.innerHTML += \"<h3>I'm sorry, you didn't pick one of the given numbers in question 6. Please refresh the page to start over and be sure to answer 23, 65, or 93.</h3>\";\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}else if(answers[i].toLowerCase() === \"n\" || answers[i].toLowerCase() === \"no\"){\n\t\t\t\tanswers[i] = \"No\";\n\t\t\t}else if(answers[i].toLowerCase() === \"y\" || answers[i].toLowerCase() === \"yes\"){\n\t\t\t\tanswers[i] = \"Yes\";\n\t\t\t}else{ //User did not answer yes or no - exit game\n\t\t\t\tresultEl.innerHTML += \"<h3>I'm sorry, I didn't understand your answer. Please refresh the page to start over and be sure to answer 'Yes' or 'No'</h3>\";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "function _promptFinished(answers) {\n for ( let i = 0; i < answers.length; i++ ) {\n let answer = answers[i];\n _process(answer[0], answer[1],i+1, answers.length);\n }\n}", "function processAnswer(tokens, ID){\n console.log(\"processing answer\");\n \n}", "function getResponse() {\r\n switch (correctAnswer) {\r\n case 0:\r\n alert('You didn\\'t get any correct! Time to study');\r\n break;\r\n case 1:\r\n alert('You only got one correct. Shameful.');\r\n break;\r\n case 2:\r\n alert('Two correct is marginal.');\r\n break;\r\n case 3:\r\n alert('Three correct is only half right.');\r\n break;\r\n case 4:\r\n alert('You got over half right: 4 correct. Not bad but not great.');\r\n break;\r\n case 5:\r\n alert('You got a C average: 5 out of 7.');\r\n break;\r\n case 6:\r\n alert('You only missed one question!');\r\n break;\r\n case 7:\r\n alert('You got them all correct! Congratulations!');\r\n break;\r\n }\r\n console.log('User answered ' + correctAnswer + ' questions correct.');\r\n }", "_processDOMResult() {\n // retrieve the checked input qyuizify elements\n let res = document.querySelectorAll('input[name=quizify_answer_option]:checked').length > 0 ?\n document.querySelectorAll('input[name=quizify_answer_option]:checked') :\n document.querySelectorAll('input[name=quizify_answer_option]'); // for jest testing...\n\n // get the selection of the user\n let chosenOptions = [];\n for (let i = 0; i < res.length; i++)\n if (res[i].checked === true)\n chosenOptions.push(res[i].value);\n\n if (chosenOptions.length <= 0)\n throw new Exceptions.QuizNoAnswerSelectedException();\n\n // pass it to the processing function\n this.processUserAnswer(chosenOptions);\n }", "function result()\n\t{\n\t\t{\n\t\t\t/* for( i=0; i<questions.length; i++ )\n\t\t\t\t {\n\t\t\t\t checkAnswers( questions[i]);\t\t\n\t\t\t\t } */\n\t\t\t\t\n\t\t\t//To test in console.log\n\t\t\tconsole.log( \"a1 Score is: \" + checkAnswers( questions[0] ) );\n\t\t\tconsole.log( \"a2 Score is: \" + checkAnswers( questions[1] ) );\n\t\t\tconsole.log( \"a3 Score is: \" + checkAnswers( questions[2] ) );\n\t\t\tconsole.log( \"a4 Score is: \" + checkAnswers( questions[3] ) );\n\t\t\tconsole.log( \"a5 Score is: \" + checkAnswers( questions[4] ) );\n\t\t\t\n\t\t\t// To accumulate total marks in to one variable \n\t\t\tvar m1 = parseInt( checkAnswers( questions[0] ) );\n\t\t\tvar m2 = parseInt( checkAnswers( questions[1] ) );\n\t\t\tvar m3 = parseInt( checkAnswers( questions[2] ) );\n\t\t\tvar m4 = parseInt( checkAnswers( questions[3] ) );\n\t\t\tvar m5 = parseInt( checkAnswers( questions[4] ) );\n\n\t\t\tvar total = m1 + m2 + m3 + m4 + m5;\n\n\t\t\tconsole.log( \"Total Score is: \" + total );\n\t\t\t\n\t\t\tquiz.answersBox.value = \"Total Score is: \" + total;\n\t\t}\n\t}", "function getResult() {\n console.log(\"getResult ran\");\n wrong = total - correct;\n $(\"#end_total_right b\").text(correct);\n $(\"#end_total_wrong b\").text(wrong);\n var answer_percent = correct / total;\n if (answer_percent >= 0.67) {\n $(\"#end\").prepend(responses[0]);\n } else if (answer_percent >= 0.34) {\n $(\"#end\").prepend(responses[1]);\n } else {\n $(\"#end\").prepend(responses[2]);\n }\n }", "function success(reply) {\n // Parse the reply\n var result = JSON.parse(reply);\n console.log(result);\n\n // As long as we got something\n if (result.number != undefined) {\n // Look at number and probability (confidence)\n var number = result.number;\n var confidence = result.prediction[number];\n // Display the results in the paragraph element\n resultP.html(number + '<br/>' + 'confidence: ' + p.nf(100 * confidence, 2, 1) + '%');\n } else {\n resultP.html('error');\n }\n next = true;\n }", "function getResults(){\n\n // question 1, option 1\n if (selections[0] === \"0\"){\n\n if (selections[1] === \"1\"){\n return 3;\n }\n if (selections[1] === \"2\"){\n return 6;\n }\n if (selections[1] === \"3\"){\n return 8;\n }\n }\n //question 1, option 2\n if (selections[0] === \"1\"){\n\n if (selections[1] === \"0\"){\n return 2;\n }\n if (selections[1] === \"1\"){\n return 4;\n }\n if (selections[1] === \"2\"){\n return 9;\n }\n }\n //question 1, option 3\n if (selections[0] === \"2\"){\n\n if (selections[1] === \"0\"){\n return 1;\n }\n if (selections[1] === \"1\"){\n return 5;\n }\n if (selections[1] === \"2\"){\n return 7;\n }\n }\n}", "function processAnswer(answer) {\n\n // set boolean switch to false\n displayQuestion = false;\n\n // clear page\n clearPage();\n\n // set timeLeft to 3 for between question time\n timeLeft = 3;\n\n run();\n\n // declare correct answer\n var correctAnswer = questions[questionOrder[curQuestion]].answer;\n\n if (answer == correctAnswer) {\n\n // increment correct guesses\n correctGuesses++;\n\n }\n\n // Display user guess and correct answer\n if (answer >= 0) {\n quizQuestion.append(\"<div>You Answered: \" + questions[questionOrder[curQuestion]].responses[answer] + \"</div>\");\n } else {\n quizQuestion.append(\"<div>You ran out of time!</div>\");\n }\n quizQuestion.append(\"<div>Correct Answer: \" + questions[questionOrder[curQuestion]].responses[correctAnswer] + \"</div>\");\n\n // increment curQuestion\n curQuestion++;\n\n }", "function processRespondents() {\n\n // Get the all the responsdents out the ojbect\n var respondents = this.respondents;\n\n if (respondents.length > 0) {\n\n // Loop through each respondent\n for (var i = 0; i < respondents.length; i++) {\n\n var respondent = respondents[i];\n\n nlapiLogExecution('DEBUG', 'Processing respondent', i);\n\n // We are only interested in the respondents numeric responses\n var numericResponses = respondent.numeric_responses;\n\n if ((numericResponses != null) && (numericResponses.length > 0)) {\n\n nlapiLogExecution('DEBUG', 'Numeric responses', numericResponses.length);\n\n // Find the measure question in all the numeric responses\n var measureQuestion = this.getMeasureQuestionFromNumericResponses(numericResponses);\n nlapiLogExecution('DEBUG', 'Found measure question');\n\n var measureQuestionAnswer = this.getMeasureQuestionAnswer(measureQuestion);\n nlapiLogExecution('DEBUG', 'Found measure question answer', measureQuestionAnswer);\n\n if (measureQuestionAnswer != null) {\n\n // Add the answer weight to the total weight\n this.totalWeight += measureQuestionAnswer.weight;\n\n // Check if the answer has a positive bias\n if (measureQuestionAnswer.bias == 1) {\n this.totalPositiveRespondents += 1;\n }\n\n }\n\n }\n\n }\n\n }\n\n\n nlapiLogExecution('DEBUG', 'Total respondents', this.totalRespondents);\n nlapiLogExecution('DEBUG', 'Total weight', this.totalWeight);\n\n // Calculate the mean average of all the responses (1dp)\n this.meanAverage = (Math.round((this.totalWeight / this.totalRespondents) * 10) / 10);\n nlapiLogExecution('DEBUG', 'Mean average', this.meanAverage);\n\n // Calculate percent positive respondents (1dp)\n this.percentPositiveRespondents = (Math.round((this.totalPositiveRespondents / this.totalRespondents) * 1000) / 10);\n nlapiLogExecution('DEBUG', 'Percent Positive Respondents', this.percentPositiveRespondents);\n\n // Updte the job record with calculated values\n this.updateJobRecord();\n\n return true;\n }", "function setQuestions(response){\n for (let i = 0; i < 1; i++){\n //response returns response_code and results\n //let questions = JSON.parse(response.result);\n questions = response.results[i];\n // console.log(questions)\n //console.log(typeof questions)\n givePosibleAnswers(response.results[i].incorrect_answers, response.results[i].correct_answer,response.results[i].question);\n }\n}", "function continueReponse() {\n // Check if the answer text says 'CORRECT' to determine the next step.\n if (dataContainers.answer.innerText == \"CORRECT\") {\n getStat(); \n }\n else {\n saveScore();\n window.location.href = \"/gameover.html\";\n }\n}", "function getMultiAnswer(b){\n\t\t//Create an array for displaying the content progressively\n\t\tvar answer = [];\n\t\t//Gather data attributes from the current question and answer\n\t\tvar questionnum = $(b).parents('.cf-question').attr('number');\n\t\tvar answerval = $(b).val();\n\t\tvar response = '';\n\t\tvar score = $(b).attr('score');\n\t\t//Add score to totalscore array\n\t\tif(totalScore.length == parseInt(questionnum) - 1){\n\t\t\ttotalScore.push(parseInt(score));\n\t\t\tsessionStorage.setItem(\"totalScore\", JSON.stringify(totalScore));\n\t\t}\n\t\t//Update currentQuestion val and sessionStorage variables\n\t\tcurrentQuestion = questionnum;\n\t\tsessionStorage.setItem(\"currentQuestion\", currentQuestion);\n\t\t//Push value to specific question value array\n\t\tif(questionnum >= 2 && questionnum <= 6){\n\t\t\tvar currentArray = q2values;\n\t\t} else if(questionnum >= 7 && questionnum <= 11){\n\t\t\tvar currentArray = q3values;\n\t\t}\n\t\tcurrentArray.push(answerval);\n\t\t//Evaluate the answers and display the most relevant answer\n\t\tif($(b).hasClass('final')){\n\t\t\tvar containsyes = (currentArray.indexOf(\"yes\") > -1);\n\t\t\tvar containsmaybe = (currentArray.indexOf(\"maybe\") > -1);\n\t\t\tif(containsyes){\n\t\t\t\tresponse = $(b).parent().find('[value=\"yes\"]').attr('answer');\n\t\t\t\tresponse = response.replace(/&&/g, '</p><p>');\n\t\t\t} else if(containsmaybe) {\n\t\t\t\tresponse = $(b).parent().find('[value=\"maybe\"]').attr('answer');\n\t\t\t\tresponse = response.replace(/&&/g, '</p><p>');\n\t\t\t} else {\n\t\t\t\tresponse = $(b).parent().find('[value=\"no\"]').attr('answer');\n\t\t\t\tresponse = response.replace(/&&/g, '</p><p>');\n\t\t\t}\n\t\t\t//Put the response in the DOM\n\t\t\t$(b).parents('.cf-question').next().children('.text-container').html('<p>' + response + '</p>');\n\t\t\t//Dsiplay answer and next question\n\t\t\tdisplayNextAnswer(b);\n\n\t\t} else {\n\t\t\t//Display next question\n\t\t\tdisplayNextQuestion(b, false);\n\t\t}\n\t}", "function doSurvey() {\n if (self.state === STATES.fillOutSurvey) {\n // Determine if processing a question response is needed\n if (self._currentQuestionId) {\n // Create a response for the given question\n var questions = survey.questions, question;\n for (var i = 0, l = questions.length; i<l; i++) {\n var q = questions[i];\n if (q._id = self._currentQuestionId) {\n question = q;\n break;\n }\n }\n\n // Process question answer and cast to relevant type if needed\n if (question) {\n var questionResponse = {\n _questionId: question._id,\n textResponse: message\n };\n\n // Try and cast to number, if needed\n var errorMessage;\n if (question.responseType === 'number') {\n var n = Number(message);\n if (!isNaN(n)) {\n questionResponse.numberResponse = n;\n } else {\n errorMessage = MESSAGES.numericRequired;\n }\n } else if (question.responseType === 'boolean') {\n var bVal = message.trim().toLowerCase();\n if (bVal === MESSAGES.yes || bVal === MESSAGES.no) {\n var b = message.trim().toLowerCase() === MESSAGES.yes;\n questionResponse.booleanResponse = b;\n } else {\n errorMessage = MESSAGES.yesNoRequired;\n }\n }\n\n // If we have a casting error, re-ask question\n if (errorMessage) {\n\n } else {\n // Save in responses array\n self.responses.push(questionResponse);\n self._currentQuestionId = null;\n self.save(function(err) {\n if (err) {\n callback(err, MESSAGES.generalError);\n } else {\n askOrFinish();\n }\n });\n }\n\n } else {\n self._currentQuestionId = null;\n self.save(function(err) {\n askOrFinish();\n });\n }\n\n } else {\n askOrFinish();\n }\n\n } else if (self.state === STATES.confirmSurvey) {\n \n // Confirm question answers before comment\n if (message.toLowerCase() === MESSAGES.yes) {\n\n self.state = STATES.comment;\n self.save(function(err) {\n callback(err, MESSAGES.comment);\n });\n\n } else if (message.toLowerCase() === MESSAGES.no) {\n // If no, start the survey process over\n self.state = STATES.fillOutSurvey;\n self.responses = [];\n self._currentQuestionId = null;\n self.save(function(err) {\n doSurvey();\n });\n } else {\n // ask for clarification and reprint survey if it's not one of those\n printSurvey();\n }\n\n } else if (self.state === STATES.comment) {\n \n // Save and finalize report\n self.commentText = message;\n self.state = STATES.done;\n self.complete = true;\n self.completedOn = new Date();\n self.save(function(err) {\n callback(err, MESSAGES.done);\n // Out of band, save to crisis maps if needed\n if (survey.cmId) {\n pushToCrisisMaps(survey, self, reporter);\n }\n });\n\n } else {\n // The absolute default case is to print out the current status\n // of the survey and prompt for confirmation\n printSurvey();\n }\n\n // Show current survey status and prompt for confirmation\n function printSurvey() {\n var questions = survey.questions,\n responses = self.responses,\n summary = '';\n\n for (var i = 0, l = questions.length; i<l; i++) {\n summary = summary + questions[i].summaryText +': '+\n responses[i].textResponse;\n if (i+1 != questions.length) {\n summary = summary+', \\n';\n }\n }\n\n self.state = STATES.confirmSurvey;\n self.save(function(err) {\n var msg = MESSAGES.confirmSurvey+summary;\n callback(err, msg);\n });\n }\n\n // Ask the next question, if needed\n function askOrFinish() {\n // Grab the survey questions for this survey\n var questions = survey.questions,\n responses = self.responses;\n\n // if we have a question, ask it\n if (responses.length < questions.length) {\n self._currentQuestionId = questions[responses.length]._id;\n self.save(function(err) {\n callback(err, questions[responses.length].text);\n });\n } else {\n // If all the questions have been answered,\n // Update survey state\n printSurvey();\n }\n }\n\n // do over and reset interview state\n function doOver(doOverMessage) {\n console.log('[' + number + '] deleting interview with message: '+doOverMessage);\n self.remove(function(err, doc) {\n callback(err, doOverMessage);\n });\n }\n }", "function results() {\n selectedAnswers = $(displayTest.find(\"input:checked\"));\n //if user is correct\n if (\n selectedAnswers[0].value === testSetup[currentQuestion - 1].questionAnswer\n ) {\n //add to correct score and display on element\n correct++;\n $(\"#correct\").text(\"Answers right: \" + correct);\n } else {\n //if user is wrong then add to wrong score and display on element\n wrong++;\n $(\"#incorrect\").text(\"Wrong answers: \" + wrong);\n }\n //check to see if the user has reached the end of the test\n if (currentQuestion === 10) {\n //toggle finalize modal at end of test to display score\n $(\"#modalMatch\").modal(\"toggle\");\n $(\"#testScore\").text(\n \"End of test! You scored a \" + (parseFloat(correct) / 10) * 100 + \"%\"\n );\n //show postTest element\n $(\"#postTest\").show();\n $(\"#submitTest\").hide();\n }\n }", "function checkAnswers() {\n\n}", "function scoreAnswers(){}", "function results() {\n targetAnswer = triviaKey[questionCount].options[triviaKey[questionCount].answer];\n console.log(\"index of target: \" + triviaKey[questionCount].answer);\n console.log(\"target answer: \" + targetAnswer);\n console.log(\"results loaded\");\n // clear question, options and timer\n $(\"#question\").empty();\n $(\"#options\").empty();\n $(\"#timer\").empty();\n $(\"#result\").empty();\n\n // show results\n if (choice === triviaKey[questionCount].answer) {\n $('#result').html(\"You got it! The answer was <BR><BR>\" + targetAnswer);\n numAnsRight++;\n } else if (secsLeft < 1) {\n $('#result').html(\"Time's up! The answer was <BR><BR> \" + targetAnswer);\n numTimedOut++;\n } else {\n $('#result').html(\"Sorry, the answer was <BR><BR>\" + targetAnswer);\n numAnsWrong++;\n }\n\n // go to next question if there are more\n if (questionCount < triviaKey.length - 1) {\n questionCount++;\n secsLeft = 10;\n setTimeout(nextQuestion, 2000);\n }\n\n // finish game if no more questions\n else {\n secsLeft = 10;\n setTimeout(endGame, 2000);\n }\n }", "async computeResult(input, userData) {\n let replies = input.replies\n let wildcards = input.wildcards\n\n debug('resplies', replies, 'wildcards', wildcards)\n\n if (!replies) {\n return { confidence: 0, success: false }\n }\n\n let replyTemplate = Helper.selectRandom(replies)\n\n let ans = Formatting.fromStorage(\n {\n replyTemplate: replyTemplate,\n wildcards: wildcards,\n confidence: input.confidence,\n },\n userData\n )\n debug('ans', ans)\n return ans\n }", "onCompletion() {\n this.close();\n\n return this.answers;\n }", "onCompletion() {\n this.close();\n\n return this.answers;\n }", "function getResult(data) {\n $('#result-btn').on('click', function(e) {\n // gather all checked radio-button values\n var choices = $(\"input[type='radio']:checked\").map(function(i, radio) {\n return $(radio).val();\n }).toArray();\n\n // now you have an array of choices = [\"valueofradiobox1\", \"valueofradiobox2\", \"valueofradiobox2\"]\n // you'll need to do some calculations with this\n // a naive approachf would be to just choose the most common option - seems reasonable\n\n if (choices.length == data.questions.length){\n let outcome = (mode(choices));\n console.log(outcome);\n \n $(\"#full-phrase\").text(data.outcomes[outcome].text);\n $(\"#result-img\").attr(\"src\", data.outcomes[outcome].img);\n\n // from hardcoded html\n // $(\"#full-phrase\").text(getResultArray(mode(choices))[0]);\n // $(\"#result-img\").attr(\"src\", getResultArray(mode(choices))[1]);\n } else{\n console.log(\"?s answered: \" + choices.length);\n console.log(getResultArray(\"error\"));\n $(\"#full-phrase\").text(getResultArray(\"error\")[0]);\n }\n });\n}", "function processQuestionnaireResponse(session, results, questionnaireType, questionID, questionnaireID){\n\tconsole.log(\"Executing processQuestionnaireResponse()\");\n\tvar userResponse = results;\n\tvar botTimeFormatted = new Date(getBotMsgTime(session));\n\tvar userTimeFormatted = new Date(getUserMsgTime(session));\n\tvar timeLapseHMS = getTimeLapse(session);\n\n\tbuilder.LuisRecognizer.recognize(session.message.text, process.env.LUIS_MODEL_URL,\n\t\tfunction(err, intents, entities, compositeEntities){\n\t\t\tconsole.log(\"Now in LUIS Recognizer in processQuestionnaireResponse() function\");\n\t\t\tvar qScore = 0;\n\n\t\t\tconsole.log(\"Intents and confidence scores identified are:\");\n\t\t\tconsole.log(intents);\n\t\t\tconsole.log(\"Intent with highest certainty is:\");\n\t\t\tconsole.log(intents[0]);\n\t\t\tconsole.log(\"Entities identified are:\");\n\t\t\tconsole.log(entities);\n\n\t\t\tif(intents[0] != null && intents[0].intent == 'Days' && entities[0] !=null){\n\t\t\t\tconsole.log(\"Intent is \\'Days\\' and a relevant entity has been identified\");\n\t\t\t\tconsole.log(\"Highest confidence entity identified is:\"); \n\t\t\t\tconsole.log(entities[0]);\n\n\t\t\t\tvar entity = entities[0].type;\n\t\t\t\tconsole.log(\"Entity recognised is: %s\", entities[0].type);\n\n\t\t\t\tqScore = getScore(entity);\n\t\t\t\tconsole.log(\"individual question score is: \" + qScore);\n\n\t\t\t\ttotalScore+=getScore(entity);\n\t\t\t\tconsole.log(\"Total score after this question is %i\", totalScore);\n\t\t\t}else{\n\t\t\t\tconsole.log(\"One of the following occured: no intents identified; intent identified was not 'Days'; no entities were identified\");\n\t\t\t\tqScore = 0;\n\t\t\t}\n \n // the user response is added to the required tables\n\t\t\tinsertIntoUserResponses(userResponse)\n\t\t\t\t.then(function(interactionID){ \n\t\t\t\t\tinsertQuestionnaireResponseData(interactionID, botTimeFormatted, userTimeFormatted, timeLapseHMS, questionID, session.userData.userID, userResponse, questionnaireType, qScore, questionnaireID)\n\t\t\t\t\t\n\t\t\t\t})\n\t\t\t\t.catch(function(error){console.log(\"Error in insertIntoUserResponses() promise in processQuestionnaireResponse(). Now in catch statement. \" + error)});\n\t\t}\n\t);\n}", "function getResponse(handleResponse, handleError) {\r\n // reset the result textarea\r\n resultTextarea.value = \"\";\r\n var matches = handleResponse.results;\r\n\r\n for (var i = 0; i < matches.length; i++) {\r\n resultTextarea.value += matches[i];\r\n }\r\n \r\n if (matches.length == 0 || matches == undefined){\r\n matchesCount.innerText = \"No Matches Found\";\r\n } else {\r\n matchesCount.innerText = `${matches.length} match${ matches.length > 1 ? 'es' : '' } found`;\r\n }\r\n // store current values in the storage so user doesn't have to type again when he comes back to popup\r\n storeCurrent();\r\n }", "function handleAnswerNoScreen(res, app) {\n\n if (res.length == 0) {\n app.ask(addSpeak(\"<p><s>No offers matching your request.</s> <s>Do you want to ask something else ?</s>\"));\n } else if (res.length == 1) {\n app.ask(app.buildRichResponse()\n .addSimpleResponse(\"There is one offer matching your request. \\n\")\n .addSimpleResponse(tellOneOffer(app, res[0], true))\n )\n } else if (res.length > 1 && res.length <= 10) {\n app.ask(app.buildRichResponse()\n .addSimpleResponse(\"There several offers matching your request. \\n\")\n .addSimpleResponse(addSpeak('After every offer you can say next, select or quit'))\n .addSimpleResponse(tellOneOffer(app, res[0]))\n )\n }\n}", "function process() {\n while(parseInt(i) <= parseInt(answer)) { \n if(upCaseRslt === true) {\n upperCase();\n i += 1;\n if( parseInt(i) === parseInt(answer)){\n break;\n }\n }\n\n if(lcase === true) {\n lowerCase();\n i += 1;\n if( parseInt(i) === parseInt(answer)){\n break;\n }\n }\n\n if(numAnsr === true) {\n numbrs();\n i += 1;\n if( parseInt(i) === parseInt(answer)){\n break;\n }\n } \n\n if(symbolAnswer === true) {\n getNum();\n i += 1;\n if( parseInt(i) === parseInt(answer)){\n break;\n }\n }\n\n}\n}", "function Process_Results(description, response) {\n if (response == null) {\n response = {\"name\":\"\", \"email\":\"\", \"homezipcode\":\"\", \"workzipcode\":\"\", \t\t\t\t\"leavehome\":\"\",\"leavework\":\"\",\"waittime\":\"\",\"emptyseats\":\"\"};\n }\n var expected = Expected(description);\t\n var status = TestCompare(expected, response);\n var parms = { 'test-description': description, \n 'name-expected': expected.name,\n 'name-results': response.name,\n 'email-expected': expected.email,\n 'email-results': response.email,\n 'homezipcode-expected': expected.homezipcode,\n 'homezipcode-results': response.homezipcode,\n 'workzipcode-expected': expected.workzipcode,\n 'workzipcode-results': response.workzipcode,\n 'leavehome-expected': expected.leavehome,\n 'leavehome-results': response.leavehome,\n 'leavework-expected': expected.leavework,\n 'leavework-results': response.leavework,\n 'waittime-expected': expected.waittime,\n 'waittime-results': response.waittime,\n 'emptyseats-expected': expected.emptyseats,\n 'emptyseats-results': response.emptyseats,\n 'test-status': status };\n \n for (var parm in parms) {\n try { \n document.getElementById(parm).textContent = parms[parm];\n } catch(failed) {\n }\t\n }\t\n }", "function add_result( value ) {\n r.push(value.data);\n next_question();\n}", "function parseAnswer() {\n const nextQuestion = fetchQuestion();\n return nextQuestion.correctAnswer;\n }", "function properResponse(input) {\n if (input.value == jNodes[1].val[0]) {\n showSuccess(input);\n thePrompt.value = jNodes[2].val\n clearUserResponse()\n } else if (input.value == jNodes[3].val[0]) {\n showSuccess(input);\n thePrompt.value = jNodes[4].val\n clearUserResponse()\n }\n else {\n showError(input, 'WRONG-O');\n }\n}", "function returnCorrectAnswer(){\n const answers = array[global_index].answers \n for(var x = 0; x < answers.length; x++){\n if(answers[x].correct === true){\n correctAnswer = answers[x].text;\n }\n }\n return correctAnswer;\n }", "function executeQuiz(questions){\nvar result=0;\nObject.keys(questions).forEach((ques)=>{\n //Printing the question with options\n console.log(questions[ques].q);\n let id=1;\n questions[ques].op.forEach((op1)=>{console.log(id+'.'+op1);id++;});\n\n//Retreiving the answer \nlet answer=readLineSync.question();\nconsole.log(\"You selected option : \"+answer);\n \n//Function to retreive value from given options \nfunction getAnswer(){\n answer=readLineSync.question();\n}\n\n//Checking the answer if arbitrary value\nwhile(answer!=1 && answer!=2 && answer!=3 && answer!=4){\n console.log(\"Please choose any options from the above\\nGive option number as 1 or 2 or 3 or 4\");\n getAnswer();\n}\n\n//Displaying th result\n if(answer==questions[ques].ans){\n console.log(\"That's Right!\");\n result++;\n}else{\n console.log(\"That's Wrong answer!!! Correct option is :\"+questions[ques].ans);\n }\nreadLineSync.question(\"Press any Key to answer next question\");\nconsole.clear();\n});\n\nconsole.log(\"Hurray! You successfully completed the quiz\")\nconsole.log(\"You answered \"+result+\" questions correctly out of \"+Object.keys(questions).length);\nconsole.log(\"\\n\\n\\nWanna Work at big Tech Companies\");\nconsole.log(\"Checkout SDE Bootcamp at workat.tech\");\n}", "function askQuestions(){\n // yes/no question, correct answer, response to correct answer, response to wrong answer\n var ynQuestions = [['Do I live in Chicago?', 'NO', 'Right, I actually live in Seattle.', 'Nope, I call Seattle my home.'],\n ['Do I have any pets?', 'YES', 'I have two cats, in fact.', 'No, well I guess my two cats own me...'],\n ['Am I a blackbelt in karate?', 'NO', 'That is correct. No karate, just know kenjutsu.', 'I don\\'t know any karate, but I do know kenjutsu.'],\n ['Did I write a thesis about the rearrangement of a platinocyclobutane?', 'YES', 'Yep, watched atoms moving around on a screen.', 'Wrong. And yes, that is a word.'],\n ['Am I Megan?', 'YES', 'Yep, that\\'s my name!', 'Seriously?']];\n\n var userAns;\n var compAns;\n var question;\n var correctAns;\n var correctResp;\n var wrongResp;\n\n for (var ask = 0; ask < ynQuestions.length; ask++) {\n questionCount++;\n question = ynQuestions[ask][0];\n correctAns = ynQuestions[ask][1];\n correctResp = ynQuestions[ask][2];\n wrongResp = ynQuestions[ask][3];\n do {\n userAns = prompt(question);\n compAns = userAns;\n if (typeof compAns === 'string') {\n compAns = compAns.toUpperCase().trim();\n compAns = compAns === correctAns || compAns === correctAns[0];\n }\n console.log(question, 'user correct:', compAns);\n } while (typeof compAns != 'boolean');\n questionElements[ask].innerHTML += '<span class=\"answer\">' + userAns + '</span>';\n if (compAns) {\n alert(correctResp);\n correctCount++;\n questionElements[ask].innerHTML += '<span class=\"correct\">&#9711;</span>';\n } else {\n alert(wrongResp);\n questionElements[ask].innerHTML += '<span class=\"wrong\">&#9747;</span>';\n }\n }\n console.log('correct y/n answers:', correctCount);\n\n }", "function format(responses, input){\n\n\t// parse string return to json hash \n\tvar hash = JSON.parse(responses)\n\n\t// depending on the return json display results or no results\n\tresult = hash.length === 0 ? noResults(input) : viewResults(hash);\n\n\t// display results to html for all to see!\n\tdocument.getElementById(\"print_result\").innerHTML = result;\n\tdocument.getElementById(\"footer\").style.display = 'block';\n\n\tloading = false;\n}", "function check_response3(id_val){\n // Get Question mark image i.e tick and cancel images respectively\n let Q_img = document.querySelector(\"#\"+id_val+ \" img\");\n\n // Logic to check questions 1 to question 4.\n\tif (id_val === \"Q1\" || id_val === \"Q2\" || id_val === \"Q3\" || id_val === \"Q4\") {\n\t // Get response value\n\t let response = document.getElementById(question_answer2[id_val][1]);\n\t console.log(response.value);\n\n\t // Check if response is not blank\n if (response.value === \"\"){\n alert(\"Fill in the answer before submitting\");\n return;\n }\n\n // Check if answer is correct\n else if (response.value === question_answer2[id_val][0]){\n generate_correct(id_val);\n Q_img.src = \"Images/tick.png\";\n correct_ans2++;\n }\n\n // Check if answer is wrong and generate feedback\n else if (response.value !== question_answer2[id_val][0]){\n generate_wrong(id_val, question_answer2);\n }\n\t}\n\n\t// Logic to check question 5 and 6\n else if (id_val === 'Q5' || id_val === 'Q6') {\n // Get input tag\n let curr_question = question_answer2[id_val][1];\n\n // Get all the checked values in that question\n let curr_question_val = document.querySelectorAll('input[name=\"'+curr_question+'\"]:checked');\n\n // Check if the value is not blank\n if (curr_question_val[0] == null){\n alert(\"Fill in the answer before submitting\");\n return;\n }\n\n // Check if the correct answers were provided\n else{\n // Check if the number of selected answers is equal to the number of actual answers\n if (curr_question_val.length === question_answer2[id_val][0].length) {\n for (let i = 0; i < curr_question_val.length ; i++) {\n\n // Check if there is a wrong answer in the selected answers\n if (curr_question_val[i].value !== question_answer2[id_val][0][i]){\n // Generate feedback for incorrect response\n generate_wrong(id_val, question_answer2);\n // return;\n }\n\n }\n // Generate feedback for correct response\n generate_correct(id_val);\n Q_img.src = \"Images/tick.png\";\n correct_ans2++;\n }\n\n // Generate feedback for incorrect responses\n else {\n generate_wrong(id_val, question_answer2)\n }\n\n }\n }\n // Increase the number of questions answered\n Q_2_ans2++;\n\n // Disable the submit button\n document.querySelector(\"#\" + id_val + \" .button2\").disabled = true;\n document.querySelector(\"#\" + id_val + \" .button2\").style.backgroundColor = \"#c7c7c7\";\n\n // Display image if correct or wrong\n Q_img.style.display = \"block\";\n\n // Display the result tab if all questions have been answered.\n if (Q_2_ans2 === 6) {\n display_result(correct_ans2);\n }\n}", "async function getAnswer(answers) {\n\tlet result = '';\n\tif (answers.other_id) { // multiple choice (other + description)\n\t\t// const aux = {};\taux[answers[0].other_id] = `<outros>${answers[0].text}`;\n\t\tresult = `<outros>${answers.text}`; // add <outros> to signal user choosing outros option\n\t} else if (answers.text) { // text/comment box\n\t\tresult = answers.text;\n\t} else if (answers.choice_id) { // multiple choice (regular) / dropdown\n\t\tresult = answers.choice_id;\n\t} return result;\n}", "function processInput() {\n // If we have input, use it to answer the current question\n var responseLength = surveyResponse.responses.length\n var currentQuestion = surveyData[responseLength];\n\n // if there's a problem with the input, we can re-ask the same question\n function reask() {\n cb.call(surveyResponse, null, surveyResponse, responseLength);\n }\n\n // If we have no input, ask the current question again\n if (!input) return reask();\n\n // Otherwise use the input to answer the current question\n var questionResponse = {};\n if (currentQuestion.type === 'boolean') {\n // Anything other than '1' or 'yes' is a false\n var isTrue = input === '1' || input.toLowerCase() === 'yes';\n questionResponse.answer = isTrue;\n } else if (currentQuestion.type === 'number') {\n // Try and cast to a Number\n var num = Number(input);\n if (isNaN(num)) {\n // don't update the survey response, return the same question\n return reask();\n } else {\n questionResponse.answer = num;\n }\n } else if(currentQuestion.type === 'text') {\n // input is a recording URL\n \n console.log('INPUT var is - '+JSON.stringify(input))\n // save the twilio recording to google bucket here such that it can be extracted by google speech later\n console.log('Before Speech to Text')\n console.log('Args - '+ JSON.stringify(args))\n\n // experiment \n questionResponse.recordingUrl = input;\n questionResponse.twilioanswer = input;\n \n // questionResponse.gcloudObj = 'gs://gspeech_api/REfbc3e8204b9ec865409e7c740a67a000';\n // Save type from question\n //questionResponse.type = currentQuestion.type;\n\n if(currentQuestion.text === 'State the amount to transfer ?'){\n web3.eth.getAccounts(function(err,accs){\n if(!err){\n\n \n console.log('Fetched accounts from localhost - '+accs)\n\n web3.eth.defaultAccount= accs[0];\n\n web3.eth.sendTransaction({\n from: accs[0],\n to: accs[1],\n value: web3.toWei('1')\n }, function(err,data){\n console.log('TX HASH - '+data)\n questionResponse.TxHash = data;\n surveyResponse.responses.push(questionResponse);\n\n // If new responses length is the length of survey, mark as done\n if (surveyResponse.responses.length === surveyData.length) {\n surveyResponse.complete = true;\n }\n console.log('Before Save')\n // Save response\n surveyResponse.save(function(err) {\n if (err) {\n reask();\n } else {\n cb.call(surveyResponse, err, surveyResponse, responseLength+1);\n }\n });\n })\n \n }\n else{\n console.log('Error getting the accounts from testrpc - '+err)\n \n }\n\n \n })\n } // only for question 3 perform blockchain Tx amd save the data\n\n if(currentQuestion.text !== 'State the amount to transfer ?'){\n surveyResponse.responses.push(questionResponse);\n\n // If new responses length is the length of survey, mark as done\n if (surveyResponse.responses.length === surveyData.length) {\n surveyResponse.complete = true;\n }\n\n // Save response\n surveyResponse.save(function(err) {\n if (err) {\n reask();\n } else {\n cb.call(surveyResponse, err, surveyResponse, responseLength+1);\n }\n });\n } // for other questions just save the data\n \n } \n\n \n }", "function updateResponses() {\n\tvar responseForm = rightPane.querySelector('form[id=\"response-form\"]');\n\tvar name = responseForm.querySelector('input[type=\"text\"]');\n\tvar response = responseForm.querySelector('textarea[type=\"text\"]');\n\tif(name.value && response.value) {\n\t\tappendResponseToResponseList(name.value, response.value);\n\t\texpandQuestion();\n\t}\n }", "function result(){\n \n const ansContainers = quizContainer.querySelectorAll('.answers');\n const resultsContainer = quizContainer.querySelectorAll('.results');\n mCQquestions.forEach( (crrQuestion, qNumber) => {\n if(currentSlide === qNumber) {\n const container = ansContainers[qNumber];\n const selector = `input[name=question${qNumber}]:checked`;\n const userAnswer = (container.querySelector(selector) || {}).value;\n if(userAnswer === crrQuestion.correctAnswer){\n ansContainers[qNumber].style.color = 'lightgreen';\n resultsContainer[qNumber].innerHTML = 'Congratulation!!! Your answer is correct.';\n } else if(userAnswer === undefined) {\n ansContainers[qNumber].style.color = 'red';\n resultsContainer[qNumber].innerHTML = 'Please select an option!';\n } else {\n ansContainers[qNumber].style.color = 'red';\n resultsContainer[qNumber].innerHTML = 'Your answer is wrong !! ';\n }\n }\n });\n }", "function process_answer_submission() {\n var user_answer = given_answer();\n update_question_result(is_correct_answer(user_answer));\n document.getElementById(\"submitter\").style.visibility=\"hidden\";\n}", "function processReply(userInput){\r\n // console.log(userInput);\r\n var wordsInInput = userInput.split(\" \");\r\n var matchedIndex=-1;\r\n\r\n for(var i=0; i<wordsInInput.length; i++ ){\r\n //check in dictonary\r\n for(var j=0;j<dict.length;j++){\r\n if(dict[j].key.indexOf(wordsInInput[i]) > -1){\r\n //key found\r\n matchedIndex = j;\r\n }\r\n }\r\n }\r\n\r\n //get related response(phrase) according to the key\r\n if(matchedIndex === -1)\r\n {\r\n //no matchedIndex\r\n var notFoundMessages = [\"eee! Not sure what are you talking about!\", \"OOps! Help me understand please!\", \"Care to explain more?\"];\r\n var randomIndex = Math.floor(Math.random() * notFoundMessages.length);\r\n while (lastUsedNotFoundMessage == randomIndex) {\r\n randomIndex = Math.floor(Math.random() * notFoundMessages.length);\r\n }\r\n lastUsedNotFoundMessage = randomIndex;\r\n return notFoundMessages[randomIndex];\r\n\r\n }\r\n else{\r\n\r\n //get response for that key from dict.json\r\n var response = dict[matchedIndex].phrase;\r\n //req 3.a. remember response in the same session\r\n //checks for prev response history or if all the response are used then start afresh\r\n if (responseHistory.length == 0 || responseHistory[matchedIndex] == undefined || responseHistory[matchedIndex].length == response.length) {\r\n responseHistory[matchedIndex] = [];\r\n }\r\n //req 3.b. randomize response in sessions\r\n var randomIndex = Math.floor(Math.random() * response.length);\r\n while(responseHistory[matchedIndex].indexOf(randomIndex) > -1){\r\n randomIndex = Math.floor(Math.random() * response.length);\r\n }\r\n responseHistory[matchedIndex].push(randomIndex);\r\n return response[randomIndex];\r\n\r\n }\r\n\r\n\r\n}", "function processResponse(){\n //\n }", "function handleResponse() {\n $('.submit-btn').on('click', function (event){\n event.preventDefault();\n let userAnswer = $('input:checked').val();\n console.log(userAnswer);\n let correctAnswer = `${quiz[questionCount].correctAnswer}`;\n console.log(correctAnswer);\n\n // if (questionCount === 9) {\n // $('.qanda-disp').empty();\n // $('.timer').hide();\n // $('.response-feedback').text('Your score was: ' + score);\n // //display end-of-game img \n // }\n\n if (userAnswer === correctAnswer) {\n $('.qanda-disp').empty();\n $('.timer').hide();\n $('.response-feedback').text('You got it correct!');\n score++;\n timeToNextQ();\n //show img that correlates with answer\n // setTimeout(timeToNext, 1000 * 5);\n // nextQuestion();\n // handleQandA();\n } else {\n $('.qanda-disp').empty();\n $('.timer').hide();\n $('.response-feedback').text('You got it wrong. The answer was: ' + correctAnswer);\n timeToNextQ();\n //show img \n // setTimeout(timeToNext, 1000 * 5);\n // nextQuestion();\n // handleQandA();\n } \n });\n}", "function generateResults(){\n //grabs answer user selected, current question number, and correct answer\n let selected = $('input[type=radio]:checked', '#question-form').val();\n let allQuestions = store.questions;\n let currentQuestionNumber = store.questionNumber;\n let correct = Object.values(allQuestions)[currentQuestionNumber].correctAnswer;\n \n //determines which view to generate based on if users selected the correct answer. if so, increments the score. determines\n if (correct === selected && currentQuestionNumber < store.questions.length) {\n store.score++;\n return generateCorrectPage();\n }\n else if (correct !== selected && currentQuestionNumber < store.questions.length) {\n return generateWrongPage();\n }\n}", "function calcDistictAnswers(answers, question) {\n\n //Check if answers contains more than one submission and question is defined\n if (answers.length < 1 || question == undefined) {\n console.log(\"Error in calculating disctinct answers: No answers provided or question missing\")\n return;\n }\n\n //Prepare return object\n var result = new Array();\n\n if (question.questionType == \"multi-choice\") {\n //All submissions must have same amount of options\n var optionsLength = question.questionOptions.length;\n\n //Get correct answer\n var solution = new Array();\n for (var i = 0; i < optionsLength; i++) {\n if (question.questionType == \"multi-choice\") {\n solution.push(question.questionOptions[i].correct);\n } else {\n solution.push(question.questionOptions[i].text);\n }\n };\n console.log(solution);\n\n //Iterate over answers\n for (var i = 0; i < answers.length; i++) {\n //Check if answer has the correct amount of options\n if (answers[i].submission.length != optionsLength) {\n console.log(\"Error in calculating disctinct options: Multiple choice options differ in length. This can't be as every answer has to have the same length.\")\n }\n\n //Remember id answer is not part of results yet\n var newAnswer = true\n\n //Check if answer was seen before. If yes increase quantity, if no add to results.\n\n for (var j = 0; j < result.length; j++) {\n //Check if answer alreday exists in results and if yes increase quantity\n if (arrayEqual(result[j].submission, answers[i].submission)) {\n result[j].quantity++;\n newAnswer = false;\n break;\n }\n };\n //If still new anser add to reluts\n if (newAnswer) {\n\n //Check if new answer is correct\n var correct = arrayEqual(answers[i].submission, solution);\n\n //text for each dataset\n var optionText = \"\";\n //text that contains all selected answer option texts\n\n var selected = new Array();\n for (var k = 0; k < answers[i].submission.length; k++) {\n if (answers[i].submission[k] == true) {\n selected.push(question.questionOptions[k].text.trim());\n optionText = optionText + String.fromCharCode(65 + k) + \" \";\n }\n };\n\n if (question.questionType == \"multi-choice\") {\n optionText = optionText + \"- \" + selected.join(\", \");\n\n } else {\n console.log(\"Qswefrgth\");\n optionText = selected.join(\", \");\n }\n\n //push new answer to results\n result.push({\n submission : answers[i].submission,\n text : optionText,\n correct : correct,\n quantity : 1 //How often option was selected\n });\n }\n\n };\n }\n //Text questions\n else if (question.questionType = \"text-input\") {\n for (var i = 0; i < answers.length; i++) {\n //Test if answer is new, if no increase quantity in results\n var isNewAnswer = true;\n for (var j = 0; j < result.length; j++) {\n if (arrayEqual(result[j].submission, answers[i].submission)) {\n isNewAnswer = false;\n result[j].quantity++;\n }\n };\n\n //If new answer push to results\n if (isNewAnswer) {\n var newAnswer = {\n submission : answers[i].submission,\n text : answers[i].submission.join(),\n correct : false,\n quantity : 1 //How often option was selected\n }\n if (answers[i].correctness == 100) {\n newAnswer.correct = true;\n }\n result.push(newAnswer)\n }\n };\n }\n //Else (missing or unknown question type) log error\n //else{\n // console.log(\"Error in calculating disctinct options: question type is unknown or mission: \");\n // console.log(question.questionType)\n //}\n\n return result;\n}", "function processAnswer() {\r\n var answer = document.getElementById('answer');\r\n // if answer field is empty, do nothing\r\n if (answer.value == \"\") {\r\n return;\r\n }\r\n // increase score if correct\r\n addScore();\r\n checkSuccess();\r\n // take life if wrong\r\n takeLifeAway();\r\n // display gameover if lives = 0\r\n if(checkGameOver()) {\r\n hideGame();\r\n displayGameOver();\r\n }\r\n displayFactors();\r\n answer.value = \"\";\r\n}", "function getUserResponse(answer) {\n\tvar lastChar = answer[answer.length - 1];\n\tvar question;\n\tvar response;\n\tif (answer[answer.length - 1] == \"o\") {\n\t\tquestion = answer.substring(0, answer.length - 3);\n\t\tresponse = \"NO\";\n\t} else {\n\t\tquestion = answer.substring(0, answer.length - 4);\n\t\tresponse = \"YES\";\n\t}\n\treturn [question, response];\n}", "function checkAnswer(userAnswer) {\n if (yesResponseArray.includes(userAnswer.toLowerCase())) {\n console.log('Input equates to true');\n return true;\n } else if (noResponseArray.includes(userAnswer.toLowerCase())) {\n console.log('Input equates to false');\n return false;\n } else {\n console.log('Unrecognized');\n }\n return userAnswer;\n}", "function successPersonal(result) {\n\n self.LoadingSync(true);\n var answer_value;\n var answer_value_custom;\n\n $.each(result, function (key, val) {\n\n if (key == \"questions\") {\n\n $.each(val, function (index, value) {\n\n if (PERSONAL_RESPONSE_IDs.indexOf(value.id) > -1) {\n\n if ($.isArray(value.answer)) {\n $.each(value.answer, function (pos, answer) {\n answer_value = answer.value;\n answer_value_custom = answer[\"value-custom\"];\n });\n } else {\n answer_value = value.answer.value;\n }\n\n switch (value.id) {\n case AGE_RESPONSE_ID:\n self.Age(answer_value);\n break;\n case GENDER_RESPONSE_ID:\n self.Gender(answer_value_custom);\n break;\n case HEIGHT_RESPONSE_ID:\n var height = Number(answer_value) / 100;\n self.Height(height.toFixed(2));\n break;\n case WEIGHT_RESPONSE_ID:\n self.Weight(answer_value);\n break;\n default:\n break;\n }\n }\n });\n }\n });\n self.LoadingSync(false);\n }", "function processResponse(resp) {\n hideStatus();\n log('processResponse: ' + resp);\n\n // TBD...\n if (true) {\n let output = 'Success! Response:\\n\\n' + resp;\n if (opt_debugAlerts) { // Debugging\n alert(output);\n }\n let newOutput = parseResponse(resp);\n if (newOutput != \"\") { // TBD...\n alert(newOutput);\n }\n }\n }", "function interpret_questionnaire(content) {\n var name = content['name'];\n if (content.hasOwnProperty('get')) { // Answer to a get request\n if (content['quest'] === 'FINISHED') {\n QUESTS[name] = true;\n return;\n }\n } else if (content.hasOwnProperty('post')) { // Answer to post request\n if (content['result'] === 'OK') {\n printLog('Questionnaire \"' + name + '\" successfully submitted and accepted by the server!');\n // Run the callafter, delete the temporary quest, and mark it as done\n QUEST_CURRENT_TO_SEND.callafter();\n\n // Send the duration to the server\n //var duration = Math.floor((QUEST_CURRENT_TO_SEND.end_time - QUEST_CURRENT_TO_SEND.start_time) / 1000);\n //sendQuestionnaireDuration(name, duration);\n\n QUEST_CURRENT_TO_SEND = {};\n QUESTS[name] = true;\n } else if (content['quest'] === 'ERROR') {\n printLog('Some error occurred while sending the questionnaire \"' + name + '\" to the server. ' +\n 'Creating error dialog.');\n viewErrorOverlay($('<div></div>').load('views/dialogs/dia_questionnaire_post_error.html'));\n } else if (content['quest'] === 'FINISHED') {\n printLog('POST questionnaire was already FINISHED! Name: ' + content['name']);\n // Run the callafter, delete the temporary quest, and mark it as done\n QUEST_CURRENT_TO_SEND.callafter();\n QUEST_CURRENT_TO_SEND = {};\n QUESTS[name] = true;\n }\n } else {\n // Should not happen with current API implementation\n printLog('Neither GET nor POST in questionnaire answer. Ignore this thing: ' + JSON.stringify(content));\n }\n}", "function ventanaRespuesta_processResponse(res) {\n try {\n var info = eval('(' + res + ')');\n\n switch (info) {\n case -1:\n muestraVentana(mensajemenosuno);\n break;\n case 1:\n muestraVentana('Información almacenada correctamente');\n $.fancybox.close();\n listarCargos(1);\n idGlobal = \"-1\";\n break;\n case 2:\n muestraVentana('Información Actualizada correctamente');\n $.fancybox.close();\n listarCargos(1);\n idGlobal = \"-1\";\n break;\n case 3:\n muestraVentana('Información Eliminada correctamente');\n $.fancybox.close();\n listarCargos(1);\n idGlobal = \"-1\";\n break;\n case 4:\n muestraVentana('NO SE PUEDE BORRAR EL &Aacute;REA, HAY CARGOS');\n $.fancybox.close();\n listarCargos(1);\n idGlobal = \"-1\";\n break;\n\n }\n } catch (elError) {\n }\n}", "function checkAnswers(answers){\n var correctAns = model.transition(false);\n var result = []; var sum = 0;\n var allCorrect = 1;\n var error = {errorName:\"none\",badInputs:[]};//[error name, position that error was found]\n \n for (var i = 0; i < answers.length; i++){\n sum += answers[i];\n if(isNaN(answers[i])){\n error.errorName = \"nonnumber_error\";\n error.badInputs.push(i);\n }\n else if(answers[i] <0){\n error.errorName = \"negative_error\";\n error.badInputs.push(i);\n }\n if (round_number(answers[i],3) == round_number(correctAns[i],3)){\n result[i] = \"right\"; \n }\n else {result[i] = \"wrong\"; allCorrect = 0;}\n }\n result[answers.length] = allCorrect;\n if (round_number(sum,3) != round_number(1,3) && error.errorName==\"none\"){ error.errorName = \"sum_error\"; error.badInputs =[]}\n// else {result[answers.length+1] = \"sum_correct\";}\n \n result[answers.length+1] = error;\n return result;\n }", "function userResponse(answers) {\n switch (answers.action) {\n case \"Surprise Me!\":\n randomDisplay();\n break;\n\n case \"Display tweets\":\n tweetDisplay(\"CoderLi3\"); //Add limit?\n break;\n\n case \"Spotify a song\":\n spotifyDisplay(answers.userSong); //Add limit?\n break;\n\n case \"Search for a movie\":\n movieDisplay(answers.userMovie);\n break;\n\n default: //Not sure if I need this...\n console.log(\"Please make a valid choice!\")\n };\n\n}", "function handleAnswer() {\n\t\tif(correctAnswer != null) {\n\t\t\ttimeSinceSelection--;\n\t\t\tif(timeSinceSelection <= 0) {\n\t\t\t\tcorrectAnswer = null;\n\t\t\t\tfor(var i in lanes) {\n\t\t\t\t\tlanes[i].reset();\n\t\t\t\t}\n\t\t\t\tgenerateNewQuestion();\n\t\t\t}\n\t\t}\n\t}", "function displayAnswer(response) {\n var question = document.getElementById(\"question\").value;\n $('.answer').text(response[\"output\"][\"text\"][0]);\n}", "function prepareSurveyResults(survey) {\n resultsJSON = survey.data;\n\n let returnJSON = {};\n\n // Add a timestamp and prolific ID to the results.\n returnJSON.timestamp = getCurrentDateTime();\n returnJSON.prolificID = $(\"#submitted-prolific-pid\").val();\n returnJSON.studyId = studyId;\n\n returnJSON[\"informedConsent\"] = resultsJSON[\"informedConsent\"];\n\n // Parsing nested answers under SSOConsiderations\n if (resultsJSON[\"SSOConsiderations\"] !== undefined) {\n let SSOConsiderations = resultsJSON[\"SSOConsiderations\"];\n for (let i = 0; i < SSOKeyEnd; i++) {\n let currentKey = SSOTPKeys[i];\n returnJSON[currentKey] = SSOConsiderations[currentKey];\n }\n returnJSON[SSOTPKeys[SSOKeyEnd]] = resultsJSON[SSOTPKeys[SSOKeyEnd]];\n }\n\n // Parsing nested answers under TPConsiderations\n if (resultsJSON[\"TPConsiderations\"] !== undefined) {\n let TPConsiderations = resultsJSON[\"TPConsiderations\"];\n for (let i = SSOKeyEnd + 1; i < TPKeyEnd; i++) {\n let currentKey = SSOTPKeys[i];\n returnJSON[currentKey] = TPConsiderations[currentKey];\n }\n returnJSON[SSOTPKeys[TPKeyEnd]] = resultsJSON[SSOTPKeys[TPKeyEnd]];\n }\n\n // Parsing Apps Authorized Matrix\n let AppsAuthMat = resultsJSON[\"AppsAuthorizedMatrix\"];\n let AppsAuthMatRet = [];\n for (let key in AppsAuthMat) {\n let removeComment = resultsJSON[`Remove${key}Comment`];\n let retObj = { \"appName\": key, \"keep\": AppsAuthMat[key], \"reason\": removeComment };\n AppsAuthMatRet.push(retObj);\n }\n\n if (AppsAuthMatRet.length > 0) {\n returnJSON[\"AppsAuthMat\"] = AppsAuthMatRet;\n }\n\n // Parsing OldestApp data\n if (survey.currentPageNo > survey.getPageByName(\"OldestAppPage4\").visibleIndex && (oldestAppGlobal !== null && Object.keys(oldestAppGlobal).length !== 0)) {\n returnJSON[\"oldestApp\"] = appResultParser(resultsJSON, \"Oldest\");\n }\n if (survey.currentPageNo > survey.getPageByName(\"NewestAppPage4\").visibleIndex && (newestAppGlobal !== null && Object.keys(newestAppGlobal).length !== 0)) {\n returnJSON[\"newestApp\"] = appResultParser(resultsJSON, \"Newest\");\n }\n if (survey.currentPageNo > survey.getPageByName(\"RandomAppPage4\").visibleIndex && (randomAppGlobal !== null && Object.keys(randomAppGlobal).length !== 0)) {\n returnJSON[\"randomApp\"] = appResultParser(resultsJSON, \"Random\");\n }\n\n for (let i = 0; i < MiscKeys.length; i++) {\n let key = MiscKeys[i];\n if (resultsJSON[key] !== undefined) {\n returnJSON[key] = resultsJSON[key];\n }\n }\n\n // Add the uuid to the results.\n returnJSON.uuid = getCookieValueByName(uuidCookieName);\n\n returnJSON[\"extentionData\"] = {\n \"ssodata\": SSOGlobal,\n \"tpdata\": TPGlobal\n };\n\n return returnJSON;\n}", "function handler(answer) {\n\n // Processing a request for receiving messages\n if(isset(answer['getMessages'])){\n const messages = answer['getMessages'];\n messages.forEach((message) => {\n createMessage(message['id'], message['x'], message['y'], message['text']);\n })\n }\n}", "function getResponse(handleResponse, handleError) {\r\n try {\r\n var matches = handleResponse.results;\r\n if (handleResponse.selectedItemIndex > 0) {\r\n selectedItemIndex = handleResponse.selectedItemIndex\r\n storeCurrent();\r\n return\r\n }\r\n selectedItemIndex = handleResponse.selectedItemIndex\r\n // reset the result textarea\r\n if (selectedItemIndex <= 0) {\r\n resultTextarea.value = \"\";\r\n for (var i = 0; i < matches.length; i++) {\r\n resultTextarea.value += matches[i] + \"\\n\";\r\n }\r\n if (matches.length == 0 || matches == undefined) {\r\n matchesCount.innerText = \"No Matches Found\";\r\n } else {\r\n matchesCount.innerText = `${matches.length} match${matches.length > 1 ? 'es' : ''} found`;\r\n }\r\n }\r\n // store current values in the storage so user doesn't have to type again when he comes back to popup\r\n storeCurrent();\r\n }\r\n catch (ex) { \r\n window.eval(`console.error(ex)`);\r\n }\r\n }", "function processQuestion(tokens, senderID){\n console.log(\"processing question\");\n if(!tokens[3] === \"or\" || tokens.length != 6){\n return -1;\n }\n var player1 = tokens[1] + \" \" + tokens[2];\n var player2 = tokens[4] + \" \" + tokens[5].substring(0, tokens[5].length-1);\n\n console.log(\"player1: %s and player2: %s\", player1, player2);\n\n if(player1 == player2) return -2;\n\n //make sure both players exist in the players database\n var player1bool = playerBase.filter(function(obj){\n return obj.name == player1;\n }).length;\n var player2bool = playerBase.filter(function(obj){\n return obj.name == player2;\n }).length;\n\n //console.log(\"player1 length: %d, player2 length: %d\", player1bool, player2bool);\n\n if(!player1bool || !player2bool){\n console.log(\"couldn't find one of the players\");\n return -2;\n }\n\n //TODO====\n //query active questions, then retired questions for this pair\n //if from active, then add to askers array and server responses so far\n //else just serve responses, and rewrite retiredQuestions?\n var matching = PQ.filter(function(obj){\n return (obj.player1 == player1 && obj.player2 == player2)\n || (obj.player1 == player2 && obj.player2 == player1);\n });\n\n if(matching.length != 0){\n console.log(\"question already asked\");\n if(matching[0].askerID.indexOf(senderID) == -1){\n matching[0].askerID.push(senderID);\n\n } else {\n console.log(\"already attached to question\");\n return -3;\n }\n return matching[0];\n }\n/*\n var retiredQs = require('./retiredQuestions.json');\n\n var matching = retiredQs.filter(function(obj){\n return obj.player1 == player1 && obj.player2 == player2;\n return obj.player1 == player2 && obj.player2 == player1;\n });\n\n if(matching.length != 0){\n console.log(\"question already asked\");\n if(matching[0].askerID.indexOf(senderID) == -1){\n matching[0].askerID.push(senderID);\n\n } else {\n console.log(\"already attached to question\");\n return -3;\n }\n fs.writeFile('./retiredQuestions.json', JSON.stringify(retiredQs, null, 2), function(err){});\n return matching[0];\n }\n*/\n //at this point the question is legit and doesn't exist yet, so make it\n var newQuestion = makeNewQuestion(player1, player2, senderID);\n PQ.push(newQuestion);\n //pq simulation\n PQ.sort(function(a,b){\n return b.priority - a.priority;\n });\n //sort...\n return 1;\n\n}", "function submitAnswer(ans) {\n let result;\n if (ans === generateCorrectAnswer(STORE.questionNumber)) {\n result = correctAnswerHtml();\n\n\n } else {\n result = wrongAnswerHtml(ans);\n\n }\n generateCurrentScore();\n $('.test').html(result)\n $('.nextButton').on('click', function (event) {\n renderPage();\n });\n\n\n}", "exitMultiLineAnswer(ctx) {\n\t}", "function handleAnswers() {\n if(userAnswers[0] !== userAnswers[1]) {\n clearCards();\n clearAnswers();\n }\n else {\n addPoint();\n clearAnswers(true);\n }\n}", "function getAnswers(response) {\n const responses = response.getItemResponses();\n\n return {\n COMPANY_NAME: responses[0].getResponse(),\n CONTACT_PERSON: responses[1].getResponse(),\n WEBSITE_URL: responses[2].getResponse(),\n SLOGAN_TAGLINE: responses[3].getResponse(),\n ORGANIZATION_SUMMARY: responses[4].getResponse(),\n TARGET_AUDIENCE: responses[5].getResponse(),\n LIKED_WEBSITES: responses[6].getResponse(),\n DONT_LIKE: responses[7].getResponse(),\n KEYWORDS: responses[8].getResponse(),\n FUNCTIONALITIES: responses[9].getResponse(),\n COLOR_SCHEME: responses[10].getResponse(),\n FONTS: responses[11].getResponse(),\n CONTACT_FREQUENCY: responses[12].getResponse(),\n CONTACT_METHOD: responses[13].getResponse(),\n PROJECT_MANAGEMENT: responses[14].getResponse(),\n EMAIL: response.getRespondentEmail(),\n CLIENT_FOLDER_URL: createClientFolder(responses[0].getResponse()).getUrl(),\n WEBSITE_DEVELOPMENT_URL: getWebsiteDevelopmentURL(\n responses[0].getResponse()\n ),\n QUESTIONNAIRE_ANSWERS: formatQuestionsAndAnswers(responses),\n };\n}", "function resultOfTrivia() {\n\tif (question === 1) {\n\t\tresult1();\n\t}\n\telse if (question === 2) {\n\t\tresult2();\n\t}\n\telse if (question === 3) {\n\t\tresult3();\n\t}\n\telse if (question === 4) {\n\t\tresult4();\n\t}\n\telse if (question === 5) {\n\t\tresult5();\n\t}\n\telse if (question === 6) {\n\t\tresult6();\n\t}\n\telse if (question === 7) {\n\t\tresult7();\n\t}\n\telse if (question === 8) {\n\t\tresult8();\n\t}\n\telse if (question === 9) {\n\t\tresult9();\n\t}\n\telse if (question === 10) {\n\t\tresult10();\n\t}\n}", "function generateQuestionResultsForm(answer) {\n if (answer == store.questions[store.questionNumber].correctAnswer) {\n store.score += 1;\n $('#question-container').append(\n `<p class=\"reply\">Correct!</p>`\n );\n } else {\n $('#question-container').append(\n `<p class=\"reply\">Sorry, the correct answer is: ${store.questions[store.questionNumber].correctAnswer}</p>`\n );\n }\n}", "function correctResponse() {\n score += 1;\n questionNumber += 1;\n \n // Updates score\n scoreUpdate();\n \n // Checks if this is the final question and runs appropriate function\n if (questionNumber > questions.length) {\n isComplete();\n }\n}", "function processResponse(){\n for(var key in returnData){\n\n //collecting the data in ref to identifier\n var data = returnData[key+\"\"];\n\n //Splitting up the values to send through\n //to load images\n var newData = data.split(\",\");\n var img = newData[0];\n var panoVal = newData[1];\n var title = newData[2];\n var Direction = newData[3];\n\n if (Direction != \"\" && DirectionCount%2 == 1 || subCount == 5) {\n //Appending journey to the planner\n $( \"#journ\" ).append( \"<div id='pathDirection'>\"+ getIcon(Direction)+\" \"+ Direction +\"<div>\" );\n };\n\n if (subCount > 1) {\n //show preloader\n $('#journeyForm').hide();\n $('.pre-circle').show(0).delay(300).hide(0).promise().then(function(){\n $('.hide').delay(300).show('slow');\n $('#journ').delay(300).show('slow');\n subCount = 0;\n });\n // $('#journ').show(0).delay(500);\n };\n\n //Load the image into the overlay\n loadImage(img,panoVal,title);\n }\n\n }", "function results() {\n // Answer variables.\n correct = 0;\n incorrect = 0;\n unanswered = 0;\n\n for (var i = 1; i < 11; i++) {\n\n if ($(\"input[name='q\" + i + \"']:checked\").val() == \"x\") {\n\n correct++;\n } else if ($(\"input[name='q\" + i + \"']:checked\").val() === undefined) {\n\n unanswered++;\n } else {\n\n incorrect++;\n }\n\n // Display results and hide unwanted elements.\n \n $(\"#quiz\").hide();\n $(\"#whichState\").hide();\n $(\"#validate\").hide();\n $(\"#score\").html(\"Correct: \" + correct + \"<br/>Incorrect: \" + incorrect + \"<br/>Unanswered: \" + unanswered);\n $(\"#timer\").hide();\n $(\"#tally\").show();\n $(\"#clear\").show();\n $(\"#jack\").show();\n }\n\n }", "function return_new_answer() {\n return new_answer;\n }", "function processResult() {\n if (matchResult === 1) {\n winCounter++;\n return msg = 'WIN';\n } else if (matchResult === -1) {\n lossCounter++;\n return msg = 'LOSE';\n } else if (matchResult === 0) {\n drawCounter++;\n return msg = 'DRAW';\n }\n}", "function answer(msg) {\n if(matches(msg, pattern_1)) {\n return \"Well, yes \" + Dagdeel() + \"I'm all ear, fire away sport!\";\n\n } else if (matches(msg, pattern_3)) {\n return choice(aanhef) + choice(ow) + maybe(bijw) + choice(ww) + choice(wwneg) + choice(AV) + maybe(bijvnwneg) + choice(zlfstnw_antw3) + maybe(aanvul) + '.' + maybe(aanvul1)\n\n } else if (matches(msg, pattern_4)) {\n return choice(AVh) + choice(bijvnwneg) + choice(zlfstnw_antw4) + maybe(bijw) + choice(ww) + ' be' + choice(wwneglijd) + maybe(acc) + maybe(aanvul) + '.' + maybe(aanvul1)\n \n } else if (matches(msg, pattern_5)) {\n return choice(aanhef) + choice(ow) + maybe(bijw) + choice(ww) + choice(wwpos) + maybe(AV) + maybe(bijvnwpos) + choice(zlfstnw_antw5) + maybe(aanvul) + '.' + maybe(aanvul1)\n\n } else if (matches(msg, pattern_6)) {\n return choice(AVh) + maybe(bijvnwneg) + choice(zlfstnw_antw6) + maybe(bijw) + choice(ww) + ' be' + choice(wwneglijd) + maybe(acc) + '. There will be a wall' + maybe(aanvul) + '!'\n\n } else if (matches(msg, pattern_7)) {\n return choice(aanhef) + choice(ow) + maybe(bijw) + choice(ww) + choice(wwneg) + choice(AV) + maybe(bijvnwneg) + choice(zlfstnw_antw7) + maybe(aanvul) + '.' + maybe(aanvul1)\n\n } else if (matches(msg, pattern_8)) {\n return \"Don't get me started, yes,\" + choice(zlfstnw_antw8) + \". A sickning group indeed. But o well, let's\" + maybe(bijw) + choice(wwpos) + choice(AV) + maybe(bijvnwneg) + choice(zlfstnw_antw8) + \n \". No just kidding, just saying that so I don't look like a complete asshole... Which I am.\"\n \n } else if (matches(msg, pattern_2)) {\n return \"I'm doing amazing, really amazing indeed, thanks for asking.\"\n //Has to be the last one otherwise it'll respond to questions such as HOW DO YOU FEEL about immigrants?\n\n } else if (matches(msg, pattern_9)) {\n return \"You're done already? Great... Now fuck off!\"\n\n } else if (matches(msg, pattern_10)) {\n return \"Who cares what you think? Please continue.\"\n\n } else {\n return choice(default_answers);\n }\n}", "function showResults() {\n\n const answerContainers = quizContainer.querySelectorAll('.answers'); // finding all the possible answers from the quiz \n \n var answerArray = \"\";\n var countryToGoTo = \"\";\n var latlng = {};\n\n myQuestions.forEach((currentQuestion, questionNumber) => {\n\n const answerContainer = answerContainers[questionNumber]; \n const selector = `input[name=question${questionNumber}]:checked`; \n const userAnswer = (answerContainer.querySelector(selector) || {}).value; \n\n if (userAnswer === currentQuestion.correctAnswer) {\n console.log('true');\n answerArray = answerArray.concat('T');\n } else {\n console.log('false'); \n answerArray = answerArray.concat('F');\n }\n\n });\n\n console.log(answerArray);\n\n // Combination answers and countryToGoTo\n\n switch (answerArray) {\n case 'TTTTT':\n countryToGoTo = 'HAWAII';\n latlng = {\n lat: 19.8968,\n lng: -155.5828\n };\n break;\n case 'TTTTF':\n countryToGoTo = 'TENERIFE';\n latlng = {\n lat: 28.048906,\n lng: -16.711597\n };\n break;\n case 'TTTFT':\n countryToGoTo = 'SANTIAGO, CHILE';\n latlng = {\n lat: -33.459229,\n lng: -70.645348\n };\n break;\n case 'TTTFF':\n countryToGoTo = 'VALENCIA, SPAIN';\n latlng = {\n lat: 39.466667,\n lng: -0.375000\n };\n break;\n case 'TTFTT':\n countryToGoTo = 'LAOS';\n latlng = {\n lat: 19.8562698,\n lng: 102.4954987\n };\n break;\n case 'TTFTF':\n countryToGoTo = 'COLOMBIA';\n latlng = {\n lat: 3.900749,\n lng: -73.073215\n };\n break;\n case 'TTFFT':\n countryToGoTo = 'KUALA LUMPUR, MALAYSIA';\n latlng = {\n lat: 3.140853,\n lng: 101.693207\n };\n break;\n case 'TTFFF':\n countryToGoTo = 'TURKEY';\n latlng = {\n lat: 38.963745,\n lng: 35.243322\n };\n break;\n case 'TFTTT':\n countryToGoTo = 'QUEENSLAND, AUSTRALIA';\n latlng = {\n lat: -20.917574,\n lng: 142.702789\n };\n break;\n case 'TFTTF':\n countryToGoTo = 'BARBADOS';\n latlng = {\n lat: 13.193887,\n lng: -59.543198\n };\n break;\n case 'TFTFT':\n countryToGoTo = 'PORTUGAL';\n latlng = {\n lat: 38.736946,\n lng: -9.142685\n };\n break;\n case 'TFTFF':\n countryToGoTo = 'SEVILLE, SPAIN';\n latlng = {\n lat: 37.392529,\n lng: -5.994072\n };\n break;\n case 'TFFTT':\n countryToGoTo = 'NORTHERN PROVINCE, SRI LANKA';\n latlng = {\n lat: 9.6684504,\n lng: 80.0074234\n };\n break;\n case 'TFFTF':\n countryToGoTo = 'BORNEO';\n latlng = {\n lat: 3.354681,\n lng: 117.596543\n };\n break;\n case 'TFFFT':\n countryToGoTo = 'OMAN';\n latlng = {\n lat: 21.5125828,\n lng: 55.9232559\n };\n break;\n case 'TFFFF':\n countryToGoTo = 'KUWAIT';\n latlng = {\n lat: 29.3116608,\n lng: 47.4817657\n };\n break;\n case 'FTTTT':\n countryToGoTo = 'BRITISH COLUMBIA, CANADA';\n latlng = {\n lat: 49.246292,\n lng: -123.116226\n };\n break;\n case 'FTTTF':\n countryToGoTo = 'SWITZERLAND';\n latlng = {\n lat: 46.8181877,\n lng: 8.2275124\n };\n break;\n case 'FTTFT':\n countryToGoTo = 'VAL-D\\'SERE, FRANCE';\n latlng = {\n lat: 45.448032,\n lng: 6.980226\n };\n break;\n case 'FTTFF':\n countryToGoTo = 'ZURICH, SWITZERLAND';\n latlng = {\n lat: 47.3666687,\n lng: 8.5500002\n };\n break;\n case 'FTFTT':\n countryToGoTo = 'LIECHTENSTEIN';\n latlng = {\n lat: 47.1675,\n lng: 9.510530\n };\n break;\n case 'FTFTF':\n countryToGoTo = 'ULUGH MUZTAGH, CHINA';\n latlng = {\n lat: 36.40749837, \n lng: 87.383831798\n };\n break;\n case 'FTFFT':\n countryToGoTo = 'ULAAN BATAAR, MONGOLIA';\n latlng = {\n lat: 47.92123, \n lng: 106.918556\n };\n break;\n case 'FTFFF':\n countryToGoTo = 'FUJI, JAPAN';\n latlng = {\n lat: 35.360638,\n lng: 138.72905\n };\n break;\n case 'FFTTT':\n countryToGoTo = 'DENMARK';\n latlng = {\n lat: 55.676098,\n lng: 12.568337\n };\n break;\n case 'FFTTF':\n countryToGoTo = 'NEW FOREST, ENGLAND';\n latlng = {\n lat: 50.879, \n lng: -1.6330\n };\n break;\n case 'FFTFT':\n countryToGoTo = 'TORONTO, CANADA';\n latlng = {\n lat: 43.65107, \n lng: -79.347015\n };\n break;\n case 'FFTFF':\n countryToGoTo = 'NORTH POLE, ARCTIC';\n latlng = {\n lat: 64.751114, \n lng: -147.349442\n };\n break;\n case 'FFFTT':\n countryToGoTo = 'ICELAND';\n latlng = {\n lat: 64.128288,\n lng: -21.827774\n };\n break;\n case 'FFFTF':\n countryToGoTo = 'ESTONIA';\n latlng = {\n lat: 59.4369583, \n lng: 24.7535305\n };\n break;\n case 'FFFFT':\n countryToGoTo = 'FINLAND';\n latlng = {\n lat: 60.192059, \n lng: 24.945831\n };\n break;\n case 'FFFFF':\n countryToGoTo = 'MOSCOW, RUSSIA';\n latlng = {\n lat: 55.751244, \n lng: 37.618423\n };\n break;\n }\n\n initMap(latlng);\n\n resultsContainer.innerHTML = `${countryToGoTo}!`;\n\n }", "function generateAnswerResults(){\n let answerArray = store.currentQuestionState.answerArray;\n\n const buttons = {\n next: ' <button type=\"submit\" class=\"next-question\" autofocus>Next</button>',\n results: '<button type=\"submit\" class=\"see-results\" autofocus>See Results</button>'\n };\n\n let correctResponse = `\"${answerArray[1]}\" is correct`;\n let incorrectResponse = `${answerArray[2]} is not correct. The correct answer is\n \"${answerArray[1]}\"`;\n\n let isLastQuestion = (store.questionNumber + 1) === (store.questions.length);\n \n return `\n <div class=\"answer-response\">\n <form>\n <p>${answerArray[0] === true ? correctResponse : incorrectResponse}</p>\n <p> Score: ${store.score}</p>\n ${isLastQuestion ? buttons.results : buttons.next}\n </form>\n </div>\n `;\n}", "async getResult(phrase, userData, forget, explicit) {\n debug('Stepped into getResult with phrase', phrase)\n\n try {\n\n //debug('userData before standard result++++++++++++++', userData)\n let res = await this.standardResult(phrase, userData, explicit)\n //debug('userData after standard result---------------', userData)\n\n debug('returning from standard result')\n //debug(\"Before PhraseFrequencyData\")\n //Not totally sure why res.phrase would ever be undefined, but it is apparently.\n\n //causes untold problems\n /*if (this.statisticsFlag && res.phrase && !forget) {\n //debug('Adding PhraseFrequency Data')\n userData.phraseFrequency.addPhrase(res.phrase, res.confidence)\n \n debug('PhraseFrequency', userData.phraseFrequency)\n }*/\n\n //This generally means somebody is telling you some information\n if (res.dontRespond) {\n //Don't modify things further'\n return Promise.resolve(res)\n }\n\n debug('Add phrase', res)\n\n //If the confidence is low, just give it a failing grade\n //res.confidence = res.confidence ? res.confidence : 0.0;\n /*if (res.confidence < 0.2) {\n res.confidence = 0.0;\n res.success = false;\n }*/\n\n if (Helper.isFailResponse(res)) {\n res.response = Helper.selectRandom(Helper.defaultResponse)\n } else if (res.response == '') {\n //Reaches this point if '' was entered as the phrase (pressed enter)\n res.response = Helper.selectRandom(Helper.defaultResponse)\n }\n debug('Returning a good result', res)\n return res\n\n } catch (reason) {\n debug('Returning a bad result', reason)\n Logger.error(reason)\n let res = Helper.failResponse\n res.confidence = 0.0\n res.response = Helper.selectRandom(Helper.defaultResponse)\n return res\n }\n\n }", "function respA() {\n resp = \"A\";\n questionIndex++;\n gamelogic();\n muestrapregunta();\n}", "function getResponse(handleResponse, handleError) {\r\n try {\r\n var matches = handleResponse.results;\r\n if (handleResponse.selectedItemIndex != matches.length -1) {\r\n selectedItemIndex = handleResponse.selectedItemIndex;\r\n storeCurrent();\r\n return\r\n }\r\n selectedItemIndex = handleResponse.selectedItemIndex\r\n // reset the result textarea\r\n resultTextarea.value = \"\";\r\n for (var i = 0; i < matches.length; i++) {\r\n resultTextarea.value += matches[i] + \"\\n\";\r\n }\r\n if (matches.length == 0 || matches == undefined) {\r\n matchesCount.innerText = \"No Matches Found\";\r\n } else {\r\n matchesCount.innerText = `${matches.length} match${matches.length > 1 ? 'es' : ''} found`;\r\n }\r\n // store current values in the storage so user doesn't have to type again when he comes back to popup\r\n storeCurrent();\r\n }\r\n catch (ex) { \r\n window.eval(`console.error(ex)`);\r\n }\r\n }", "function checkAnswers (){\n \n // variables needed to hold results\n var correct = 0;\n var incorrect = 0;\n var unAnswered =0\n \n // for loop iterates through each question and passes the questions at each index first into\n // the isCorrect function to see if they match the indices of correct answers, and if they do,\n // increments up the correct score\n for (var i = 0; i<questions.length; i++) {\n if (isCorrect(questions[i])) {\n correct++;\n } else {\n // then this statement runs the questions at each index through the checkAnswered function\n // to determine whether the user clicked an answer, or did not click an answer, so that\n // incorrect and unAnswered scores can be delineated from each other\n if (checkAnswered(questions[i])) {\n incorrect++;\n } else {\n unAnswered++;\n }\n }\n \n }\n // display the results of the function in the results div and use strings of text to relate the\n // results of the for loop with their corresponding values\n $('#results').html('correct: '+correct+ \"<br>\" +'incorrect: '+incorrect+ \"<br>\" +'unanswered: '+unAnswered);\n }", "function handlePluginResponses(responses){\r\n\tlet sorted = responses.sort((a, b) => a.priority - b.priority);\r\n\tchainPromises(sorted.map(r => r.promise), result => {\r\n\t\tif(result.steam){\r\n\t\t\tthis.sayTo(\"steam\", result.message);\r\n\t\t}\r\n\t\tif(result.irc){\r\n\t\t\tthis.sayTo(\"irc\", result.message);\r\n\t\t}\r\n\t}, (err, index) => logErr(`error in plugin \"${sorted[index].name}\"`, err))\r\n}", "function processQWhichHaveYouUsed(questionObject) {\n\tvar answers = questionObject.answers;\n\tvar q;\n\n\tfor (var prop in answers) {\n\t\tvar questionAnswerPair = getUserResponse(prop);\n\t\tswitch(questionAnswerPair[0]) {\n\t\t\tcase \"ocp\":\n\t\t\t\tq = \"The pill or birth control pills (containing both an estrogen and progestin)\";\n\t\t\t\tbreak;\n\t\t\tcase \"ccap\":\n\t\t\t\tq = \"Cervical cap\";\n\t\t\t\tbreak;\n\t\t\tcase \"diaph\":\n\t\t\t\tq = \"Diaphragm\";\n\t\t\t\tbreak;\n\t\t\tcase \"sperm\":\n\t\t\t\tq = \"Vaginal spermicides (foam, film, gel, or suppositories)\";\n\t\t\t\tbreak;\n\t\t\tcase \"pop\":\n\t\t\t\tq = \"'Mini-pills' or progestin-only pills\";\n\t\t\t\tbreak;\n\t\t\tcase \"nuvaring\":\n\t\t\t\tq = \"NuvaRing, the vaginal contraceptive ring\";\n\t\t\t\tbreak;\n\t\t\tcase \"depo\":\n\t\t\t\tq = \"Depo-Provera, birth control injection\";\n\t\t\t\tbreak;\n\t\t\tcase\"nori\":\n\t\t\t\tq = \"Noristerat, birth control injection\";\n\t\t\t\tbreak;\n\t\t\tcase \"cyclomess\":\n\t\t\t\tq = \"Cyclofem or Mesigyna, birth control injection\";\n\t\t\t\tbreak;\n\t\t\tcase\"mcondom\":\n\t\t\t\tq = \"Male condom\";\n\t\t\t\tbreak;\n\t\t\tcase\"fcondom\":\n\t\t\t\tq = \"Female condom\";\n\t\t\t\tbreak;\n\t\t\tcase\"sponge\":\n\t\t\t\tq = \"Contraceptive sponge\";\n\t\t\t\tbreak;\n\t\t\tcase\"paragard\":\n\t\t\t\tq = \"Intrauterine Device or IUD (ParaGard, Mirena, or others)\";\n\t\t\t\tbreak;\n\t\t\tcase\"implanon\":\n\t\t\t\tq = \"Contraceptive implant (Norplant, Implanon, or others)\";\n\t\t\t\tbreak;\n\t\t\tcase\"withd\":\n\t\t\t\tq = \"Pulling out or withdrawal\";\n\t\t\t\tbreak;\n\t\t}\n\t\trenderHTML(q, questionAnswerPair[1]);\n\t\n\t}\n}", "processAnswers(line,parser) {\r\n if (line.startsWith(\"[\")) {\r\n this._processAnswerPattern(line, parser);\r\n parser._readNextLine();\r\n } else if (line.startsWith(\"@DifferentAnswer\")) {\r\n this._processDifferentAnswer(line,parser);\r\n } else if (line.startsWith(\"@AcceptAnswer\")) {\r\n this._processAcceptAnswer(line, parser);\r\n }\r\n }", "function renderResult() {\n\t$('section.questions-page').on('click', '.button', function(event){\n\t\t$('section.modal-page').removeClass('hidden');\n\t\t$('section.questions-page').addClass('modal-render');\n\t\tconst answerPicked = $(this).siblings('span').html();\n\t\tconst question1 = currentQuest();\n\t\tif (answerCheck(answerPicked)) {\n\t\t\t$('section.modal-page').html(`\n\t\t\t\t<header role=\"heading\" class=\"modal-page-header\">Correct</header>\n \t\t\t\t<img role=\"img\" src=\"https://media.giphy.com/media/xT0xeHxJS9SNIXw568/giphy.gif\" alt=\"gif of thousand ants making a 3 pointer\" class=\"img\">\n \t\t\t\t<button role=\"checkbox\" class=\"modal-page button\">Continue</button>\n\t\t\t`);\n\t\t\tcurrentStreak ++;\n\t\t\tcurrentCorrect ++;\n\t\t\tcurrentQuestion ++;\n\t\t}\n\t\t\n\t\telse {\n\t\t\t$('section.modal-page').html(`\n\t\t\t\t<header role=\"heading\" class=\"modal-page-header\">Incorrect</header>\n \t\t\t\t<img role=\"img\" src=\"https://media.giphy.com/media/xT0xekPgV0OgNfcbuw/giphy.gif\" alt=\"gif of morty scratching his head saying aww jezz okay\">\n \t\t\t\t<p role=\"status\"class=\"modal-page-para\">The correct answer was ${question1.correctAnswer}</p>\n \t\t\t\t<button role=\"checkbox\" class=\"modal-page button\">Continue</button>\n\t\t\t`);\n\t\t\tcurrentStreak = 0;\n\t\t\tcurrentQuestion ++;\n\t\t}\n\t});\n}", "function processQuestionAndAnswerObject(questionAndAnswerObject) {\n\tvar question = questionAndAnswerObject.question;\n\tif (haveSeenQuestion(question)) {\n\t\treturn;\n\t}\n\tswitch (question) {\n\t\t/* There is a bug where we have multiple redundant questions in the JSON file\n\t\tThis function call should handle it. If we see the same question twice, then \n\t\twe just return.\n\t\t*/\n\t\tcase \"qMostImportant\":\n\t\t\tdisplayContainer.insertAdjacentHTML('beforeend', \"<p>FIRST PAGE</p>\");\n\t\t\tprocessQMostImportant(questionAndAnswerObject);\n\t\t\thaveSeen.qMostImportant = true;\n\t\t\treturn;\n\t\tcase \"qRiskFactors\":\n\t\t\tdisplayContainer.insertAdjacentHTML('beforeend', \"<p>SECOND PAGE</p>\");\n\t\t\tprocessQRiskFactors(questionAndAnswerObject);\n\t\t\thaveSeen.qRiskFactors = true;\n\t\t\treturn;\n\t\t\t// If we say yes to the health problems, we then list out what the user inputted. The following does that\n\t\tcase \"qSeriousHealthProblems\":\n\t\t\thealthProblemsContainer.insertAdjacentHTML('beforeend', \"<p>HEALTH PROBLEMS</p>\");\n\t\t\tprocessQSeriousHealthProblems(questionAndAnswerObject);\n\t\t\thaveSeen.qSeriousHealthProblems = true;\n\t\t\treturn;\n\t\tcase \"qPeriodProblems\":\n\t\t\tdisplayContainer.insertAdjacentHTML('beforeend', \"<p>THIRD PAGE</p>\");\n\t\t\tprocessQPeriodProblems(questionAndAnswerObject);\n\t\t\thaveSeen.qPeriodProblems = true;\n\t\t\treturn;\n\t\tcase \"qWhichHaveYouUsed\":\n\t\t\tdisplayContainer.insertAdjacentHTML('beforeend', \"<p>FOURTH PAGE</p>\");\n\t\t\tprocessQWhichHaveYouUsed(questionAndAnswerObject);\n\t\t\thaveSeen.qWhichHaveYouUsed = true;\n\t\t\treturn;\n\t\t\t// Here we branch off if we encounter issues with contraceptives\n\t\tcase \"qMethodProblems/ocp\": // OCP means birth control pills\n\t\t\tcontraceptiveProblemsContainer.insertAdjacentHTML('beforeend', \"<p>BIRTH CONTROL ISSUES</p>\");\n\t\t\tprocessQMethodProblemsOCP(questionAndAnswerObject);\n\t\t\treturn;\n\t\tcase \"qMethodProblems/ccap\": // CCAP\n\t\t\tcontraceptiveProblemsContainer.insertAdjacentHTML('beforeend', \"<p>CCAP ISSUES</p>\");\n\t\t\tprocessQMethodProblemsCCAP(questionAndAnswerObject);\n\t\t\treturn;\n\t\tcase \"qMethodProblems/diaph\": // Diaphragm \n\t\t\tcontraceptiveProblemsContainer.insertAdjacentHTML('beforeend', \"<p>DIAPHGRAM ISSUES</p>\");\n\t\t\tprocessQMethodProblemsDiaph(questionAndAnswerObject);\n\t\t\treturn;\n\t\tcase \"qMethodProblems/sperm\": \n\t\t\tcontraceptiveProblemsContainer.insertAdjacentHTML('beforeend', \"<p>SPERM ISSUES</p>\");\n\t\t\tprocessQMethodProblemsSperm(questionAndAnswerObject);\n\t\t\treturn;\n\t\tcase \"qMethodProblems/pop\": // Mini pills\n\t\t\tcontraceptiveProblemsContainer.insertAdjacentHTML('beforeend', \"<p>MINI PILLS ISSUES</p>\");\n\t\t\tprocessQMethodProblemsPop(questionAndAnswerObject);\n\t\t\treturn;\n\t\tcase \"qMethodProblems/nuvaring\": //Nuva ring\n\t\t\tcontraceptiveProblemsContainer.insertAdjacentHTML('beforeend', \"<p>NUVA RING ISSUES</p>\");\n\t\t\tprocessQMethodProblemsNuvaring(questionAndAnswerObject);\n\t\t\treturn;\n\t\tcase \"qMethodProblems/depo\": // Depo\n\t\t\tcontraceptiveProblemsContainer.insertAdjacentHTML('beforeend', \"<p>DEPO ISSUES</p>\");\n\t\t\tprocessQMethodProblemsDepo(questionAndAnswerObject);\n\t\t\treturn;\n\t\tcase \"qMethodProblems/nori\": // Noristerat\n\t\t\tcontraceptiveProblemsContainer.insertAdjacentHTML('beforeend', \"<p>NORISTERAT ISSUES</p>\");\n\t\t\tprocessQMethodProblemsNori(questionAndAnswerObject);\n\t\t\treturn;\n\t\tcase \"qMethodProblems/cyclomess\": // Cyclomess\n\t\t\tcontraceptiveProblemsContainer.insertAdjacentHTML('beforeend', \"<p>CYCLOFEM AND MESSYGNA PROBLEMS</p>\");\n\t\t\tprocessQMethodProblemsCyclomess(questionAndAnswerObject);\n\t\t\treturn;\n\t\tcase \"qMethodProblems/mcondom\": // Male condom\n\t\t\tcontraceptiveProblemsContainer.insertAdjacentHTML('beforeend', \"<p>MALE CONDOM ISSUES</p>\");\n\t\t\tprocessQMethodProblemsMCondom(questionAndAnswerObject);\n\t\t\treturn;\n\t\tcase \"qMethodProblems/fcondom\": // Female condom\n\t\t\tcontraceptiveProblemsContainer.insertAdjacentHTML('beforeend', \"<p>FEMALE CONDOM ISSUES</p>\");\n\t\t\tprocessQMethodProblemsFCondom(questionAndAnswerObject);\n\t\t\treturn;\n\t\tcase \"qMethodProblems/sponge\": // Sponge\n\t\t\tcontraceptiveProblemsContainer.insertAdjacentHTML('beforeend', \"<p>SPONGE ISSUES</p>\");\n\t\t\tprocessQMethodProblemsSponge(questionAndAnswerObject);\n\t\t\treturn;\n\t\tcase \"qMethodProblems/paragard\": // Paragard\n\t\t\tcontraceptiveProblemsContainer.insertAdjacentHTML('beforeend', \"<p>PARAGARD ISSUES</p>\");\n\t\t\tprocessQMethodProblemsParagard(questionAndAnswerObject);\n\t\t\treturn;\n\t\tcase \"qMethodProblems/implanon\": // Implanon issues\n\t\t\tcontraceptiveProblemsContainer.insertAdjacentHTML('beforeend', \"<p>IMPLANON ISSUES</p>\");\n\t\t\tprocessQMethodProblemsImplanon(questionAndAnswerObject);\n\t\t\treturn;\n\t\tcase \"qMethodProblems/withd\": // Withdrawal\n\t\t\tcontraceptiveProblemsContainer.insertAdjacentHTML('beforeend', \"<p>WITHDRAWAL ISSUES</p>\");\n\t\t\tprocessQMethodProblemsWithdrawal(questionAndAnswerObject);\n\t\t\treturn;\n\t\tcase \"qOtherMedications\":\n\t\t\tdisplayContainer.insertAdjacentHTML('beforeend', \"<p>FIFTH PAGE</p>\");\n\t\t\tprocessQOtherMedications(questionAndAnswerObject);\n\t\t\thaveSeen.qOtherMedications = true;\n\t\t\treturn;\n\t\tcase \"qOtherHealthIssues\":\n\t\t\tdisplayContainer.insertAdjacentHTML('beforeend', \"<p>SIXTH PAGE</p>\");\n\t\t\tprocessQOtherHealthIssues(questionAndAnswerObject);\n\t\t\thaveSeen.qOtherHealthIssues = true;\n\t\t\treturn;\n\t\tcase \"qWhenHaveChildren\":\n\t\t\tdisplayContainer.insertAdjacentHTML('beforeend', \"<p>SEVENTH PAGE</p>\");\n\t\t\tprocessQWhenHaveChildren(questionAndAnswerObject);\n\t\t\thaveSeen.qWhenHaveChildren = true;\n\t\t\treturn;\n\t\tcase \"qOtherQuestions\":\n\t\t\tdisplayContainer.insertAdjacentHTML('beforeend', \"<p>EIGHTH PAGE</p>\");\n\t\t\tprocessQOtherQuestions(questionAndAnswerObject);\n\t\t\thaveSeen.qOtherQuestions = true;\n\t\t\treturn;\n\t\tcase \"qMethodSpecific\":\n\t\t\tdisplayContainer.insertAdjacentHTML('beforeend', \"<p>NINTH PAGE</p>\");\n\t\t\tprocessQMethodSpecific(questionAndAnswerObject);\n\t\t\thaveSeen.qMethodSpecific = true;\n\t\t\treturn;\n\t}\n}", "function DisplayResult(){\n\tanswers = answers.filter(function(e){return e});\n\t$(\"#content\").html('');\n\t$(\"#content\").append(\"<div class='page-header'><h1>\"+Language[\"Analysis\"]+\"</h1></div>\");\n\t$(\"#content\").append(\"<ul id='answerpanel'></ul>\");\n\tvar noAnswersGiven = 0;\n\tfor (var i = 0; i < answers.length;i++){\n\t\tvar text = \"\";\n\t\tif (answers[i].SelectedAnswer == null){\n\t\t\ttext =\"<b>\"+Language[\"NoAnswer\"]+\"</b>\";\n\t\t\tnoAnswersGiven++;\n\t\t}else\n\t\t\ttext = answers[i].SelectedAnswer.Text;\n\t\t$(\"#answerpanel\").append(\"<li>\"+answers[i].Question+\": \" + text+ \"</li>\");\n\t}\t\n\t\n\tif (noAnswersGiven == answers.length){\n\t\t$(\"#content\").append(\"<div class=\\\"alert alert-danger\\\" role=\\\"alert\\\">\"+Language[\"NoAnswersWarning\"]+\"</div\");\n\t}\n\t$(\"#content\").append(\"<a id =\\\"backToLastQuestion\\\" class='btn btn-primary btn-lg' role='button'>Zurück</a>\");\n\t$(\"#backToLastQuestion\").click(function(){\n\t\t$(\"#answerpanel\").fadeOut(function(){\n\t\t\t\t$(\"#answerpanel\").remove();\n\t\t\t\t$(\"#content\").append(\"<div id='answerpanel'></div>\"); \t\t\t\t\n\t\t\t\tLoadQuestion(--lastAnsweredQuestion.Id);\t\n \t\t});\n\t});\n\tif (noAnswersGiven != answers.length)\n\t$(\"#content\").append(\"<a id='showDistros' class='btn btn-success btn-lg' role='button'>\"+Language[\"ShowResults\"]+\"</a>\");\n\t$(\"#showDistros\").click(function(){\n\t\tLoadDistributionByAnswer();\n\t});\n}", "function gotResult(error, results) {\r\n // If there is an error\r\n if (error) {\r\n console.error(error);\r\n return;\r\n }\r\n // The results are in an array ordered by confidence.\r\n\r\n label = results[0].label;\r\n conf = results[0].confidence\r\n // Classify again!\r\n classifyVideo();\r\n answerbtn.show()\r\n}", "function onAnswer(answer) {\n rl.pause();\n answer = answer || def || '';\n if (options) {\n return processOptions(answer)\n .then(resolve);\n } else {\n return resolve(answer);\n }\n }", "function processAnswer(finalTestData) {\n\tlet userAnswer = editor.getValue();\n\tlet finalTest = finalTestData.data.attributes.finalText;\n\n\tcheckAnswer(userAnswer, finalTest);\n}" ]
[ "0.70424396", "0.6909091", "0.6893842", "0.66537166", "0.6636547", "0.64825463", "0.6337962", "0.6301394", "0.6291362", "0.62783444", "0.6265152", "0.6256019", "0.62528723", "0.62388945", "0.6196289", "0.6033688", "0.60149693", "0.6010346", "0.59981894", "0.59913087", "0.59867257", "0.59840345", "0.59724313", "0.5959808", "0.59384304", "0.5936475", "0.59126735", "0.58864236", "0.58800524", "0.5878412", "0.58677995", "0.5857079", "0.5857079", "0.5854522", "0.58389944", "0.58288246", "0.58174366", "0.5801838", "0.5796603", "0.5793156", "0.5793101", "0.5788935", "0.5786807", "0.57831275", "0.57764155", "0.5775306", "0.57597464", "0.5749889", "0.57469594", "0.57418674", "0.5733867", "0.5732657", "0.57201636", "0.5715606", "0.5697966", "0.5685968", "0.5683421", "0.5658925", "0.5657916", "0.565688", "0.5656504", "0.5650245", "0.5649383", "0.5644429", "0.56411916", "0.56371534", "0.56275785", "0.5622968", "0.5622242", "0.56121784", "0.56071454", "0.56003547", "0.5593235", "0.5586672", "0.558582", "0.5581977", "0.5581755", "0.5577985", "0.55733925", "0.5568118", "0.55646694", "0.5564417", "0.5564158", "0.5558748", "0.5555107", "0.5554922", "0.5547339", "0.5545902", "0.5539258", "0.55390775", "0.55365556", "0.5533654", "0.5529905", "0.5529865", "0.5516562", "0.55163515", "0.55142826", "0.5511546", "0.55090576" ]
0.6168534
15
the string contains (ie. "All cows eat grass and moo" would return 8). Do not count y as a vowel for this challenge.
function VowelCount(str) { let count = 0; for (let i = 0; i < str.length; i++) { if (str[i] === 'a' || str[i] === 'e' || str[i] === 'i' || str[i] === 'o' || str[i] === 'u') { count++; } } return count; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCount(str) {\n return (str.match(/[aeiou]/ig)||[]).length;\n }", "function countVowelConsonant(str) {\n\n return str.split(\"\").reduce(function (accumulator, currentValue) {\n let i=2;\n if(\"aeiou\".indexOf(currentValue) != -1) i=1; \n return accumulator +i;\n }, 0);\n }", "function vowelCounter(string) {\n return string.match(/[aeiou]/ig).length\n}", "function getCount(test) {\r\n var vowelsCount = 0;\r\n let tempStr = test.split(\"\");\r\n let vowel = [\"a\",\"e\",\"i\",\"o\",\"u\"];\r\n for(let i = 0; i < str.length ; i++){\r\n for(let j = 0; j < str.length ; j++){\r\n if(tempStr[i].includes(vowel[j])){\r\n vowelsCount++;\r\n }\r\n }\r\n }\r\n \r\n return vowelsCount;\r\n }", "function getCount(str) {\n let vowelsRegex = /[a,e,i,o,u]/g\n let result = str.match(vowelsRegex)\n return result ? result.length : 0\n}", "function findVowels(string) {\n let vowels = \"AaEeIiOoUu\";\n let totalVowels = 0;\n for (i = 0; i < string.length; i++) {\n if (vowels.includes(string[i])) {\n totalVowels++;\n }\n }\n return totalVowels;\n}", "function getCount(str) {\n var vowelsCount = 0;\n if (str.match(/[(a)+(e)+(i)+(o)+(u)+]/g)){\n vowelsCount = str.match(/[(a)+(e)+(i)+(o)+(u)+]/g).length;\n }\n return vowelsCount;\n}", "function getCount4(str) {\n const vowels = {\n a: true,\n e: true,\n i: true,\n o: true,\n u: true\n };\n\n return str.split('').filter((currentLetter) => vowels[currentLetter]).length;\n}", "function whereIsE(str) {\n let count = 0;\n for (const char of str) {\n if (char === \"e\") {\n count++;\n }\n }\n return count;\n}", "function getCount(str) {\n var vowelsCount = 0;\n str.split(\"\").forEach(function(x){\n if(x == \"a\" | x == \"e\" | x == \"i\" | x == \"o\" | x == \"u\"){\n vowelsCount += 1;\n }\n }); \n return vowelsCount;\n}", "function getVowelCount(string){\n var count = 0;\n for (var i = 0; i < string.length; i++) {\n var character = string[i];\n if (character === 'a' || character === 'e' || character === 'i' || character === 'o' || character === 'u') {\n count++;\n }\n }\n return count;\n}", "function countVowels1(str) {\n\n\tlet sum = 0;\n\tlet letters = str.split('');\n\n\tfor (let i = 0; i < letters.length; i++) {\n\n\t\tconst l = letters[i];\n\n\t\tif (l === 'a' || l === 'e' || l === 'i' || l === 'o' || l === 'u') {\n\n\t\t\tsum++;\n\t\t}\n\t}\n\n\treturn sum;\n}", "function solve(s){\r\n const newS = s.split('');\r\n const vowels = ['a', 'e', 'i', 'o', 'u'];\r\n let testCounter = 0;\r\n let finalCounter = 0;\r\n \r\n for(let i = 0; i < newS.length; i++){\r\n if(vowels.includes(newS[i])) {\r\n testCounter++\r\n }\r\n else{\r\n if(testCounter > finalCounter) {\r\n finalCounter = testCounter;\r\n }\r\n testCounter = 0;\r\n }\r\n }\r\n return finalCounter;\r\n }", "function getCount(str) {\n var vowels = str.match(/[aeiouAEIOU]/gi);\n return vowels === null ? 0 : vowels.length;\n}", "function vowels(str) {\n const regex = /[aeiouAEIOU]/\n return [...str].reduce((acc, curr) => {\n curr.match(regex) ? acc += 1 : null\n return acc\n }, 0)\n}", "function countVowels2(string) {\n //create counter\n //create list of vowels array\n //for each char in str\n //if Vowels array contains char\n //increment counter\n //return counter\n \n var counter = 0;\n var vowels = [\"a\", \"e\", \"i\", \"o\", \"u\"];\n \n for (var char of string) {\n if (vowels.includes(char.toLowerCase())) {\n counter++;\n }\n }\n \n return counter;\n }", "function getNumberOfVowels(str) {\r\n // code ...\r\n return [...str].filter(function (letter) {\r\n return \"aąeęėiįoyuųū\".includes(letter.toLowerCase());\r\n }).length;\r\n\r\n // return Array.from(str).filter(letter => 'aąeęėiįoyuųū'.includes(letter)).length\r\n }", "function numOfVowels(string) {\n var m = string.match(/[aeiou]/gi);\n return m === null ? 0 : m.length;\n}", "function findOccurrences() {\n var str = \"Pleases read this application and give me gratuity\";\n var count = 0;\n let haveSeenVowel = false;\n \n for (const letter of str.toLowerCase()) {\n switch (letter) {\n case 'a':\n case 'e':\n case 'i':\n case 'o':\n case 'u':\n {\n if (haveSeenVowel) {\n count++;\n haveSeenVowel = false;\n } else {\n haveSeenVowel = true;\n }\n break;\n }\n default:\n haveSeenVowel = false\n }\n }\n \n return count\n }", "function getCount(str) {\n var vowelsCount = 0;\n \n const split = str.split(\"\") \n for (let i=0; i< split.length; i++){\n if(split[i] === 'a'|| split[i] ==='e'|| split[i] === 'i'|| split[i] === 'o'||\n split[i] === 'u') {\n vowelsCount+=1\n }\n }\n return vowelsCount;\n }", "function vowelCount(str) {\n var matches = str.match(/[aeiou]/gi);\n\n if(matches.includes(\"i\") ||matches.includes(\"o\") || matches.includes(\"a\") || matches.includes(\"e\") || matches.includes(\"u\") ){\n\n return matches.length;\n }else{\n\n return 0;\n }\n\n}", "subtractOneForE(aStr){\n let vowelsCount = this.countVows(aStr);\n if(aStr.endsWith('e')){\n vowelsCount --;\n }\n return vowelsCount;\n\n }", "function getCount(str) {\n let vowelsMatch = \"aeiou\";\n //this is your counter\n let vowelsCount = 0;\n //loop over the string that is passed in \n for (i=0; i < str.length; i++) {\n //loop over the vowels string to compare each index position against the string that was passed in to find any matches\n for (v=0; v < vowelsMatch.length; v++) {\n // if any 2 indexes are equal, add 1 to the vowel count\n if (str[i] === vowelsMatch[v]) {\n vowelsCount++;\n }\n }\n }\n return vowelsCount;\n }", "function countVowels(str) {\n let vowels = 'aeiouAEIOU';\n let count = 0;\n\n for (let i = 0; i < str.length; i++) {\n if (vowels.indexOf(str[i]) !== -1) {\n count += 1;\n }\n }\n\n return count;\n\n\n}", "function vowels2(str) {\n const matches = str.match(/[aeiou]/gi);//g is for continue the search and i is case-insensitive \n return matches ? matches.length : 0;\n}", "function countVowel(word) {\n word = word.match(/[aeiouAEIOU]/gi);\n return word.length;\n}", "function vowels(str) {\n const matches = str.match(/[aeiou]/gi);\n\n return matches ? matches.length : 0;\n}", "function vowelCount(str){\n var result = 0;\n str = str.split(\"\");\n str.forEach(function(letter){\n if(/[aeiou]/i.test(letter)){\n result ++;\n }\n });//end of forEach\n return result;\n}", "function getCount(str) {\n var vowelsCount = 0;\n\n // enter your majic here\n str.split('').map(function(x) {\n if(x == 'a' || x == 'e' || x == 'i' || x == 'o' || x == 'u') {\n vowelsCount++;\n }\n });\n\n return vowelsCount;\n }", "function findVowels(str) {\n str.toLowerCase();\n const inArr = str.split('');\n const vowels = inArr.filter(item => item === \"a\" || item === \"e\" || item === \"i\" || item === \"o\" || item === \"u\");\n return vowels.length;\n}", "function countYZ(string){\n var count = 0;\n string = string.toLowerCase();\n if(string.charAt(string.length - 1) === 'y' || string.charAt\n (string.length - 1) === 'z'){\n count ++;\n }\n for(var i = 0; i < string.length; i++){\n if(string[i] === ' ' && string[i - 1] === 'y'){\n count++;\n }\n if(string[i] === ' ' && string[i - 1] === 'z'){\n count++;\n }\n }\n return count;\n}", "function Vowels(str5) {\n var sliptString = str5.split(\"\");\n var vowels = [\"a\", \"e\", \"i\", \"o\", \"u\", \"y\"];\n return sliptString.reduce(function(acc, next) {\n if (vowels.indexOf(next) !== -1) {\n acc += 1;\n }\n return acc;\n }, 0)\n}", "function exOh(str) {\n\tlet xCount = str.match(/x/gi);\n\tlet oCount = str.match(/o/gi);\n\t// console.log(xCount);\n\treturn xCount.length === oCount.length ? true : false;\n}", "function countVowels(string)\n{\n\tvar count = 0;\n\tvar vowel ='aeiouAEIOU'\n\tfor(var i =0;i<string.length;i++)\n\t\t{\n\t\t\tif(vowel.indexOf(string[i]) !== -1)\n\t\t\t\t{\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\n\t\t}\n\treturn count\n}", "function getCount(str) {\n return str.toLowerCase().split('').filter(function(char) {\n return char == 'a' || char == 'e' || char == 'i' || char == 'o' || char == 'u';\n }).length;\n}", "function consonantCount(str) {\n return (str.replace(/[^a-z]/gi, '').match(/[^aeiou]/gi) || []).length;\n}", "subtractOneFConstVowel(aStr){\n let vowelCount = this.subtractOneForE(aStr);\n if(aStr.match(/aa|oo|ee|ii|uu/gi)){\n return vowelCount - aStr.match(/aa|oo|ee|ii|uu/gi).length\n }else{\n return vowelCount;\n }\n }", "function numOfApp(string) {\r\n var total = 0;\r\n for (var i = 0; i < string.length; i++) {\r\n if (string[i] === \"a\") {\r\n total++;\r\n }\r\n }\r\n return total;\r\n}", "function count(string) {\n let vowels = 0; \n let lowerCaseString = string.toLowerCase(); \n for (let i = 0; i < lowerCaseString.length; i++) {\n if (lowerCaseString[i] === 'a') {\n vowels = vowels +1; \n }else if (lowerCaseString[i] === 'e') {\n vowels = vowels +1; \n }else if (lowerCaseString[i] === 'i') {\n vowels = vowels +1; \n }else if (lowerCaseString[i] === 'o') {\n vowels = vowels +1; \n }else if (lowerCaseString[i] === 'u') {\n vowels = vowels +1; \n }\n }\n return vowels; \n}", "function absentVowel(x) {\n if (x.indexOf(\"a\") === -1) {\n return 0;\n } else if (x.indexOf(\"e\") === -1) {\n return 1;\n } else if (x.indexOf(\"i\") === -1) {\n return 2;\n } else if (x.indexOf(\"o\") === -1) {\n return 3;\n } else if (x.indexOf(\"u\") === -1) {\n return 4;\n }\n}", "function getCount(str) {\n const regex = /[aeiou]/g\n \n return str.match(regex) == null ? 0 : str.match(regex).length\n }", "function countVowelConsonant(str) {\n let count = 0\n for (let i = 0; i < str.length; i++) { // for each letter in the string, add 1 to count if the letter is a vowel.\n if (str[i] === \"a\" || str[i] === \"e\" || str[i] === \"i\" || str[i] === \"o\" || str[i] === \"u\") {\n count += 1\n } else { // if the letter is not a vowel, add 2 to count.\n count += 2\n }\n } return count\n }", "function countVowels(str){\n let vowelCount=0;\n for(let i=0; i<str.length; i++){\n if('AEIOUaeiou'.includes(str[i])){\n vowelCount++;\n }\n }\n return vowelCount;\n}", "function VowelCount(str) {\n const vowels = {\n a: true,\n e: true,\n i: true,\n o: true,\n u: true,\n };\n count = 0;\n for (let i = 0; i < str.length; i++) {\n if (vowels[str[i]]) {\n count++;\n }\n }\n return count;\n}", "function VowelCount(str) {\n\n // First, we Remove all characters in the string that aren't vowels with the .replace method.\n // Note that ^ in Regex means \"all characters not in the set\", so placing it in front of aeiou means \"Match everything that isn't a vowel\"\n // Enclosing a set in [] means that our string matches any individual character in that set\n // Ending with our /g tag signifies that we want to do a global search and lets our engine know to going through the entire string.\n str = str.replace(/[^aeiuo]/g, \"\");\n\n // Finally, we return the length of the string to \"count\" how many vowels are left.\n return str.length;\n}", "function getCount(str) {\n // regex:\n // 'g' tells to find all matches, not just the first.\n // 'i' tells to be case insensitive.\n // What goes inside the '//'' is the pattern.\n // '[]'' tells to match any character in a set.\n // 'aeiou' are the characters in the set.\n // because of the '^' the replace function removes everything that is NOT within the\n // regex statement\n // without it, the replace function would replace all of the vowels and return only\n // the other characters\n return str.replace(/[^aeiou]/gi, '')\n // then count the length of the remaining string\n .length;\n}", "function vowelCounter(string) {\n var vowelCount = 0;\n var input = string.toLowerCase();\n //loop throught string as an array\n for (var i=0; i < input.length; i++) {\n if (input[i] === 'a' || input[i] === 'e' || input[i] === 'i' || input[i] === 'o' || input[i] === 'u' ) {\n vowelCount++\n }\n }\n return vowelCount;\n }", "function getCount(str) {\n let vowelsCount = 0;\n for (current_char of str) {\n if (current_char === 'a' | current_char === 'e' | current_char === 'i' | current_char === 'o' | current_char === 'u') {\n vowelsCount++;\n }\n }\n return vowelsCount;\n }", "function outcomes_word_syllable(word) {\n\tif (word.length <= 3) {\n\t\treturn 1;\n\t}\n\tword = word.replace(/(?:[^laeiouy]es|ed|[^laeiouy]e)$/, '');\n\tword = word.replace(/^y/, '');\n\tvar a = word.match(/[aeiouy]{1,2}/g);\n\tif (a == null) {\n\t\t/* Long word with no vowels?? */\n\t\treturn 1;\n\t}\n\treturn a.length;\n}", "function vowel_count(str)\n{\n //code goes here\n}", "function getCount(str) {\n var vowelsCount = 0;\n\n let pos = {\n A : str.indexOf(\"a\"),\n E : str.indexOf(\"e\"),\n I : str.indexOf(\"i\"),\n O : str.indexOf(\"o\"),\n U : str.indexOf(\"u\")\n }\n\n while ( pos.A != -1 ) {\n vowelsCount++;\n pos.A = str.indexOf( \"a\", pos.A + 1 );\n }\n while ( pos.E != -1 ) {\n vowelsCount++;\n pos.E = str.indexOf( \"e\", pos.E + 1 );\n }\n while ( pos.I != -1 ) {\n vowelsCount++;\n pos.I = str.indexOf( \"i\", pos.I + 1 );\n }\n while ( pos.O != -1 ) {\n vowelsCount++;\n pos.O = str.indexOf( \"o\", pos.O + 1 );\n }\n while ( pos.U != -1 ) {\n vowelsCount++;\n pos.U = str.indexOf( \"u\", pos.U + 1 );\n }\n return vowelsCount;\n}", "function vowels2(str) {\n /* RegEx tips:\n g -> make sure we don't stop at the first match\n i -> case insensitive\n */\n const matches = str.match(/[aeiou]/gi)\n return matches ? matches.length : 0\n}", "function vowels(str) {\n let count = 0;\n let checker = \"aeiou\"; // or we have give it as an array = ['a','e','i','o','u'] \n for (let char of str.toLowerCase()) {\n if (checker.includes(char)) {\n count++\n }\n\n }\n return count;\n}", "function vowelsInString(vowelsWithin){\n let count = 0; //used to count the number of vowels that are insisde of the string\n let vowels = 'aeiou'; // going to be used to compare strings\n\n for (let i=0; i< vowelsWithin.length;i++){ // .length shows me all the characters in the string vowelWithin.\n if(vowels.indexOf(vowelsWithin[i].toLowerCase()) > -1) { // indexOf shows me the index number of the string and if the character is not found then it displays a -1, so all values greater than -1 will be within the string vowelWithin.\n count ++;\n }\n }\n return count;\n}", "function vowelCount(str) {\n const vowels = \"aeiou\";\n let counter = 0;\n for (i = 0; i < str.length; i++) {\n if (vowels.indexOf(str[i].toLowerCase()) > -1) {\n counter++;\n }\n }\n return counter;\n}", "function vowelCount(str) {\n\n // put all vowels from the string into an array\n var vowels = str.match(/[aeiou]/gi);\n\n // if there are no vowels in the string return 0\n // else return the length of the array containing the vowels\n return (vowels === null) ? 0 : vowels.length;\n\n}", "function findNumberOfVowels(mySentence) {\n const vowelList = [\"a\", \"e\", \"i\", \"o\", \"u\"];\n let currentVowelCount = 0; \n const arrayOfLetters = mySentence.toLowerCase().split(\"\"); \n \n for(let x = 0; x < arrayOfLetters.length; x++) {\n if (vowelList.includes(arrayOfLetters[x])) {\n currentVowelCount += 1; \n }\n }\n return currentVowelCount; \n}", "function hackerrankInString(s) {\n return s.match(/.*h.*a.*c.*k.*e.*r.*r.*a.*n.*k/) ? 'YES' : 'NO';\n}", "function howManyVowels (z){\n \n let vowelsQuantity = z.match(/[aeiou]/gi).length;\n return vowelsQuantity\n}", "function vowelCount( str ) {\n\tvar strArr = str.split('');\n\tvar counter = 0;\n\tfor ( var i = 0; i < strArr.length; i++ ) {\n\t\tif (\n\t\t\tstrArr[i] === \"a\" \n\t\t\t|| strArr[i] === \"e\" \n\t\t\t|| strArr[i] === \"i\" \n\t\t\t|| strArr[i] === \"o\" \n\t\t\t|| strArr[i] === \"u\" \n\t\t) {\n\t\t\tcounter++;\n\t\t}\n\t}\n\n\treturn counter;\n}", "function noOfOccurance(str) {\n\tvar count=0;\n\tfor(let i=0; i<str.length; ++i) {\n\t\tif(str[i]==\"m\") count++\n\t}\n\treturn count;\n}", "function findVowelsRegex(s){\n const matched = s.match(/[aeiou]/gi);\n return matched ? matched.length : 0;\n //if '.match()' finds no matches, it returns null, so we have to account for that and return zero instead\n }", "function countVowels(stringEntered) {\n let count = 0;\n for (let i = 0; i < stringEntered.length; i++) {\n if (\n stringEntered[i] === \"a\" ||\n stringEntered[i] === \"e\" ||\n stringEntered[i] === \"i\" ||\n stringEntered[i] === \"o\" ||\n stringEntered[i] === \"u\"\n )\n count++;\n }\n return count;\n}", "function countVowels(string2) {\n let match = string2.match(/[aeiou]|[AEIOU]/g);\n let output3 = `${match.length} vowels found`;\n console.log(output3); \n}", "function count(x, y){\n return (x.match(new RegExp(y, \"g\")) || []).length;\n }", "function reg(s) {\n let good = s.split(`\\n`).filter( e => {\n let bad = /ab|cd|pq|xy/g.test(e);\n let vowels = e.match(/[aeiou]/g) ? e.match(/[aeiou]/g).length : 0;\n let repeat = /(.)\\1{1}/g.test(e);\n return !bad && vowels >= 3 && repeat;\n }).length;\n console.log(good);\n}", "function getCount(str) {\n var vowelsCount = 0;\n var vowels = [\"a\",\"e\",\"i\",\"o\",\"u\"];\n for(var i = 0;i < str.length;i++){\n for(var j=0;j<vowels.length;j++){\n if(str[i] === vowels[j]){\n vowelsCount++;\n }\n }\n }\n \n return vowelsCount;\n }", "function getCount(str) {\n var vowelsCount = 0;\n var vowels = [\"a\",\"e\",\"i\",\"o\",\"u\"];\n for(var i = 0;i < str.length;i++){\n for(var j=0;j<vowels.length;j++){\n if(str[i] === vowels[j]){\n vowelsCount++;\n }\n }\n }\n \n return vowelsCount;\n }", "function countVowels(str) {\n const strLower = str.toLowerCase()\n const vowels = 'aeiou'\n let count = 0\n\n for (let i = 0; i < strLower.length; i++) {\n if (vowels.indexOf(strLower[i]) !== -1) {\n count += 1\n }\n }\n\n // console.log(count)\n return count\n}", "function countCode(string) { \n if (typeof string !== \"string\") {\n return \"You must provide a string as an argument\"\n }\n var splitStr = string.split('');\n let count = 0;\n for(let i = 0; i < splitStr.length -3; i++){\n if(splitStr[i] === \"c\" && splitStr[i+1] === \"o\" && splitStr[i+3] === \"e\"|| (splitStr[i].toUpperCase() && splitStr[i+1] === \"o\" && splitStr[i+3] === \"e\")){\n count +=1;\n }\n }\n return count;\n}", "function VowelCount(str) {\n var counter = 0;\n var vowels = \"aeiou\";\n\n //loop through every character in string\n for (var i = 0; i < str.length; i++) {\n //if vowel, increment counter\n if (vowels.indexOf(str[i]) !== -1) {\n counter++;\n }\n }\n\n return counter;\n}", "function exOh(str){\n let exCount = 0;\n let ohCount = 0;\n str.split(\"\").forEach(function(letter){\n letter === \"x\" ? exCount++ : ohCount++;\n })//end of forEach\n return exCount === ohCount ? true: false;\n}//end", "function vowels(str) {\n let counter = 0;\n for (let char of str.toLowerCase()) {\n if (char === \"a\" || char === \"e\" || char === \"i\" || char === \"o\" || char === \"u\") {\n counter++\n }\n }\n return counter\n}", "function vowels(str) {\n // split str into arr, all lowercased\n let arr = str.toLowerCase().split('')\n // set counter\n let counter = 0\n // loop thru arr\n // if element is vowel, counter++\n arr.forEach(char => {\n if (isVowel(char)) {\n counter++\n }\n })\n return counter\n}", "function findVowelIndex(str) {\n const re = /[aeiouy]/g;\n /*regular expression, the characters in the brackets\n are what you’re searching for, the “g” tells it to search the whole string.*/\n\n scrubString(str); //scrub whitespace and convert to lower case\n\n return string.search(re);\n /*this searches the string for characters that\n match the ones in the regex (vowels in this case), and stores the index\n number of the first match*/\n}", "function countVowels(word) {\n var vowelAmount = 0;\n var i = 0;\n for (i = 0; i < word.length; i++){\n if ( (word[i] === 'a') || (word[i] === 'e') || (word[i] === 'i') || (word[i] === 'o') || (word[i] === 'u') || (word[i] === 'y') ){\n vowelAmount++;\n }\n }\n return vowelAmount;\n}", "function vowels(str) {\n //match takes in regular expression that checks to see if what's passed in as arg matches str\n //returns arr of all matches found, if str has any char included between []\n //if no match found, will return null\n //2 options added to regex: g-> makes sure we don't stop at first match we find inside str; i-> \"case insensitive\"\n const matches = str.match(/[aeiou]/gi);\n return matches ? matches.length : 0;\n}", "function countVowels(string) {\n if (string.length === 0) {\n return 0;\n }\n if (string.slice(0, 1).toUpperCase() === \"A\" || string.slice(0, 1).toUpperCase() === \"E\" \n || string.slice(0, 1).toUpperCase() === \"I\" || string.slice(0, 1).toUpperCase() === \"O\" \n || string.slice(0, 1).toUpperCase() === \"U\") {\n return increment(countVowels(string.slice(1)));\n }\n return countVowels(string.slice(1))\n}", "function numVowels(string) {\n var counter = 0;\n var newString = string.toUpperCase();\n for (var i = 0; i < string.length; i++) {\n if ((newString[i] === 'A') ||\n (newString[i] === 'E') ||\n (newString[i] === 'I') ||\n (newString[i] === 'O') ||\n (newString[i] === 'U')) {\n counter++;\n }\n }\n return counter;\n}", "function count_vowels(word) {\n let vowels = 0;\n let i = 0;\n\n while (i < word.length) {\n let char = word[i];\n if (char == \"a\" || char == \"e\" || char == \"i\" || char == \"o\" || char == \"u\") {\n vowels++\n };\n i++\n };\n return vowels\n}", "function countvowels(text){\n var character = text.toLowerCase().split('')\n var vowels = 'aeiou';\n \n var countvowels = character.reduce(function(acc,current){\n return vowels.indexOf(current) > -1 ? acc + 1 : acc;\n },0);\n \n return countvowels;\n}", "function vowelCount(word) {\n let letters = word.split(\"\");\n let vowels = letters.filter(\n (letter) =>\n letter === \"a\" ||\n letter === \"e\" ||\n letter === \"i\" ||\n letter === \"o\" ||\n letter === \"u\"\n );\n return vowels.length;\n}", "function problem(str) {\n var vowels = ['a', 'e', 'i', 'o', 'u', 'y', 'A', 'E', 'I', 'O', 'U', 'Y'];\n var arr = str.split('');\n var indexes = [];\n for (var i = 0; i < arr.length; i++) {\n for (var j = 0; j < vowels.length; j++) {\n if (arr[i] === vowels[j]) {\n indexes.push(i + 1);\n }\n }\n }\n return indexes;\n}", "function countVowels(str)\r\n {\r\n for (var i = 0; i < str.length; i++)\r\n if (isVowel(str[i]))\r\n \r\n // Check for vowel\r\n console.log(str[i]);\r\n console.log(str);\r\n return str;\r\n }", "function ExOh(str) { \r\n\r\n // code goes here \r\n var count = 0;\r\n var result = false;\r\n for(var i = 0; i < str.length; i++){\r\n count = (str[i] == 'x') ? (count + 1) : (count - 1);\r\n }\r\n if(count === 0){\r\n result = true;\r\n }\r\n return result; \r\n \r\n}", "function vowelCounter(str) {\n var count = 0;\n for (var i = 0; i < str.length; i++) {\n var l = str.charAt(i).toLowerCase();\n if (l === 'a' || l === 'e' || l === 'i' || l === 'o' || l === 'u') {\n count++;\n }\n }\n return count;\n}", "function vowelCount(str) {\n let vowels = ['a', 'e', 'i', 'o', 'u'];\n let lowerCaseSplitStr = str.toLowerCase().split('');\n let count = 0;\n lowerCaseSplitStr.forEach((letter) => {\n if (vowels.includes(letter) === true) {\n count++;\n }\n });\n return count;\n}", "function ExOh(str) { \n\n \n var x = str.match(/[x]+/gi);\n var o = str.match(/[o]+/gi);\n \n if (o === null || x === null)\n {\n return false\n }\n else{\n x = x.join('').split('').length;\n o = o.join('').split('').length;\n \n if (x == o)\n return true\n else\n return false;\n \n }\n \n}", "function VowelCount(str) {\n var newStr = str.toLowerCase().split('');\n var vowelCounter = 0;\n for(var i = 0; i<newStr.length; i++) {\n if(newStr[i] === 'a' || newStr[i] === 'e' || newStr[i] === 'i' || newStr[i] === 'o' || newStr[i] === 'u')\n {vowelCounter += 1;}\n }\n return vowelCounter;\n}", "function numPY1(s) {\n return s.match(/p/ig).length == s.match(/y/ig).length\n}", "function vowelCounter(sentence){\n var vowels = 'AEIOUaeiou';\n var vowelCounter = 0;\n \n for(var x = 0; x < sentence.length ; x++)\n {\n if (vowels.indexOf(sentence[x]) !== -1)\n {\n vowelCounter += 1;\n }\n \n }\n return vowelCounter;\n}", "function oddSubstringsMS(str) {\n let count = 0;\n while (str.length > 0) {\n for (let i = 0; i < str.length; i++) {\n let currentNum = str.slice(0,i+1);\n if (/[13579]/.test(currentNum.substr(-1))) {count++;}\n }\n str = str.replace(/^./, '');\n }\n return count;\n}", "function countVowels(str){\n //Use .split method to break string apart into digestable bits for later.\n let splitString=str.split('');\n //Declare an object that will store the number of each vowel within.\n let numOfVowels={};\n //Declare a variable that identifies what vowels are.\n let vowels=\"aeiou\";\n \n //Use previous split string and apply .forEach to compare each letter of a string to the previously declared vowel variable\n splitString.forEach((letter)=>{\n //Declare if statement that uses .indexOf method to compare each element. Also use .toLowerCase to ensure nothing is missed.\n if(vowels.indexOf(letter.toLowerCase())!==-1){\n //If the vowel passes, add to object.\n if(letter in numOfVowels){\n numOfVowels[letter]++;\n //Otherwise, keep checking\n }else{\n numOfVowels[letter]=1;\n }\n } \n \n });\n //Return object\n return numOfVowels; \n }", "function findOccurrences(string) {\n\n var str = string;\n var res = str.match(/[aeiou]{2}/g);\n\n document.write(\"String: \" + str + \"<br>\")\n document.write(\"Count: \" + res.length + \"<br>\")\n document.write(\"Occurences are: \" + res)\n\n}", "function vowelCount(str1)\n{\n var vowels = 'aeiouAEIOU';\n var count = 0;\n\n for(var i = 0; i < str1.length ; i++)\n {\n if (vowels.indexOf(str1[i]) !== -1)\n {\n count += 1;\n }\n\n }\n return count;\n}", "function vowelCount(str) {\n var m = str.match(/[aeiou]/gi);\n return m === null ? 0 : m.length;\n }", "function vowels(str) {\n //create an array that will hold all Vowels\n const vowels = [];\n //convert the string into an array\n const string = str.toLowerCase();\n //find the vowels using regex\n let check = string.match(/[aeiou]/g);\n if (!check){\n //if nothing is found, return 0\n return 0;\n } else {\n for (var i = 0; i< check.length; i++){\n vowels.push(check[i]);\n }\n //else return the length of the array\n return vowels.length;\n }\n}", "function ExOh(str) { \n var numx= str.match(/x/gi);\n var numy=str.match(/o/gi);\n if (numx!==null && numy!==null) return numx.length == numy.length;\n else return false; \n}", "function vowelsAndConsonants(string) {\n let vowels = 0;\n let consonants = 0;\n\n for (let i = 0; i < string.length; i++) {\n if (string.charAt(i) === 'a' ||\n string.charAt(i) === 'e' ||\n string.charAt(i) === 'i' ||\n string.charAt(i) === 'o' ||\n string.charAt(i) === 'u') {\n vowels++;\n } else {\n consonants++;\n }\n }\n\n return 'Vowels: ' + vowels + ' Consonants: ' + consonants;\n}", "function vowelBonusScore(word) {\n \tword = word.toUpperCase();\n let points = 0;\n for(i=0; i<word.length; i++){\n if (word.slice(i, i+1)==='A' || word.slice(i, i+1)==='E'|| word.slice(i, i+1)==='I' || word.slice(i, i+1)==='O' || word.slice(i, i+1)==='U'){\n points = points + 3;\n }\n else {\n points = points + 1;\n }\n }\n //console.log(points);\n return points;\n}" ]
[ "0.6963035", "0.6923765", "0.69180024", "0.69065416", "0.68987006", "0.689386", "0.68740726", "0.68611586", "0.68381166", "0.68208677", "0.6783065", "0.67584926", "0.6738229", "0.6737461", "0.67345434", "0.6732355", "0.6732281", "0.67241216", "0.6693089", "0.66694736", "0.66670114", "0.6665005", "0.6662476", "0.66615814", "0.665939", "0.6645637", "0.6636945", "0.66297096", "0.6621089", "0.66107893", "0.66100484", "0.6609491", "0.65872234", "0.65846056", "0.6560147", "0.6559366", "0.6559171", "0.65534323", "0.6549936", "0.65440476", "0.65435123", "0.6542162", "0.6541457", "0.6518081", "0.6514793", "0.6514712", "0.6510614", "0.6493488", "0.64877796", "0.64707005", "0.6466917", "0.6460268", "0.64493215", "0.6446589", "0.6442175", "0.64416265", "0.64400315", "0.64367145", "0.6428693", "0.6424214", "0.6407238", "0.6397476", "0.63883185", "0.6388042", "0.63875866", "0.63836443", "0.6378547", "0.6378547", "0.6363055", "0.6350687", "0.63478297", "0.6347495", "0.6346967", "0.63461035", "0.6343574", "0.63420445", "0.63218904", "0.6317545", "0.63167304", "0.63157374", "0.63045555", "0.6304053", "0.63021356", "0.6299625", "0.6296898", "0.6295395", "0.6294828", "0.6294534", "0.62778205", "0.6275378", "0.6273548", "0.62726074", "0.62629855", "0.6249677", "0.6240814", "0.62378347", "0.6236542", "0.62337965", "0.6225832", "0.62116873" ]
0.64890075
48
draw matrix cells /////////////////////////////////////// set up offset array for buffer
function offset_function(_, i){ var x = -0.5 + ( Math.floor(i / num_cell) ) / num_cell ; var y = -0.5 + (i % num_cell) / num_cell ; return [x, y]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawMatrix(matrix, offset, Grid){ // offset used to move the block around // Grid used so i can use this function for both canvas\r\n matrix.forEach((row, y) => { // x and y here are the indexes\r\n row.forEach((value, x) => {\r\n if(value !== 0){\r\n Grid.fillStyle = colors[value];\r\n Grid.fillRect(x+offset.x, y+offset.y, 1, 1);\r\n }\r\n });\r\n });\r\n }", "function drawMatrix(matrix, offset) {\n matrix.forEach((row, y) => {\n row.forEach((val, x) => {\n if(val !== 0) {\n context.fillStyle = colors[val];\n context.fillRect(x + offset.x, y + offset.y, 1, 1);\n }\n });\n });\n}", "function draw_matrix(matrix, offset) {\n matrix.forEach((row, y) => {\n row.forEach((value, x) => {\n if(value !== 0) {\n context.fillStyle = colors[value];\n context.fillRect(x+offset.x, y+offset.y, 1, 1);\n }\n });\n });\n}", "function drawMatrix(matrix, offset) {\n matrix.forEach((row, y) => {\n row.forEach((value, x) => {\n if (value !== 0) {\n context.fillStyle = colors[value];\n context.fillRect(x + offset.x, y + offset.y, 1, 1);\n }\n });\n });\n}", "function drawMatrix(matrix, offset) {\n matrix.forEach((row, y) => {\n row.forEach((value, x) => {\n if(value !== 0) {\n context.fillStyle = colors[value];\n context.fillRect(x + offset.x, y + offset.y, 1, 1);\n }\n });\n });\n}", "function drawMatrix(matrix, offset) { // offset to move the figure later\n matrix.forEach((row, y) => {\n row.forEach((value, x) => {\n if (value !== 0) {\n context.fillStyle = colors[value];\n context.fillRect(x + offset.x,\n y + offset.y,\n 1, 1);\n }\n });\n });\n}", "drawMatrix() {\n fill(125);\n /* Background Square */ \n rect(this.xOffset, this.yOffset, this.lineEnd, this.lineEnd);\n\n /* Grid creation */ \n for (let i = 0; i < this.beatLength; i++) {\n let lineStart = (i * this.boxSize) + this.boxSize;\n\n /* Horizontal line */ \n line(this.xOffset, lineStart + this.yOffset,\n this.lineEnd + this.xOffset, lineStart + this.yOffset);\n\n /* Vertical line */ \n line(lineStart + this.xOffset, this.yOffset,\n lineStart + this.xOffset, this.lineEnd + this.yOffset);\n }\n\n /* On/Off Grid Squares */ \n for (let j = 0; j < pow(this.beatLength, 2); j++) {\n let toRowIndex = j % this.beatLength;\n let toColumnIndex = Math.floor(j / this.beatLength);\n\n fill(j, 255 / (2 / (j + 2)), j / 2)\n if (this.polyMatrix[toRowIndex][toColumnIndex] === 1) {\n this.noteRect = rect((toColumnIndex * this.boxSize) + this.xOffset,\n (toRowIndex * this.boxSize) + this.yOffset,\n this.boxSize, this.boxSize);\n }\n\n }\n\n }", "_draw(data) {\n let m, n, x, y, currentValue, newValue;\n const resolution = this.resolution;\n const matrix = this.matrix;\n const context = this.context;\n\n for (n = 0; n < this.height; n++) {\n for (m = 0; m < this.width; m++) {\n x = m * resolution;\n y = n * resolution;\n currentValue = matrix[n][m];\n newValue = data[n][m];\n if (newValue !== currentValue) {\n if (newValue === 1) {\n context.fillStyle = this.cellColor;\n context.fillRect(x, y, resolution, resolution);\n } else {\n context.clearRect(x, y, resolution, resolution);\n }\n }\n }\n }\n }", "update_offsets(){\r\n\t\tlet i, n, mat = new Mat4();\r\n\r\n\t\tfor( i=0; i < this.bones.length; i++ ){\r\n\t\t\tn = this.nodes[ i ];\r\n\t\t\tif( n.updated ){\r\n\t\t\t\tmat.from_mul( n.model_matrix, this.bind_pose[ i ] );\r\n\t\t\t\tthis.offset_buffer.set( mat, i*16 );\r\n\t\t\t}\r\n\t\t}\r\n\t}", "update() {\n let xpos = 0, ypos = 0;\n let i;\n this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);\n this.ctx.strokeStyle = \"#E0E0E0\";\n for (i = 0; i < this.cols*this.rows; i++) {\n if (i % this.cols === 0 && i !== 0) {\n ypos += this.cellSize;\n xpos = 0;\n }\n if (this.engine.getCellStateFromIndex(i) === 1) {\n this.ctx.fillRect(xpos, ypos, this.cellSize, this.cellSize);\n }\n if (this.cellSize > 5) {\n this.ctx.strokeRect(xpos, ypos, this.cellSize, this.cellSize);\n }\n xpos += this.cellSize;\n }\n }", "drawPixels() {\n this.cells.forEach((row, y) => {\n row.forEach((cell, x) => {\n this.drawPixel([y, x], cell);\n });\n });\n }", "draw () {\n for (var column = 0; column < this.numberOfColumns; column ++) {\n for (var row = 0; row < this.numberOfRows; row++) {\n this.cells[column][row].draw();\n }\n }\n }", "function color_starting_square(ctx, num_canvas_cells, x_offset, y_offset)\r\n{\r\n ctx.save( );\r\n ctx.fillStyle = 'black';\r\n\r\n // rect(the x cord in the upper left corner, the y cord of the upper left rect, width, height)\r\n ctx.rect(x_offset + ((Math.floor(num_canvas_cells / 2) - 1) * 5), y_offset, 5, 5);\r\n ctx.fill();\r\n ctx.restore( );\r\n}", "function drawMatrix(phrase) {\n\t// TODO: Draw the matrix based on the length of the\n}", "function init() {\n let y;\n let x;\n cells_data_matrix = new Array();\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n for (y = cell_radius; y < canvas.height; y += diamter) {\n const cell_array = new Array();\n for (x = cell_radius; x < canvas.width; x += diamter) {\n const cell_info = {\n x: x,\n y: y,\n alive: false\n };\n cell_array.push(cell_info);\n //drawCell(cell_info);\n }\n cells_data_matrix.push(cell_array);\n }\n if (random_option === true) {\n let random_number =\n Math.floor(Math.random() * (number_cells_inline * number_of_lines)) / 7;\n for (x = 0; x < random_number; x++) {\n const i = Math.floor(Math.random() * number_of_lines);\n const j = Math.floor(Math.random() * number_cells_inline);\n cells_data_matrix[i][j].i = i;\n cells_data_matrix[i][j].j = j;\n cells_data_matrix[i][j].alive = true;\n drawCell(cells_data_matrix[i][j]);\n }\n }\n}", "function drawCells() {\n currentGrid = board.getGrid();\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n drawBoard();\n ctx.beginPath();\n from_to(0, sidelength, 1, function (row) {\n from_to(0, sidelength, 1, function (col) {\n if (currentGrid[row][col]) {\n ctx.rect(cellside * col, cellside * row, cellside, cellside);\n }\n });\n });\n ctx.fillStyle = 'black';\n ctx.fill();\n}", "function mark_visited_cell( rx, ry) // wraps in x,y ifn.\n{\n console.log( \"(p5 mark_visited_cell \", rx, ry, \" )\" );\n let pix_ob = grid_to_pix( rx, ry );\n let ctx = g_p5_cnv.canvas.getContext( '2d' ); // get html toolbox to draw. \n\t\n\tctx.fillStyle = \"#cbaf87\";\t\n\tctx.fillRect(pix_ob.x, pix_ob.y,\n g_grid.cell_size - 1, g_grid.cell_size - 1);\n\n console.log( \"end (marked_visited_cell)\" );\n}", "function drawMatrixOnCanvas() {\n\tvar M = arguments[0];\n\tvar style = arguments[1];\n\t\n\tvar Rows = W.length;\n\tvar Cols = W[0].length;\n\t\n\tvar w = Math.floor(can.width / Cols);\n\tvar h = Math.floor(can.height / Rows);\n\t\n\tvar cx = can.getContext(\"2d\");\n\t\n\tvar strokeColor;\n\tvar fillColor;\n\tswitch(style) {\n\t\tcase 0:\n\t\t\tfor(var i = 0; i < Rows; i++) {\n\t\t\t\tfor(var j = 0; j < Cols; j++) {\n\t\t\t\t\tvar x = j * w;\n\t\t\t\t\tvar y = i * h;\n\t\t\t\t\tvar c = M[i][j];\n\t\t\t\t\tif(c > 2) console.log(c);\n\t\t\t\t\tstrokeColor = colors[c][0];\n\t\t\t\t\tfillColor = colors[c][1];\n\t\t\t\t\tif(c < 2) {\n\t\t\t\t\t\tcx.beginPath();\n\t\t\t\t\t\tcx.fillStyle = fillColor;\n\t\t\t\t\t\tcx.fillRect(x, y, w, h);\n\t\t\t\t\t\tcx.fill();\n\t\t\t\t\t\tcx.beginPath();\n\t\t\t\t\t\tcx.strokeStyle = strokeColor;\n\t\t\t\t\t\tcx.strokeRect(x, y, w, h);\n\t\t\t\t\t\tcx.stroke();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcx.fillStyle = fillColor;\n\t\t\t\t\t\tcx.fillRect(x, y, w, h);\n\t\t\t\t\t\tcx.stroke();\n\t\t\t\t\t\tcx.strokeStyle = strokeColor;\n\t\t\t\t\t\tcx.lineWidth = 1;\n\t\t\t\t\t\tcx.strokeRect(x+1, y+1, w-2, h-2);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\tbreak;\n\t\tcase 1:\n\t\t\tfor(var i = 0; i < Rows; i++) {\n\t\t\t\tfor(var j = 0; j < Cols; j++) {\n\t\t\t\t\tif(M[i][j] != 0) {\n\t\t\t\t\t\tvar x = j * w;\n\t\t\t\t\t\tvar y = i * h;\n\t\t\t\t\t\tvar Rx = 0.4 * w;\n\t\t\t\t\t\tvar Ry = 0.4 * h;\n\t\t\t\t\t\tvar xx = x + Rx;\n\t\t\t\t\t\tvar yy = y + Ry; \n\t\t\t\t\t\tvar c = M[i][j] + 2;\n\t\t\t\t\t\tstrokeColor = colors[c][0];\n\t\t\t\t\t\tfillColor = colors[c][1];\n\t\t\t\t\t\tcx.beginPath();\n\t\t\t\t\t\tcx.fillStyle = fillColor;\n\t\t\t\t\t\tcx.ellipse(xx, yy, Rx, Ry, 0, 2 * Math.PI, 0);\n\t\t\t\t\t\tcx.fill();\n\t\t\t\t\t\tcx.beginPath();\n\t\t\t\t\t\tcx.strokeStyle = strokeColor;\n\t\t\t\t\t\tcx.ellipse(xx, yy, Rx, Ry, 0, 2 * Math.PI, 0);\n\t\t\t\t\t\tcx.stroke();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\tbreak;\n\t\tcase 2:\n\t\t\tfor(var i = 0; i < Rows; i++) {\n\t\t\t\tfor(var j = 0; j < Cols; j++) {\n\t\t\t\t\tif(M[i][j] != 0) {\n\t\t\t\t\t\tvar x = j * w;\n\t\t\t\t\t\tvar y = i * h;\n\t\t\t\t\t\tvar Rx = 0.5 * w;\n\t\t\t\t\t\tvar Ry = 0.5 * h;\n\t\t\t\t\t\tvar xx = x + Rx;\n\t\t\t\t\t\tvar yy = y + Ry;\n\t\t\t\t\t\tvar theta = 90 - (M[i][j] - 1) * 45;\n\t\t\t\t\t\ttheta *= (Math.PI / 180);\n\t\t\t\t\t\tvar thetaL = 90 - (M[i][j] - 2) * 45;\n\t\t\t\t\t\tthetaL *= (Math.PI / 180);\n\t\t\t\t\t\tvar thetaR = 90 - (M[i][j] - 0) * 45;\n\t\t\t\t\t\tthetaR *= (Math.PI / 180);\n\t\t\t\t\t\tvar R = 0.45 * (Rx + Ry);\n\t\t\t\t\t\tvar dx = Math.round(R * Math.cos(theta));\n\t\t\t\t\t\tvar dy = Math.round(R * Math.sin(theta));\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar dxL = Math.round(0.5 * R * Math.cos(thetaL));\n\t\t\t\t\t\tvar dyL = Math.round(0.5 * R * Math.sin(thetaL));\n\t\t\t\t\t\tvar dxR = Math.round(0.5 * R * Math.cos(thetaR));\n\t\t\t\t\t\tvar dyR = Math.round(0.5 * R * Math.sin(thetaR));\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar c = 6;\n\t\t\t\t\t\tstrokeColor = colors[c][0];\n\t\t\t\t\t\tfillColor = colors[c][1];\n\t\t\t\t\t\tcx.beginPath();\n\t\t\t\t\t\tcx.lineWidth = 1;\n\t\t\t\t\t\tcx.strokeStyle = strokeColor;\n\t\t\t\t\t\tcx.moveTo(xx, yy);\n\t\t\t\t\t\tcx.lineTo(xx + dx, yy - dy);\n\t\t\t\t\t\tcx.stroke();\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Draw arrow head\n\t\t\t\t\t\t/*\n\t\t\t\t\t\tcx.beginPath();\n\t\t\t\t\t\tcx.moveTo(xx + dx, yy - dy);\n\t\t\t\t\t\tcx.lineTo(xx + dxL, yy - dyL);\n\t\t\t\t\t\tcx.moveTo(xx + dx, yy - dy);\n\t\t\t\t\t\tcx.lineTo(xx + dxR, yy - dyR);\n\t\t\t\t\t\tcx.stroke();\n\t\t\t\t\t\t*/\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Draw dot in replacement of arrow head\n\t\t\t\t\t\t/**/\n\t\t\t\t\t\tcx.beginPath();\n\t\t\t\t\t\tcx.fillStyle = fillColor;\n\t\t\t\t\t\tcx.arc(xx + dx, yy - dy, 0.8, 0, 2 * Math.PI);\n\t\t\t\t\t\tcx.fill();\n\t\t\t\t\t\t/**/\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\tbreak;\n\t\tcase 3:\n\t\t\tvar c = 7;\n\t\t\tstrokeColor = colors[c][0];\n\t\t\tfillColor = colors[c][1];\n\t\t\tvar box = M;\n\t\t\tfor(var i = 0; i < box.length; i++) {\n\t\t\t\tvar ibeg = box[i][0];\n\t\t\t\tvar jbeg = box[i][1];\n\t\t\t\tvar iend = box[i][2];\n\t\t\t\tvar jend = box[i][3];\n\t\t\t\t\n\t\t\t\tvar x = jbeg * w;\n\t\t\t\tvar y = ibeg * h;\n\t\t\t\tvar lx = (jend - jbeg + 1) * w;\n\t\t\t\tvar ly = (iend - ibeg + 1) * h;\n\t\t\t\tcx.beginPath();\n\t\t\t\tcx.fillStyle = fillColor;\n\t\t\t\tcx.fillRect(x, y, lx, ly);\n\t\t\t\tcx.fill();\n\t\t\t}\n\t\tbreak;\n\t\tdefault:\n\t}\n}", "function drawCells(){\n context.fillStyle = 'white';\n context.fillRect(0, 0, resolution, resolution);\n context.fillStyle = 'black'\n for (let y = 0; y < resolution; y++){\n for(let x = 0; x < resolution; x++){\n if (cells[x][y]) \n context.fillRect(x,y,1,1) //position of the cell are given with x and y, fill react first parameters are the coordenates\n }\n }\n}", "function staticUpdateCells(grid) {\r\n var new_canvas = getCanvas();\r\n for (var i = 0; i < NUM_ROWS; i += 1) {\r\n for (var j = 0; j < NUM_COLS; j += 1) {\r\n new_canvas.fillStyle = grid[i][j].fillStyle;\r\n new_canvas.fillRect(grid[i][j].xPosition, grid[i][j].yPosition, CELL_SIZE, CELL_SIZE);\r\n }\r\n }\r\n }", "function drawBoard() {\n // vertical lines\n for (let x = 0; x <= BOARD_WIDTH; x += CELL_SIZE) {\n context.moveTo(0.5 + x + OFFSET, OFFSET);\n context.lineTo(0.5 + x + OFFSET, BOARD_HEIGHT + OFFSET);\n }\n\n // horizontal lines\n for (let y = 0; y <= BOARD_HEIGHT; y += CELL_SIZE) {\n context.moveTo(OFFSET, 0.5 + y + OFFSET);\n context.lineTo(BOARD_WIDTH + OFFSET, 0.5 + y + OFFSET);\n }\n\n context.strokeStyle = \"black\";\n context.stroke();\n}", "function paintCells() {\r\n for (x = 0; x < w; x += space) {\r\n for (y = 0; y < h; y += space) {\r\n ctx.fillRect(x, y, space - unit, space - unit);\r\n }\r\n }\r\n}", "function drawMaze() {\n for( var i = 0; i < cols; i++ ) {\n for( var j = 0; j < rows; j++ ) {\n /*\n switch( maze[i][j] ) {\n case 0: ctx.fillStyle = \"black\"; break;\n case 1: ctx.fillStyle = \"gray\"; break;\n case 2: ctx.fillStyle = \"red\"; break;\n case 3: ctx.fillStyle = \"yellow\"; break;\n case 4: ctx.fillStyle = \"#500000\"; break;\n case 8: ctx.fillStyle = \"blue\"; break;\n }\n ctx.fillRect( grid * i, grid * j, grid, grid );\n ctx.strokeStyle = ctx.fillStyle;\n ctx.strokeRect( grid * i, grid * i, grid, grid );*/\n drawBlock(i,j,maze[i][j]);\n }\n }\n}", "function resetGrid() {\r\n var cellWidth = canvSize/matrix.length;\r\n var cellHeight = canvSize/matrix.length;\r\n for(var i=0; i<matrix.length; i++){\r\n for(var j=0; j<matrix.length; j++){\r\n context.fillStyle = (matrix[i][j] == 1) ? \"#000000\" : \"#FFFFFF\";\r\n context.fillRect(i*cellWidth,j*cellHeight, cellWidth, cellHeight);\r\n\r\n context.fillStyle = \"#000000\";\r\n context.fillRect(i*cellWidth,j*cellHeight, 1, cellHeight);\r\n context.fillRect(i*cellWidth,j*cellHeight, cellWidth, 1);\r\n context.fillRect((i+1)*cellWidth-1,j*cellHeight-1, 1, cellHeight);\r\n context.fillRect(i*cellWidth,(j+1)*cellHeight, cellWidth, 1);\r\n }\r\n}\r\ncontext.fillStyle = \"red\";\r\ncontext.fillRect(cellWidth, cellHeight, cellWidth, cellHeight);\r\ncontext.fillRect(cellWidth*(matrix.length-2), cellWidth*(matrix.length-2), cellWidth, cellHeight);\r\n\r\ncontext.fillStyle = \"black\";\r\n}", "function drawGrid() {\n jaws.context.save();\n jaws.context.strokeStyle = \"rgba(5,119,17,0.7)\";\n jaws.context.beginPath();\n\n for (var x = 0; x < m_viewport.max_x; x += cell_size) {\n jaws.context.moveTo(x - m_viewport.x, 0);\n jaws.context.lineTo(x - m_viewport.x, jaws.height);\n }\n for (var y = 0; y < m_viewport.max_y; y += cell_size) {\n jaws.context.moveTo(0, y - m_viewport.y);\n jaws.context.lineTo(jaws.width, y - m_viewport.y);\n }\n\n jaws.context.closePath()\n jaws.context.stroke()\n jaws.context.restore()\n }", "draw(){\n var canvas = document.getElementById(\"myCanvas\");\n var ctx = canvas.getContext(\"2d\");\n\n var startx = 0;\n var starty = 0;\n\n if(this.normx == 1){\n startx = this.posx*cell_size[0];\n starty = this.posy*cell_size[1]+cell_size[1]/2;\n }\n else if(this.normx == -1){\n startx = this.posx*cell_size[0]+cell_size[0];\n starty = this.posy*cell_size[1]+cell_size[1]/2;\n }\n else if(this.normy == 1){\n startx = this.posx*cell_size[0]+cell_size[0]/2;\n starty = this.posy*cell_size[1];\n }\n else if(this.normy == -1){\n startx = this.posx*cell_size[0]+cell_size[0]/2;\n starty = this.posy*cell_size[1]+cell_size[1];\n }\n\n var centrex = this.posx*cell_size[0]+cell_size[0]/2;\n var centrey = this.posy*cell_size[1]+cell_size[1]/2;\n\n ctx.beginPath();\n ctx.moveTo(startx, starty);\n ctx.lineTo(centrex, centrey);\n ctx.stroke();\n }", "Draw() {\r\n for (let row = 0; row < this.rowCount; ++row) {\r\n for (let column = 0; column < this.columnCount; ++column) {\r\n let cell = this.simulationGrid[row][column];\r\n\r\n if (cell === this.cellState.alive) {\r\n let coordinate = new Vector2D();\r\n coordinate.x = column * this.cellSize.x;\r\n coordinate.y = row * this.cellSize.y;\r\n\r\n DrawRectangle(coordinate, this.cellSize, \"#ffffff\", this.context);\r\n }\r\n }\r\n }\r\n }", "function animateGrid(select){\n var initial=to_draw;\n if(counter==number_frames){\n animation_end=true;\n }\n if(counter==0){\n animation_end=false;\n }\n if(button_animate==1){\n processInput();\n var grid = document.getElementsByTagName(\"td\");\n console.log(counter);\n if(!animation_end){\n counter++;\n\n for(var i = 0; i < to_draw.length; i++){\n let { loc } = to_draw[i];\n let { color } = to_draw[i];\n let { offset } = to_draw[i];\n var at= loc;\n // console.log(at);\n //is used for the the current screen to scroll\n if(at<16 && loc+offset>15){\n to_draw[i].loc=0;;\n to_draw[i].offset=0;\n }\n if(at<32 &&loc+offset>31){\n to_draw[i].loc=16;\n to_draw[i].offset=0;\n }\n if(at<48 &&loc+offset>47){\n to_draw[i].loc=32;\n to_draw[i].offset=0;\n }\n if(at<64 &&loc+offset>63){\n to_draw[i].loc=48;\n to_draw[i].offset=0;\n }\n if(at<80 &&loc+offset>79){\n\n to_draw[i].loc=64;\n to_draw[i].offset=0;\n\n }\n if(at<96 &&loc+offset>95){\n to_draw[i].loc=80;\n to_draw[i].offset=0;\n }\n if(at<112 &&loc+offset>111){\n to_draw[i].loc=96;\n to_draw[i].offset=0;\n }\n if(at<128 &&loc+offset>127){\n to_draw[i].loc=112;\n to_draw[i].offset=0;\n\n }\n else{\n to_draw[i].offset=to_draw[i].offset+1;\n if(random_colors_switch==1){\n color=getRandomColor();\n }\n grid[to_draw[i].loc+to_draw[i].offset].style.backgroundColor = color; \n\n // console.log(to_draw[i].offset);\n }\n }\n\n }\n if(animation_end){\n counter--;\n for(var i = 0; i < to_draw.length; i++){\n let { loc } = to_draw[i];\n let { color } = to_draw[i];\n let { offset } = to_draw[i];\n var at= loc;\n // console.log(at);\n //is used for the the current screen to scroll\n if(at<16 && loc+offset>15){\n to_draw[i].loc=0;;\n to_draw[i].offset=0;\n }\n if(at<32 &&loc+offset>31){\n to_draw[i].loc=16;\n to_draw[i].offset=0;\n }\n if(at<48 &&loc+offset>47){\n to_draw[i].loc=32;\n to_draw[i].offset=0;\n }\n if(at<64 &&loc+offset>63){\n to_draw[i].loc=48;\n to_draw[i].offset=0;\n }\n if(at<80 &&loc+offset>79){\n\n to_draw[i].loc=64;\n to_draw[i].offset=0;\n\n }\n if(at<96 &&loc+offset>95){\n to_draw[i].loc=80;\n to_draw[i].offset=0;\n }\n if(at<112 &&loc+offset>111){\n to_draw[i].loc=96;\n to_draw[i].offset=0;\n }\n if(at<128 &&loc+offset>127){\n to_draw[i].loc=112;\n to_draw[i].offset=0;\n\n }\n else{\n to_draw[i].offset=to_draw[i].offset-1;\n if(random_colors_switch==1){\n color=getRandomColor();\n }\n grid[to_draw[i].loc+to_draw[i].offset].style.backgroundColor = color; \n\n // console.log(to_draw[i].offset);\n }\n }\n \n }\n\n }\n if(button_animate==2){\n clearInterval();\n resetGrid();\n button_animate=0;\n }\n \n }", "function drawMatrix(matrix, s) {\n matrix.forEach((row, y) => {\n row.forEach((v, x) => {\n if (v !== 0) {\n cxs.fillStyle = color[v];\n cxs.fillRect(x + s.x, y + s.y, 1, 1);\n }\n });\n });\n}", "function drawBoard() {\n var height = cellside * sidelength;\n var width = cellside * sidelength;\n from_to(0, height, cellside, function (i) {\n ctx.moveTo(i, 0);\n ctx.lineTo(i, width);\n ctx.moveTo(0, i);\n ctx.lineTo(height, i);\n });\n ctx.strokeStyle = \"black\";\n ctx.stroke();\n}", "function drawMaze(mfields, first, last) {\n console.log(\"startfeld\", first);\n let cvs = document.getElementById('cvs');\n let ctx = cvs.getContext('2d');\n\n ctx.fillStyle = '#000000';\n\n for (let y = 0; y < mfields.length; y++) {\n for (let x = 0; x < mfields[y].length; x++) {\n ctx.beginPath();\n ctx.strokeStyle = '#ffff00';\n ctx.rect(x * field_dim, y * field_dim, field_dim, field_dim);\n ctx.fill();\n ctx.stroke();\n }\n }\n\n ctx.beginPath();\n ctx.fillStyle = '#d1d1d1';\n\n\n\n\n for (let y = 0; y < mfields.length; y++) {\n for (let x = 0; x < mfields[y].length; x++) {\n ctx.beginPath();\n ctx.strokeStyle = '#ffff00';\n\n if (mfields[y][x].neighbors.n) {\n if (y != 0)\n ctx.rect(x * field_dim + 1, (y - 1) * field_dim + 1, field_dim - 2, field_dim * 2 - 2);\n }\n if (mfields[y][x].neighbors.s) {\n if (!(y == mfields.length - 1))\n ctx.rect(x * field_dim + 1, y * field_dim + 1, field_dim - 2, field_dim * 2 - 2);\n }\n\n if (mfields[y][x].neighbors.w) {\n ctx.rect((x - 1) * field_dim + 1, y * field_dim + 1, field_dim * 2 - 2, field_dim - 2);\n }\n if (mfields[y][x].neighbors.e) {\n ctx.rect((x) * field_dim + 1, y * field_dim + 1, field_dim * 2 - 2, field_dim - 2);\n }\n ctx.fill();\n ctx.beginPath();\n ctx.fillStyle = \"#ff0000\";\n\n if (mfields[y][x].item) {\n if (mfields[y][x].item == \"Banane\")\n ctx.fillText(\"B\", (x) * field_dim + field_dim / 2, y * field_dim + 1 + field_dim / 2);\n if (mfields[y][x].item == \"Schwert\")\n ctx.fillText(\"S\", (x) * field_dim + field_dim / 2, y * field_dim + 1 + field_dim / 2);\n\n }\n ctx.fill();\n ctx.fillStyle = \"#000000\";\n }\n\n\n }\n\n\n\n // Aktuelles Feld einzeichnen\n\n let y = parseInt(first.id / cols);\n let x = parseInt(first.id % cols);\n ctx.beginPath();\n ctx.arc(x * field_dim + field_dim / 2, y * field_dim + field_dim / 2, 5, 0, 2 * Math.PI);\n\n ctx.fillStyle = '#ffff00'\n ctx.fill();\n\n\n ctx.fillStyle = '#d1d1d1'\n\n if (first.neighbors.n)\n ctx.rect(x * field_dim + 5, (y - 1) * field_dim + 5, field_dim - 10, field_dim - 10);\n if (first.neighbors.s)\n ctx.rect(x * field_dim + 5, (y + 1) * field_dim + 5, field_dim - 10, field_dim - 10);\n if (first.neighbors.w)\n ctx.rect((x - 1) * field_dim + 5, (y) * field_dim + 5, field_dim - 10, field_dim - 10);\n if (first.neighbors.e)\n ctx.rect((x + 1) * field_dim + 5, (y) * field_dim + 5, field_dim - 10, field_dim - 10);\n\n ctx.fill();\n //ctx.stroke();\t\t\t\n\n\n\n // Letzes Feld einzeichnen\n y = parseInt(last.id / cols);\n x = parseInt(last.id % cols);\n\n ctx.beginPath();\n ctx.arc(x * field_dim + field_dim / 2, y * field_dim + field_dim / 2, 5, 0, 2 * Math.PI);\n\n ctx.fillStyle = '#0000ff'\n ctx.fill();\n\n drawTimer()\n}", "paintBoard(matrix = this.boardMatrix) {\r\n let i, j, tr, td;\r\n let tbody = document.getElementById(\"gameBody\");\r\n let cell = \"cell \";\r\n for (i = 0; i < matrix.length; i++) {\r\n tr = document.createElement(\"tr\");\r\n for (j = 0; j < matrix[0].length; j++) {\r\n td = this.paintPosition(i, j, true);\r\n td.setAttribute(\"id\", \"\".concat(\"cell\", \"-\", i, \"-\", j));\r\n tr.appendChild(td);\r\n }\r\n tbody.appendChild(tr);\r\n }\r\n }", "function cell(arr,size_cell_info,lineWidth,num){\n //the cell start&end position\n //this.id = id;\n //id++;\n this.pos_all=[];\n this.pos_next = [];\n //this.angle = null;\n this.child_len = rand(1,num);\n this.scale = rand_float(0.3,1.0).toFixed(2);\n this.ccc = [];\n\n //scale the size by angle\n //var ang = (parseFloat(arr[2])+1.5708)/2;\n\n var angle_last = rand_float(ang-size_cell_info[2]/2,size_cell_info[2]);\n this.angle = angle_last.toFixed(2);\n var size = rand(size_cell_info[0],size_cell_info[1]);\n size = size * this.scale;\n var x = Math.round(size*Math.cos(this.angle));\n\n var y = Math.round(size*Math.sin(this.angle));\n this.pos_all[0]=arr[0];\n this.pos_all[1]=arr[1];\n this.pos_all[2]=x+arr[0];\n this.pos_all[3]=arr[1]-y;\n\n\n for(var i = 0;i<this.child_len;i++){\n this.ccc[i]=null;\n //-------------------\n var ratio = rand_float(size_cell_info[3],size_cell_info[4]);\n var x_x = Math.round(size * ratio * Math.cos(angle_last));\n var y_y = Math.round(size * ratio * Math.sin(angle_last));\n this.pos_next.push([x_x+arr[0],arr[1]-y_y]);\n //-------------------\n }\n draw(this.pos_all,lineWidth);\n //drawT(this.pos_all[2],this.pos_all[3],lineWidth+3);\n}", "function create_buffer_matrix(road_indices_array){\r\n var buffer_array = [];\r\n\r\n // Create a 30x30 matrix of 0s\r\n for (var i=0; i<matrix_map_size; i++){\r\n buffer_array.push([]);\r\n for (var j=0; j<matrix_map_size; j++){\r\n buffer_array[i].push(0);\r\n }\r\n }\r\n\r\n // Iterate over each road index\r\n for (var road_index=0; road_index<road_indices_array.length; road_index++){\r\n\r\n // Get 'row' value of the road index\r\n var row = road_indices_array[road_index][0];\r\n // Get 'col' value of the road index\r\n var col = road_indices_array[road_index][1];\r\n // Get the value indicating which kernel to use for buffer, 90 deg or\r\n // other\r\n var ker = road_indices_array[road_index][2];\r\n\r\n // Stamp a 1 for the direct road index.\r\n buffer_array[row][col] = 1;\r\n\r\n var kernel_index;\r\n // Iterate over the 3x3 kernel to look for buffer areas\r\n for (kernel_index=0; kernel_index < kern[ker].length; kernel_index++)\r\n {\r\n // x, y are the cells surrounding the road index\r\n var x = kern[ker][kernel_index][0] + row;\r\n var y = kern[ker][kernel_index][1] + col;\r\n\r\n // Make sure we're not out of bounds somewhere\r\n if (x >= 0 && x < matrix_map_size && y >= 0 && y < matrix_map_size){\r\n // Confusing, but basically that potential buffer isn't actually\r\n // another road pixel\r\n if (JSON.stringify(road_indices_array).indexOf(JSON.stringify([x, y, 0])) == -1 &&\r\n JSON.stringify(road_indices_array).indexOf(JSON.stringify([x, y, 1])) == -1)\r\n {\r\n // Make sure that we are NOT buffering on top of our city points\r\n if (JSON.stringify(city_points).indexOf(JSON.stringify([x,y])) == -1){\r\n // Finally set as buffer pixel\r\n buffer_array[x][y] = 2;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n return buffer_array;\r\n}", "function displayMatrix(name, matrix, xOffset, yOffset) {\n\t\tctx.fillStyle = defaultTextColor;\n\t\tvar str;\n\t\tvar x = xOffset, y = yOffset;\n\t\tctx.fillText(name + \":\", x, y);\n\t\tx += fontLineHeightInPt;\n\t\ty += fontLineHeightInPt;\n\t\tvar index = 0;\n\t\tfor(var i = 0; i < 4; i++) {\n\t\t\tstr = \"\";\n\t\t\tfor(var j = 0; j < 4; j++) {\n\t\t\t\tstr += matrix[index].toFixed(3) + \" \";\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\tctx.fillText(str, x, y);\n\t\t\ty += fontLineHeightInPt;\n\t\t}\n\t\t// Reset color.\n\t\tctx.fillStyle = defaultColor;\n\t}", "update_grid() {\n // Constants for parameters of the grid pattern.\n // The (average) length of the dashes making up the cell border lines.\n const DASH_LENGTH = this.default_cell_size / 16;\n // The border colour.\n const BORDER_COLOUR = \"lightgrey\";\n\n const [width, height] = [document.body.offsetWidth, document.body.offsetHeight];\n const canvas = this.grid;\n canvas.resize(width, height);\n\n const scale = 2 ** this.scale;\n\n const context = canvas.context;\n context.strokeStyle = BORDER_COLOUR;\n context.lineWidth = Math.max(1, CONSTANTS.GRID_BORDER_WIDTH * scale);\n context.setLineDash([DASH_LENGTH * scale]);\n\n // We want to centre the horizontal and vertical dashes, so we get little crosses in the\n // corner of each grid cell. This is best effort: it is perfect when each column and row\n // is the default size, but otherwise may be imperfect.\n const dash_offset = -DASH_LENGTH * scale / 2;\n\n const offset = this.view;\n\n const [[left_col, left_offset], [top_row, top_offset]] = this.col_row_offset_from_offset(\n offset.sub(new Offset(width / scale / 2, height / scale / 2))\n );\n const [[right_col,], [bottom_row,]] = this.col_row_offset_from_offset(\n offset.add(new Offset(width / scale / 2, height / scale / 2))\n );\n\n // Draw the vertical lines.\n context.beginPath();\n for (let col = left_col, x = left_offset - offset.left;\n col <= right_col; x += this.cell_size(this.cell_width, col++)) {\n context.moveTo(x * scale + width / 2, 0);\n context.lineTo(x * scale + width / 2, height);\n }\n context.lineDashOffset = offset.top * scale - dash_offset - height % this.default_cell_size / 2;\n context.stroke();\n\n // Draw the horizontal lines.\n context.beginPath();\n for (let row = top_row, y = top_offset - offset.top;\n row <= bottom_row; y += this.cell_size(this.cell_height, row++)) {\n context.moveTo(0, y * scale + height / 2);\n context.lineTo(width, y * scale + height / 2);\n }\n context.lineDashOffset = offset.left * scale - dash_offset - width % this.default_cell_size / 2;\n context.stroke();\n }", "drawMatrix() {\r\n console.log(`== CURRENT GENERATION IS: ${grid.currentGeneration}`);\r\n this.items.forEach(row => {\r\n console.log('--------');\r\n console.log(row.map(item => item.color).join('|'));\r\n });\r\n\r\n\r\n const counterMessage = `Cell X:${this.trackedCellCoordinates.x}, Y:${this.trackedCellCoordinates.y} was ${this.items[this.trackedCellCoordinates.y][this.trackedCellCoordinates.x].timesWasGreen} times green`;\r\n console.log(counterMessage);\r\n const generationContainer = document.getElementsByClassName(`generation-${this.currentGeneration}`);\r\n const counterElement = document.createElement('div');\r\n counterElement.classList.add('sub-heading');\r\n counterElement.textContent = counterMessage;\r\n generationContainer[0].appendChild(counterElement);\r\n }", "function drawBoard(){\n for (var i = 0; i < gameboard.length; i++){\n for (var j = 0; j < gameboard.length; j++){\n var xCoord = 15 + i * 32;\n var yCoord = 25 + j * 32;\n gameboard[i][j].xCoord = xCoord;\n gameboard[i][j].yCoord = yCoord;\n tile.beginPath();\n tile.fillStyle = '#000000';\n tile.font = '24px monospace';\n tile.fillText(gameboard[i][j].letter, xCoord, yCoord);\n tile.closePath();\n }\n }\n}", "initDraw(board) {\n var rowLength = (board.size)\n for (var i = rowLength; i > 0; i--) {\n createRow(i);\n for (var j = 0; j < rowLength; j++) {\n drawIntersection(i, `${alphabet[j]}${i}`, startx, starty);\n startx += gap;\n }\n // Reset startx and adjust starty to begin new row \n startx = startx - (gap * rowLength);\n starty += gap; \n }\n }", "function numbers(){\n for(let i=1;i<tileColCount;i++)\n {\n let tmpx= i*(tileW+3);\n let tmpy=0;\n ctx.fillStyle=\"black\";\n ctx.font = \"15px Georgia\";\n ctx.fillText(i,tmpx+3,tmpy+12,20); \n }\n for(let j=1;j<tileRowCount;j++)\n {\n let tmpy= j*(tileW+3);\n let tmpx=0;\n ctx.fillStyle=\"black\";\n ctx.font = \"15px Georgia\";\n ctx.fillText(j,tmpx,tmpy+14,20); \n }\n}", "cell_from_offset(sizes, offset) {\n // We explore the grid in both directions, starting from the origin.\n let index = 0;\n const original_offset = offset;\n if (offset === 0) {\n return [index, 0];\n }\n // The following two loops have been kept separate to increase readability.\n // Explore to the right or bottom...\n while (offset >= 0) {\n const size = this.cell_size(sizes, index);\n if (offset < size) {\n return [index, original_offset - offset];\n }\n offset -= size;\n ++index;\n }\n // Explore to the left or top...\n while (offset <= 0) {\n --index;\n const size = this.cell_size(sizes, index);\n if (Math.abs(offset) < size) {\n return [index, original_offset - (offset + size)];\n }\n offset += size;\n }\n }", "function drawCurrentGrid() {\n\n\n for (var i = 0; i < 20; i++) {\n for (var j = 0; j < 10; j++) {\n if (grid[i][j] > 0) {\n var num = grid[i][j];\n var color = colors[num - 1];\n\n var y = 1 + j * 32;\n var x = 612 - (1 + i * 32);\n\n\n $canvas.drawRect({\n fillStyle: color,\n strokeStyle: color,\n strokeWidth: 4,\n x: y,\n y: x, // 1+i*32, j*32\n fromCenter: false,\n width: 30,\n height: 28\n });\n } else if (placed[i][j] > 0) {\n var num = placed[i][j];\n var color = colors[num - 1];\n\n var y = 1 + j * 32;\n var x = 612 - (1 + i * 32);\n\n $canvas.drawRect({\n fillStyle: color,\n strokeStyle: color,\n strokeWidth: 4,\n x: y,\n y: x, // 1+i*32, j*32\n fromCenter: false,\n width: 30,\n height: 28\n });\n }\n\n }\n }\n\n}", "draw(ctx, x, y, cell_width, cell_height) { \n for (let h = 0; h < this.height; h++) {\n // each odd line is 1 cell shorter\n for (let w = 0; w < this.width - (h & 1); w++) {\n let index = (h * this.width - (~~(h / 2))) + w;\n\n if (this.cells[index].playerId != 0) {\n this.playersCells[this.cells[index].playerId].add(index);\n }\n\n // NOTE: It can probably be a static method\n this.cells[index].draw(ctx, \n x + w * cell_width + ((h % 2) * cell_width / 2), \n y + h * cell_height - (h * (cell_height / 2)), \n cell_width, \n cell_height\n );\n }\n }\n }", "clear() {\n for (let h = 0; h < this.height; h++) {\n this.cells[this.currentBufferIndex][h].fill(0);\n }\n }", "function drawCells() {\n // Get canvas context\n var canvas = document.getElementById('mainCanvas');\n var ctx = canvas.getContext('2d');\n\n // Get the grid padding\n var padding = getGridPadding();\n\n // Cycle through the grid\n for (var i = 0; i < window.numCellsX; i++) {\n for (var j = 0; j < window.numCellsY; j++) {\n // Check if cell is alive or dead\n if (window.grid[i][j]) {\n // If cell is alive then color with cell color\n ctx.fillStyle = window.cellColor;\n } else {\n // If cell is dead then color with background color\n ctx.fillStyle = window.backgroundColor;\n }\n\n // Draw the cells\n var halfGridLineWidth = (window.cellSize / window.gridLineWidthRatio) / 2;\n ctx.fillRect(padding.horizontal + (i * window.cellSize) + halfGridLineWidth,\n padding.vertical + (j * window.cellSize) + halfGridLineWidth,\n window.cellSize - halfGridLineWidth, window.cellSize - halfGridLineWidth);\n }\n }\n}", "function drawData() {\n for (let i = 0; i < dirtyIndices.length; i++) {\n let color = canvasData[dirtyIndices[i]];\n colorBox(indexToRowAndColumn(dirtyIndices[i]), color);\n }\n // Reset the dirty Indices array for the next animation frame's update\n dirtyIndices = [];\n requestAnimationFrame(drawData);\n}", "function reDraw() {\n \"use strict\";\n var results;\n var i;\n results = [\n [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 [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 ];\n matrixMultiply();\n for (i = 0; i < 26; i = i + 1) { // calculate new co-ordinate pairs\n results[i][0] = transformCoordsX(i);//new x coordinate\n results[i][1] = transformCoordsY(i);//new y coordinate\n }\n /* again, not pretty code, but its left this way to ease understanding */\n drawLine(results[0][0], results[0][1], results[1][0], results[1][1], \"red\", 1.0);\n drawLine(results[1][0], results[1][1], results[2][0], results[2][1], \"red\", 1.0);\n drawLine(results[2][0], results[2][1], results[3][0], results[3][1], \"red\", 1.0);\n drawLine(results[3][0], results[3][1], results[4][0], results[4][1], \"red\", 1.0);\n drawLine(results[5][0], results[5][1], results[6][0], results[6][1], \"blue\", 1.0); //upper left tyre\n drawLine(results[6][0], results[6][1], results[7][0], results[7][1], \"blue\", 1.0);\n drawLine(results[7][0], results[7][1], results[8][0], results[8][1], \"blue\", 1.0);\n drawLine(results[9][0], results[9][1], results[10][0], results[10][1], \"blue\", 1.0); //upper right tyre\n drawLine(results[10][0], results[10][1], results[11][0], results[11][1], \"blue\", 1.0);\n drawLine(results[11][0], results[11][1], results[12][0], results[12][1], \"blue\", 1.0);\n drawLine(results[13][0], results[13][1], results[14][0], results[14][1], \"blue\", 1.0); //lower left tyre\n drawLine(results[14][0], results[14][1], results[15][0], results[15][1], \"blue\", 1.0);\n drawLine(results[15][0], results[15][1], results[16][0], results[16][1], \"blue\", 1.0);\n drawLine(results[17][0], results[17][1], results[18][0], results[18][1], \"blue\", 1.0); //lower right tyre\n drawLine(results[18][0], results[18][1], results[19][0], results[19][1], \"blue\", 1.0);\n drawLine(results[19][0], results[19][1], results[20][0], results[20][1], \"blue\", 1.0);\n drawLine(results[21][0], results[21][1], results[22][0], results[22][1], \"red\", 1.0); //car roof\n drawLine(results[22][0], results[22][1], results[23][0], results[23][1], \"red\", 1.0);\n drawLine(results[23][0], results[23][1], results[24][0], results[24][1], \"red\", 1.0);\n drawLine(results[24][0], results[24][1], results[25][0], results[25][1], \"red\", 1.0);\n}", "drawBoxes () {\n let c = document.getElementById(\"canvas\").getContext(\"2d\");\n c.fillStyle = \"black\";\n for(let i = 1; i < this.state.m; i++) {\n c.fillRect(i * 20, 0, 1, this.state.n * this.state.cellSize);\n }\n for(let i = 1; i < this.state.n; i++) {\n c.fillRect(0, i * 20, this.state.m * this.state.cellSize, 1);\n }\n }", "function drawCell(x, y, color, ctx) {\n\tx = x * cellSize;\n\tx = ~~x;\n\ty = ~~y * cellSize - 2 * cellSize;\n\tctx.drawImage(spriteCanvas, color * cellSize, 0, cellSize, cellSize, x, y, cellSize, cellSize);\n}", "step() {\n // const currentIndex = this.currentBufferIndex;\n // const nextIndex = this.currentBufferIndex === 0 ? 1 : 0;\n\n // animate\n const currentBuffer = this.cells[this.currentBufferIndex];\n const backBuffer = this.cells[this.currentBufferIndex === 0 ? 1 : 0];\n\n // console.log('current', currentBuffer);\n // console.log('back', backBuffer);\n\n // See if we have a nieghbor that can infect this cell and change its color:\n\n function hasInfectiousNeighbor(height, width) {\n const nextValue = (currentBuffer[height][width] + 1) % MODULO;\n // See visual rep below:\n // We are not interested in comparing X with diagonal values, only cardinal values.\n\n // WEST\n if (width > 2) {\n if (currentBuffer[height][width - 2] === nextValue) {\n return true;\n }\n }\n // NORTH\n if (height > 1) {\n if (currentBuffer[height - 1][width] === nextValue) {\n return true;\n }\n }\n // EAST\n if (width < this.width - 2) {\n if (currentBuffer[height][width + 2] === nextValue) {\n return true;\n }\n }\n // SOUTH\n if (height < this.height - 1) {\n if (currentBuffer[height + 1][width] === nextValue) {\n return true;\n }\n }\n }\n\n for (let height = 0; height < this.height; height++) {\n for (let width = 0; width < this.width; width++) {\n if (hasInfectiousNeighbor.call(this, height, width)) {\n backBuffer[height][width] =\n (currentBuffer[height][width] + 1) % MODULO;\n } else {\n backBuffer[height][width] = currentBuffer[height][width];\n }\n }\n }\n\n this.currentBufferIndex = this.currentBufferIndex === 0 ? 1 : 0;\n }", "function main() {\n var board = [];\n for (i = 0; i < 9; i++) {\n var line = [];\n for (j = 1; j <= 9; j++) {\n line.push(0);\n }\n board.push(line);\n }\n currentGrid = board;\n draw();\n}", "function grid_from_offset(pos){\n\t \tvar location = {\n\t \t\tcol: Math.floor(pos.left/tileWidth) + 1,\n\t \t\trow: Math.floor(pos.top/tileHeight) + 1\n\t \t}\n\t \treturn location;\n\t }", "getCells() {\n return this.buffer[this.currentBufferIndex];\n }", "getCells() {\n return this.buffer[this.currentBufferIndex];\n }", "getCells() {\n return this.buffer[this.currentBufferIndex];\n }", "function drawCells() {\n // Draw the background\n colorRect(0, 0, canvas.width, canvas.height, 'green');\n\n for (var i = 0; i <= HEIGHT - 1; i++) {\n for (var j = 0; j <= WIDTH - 1; j++) {\n grid[i][j].draw();\n }\n }\n}", "getCells() {\n // !!!! IMPLEMENT ME !!!!\n return this.buffer[this.currentBufferIndex];\n }", "setStartingPosition() {\n this.x = CELL_WIDTH * 2;\n this.y = CELL_HEIGHT * COLS;\n }", "function drawMesh() {\n ctx.beginPath();\n for (let yl = 1; yl < col; yl++) {\n ctx.moveTo(cellSize * yl , 0);\n ctx.lineTo(cellSize * yl , height);\n }\n for (let xl = 1; xl < row; xl++) {\n ctx.moveTo(0 , cellSize * xl);\n ctx.lineTo(width , cellSize * xl);\n }\n ctx.lineWidth = 1;\n ctx.strokeStyle='#888';\n ctx.stroke();\n}", "function drawBoard(array_name, numRows, numCol, xOrigin, yOrigin) {\n for (var j = 0; j < numRows; j++) {\n\n var yCorner = yOrigin + j * segmentHeight;\n\n for (var i = 0; i < numCol; i++) {\n\n var xCorner = xOrigin + i * segmentWidth;\n rect(xCorner, yCorner, segmentWidth, segmentHeight);\n }\n\n strokeWeight(1);\n textSize(25);\n textAlign(CENTER, CENTER);\n stroke('black');\n //Display the array values on canvas\n text(array_name[j], xOrigin + segmentWidth / 0.7, yCorner + segmentHeight / 2);\n //Display the array index value on canvas\n text(j, xOrigin + segmentWidth / 2, yCorner + segmentHeight / 2);\n\n }\n}", "function paint_cell(x, y, num)\n\t{\t\n\t\tvar gc_colors = [\"#1BCFC3\", \"#1BCFC3\" , \"#1BCFC3\"];\n\t\tctx.fillStyle = gc_colors[num % 3];\n\t\tctx.fillRect(x*cell_w, y*cell_w, cell_w, cell_w);\n\t\tctx.strokeStyle = gc_colors[num % 3];\n\t\tctx.strokeRect(x*cell_w, y*cell_w, cell_w, cell_w);\n\t}", "draw_picture(rot_mat){\n var canvas = document.getElementById(\"myCanvas\");\n var ctx = canvas.getContext(\"2d\");\n ctx.beginPath();\n ctx.arc(this.posx*cell_size[0]+cell_size[0]*3/2, this.posy*cell_size[1]+cell_size[1]*3/2, cell_size[0]*3/2, 0, 2 * Math.PI);\n ctx.stroke();\n ctx.beginPath();\n var gposx = this.posx*cell_size[0];\n var gposy = this.posy*cell_size[1];\n var midx = cell_size[0]*3/2;\n var midy = cell_size[1]*3/2;\n //extentions of out pins\n ctx.moveTo( gposx+midx+(cell_size[0]*2/2)*rot_mat[0]+(-cell_size[1]*3/2)*rot_mat[1], gposy+midy+(cell_size[0]*2/2)*rot_mat[2]+(-cell_size[1]*3/2)*rot_mat[3] );\n ctx.lineTo( gposx+midx+(cell_size[0]*2/2)*rot_mat[0]+(-cell_size[1]*2/2)*rot_mat[1], gposy+midy+(cell_size[0]*2/2)*rot_mat[2]+(-cell_size[1]*2/2)*rot_mat[3] );\n ctx.moveTo( gposx+midx+(cell_size[0]*2/2)*rot_mat[0]+(cell_size[1]*3/2)*rot_mat[1], gposy+midy+(cell_size[0]*2/2)*rot_mat[2]+(cell_size[1]*3/2)*rot_mat[3] );\n ctx.lineTo( gposx+midx+(cell_size[0]*2/2)*rot_mat[0]+(cell_size[1]*2/2)*rot_mat[1], gposy+midy+(cell_size[0]*2/2)*rot_mat[2]+(cell_size[1]*2/2)*rot_mat[3] );\n ctx.moveTo( gposx+midx+(-cell_size[0]*3/2)*rot_mat[0]+(cell_size[1]*0/2)*rot_mat[1], gposy+midy+(-cell_size[0]*3/2)*rot_mat[2]+(cell_size[1]*0/2)*rot_mat[3] );\n ctx.lineTo( gposx+midx+(-cell_size[0]*1/2)*rot_mat[0]+(cell_size[1]*0/2)*rot_mat[1], gposy+midy+(-cell_size[0]*1/2)*rot_mat[2]+(cell_size[1]*0/2)*rot_mat[3] );\n //middle bar\n ctx.moveTo( gposx+midx+(-cell_size[0]*1/2)*rot_mat[0]+(-cell_size[1]*2/2)*rot_mat[1], gposy+midy+(-cell_size[0]*1/2)*rot_mat[2]+(-cell_size[1]*2/2)*rot_mat[3] );\n ctx.lineTo( gposx+midx+(-cell_size[0]*1/2)*rot_mat[0]+(cell_size[1]*2/2)*rot_mat[1], gposy+midy+(-cell_size[0]*1/2)*rot_mat[2]+(cell_size[1]*2/2)*rot_mat[3] );\n //two diagonals\n ctx.moveTo( gposx+midx+(cell_size[0]*2/2)*rot_mat[0]+(-cell_size[1]*2/2)*rot_mat[1], gposy+midy+(cell_size[0]*2/2)*rot_mat[2]+(-cell_size[1]*2/2)*rot_mat[3] );\n ctx.lineTo( gposx+midx+(-cell_size[0]*1/2)*rot_mat[0]+(-cell_size[1]*1/2)*rot_mat[1], gposy+midy+(-cell_size[0]*1/2)*rot_mat[2]+(-cell_size[1]*1/2)*rot_mat[3] );\n ctx.moveTo( gposx+midx+(cell_size[0]*2/2)*rot_mat[0]+(cell_size[1]*2/2)*rot_mat[1], gposy+midy+(cell_size[0]*2/2)*rot_mat[2]+(cell_size[1]*2/2)*rot_mat[3] );\n ctx.lineTo( gposx+midx+(-cell_size[0]*1/2)*rot_mat[0]+(cell_size[1]*1/2)*rot_mat[1], gposy+midy+(-cell_size[0]*1/2)*rot_mat[2]+(cell_size[1]*1/2)*rot_mat[3] );\n ctx.stroke();\n }", "draw() {\r\n\t\tthis.matrix.forEach((row, y) => row.forEach((tile, x) => {\r\n\t\t\tif (tile) {\r\n\t\t\t\tlet [tx, ty] = tile.position.get;\r\n\t\t\t\tif (tile.isEmpty) {\r\n\t\t\t\t\t//default\r\n\t\t\t\t\tmainCtx.fillStyle = this.baseColor;\r\n\t\t\t\t\tmainCtx.fillRect(\r\n\t\t\t\t\t\ttx * (this.tileSize + this.spacing),\r\n\t\t\t\t\t\tty * (this.tileSize + this.spacing),\r\n\t\t\t\t\t\tthis.tileSize,\r\n\t\t\t\t\t\tthis.tileSize\r\n\t\t\t\t\t);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t//draw gameobject\r\n\t\t\t\t\tmainCtx.fillStyle = tile.top.bgColor;\r\n\t\t\t\t\tmainCtx.fillRect(\r\n\t\t\t\t\t\ttx * (this.tileSize + this.spacing),\r\n\t\t\t\t\t\tty * (this.tileSize + this.spacing),\r\n\t\t\t\t\t\tthis.tileSize,\r\n\t\t\t\t\t\tthis.tileSize\r\n\t\t\t\t\t);\r\n\t\t\t\t\tmainCtx.fillStyle = tile.top.color;\r\n\t\t\t\t\tmainCtx.fillText(\r\n\t\t\t\t\t\ttile.top.glyph,\r\n\t\t\t\t\t\ttx * (this.tileSize + this.spacing) + this.tileSize / 2,\r\n\t\t\t\t\t\tty * (this.tileSize + this.spacing) + this.tileSize / 1.5\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}));\r\n\t}", "render() {\n fill(100);\n noStroke();\n push();\n translate(this.x, this.y); // translate the coordinates to the grid cell\n this.drawlines();\n pop();\n }", "function draw() {\n context.fillStyle = '#000';\n context.fillRect(0, 0, canvas.width, canvas.height);\n draw_matrix(arena, {x: 0, y: 0});\n draw_matrix(player.matrix, player.pos);\n}", "printBall () {\n for (let i = this.ballPosition.latitude - 2; i < this.ballPosition.latitude + 2; i++) {\n for (let j = this.ballPosition.longitude - 2; j < this.ballPosition.longitude + 2; j++) {\n this.matrix.setElement(j, i, '#');\n }\n }\n }", "createGrid(starti, startj, endi, endj, level, mapped) {\n for (let i = 0; i < this.rows; i++) {\n\n let rowgrid = [];\n for (let j = 0; j < this.columns; j++) {\n let cell = new Cell(\n i, \n j, \n (i==starti && j==startj), \n (i==endi && j==endj), \n level, \n mapped\n );\n paintCell(cell);\n rowgrid.push(cell);\n }\n this.grid.push(rowgrid);\n }\n }", "function draw() { \n for (var i = 0; i < cols; i++) {\n for (var j = 0; j < rows; j++) {\n\n var x = i * 30;\n var y = j * 30;\n ctx.rect(x, y, 30, 30);\n }\n //tab[i][j] = calculateAndApplyColor(i,j);\n ctx.stroke();\n ctx.strokeStyle = \"lightgrey\";\n }\n console.log('carré dessiné');\n }", "function paint_cell(x, y)\n {\n ctx.fillStyle = \"white\";\n ctx.fillRect(x*cw, y*cw, cw, cw);\n ctx.strokeStyle = \"blue\";\n ctx.strokeRect(x*cw, y*cw, cw, cw);\n }", "updateCell(i, j, newCell, tool) {\n let newState = Object.assign({}, this.state);\n let n = newState.cells;\n // don't update oob cells\n if (i <= 0 || j <= 0 || i >= this.rows - 1 || j >= this.cols - 1) {\n return;\n }\n\n // don't update empty adjacent cells\n if (newCell === false && !this.check(n[i][j])) {\n return;\n }\n // get adjacent cells\n let A = n[i-1][j];\n let B = n[i][j+1];\n let C = n[i+1][j];\n let D = n[i][j-1];\n let ans = null;\n //━ ┃ ┏ ┓ ┗ ┛ ┣ ┫ ┳ ┻ ╋\n // fill cell with line character based on the adjacent cells\n if (tool === \"draw\") {\n if ((this.check(A) || this.check(C)) && !this.check(B) && !this.check(D)) {\n ans = '┃';\n } else if (!this.check(A) && !this.check(C) && (this.check(B) || this.check(D))) {\n ans = '━';\n } else if (!this.check(A) && this.check(B) && this.check(C) && !this.check(D)) {\n ans = '┏';\n } else if (!this.check(A) && !this.check(B) && this.check(C) && this.check(D)) {\n ans = '┓';\n } else if (this.check(A) && this.check(B) && !this.check(C) && !this.check(D)) {\n ans = '┗';\n } else if (this.check(A) && !this.check(B) && !this.check(C) && this.check(D)) {\n ans = '┛';\n } else if (this.check(A) && this.check(B) && this.check(C) && !this.check(D)) {\n ans = '┣';\n } else if (this.check(A) && !this.check(B) && this.check(C) && this.check(D)) {\n ans = '┫';\n } else if (!this.check(A) && this.check(B) && this.check(C) && this.check(D)) {\n ans = '┳';\n } else if (this.check(A) && this.check(B) && !this.check(C) && this.check(D)) {\n ans = '┻';\n } else if (this.check(A) && this.check(B) && this.check(C) && this.check(D)) {\n ans = '╋';\n } else {\n ans = '╸'\n }\n } else if (tool === \"erase\") {\n if (j < this.leftmost) {\n ans = null\n } else {\n ans = \" \"\n }\n }\n\n n[i][j] = ans;\n\n // check for leftmost cell updates\n if(tool === \"erase\" && newCell) {\n loop:\n for (let m = 0; m < this.cols; m++) {\n for (let k = 0; k < this.rows; k++) {\n if (this.checkForLimits(n[k][m]) || (m === this.cols - 1 && k === this.rows - 1)) {\n this.prevLeftmost = this.leftmost.valueOf()\n this.leftmost = m\n break loop\n }\n }\n }\n }\n\n if(tool === \"draw\" && j < this.leftmost) {\n this.leftmost = j;\n // fill all the cells right of the leftmost non-empty cell to\n // improve selecting it for copy pasting\n for (let k = 0; k < this.rows; k++) {\n for (let m = this.leftmost; m < this.cols; m++) {\n if (!this.checkForLimits(n[k][m])) {\n n[k][m] = \" \"\n }\n }\n }\n }\n\n // set all cells left of leftmost to null\n if(this.prevLeftmost < this.leftmost) {\n for (let k = 0; k < this.rows; k++) {\n for (let m = 0; m < this.leftmost; m++) {\n n[k][m] = null\n }\n }\n }\n\n this.setState({cells: n});\n }", "drawMatrix(dontUpdateScale) {\n\n\t\t\t// Get row scale\n\t\t\tif (!dontUpdateScale) {\n\t\t\t\tthis._columnScale = this._createColumnScale();\n\t\t\t\tthis._colorScale = this._createColorScale();\n\t\t\t}\n\n\t\t\tthis._drawRows(this._columnScale.bandwidth());\n\t\t\tthis._drawColumnHeads();\n\n\t\t\tif (!dontUpdateScale) {\n\t\t\t\tthis._updateColumnScale();\n\t\t\t}\n\n\t\t\tthis._updatePositionsAndSizes();\n\n\t\t}", "_drawFrame () {\n \n\n this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height)\n for (let x = 0; x < this.sizeX; x++) {\n for (let y = 0; y < this.sizeY; y++) {\n if (this.matrix[x][y] === -1) {\n this._drawBackgroundSquare(x, y, this.tileWidth, this.deathTileColor)\n this.matrix[x][y] = 0\n } else if (this.matrix[x][y] === 1) {\n this._drawSquare(x, y, this.tileWidth, this.tileColor)\n }\n }\n }\n this._drawMouse()\n }", "updateUI() {\n this.clear();\n this.context.beginPath();\n let cells = this.automaton.cells;\n for(let x = 0; x < cells.length; x++) {\n for(let y = 0; y < cells[x].length; y++) {\n if(cells[x][y]) {\n this.context.fillRect(x*this.cellSize, y*this.cellSize, this.cellSize, this.cellSize);\n }\n }\n }\n this.context.stroke();\n }", "drawGrid() {\n strokeWeight(1);\n stroke(125);\n for(var c = 0; c < this.cols; c++) {\n line(c * this.cellWidth, 0, c * this.cellWidth, height);\n }\n\n for(var r = 0; r < this.rows; r++) {\n line(0, this.cellHeight * r,\n width, this.cellHeight * r);\n }\n }", "draw() { \n // redraw the row that have been modified using the current drawMethod \n for (var i = 0; i < this.charArray.length; i++) {\n if (this.charArray[i].modified) {\n this.charArray[i].modified = false;\n if (this.drawMethod == 'DOM') {\n this.drawRowDOM(i);\n }\n else if (this.drawMethod == 'canvas') {\n this.drawRowCanvas(i);\n }\n }\n }\n\n // reposition the cursor node\n this.cursorNode.style.left = this.cursor.x * this.charWidth + \"px\";\n this.cursorNode.style.top = this.cursor.y * this.charHeight + \"px\";\n }", "step() {\n let i;\n for (i = 0; i < this.cols * this.rows; ++i) {\n this.buff[i] = this.nextState(i);\n }\n let temp = this.buff;\n this.buff = this.cells;\n this.cells = temp;\n }", "function drawCell(cellX, cellY, stat)\n{\n /*if(stat){\n console.log(\"Drawing \" + cellX + \" \" + cellY);\n console.log(stat + \" == \" + boardVals[cellX][cellY] + \" == \" + boardVals[cellY][cellX]);\n }*/\n \n\t//Accounting for the width of the edges and the weirdness at the very edges of the field\n\tvar edgeAddX = (cellX == 0) ? 0 : 1;\n\tvar edgeAddY = (cellY == 0) ? 0 : 1;\n\tvar edgeSubX = (cellX == (cellXCount - 1)) ? 0 : 2;\n\tvar edgeSubY = (cellY == (cellYCount - 1)) ? 0 : 2;\n\n\t\n\tboardVals[cellY][cellX] = stat;\n\tif(stat)\n\t{\n\t\t//console.log(cellX + \" \" + cellY + \": \" + stat);\n\t\t//ctx.strokeStyle = \"black\";\n\t\tctx.fillRect(cellX * cellSide + edgeAddX, cellY * cellSide + edgeAddY, cellSide - edgeSubX + !edgeAddX, cellSide - edgeSubY + !edgeAddY);\n\t}\n\telse\n\t{\n\t\t//console.write(cellX + \" \" + cellY + \": \" + stat);\n\t\t//ctx.strokeStyle = \"white\";\n\t\tctx.clearRect(cellX * cellSide + edgeAddX, cellY * cellSide + edgeAddY, cellSide - edgeSubX + !edgeAddX, cellSide - edgeSubY + !edgeAddY);\n\t}\n}", "col_row_offset_from_offset(offset) {\n return [\n this.cell_from_offset(this.cell_width, offset.left),\n this.cell_from_offset(this.cell_height, offset.top),\n ];\n }", "function initialDrawGrid() {\n for (r = 0; r < ROW; r++) {\n for (c = 0; c < COLUMN; c++) {\n initialDrawSquare(c, r, grid[r][c]);\n }\n }\n}", "function drawGrid ( ctx ) {\n\n var yM = FIELD_HEIGHT,\n xM = FIELD_WIDTH,\n y, x;\n\n for ( y = 0; y < yM; y += ELEMENT_SIZE ) {\n\n ctx.moveTo( y, 0 );\n ctx.lineTo( y, xM );\n\n for ( x = 0; x < xM; x += ELEMENT_SIZE ) {\n\n ctx.moveTo( 0, x );\n ctx.lineTo( yM, x );\n }\n }\n\n ctx.stroke();\n }", "function starWars(canvas, margin, pixelsPerCell, busyBorders, wrapBorders) {\n var W = 2*margin + ~~(canvas.width / pixelsPerCell);\n var H = 2*margin + ~~(canvas.height / pixelsPerCell);\n\n var peacefulCell = function (x, y) {\n if (0 <= x && x < W && 0 <= y && y < H) {\n return this.data[y*W+x];\n }\n return 0;\n };\n var wrapCell = function (x, y) {\n x = (x + W) % W;\n y = (y + H) % H;\n return this.data[y*W+x];\n };\n var busyCell = function (x, y) {\n if (0 <= x && x < W && 0 <= y && y < H) {\n return this.data[y*W+x];\n } else if (y < 0) {\n return 0x4 + Math.round(Math.random());\n } else if (y >= H) {\n return 0x8 + Math.round(Math.random());\n }\n return 0;\n };\n\n var result = {\n W: W,\n H: H,\n Margin: margin,\n data: null,\n initial_data: null,\n displayIndices: null,\n randomize: function() {\n var result = Array(W*H);\n for (var i = 0; i < result.length; ++i) {\n result[i] = Math.round(Math.random());\n }\n this.initial_data = result;\n this.reset();\n },\n initializeWithPattern: function (pattern) {\n var result = new Array(W*H).fill(0);\n var PH = pattern.length;\n for (var py = 0; py < PH; ++py) {\n var PW = pattern[py].length;\n for (var px = 0; px < PW; ++px) {\n var x = ((W - PW) >> 1) + px;\n var y = ((H - PH) >> 1) + py;\n result[y*W+x] = pattern[py][px];\n }\n }\n this.initial_data = result;\n this.reset();\n },\n reset: function() {\n this.data = this.initial_data.slice();\n },\n clear: function() {\n this.data = Array(W*H).fill(0);\n },\n cell: busyBorders ? busyCell : wrapBorders ? wrapCell : peacefulCell,\n is_live_cell: function (x, y) {\n return (this.cell(x, y) & 3) == 1;\n },\n live_cell_should_continue_living: function (x, y) {\n var count = (\n this.is_live_cell(x-1, y-1) + this.is_live_cell(x, y-1) + this.is_live_cell(x+1, y-1) +\n this.is_live_cell(x-1, y) + this.is_live_cell(x+1, y) +\n this.is_live_cell(x-1, y+1) + this.is_live_cell(x, y+1) + this.is_live_cell(x+1, y+1)\n );\n return (count == 3 || count == 4 || count == 5);\n },\n faction_of_cell: function (x, y) {\n var c = this.cell(x, y);\n if (c == 0x0 + 1) return 1;\n if (c == 0x4 + 1) return 2;\n if (c == 0x8 + 1) return 3;\n return 0;\n },\n dead_cell_should_start_living: function (x, y) {\n var counts = [0, 0, 0, 0];\n counts[this.faction_of_cell(x-1, y-1)] += 1;\n counts[this.faction_of_cell(x , y-1)] += 1;\n counts[this.faction_of_cell(x+1, y-1)] += 1;\n counts[this.faction_of_cell(x-1, y )] += 1;\n counts[this.faction_of_cell(x+1, y )] += 1;\n counts[this.faction_of_cell(x-1, y+1)] += 1;\n counts[this.faction_of_cell(x , y+1)] += 1;\n counts[this.faction_of_cell(x+1, y+1)] += 1;\n if (counts[1] + counts[2] + counts[3] == 2) {\n if (counts[1] == 2) return 1;\n if (counts[2] == 0) return 3;\n if (counts[3] == 0) return 2;\n return 1;\n }\n return 0;\n },\n tweak_one_random_cell: function () {\n var i = Math.floor(Math.random() * (W*H)) % (W*H);\n this.data[i] = (this.data[i] & ~3) | ((this.data[i] + 1) & 3);\n },\n next_step: function () {\n var result = Array(W*H);\n for (var x = 0; x < W; ++x) {\n for (var y = 0; y < H; ++y) {\n var c = this.cell(x, y);\n if (c == 0) {\n var faction = this.dead_cell_should_start_living(x, y);\n if (faction != 0) {\n result[y*W+x] = 1 + ((faction - 1) << 2);\n } else {\n result[y*W+x] = 0;\n }\n } else if ((c & 3) == 1) {\n if (this.live_cell_should_continue_living(x, y)) {\n result[y*W+x] = c;\n } else {\n result[y*W+x] = c + 1;\n }\n } else if ((c & 3) == 2) {\n result[y*W+x] = c + 1;\n } else {\n result[y*W+x] = 0;\n }\n }\n }\n this.data = result;\n },\n createDisplayIndices: function (canvas) {\n // This function should be called whenever the canvas is resized.\n var datalength = canvas.width * canvas.height;\n this.displayIndices = Array(datalength);\n for (var i = 0; i < datalength; ++i) {\n var cy = ~~(i / canvas.width);\n var cx = i % canvas.width;\n var py = margin + ~~((H - 2*margin) * cy / canvas.height);\n var px = margin + ~~((W - 2*margin) * cx / canvas.width);\n this.displayIndices[i] = py*W+px;\n }\n },\n display: function (canvas) {\n var context = canvas.getContext('2d');\n var imageData = context.getImageData(0, 0, canvas.width, canvas.height);\n var data = imageData.data;\n console.assert(data.length == canvas.width * canvas.height * 4);\n var datalength = canvas.width * canvas.height;\n var indices = this.displayIndices;\n console.assert(datalength == indices.length);\n for (var i = 0; i < datalength; ++i) {\n var color = this.data[indices[i]];\n data[4*i+0] = [32, 255, 192, 128, 32, 255, 255, 255, 32, 0, 0, 0][color];\n data[4*i+1] = [32, 64, 0, 0, 32, 255, 128, 0, 32, 255, 255, 32][color];\n data[4*i+2] = [32, 255, 192, 128, 32, 0, 0, 0, 32, 0, 128, 255][color];\n data[4*i+3] = 255;\n }\n context.putImageData(imageData, 0, 0);\n },\n draw_dragging_through: function (x, y) {\n console.assert(0 <= x && x < W);\n console.assert(0 <= y && y < H);\n this.data[y*W+x] += 1;\n this.data[y*W+x] %= 4;\n },\n };\n result.createDisplayIndices(canvas);\n return result;\n}", "function paint_cell(x, y, color) {\n ctx.fillStyle = color;\n ctx.fillRect(x * cw, y * cw, cw, cw);\n ctx.strokeStyle = \"white\";\n ctx.strokeRect(x * cw, y * cw, cw, cw);\n }", "render(cellX, cellY, cellWidth, cellHeight, color) {\n let startX = cellX * this.pixelWidth - this.x;\n let startY = cellY * this.pixelWidth - this.y;\n drawRect(startX, startY, cellWidth * this.pixelWidth, cellHeight * this.pixelWidth, color);\n }", "drawCell({x, y}) {\n this.boardContext.rect(\n x * this.cellSize,\n y * this.cellSize,\n this.cellSize,\n this.cellSize\n );\n this.boardContext.fillStyle = \"#000\";\n this.boardContext.fill();\n }", "function remake_cells(){\n cells = new Array() ;\n for(var i=0 ; i<nRows ; i++){\n cells.push(new Array()) ;\n for(var j=0 ; j<nCols ; j++){\n cells[i].push([0,0,0]) ;\n }\n }\n}", "function render() {\n loop(function (row, col) {\n x = (col * tileSize);\n y = (row * tileSize);\n\n // draw placements\n if (map[row][col] == 1) {\n context.fillStyle = \"#aa0000\";\n context.fillRect(x + tileOffset, y + tileOffset, tileSize - tileOffset, tileSize - tileOffset);\n }\n });\n }", "function drawGrid(grid,width,height,xOffset,yOffset){ //OFFSETS DONT WORK, PLEASE FIX LATER\n\tfor(var x=1;x<width;x++){\n\t\tfor(var y=1;y<height;y++){\n\t\t\tdrawTile(grid[x][y][\"entityContent\"][\"name\"]+\".png\",x,y);\n\t\t}\n\t}\n}", "function drawGrid() {\n\t\tcontext.fillStyle = GRID_COLOR;\n\t\tfor (var i = GRID_CELL_WIDTH; i < canvas.width; i = i + GRID_CELL_WIDTH) {\n\t\t\tfor (var j = GRID_CELL_WIDTH; j < canvas.height; j = j + GRID_CELL_WIDTH) {\n\t\t\t\tcontext.fillRect(i, j, 1, 1);\n\t\t\t}\n\t\t}\n\t}", "function /*DEPRECATEDs*/\r\n\tpaint_cell(x, y, color1) {\r\n\r\n\t\tvar tpoint = traslate_point(x, y);\r\n\t\tx = tpoint.x;\r\n\t\ty = tpoint.y;\r\n\r\n\t\t// calcolo le dimensioni in base alla prospettiva\r\n\r\n\r\n\t\t//trovo la dimensione del punto da disegnare PROPORZIOnale alla distanza da me\r\n\t\tpcw = (1 - distanza(center.x, center.y, x, y) / default_dist) * cw;\r\n\t\t// pcw=cw;\r\n\t\tif (!(x == -1 || x == w || y == -1 || y == h)) {\r\n\r\n\t\t\thpcw = pcw / 2; //half pcw , x e y sono il centro\r\n\r\n\t\t\tctx.fillStyle = color1;\r\n\t\t\tctx.fillRect(x - hpcw, (y) - hpcw, pcw, pcw);\r\n\t\t\tctx.strokeStyle = \"white\";\r\n\t\t\tctx.strokeRect(x - hpcw, y - hpcw, pcw, pcw);\r\n\r\n\t\t\t//\t ctx.fillText(\" X\"+x*cw+\" Y\"+y*cw+\" offset.y/cw\"+offset.y/cw+\"y-((me.y )/cw)\"+(y-((me.y )/cw))+\" T\"+offset.t, x*cw, y*cw);\r\n\r\n\t\t}\r\n\t\t//ctx.fillText(\" me.y\"+me.y+\" me.x\"+me.x +\" offset.t\"+ offset.t+\" cos\"+Math.cos(gradiToRadianti(360-offset.t)) +\" sin\"+Math.sin(gradiToRadianti(360-offset.t)) , 25, 25);\r\n\t}", "fillCells(cellsY, cellsX, pattern){\n \n // console.log('[pattern]', pattern);\n this.cells = new Array(cellsY);\n for (let y = 0; y<cellsY; y++){\n this.cells[y] = new Array(cellsX)\n for (let x = 0; x<cellsX; x++){\n this.cells[y][x]= new Cell(pattern[y][x], y, x, this.cellWidth, this.cellHight, this.node);\n }\n }\n // console.log('[this.cells]', this.cells);\n\n }", "createBdryGrid() {\n this.p.push()\n let rows = this.rows / this.scale\n let cols = this.cols / this.scale\n let cellSize = this.cellSize * this.scale\n\n this.p.stroke(200,200,200)\n\n for (let i=0; i<=cols; i++) {\n let x = this.x + cellSize*i\n this.p.line(x,this.y, x, this.y +this.h)\n \n }\n\n for (let i=0; i<=rows; i++) {\n let y = this.y + cellSize*i\n this.p.line(this.x, y, this.x+this.w, y)\n }\n this.p.pop()\n }", "function drawGrid() {\n noFill();\n stroke(230, 50);\n strokeWeight(2);\n\n for (let j = 0; j < config.numRows; j++) {\n for (let i = 0; i < config.numCols; i++) {\n rect(i * colWidth, j * rowHeight, colWidth, rowHeight)\n }\n }\n }", "_draw() {\n this.grid = [];\n\n for (let i = 0; i < this.gridSize; i++) {\n const row = [];\n\n const y = this.hexagonHeight/2 + 5 + i * this.hexagonHeight * 3/4;\n const x_offset = i * this.hexagonWidth/2;\n\n for (let j = 0; j < this.gridSize; j++) {\n\n if (this._isCornerCell(i, j) && !this.drawCorners) {\n row.push(null);\n continue;\n }\n\n const x = this.hexagonWidth/2 + 5 + j * this.hexagonWidth;\n\n const points = this._getPoints(x + x_offset, y);\n\n const hexagon = this.elem.append('path')\n .attr('d', this._hexagonPathGenerator(points))\n .attr('stroke', 'grey')\n .attr('stroke-width', 2)\n .attr('fill', () => this._isCornerCell(i, j) ? '#ff9482' : 'none');\n\n row.push({x: x + x_offset, y: y, hexagon: hexagon});\n\n if (!this.drawText) {\n continue;\n }\n\n this.elem.append('text')\n .attr('x', x + x_offset)\n .attr('y', y)\n .attr('font-family', 'sans-serif')\n .attr('font-size', '12px')\n .attr('text-anchor', 'middle')\n .attr('dominant-baseline', 'middle')\n .text(`${i},${j}`);\n }\n\n this.grid.push(row);\n }\n }", "drawGrid() {\n translate(this.xOffset, this.yOffset);\n background(color('black'));\n for (let x = 0; x <= this.width; x++) {\n\n for (let y = 0; y <= this.height; y++) {\n fill(color('white'))\n strokeWeight(1);\n rect(x * this.boxSize, y * this.boxSize, this.boxSize, this.boxSize);\n\n // Draw the position of the entry\n fill(color('gray'));\n if (this.gridLayout[x][y] != null)\n text(x + \",\" + y + \"\\n\" + this.gridLayout[x][y].name, x * this.boxSize, y * this.boxSize, this.boxSize, this.boxSize);\n else\n text(x + \",\" + y + \"\\n\", x * this.boxSize, y * this.boxSize, this.boxSize, this.boxSize);\n }\n }\n }", "function paintMatrixImage(canvasID, matrixCoords, dispCoords, visData) {\n //console.log(arguments.callee.name);\n //console.log(matrixCoords);\n //console.log(dispCoords);\n xStart = (matrixCoords[0]);\n yStart = (matrixCoords[1]);\n xStop = (matrixCoords[2]);\n yStop = (matrixCoords[3]);\n visData.avgSize = 1;\n var span = (visData.avgSize - 1) / 2;\n\n // Calculate the width and height of the matrix (or submatrix) which should be painted\n var xLength = (xStop - xStart);\n var yLength = (yStop - yStart);\n var l = 0;\n var index = 0;\n var pi = 0;\n var color = [0, 0, 0];\n var pixelIndex = 0;\n\n xxLength = Math.round(xLength / visData.avgSize);\n yyLength = Math.round(yLength / visData.avgSize);\n\n var imageData = visData.paintMatrixContext.createImageData(xxLength, yyLength);\n xStart = Math.round(xStart);\n xStop = Math.round(xStop);\n yStart = Math.round(yStart);\n yStop = Math.round(yStop);\n\n for (var y = 0; y < imageData.height; y++) {\n for (var x = 0; x < imageData.width; x++) {\n if (map[y * visData.avgSize][x * visData.avgSize] != -1) {}\n }\n }\n var imgx = 0;\n var imgy = 0;\n for (var x = xStart + span; x < xStop - span; x += vizObj.avgSize) {\n imgy = 0;\n for (var y = yStart + span; y < yStop - span; y += vizObj.avgSize) {\n if (map[y][x] != -1) {\n pixelIndex = ((imgy * (imageData.width * 4)) + (imgx * 4));\n color = gradientRGB[colors[y][x]];\n if (!color) {\n imageData.data[pixelIndex + 3] = 0;\n } else {\n imageData.data[pixelIndex] = color[0];\n imageData.data[pixelIndex + 1] = color[1];\n imageData.data[pixelIndex + 2] = color[2];\n imageData.data[pixelIndex + 3] = 255;\n }\n }\n imgy++;\n }\n imgx++;\n }\n\n var dx = dispCoords[0];\n var dy = dispCoords[1];\n var dirtyX = 0;\n var dirtyY = 0;\n var dirtyWidth = dispCoords[2] - dx;\n var dirtyHeight = dispCoords[3] - dy;\n var newCanvas = $(\"<canvas>\").attr(\"width\", imageData.width).attr(\"height\", imageData.height)[0];\n newCanvas.getContext(\"2d\").putImageData(imageData, 0, 0);\n visData.paintMatrixContext.drawImage(newCanvas, dx, dy, dirtyWidth, dirtyHeight);\n}", "function redraw() {\n var i, j, str, myEl, x, val;\n for(i = 0; i < size; i++) {\n for(j = 0; j < size; j++) {\n x = 4*i + j;\n str = \"\" + x;\n myEl = document.getElementById(str);\n if(mat[i][j] !== 0) {\n val = \"\" + mat[i][j];\n myEl.innerHTML = val;\n changeTileColor(str, mat[i][j]);\n }\n else {\n val = \"\";\n myEl.innerHTML = val;\n myEl.style.backgroundColor = \"rgb(205, 193, 180)\";\n }\n }\n } \n }", "function generateCanvasMatrix() {\n\n gameState.numberOfColumns = GAME_CONFIG.CANVAS_SIZE.WIDTH / GAME_CONFIG.CELL_SIDE_SIZE;\n gameState.numberOfRows = GAME_CONFIG.CANVAS_SIZE.HEIGHT / GAME_CONFIG.CELL_SIDE_SIZE;\n\n let canvasMatrix = Array.from(Array(gameState.numberOfColumns), () => new Array(gameState.numberOfRows));\n for (let widthIndex = 0; widthIndex < gameState.numberOfColumns; widthIndex++) {\n for (let heightIndex = 0; heightIndex < gameState.numberOfRows; heightIndex++) {\n if (GAME_CONFIG.MAX_NUMBER_OF_STARTING_CELLS > gameState.aliveCells) {\n let randomNumber = Math.floor(random(GAME_CONFIG.RANDOM_CELL_QUOTA));\n if (randomNumber === 1) {\n gameState.aliveCells++;\n canvasMatrix[widthIndex][heightIndex] = randomNumber;\n } else {\n canvasMatrix[widthIndex][heightIndex] = 0;\n }\n } else {\n canvasMatrix[widthIndex][heightIndex] = 0;\n }\n }\n }\n gameState.currentCanvas = canvasMatrix;\n gameState.oldcanvas = canvasMatrix;\n}", "function drawMatrix(rows, cols, matrix) {\n var stage = $('#stage').html('');\n for (var r = 0; r < rows; r += 1) {\n var row = $('<div class=\"row\"></div>').appendTo(stage);\n for (var c = 0; c < cols; c += 1) {\n var col = $('<div class=\"col\"></div>').appendTo(row);\n if (matrix[r][c] == true) {\n col.addClass('black');\n }\n }\n }\n }", "function constructMarkedCell() {\n this.x = -1;\n this.y = -1; }", "function drawBoard()\n{\n for(var i = 0; i < cps; i++)\n {\n for(var j = 0; j < cps; j++)\n {\n\n drawCell(i, j, boardVals[j][i]);\n }\n }\n}" ]
[ "0.7344852", "0.711648", "0.7114928", "0.705269", "0.7050805", "0.6993967", "0.6512643", "0.62977177", "0.62860906", "0.6273997", "0.62422884", "0.62270874", "0.62022066", "0.6097551", "0.6079596", "0.6067703", "0.6043228", "0.59734", "0.597086", "0.595872", "0.5955974", "0.59468865", "0.5926543", "0.5923128", "0.5892759", "0.5878135", "0.5865665", "0.5850228", "0.5845759", "0.5841537", "0.58387357", "0.579512", "0.57615775", "0.57493275", "0.5746601", "0.5741356", "0.57397175", "0.57284415", "0.57258844", "0.5722752", "0.572172", "0.5713761", "0.5707252", "0.56998944", "0.5699472", "0.5695402", "0.5685399", "0.5684066", "0.5677834", "0.5672866", "0.5665692", "0.56625074", "0.5648422", "0.5648422", "0.5648422", "0.56401515", "0.56377304", "0.5637323", "0.5637099", "0.5636583", "0.56327266", "0.56266373", "0.5608306", "0.56049275", "0.55979156", "0.55973417", "0.55929273", "0.5592919", "0.5591645", "0.55815935", "0.5579123", "0.5576581", "0.5573877", "0.5569276", "0.55689406", "0.5563775", "0.55631065", "0.55568635", "0.55560124", "0.55401653", "0.55368733", "0.5531748", "0.5531406", "0.5525905", "0.5525084", "0.5522908", "0.5516752", "0.551649", "0.55141366", "0.5507666", "0.5506517", "0.5506484", "0.54976463", "0.5496095", "0.5486364", "0.5484384", "0.54819036", "0.54742604", "0.54734945", "0.5465685" ]
0.57246244
39
Returns true if the supplies object has no properties.
function isEmpty(obj) { for (var key in obj) { if (obj.hasOwnProperty(key)) { return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isEmptyProperties( props ) {\n for (var k in props) {\n if (!props.hasOwnProperty(k)) {\n continue;\n }\n return false;\n }\n return true;\n}", "_emptyProp (propName) {\n return !this[propName] || (typeof this[propName] === 'object' && Object.keys(this[propName]).length === 0)\n }", "function _isEmpty(obj) {\n for(var prop in obj) {\n if(obj.hasOwnProperty(prop))\n return false;\n }\n return true;\n }", "function isEmpty(objeto){\n\tfor (var prop in objeto) { \n\t\tif (objeto.hasOwnProperty(prop)) return false; \n\t} \n\treturn true;\n}", "function isEmpty(obj) {\n for (prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n return false;\n }\n }\n return true;\n }", "function isEmpty(obj) \n\t \t{\n\t\t for(var prop in obj) {\n\t\t if(obj.hasOwnProperty(prop))\n\t\t return false;\n\t\t }\n\n\t\t return true;\n\t\t}", "hasProps(obj) {\n const size = this.size;\n\n for (let i = 0; i < size; ++i) {\n const prop = this.getProp(obj, i);\n\n if (prop === null || prop === undefined) {\n return false;\n }\n }\n\n return true;\n }", "function isEmpty(obj) {\n for (var prop in obj) {\n if (obj.hasOwnProperty(prop)) return false;\n }\n\n return true;\n }", "function isEmpty(obj) {\n for (var prop in obj) {\n if (obj.hasOwnProperty(prop)) return false;\n }\n\n return true;\n }", "isEmpty(obj) {\n return Object.keys(obj).length === 0;\n }", "isEmpty(obj) {\n return Object.keys(obj).length === 0;\n }", "function isEmpty(obj) {\n\t\t\tfor(var prop in obj) {\n\t\t\t\tif(obj.hasOwnProperty(prop))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}", "function isEmpty(obj) {\n\t\tfor(var prop in obj) {\n\t\t\tif(obj.hasOwnProperty(prop))\n\t\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "function emptyObject (data) {\n return object(data) && Object.keys(data).length === 0;\n }", "function isEmpty(obj){\r\n \r\n if(typeof obj === 'undefined'){\r\n return true;\r\n } \r\n\r\n return Object.keys(obj).length === 0;\r\n}", "isEmpty() {\n\t\treturn Object.keys(this.items).length == 0\n\t}", "function hasEmptyProperties(target) {\n for (var member in target) {\n if(member == \"index\" || member == \"formatted\"){\n continue;\n }\n if (target[member] == \"\"){\n return true;\n }\n }\n return false;\n }", "function nonEmptyObject (data) {\n return object(data) && Object.keys(data).length > 0;\n }", "function isEmpty(obj) {\n\tfor(var prop in obj) {\n\t\tif(obj.hasOwnProperty(prop))\n\t\t\treturn false;\n\t}\n\treturn true;\n}", "function checkEmptyObject(obj) {\n return Object.keys(obj).length <= 0;\n }", "function emptyObject (data) {\n return object(data) && Object.keys(data).length === 0;\n }", "function isEmpty(obj) {\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) return false;\n }\n return true;\n }", "function objectHasProperties(obj) {\n return Object.keys(obj).length > 0;\n}", "isEmpty(obj) {\n for(var key in obj) {\n if(obj.hasOwnProperty(key))\n return false;\n }\n return true;\n }", "isEmpty(obj) {\n for(var key in obj) {\n if(obj.hasOwnProperty(key))\n return false;\n }\n return true;\n }", "function isEmpty(obj) {\n return Object.keys(obj).length === 0;\n}", "function isEmpty(obj) {\r\n for(var prop in obj) {\r\n if(obj.hasOwnProperty(prop))\r\n return false;\r\n }\r\n return true;\r\n}", "function isEmpty(obj) {\n return Object.keys(obj).length === 0;\n}", "function isEmpty(obj) {\n return Object.keys(obj).length === 0;\n}", "function isEmpty(obj) {\n return Object.keys(obj).length === 0;\n}", "function isEmpty(obj) {\n for (var prop in obj) {\n if (obj.hasOwnProperty(prop)) return false;\n }\n return true;\n}", "function isObjEmpty(obj) {\n for (let prop in obj) {\n if (obj.hasOwnProperty(prop))\n return false;\n }\n return true;\n }", "function isEmpty(obj) {\n for (var key in obj) {\n if (obj.hasOwnProperty(key))\n return false;\n }\n return true;\n }", "function isEmptyObject(obj) {\n\t\t\t\tfor (var prop in obj) {\n\t\t\t\t\tif(obj.hasOwnProperty(prop)) return false; \n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}", "function isEmptyDataObject(obj) {\n for (var name in obj) {\n if (name !== \"toJSON\") {\n return false;\n }\n }\n\n return true;\n }", "function isEmpty(obj) {\n for (var prop in obj) {\n if (obj.hasOwnProperty(prop))\n return false;\n }\n return true;\n}", "function isEmpty(obj) {\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) return false;\n }\n return true;\n }", "function isEmpty(obj) {\n for (var key in obj) {\n if (obj.hasOwnProperty(key))\n return false;\n }\n return true;\n }", "function isEmpty(obj) {\n for (var key in obj) {\n if (obj.hasOwnProperty(key))\n return false;\n }\n return true;\n }", "function isEmpty(obj) {\n for (var key in obj) {\n if (obj.hasOwnProperty(key))\n return false;\n }\n return true;\n }", "function isEmpty(obj) {\n for(var key in obj) {\n if(obj.hasOwnProperty(key))\n return false;\n }\n return true;\n }", "static isEmpty(obj) {\r\n for(var key in obj) {\r\n if(obj.hasOwnProperty(key)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "function isEmptyObject(obj) {\n return Object.keys(obj).length === 0;\n}", "function isEmpty(obj) {\n return Object.keys(obj).length === 0 && obj.constructor === Object\n}", "function isEmpty(obj) {\n for(var prop in obj) {\n if(obj.hasOwnProperty(prop))\n return false;\n }\n\n return true;\n}", "function isEmpty(obj) {\n return Object.keys(obj).length === 0 && obj.constructor === Object;\n}", "function isEmpty (obj) {\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) {\n return false\n }\n }\n return true\n }", "function empty_obj(obj) {\n for (var key in obj) {\n if (hasOwnProperty.call(obj, key)) return false;\n }\n return true;\n}", "function isEmpty(obj) {\r\n for(var key in obj) {\r\n if(obj.hasOwnProperty(key))\r\n return false;\r\n }\r\n return true;\r\n }", "function isEmpty(obj) {\n return !obj || Object.keys(obj).length === 0;\n }", "function isEmptyDataObject( obj ) {\n\tfor ( var name in obj ) {\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function isEmptyDataObject( obj ) {\n\tfor ( var name in obj ) {\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function isEmptyDataObject( obj ) {\n\tfor ( var name in obj ) {\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function isEmptyDataObject( obj ) {\n\tfor ( var name in obj ) {\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "isEmpty(obj){\n return !Object.keys(obj).length;\n }", "function paramIsEmpty(paramObj) {\n\treturn Object.keys(paramObj).length === 0;\n}", "function isEmptyObject(obj) {\n return !Object.keys(obj).length;\n }", "function _isEmptyObject(obj) {\n var name;\n\n for (name in obj) {\n return false;\n }\n return true;\n }", "function _isEmptyObject(obj) {\n var name;\n\n for (name in obj) {\n return false;\n }\n return true;\n }", "function isEmptyDataObject(obj) {\n var name;\n for (name in obj) {\n\n // if the public data object is empty, the private is still empty\n if (name === \"data\" && jQuery.isEmptyObject(obj[name])) {\n continue;\n }\n if (name !== \"toJSON\") {\n return false;\n }\n }\n\n return true;\n }", "function isEmptyDataObject( obj ) {\n var name;\n for ( name in obj ) {\n \n // if the public data object is empty, the private is still empty\n if ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n continue;\n }\n if ( name !== \"toJSON\" ) {\n return false;\n }\n }\n \n return true;\n }", "function isEmptyDataObject( obj ) {\r\r\n\tvar name;\r\r\n\tfor ( name in obj ) {\r\r\n\r\r\n\t\t// if the public data object is empty, the private is still empty\r\r\n\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\r\r\n\t\t\tcontinue;\r\r\n\t\t}\r\r\n\t\tif ( name !== \"toJSON\" ) {\r\r\n\t\t\treturn false;\r\r\n\t\t}\r\r\n\t}\r\r\n\r\r\n\treturn true;\r\r\n}", "function isEmptyDataObject( obj ) {\n\t var name;\n\t for ( name in obj ) {\n\n\t // if the public data object is empty, the private is still empty\n\t if ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t continue;\n\t }\n\t if ( name !== \"toJSON\" ) {\n\t return false;\n\t }\n\t }\n\n\t return true;\n\t}", "function isEmptyDataObject( obj ) {\n var name;\n for ( name in obj ) {\n\n // if the public data object is empty, the private is still empty\n if ( name === \"data\" && jQuery.isEmptyObject( obj[ name ] ) ) {\n continue;\n }\n if ( name !== \"toJSON\" ) {\n return false;\n }\n }\n\n return true;\n }", "function isEmptyDataObject( obj ) {\n var name;\n for ( name in obj ) {\n\n // if the public data object is empty, the private is still empty\n if ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n continue;\n }\n if ( name !== \"toJSON\" ) {\n return false;\n }\n }\n\n return true;\n }", "function isEmptyDataObject(obj) {\r\n\t\tvar name;\r\n\t\tfor (name in obj) {\r\n\r\n\t\t\t// if the public data object is empty, the private is still empty\r\n\t\t\tif (name === \"data\" && jQuery.isEmptyObject(obj[name])) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif (name !== \"toJSON\") {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}", "function isEmptyDataObject( obj ) {\n\tvar name;\n\tfor ( name in obj ) {\n\n\t\t// if the public data object is empty, the private is still empty\n\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function isEmptyDataObject( obj ) {\n\tvar name;\n\tfor ( name in obj ) {\n\n\t\t// if the public data object is empty, the private is still empty\n\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function isEmptyDataObject( obj ) {\n\tvar name;\n\tfor ( name in obj ) {\n\n\t\t// if the public data object is empty, the private is still empty\n\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function isEmptyDataObject( obj ) {\n\tvar name;\n\tfor ( name in obj ) {\n\n\t\t// if the public data object is empty, the private is still empty\n\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function isEmptyDataObject( obj ) {\n\tvar name;\n\tfor ( name in obj ) {\n\n\t\t// if the public data object is empty, the private is still empty\n\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function isEmptyDataObject( obj ) {\n\tvar name;\n\tfor ( name in obj ) {\n\n\t\t// if the public data object is empty, the private is still empty\n\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function isEmptyDataObject( obj ) {\n\tvar name;\n\tfor ( name in obj ) {\n\n\t\t// if the public data object is empty, the private is still empty\n\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function isEmptyDataObject( obj ) {\n\tvar name;\n\tfor ( name in obj ) {\n\n\t\t// if the public data object is empty, the private is still empty\n\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function isEmptyDataObject( obj ) {\n\tvar name;\n\tfor ( name in obj ) {\n\n\t\t// if the public data object is empty, the private is still empty\n\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function isEmptyDataObject( obj ) {\n\tvar name;\n\tfor ( name in obj ) {\n\n\t\t// if the public data object is empty, the private is still empty\n\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function isEmptyDataObject( obj ) {\n\tvar name;\n\tfor ( name in obj ) {\n\n\t\t// if the public data object is empty, the private is still empty\n\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function isEmptyDataObject( obj ) {\n\tvar name;\n\tfor ( name in obj ) {\n\n\t\t// if the public data object is empty, the private is still empty\n\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function isEmptyDataObject( obj ) {\n\tvar name;\n\tfor ( name in obj ) {\n\n\t\t// if the public data object is empty, the private is still empty\n\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function isEmptyDataObject( obj ) {\n\tvar name;\n\tfor ( name in obj ) {\n\n\t\t// if the public data object is empty, the private is still empty\n\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function isEmptyDataObject( obj ) {\n\tvar name;\n\tfor ( name in obj ) {\n\n\t\t// if the public data object is empty, the private is still empty\n\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function isEmptyDataObject( obj ) {\n\tvar name;\n\tfor ( name in obj ) {\n\n\t\t// if the public data object is empty, the private is still empty\n\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function isEmptyDataObject( obj ) {\n\tvar name;\n\tfor ( name in obj ) {\n\n\t\t// if the public data object is empty, the private is still empty\n\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function isEmptyDataObject( obj ) {\n\tvar name;\n\tfor ( name in obj ) {\n\n\t\t// if the public data object is empty, the private is still empty\n\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function isEmptyDataObject( obj ) {\n\tvar name;\n\tfor ( name in obj ) {\n\n\t\t// if the public data object is empty, the private is still empty\n\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function isEmptyDataObject( obj ) {\n\tvar name;\n\tfor ( name in obj ) {\n\n\t\t// if the public data object is empty, the private is still empty\n\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function isEmptyDataObject( obj ) {\n\tvar name;\n\tfor ( name in obj ) {\n\n\t\t// if the public data object is empty, the private is still empty\n\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function isEmptyDataObject( obj ) {\n\tvar name;\n\tfor ( name in obj ) {\n\n\t\t// if the public data object is empty, the private is still empty\n\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function isEmptyDataObject( obj ) {\n\tvar name;\n\tfor ( name in obj ) {\n\n\t\t// if the public data object is empty, the private is still empty\n\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function isEmptyDataObject( obj ) {\n\tvar name;\n\tfor ( name in obj ) {\n\n\t\t// if the public data object is empty, the private is still empty\n\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function isEmptyDataObject( obj ) {\n\tvar name;\n\tfor ( name in obj ) {\n\n\t\t// if the public data object is empty, the private is still empty\n\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function isEmptyDataObject( obj ) {\n\tvar name;\n\tfor ( name in obj ) {\n\n\t\t// if the public data object is empty, the private is still empty\n\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function isEmptyDataObject( obj ) {\n\tvar name;\n\tfor ( name in obj ) {\n\n\t\t// if the public data object is empty, the private is still empty\n\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function isEmptyDataObject( obj ) {\n\tvar name;\n\tfor ( name in obj ) {\n\n\t\t// if the public data object is empty, the private is still empty\n\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function isEmptyDataObject( obj ) {\n\tvar name;\n\tfor ( name in obj ) {\n\n\t\t// if the public data object is empty, the private is still empty\n\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function isEmptyDataObject( obj ) {\n\tvar name;\n\tfor ( name in obj ) {\n\n\t\t// if the public data object is empty, the private is still empty\n\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function isEmptyDataObject( obj ) {\n\tvar name;\n\tfor ( name in obj ) {\n\n\t\t// if the public data object is empty, the private is still empty\n\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function isEmptyDataObject( obj ) {\n\tvar name;\n\tfor ( name in obj ) {\n\n\t\t// if the public data object is empty, the private is still empty\n\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function isEmptyDataObject( obj ) {\n\tvar name;\n\tfor ( name in obj ) {\n\n\t\t// if the public data object is empty, the private is still empty\n\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function isEmptyDataObject( obj ) {\n\tvar name;\n\tfor ( name in obj ) {\n\n\t\t// if the public data object is empty, the private is still empty\n\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function isEmptyDataObject( obj ) {\n\tvar name;\n\tfor ( name in obj ) {\n\n\t\t// if the public data object is empty, the private is still empty\n\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( name !== \"toJSON\" ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}" ]
[ "0.74720997", "0.7298551", "0.7027249", "0.6921188", "0.6897622", "0.68790996", "0.6873961", "0.6828858", "0.6828858", "0.68222195", "0.68222195", "0.68206567", "0.6760268", "0.6751869", "0.6751688", "0.6738281", "0.6736219", "0.6730328", "0.67226195", "0.6711692", "0.6688229", "0.6635861", "0.662386", "0.6619303", "0.6619303", "0.66190064", "0.66168725", "0.66140264", "0.66140264", "0.66140264", "0.6611256", "0.6607312", "0.6606972", "0.660225", "0.6588046", "0.6585869", "0.6581877", "0.6579886", "0.6579886", "0.6565915", "0.6565812", "0.6560848", "0.65596557", "0.6551926", "0.6550281", "0.65467227", "0.65450525", "0.6539069", "0.6535341", "0.6534683", "0.6532721", "0.6532721", "0.6532721", "0.6532721", "0.6525284", "0.65058136", "0.6502103", "0.6476726", "0.6476726", "0.6476297", "0.6468234", "0.64586544", "0.6456387", "0.6444623", "0.6444292", "0.64417434", "0.64383966", "0.64383966", "0.64383966", "0.64383966", "0.64383966", "0.64383966", "0.64383966", "0.64383966", "0.64383966", "0.64383966", "0.64383966", "0.64383966", "0.64383966", "0.64383966", "0.64383966", "0.64383966", "0.64383966", "0.64383966", "0.64383966", "0.64383966", "0.64383966", "0.64383966", "0.64383966", "0.64383966", "0.64383966", "0.64383966", "0.64383966", "0.64383966", "0.64383966", "0.64383966", "0.64383966", "0.64383966", "0.64383966", "0.64383966", "0.64383966" ]
0.0
-1
Resizes the window to the current dimensions of this page's body.
function resizeWindow() { window.setTimeout(function() { chrome.tabs.getCurrent(function (tab) { var newHeight = Math.min(document.body.offsetHeight + 140, 700); chrome.windows.update(tab.windowId, { height: newHeight, width: 520 }); }); }, 150); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function windowResized() {\n\n getWrapperWidth();\n resizeCanvas(wrapperWide, wrapperWide);\n\n widthVar = (width - 40) / 100;\n drawArea = (width - 40);\n\n switchBox();\n}", "function windowResized() {\n\twindowW = window.innerWidth;\n\twindowH = window.innerHeight;\n resizeCanvas(window.innerWidth, window.innerHeight);\n}", "function windowResized () {\n\tresizeCanvas(windowWidth, windowHeight);\n }", "function windowResized () {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth/4, windowHeight);\n renderNoteMap();\n}", "function resize() {\n\t\tself.wz.height($(window).height()-self.delta);\n\t\tself.rte.updateHeight();\n\t}", "function resize() {\n\twindowWidth = window.innerWidth;\n\twindowHeight = window.innerHeight;\n renderer.setSize(window.innerWidth,window.innerHeight);\n}", "function resize() {\n\twindowWidth = window.innerWidth;\n\twindowHeight = window.innerHeight;\n renderer.setSize(window.innerWidth,window.innerHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight, false);\n init();\n}", "onWindowResize() {\n\t\tthis.windowHeight = this.getWindowHeight();\n\t\tthis.updatePosition();\n\t}", "function windowResized() {\n // We can use the resizeCanvas() function to resize our canvas to the new window dimensions\n resizeCanvas(windowWidth,windowHeight);\n}", "function windowResized() {\n\tresizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n\tresizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n // retrieve the new client width\n clientWidth = Math.max(200, window.innerWidth - 200);\n aspRatio = 1;\n clientHeight = clientWidth * aspRatio;\n \n // resize the canvas and plot, reposition the GUI \n resizeCanvas(clientWidth, clientHeight);\n examplePlot.GPLOT.setOuterDim(clientWidth, clientHeight);\n examplePlot.GPLOT.setPos(0, 0);\n gui.prototype.setPosition(clientWidth, examplePlot.GPLOT.mar[2]);\n}", "function windowResized() {\n\tresizeCanvas(innerWidth, innerHeight);\n}", "function resizeWindow(event_) {\n\t\t\tclient_height = document.documentElement.clientHeight;\n\t\t\tclient_width = document.documentElement.clientWidth;\n\n\t\t\tgame.resize();\n\t\t}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight, false);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight, false);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight, false);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight, false);\n}", "function windowResized() {\n resizeCanvas(canvasX, canvasY);\n}", "function windowResized() {\n resizeCanvas(width, height);\n}", "function updateDimensions() {\n\n\t\twindowHeight \t\t= main.innerHeight()-350;\n\t\t\n\t\twindowWidth \t\t= virtualhand.innerWidth();\n\n\t\t/*\n\t\t * The three.js area and renderer are resized to fit the page\n\t\t */\n\t\tvar renderHeight \t= windowHeight - 5;\n\n\t\trenderArea.css({width: windowWidth, height: renderHeight});\n\n\t\trenderer.setSize(windowWidth, renderHeight);\n\n\t}", "function windowResized() {\n resizeCanvas(canvasContainer.clientWidth, canvasContainer.clientHeight);\n}", "function windowResized() {\n resizeCanvas(canvasWidth, canvasHeight);\n}", "function windowResized() {\r\n resizeCanvas(windowWidth, windowHeight);\r\n}", "function windowResized() {\r\n resizeCanvas(windowWidth, windowHeight);\r\n}", "updateWindowDimensions() {\n if (this.body != null) {\n this.setState({\n width: this.body.clientWidth,\n height: this.body.clientHeight,\n });\n }\n }", "function resizeWindow() {\n setWindowWidth(window.innerWidth);\n }", "function reset_window_size() {\n\tcurrentWindow.height = 400;\n\tcurrentWindow.width = 600;\n\tcurrentWindow.x = Math.round((screen.width / 2) - 300);\n\tcurrentWindow.y = Math.round((screen.height / 2) - 200);\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 windowResized() {\n\tresizeCanvas(windowWidth, windowHeight);\n\tLogo.resize();\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight)\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight)\n}", "function windowResized() {\r\n resizeCanvas(windowWidth, windowHeight, false);\r\n}", "updateSize() {\n windowWidth = Math.min(\n this.handler.getMaxGameWidth(),\n window.innerWidth\n )\n windowHeight = Math.min(\n this.handler.getMaxGameHeight(),\n window.innerHeight\n )\n this.handler.getGame().setWidth(windowWidth)\n this.handler.getGame().setHeight(windowHeight)\n }", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight - 50);\n}", "function windowResized() {\n\tlet container = document.getElementById(containerID);\n\tif (!container) {\n\t\treturn;\n\t}\n\tresizeCanvas(Math.floor(container.clientWidth), Math.floor(container.clientHeight));\n}", "function windowResized() {\n\tlet w = window.innerWidth / 2;\n\tlet h = window.innerWidth / 2 / 475 * 600;\n\tresizeCanvas(w, h);\n\tcnv.position(window.innerWidth / 2, 0, \"absolute\");\n\t// reposition all shapes back in initial position relative to canvas\n\tinit_shapes();\n}", "function resizeGameWindow()\n{\n Game.engine.scale.setGameSize($( window ).width(), $( window ).height()*0.8);\n}", "function windowResize() {\n dbC = getDBC();\n winSize = {x:(dbC[0])? dbC[0]:window.innerWidth, y:(dbC[1])? dbC[1]:window.innerHeight}\n}", "function set_window_size(left, top, width, height)\n{\n window.moveTo(left, top);\n window.resizeTo(width, height);\n}", "function windowResized(){\n canvas.resize(windowWidth, windowHeight - canvasadjust);\n}", "async resize (width, height) {\n debug('resizing to', width, height)\n this.pageContext.set('viewportSize', {width, height})\n }", "function windowResized() {\n // Get the dimensions of the sketch holder element\n const sketchHolder = document.getElementById('sketch-holder');\n const { width, height } = sketchHolder.getBoundingClientRect();\n \n // Resize the canvas to match the dimensions of the sketch holder element\n resizeCanvas(width, height);\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 handleResize() {\n // Set window width/height to state\n setWindowSize({\n width: window.outerWidth,\n height: window.outerHeight,\n });\n }", "function windowResized() {\n resizeCanvas(innerWidth, innerHeight);\n}", "function windowResized() {\r\n resizeCanvas(windowWidth, windowHeight)\r\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n draw();\n}", "function resize() {\n canvas.height = window.innerHeight\n canvas.width = window.innerWidth\n }", "function resize() {\n var nativePixelRatio = window.devicePixelRatio = window.devicePixelRatio ||\n Math.round(window.screen.availWidth / document.documentElement.clientWidth);\n\n var devicePixelRatio = nativePixelRatio;\n\n var width = window.innerWidth;\n var height = window.innerHeight;\n self.camera.aspect = devicePixelRatio;\n self.camera.updateProjectionMatrix();\n self.renderer.setSize(width, height);\n self.effect.setSize(width, height);\n }", "function resize() {\n\n const bodyWidth = parseInt(getComputedStyle(document.body).width.slice(0, -2), 10);\n\n if (bodyWidth < screenWidth) { //TODO fix width change\n screenWidth = bodyWidth;\n screenHeight = screenWidth / roadWidthSegments * roadHeightSegments;\n } else {\n screenHeight = parseInt(getComputedStyle(domElement).height.slice(0, -2), 10);\n screenWidth = Math.floor(screenHeight / roadHeightSegments * roadWidthSegments);\n }\n\n squareWidth = Math.floor(screenWidth / roadWidthSegments);\n screenWidth = roadWidthSegments * squareWidth; // pixel perfect :v\n\n domElement.setAttribute('height', screenHeight);\n domElement.setAttribute('width', screenWidth);\n\n render();\n }", "resize(windowRect) {}", "function windowResized () {\n resizeCanvas(windowWidth, windowHeight);\n resize=1;\n}", "function onWindowResize() {\n windowHalfX = window.innerWidth;\n windowHalfY = window.innerHeight;\n camera.aspect = window.innerWidth / window.innerHeight;\n camera.updateProjectionMatrix();\n renderer.setSize(window.innerWidth, window.innerHeight);\n }", "resize() {\n if (this._isShutDown) return;\n this._canvas.width = window.innerWidth;\n this._canvas.height = window.innerHeight;\n this.redraw();\n }", "function windowResize() {\n resiveCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resize();\n redraw();\n}", "function window_resize() {\r\n\t\t// Die Schrift der gesamten Seite soll relativ zur hoehe des Scenecontainers sein.\r\n\t\tvar newFontSize = $(\"#sceneContainer\").height() * 0.03;\r\n\t\t$(\"body\").css(\"font-size\", newFontSize + \"px\");\r\n\t\t\r\n\t\t/* Browser Fix: Manche Browser (z.B. Firefox) scheinen Unterelemente nicht immer richtig Ausrichten zu koennen, wenn sich diese\r\n\t\t in einem Container mit position: fixed und 100% höhe befinden und diese mit Transform zentriert werden \r\n\t\t (siehe Szene 5 mit unterschiedlichen Seitenhoehen). */\r\n\t\t$(\"#intro1\").height($(\"#sceneContainer\").height() * 0.825);\r\n\t\t\r\n\t\t// Mit Aenderungen der Groesse veraendert sich auch die Scrollaenge.\r\n\t\tupdateScrollLength();\r\n\t}", "function resize() {\n _screenWidth = window.innerWidth\n _screenHeight = window.innerHeight\n\n // camera settings for to be actual size\n _mainCamera.aspect = _screenWidth / _screenHeight\n _mainCamera.updateProjectionMatrix()\n _mainCamera.position.z = (_screenHeight * 0.5) / Math.tan((_mainCamera.fov * 0.5) * Math.PI / 180)\n\n _renderer.setSize(_screenWidth, _screenHeight)\n\n // update something\n}", "function resizeWindow() {\n let canvas = document.getElementById(renderSettings.viewPort.canvasId);\n\n setUpViewport(gl, canvas, ctx.uProjectionMatId, window.innerWidth, window.innerHeight, renderSettings.viewPort.fovy,\n renderSettings.viewPort.near, renderSettings.viewPort.far);\n}", "function windowResized() {\n console.log('resized');\n resizeCanvas(windowWidth, windowHeight);\n}" ]
[ "0.71591026", "0.6864512", "0.68576", "0.68494874", "0.6844306", "0.68431675", "0.6832591", "0.6832591", "0.6832013", "0.6799786", "0.6799288", "0.6786279", "0.6786279", "0.6785724", "0.6785724", "0.6785724", "0.6785724", "0.6785724", "0.6785724", "0.6785724", "0.6785724", "0.6785724", "0.6785724", "0.6785724", "0.6785724", "0.6785724", "0.6785724", "0.6785724", "0.6785724", "0.6785724", "0.6785724", "0.6785724", "0.6785724", "0.6785724", "0.6785724", "0.6785724", "0.6785724", "0.6785724", "0.6785724", "0.6785724", "0.6783807", "0.6773941", "0.6756925", "0.6755868", "0.6755868", "0.6755868", "0.6755868", "0.67535615", "0.67395645", "0.6730458", "0.6728144", "0.67269254", "0.6712088", "0.6712088", "0.6701454", "0.66932905", "0.66773814", "0.66713005", "0.66671646", "0.6653962", "0.6653962", "0.6653962", "0.6653962", "0.6653962", "0.6653962", "0.6653962", "0.6653962", "0.6653962", "0.6653962", "0.665335", "0.665335", "0.66508114", "0.6649484", "0.6646695", "0.66363096", "0.6627378", "0.6618449", "0.660095", "0.65983427", "0.65971345", "0.6591153", "0.65906054", "0.6586631", "0.6585767", "0.6577769", "0.6572631", "0.6565643", "0.6556984", "0.6544522", "0.6543592", "0.65406376", "0.6535996", "0.6520075", "0.6516411", "0.65116787", "0.65098333", "0.6505937", "0.6504937", "0.65026313", "0.65004414" ]
0.66747314
57
Called directly by the background page with information about the image. Outputs image data to the DOM.
function renderImageInfo(imageinfo) { console.log('imageinfo', imageinfo); var divloader = document.querySelector('#loader'); var divoutput = document.querySelector('#output'); divloader.style.display = "none"; divoutput.style.display = "block"; var divinfo = document.querySelector('#info'); var divexif = document.querySelector('#exif'); // Render general image data. var datacells = divinfo.querySelectorAll('td'); renderCells(datacells, imageinfo); // If EXIF data exists, unhide the EXIF table and render. if (imageinfo['exif'] && !isEmpty(imageinfo['exif'])) { divexif.style.display = 'block'; var exifcells = divexif.querySelectorAll('td'); renderCells(exifcells, imageinfo['exif']); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function image_display() {\r\n\r\n}", "draw() {\n // Displaying the background\n image(hubImage, 0, 0, width, height);\n }", "function drawImage() {\n document.body.style.backgroundImage = `url(${ store.State.image.large_url})`\n document.body.classList.add('bg-image')\n}", "function _drawBackgroundImage() {\n console.log(\"_drawBackgroundImage\");\n let template = \"\";\n let backgroundImage = store.State.backgroundImage;\n console.log(\"backgroundImage for _drawBackgroundImage\", backgroundImage);\n template = `<div style=\"background-image: url('${backgroundImage}');\" class=\"fixed-top\" id=\"background-image-css\">`;\n document.querySelector(\"#bg-image\").innerHTML = template;\n}", "function imageLoaded() {\n self.framed = self.createFramedImage(self.image, width, height);\n //self.framed = self.image;\n self.object = self.createRendererObject();\n if(self.prepareCallback) {\n self.prepareCallback(true);\n }\n }", "function drawImage(image) {\n let bodyDiv = document.getElementById('bg');\n bodyDiv.style.backgroundImage = \"url(\" + image.url + \")\";\n}", "function displayImage(){\n\n}", "function drawImages(image) {\n// had to use style.backgroundImage or else my image would cover quote and weather. \n\t\tdocument.getElementById('body').style.backgroundImage = `url(${image.url})`\n\t }", "draw() {\n // Displaying the image\n image(experimentImage, 0, 0, width, height);\n }", "function drawImage() {\n var stat = getState(cm);\n var url = \"http://\";\n _replaceSelection(cm, stat.image, insertTexts.image, url);\n}", "function ImageController(){\n\t\tvar imageService = new ImageService()\n\t\t$.get(window.location.pathname + '-image-tag.html', function(data){\n\t\t\t$('.main-container').append(data)\n\t\t})\n\t\timageService.getImage(function(imageData){\n\t\t\t$('body').css('background-image', `url(\"${imageData.url}\")`);\n\t\t\tconsole.log(imageData.large_url)\n\t\t\t$('.image-link').attr('href', imageData.large_url!==null? imageData.large_url : imageData.url)\n\t\t})\n\t}", "function getImageInfo() {\n\n}", "function showImage( im )\r\n {\r\n var fileName = imageURLs[im].split(\"/\")[2];\r\n window.scrollTo(0, 0);\r\n currentImage = im;\r\n\r\n if ( !images[im] )\r\n {\r\n images[im] = new Image();\r\n }\r\n\r\n if ( useSmaller )\r\n {\r\n images[im].src = smallerURLs[im];\r\n }\r\n else\r\n {\r\n images[im].src = imageURLs[im];\r\n }\r\n setInner( \"image\", \"<h3>Waiting for image ...<\\/h3>\" );\r\n waitForCurrent();\r\n\r\n setInner( \"image\", \"<img class=\\\"main_image\\\"\" +\r\n \"src=\\\"\"+images[im].src +\r\n \"\\\" \" +\r\n \"alt=\\\"\"+imageURLs[im] +\r\n \"\\\" height=\\\"\"+imgHeight+\"\\\" />\" );\r\n setInner( \"title\", fileName );\r\n }", "function Render(image) {\n selectedImage = image;\n //setup canvas for paper API\n setupPaperCanvas();\n //setup and fill image\n setupPaperImage();\n //setup and fill texts\n setupPaperTexts();\n}", "function fHomePgImgWInfo() // HOME PAGE IMAGE: This function loads the home page image and its description on page load\r\n{\r\n var expandImg = document.getElementById(\"expandedImg\"); // Find the ID \"expandedImg\"\r\n var imgText = document.getElementById(\"imgInfo\"); // Find the ID \"imgInfo\"\r\n \r\n var my_image = images[parseInt(0)];\r\n my_image = resizeImage(my_image,800,700);\r\n expandImg.src = my_image.file; // !Load the first image (index [0]) from the \"images\" array to the presentation container\r\n expandImg.width = my_image.dimensions.width;\r\n expandImg.height = my_image.dimensions.height;\r\n imgText.innerHTML = `${my_image.name} <br/> ${my_image.description}`; // !Load image info from the \"images\" array to the image info field\r\n expandImg.parentElement.style.display = \"block\"; // Apply style to a loaded image\r\n}", "function updatePageBackground() {\n\n\t\tconsole.debug( 'Update background' );\n\n\t\tvar tmp = renderResult();\n\t\tpageBackground.style.backgroundImage = 'url(' + tmp.toDataURL() + ')';\n\t}", "function writeMinimapBackground() {\n\t\tif (this.bgImage != null) {\n\t\t\tvar image = new Image();\n\t\t\timage.src = this.bgImage;\n\t\t\tvar img = document.createElement(\"img\");\n\t\t\timg.setAttribute(\"border\", \"0\");\n\t\t\timg.setAttribute(\"src\", image.src);\n\t\t\tvar imgsp = document.getElementById(MINIMAP).appendChild(img);\n\t\t\timgsp.style.position = \"absolute\";\n\t\t\timgsp.style.left = this.bgImageXCoord * this.xRate;\n\t\t\timgsp.style.top = this.bgImageYCoord * this.yRate;\n\t\t\timgsp.style.width = image.width * this.xRate;\n\t\t\timgsp.style.height = image.height * this.yRate;\n\t\t}\n\t}", "function displayImage(image) {\n var img = document.createElement(\"IMG\");\n img.src = image.url; \n img.style = \"margin: 15px\";\n document.getElementById('root').appendChild(img);\n}", "function _drawImage() {\n document.getElementById(\"background\").style.background = `transparent url('${ProxyState.image}') no-repeat center center /cover`\n}", "function onloadCallback(current_image) {\n\t\t//set the image as the background image of the canvas wrapper\n\t\t$('#canvas-wrapper').css('background', 'url(' + current_image.path +') no-repeat center center fixed').css('background-size', 'contain');\n\t}", "function displayBg() \n{\n\tvar bg = new Image();\n\tbg.src = \"Images/background.jpg\";\n\tctx.drawImage(bg,minCanvasWidth,minCanvasHeight,maxCanvasWidth,maxCanvasHeight);\n}", "function injectImage(request, sender, sendResponse) {\n console.log(\"pageCopier.js: injectImage:-\");\n //removeEverything();\n //insertImage(request.imageURL);\n\n\n}", "function generateAndDrawImage()\n { \n // generate image data from DICOM\n view.generateImageData(imageData); \n // set the image data of the layer\n imageLayer.setImageData(imageData);\n // draw the image\n imageLayer.draw();\n }", "function createImage(data) {\n //image output\n var img_output;\n //clear image search value\n $(\".contextual-choice input\").val(\"\");\n if (data !== \"\") {\n //create each image element\n var $img = $('<img class=\"flex-img\">').attr(\"src\", data);\n //add image\n img_output = $img;\n }\n //check for visible contextual-output - if not visible\n if (checkVisible($(\".contextual-output\")) === true) {\n changeClass(\".note-output\", \"col-12\", \"col-4\");\n }\n //append output to DOM\n $(\".contextual-output\").append(img_output);\n //fade in contextual-output with appended results\n $(\".contextual-output\").fadeIn(\"slow\");\n }", "function show_image(src) \n\t{\n var img = document.createElement(\"img\");\n img.src = src;\n document.body.appendChild(img);\n\t}", "function loadedImage()\r\n {\r\n //console.log(\"Load image \" + this.width + \" \" + this.height);\r\n\r\n this.loadMode = 2;\r\n\r\n if (this.repaint)\r\n {\r\n for (var i = 0; i < this.repaint.length; ++i)\r\n {\r\n var r = this.repaint[i];\r\n\r\n that.printPage(r.canvas, r.page, r.canvas.cpcOptions);\r\n }\r\n\r\n this.repaint = null;\r\n }\r\n\r\n this.removeEventListener('load', loadedImage);\r\n }", "function Start() {\r\n //when viewing an image (not a webpage). iFrames, or pdfs may not have body/head\r\n if (!doc.body || !doc.head || (win == top && doc.body.children.length == 1 && !doc.body.children[0].children.length)) {\r\n ShowImages();\r\n return;\r\n }\r\n //do elements\r\n DoElements(doc.body, false);\r\n //show body\r\n AddClass(doc.documentElement, 'wizmage-show-html wizmage-running');\r\n //create eye\r\n eye.style.display = 'none';\r\n eye.style.width = eye.style.height = '16px';\r\n eye.style.position = 'fixed';\r\n eye.style.zIndex = '100000000';\r\n eye.style.cursor = 'pointer';\r\n eye.style.padding = '0';\r\n eye.style.margin = '0';\r\n eye.style.opacity = '.5';\r\n doc.body.appendChild(eye);\r\n //create temporary div, to eager load background img light for noEye to avoid flicker\r\n if (_settings.isNoEye) {\r\n for (let i = 0; i < 8; i++) {\r\n let div = doc.createElement('div');\r\n div.style.opacity = div.style.width = div.style.height = '0';\r\n div.className = 'wizmage-pattern-bg-img wizmage-light wizmage-shade-' + i;\r\n doc.body.appendChild(div);\r\n }\r\n }\r\n //mutation observer\r\n observer = new WebKitMutationObserver(function (mutations: any) {\r\n for (let i = 0; i < mutations.length; i++) {\r\n let m = mutations[i];\r\n if (m.type == 'attributes') {\r\n if (m.attributeName == 'class') {\r\n if (m.target.tagName == 'HTML') {\r\n if (m.target.className.indexOf('wizmage-show-html') == -1)\r\n AddClass(m.target, 'wizmage-show-html');\r\n }\r\n let oldHasLazy = m.oldValue != null && m.oldValue.indexOf('lazy') > -1, newHasLazy = m.target.className != null && m.target.className.indexOf('lazy') > -1;\r\n if (oldHasLazy != newHasLazy)\r\n DoElements(m.target, true);\r\n } else if (m.attributeName == 'style' && m.target.style.backgroundImage.indexOf('url(') > - 1) {\r\n let oldBgImg, oldBgImgMatch;\r\n if (m.oldValue == null || !(oldBgImgMatch = /background(?:-image)?:[^;]*url\\(['\"]?(.+?)['\"]?\\)/.exec(m.oldValue)))\r\n oldBgImg = '';\r\n else\r\n oldBgImg = oldBgImgMatch[1];\r\n let imgUrlMatch = /url\\(['\"]?(.+?)['\"]?\\)/.exec(m.target.style.backgroundImage);\r\n if (imgUrlMatch && oldBgImg != imgUrlMatch[1]) {\r\n DoElement.call(m.target);\r\n }\r\n }\r\n else if (m.attributeName == 'srcset' && m.target.tagName == 'SOURCE' && m.target.srcset)\r\n DoElement.call(m.target.parentElement);\r\n }\r\n else if (m.addedNodes != null && m.addedNodes.length > 0)\r\n for (let j = 0; j < m.addedNodes.length; j++) {\r\n let el = m.addedNodes[j];\r\n if (!el.tagName) //eg text nodes\r\n continue;\r\n if (el.tagName == 'IFRAME')\r\n DoIframe(el);\r\n else\r\n DoElements(el, true);\r\n }\r\n }\r\n });\r\n observer.observe(doc, { subtree: true, childList: true, attributes: true, attributeOldValue: true });\r\n //CheckMousePosition every so often\r\n setInterval(CheckMousePosition, 250);\r\n setInterval(UpdateElRects, 3000);\r\n for (let to of [250, 1500, 4500, 7500])\r\n setTimeout(UpdateElRects, to);\r\n //ALT-a, ALT-z\r\n doc.addEventListener('keydown', DocKeyDown);\r\n //notice when mouse has moved\r\n doc.addEventListener('mousemove', DocMouseMove);\r\n win.addEventListener('scroll', WindowScroll);\r\n //empty iframes\r\n let iframes = doc.getElementsByTagName('iframe');\r\n for (let i = 0, max = iframes.length; i < max; i++) {\r\n DoIframe(iframes[i]);\r\n }\r\n hasStarted = true;\r\n }", "function displayImage(user , srcData ) {\r\n var newImage = document.createElement('img');\r\n newImage.src = srcData;\r\n \r\n // document.getElementById(\"historyMsg\").innerHTML = user + newImage.outerHTML;\r\n \r\n messageArea.append(newImage);\r\n appendMessage(`${user} send image...`);\r\n autoScrollDown();\r\n // alert(\"Converted Base64 version is \" + document.getElementById(\"historyMsg\").innerHTML);\r\n\r\n}", "function bgImage() {\r\n $('[data-bgi]').each(function () {\r\n var src = $(this).attr('data-bgi');\r\n $(this).css({\r\n 'background-image': 'url(' + src + ')'\r\n });\r\n });\r\n }", "imageCreated(/* image */) {}", "function insertImageToCanvas(statusBar, imageAddress) {\n var image = new Image();\n image.crossOrigin = '';\n image.onload = function () {\n var canvas = $(statusBar).find(\"#steg-canvas\").get(0);\n var context = canvas.getContext('2d');\n context.drawImage(image, 0, 0, image.width, image.height, 0, 0, canvas.width, canvas.width * 1.0 * image.width / image.height);\n var imageText = canvas.toDataURL();\n };\n image.src = imageAddress;\n}", "function renderImage(data) { \n //function takes image from data\n //replaces our dog image with data.image\n \n dogImage.src = data.message\n}", "function writeImageNE() {\n\t\tvar elem = document.getElementById(this.id).appendChild(document.createElement(\"span\"));\n\t\telem.style.position = \"absolute\";\n\t\telem.style.left = 0;\n\t\telem.style.width = this.width;\n\t\telem.style.backgroundImage = \"url(\" + this.image + \")\";\n\t\tvar pos = NAME_CENTER;\n\t\tif (this.nameLocation == NAME_UP) {\n\t\t\telem.style.top = 12;\n\t\t\telem.style.height = this.height - 12;\n\t\t\tpos = NAME_DOWN;\n\t\t} else if (this.nameLocation == NAME_DOWN) {\n\t\t\telem.style.top = 2;\n\t\t\telem.style.height = this.height - 12;\n\t\t\tpos = NAME_UP;\n\t\t} else if (this.nameLocation == NAME_CENTER) {\n\t\t\telem.style.top = 0;\n\t\t\telem.style.height = this.height;\n\t\t}\n\t\telem.style.backgroundPosition = pos;\n\t\telem.style.backgroundRepeat = \"no-repeat\";\n\t\telem.style.zIndex = 6;\n\t}", "function renderBackgroundImage(sibling){\n\t\t// get image container size\n\t\tvar bgImg = images[sibling.attr('id')];\n\n\t\tvar bgImgWidth = bgImg.low.width , bgImgHeight = bgImg.low.height;\n\t\t\n\t\t\n\t\tvar scale = Math.max( windowHeight/bgImgHeight , windowWidth/bgImgWidth );\n\t\tvar width = scale * bgImgWidth , height = scale * bgImgHeight;\n\t\tvar left = (windowWidth-width)/2, top = (windowHeight-height)/2;\n\n\t\tvar transform = 'translate('+[-bgImgWidth/2,-bgImgHeight/2].join('px,')+'px) scale('+scale+') translate('+[windowWidth/2/scale,windowHeight/2/scale].join('px,')+'px)';\n\t\tsibling\n\t\t\t.width(bgImgWidth).height(bgImgHeight)\n\t\t\t.css({\n\t\t\t\t'-webkit-transform':transform,\n\t\t\t\t'-moz-transform':transform,\n\t\t\t\t'-o-transform':transform,\n\t\t\t\t'-ms-transform':transform\n\t\t\t})\n\t\t\t .css({'position':'fixed', top: 0, left: 0});\n\t}", "function renderBreedImg (imgData) {\n let checkImg = document.querySelector(\"img\");\n if (checkImg){\n main.removeChild(checkImg);\n }\n let img = document.createElement(\"img\");\n img.setAttribute(\"src\", imgData);\n main.appendChild(img);\n\n setCurrentBreed();\n}", "function startPage() {\n var img = new Image();\n img.onload = function() {\n cr.ui.replaceContent(cr.ui.template.render_template(\"admin/start_page.html\"));\n };\n img.src = \"../asset/css/admin/title_img.png\";\n }", "function getBackgroundImage(image) {\n setImage(image);\n }", "display() {\n push();\n // Centering image for easier image placement\n imageMode(CENTER);\n image(this.image, this.x, this.y, 1500, 300);\n pop();\n }", "function _drawImage() {\n document.getElementById(\"bg-image\").style.backgroundImage = `url(${store.State.imgUrl})`\n\n}", "function image() {\n /* Set background image to desired URL, throw error if invalid URL */\n canvas.style.backgroundImage = \"url('\" + value + \"')\";\n /* Modify CSS Properties */\n\n if (options) {\n /* Set Repeat */\n canvas.style.backgroundRepeat = options.repeat ? 'repeat' : 'no-repeat';\n /* Set Position */\n\n canvas.style.backgroundPosition = options.position ? options.position : 'center';\n /* Set Size */\n\n canvas.style.backgroundSize = options.size ? options.size : 'contain';\n /* Set Color */\n\n canvas.style.backgroundColor = options.color ? options.color : 'none';\n }\n }", "display(){\r\n var angle = this.body.angle;\r\n //Pushing in the settings to be applied on the image\r\n push();\r\n //Translating or moving the image to the given position \r\n translate(this.body.position.x, this.body.position.y);\r\n //Rotating the image based on the angle provided\r\n rotate(angle);\r\n imageMode(CENTER);\r\n image(this.image, 0, 0, this.width, this.height);\r\n //Reverting to the original settings\r\n pop();\r\n }", "function insertImage() {\n telemetry_1.reporter.sendTelemetryEvent(\"command\", { command: telemetryCommandMedia + \".art\" });\n Insert(true);\n}", "function loadImageDetails(){\n $(\".image-url\").text(`URL: ${displayedImg.url}`);\n $(\".image-id\").text(`ID: ${displayedImg.id}`);\n $(\".image-author\").text(`Author: ${displayedImg.author}`)\n}", "function displayImage(){\n\t//Function always displays the image in the \"0\" value of the array\n\tcurrentImage.image = \"galleryImages/\" + imageFiles[0];\n}", "function addImg (image) {\n jCooper.images.headshot2 = (image);\n console.log(jCooper.images.headshot2)\n}", "function paintImage(imgNumber) {\n const image = new Image();\n image.src = `images/${imgNumber + 1}.jpg`;\n image.classList.add('bgImage');\n image.onload = function () {\n body.appendChild(image);\n };\n}", "function setImage()\n {\n var img = getId(\"captured_image\");\n \n var path = \"file:\" + Native.getImagePath();\n \n img.setAttribute(\"src\", path);\n }", "function renderizarImagen() {\r\n $imagen.style.backgroundImage = `url(${IMAGENES[posicionActual]})`;\r\n }", "create() {\n let background = this.add.image(0, 0, 'background');\n background.displayOriginX = 0;\n background.displayOriginY = 0;\n background.displayWidth = this.sys.canvas.width;\n background.displayHeight = this.sys.canvas.height;\n }", "imageOnLoad() {\n loadJS(resizeScript, this.initResizeHandler.bind(this), document.body);\n\n this.toggleStatus(STATUS.FILLED);\n // eslint-disable-next-line no-undef\n\n /**\n * Preloader does not exists on first rendering with presaved data\n */\n if (this.nodes.imagePreloader) {\n this.nodes.imagePreloader.style.backgroundImage = \"\";\n }\n }", "function shot() {\r\n //step 1: show description text of all tags\r\n showAllTags(taggd);\r\n //step 2: shot pic with tags\r\n html2canvas($(\"#mydiv\"), {\r\n \theight:$(\"#mydiv\").innerHeight(),\r\n onrendered:function (canvas) {\r\n \tvar stmFileName = getProPicName();\r\n var url = canvas.toDataURL();\r\n mui.post(ip+\"/proPic.do\",{\r\n \tcommand:\"savePicWithSpots\",\r\n \tbaseStr:(url.split(\",\"))[1],\r\n \tfileName:stmFileName,\r\n \tproPic:proPic\r\n },function(data){\r\n },\"json\");\r\n /* console.log(url);\r\n \tconsole.log($(\"#mydiv\").html());\r\n var triggerDownload = $(\"<a>\").attr(\"href\", url).attr(\"download\", Date.parse(new Date())+\".png\").appendTo(\"body\");\r\n triggerDownload[0].click();\r\n triggerDownload.remove();\r\n */\r\n }\r\n });\r\n //step 3: hide description text of all tags\r\n hideAllTags(taggd);\r\n }", "function show_image(pid, install_dir_name){\n $('large-image').innerHTML = \"Loading image ...\";\n var ajax = new Ajax.Updater('large-image', \n install_dir_name + '/go/large_image/?pid='+ pid, \n {asynchronous:true});\n \n}", "display() {\n if (this.isDrank === false) {\n //Display\n image(this.image, this.x, this.y, this.size, this.size);\n }\n }", "display() {\n push();\n imageMode(CENTER);\n image(this.image, this.x, this.y, this.size * 2, this.size * 2);\n this.currentFrame = this.image.getCurrentFrame();\n pop();\n }", "function onSuccess (imageData) {\n\t\t//var image = document.getElementById ('picture');\n\t\t//image.src = \"data:image/jpeg;base64,\" + imageData;\n\t\t//send_png(imageData);\n\t\t//alert(encode);\n\t\t//var target = document.getElementById(\"textArea\");\n\t\t//target.value = makeSmall(imageData);\n\t\timageurl = \"data:image/jpeg;base64,\"+imageData;\n\t\t//send_png(imageurl);\n\t\t//alert(smallurl);\n\t\tmyNavigator.pushPage(\"edit.html\");\n\t}", "function renderImg (imgData) {\n let checkImg = document.querySelector(\"img\");\n if (checkImg){\n main.removeChild(checkImg);\n }\n let img = document.createElement(\"img\");\n img.setAttribute(\"src\", imgData);\n main.appendChild(img);\n}", "function beginPixelationProcess(urlimg) {\n\t// display loaders\n\ttoggleLoader( true, 'original' );\n\ttoggleLoader( true, 'canvas' );\n\t// jquery ajax here\n\tconsole.log(\"LOADING: \" + urlimg);\n\t$.ajax({ \n \turl: 'test.php?q=getInstaImage',\n\t data: {src: urlimg},\n type: 'post'\n\n\t}).done(function (data) {\n\t\ttry {\n\t\t\tvar json = JSON.parse(data); // need some check here...\n\t\t //console.log(data);\n\n\t\t // when done build the new image, set hte source and onoad callback\n\t\t\timg = new Image();\n\t\t\timg.src = json.src; // our source data\n\t\t\timg.id = ORIGINAL_IMAGE.substring(1);\n\n\t\t img.onload = function () {\t// our image is out of the oven\n\t\t \ttoggleLoader( false, 'original' );\n\t\t \ttoggleLoader( false, 'canvas' );\n\t\t\t\tcanvimg = document.createElement(\"canvas\");\n\t\t\t\tctximg = canvimg.getContext(\"2d\");\n\t\t\t\tcanvimg.width = img.width;\n\t\t\t canvimg.height = img.height;\n\t\t\t canvimg.id = MAIN_CANVAS.substring(1);\n\t\t\t ctximg.drawImage( img, 0, 0 );\n\t\t\t $( ORIGINAL_IMAGE ).replaceWith(img);\n\t\t\t getPixelDataArray( );\n\t\t\t\tdrawPixelatedToCanvas( getSliderValue(), true, null);\n\t\t\t\t// all done, activate GUI buttons and things\n\t\t\t\tconsole.log('toggling');\n\t\t\t\t//toggleGUI( 'enabled', 'save' );\n\t\t\t\ttoggleLoader(false, 'canvas' );\n\t\t\t};\n\t\t} \n\tcatch(err) {\n\t\t\tconsole.log(err);\n\t\t}\n\t});\t\n}", "function pageSetup() {\r\n document.getElementsByTagName(\"img\")[0].src = figFilename; // assign filename to img element\r\n createEventListener();\r\n}", "function startImgStatus(){\n var img = document.createElement('img'); // Hack to extract absolute url\n $jQ('img').each(function(){\n img.src=$jQ(this).attr('src');\n setLink($jQ(this),'src', img.src);\n });\n}", "function addImage (data) {\n var element = document.createElement('div');\n element.innerHTML = '<img src=\"' + data +'\" />';\n\n var container = document.getElementById('data--container');\n container.appendChild(element);\n }", "function showImage() {\n context.drawImage(v, 0, 0, c.width, c.height);\n \n }", "loadImage(img) {\n // abort operations if componente was unmounted\n if (this._.componentUnmounted) return;\n // set as background image\n this._.backgroundImg = img;\n this._.imageLoaded = true;\n // clear all previous labels\n this.removeAllLabels();\n // refresh GUI\n this.refreshCanvases();\n }", "function ev_imageLoaded () {\n // Did the image already load?\n if (imageLoaded) {\n return;\n }\n\n // The default position for the inserted image is the top left corner of the visible area, taking into consideration the zoom level.\n var x = MathRound(gui.elems.viewport.scrollLeft / canvasImage.canvasScale),\n y = MathRound(gui.elems.viewport.scrollTop / canvasImage.canvasScale);\n\n context.clearRect(0, 0, canvasImage.width, canvasImage.height);\n\n try {\n context.drawImage(imageElement, x, y);\n } catch (err) {\n alert(lang.errorInsertimg);\n return;\n }\n\n imageLoaded = true;\n needsRedraw = false;\n\n if (!timer) {\n timer = setInterval(_self.draw, config.toolDrawDelay);\n }\n\n gui.statusShow('insertimgLoaded');\n }", "function setImage() {\n let image = imagesAfrica[0];\n let imageContainer = $(\".js-images-container\");\n imageContainer.css(\"background-image\", `url('${image.imageSelection}')`);\n imageContainer.css(\"color\", \"white\");\n imageContainer.css(\"font-size\", \"20px\");\n $(\".image-description\").text(`${image.imageDescription}`);\n}", "function paintImage(imgNumber) {\n const image = new Image();\n image.src = `images/${imgNumber + 1}.jpg`;\n image.classList.add(\"bgImage\");\n body.prepend(image);\n}", "function ImageTransparent() {\n // Image: all image loaded\n SetupAfterAllLoaded();\n }", "function printImages (data) {\n if(data.location !== null && typeof data.location !== 'undefined'){\n var imgUrl = data.images.low_resolution.url;\n var lat = data.location.latitude;\n var lng = data.location.longitude;\n var newImage = $('<img>');\n \n newImage.attr({\n src: data.images.standard_resolution.url,\n class: \"image\",\n alt: data.caption.text,\n onclick: \"getRoute(\" + lat + \",\" + lng + \"); blockPage(this.src, this.alt);\"\n });\n $('#imageContainer').append(newImage);\n }\n//TÄHÄN ELSE TMS. HAKEMAAN LISÄÄ KUVIA JOS SIJAINTI EI TIEDETTY? KORVATTU LISÄÄMÄLLÄ PYYNNÖN COUNT-ARVOA\n}", "function writeImage() {\n /* En la propiedad `result` de nuestro FR se almacena\n * el resultado\n */\n profileImage.style.backgroundImage = `url(${fr.result})`;\n profilePreview.style.backgroundImage = `url(${fr.result})`;\n}", "function renderizarImagen() {\n $imagen.style.backgroundImage = `url(${imagenes[posicionActual]})`\n }", "display() {\n push();\n noStroke();\n imageMode(CENTER);\n image(this.avalancheImg, this.x, this.y, this.width, this.height);\n pop();\n }", "render() {\n image(this.image, this.x, this.y, this.width, this.height);\n }", "function cdc_display_image_when_loaded(img,url){\r\n\t// we're extending img with .tempImg to do a test load of the src with a new image object\r\n\timg.tempImg = new Image();\r\n\timg.tempImg.onload = function(){\r\n\t\t// this prevents the image src in html from firing the onload again\r\n\t\timg.onload=null;\r\n\t\timg.src = img.tempImg.src;\r\n\t\timg.tempImg.onload=null;\r\n\r\n\t\tif(img.id == \"bam_img\"){\r\n\t\t\timg.parentNode.href = img.src.replace('image.ng','click.ng');\r\n\t\t}\r\n\t};\r\n\t// putting this after the onload handler above\r\n\timg.tempImg.src = url;\r\n}", "function displayImage(){\n\t context.drawImage(video,0,0,320,240);\n //This is where we write the picture data and turn it into a dataURL so we can feed it to the API\n\t\tdURL = canvasElement.toDataURL(\"image/jpeg\",1);\n\n\t\t//call the function to send the image to the emotion API\n\t\tfaceProcess();\n}", "function inject_image_into_background(image_url){\n var style_sheet = document.createElement('style');\n style_sheet.innerHTML = \"body#gsr.hp.vasq{background-image: url(\" + \n image_url + \");}\";\n document.body.appendChild(style_sheet);\n}", "function display_advertise_images() {\n}", "function getAndDisplayGuideImage(){\n\tconsole.log('getAndDisplayGuideImage ran');\n\tgetAnimations(displayGuideImage);\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 runimg(){\n sendimg()\n}", "function pageSetup() {\r\n document.getElementsByTagName(\"img\")[0].src = figFilename; // assign filename to img element\r\n}", "function onImageSuccess(e){\n\t// Assign the blob to the image\t\n\t$.image.image = e.data;\n\t\n\t// Do a \"fade in\" of the image\n\tanimation.popIn($.image);\n\t\n\t// Hide the indicator\n\t$.indicator.hide();\n}", "function drawImage(image) {\n g.clear();\n g.drawString(image, g.getWidth() / 2, g.getHeight() / 2);\n g.flip();\n}", "function RefreshImage(img) {\n\tvar image = Ext.getDom(\"main-image\");\n\timage.src = img;\n}", "function imageDisplay(index){\n\t\tif( index >= data.length ){\n\t\t\treturn;\n\t\t} else {\n\t\t\tcreateImage(data[index].src, data[index].width, data[index].height);\n\t\t}\n\t}", "function onPhotoFileSuccess(imageData) {\n // Get image handle\n //alert('image taken');\n console.log(JSON.stringify(imageData));\n\n var wallImage = new Image();\n\n // Show the captured photo\n // The inline CSS rules are used to resize the image\n //\n wallImage.src = imageData;\n document.body.appendChild(wallImage);\n}", "render () {\n ctx.drawImage(Resources.get(this.image), this.x, this.y);\n }", "function saveImg() {\n var ImgBaseString = mainDiagram.makeImageData({ background: \"white\" });\n return ImgBaseString;\n}", "getBackgroundImage(){return this.__background.image}", "function _onImageLoaded() {\n _imagesToLoad = _imagesToLoad - 1;\n if (!_imagesToLoad) {\n $$log(\"All images loaded, rendering again.\");\n PP64.renderer.render();\n }\n }", "function render(project) { // a key\n $('.footer-test').html(project.text) //put the response on the dom\n var imageHtml = '';\n project.images.forEach(function(img) {\n imageHtml += '<img src=\"' + img + '\" /></br>'\n console.log(img);\n // put the image wherever\n });\n $('#imageZone').html(imageHtml); //put the response on the dom\n\n }", "show() {\n // applyTextTheme\n image(this.image, this.x, this.y, this.width, this.height)\n }", "function onPhotoDataSuccess2(imageData) {\n ImageSrc = \"data:image/jpeg;base64,\" + imageData;\n\t document.getElementById(\"container2\").innerHTML = \"<img src = '\" + ImageSrc + \"' width = '100%'/>\"\n\t }", "function breedImage() {\n document.querySelector(\"#breedImage\").innerHTML =\"\";\n // Create Image of Dog Breed\n var div = document.querySelector(\"#breedImage\");\n var img = document.createElement(\"img\");\n img.setAttribute(\"src\", \"assets/img/breeds/\" + (dogBreedArray[i]) + \".jpg\");\n img.setAttribute(\"alt\", (dogBreeds[dogBreedArray[i]].breed));\n div.appendChild(img);\n}", "onImageLoad() {\n this.cacheFrameReady = true;\n this.drawCurrentFrame();\n }", "function renderImage(img){\n$image.setAttribute('src', img)\n}", "display() {\n this.move();\n imageMode(CENTER);\n image(this.axeImg, this.x + bgLeft, this.y, this.w, this.h);\n }", "function imageOnLoad() {\n if ($(this).attr('src') == '') return;\n var img = $(this)[0];\n $('#image-preview')[0].appendChild(img);\n $('#image-preview > img').attr('width', '100%');\n var $container = $('#image-exif');\n $container.html('');\n EXIF.getData(img, function() {\n renderExifItem(img, 'DateTimeOriginal', 'Дата создания');\n renderExifItem(img, 'Orientation', 'Ориентация');\n var lat = renderExifItem(img, 'GPSLatitude', 'Широта');\n var long = renderExifItem(img, 'GPSLongitude', 'Долгота');\n lat = formatGPSCoord(lat);\n long = formatGPSCoord(long);\n $.get(`https://geocode-maps.yandex.ru/1.x/?geocode=${lat},${long}&sco=latlong&format=json`, function (data) {\n if (data != undefined && data != null) {\n var found = data.response.GeoObjectCollection.metaDataProperty.GeocoderResponseMetaData.found;\n if (found > 0) {\n var url = `https://yandex.ru/maps/?ll=${long}%2C${lat}&z=12`;\n var text = data.response.GeoObjectCollection.featureMember[0].GeoObject.metaDataProperty.GeocoderMetaData.text;\n $container.append(`<dl><dt>Адрес</dt><dd><a href=\"${url}\" target=\"_blank\">${text}</a></dd></dl>`);\n }\n }\n });\n });\n }", "function display() {\n var content = this.getContent();\n var root = Freemix.getTemplate(\"thumbnail-view-template\");\n\n content.empty();\n content.append(root);\n this._setupViewForm();\n this._setupLabelEditor();\n\n var images = Freemix.property.getPropertiesWithType(\"image\");\n\n var image = content.find(\"#image_property\");\n\n // Set up image property selector\n this._setupPropertySelect(image, \"image\", images);\n this._setupTitlePropertyEditor();\n this._setupMultiPropertySortEditor();\n\n image.change();\n }", "function addImageToScreen(myURL) {\n\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 displayImage() {\n \n \n // $(\"#image-holder\").html(\"<img src=\" + images[count] + \" height='420px' width='105%'>\");\n $(\"#image-holder\").css(\"background-image\",\"url(\"+images[count]+\")\");\n\n}", "connectedCallback() {\n if (this.ownerDocument.defaultView) {\n var shadow = this.attachShadow({ mode: 'open' });\n\n shadow.appendChild(Img({\n src: this._src, width: 600, height: 400\n }))\n }\n }" ]
[ "0.66021895", "0.64751923", "0.64181393", "0.6318622", "0.6300253", "0.6294994", "0.6287033", "0.628028", "0.62594223", "0.6163313", "0.6161639", "0.61614597", "0.6104169", "0.6088577", "0.6073676", "0.6073315", "0.6044414", "0.6040513", "0.60336167", "0.60294414", "0.60094726", "0.59944695", "0.5989759", "0.59797585", "0.59700596", "0.5960185", "0.59054285", "0.5902993", "0.58967966", "0.5895518", "0.5893056", "0.5878654", "0.58687246", "0.5840159", "0.58394355", "0.5837782", "0.58346134", "0.58276117", "0.58047414", "0.5795259", "0.57857186", "0.57852304", "0.577228", "0.57703197", "0.5759541", "0.5758976", "0.57578814", "0.57571507", "0.5752291", "0.5732282", "0.57271045", "0.57166016", "0.5716075", "0.57147455", "0.5714205", "0.57060707", "0.5701306", "0.57007986", "0.5699048", "0.56905293", "0.5690295", "0.5689822", "0.5683423", "0.5681527", "0.5680342", "0.5675146", "0.56715024", "0.5663502", "0.5662327", "0.56620216", "0.56587356", "0.5654977", "0.5652184", "0.5642796", "0.56378376", "0.56346637", "0.5630074", "0.562314", "0.5618968", "0.56100035", "0.560993", "0.560674", "0.55995744", "0.5596049", "0.55881786", "0.55841595", "0.5582381", "0.55795", "0.5579489", "0.55763745", "0.55762905", "0.5574068", "0.55713916", "0.5569154", "0.5565648", "0.55553466", "0.5554223", "0.55542", "0.5553418", "0.55501497", "0.55459434" ]
0.0
-1
Renders the URL for the image, trimming if the length is too long.
function renderUrl(url) { var divurl = document.querySelector('#url'); var urltext = (url.length < 45) ? url : url.substr(0, 42) + '...'; var anchor = document.createElement('a'); anchor.href = url; anchor.innerText = urltext; divurl.appendChild(anchor); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function TrimLength(text, maxLength) {\n var shortURL = text.substring(0, maxLength) + '...';\n return shortURL;\n}", "function urlFor(source) {\n return builder.image(source)\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 urlFor(source) {\n return builder.image(source);\n }", "function urlFor (source) {\n return builder.image(source)\n}", "function _usfGetImageUrls(imageUrl) {\r\n if (_usfIsDynamicImage)\r\n // in dynamic image size mode, {size} represents the image size\r\n\t\treturn _usfImageWidths.map(w => imageUrl.replace('{size}', w) + ' ' + w + 'w').join(', ')\r\n\t\r\n\treturn _usfImageWidths.map(w => imageUrl + ' ' + w + 'w').join(', ')\r\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}", "determineThumbnail() {\n if (this.props.book.imageLinks && this.props.book.imageLinks.smallThumbnail) {\n return `${this.props.book.imageLinks.smallThumbnail}`;\n } else {\n return `${process.env.PUBLIC_URL + '/images/missing-thumbnail.PNG'}`;\n }\n }", "function prepareUrl(imgObject) {\n return 'https://farm8.staticflickr.com/' + imgObject.server + '/'+ imgObject.id + '_' + imgObject.secret + '.jpg';\n}", "getVoterPhotoUrlLarge (){\n return this.getState().voter.voter_photo_url_large || \"\";\n }", "function _usfGetScaledImageUrl (url, size = '{width}') {\r\n if (_usfIsDynamicImage)\r\n return url.replace('{size}', size);\r\n \r\n var n = url.lastIndexOf('_');\r\n if (n === -1)\r\n return url;\r\n\r\n return url.substr(0, n) + url.substr(n).replace('_' + usf.settings.search.imageSize + 'x', '_' + size + 'x')\r\n}", "function getImageUrl(item) {\n return item.$image ? item.$image.image + '?width=' + scope.cfg.image.width + '&height=' + scope.cfg.image.height + '&mode=crop' : null;\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 }", "function makeLargeIconLink( thisRow )\r\n\t{\r\n\t\tvar outputStr = \"\";\r\n\t\tvar lrgImgStr = \"\";\r\n\t\tvar size = 32;\r\n\r\n\t\tif ( 0 !== thisRow.imgStatus.length )\r\n\t\t{\r\n\t\t\t// Only put out information for the object iff\r\n\t\t\t// the img status is not empty. If this is not\r\n\t\t\t// the case then we put out a nbsp\r\n\t\t\tif ( ( ( \"\" !== thisRow.imgRealLargeStr ) && renderBigImages ) || ( thisRow.imgRealLargeStr === thisRow.imgLargeStr ))\r\n\t\t\t{\r\n\t\t\t\tlrgImgStr = class_baseUrl + \"/fetch/\" + thisRow.imgRealLargeStr;\r\n\t\t\t\tsize = 64;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tlrgImgStr = thisRow.imgLargeStr;\r\n\t\t\t}\r\n\r\n\t\t\tif ( 0 < thisRow.link.length )\r\n\t\t\t{\r\n\t\t\t\toutputStr += \"\t\t<A HREF=\\\"\" + thisRow.link + getOptionalParams( thisRow ) + \"\\\">\";\r\n\t\t\t\toutputStr += \"\t\t\t<IMG SRC='\"+ thisRow.imgStatus + \"' WIDTH='8' HEIGHT='8' BORDER='0' ALT='\"+ thisRow.statusName + \"'><IMG SRC='\"+ lrgImgStr + \"' WIDTH='\" + size + \"' HEIGHT='\" + size + \"' BORDER='0' ALT='\"+ thisRow.typeName + \"'>\";\r\n\t\t\t\toutputStr += \"\t\t</A>\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\toutputStr += \"&nbsp;<IMG SRC='\"+ thisRow.imgStatus + \"' WIDTH='8' HEIGHT='8' BORDER='0' ALT='\"+ thisRow.statusName + \"'><IMG SRC='\"+ lrgImgStr + \"' WIDTH='\" + size + \"' HEIGHT='\" + size + \"' BORDER='0' ALT='\"+ thisRow.typeName + \"'>\";\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\toutputStr += \"&nbsp;\";\r\n\t\t}\r\n\r\n\t\treturn outputStr;\r\n\t}", "function getUrlPic(picture) { return \"url(\"+picture+\")\"; }", "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 FormatUrl(url)\n{\n let base = \"http://cdn.akamai.steamstatic.com/steamcommunity/public/images/avatars/\";\n url = url.substring(url.indexOf('/avatars/') + 9, url.length);\n url = base + url;\n return url;\n}", "function URLify(string, length) {\r\n // The solution below works, but not in constant space. \r\n // Not sure what a in place, constant space JavaScript solution would look like. \r\n\r\n let characters = string.slice(0, length).split(\"\");\r\n characters = characters.map( char => {\r\n if (char === \" \") return \"%20\";\r\n return char;\r\n })\r\n return characters.join(\"\");\r\n}", "function bigImage ( data, index ) {\n if( typeof index === 'undefined' ) return \"\";\n if( index === null ) return \"\";\n if( !data ) return \"\";\n const urlArray = data.results[index].image_url;\n return urlArray[urlArray.length-1];\n}", "function loadImg(url) {\r\n var str1 = '<img class = \"resize_big_image\" src =';\r\n var str2 = str1.concat(url)\r\n var str3 = '>';\r\n var res = str2.concat(str3);\r\n\r\n document.getElementById(\"big_image\").innerHTML = res;\r\n }", "function displayShortenedUrl(res) {\n link.textContext = res.data.shortUrl;\n link.setAttribute('href', res.data.shortUrl);\n shrBox.style.opacity = '1';\n urlBox.value = '';\n}", "function getUrlPic(picture) { return \"url(\"+host+picture+\")\"; }", "function getUrlPic(picture) { return \"url(\"+host+picture+\")\"; }", "function normalizeImageUrl(data) {\n\t return data.replace('www.dropbox.com', 'dl.dropboxusercontent.com');\n\t}", "render() {\n return (\n <img\n alt={\"img-\" + this.num}\n src={this.src}\n style={this.styles}\n onError={this.failedToLoad}\n />\n );\n }", "renderUrl() {\n try {\n let valid_url = this.prepareUrl(this.value());\n if (!valid_url) return;\n this.value(valid_url);\n this.source.data.page_url = valid_url;\n uiRegistry.get(ONBOARDING_REGISTRY, onboarding => {\n onboarding.renderIframe(valid_url)\n });\n } catch (error) {\n $(`[name=\"${this.inputName}\"]`).val('').change();\n alert({ title: $.mage.__('Invalid URL, please review your Page Url input.') });\n }\n }", "function getPhotoURL(id, farm, server, secret, size) {\n if(!size) size = '';\n else size = '_' + size;\n return 'https://farm' + farm + '.staticflickr.com/' + server + '/' + id + '_' + secret + size + '.jpg';\n}", "buildImgURL(string){\n const value = string.toLowerCase().split(' ').join('-');\n return process.env.PUBLIC_URL+'/'+value;\n }", "function HandleErrorUrl() {\n if (imgSrc === \"https://www.esky.eu/_fe/img/city_\" + id + \"_horizontal_0.jpg\") {\n setImgSrc(\"https://static1.eskypartners.com/deals/\" + id + \"_1_SquareSmall_290_290.jpg\")\n } else if (imgSrc === \"https://static1.eskypartners.com/deals/\" + id + \"_1_SquareSmall_290_290.jpg\") {\n setImgSrc(\"https://static1.eskypartners.com/deals/\" + id + \"_0_Rectangle_610_290.jpg\")\n } else if (imgSrc === \"https://static1.eskypartners.com/deals/\" + id + \"_0_Rectangle_610_290.jpg\") {\n //default image - with no connection to the country!\n setImgSrc(\"https://static1.eskypartners.com/deals/CVG_0_Rectangle_610_290.jpg\")\n }\n }", "function photo() {\n //check if exist data imageLinks\n if(book.volumeInfo.imageLinks){\n //check if thumbnail is not undefined\n if(book.volumeInfo.imageLinks.thumbnail !== undefined){\n return book.volumeInfo.imageLinks.thumbnail\n }\n } else return '/img/No-Photo-Available.jpg'\n }", "function recipeURL(recipeID) {\n return (\"https://spoonacular.com/recipeImages/\" + recipeID + \"-240x150.jpg\");\n}", "function GetImageURL(imagePath) {\n// return URLUtility.VirtualPath + imagePath;\n return imagePath;\n}", "static imageUrlForRestaurantL(restaurant) {\r\n if (restaurant.photograph === undefined){\r\n return 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';\r\n }\r\n return (`/img/800_${restaurant.photograph}.jpg`);\r\n }", "function truncateUrl(url) {\n if (url.length > 80) {\n return url.substring(0, 80) + \"...\"\n }\n return url;\n}", "_notValidURL() {\n toast.mostrar(\"Doesn't look like a valid URL 😕\", {color: '#fff', fondo: '#fe4440'});\n }", "function Image (props) {\n return (\n <img src={ props.url } width=\"250\" height=\"250\" />\n )\n}", "function uutrimurl(source) { // @param String: ' url(\"http://...\") '\r\n // @return String: \"http://...\"\r\n return (!source.indexOf(\"url(\") && source.indexOf(\")\") === source.length - 1) ?\r\n source.slice(4, -1).replace(uutrim._QUOTE, \"\") : source;\r\n}", "buildURL(){\n var url = this._super(...arguments);\n if (url.lastIndexOf('/') !== url.length - 1) {\n url += '/';\n }\n return url;\n }", "function imgURLGetter( apiResult ){\n var imgArr = JSON.parse( apiResult ).hits;\n if (imgArr.length === 0) { return errorImage();}\n var numHits = imgArr.length;\n var randomImgIndex = Math.floor( Math.random() * numHits );\n return imgArr[ randomImgIndex ].webformatURL;\n}", "function viewFullImg(uri){\n\tconst html = `<img src=\"${uri}\">`\n\tdocument.getElementById(\"results\").innerHTML = html;\n}", "function escapeSpecialChar(imageurl) {\r\n if (imageurl != \"\" && imageurl != null) {\r\n\r\n imageurl = imageurl.replace(/&/g, '&amp;');\r\n imageurl = imageurl.replace(/</g, '&lt;');\r\n imageurl = imageurl.replace(/>/g, '&gt;');\r\n imageurl = imageurl.replace(/\"/g, '&quot;');\r\n imageurl = imageurl.replace(/'/g, '&apos;');\r\n return imageurl;\r\n } else {\r\n return \"https://3425005-sb1.app.netsuite.com/core/media/media.nl?id=23774770&amp;c=3425005_SB1&amp;h=4JRD3TXTflztyPx40gQ4uuPCP0_Xgv98YiG3PZt15RdLNUyr&amp;fcts=20201126233413&amp;whence=\";\r\n }\r\n\r\n }", "function fix(url, domain) {\n \t\t// console.log(object);\n \tif (domain == \"i.imgur.com\")\n \t{\n \t\treturn url;\n\t}\n \telse if (domain == \"imgur.com\")\n\t{\n \t\treturn \"http://i.imgur.com/\" + url.slice(17) + \"m.jpg\";\n \t}\n \telse \n \t{\n \t\treturn \"\";\n \t}\n\n}", "function smallImage(filename) {\r\n let size = \"w_55\";\r\n return `https://res.cloudinary.com/funwebdev/image/upload/${size}/art/paintings/${filename}`;\r\n }", "function URLify(str, length) {\n\tvar result = '';\n\tfor (var i = 0; i < length; i++) {\n\t\tstr[i] === ' '\n\t\t? result += '%20'\n\t\t: result += str[i];\n\t}\n\treturn result;\n}", "function URLify(str, length) {\n let url = '';\n for (let i = 0; i < length; i++) {\n let char = str[i];\n if (char === ' ') {\n url += '%20';\n } else {\n url += char;\n }\n }\n return url;\n}", "static imageUrlForRestaurantS(restaurant) {\r\n if (restaurant.photograph === undefined){\r\n return 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';\r\n }\r\n return (`/img/400_${restaurant.photograph}.jpg`);\r\n }", "getHtmlEmployeeString(name, description, iconHtml, title, imageUrl, employeeDetails) {\n //check if the image passed in is valid and if not provide a default that works\n const isValidUrl = this.isImageUrlValid(imageUrl);\n let urlGettingPassed;\n if (isValidUrl) {\n urlGettingPassed = imageUrl;\n } else {\n urlGettingPassed = \"https://source.unsplash.com/800x600/?professional\";\n }\n return `\n <div class=\"column is-one-third\">\n <div class=\"card is-shady\">\n <div class=\"card-image\">\n <figure class=\"image\">\n <img src=\"${urlGettingPassed}\" alt=\"${name}\">\n </figure>\n </div>\n <div class=\"card-content\">\n <div class=\"content\">\n <h4>${name}</h4>\n <h2>${iconHtml} ${title}</h2>\n <p>${description}</p>\n ${employeeDetails}\n </div>\n </div>\n </div>\n </div>`;\n }", "function large_image(result){\n\tvar parsed = JSON.parse(result);\n\tvar image_url = parsed.collection.items[1].href;\n\tvar image_spot = document.getElementById('side_image');\n\t\n\tdocument.getElementById('loading_photo').style.display = \"none\";\n\t\n\tvar img = new Image(); \n\timg.src = image_url;\n\timg.setAttribute('width',\"100%\");\n\timage_spot.appendChild(img);\n}", "function getItemImage() {\r\n var item_image = '';\r\n item_image = img_data[1].getElementsByTagName('img')[0].getAttribute('src');\r\n return encodeURIComponent(\"http://\" + window.location.hostname + \"/\" + item_image);\r\n }", "function URLify(string, truelength){\n string = string.slice(0, truelength);\n for(let i = string.length; i >= 0; i--){\n if(string[i] === ' '){\n string = string.slice(0, i) + '%20' + string.slice(i+1, string.length);\n }\n }\n return string;\n}", "function prepViewLargeImageLink(product_id, image_type, cache_url) {\n var fullsize_link = document.getElementById('full-size-image-link');\n if (fullsize_link != null) {\n fullsize_link.onclick = function() {\n launchNamePopUp('imgL', '/' + channel + '/ViewFullSizeImage.ice?productID=' + product_id + '&currentImage=' + image_type, 580,760);\n };\n }\n}", "function generatePhoto(id) {\n\treturn ('[url=' + images[id].link + '][img]' + images[id].url + document.getElementById('photoSize').value +'[/img][/url]');\n}", "function URLify2(str, length) {\n str = str.split(' ')\n while (str[str.length - 1].length === 0) {\n str.pop();\n }\n return str = str.join('%20');\n}", "function getImageUrl(imageSrc) {\n if (imageSrc) {\n imageSrc = imageSrc.replace(\"www.dropbox\", \"dl.dropboxusercontent\").split(\"?dl=\")[0];\n imageSrc = imageSrc.replace(\"dropbox.com\", \"dl.dropboxusercontent.com\").split(\"?dl=\")[0];\n imageSrc = imageSrc.replace(\"dl.dropbox.com\", \"dl.dropboxusercontent.com\");\n }\n return imageSrc;\n }", "function readURL(input) {\n if (input.files && input.files[0]) {\n var reader = new FileReader();\n\n reader.onload = function (e) {\n const maxLength = 2000000\n console.log(e.loaded + \"\" + e.total);\n console.log(e);\n if (e.loaded < maxLength) {\n //document.getElementById('ImageLength').innerText = \"\";\n $('#imgpreview').attr('src', e.target.result);\n }\n else {\n $('#imgpreview').attr('src',\"../../Content/img/descarga.jpg\");\n document.getElementById('lblCargarFoto').innerText = \"\";\n document.getElementById('CargarFoto').value = \"\";\n document.getElementById('ImageLength').innerText = \"Limite Excedido, máximo 2 MB\";\n }\n }\n reader.readAsDataURL(input.files[0]);\n }\n}", "function photo_thumbnail_url(request, response) {\n\n if (!request.user || !request.user.authenticated()) {\n response.error(\"Needs an authenticated user\");\n return;\n }\n\n var query = new Parse.Query(PHOTO_OBJECT_NAME);\n query.get(request.params.objectId, {\n\n success: function(result) {\n\n response.success({\n url: cloudinary.url(result.get(CLOUDINARY_IDENTIFIER_FIELD_NAME), {crop: \"fill\", width: 150, height: 150})\t\n });\n\n },\n error: function() {\n response.error(\"image lookup failed\");\n }\n\n });\n\n}", "function SafeResourceUrl() { }", "function SafeResourceUrl() { }", "function SafeResourceUrl() { }", "function getImgurURL(oldURL) {\n\tif (!oldURL) {\n\t\treturn (\"\");\n\t}\n\telse if (oldURL.indexOf(\"imgur\") == -1) {\n\t\treturn (\"\");\n\t}\n\telse if (oldURL.replace(\".com\").indexOf(\".\") > -1) {\n\t\treturn (oldURL.replace(\"gallery/\",\"\"));\n\t}\n\t\n\tvar index = oldURL.lastIndexOf(\"/\");\n var tempID = oldURL.substring(index + 1);\n\tvar url = \"http://i.imgur.com/\" + tempID + \".jpg\";\n\treturn (url);\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 getItemImage()\r\n {\r\n var element = document.getElementById(\"mp\");\r\n\t\r\n if(element!=null)\r\n {\r\n var item_image = element.getAttribute('src');\r\n } else item_image = '';\r\n\t\r\n return encodeURIComponent( !is_valid_url(item_image) ? 'http://fuzhuangpifa.cn/' + item_image : item_image);\r\n }", "getVoterPhotoUrlTiny (){\n return this.getState().voter.voter_photo_url_tiny || \"\";\n }", "function addUrlImage(data) {\r\n $(\"#image_search_result\").empty();\r\n var img;\r\n if (data.url != '0') {\r\n img = \"<span class='selected_image'><img class='image_by_url' src='\" + data.url + \"'></span>\";\r\n } else {\r\n img = \"<p>Not image</p>\";\r\n }\r\n $(\"#image_search_result\").append(img);\r\n }", "function _usfGetOriginImgWithSize(url, size = '50x50') {\r\n var n = url.lastIndexOf(\".\");\r\n if (n != -1)\r\n return url.substring(0, n) + '_' + size + url.substring(n);\r\n else\r\n return url\r\n}", "static bluredImageUrlForRestaurant(restaurant) {\r\n // for development we need to remove \"/mws-restaurant-stage-1\"\r\n const url = window.location.href;\r\n if(url.startsWith('https')) {\r\n return (`/mws-restaurant-stage-1/img/${restaurant.photograph}`);\r\n }\r\n return (`/img/${restaurant.photograph || 10}-800_lazy_load.jpg`); \r\n }", "formatPreviewLink() {\n if (this.props.book.previewLink) {\n return (\n <a\n href={this.props.book.previewLink}\n aria-label={`Preview ${this.props.book.title} at Google Books`}\n className=\"book-link book-link-preview\">\n <img\n className=\"book-link-preview\"\n src={`${process.env.PUBLIC_URL + '/images/google-books-preview.png'}`}\n alt={`Preview ${this.props.book.title} at Google Books`}\n />\n </a>\n );\n }\n }", "function imageLargeUrl(img) {\n var retUrl;\n // try new photobox format first, parent LI has a data-photo-id attribute\n var imageId = myJQ(img).parent().attr(\"data-photo-id\");\n if (imageId) {\n // TODO the \"plus\" image still appears to exist even if there is no zoom box, any exceptions?\n retUrl = myJQ(\"#Photobox_PhotoserverPlusUrlString,#PhotoserverPlusUrlString\").attr(\"value\") + imageId + \".jpg\";\n } else {\n // old format\n // thumbnail link has class \"lbt_nnnnn\"\n imageId = myJQ(img).parent().attr(\"class\").substring(4);\n\n // TODO is \"photoStartIdNewDir\" still used in the old-format listings? \n // This is what TM does in their own script, comparing the current image ID to the ID where they started storing the images in a new path.\n var isNewImage = (unsafeWindow.photoStartIdNewDir ? unsafeWindow.photoStartIdNewDir > imageId : false);\n if (isNewImage) {\n retUrl = img.src.replace(\"/thumb\", \"\").replace(\".jpg\", \"_full.jpg\");\n } else {\n retUrl = img.src.replace(\"/thumb\", \"/full\");\n }\n }\n console.log(retUrl);\n return retUrl;\n}", "function URLify(str,len) {\n str = str.slice(0,len);\n return str.split(' ').join('%20')\n}", "getVoterPhotoUrlMedium (){\n return this.getState().voter.voter_photo_url_medium || \"\";\n }", "goodPhotoThumbnail(goodId, imageIndex) {\n return `http://${helpers.base}/images/goods/thumbnail/pht_${goodId}_${imageIndex}.jpg`;\n }", "function render(id, title, imgUrl, height, width, prev, next) {\n var imgContainer = \"<div id='\" + id + \"' class='thumb col-md-3' data-title='\" + title + \"' data-previous='\" + prev + \"' data-next='\"+ next + \"' style='background-repeat: no-repeat; position: relative; max-width:\" + width + \"px; width: 100%; height:\" + height + \"px;'><img src='\" + imgUrl + \"'/></div>\";\n document.getElementById(\"container\").innerHTML += imgContainer;\n }", "function render_url(text) {\n if (text.includes(\"http\")) {\n return \"<a href=\\\"\" + text + \"\\\" target=\\\"_blank\\\">Buy Here</a>\";\n } else {\n return text;\n }\n }", "getImage(){\n return '';//This might change later, we will see what I want this to be\n }", "function imgEncode( str ){\n// encodeURIComponent skips \"~!*()'\", so we include them here\n if (str.indexOf(\"|\") != -1) {\n str = str.substring(0,str.length -2);\n }\n // fix for IE href attribute\n if ($.browser.msie && str.indexOf(\"http://\" + window.location.hostname) != -1) {\n str = str.replace(\"http://\" + window.location.hostname, \"\");\n }\n str = str.substring(10);\n\n //return \"thumbnails/\" + $.trim(str) + \".gif\";\n //return \"thumbnails/\"+ encodeURIComponent($.trim(str)).replace(/!/g,'%21').replace(/\\*/g,'%2A').replace(/\\(/g,'%28').replace(/\\)/g,'%29').replace(/'/g,'%27') +\".gif\";\n return \"thumbnails/\"+ encodeURIComponent($.trim(str)).replace(/!/g,'%21').replace(/\\*/g,'%2A').replace(/\\(/g,'%28').replace(/\\)/g,'%29').replace(/'/g,'%27') +\".gif\";\n\n}", "function UserImage(props) {\n const [imageErr, setImageErr] = useState(false);\n\n function handleBrokenLink() {\n setImageErr(true);\n }\n\n return (\n <section>\n {/* add figure/figcation to all images */}\n\n {(props.previewImg || props.image) && !imageErr ? (\n <img\n style={{\n width: \"200px\",\n height: \"200px\",\n borderRadius: \"50%\",\n }}\n src={props.previewImg || props.image}\n onError={handleBrokenLink}\n alt={props.previewImg ? \"current profile pic preview\" : \"profile pic\"}\n />\n ) : (\n <p>Avatar Image</p>\n )}\n </section>\n );\n}", "urlShorten(url) {\n let name = url;\n\n if (url.length > 50) {\n name = url.substr(0, 33);\n name += \"...\";\n name += url.substr(-14);\n }\n\n return name;\n }", "image_preview() {\n if (Template.instance().imageLoaded.get() === 0) {\n return _.pluck(_.where(Images.find().fetch(), { recipeID: FlowRouter.getParam('_id') }), 'imageURL')[0];\n } else {\n return Template.instance().dataUrl.get();\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}", "renderNewImage() {\n\n document.getElementById('img').src = `${this.url}`\n document.getElementById('p1').innerText = `${this.caption}`\n\n }", "function expandedImageUrl(photo_id) {\n //return 'http://oldnyc-assets.nypl.org/600px/' + photo_id + '.jpg';\n //return 'http://192.168.178.80/thumb/' + photo_id + '.jpg';\n return 'http://www.oldra.it/thumb/' + photo_id + '.jpg';\n}", "function 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}", "render () {\r\n\t\tconst { description, urls } = this.props.image;\r\n\r\n\t\treturn (\r\n\t\t\t<div style={{ gridRowEnd: `span ${this.state.spans}` }}>\r\n\t\t\t\t<img \r\n\t\t\t\t\tref={this.imageRef}\r\n\t\t\t\t\talt={description}\r\n\t\t\t\t\tsrc={urls.regular}\r\n\t\t\t\t/>\r\n\t\t\t</div>\r\n\t\t);\r\n\t}", "function getThumbnail(book) {\n let thumbnailUrl = book.volumeInfo && book.volumeInfo.imageLinks && book.volumeInfo.imageLinks.smallThumbnail;\n return thumbnailUrl ? thumbnailUrl.replace(/^http:\\/\\//i, 'https://') : '';\n }", "function ProfileImg(props) {\n const { url, size, link } = props;\n\n const imgStyles = {\n width: `${size}rem`,\n borderRadius: '100%',\n }\n\n return (\n <div>\n <Link to={link}>\n <img\n src={url}\n style={imgStyles}\n />\n </Link>\n </div>\n );\n}", "function checkForImg(val){\n return !val ? 'https://tinyurl.com/tv-missing' : val.original\n }", "function getLogoUrl2(url){\n\t$(\"#addLogoModal\").modal(\"hide\");\n\n\t$(\"#edit_ .froala-element p\").append( '<img src=\"'+window.location.origin+url+'\" />' );\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 }", "renderFileUri(reviewId) {\n if (this.state.photo[reviewId]) {\n return (<Image \n source={{ uri: this.state.photo[reviewId] }} \n style={{ height: 400, width: null, flex: 1, marginHorizontal: 3 }}\n />);\n } \n }", "function urlRenderer() {\n\treturn function(value) {\n\t\tif (value) {\n\t\t\tvar url = \"\";\n\t\t\tvar label = \"\";\n\t\t\tvar s = value.split(\"\\n\");\n\t\t\tif (s.length == 2) {\n\t\t\t\turl = Ext.util.Format.htmlEncode(s[1]);\n\t\t\t\tlabel = Ext.util.Format.htmlEncode(s[0]) || url;\n\t\t\t}\n\t\t\telse {\n\t\t\t\turl = Ext.util.Format.htmlEncode(value);\n\t\t\t\tlabel = Ext.util.Format.htmlEncode(value);\n\t\t\t}\n\t\t\treturn \"<a href=\\\"\" + url + \"\\\" target=\\\"_blank\\\">\" + label + \"</a>\";\n\t\t}\n\t\treturn \"\";\n\t};\n}", "function SafeResourceUrl() {}", "function SafeResourceUrl() {}", "function SafeResourceUrl() {}", "function SafeResourceUrl() {}", "function SafeResourceUrl() {}", "function displayResult(url, large_url) {\n\t\t\tlet image = document.createElement('img');\n\t\t\timage.src = url;\n\t\t\tresults.appendChild(image);\n\t\t\timage.dataset.large_url = `${large_url}`;\n\t\t\timage.className = 'lightBoxImage';\n\t\t}", "function displayImage() {\n img.style.backgroundImage = \"url('\" + images[iActiveImg].images.standard_resolution.url + \"')\";\n // Truncate captions that are too long to fit in their allotted space.\n if (images[iActiveImg].caption.text.length > 40) {\n images[iActiveImg].caption.text = images[iActiveImg].caption.text.slice(0, 40) + '...';\n }\n imgTitle.innerHTML = '<p>' + images[iActiveImg].caption.text + '</p>';\n}", "function formatImgSrc(imgURL) {\n\t\treturn 'resources/'+/[a-z_]*.gif/.exec(imgURL)[0];\n\t}", "function getShortURL () {\n\t//base 36 characters\n\tvar alphanumeric = ['0','1','2','3','4','5','6','7','8','9','A','B',\n\t\t\t\t\t\t'C','D','E','F','G','H','I','J','K','L','M','N',\n\t\t\t\t\t\t'O','P','Q','R','S','T','U','V','W','X','Y','Z'];\n\tvar urlString = \"http://localhost:3000/\";\n\tfor (i = 0; i < 4; i++) {\n\t\tvar num = randomNum(0,35);\n\t\turlString = urlString + alphanumeric[num];\n\t}\n\n\treturn urlString;\n}" ]
[ "0.58814675", "0.5874486", "0.5849954", "0.58483356", "0.5749398", "0.574464", "0.57118964", "0.5703574", "0.568112", "0.5611665", "0.5597645", "0.55876744", "0.5550715", "0.5543544", "0.55422634", "0.5535454", "0.54782176", "0.5475347", "0.54525286", "0.54496557", "0.5444438", "0.5444117", "0.54381377", "0.54381377", "0.5363813", "0.53346467", "0.53219754", "0.53213847", "0.5313842", "0.5307579", "0.5299762", "0.52862495", "0.5282664", "0.5277135", "0.5273647", "0.524682", "0.5244377", "0.52306914", "0.5229846", "0.5227074", "0.5227008", "0.52229184", "0.5214384", "0.5213544", "0.520523", "0.52021605", "0.5200848", "0.5197825", "0.51948917", "0.5189232", "0.5186096", "0.51812816", "0.5175239", "0.51627994", "0.51600957", "0.51405454", "0.51383257", "0.5134455", "0.5134455", "0.5134455", "0.5132959", "0.51298666", "0.512932", "0.51223564", "0.5119762", "0.51074195", "0.5106738", "0.5105134", "0.510425", "0.509624", "0.5096005", "0.50920564", "0.50858206", "0.50812167", "0.5079924", "0.5075337", "0.5071942", "0.50714946", "0.5065068", "0.5062378", "0.50610435", "0.5056101", "0.5051259", "0.5051161", "0.5044942", "0.5037746", "0.5031094", "0.50284386", "0.50210565", "0.5020699", "0.50198436", "0.5012986", "0.5012986", "0.5012986", "0.5012986", "0.5012986", "0.50124776", "0.50003326", "0.49990642", "0.49982053" ]
0.58346325
4
Renders a thumbnail view of the image.
function renderThumbnail(url) { var canvas = document.querySelector('#thumbnail'); var context = canvas.getContext('2d'); canvas.width = 100; canvas.height = 100; var image = new Image(); image.addEventListener('load', function() { var src_w = image.width; var src_h = image.height; var new_w = canvas.width; var new_h = canvas.height; var ratio = src_w / src_h; if (src_w > src_h) { new_h /= ratio; } else { new_w *= ratio; } canvas.width = new_w; canvas.height = new_h; context.drawImage(image, 0, 0, src_w, src_h, 0, 0, new_w, new_h); }); image.src = url; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function display() {\n var content = this.getContent();\n var root = Freemix.getTemplate(\"thumbnail-view-template\");\n\n content.empty();\n content.append(root);\n this._setupViewForm();\n this._setupLabelEditor();\n\n var images = Freemix.property.getPropertiesWithType(\"image\");\n\n var image = content.find(\"#image_property\");\n\n // Set up image property selector\n this._setupPropertySelect(image, \"image\", images);\n this._setupTitlePropertyEditor();\n this._setupMultiPropertySortEditor();\n\n image.change();\n }", "_renderThumbnail($$) {\n let node = this.props.node\n // TODO: Make this work with tables as well\n let contentNode = node.find('graphic')\n let el = $$('div').addClass('se-thumbnail')\n if (contentNode) {\n el.append(\n $$(this.getComponent(contentNode.type), {\n node: contentNode,\n disabled: this.props.disabled\n })\n )\n } else {\n el.append('No thumb')\n }\n return el\n }", "render() {\n const { source } = this.props;\n\n return (\n <Thumbnail\n large\n source={source}\n />\n );\n }", "function render(id, title, imgUrl, height, width, prev, next) {\n var imgContainer = \"<div id='\" + id + \"' class='thumb col-md-3' data-title='\" + title + \"' data-previous='\" + prev + \"' data-next='\"+ next + \"' style='background-repeat: no-repeat; position: relative; max-width:\" + width + \"px; width: 100%; height:\" + height + \"px;'><img src='\" + imgUrl + \"'/></div>\";\n document.getElementById(\"container\").innerHTML += imgContainer;\n }", "_buildImg(thumb, height) {\n var scaleFactor = height / thumb.h\n var $img = $(\"<img />\").addClass(\"thumbnail-img\").attr(\"src\", thumb.url)\n\n // the container will contain the image positioned so that the correct sprite\n // is visible\n var $container = $(\"<div />\").addClass(\"thumbnail-container\")\n $container.css(\"width\", thumb.w * scaleFactor)\n $container.css(\"height\", height)\n $img.css({\n height: thumb.imageH * scaleFactor,\n left: -1 * thumb.x * scaleFactor,\n top: -1 * thumb.y * scaleFactor\n })\n $container.append($img)\n return $container\n }", "function PostThumbnail(props) {\n return (\n <div className={css.square}>\n <div className={css.content}>\n <img className={css.image} src={publicUrl(props.src)} alt={props.alt}/>\n </div>\n </div>\n );\n}", "function ThumbnailRenderer() {\n\tbitsyLog(\"NEW THUMB RENDERER\", \"editor\");\n\n\tvar drawingThumbnailCanvas, drawingThumbnailCtx;\n\tdrawingThumbnailCanvas = document.createElement(\"canvas\");\n\tdrawingThumbnailCanvas.width = tilesize * scale; // TODO: scale constants need to be contained somewhere\n\tdrawingThumbnailCanvas.height = tilesize * scale;\n\tdrawingThumbnailCtx = drawingThumbnailCanvas.getContext(\"2d\");\n\n\tvar thumbnailRenderEncoders = {};\n\tvar cache = {};\n\n\tfunction thumbnailGetImage(drawing, frameIndex) {\n\t\tif (drawing.type === TileType.Sprite || drawing.type === TileType.Avatar) {\n\t\t\treturn getSpriteFrame(sprite[drawing.id], frameIndex);\n\t\t}\n\t\telse if(drawing.type === TileType.Item) {\n\t\t\treturn getItemFrame(item[drawing.id], frameIndex);\n\t\t}\n\t\telse if(drawing.type === TileType.Tile) {\n\t\t\treturn getTileFrame(tile[drawing.id], frameIndex);\n\t\t}\n\t\treturn null;\n\t}\n\n\tfunction thumbnailDraw(drawing, context, x, y, frameIndex) {\n\t\tvar renderedImg = renderTileToCanvas(drawing, frameIndex);\n\t\tif (renderedImg) {\n\t\t\tcontext.drawImage(renderedImg, x, y, tilesize * scale, tilesize * scale);\n\t\t}\n\t\telse {\n\t\t\tbitsyLog(\"oh no! image render for thumbnail failed\", \"editor\");\n\t\t}\n\t}\n\n\tfunction render(imgId,drawing,frameIndex,imgElement) {\n\t\tvar isAnimated = (frameIndex === undefined || frameIndex === null) ? true : false;\n\n\t\tvar palId = getRoomPal(state.room); // TODO : should NOT be hardcoded like this\n\n\t\tvar hexPalette = [];\n\t\tvar roomColors = getPal(palId);\n\t\tfor (i in roomColors) {\n\t\t\tvar hexStr = rgbToHex(roomColors[i][0], roomColors[i][1], roomColors[i][2]).slice(1);\n\t\t\thexPalette.push(hexStr);\n\t\t}\n\n\t\t// bitsyLog(id, \"editor\");\n\n\t\tvar drawingFrameData = [];\n\n\t\tif( isAnimated || frameIndex == 0 ) {\n\t\t\tthumbnailDraw(drawing, drawingThumbnailCtx, 0, 0, 0 /*frameIndex*/);\n\t\t\tdrawingFrameData.push( drawingThumbnailCtx.getImageData(0,0,tilesize*scale,tilesize*scale).data );\n\t\t}\n\t\tif( isAnimated || frameIndex == 1 ) {\n\t\t\tthumbnailDraw(drawing, drawingThumbnailCtx, 0, 0, 1 /*frameIndex*/);\n\t\t\tdrawingFrameData.push( drawingThumbnailCtx.getImageData(0,0,tilesize*scale,tilesize*scale).data );\n\t\t}\n\n\t\t// create encoder\n\t\tvar gifData = {\n\t\t\tframes: drawingFrameData,\n\t\t\twidth: tilesize*scale,\n\t\t\theight: tilesize*scale,\n\t\t\tpalette: hexPalette,\n\t\t\tloops: 0,\n\t\t\tdelay: animationTime / 10 // TODO why divide by 10???\n\t\t};\n\t\tvar encoder = new gif();\n\n\t\t// cancel old encoder (if in progress already)\n\t\tif( thumbnailRenderEncoders[imgId] != null )\n\t\t\tthumbnailRenderEncoders[imgId].cancel();\n\t\tthumbnailRenderEncoders[imgId] = encoder;\n\n\t\t// start encoding new GIF\n\t\tif (imgElement === undefined || imgElement === null) {\n\t\t\timgElement = document.getElementById(imgId);\n\t\t}\n\t\tencoder.encode( gifData, createThumbnailRenderCallback(imgElement) );\n\t}\n\tthis.Render = function(imgId,drawing,frameIndex,imgElement) {\n\t\trender(imgId,drawing,frameIndex,imgElement);\n\t};\n\n\tfunction createThumbnailRenderCallback(img) {\n\t\treturn function(uri) {\n\t\t\t// update image\n\t\t\timg.src = uri;\n\t\t\timg.style.background = \"none\";\n\n\t\t\t// update cache\n\t\t\tcache[img.id] = {\n\t\t\t\turi : uri,\n\t\t\t\toutOfDate : false\n\t\t\t};\n\t\t};\n\t}\n\n\tthis.GetCacheEntry = function(imgId) {\n\t\tif (!cache[imgId]) {\n\t\t\tcache[imgId] = {\n\t\t\t\turi : null,\n\t\t\t\toutOfDate : true\n\t\t\t};\n\t\t}\n\t\treturn cache[imgId];\n\t}\n}", "function setThumbnail(evt) {\n\tconst imgContainer = document.querySelector(\"#image-container\");\n\n\tconst reader = new FileReader();\n\n\treader.addEventListener(\"load\", (evt) => {\n\t\tconst img = document.createElement(\"img\");\n\t\timg.src = evt.target.result;\n\t\timg.classList.add(\"thumbnail\");\n\t\timgContainer.appendChild(img);\n\t});\n\treader.readAsDataURL(evt.target.files[0]);\n}", "function thumbnailClickHandler(evt) {\n var target = evt.target;\n if (!target || !target.classList.contains('thumbnail'))\n return;\n\n if (currentView === thumbnailListView || currentView === fullscreenView) {\n showFile(parseInt(target.dataset.index));\n }\n else if (currentView === thumbnailSelectView) {\n updateSelection(target);\n }\n else if (currentView === pickView) {\n cropPickedImage(files[parseInt(target.dataset.index)]);\n }\n}", "function onPhotoURISuccess(imageURI) {\n showThumbnail(imageURI);\n}", "function displayThumb(result) {\n var htmlStr = \"\";\n for (var i = 0; i < result.length; i++){\n htmlStr += '<figure><a href=\"' + result[i].url + '\"><img src=\"' + result[i].url + '\" alt=\"' + result[i].description + '\" height=\"200\" width=\"200\"></a><figcaption>' + result[i].description + '</figcaption></figure>';\n }\n $(\"#thumbnails\").html(htmlStr);\n $( \"figure\" ).draggable();\n }", "function ShowThumbnails( fileUrl, data )\n{\n // this = CKFinderAPI\n var sFileName = this.getSelectedFile().name;\n document.getElementById( 'thumbnails' ).innerHTML +=\n '<div class=\"thumb\">' +\n '<img src=\"' + fileUrl + '\" />' +\n '<div class=\"caption\">' +\n '<a href=\"' + data[\"fileUrl\"] + '\" target=\"_blank\">' + sFileName + '</a> (' + data[\"fileSize\"] + 'KB)' +\n '</div>' +\n '</div>';\n\n document.getElementById( 'preview' ).style.display = \"\";\n // It is not required to return any value.\n // When false is returned, CKFinder will not close automatically.\n return false;\n}", "preview(file) {\n this.thumbTarget.innerHTML = `<span>${file.type}<br>${file.name}</span>`\n const url = URL.createObjectURL(file.data)\n\n if (file.type.includes(\"image\")) {\n this.thumbTarget.innerHTML = `<img src=\"${url}\">`\n } else if (file.type.includes(\"video\")) {\n this.thumbTarget.innerHTML = `<video src=\"${url}\" preload=\"metadata\"></video>`\n } else {\n this.thumbTarget.innerHTML = `<span>${file.type}<br>${file.name}</span>`\n }\n }", "function thumb_loaded(event) {\n \"use strict\";\n // prepare the output canvas\n var newImg = new Image();\n newImg.src = event.target.src;\n\n aspectRatio = newImg.width / newImg.height;\n output_canvas.height = defaults.output_height;\n output_canvas.width = defaults.output_height * aspectRatio;\n\n // and render\n go();\n}", "function createDisplayThumbnail(videoSnippet) {\n var titleEl = $('<h3>');\n titleEl.addClass('video-title');\n $(titleEl).html(videoSnippet.title);\n var thumbnailUrl = videoSnippet.thumbnails.medium.url;\n\n var div = $('<div>');\n div.addClass('video-content');\n div.css('backgroundImage', 'url(\"' + thumbnailUrl + '\")');\n div.append(titleEl);\n $('#video-container').append(div);\n}", "function clickOnThumbnail() {\n\tgetPhotoUrl($(this));\n\t$container.append($photoviewer.append($photoBox).append($caption));\n\t$photoBox.after($leftClick);\n\t$photoBox.before($rightClick);\n\t$(\"html\").css(\"background\",\"gray\");\n\t//All other images are not visible\n\t$(\".thumbnail\").addClass(\"greyed-out\");\n\t$(\".small-img\").hide();\n\t$leftClick.on(\"click\",leftClick);\n\t$rightClick.on(\"click\",rightClick);\n}", "function updateThumbnail()\n{\n\tvar thumb_dimension = 100;\n\tvar thumbnail_style = $('#thumbnail');\n\tupdateSelection();\n\t//should be the same\n\tvar X_scale = thumb_dimension/selection.origWidth;\n\tvar Y_scale = thumb_dimension/selection.origHeight;\n\tthumbnail_style.css('width', imgObj.width*X_scale);\n\tthumbnail_style.css('height', imgObj.height*Y_scale);\n\tthumbnail_style.css('left', -selection.origX*X_scale);\n\tthumbnail_style.css('top', -selection.origY*Y_scale);\n}", "function displayImage(domAAroundImgThumb)\n{\n if (domAAroundImgThumb.attr('href'))\n {\n var newSrc = domAAroundImgThumb.attr('href').replace('thickbox','large');\n if ($('#bigpic').attr('src') != newSrc)\n\t\t{ \n $('#bigpic').fadeIn('fast', function(){\n $(this).attr('src', newSrc).show();\n if (typeof(jqZoomEnabled) != 'undefined' && jqZoomEnabled)\n\t $(this).attr('alt', domAAroundImgThumb.attr('href'));\n });\n }\n $('#views_block li a').removeClass('shown');\n $(domAAroundImgThumb).addClass('shown');\n }\n}", "function zoto_modal_album_template_thumb_view(options) {\n\toptions = merge({\n\t\t'big_item_class': zoto_modal_album_template_thumb,\n\t\t'view_mode': \"big\",\n\t\t'max_items': 50,\n\t\t'glob': new zoto_glob({}),\n\t\t'edit_mode': true,\n\t\t'select_mode': \"single\"\n\t\t}, options);\n\tthis.$uber(options);\n\tthis.switch_view('big');\n\tthis.update_edit_mode(false);\n\tthis.view_options = [];\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 thumbnail(object) {\nreturn $(\"<div>\")\n .addClass(\"thumb\")\n .css(\"background-image\", \"url(\" + object.webImage.url.replace(\"s0\", \"s128\") +\")\");\n}", "function previewImage(file) {\n \t\tvar galleryId = \"gallery\";\n\n \t\tvar gallery = document.getElementById(galleryId);\n \t\tvar imageType = /image.*/;\n\n \t\tif (!file.type.match(imageType)) {\n \t\t\tthrow \"File Type must be an image\";\n \t\t}\n\n \t\tvar thumb = document.createElement(\"div\");\n \t\tthumb.classList.add('thumbnail');\n\n \t\tvar img = document.createElement(\"img\");\n \t\timg.file = file;\n \t\tthumb.appendChild(img);\n \t\tgallery.appendChild(thumb);\n\n \t\t// Using FileReader to display the image content\n \t\tvar reader = new FileReader();\n \t\treader.onload = (function(aImg) {\n \t\t\treturn function(e) {\n \t\t\t\taImg.src = e.target.result;\n \t\t\t};\n \t\t})(img);\n \t\treader.readAsDataURL(file);\n \t\t\n\t\tupload(thumb, file);\n \t}", "function a(e){var t=e.file,n=e.thumbnailMaxWidth,r=e.thumbnailMaxHeight,a=e.enableThumbnails;return t.type&&t.type.startsWith(\"image\")?(t=t instanceof Blob?t:new Blob([t]),new s.default(function(e,n){var r=new Image;r.onload=function(){e(r)},r.onerror=n,r.src=URL.createObjectURL(t)}).then(function(e){var o=(0,c.default)(e,\"height\",\"width\");if(!a)return[null,o,null];var s=i(o,n,r),u=document.createElement(\"canvas\");u.width=s.width,u.height=s.height;var d=u.getContext(\"2d\");(0,l.orient)({orientation:t&&t.image?t.image.orientation:\"\",img:e,x:0,y:0,width:s.width,height:s.height,ctx:d},t);for(var p=u.toDataURL(\"image/png\").split(\",\"),f=atob(p[1]),h=new ArrayBuffer(f.length),m=new DataView(h),v=0;v<f.length;v++)m.setUint8(v,f.charCodeAt(v));return[h,o,s]})):s.default.resolve()}", "goodPhotoThumbnail(goodId, imageIndex) {\n return `http://${helpers.base}/images/goods/thumbnail/pht_${goodId}_${imageIndex}.jpg`;\n }", "function buildThumbnailDiv(photo) {\n var APIImgUrl = prepareUrl(photo);\n //Define ltbox elements\n var innerBx = '<div class=\"image-box\">' + '<div class=\"imageholder\"><img src=\"' + APIImgUrl + '\"/>' + '</div></div>';\n var newImgDiv = document.createElement(\"div\");\n newImgDiv.setAttribute(\"class\", \"thumbnail\");\n newImgDiv.setAttribute(\"onClick\", \"displayLtBox(\\'\" + APIImgUrl + \"\\',\\'\" + photo.title + \"\\')\");\n newImgDiv.innerHTML = innerBx;\n return newImgDiv;\n}", "function thumbnail(id, info)\n{\n // caption, usually contains date\n let cap = document.createElement('span');\n cap.classList.add('cap');\n cap.textContent = info.date;\n\n // this says how many photos/videos gallery has\n let infoContent = [];\n\n if(info.images)\n infoContent.push(document.createTextNode(pl(info.images, 'fotka')));\n if(info.images && info.videos)\n infoContent.push(document.createElement('br'));\n if(info.videos)\n infoContent.push(document.createTextNode(pl(info.videos, 'video')));\n\n let imgInfo = document.createElement('span');\n imgInfo.classList.add('info');\n imgInfo.append(...infoContent);\n\n // thumbnail image, we are adding \"ghost\" src/srcset attributes to be\n // copied to real ones upon becoming visible (ie. lazy loading)\n let image = document.createElement('img');\n if('thumb' in info)\n image.setAttribute('data-src', info.thumb.src);\n if('srcset' in info.thumb)\n image.setAttribute('data-srcset', info.thumb.srcset);\n\n // encompassing DIV element that holds the text content and the image\n let thumb = document.createElement('div');\n thumb.classList.add('th');\n thumb.append(cap, imgInfo, image);\n\n // wrapping A element\n let a = document.createElement('a');\n a.setAttribute('href', id + '/');\n a.classList.add('th');\n a.append(thumb);\n\n return a;\n}", "function loadThumbnail(id){\n return '<img class=\"youtube-thumb\" src=\"//i.ytimg.com/vi/' + id + '/hqdefault.jpg\"><div class=\"play-button\"></div>';\n }", "function createThumbnail(url) {\n const theContainer = document.createElement('div')\n theContainer.classList.add('thumbnail-item');\n \n theContainer.appendChild(createImage(url));\n \n return theContainer;\n\n}", "function ThumbnailItem(fileData) {\n if (!fileData) {\n throw new Error('fileData should not be null or undefined.');\n }\n this.data = fileData;\n\n this.htmlNode = document.createElement('div');\n this.htmlNode.classList.add('thumbnail');\n this.htmlNode.setAttribute('role', 'button');\n this.imgNode = document.createElement('img');\n this.imgNode.alt = '';\n this.imgNode.classList.add('thumbnailImage');\n this.imgNode.dataset.filename = fileData.name;\n\n // We revoke this url in imageDeleted\n var url = URL.createObjectURL(fileData.metadata.thumbnail);\n this.imgNode.src = url;\n this.htmlNode.appendChild(this.imgNode);\n\n if (navigator.mozL10n.readyState === 'complete') {\n this.localize();\n }\n}", "function scaleThumb() {\n\n\tjQuery('#thumbBig').remove();\n\n\tvar src\t= jQuery(this).attr('src');\n\n\t\t// dimensions of thumbnail\n\tvar w\t= parseInt(jQuery(this).width());\n\tvar h\t= parseInt(jQuery(this).height());\n\n\t\t// real dimensions of image\n\tvar nw\t= jQuery(this).context.naturalWidth;\n\tvar nh\t= jQuery(this).context.naturalHeight;\n\n\t\t// position of thumbnail\n\tvar x\t= Math.floor(jQuery(this).offset().left);\n\tvar y\t= Math.floor(jQuery(this).offset().top);\n\n\tvar big = jQuery('<img src=\"'+src+'\" width=\"'+w+'\" height=\"'+h+'\" id=\"thumbBig\" style=\"position:absolute; top:'+y+'px; left:'+x+'px;z-index:1000;\" />');\n\tjQuery('body').append(big);\n\n\tjQuery('#thumbBig')\n\t\t.animate({'width':nw+'px','height':nh+'px'},400)\n\t\t.bind('mouseleave',function(){jQuery(this).remove();});\n}", "function displayExampleThumbs() {\n // called from init()\n EXAMPLE_ALBUM.forEach(function(currentImage) {\n // Create thumbnail div elements\n let thumb = document.createElement(\"div\");\n thumb.id = `thumb-${currentImage.albumId}-${currentImage.id}`;\n thumb.classList.add(\"thumb\");\n thumb.style.backgroundImage = `url('${currentImage.url}')`;\n thumb.alt = currentImage.message;\n // Event listener to draw clicked thumb to canvas\n thumb.addEventListener(\"click\", function(event) {\n canvasImage(event.target);\n document.querySelector(\"#message-input\").value = \"\"; // clears custom message input upon new image selected\n });\n // Append thumb to thumbnail div wrapper\n exampleThumbsWrapper.append(thumb);\n });\n}", "function generateThumbnailElement() {\n var element;\n element += \"<a class='fancybox-button' rel='fancybox-button' href='images/Zetica_RASC_DC_main.png' title='Screenshot of main dash board'>\";\n element += \"<img class='thumbnail' src='images/Zetica_RASC_DC_main.png' alt='' />\";\n element += \"</a>\"\n return element;\n }", "function onResultReceived(imageId, context) {\n $(\"#\" + imageId).replaceWith(thumbnailTemplate(context));\n }", "function createThumbnail(imagenum) {\n var li = document.createElement('li');\n li.dataset.index = imagenum;\n li.classList.add('thumbnail');\n\n var fileinfo = files[imagenum];\n // We revoke this url in imageDeleted\n var url = URL.createObjectURL(fileinfo.metadata.thumbnail);\n\n // We set the url on a data attribute and let the onscreen\n // and offscreen callbacks below set and unset the actual\n // background image style. This means that we don't keep\n // images decoded if we don't need them.\n li.dataset.backgroundImage = 'url(\"' + url + '\")';\n return li;\n}", "render() {\n\t\treturn (\n\t\t\t<img \n\t\t\t\tsrc={ this.props.src } \n\t\t\t\talt={ this.props.title }\n\t\t\t\tclassName={ styles.image }\n\t\t\t/>\n\t\t);\n\t}", "function renderPhoto(photo) {\n const {thumbnailUrl, title, url} = photo;\n let template = `\n<div class=\"photo-card\">\n <a href=\"${thumbnailUrl}\" target=\"_blank\">\n <img src=\"${url}\" width= \"150\" height= \"150\">\n <figure>${title}</figure>\n </a>\n</div>`\n return template;\n}", "function viewImage(input,viewId,image_width,image_height) \r\n\t{\r\n\r\n\t\tif (input.files && input.files[0]) {\r\n\t\t var reader = new FileReader();\r\n\t\r\n\t\t reader.onload = function (e) {\r\n\t\t $('#'+viewId)\r\n\t\t .attr('src', e.target.result)\r\n\t\t .width(image_width)\r\n\t\t .height(image_height);\r\n\t\t };\r\n\t\t reader.readAsDataURL(input.files[0]);\r\n\t\t}\r\n\t}", "function previewImage(file) {\n var galleryId = \"gallery\";\n\n var gallery = document.getElementById(galleryId);\n var imageType = /image.*/;\n\n if (!file.type.match(imageType)) {\n throw \"File Type must be an image\";\n }\n\n var thumb = document.createElement(\"div\");\n thumb.classList.add('thumbnail'); // Add the class thumbnail to the created div\n\n var img = document.createElement(\"img\");\n img.file = file;\n thumb.appendChild(img);\n gallery.appendChild(thumb);\n\n // Using FileReader to display the image content\n var reader = new FileReader();\n reader.onload = (function (aImg) { return function (e) { aImg.src = e.target.result; }; })(img);\n reader.readAsDataURL(file);\n}", "function generateThumbnail() {\n c = document.createElement(\"canvas\");\n c.width = width;\n c.height = height;\n c.style.width = width;\n c.style.height = height;\n ctx = c.getContext(\"2d\");\n ctx.canvas.width = width;\n ctx.canvas.height = height;\n ctx.drawImage(video, 0, 0, width, height);\n var pixel = ctx.getImageData(x, y, 1, 1);\n var newx = video.currentTime; // or i for frame #?\n var newy = pixel.data[0] + pixel.data[1] + pixel.data[2];\n if (newy > 0) Plotly.extendTraces('plot', { x: [[newx]], y: [[newy]] }, [0])\n}", "get thumbnailUrl() {\n return this._data.thumbnail_url;\n }", "function showThumbnailImages(rowNumber) {\n\n // image wrapping\n if (rowNumber > images[images.length-1].image.thumbnailRow){\n rowNumber = 0;\n }\n\n // image wrapping\n if (rowNumber < 0){\n rowNumber = images[images.length-1].image.thumbnailRow;\n }\n\n // show thumbnails\n images.forEach(function(element, index) {\n var thumbnailImage = document.getElementById('h5p-image-gallery-thumbnail-'+index);\n\n if (element.image.thumbnailRow == ''+rowNumber){\n thumbnailImage.style.display = 'inline-block';\n }\n else{\n thumbnailImage.style.display = 'none';\n }\n });\n\n // keep track of current thumbnail showing\n currentThumbnail(rowNumber);\n}", "thumbnail (file, dataUrl) {\n if (file.previewElement) {\n file.previewElement.classList.remove(\"dz-file-preview\");\n for (let thumbnailElement of file.previewElement.querySelectorAll(\"[data-dz-thumbnail]\")){\n thumbnailElement.alt = file.name;\n thumbnailElement.src = dataUrl;\n }\n return setTimeout(()=>file.previewElement.classList.add(\"dz-image-preview\")\n , 1);\n }\n }", "function displayImage() {\n let image = document.createElement('img');\n image.setAttribute(\"src\", product.imageUrl);\n image.setAttribute(\"alt\", product.name);\n image.classList.add(\"img-thumbnail\",\"border-dark\");\n imageContainer.appendChild(image);\n}", "setThumbnail(thumbnailURL, useThumbnail) {\n if (useThumbnail) {\n this.loadThumbnail(thumbnailURL, (texture) => {\n this.useThumbnail = useThumbnail;\n this.thumbnailURL = thumbnailURL;\n const thumbnail = this.generateThumbnail(texture);\n this.setThumbnailSprite(thumbnail);\n });\n }\n }", "determineThumbnail() {\n if (this.props.book.imageLinks && this.props.book.imageLinks.smallThumbnail) {\n return `${this.props.book.imageLinks.smallThumbnail}`;\n } else {\n return `${process.env.PUBLIC_URL + '/images/missing-thumbnail.PNG'}`;\n }\n }", "renderImage() {\n\n const imageContainer = document.getElementById(\"image-container\")\n const div = document.createElement('div')\n div.className = 'container-fluid'\n imageContainer.append(div)\n const img = document.createElement('img')\n img.setAttribute('id', 'img')\n img.className = 'img-fluid'\n img.src = `${this.url}`\n\n const p1 = document.createElement('p1')\n p1.setAttribute('id', 'p1')\n\n p1.innerText = `${this.caption}`\n div.append(img, p1)\n\n }", "function large_image(result){\n\tvar parsed = JSON.parse(result);\n\tvar image_url = parsed.collection.items[1].href;\n\tvar image_spot = document.getElementById('side_image');\n\t\n\tdocument.getElementById('loading_photo').style.display = \"none\";\n\t\n\tvar img = new Image(); \n\timg.src = image_url;\n\timg.setAttribute('width',\"100%\");\n\timage_spot.appendChild(img);\n}", "function displayThumbnails() {\n // thumbnails.js started created thumbanils offscreen.\n // We're ready now to deal with them\n\n // Copy stuff to global variables\n // jshint ignore:start\n thumbnails = Thumbnails.container; // The element that holds the thumbnail\n thumbnailList = Thumbnails.list; // The object that represents them\n // jshint ignore:end\n\n // Now insert the thumbnails into the document.\n var placeholder = $('thumbnails-placeholder');\n placeholder.parentElement.replaceChild(thumbnails, placeholder);\n\n // Handle clicks on the thumbnails\n thumbnails.addEventListener('click', thumbnailClickHandler);\n\n // When the first page of thumbnails is diplayed, we can emit\n // our 'visually complete' mark for startup time comparison\n Thumbnails.firstpage.then(function() {\n // Tell performance monitors that \"above the fold\" content is displayed\n // and is ready to interact with.\n window.performance.mark('visuallyLoaded');\n window.performance.mark('contentInteractive');\n });\n\n // When all the thumbnails have been created, we can start a scan\n Thumbnails.complete.then(function() {\n if (files.length === 0) { // If we didn't find anything\n Overlay.show('scanning');\n }\n\n // Send a custom mark to performance monitors to note that we're done\n // enumerating the database at this point. We won't send the final\n // fullyLoaded marker until we're completely stable and have\n // finished scanning.\n window.performance.mark('mediaEnumerated');\n\n // Now that we've enumerated all the photos and videos we already know\n // about it is time to go and scan the filesystem for new ones. If the\n // MediaDB is fully ready, we can scan now. Either way, we always want\n // to scan every time we get a new 'ready' event.\n photodb.addEventListener('ready', function() { photodb.scan(); });\n if (photodb.state === MediaDB.READY) { // if already ready then scan now\n photodb.scan();\n }\n });\n }", "function ThumbnailItem(props) {_classCallCheck(this, ThumbnailItem);return _possibleConstructorReturn(this, (ThumbnailItem.__proto__ || Object.getPrototypeOf(ThumbnailItem)).call(this,\n props));\n }", "function imageDisplay(index){\n\t\tif( index >= data.length ){\n\t\t\treturn;\n\t\t} else {\n\t\t\tcreateImage(data[index].src, data[index].width, data[index].height);\n\t\t}\n\t}", "function thumbnailOnscreen(thumbnail) {\n if (thumbnail.dataset.backgroundImage)\n thumbnail.style.backgroundImage = thumbnail.dataset.backgroundImage;\n}", "is_thumbnail_safe() {\n return true\n }", "function displayThumb(src, width, height, title)\n{\n var winWidth = 650;\n var winHeight = 510;\n\n eval(\"win = window.open('','Thumb', 'toolbar=0,scrollbars=1,location=0,status=0,resizable=1,menubar=0,width=\"+winWidth+\",height=\"+winHeight+\"');\");\n\n // clear the content of the document\n win.document.open();\n\n win.document.writeln('<html>');\n\n if(null != title && title != \"\")\n {\n win.document.writeln('<head><title>' + title + '</title></head>');\n }\n else\n {\n win.document.writeln('<head><title>' + ICtxgopub.pe_txt12 +'</title></head>');\n }\n win.document.writeln('<body>');\n\n win.document.writeln('<center><table border=\"0\">');\n if (width == 0)\n {\n win.document.writeln('<tr><td align=\"center\"><img src=\"'+src+'\"></td></tr>');\n }\n else if (height == 0)\n {\n win.document.writeln('<tr><td align=\"center\"><img width=\"'+width+'\" src=\"'+src+'\"></td></tr>'); \n } \n else\n {\n win.document.writeln('<tr><td align=\"center\"><img width=\"'+width+'\" height=\"'+height+'\" src=\"'+src+'\"></td></tr>'); \n } \n\n if(null != title && title != \"\")\n {\n win.document.writeln('<tr><td align=\"center\">'+title+'</td></tr>');\n }\n win.document.writeln('</table></center>');\n\n win.document.writeln('</body></html>');\n win.document.close();\n}", "function Thumbnail(props) {\n return (\n <div className={props.col} key={props.title}>\n <Link to={props.link}>\n <div className=\"portfolio-item\">\n <div className=\"portfolio-item-img set-bg\" style={{backgroundImage: \"url(\" + props.image + \")\"}}>\n <div className=\"pi-inner\">\n <h3 className=\"project-question\">{props.question}</h3>\n <h2 className=\"project-title\">{props.title}</h2>\n </div>\n </div>\n </div>\n </Link>\n </div>\n );\n}", "function setThumbnail(args) {\n let slider = page.getViewById(\"thumbnailSlider\");\n thumbnail = viewModel.get(\"sliderValue\");\n let thumbnailVideo = page.getViewById(\"thumbnailVideo\");\n thumbnailVideo.seekToTime(thumbnail);\n}", "function setThumbnail(imageID) {\n // const container = document.querySelector(`#img${imageID}`);\n const imagePos = document.querySelector(`#img${imageID} img`);\n document\n .querySelector(`#img${imageID} img`)\n .setAttribute(\"src\", imageContainer[imageID][\"previewImage\"]);\n document.querySelector(`#img${imageID} p`).innerText =\n imageContainer[imageID][\"title\"];\n}", "function photo_thumbnail_url(request, response) {\n\n if (!request.user || !request.user.authenticated()) {\n response.error(\"Needs an authenticated user\");\n return;\n }\n\n var query = new Parse.Query(PHOTO_OBJECT_NAME);\n query.get(request.params.objectId, {\n\n success: function(result) {\n\n response.success({\n url: cloudinary.url(result.get(CLOUDINARY_IDENTIFIER_FIELD_NAME), {crop: \"fill\", width: 150, height: 150})\t\n });\n\n },\n error: function() {\n response.error(\"image lookup failed\");\n }\n\n });\n\n}", "thumbnail(w = 0, h = 0, options = {}){\n\t\tthrow(\"todo\");\n\t\tif(! h && ! w) throw(\"Unable to resize image to thumbnail, either height or width should be given.\");\n\t\tif(! this.isImageInitialized()) this.initImage();\n\t\tlet doFit = (options.fit || options.contain) ? true : false;\n\t\tdoFill = options.fill || false;\n\t\tdoCover = options.cover || false;\n\t\tif(doCover){\n\t\t\tthis._metadata.image.cropThumbnailImage(w, h);\n\t\t}\n\t\telse this._metadata.image.thumbnailImage(w, h, doFit, doFill);\n\t\t\n\t\treturn this;\n\t}", "render() {\n let video = this.video;\n let parts = video.path.split('/');\n let basename = parts[parts.length - 1];\n return (\n <div className='video-summary'>\n {this.props.show_meta\n ? <div><Link to={'/video/' + video.id}>{basename}</Link></div>\n : <div />}\n {!this.state.show_video\n ? (<img src={\"/static/thumbnails/\" + video.id + \".jpg\"}\n onClick={this._onClickThumbnail.bind(this)} />)\n : (this.video.loadedFaces == 0\n ? (<div>Loading...</div>)\n : (<div>\n <canvas ref={(n) => { this._canvas = n; }}></canvas>\n <video controls ref={(n) => { this._video = n; }}>\n <source src={\"/fs/usr/src/app/\" + video.path} />\n </video>\n </div>))}\n </div>\n );\n }", "function zoto_modal_album_template_thumb(options) {\n\tthis.$uber(options);\n\tthis.item_holder = DIV({});\n\tthis.caption = DIV({});\n\tthis.el = DIV({'class': \"invisible\", 'style': \"float: left; border: 2px solid transparent; margin: 0px 10px 10px 0px\"},\n\t\tDIV({'style': \"width: 180px; height: 165px; text-align: center\"},\n\t\t\tthis.item_holder,\n\t\t\tthis.caption\n\t\t)\n\t);\n\tconnect(this.el, 'onclick', this, 'item_clicked');\n}", "render(){\n return(\n <View style={styles.container}>\n <View style={styles.picture}>\n <Thumbnail source={{ uri: this.state.contact.image}} large style={styles.thumbnail} />\n </View>\n <Text style={styles.name}>\n {this.state.contact.first_name} {this.state.contact.last_name}\n </Text>\n <Text style={styles.info}>\n {this.state.contact.phone_number}\n </Text>\n <Text style={styles.info}>\n {this.state.contact.email}\n </Text>\n\n\n </View>\n )\n }", "render(){\n\t\treturn(\n\t\t\t<div className=\"userText\" id=\"artContent\">\n\t\t\t\t<h1>Art</h1>\n\n\t\t\t\t<div className=\"thumbnails\">\n\t\t\t\t\t<ArtThumbnail\n\t\t\t\t\tgetSrc=\"data/gallery/bloodmoonAkali.png\"\n\t\t\t\t\tgetBackgroundPos=\"61% 18%\"\n\t\t\t\t\tsetCurrentSrc={this.setCurrentSrc}\n\t\t\t\t\tgetSize=\"65%\"\n\t\t\t\t\tpicWidth=\"50%\"/>\n\n\t\t\t\t\t<ArtThumbnail\n\t\t\t\t\tgetSrc=\"data/gallery/pokemon.png\"\n\t\t\t\t\tgetBackgroundPos=\"88% 56%\"\n\t\t\t\t\tsetCurrentSrc={this.setCurrentSrc}\n\t\t\t\t\tgetSize=\"65%\"\n\t\t\t\t\tpicWidth=\"50%\"/>\n\n\t\t\t\t\t<ArtThumbnail\n\t\t\t\t\tgetSrc=\"data/gallery/umi.png\"\n\t\t\t\t\tgetBackgroundPos=\"55% 21%\"\n\t\t\t\t\tsetCurrentSrc={this.setCurrentSrc}\n\t\t\t\t\tgetSize=\"50%\"\n\t\t\t\t\tpicWidth=\"50%\"/>\n\n\t\t\t\t\t<ArtThumbnail\n\t\t\t\t\tgetSrc=\"data/gallery/marax.png\"\n\t\t\t\t\tgetBackgroundPos=\"61% 18%\"\n\t\t\t\t\tsetCurrentSrc={this.setCurrentSrc}\n\t\t\t\t\tgetSize=\"55%\"\n\t\t\t\t\tpicWidth=\"50%\"/>\n\n\t\t\t\t\t<ArtThumbnail\n\t\t\t\t\tgetSrc=\"data/gallery/dj_monochrome.png\"\n\t\t\t\t\tgetBackgroundPos=\"-72% 30%\"\n\t\t\t\t\tsetCurrentSrc={this.setCurrentSrc}\n\t\t\t\t\tgetSize=\"80%\"\n\t\t\t\t\tpicWidth=\"60%\"/>\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t<ArtDisplay\n\t\t\t\t\tgetSrc={this.state.currentSrc}\n\t\t\t\t\tgetWidth={this.state.picWidth} />\n\t\t\t</div>\n\t\t);\n\t}", "render() {\n const { thumbNail, index, currentImageIndex, thumbnailClick } = this.props;\n if (index === currentImageIndex) {\n return (\n <div className=\"carouselSidebarThumbnail\">\n <img\n src={thumbNail}\n alt={index}\n className=\"carouselThumbnail\"\n id=\"selectedCarouselThumbnail\"\n />\n </div>\n );\n }\n return (\n <div className=\"carouselSidebarThumbnail\">\n <img\n src={thumbNail}\n alt={index}\n className=\"carouselThumbnail\"\n onClick={thumbnailClick}\n />\n </div>\n );\n }", "function UserThumbnail({\n /*name used as fallback if image not available*/\n name,\n /*image in form of { uri: string }*/\n image,\n}) {\n return (\n image\n ? <Image source={image} style={styles.image}/>\n : <View style={styles.fallback}>\n <Text style={styles.fallbackText}>\n {(name.length > 0) ? name[0] : \"?\"}\n </Text>\n </View>\n );\n}", "render() {\n image(this.image, this.x, this.y, this.width, this.height);\n }", "function renderPhoto(data) {\n var photoData = photoService.renderPhoto(remoteVideo, photo, data);\n vm.imgContainer.push(photoData);\n //make sure all thumbnails are being rendered on the site\n $scope.$digest();\n console.log('This is the container size: '+vm.imgContainer.length); \n }", "function createPageThumbnail(page_num) {\n\tvar columnDiv = document.createElement(\"div\"); \n\tcolumnDiv.classList.add(\"col-3\");\n\n\tvar pageImage = document.createElement(\"IMG\");\n\tpageImage.src = getThumbnailFilepath(page_num);\n\tpageImage.id = getThumbnailID(page_num);\n\tpageImage.onclick = onThumbnailClicked;\n\n\tcolumnDiv.appendChild(pageImage);\n\treturn columnDiv;\n}", "render () {\r\n\t\tconst { description, urls } = this.props.image;\r\n\r\n\t\treturn (\r\n\t\t\t<div style={{ gridRowEnd: `span ${this.state.spans}` }}>\r\n\t\t\t\t<img \r\n\t\t\t\t\tref={this.imageRef}\r\n\t\t\t\t\talt={description}\r\n\t\t\t\t\tsrc={urls.regular}\r\n\t\t\t\t/>\r\n\t\t\t</div>\r\n\t\t);\r\n\t}", "function displayAlbumArt(img, fileinfo) {\n getThumbnailURL(fileinfo, function(url) {\n if (!url)\n return;\n img.src = url;\n // When the image loads make sure it is positioned correctly\n img.addEventListener('load', function revoke(event) {\n img.removeEventListener('load', revoke);\n cropImage(event);\n });\n });\n}", "function getPhotoUrl(thumbnail) {\n\tvar photo = thumbnail.attr(\"src\");\n\tphoto = photo.slice(18);\n\tcaption(parseInt(photo)-1);\n\tvar bigger_photo = \"Photos/\" + photo;\n\t$photoBox.attr(\"src\",bigger_photo);\n}", "function renderImage(file) {\n images.push(file);\n// generate a new FileReader object\n var reader = new FileReader();\n// inject an image with the src url\n reader.onload = function(event) {\n the_url = event.target.result\n $('#preview').html(\"<img src='\" + the_url + \"' />\")\n}// when the file is read it triggers the onload event above.\n reader.readAsDataURL(file);\n}", "function displayImage() {\n console.log(Constants.APP_INFO, 'Load image: ', url);\n\n PictureManager.stopLoading();\n\n var bPicture = PictureManager.getBottomPictureObj();\n if (!bPicture) {\n onLoadImageError();\n return;\n }\n\n bPicture.load(url, onLoadImageSuccess, onLoadImageError);\n\n function onLoadImageSuccess() {\n console.log(Constants.APP_INFO, 'onLoadImageSuccess');\n if (!prepareStage.prepared) prepareStage();\n\n /*Here image is fully loaded and displayed*/\n if (hasOrientation) bPicture.rotate(orientation);\n\n Page.thumbnail.display({flag: false});\n Page.loading.display(false);\n\n var tPicture = PictureManager.getTopPictureObj();\n\n Animation.reset(bPicture.getContainer(), tPicture.getContainer());\n\n if (tvApp.slideshow.started) {\n /*\n * AUTO SLIDE\n * It's the only case when we need animation\n */\n if (!tvApp.slideshow.isLoadingPageRequired() &&\n !tvApp.slideshow.custom &&\n Utils.ui.viewManager.getRecentViewInfo().mode == 'photo') {\n PictureManager.animate(bPicture, tPicture);\n /*\n * FIRST SLIDE || NEXT_SLIDE || PREVIOUS_SLIDE\n */\n } else tPicture.hide();\n\n tvApp.slideshow.onSlideLoadComplete();\n } else {\n tPicture.hide();\n }\n\n Utils.ui.viewManager.setView('photo');\n\n var message = {\n \"event\": \"MEDIA_PLAYBACK\",\n \"message\": url,\n \"media_event\": {\"event\": Constants.MediaEvent.MEDIA_LOAD_COMPLETE}\n };\n Utils.sendMessageToSender(message);\n }\n\n /**\n * Function callback at failure.\n *\n * @param {object} e Object details.\n * @param {undefined} Result: displaying an error.\n */\n function onLoadImageError(e) {\n var error = new MediaError();\n console.log(Constants.APP_INFO, 'Load image error callback: ', url);\n console.log(Constants.APP_INFO, 'Load image error: ', e);\n console.log(Constants.APP_INFO, 'Load image: MediaError: ', error);\n\n if (!tvApp.slideshow.started) {\n // Hide whatever page is currently shown.\n $('.page').removeClass('displayed');\n Page.header.display(true);\n Page.message.set(error.description).display()\n }\n\n /* Send messages to Sender app*/\n var message_1 = {\n \"event\": \"ERROR\",\n \"media\": { \"url\": url },\n \"error\": error\n };\n var message_2 = {\n \"event\": \"MEDIA_PLAYBACK\",\n \"message\": url,\n \"media_event\": {\n \"event\": Constants.MediaEvent.MEDIA_ERROR,\n \"code\": error.code,\n \"description\": error.description\n }\n };\n Utils.sendMessageToSender(message_1);\n Utils.sendMessageToSender(message_2);\n }\n }", "onShowThumbnails(callback) {\n this.transport.on(Protocol.SHOW_THUMBNAILS, () => callback());\n }", "function renderImage(file) {\n\n\t\t// generate a new FileReader object\n\t\tvar reader = new FileReader();\n\t\t// inject an image with the src url\n\t\treader.onload = function(event) {\n\t\t\ttemplate_xml = event.target.result;\n\t\t\t$(\"#preview-template-file\")\n\t\t\t\t.html(template_xml)\n\t\t\t\t.find(\":first-child\")\n\t\t\t\t\t.css({\"border\":\"solid lightGray thin\"});\n\n\t\t};\n\t\t// when the file is read it triggers the onload event above.\n\t\treader.readAsText(file);\n\t}", "function loadPhoto($thumb){\n var $loader \t= $('#photo_container').find('.loader');\n $loader.show();\n var $theimage \t= $('#theimage');\n $('<img/>').load(function(){\n var $this \t= $(this);\n resize($this);\n $loader.hide();\n var $a=$('<a/>');/*for swipe*/\n $theimage.empty().append($a.append($this));\n $('#description').empty().html($thumb.attr('title'));\n $('#prev,#next').show();\n }).attr('src',$thumb.attr('alt'));\n }", "function handleFileSelect(evt) {\n var files = evt.target.files; // FileList object\n \n // Loop through the FileList and render image files as thumbnails.\n for (var i = 0, f; f = files[i]; i++) {\n \n // Only process image files.\n if (!f.type.match('video.*')) {\n continue;\n }\n \n var reader = new FileReader();\n \n // Closure to capture the file information.\n reader.onload = (function(theFile) {\n return function(e) {\n // Render thumbnail.\n debugger;\n var span = document.createElement('span');\n span.innerHTML = ['<source class=\"thumb\" src=\"', e.target.result,\n '\" title=\"', escape(theFile.name), '\"/>'].join('');\n document.getElementById('list').insertBefore(span, null);\n };\n })(f);\n \n // Read in the image file as a data URL.\n reader.readAsDataURL(f);\n }\n }", "function getThumbnailURL(d){\n if (d.video_id > 0){\n return \"/uploads/\" + d.video_id + \"/thumbnails/\" + d.extracted_frame_number + \".jpg\";\n } else {\n return \"/uploads/refresh_to_load.jpg\";\n }\n }", "function render(dataSet){\n \tdataSet.data.forEach(function(item,i){\n \tvar gif = dataSet.data[i].images.fixed_height.url;\n \t$(\"#main\").append(\"<img class='img-thumbnail'src='\" + gif + \"'>\"); // mind the single vs. double quotes!\n \t});\n\t}", "function drawThumbNail() {\n\t\t\tthumbCtx.drawImage(thumbImg, 0, 0);\n\t\t\tthumbCtx.strokeStyle = \"#FF00FF\";\n\t\t\tthumbCtx.beginPath();\n\t\t\tthumbCtx.moveTo(this.tempX - 5, this.tempY - 5);\n\t\t\tthumbCtx.lineTo(this.tempX - 5, this.tempY + 5);\n\t\t\tthumbCtx.lineTo(this.tempX + 5, this.tempY + 5);\n\t\t\tthumbCtx.lineTo(this.tempX + 5, this.tempY - 5);\n\t\t\tthumbCtx.closePath();\n\t\t\tthumbCtx.stroke();\n\t\t}", "function loadThumbnail(start) {\n thumbsContainer.innerHTML = \"\";\n\n for (let i = start; i < start + maxThumbnail; i++) {\n let thumb = thumbnails[i];\n if (!thumb) continue;\n let thumbContainer = document.createElement('div');\n if (!thumb.page) continue;\n // let page = thumb.page.split(\"|\")[0];\n let page = thumb.page;\n let folio = _thisRef.FOLIOS[page];\n thumbContainer.innerHTML = `<span>${folio}</span><img src='Zoomify/FGM_Zoomify/${page}/TileGroup0/0-0-0.jpg'>`;\n thumbContainer.setAttribute(\"page\", page);\n thumbsContainer.appendChild(thumbContainer);\n thumbContainer.onclick = function () {\n _thisRef.loadPage(page);\n }\n }\n _thisRef.highlightThumbnail();\n }", "function showGallery(thumbs, index, clickedImage, getSrcCallback) {\r\n\t\tvar viewport = fitToView(preventTouch($('<div id=\"galleryViewport\">').css({\r\n\t\t\tposition: 'fixed',\r\n\t\t\ttop: 0,\r\n\t\t\tleft: 0,\r\n\t\t\toverflow: 'hidden'\r\n\t\t}).transform(false).appendTo('body')));\r\n\t\t\r\n\t\tvar stripe = $('<div id=\"galleryStripe\">').css({\r\n\t\t\tposition: 'absolute',\r\n\t\t\theight: '100%',\r\n\t\t\ttop: 0,\r\n\t\t\tleft: (-index * getInnerWidth()) + 'px'\r\n\t\t}).width(thumbs.length * getInnerWidth()).transform(false).appendTo(viewport);\r\n\t\t\r\n\t\tsetupEventListeners(stripe, getInnerWidth(), index, thumbs.length-1);\r\n\t\t\r\n\t\t$(window).bind('orientationchange.gallery', function() {\r\n\t\t\tfitToView(viewport);\r\n\t\t\tstripe.find('img').each(centerImage);\r\n\t\t});\r\n\t\t\r\n\t\tthumbs.each(function(i) {\r\n\t\t\tvar page = $('<div>').addClass('galleryPage').css({\r\n\t\t\t\tdisplay: 'block',\r\n\t\t\t\tposition: 'absolute',\r\n\t\t\t\tleft: i * getInnerWidth() + 'px',\r\n\t\t\t\toverflow: 'hidden',\r\n\t\t\t\theight: '100%'\r\n\t\t\t}).width(getInnerWidth()).data('thumbs', thumbs).data('thumb', $(this)).transform(false).appendTo(stripe);\r\n\t\t\t\r\n\t\t\tif (i == index) {\r\n\t\t\t\tvar $img = $(clickedImage).css({position: 'absolute', display: 'block'}).transform(false);\r\n\t\t\t\tmakeInvisible(centerImage(index, clickedImage, $img)).appendTo(page);\r\n\t\t\t\tzoomIn($(this), $img, function() {\r\n\t\t\t\t\tstripe.addClass('ready');\r\n\t\t\t\t\tloadSurroundingImages(index);\r\n\t\t\t\t});\r\n\t\t\t\tinsertShade(viewport);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tpage.activity({color: '#fff'});\r\n\t\t\t\tvar img = new Image();\r\n\t\t\t\tvar src = $.proxy(getSrcCallback, this)();\r\n\t\t\t\tpage.one('loadImage', function() {\r\n\t\t\t\t\timg.src = src;\r\n\t\t\t\t});\r\n\t\t\t\timg.onload = function() {\r\n\t\t\t\t\tvar $this = $(this).css({position: 'absolute', display: 'block'}).transform(false);\r\n\t\t\t\t\tcenterImage(i, this, $this).appendTo(page.activity(false));\r\n\t\t\t\t\tpage.trigger('loaded');\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t});\r\n\t}", "function insertImg(photo) {\n var thumbnailDiv = buildThumbnailDiv(photo);\n document.getElementById('img-thumbnails').appendChild(thumbnailDiv);\n}", "function loadImage() {\n\t\t$('div.thumbnail a img').on('click', function(){\n\t\t\tvar image = this.src;\n\t\t\t$('.image-load').html('<img src=\"' + image + '\">');\n\t\t});\n\t}", "function image_display() {\r\n\r\n}", "function thumbnails() {\n let watched = watcher.getWatched().screenshots;\n const node = document.getElementById('image-grid'); \n\n var img = document.createElement('img');\n var imageWrap = document.createElement('div');\n imageWrap.setAttribute(\"class\", \"image-block\");\n for (let index = 0; index < watched.length; index++) {\n img.src = './screenshots/' + watched[index];\n console.log(img);\n node.appendChild(imageWrap);\n imageWrap.appendChild(img);\n \n }\n}", "function PhotoPreview(props) {\n\treturn (\n\t\t<div onClick={() => history.push(`/plant/${props.plant.id}`)}>\n\t\t\t<img\n\t\t\t\tclassName={cn(styles.preview_img, props.className)}\n\t\t\t\tsrc={props.plant.img}\n\t\t\t/>\n\t\t\t<div className={styles.preview_text}>\n\t\t\t\t<div>{capitalizeFirst(props.plant.type)}</div>\n\t\t\t\t<div>{ageString(props.plant.age)}</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n}", "renderPhoto(data) {\n\t\tconst image = this.createElement('img', 'gallery__photo-item');\n\t\timage.setAttribute('alt', data.alt);\n\t\timage.setAttribute('src', data.src);\n\t\timage.setAttribute('data-image-min-id', data.id);\n\t\treturn image;\n\t}", "function generateThumbs() {\r\n\t\t\tfunction createNewImgIndex(url, src, el) {\r\n jQuery('<a href=\"' + url + '\" style=\"background-image: url('+ src +');\"></a>').prependTo(el);\r\n\t\t\t}\r\n\r\n jQuery('.index .post').each( function() {\r\n\t\t\t\tvar postURL = jQuery(this).find('.post-title a').attr('href');\r\n\t\t\t\tvar firstImg = jQuery(this).find('img:first-of-type');\r\n\t\t\t\tvar firstImgSrc = firstImg.attr('src');\r\n\t\t\t\tif (typeof firstImgSrc !== 'undefined') {\r\n\t\t\t\t\tcreateNewImgIndex(postURL, firstImgSrc, this);\r\n\t\t\t\t\tfirstImg.parent().remove();\r\n\t\t\t\t\tfirstImg.parent().parent().parent().find('.post-excerpt').remove();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n jQuery('.index .post > a').wrap('<div class=\"post-image\" />');\r\n\t\t}", "function addThumbnail(ele, la1, lo1, la2, lo2, zo) {\n while (ele.firstChild) {\n ele.removeChild(ele.firstChild);\n }\n // get the bounds of the view in pixels\n var topLeft = map.project([-Math.max(la1, la2), Math.min(lo1, lo2)], zo);\n var bottomRight = map.project([-Math.min(la1, la2), Math.max(lo1, lo2)], zo);\n // get which tile the pixels belong in \n var tlTile = pixelsToTile(topLeft.x, topLeft.y);\n var brTile = pixelsToTile(bottomRight.x, bottomRight.y);\n for (var i = tlTile[1]; i >= brTile[1]; i--) {\n // get the top and bottom heights on the image tile that are part of the\n // thumbnail\n var south = 255 - (Math.max(bottomRight.y, 256 * (i - 1)) % 256);\n var north = 255 - (Math.min(topLeft.y, (256 * i) - 1) % 256);\n if (north < south) {\n // create a row of tiled images for the thumbnail\n var tr = document.createElement('div');\n tr.style.width = \"100%\";\n // set the height of the row\n // this could have used the height of the element the thumbnail will be in\n // instead of a constant, but it sometimes caused some problems with\n // dynamically created elements\n tr.style.height = ((south - north) * THUMBNAIL_SIZE / (topLeft.y - bottomRight.y)) + \"px\";\n tr.style.whiteSpace = \"nowrap\";\n for (var j = tlTile[0]; j <= brTile[0]; j++) {\n // do the same process as above, but with the columns of images\n var west = Math.max(topLeft.x, 256 * (j - 1)) % 256;\n var east = Math.min(bottomRight.x, (256 * j) - 1) % 256;\n if (west < east) {\n var td = document.createElement('span');\n td.style.height = \"100%\";\n td.style.width = ((east - west) * THUMBNAIL_SIZE / (bottomRight.x - topLeft.x)) + \"px\";\n td.style.overflow = \"hidden\";\n td.style.display = \"inline-block\";\n var img = document.createElement('img');\n img.draggable = false;\n img.src = \"/static/imgs/\" + zo + \"/\" + (j - 1) + \"/\" + (i-1) + \".png\";\n\n // scale and pan the image so that the correct part of it is in the span\n img.style.height = 256 * THUMBNAIL_SIZE / (topLeft.y - bottomRight.y) + \"px\";\n img.style.width = 256 * THUMBNAIL_SIZE / (bottomRight.x - topLeft.x) + \"px\";\n img.style.margin = -(north * THUMBNAIL_SIZE / (topLeft.y - bottomRight.y)) + \"px 0 0 \" +\n -(west * THUMBNAIL_SIZE / (bottomRight.x - topLeft.x)) + \"px\";\n td.appendChild(img);\n tr.appendChild(td);\n }\n\n }\n ele.appendChild(tr);\n }\n }\n}", "function renderImagePreview(files, $container, $inner) {\n\n // empty preview\n $inner.empty();\n\n var file;\n for (var i = 0; i < files.length; i++) {\n file = files[0];\n var imageType = /^image\\//;\n\n if (!imageType.test(file.type)) {\n continue;\n }\n break;\n }\n\n // \n // create image element\n var img = document.createElement(\"img\");\n img.classList.add(\"obj\");\n img.file = file;\n img.setAttribute('style', 'max-width: 100%; max-height: 100%;');\n $inner.append($('<div class=\"image-wrapper\" />').append(img)); // Assuming that \"preview\" is the div output where the content will be displayed.\n\n // build reader\n var reader = new FileReader();\n reader.onload = (function(_img) {\n return function(ev) { \n _img.src = ev.target.result; \n }; \n })(img);\n reader.readAsDataURL(file);\n\n return img;\n}", "function viewFullImg(uri){\n\tconst html = `<img src=\"${uri}\">`\n\tdocument.getElementById(\"results\").innerHTML = html;\n}", "function Preview() {\n const divStyle = {\n display: 'flex',\n flexDirection: 'row',\n height: '80px',\n alignItems: 'center',\n justifyContent: 'center',\n textAlign: 'center',\n lineHeight: '80px',\n mrginTop: '80px',\n };\n\n const imgStyle = {\n mrginTop: '80px',\n marginRight: '20px',\n height: '45px',\n width: '80px',\n };\n\n // const change = props => (props.index);\n\n const smallImgs = (input) => {\n const result = [];\n input.forEach((element) => {\n result.push(<img style={imgStyle} src={element} alt=\"\" />);\n });\n return result;\n };\n\n return (\n <div style={divStyle}>\n { smallImgs(imgs) }\n </div>\n );\n}", "renderNewImage() {\n\n document.getElementById('img').src = `${this.url}`\n document.getElementById('p1').innerText = `${this.caption}`\n\n }", "function imageDisplay() {\n var color = imageColor();\n var captionColor = color;\n captionColor = color.replace(/_/g, \" \").replace('solid', '');\n var captionProduct = name.replace('<br>', '&nbsp;');\n var caption = (captionColor+\" \"+captionProduct).replace(/(^|\\s)\\S/g, function(match) {\n return match.toUpperCase();\n });\n var img_source = \"../../images/products/\"+img+color+\".gif\";\n var lightbox_img = \"../../images/products/large/\"+img+color+\".gif\";\n var lightbox_img_back = \"../../images/products/back/large/\"+img+color+\".gif\";\n $('#product_img_front').attr('src', img_source);\n $('#product_img_front_large').attr('src', lightbox_img);\n $('#product_img_back_large').attr('src', lightbox_img_back);\n $('#product_img_front').parent().attr('href', lightbox_img).attr('data-lightbox', img+color).attr('title', caption);\n $('#product_img_back').attr('href', lightbox_img_back).attr('data-lightbox', img+color).attr('title', caption+' (Back)');\n}", "function showOriginalImage(id) {\r\n var photo = images[id];\r\n document.getElementById(\"image-title\").innerHTML = photo.title;\r\n document.getElementById(\"image-content\").innerHTML =\r\n '<img src=\"https://farm' +\r\n photo.farm +\r\n '.staticflickr.com/' +\r\n photo.server +\r\n '/' +\r\n photo.id +\r\n '_' +\r\n photo.secret +\r\n '_z.jpg' +\r\n '\" alt=\"' +\r\n photo.title +\r\n '\"/>';\r\n document.getElementById(\"image\").className += \" visible\";\r\n}", "function getImageThumbnail(index_to_get) {\n if((imgur_list.length > 0) && (index_to_get < imgur_list.length)) {\n console.log(\"Getting Image: \" + imgur_list[index_to_get].link);\n var image_url = imgur_list[index_to_get].link;\t// The Full Size Image\n\n var n = image_url.lastIndexOf(\".\");\n var ext = image_url.slice(n).toUpperCase();\n //ext=\".PNG\";\n console.log(\"Extension = '\"+ext+\"'\");\n\n var get_thumbnail = true;\n if(get_thumbnail) {\n // The Medium Thumbnail (320x320 or close to)\n // Also, thumbnails on imgur are always jpg\n image_url = image_url.slice(0, n) + \"m.jpg\";\n console.log(\"Getting Thumbnail: \" + image_url);\n getJpegImage(image_url);\n } else {\n switch (ext) {\n case \".PNG\":\n getPngImage(image_url);\n break;\n case \".JPG\":\n case \".JPEG\":\n getJpegImage(image_url);\n }\n }\n } else {\n console.log(\"Index bigger than array!\");\n }\n}", "function FSImage(index, src, href, photoId) {\n\t\tif(src != null) {\n\t\t\tnImg = new Image();\n\t\t\tnImg.src = src;\n\t\t\tnImg.onclick = function() { showImage(this); return true; }\n\t\t\tnImg.id = \"stream_\"+activeStream+\"_\"+index+\"_ThumbImg\";\n\t\t\tnImg.width = 75;\n\t\t\tnImg.height = 75;\n\n\t\t\tthis.image = nImg;\n\t\t}\n\t\t\n\t\tthis.index = index;\n\t\tthis.src = src;\n\t\tthis.href = href;\n\t\tthis.photoId = photoId;\n\t}", "function showImgPreview(file, img) {\n var reader = new FileReader();\n\n reader.onload = function (e) {\n img.attr('src', reader.result).show();\n };\n reader.readAsDataURL(file);\n }", "renderFileUri(reviewId) {\n if (this.state.photo[reviewId]) {\n return (<Image \n source={{ uri: this.state.photo[reviewId] }} \n style={{ height: 400, width: null, flex: 1, marginHorizontal: 3 }}\n />);\n } \n }", "function imagePreview(source){\n var source1 = source; \n var index = source.indexOf('thumbnail/thumb');\n source = source.substring(0,index)+source1.substring(index+15);\n var div= document.createElement(\"div\");\n div.className += 'over';\n div.id += 'over';\n document.body.appendChild(div);\n var div = '<div class=\"container\" id=\"prev\"><img style=\"max-height:500px;\" id=\"prev-img\" src=\"'+source+'\"/>'+\n '<span style=color: white;><button id=\"closePrev\" class=\"btn btn-primary\" onClick=\"closePreview();\">Close</button></span></div>';\n $('#over').append(div);\n}" ]
[ "0.70654005", "0.6743225", "0.66222453", "0.6562471", "0.6522311", "0.6441667", "0.6409667", "0.64059156", "0.6402615", "0.63581777", "0.62729055", "0.6243776", "0.62026244", "0.61985946", "0.61974347", "0.6117547", "0.6112769", "0.60977876", "0.6074607", "0.6050965", "0.60023904", "0.5997335", "0.5976788", "0.5956234", "0.5938654", "0.592637", "0.5924481", "0.59237814", "0.5874797", "0.58746386", "0.58718395", "0.5867004", "0.5853251", "0.58504415", "0.5830807", "0.5801545", "0.57927614", "0.5791226", "0.5762392", "0.5743089", "0.5738288", "0.57221395", "0.5719384", "0.57104284", "0.56763184", "0.5673984", "0.56733996", "0.5659436", "0.56589437", "0.56575215", "0.5646338", "0.56437016", "0.56277233", "0.5625832", "0.56092983", "0.560467", "0.56039065", "0.5600971", "0.5583427", "0.55760646", "0.557288", "0.5561271", "0.55579394", "0.55572027", "0.5555224", "0.5553447", "0.55472744", "0.55373585", "0.5532859", "0.5517994", "0.5516126", "0.55117875", "0.5498006", "0.54856485", "0.5476319", "0.547321", "0.54722667", "0.5467501", "0.545296", "0.54445153", "0.5441459", "0.543702", "0.5435287", "0.5432421", "0.54208463", "0.54205394", "0.5418364", "0.54168737", "0.5413725", "0.5411387", "0.5404452", "0.5394962", "0.5381414", "0.535799", "0.53468454", "0.53370184", "0.5336348", "0.5329344", "0.532913", "0.5324504" ]
0.7134303
0
this is my click function
function click() { /* i need to check if the current color is the last object in the array. If it is, i set the value back to 0 (the first color in the array. Otherwise, i have to increment the current color by 1. */ if (presentColor == colors.length-1) presentColor = 0; else presentColor++; // here now i can set the body's style - backgroundColor to the new color. document.body.style.backgroundColor = colors[presentColor]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _click(d){\n \n }", "function click(el){\n \n \n}", "click() { }", "click_extra() {\r\n }", "handleClick() {}", "function clicked(d,i) {\n\n}", "function clicked(d,i) {\n\n}", "function cb_beforeClick(cb, pos) { }", "function handleClick() {\n\t\t window.ctaClick();\n\t\t}", "function handleClick() {\n\t\t window.ctaClick();\n\t\t}", "metodoClick(){\n console.log(\"diste click\")\n }", "handleJDotterClick() {}", "function Click() {\n}", "activeClick() {\n var $_this = this;\n var action = this.options.dblClick ? 'dblclick' : 'click';\n\n this.$selectableUl.on(action, '.SELECT-elem-selectable', function () {\n $_this.select($(this).data('SELECT-value'));\n });\n this.$selectionUl.on(action, '.SELECT-elem-selection', function () {\n $_this.deselect($(this).data('SELECT-value'));\n });\n\n }", "handleClick( event ){ }", "function clickHandler(e) {\n // Nur bei Linksklick\n if (e.button !== 0) return;\n clickAt(e.offsetX, e.offsetY);\n }", "function clickOn() {\n openedCards[0].click(cardToggle);\n}", "clicked(x, y) {}", "function bwClick(itemId) {\n $(itemId).click();\n}", "click(x, y, _isLeftButton) {}", "clicked(panel) {\n\t}", "function click_on() {\n console.log('called click function');\n}", "click(event) {\n if (event.target === this.get('element')) {\n this.sendAction();\n }\n }", "function doClick(e) {\n options.onClick(e);\n }", "clickHandler() {\n // Activate if not active\n if (this.active === 'safety') {\n // Button view press effect\n this.removeSafety();\n } else if (this.active === false) {\n // Button view press effect\n this.changeToActive();\n // Click action\n this.clickAction();\n }\n }", "function clickAssess() {\n\t$.trigger(\"clickAssess\");\n}", "function clickHandler(){ // declare a function that updates the state\n elementIsClicked = true;\n isElementClicked();\n }", "clickHandler() {\n // Activate if not active\n if (this.active === false) {\n // Button view press effect\n this.changeToActive();\n // No click 'action' for input - text is removed in visualEffectOnActivation\n }\n }", "function onClick(e) {\n }", "function onClick(e) {\n \t\t// console.log(this);\n\t\t}", "function click() {\n\n setName('Ram')\n setAge(21)\n // console.log(\"button clicked\")\n console.log(name,age)\n }", "function canvasClickEvent(e){\n\t\t\tvar mouseX = $(this).offset().left, mouseY = $(this).offset().top;\n\t\t\tconsole.log(\"clicked the canvas\");\n\t\t\tswitch(Math.floor((e.pageX - mouseX)/(this.width/5)%5)){\n\t\t\tcase 0:\n\t\t\t\t$(\"#holdbutton_1\").trigger(\"click\");\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\t$(\"#holdbutton_2\").trigger(\"click\");\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$(\"#holdbutton_3\").trigger(\"click\");\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t$(\"#holdbutton_4\").trigger(\"click\");\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\t$(\"#holdbutton_5\").trigger(\"click\");\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tconsole.log(\"error didn't detect where the click came from\");\n\t\t\t\tbreak\n\t\t\t}\n\t\t\treturn false;\n\t}", "onClick(element) {\n\t\taction(`You have clicked on element ${element.name}`).call();\n\t}", "mouseClick(p) {\n }", "function clicked() {\r\n // consists of animations and transitions\r\n resetClickLinks();\r\n // Click node Action and Info\r\n // only if it is defined\r\n click_node = drag_node; // defining here\r\n nodePop(click_node);\r\n loadInfo();\r\n}", "function makeItClickable(){\n\n }", "onClick() {\n }", "_click(e) {\n const type = this.cel.getAttribute('data-type');\n\n this[type](e);\n }", "function canvasClick(e) {\n\tblockus.mouseClicked();\n}", "function auxClicked(ev) {\n clicked(ev, dificuldade, score);\n }", "function click() {\n\tconsole.log('click')\n}", "click() { // add click event\n app.quit();\n }", "function handleClick(event)\n{\n}", "function outterClick() {\n\n}", "function clickHandler(event) {\n \tconsole.log('event');\n \ttau.openPopup(popup);\n }", "_evtClick(event) { }", "function o(a){a.click(p).mousedown(ka)}", "function clickSolve(){\n env.click.render() ;\n env.clickCopy.render() ;\n refreshDisplay() ;\n}", "function asignarEventos() {\n _.click(function() {\n\n });\n}", "function clickOptiontoSelect(){\n\n}", "function listenForClick() {\n loopThroughGrid();\n clickTurnBtn();\n }", "function clicked() {\n search()\n; }", "clicked() {\n this.get('onOpen')();\n }", "function buttonClicked(e) {\n\tvar element = e.memo.element;\n\tif (this.options.singleSelect) {\n\t\tthis.select(element);\n\t} else {\n\t\tif (this.isSelected(element)) {\n\t\t\tthis.deselect(element);\t\n\t\t} else {\n\t\t\tthis.select(element);\n\t\t}\n\t}\n}", "function checkClicked() {\n \n}", "function clickItem()\n{\n\tvar item = this.item;\n\n\tif (null == item) item = this.parent.item\n\tif (null == item) item = this.parent.parent.item;\n\n\timage_list.toggleSelect(item.index);\n}", "function buthandleclick_this() {\n\tbuthandleclick(this);\n}", "function onClickEvent() {\n if (selectedElements.length == 0) {\n selectedElements.push($(this));\n $(selectedElements[0]).addClass('open show');\n $(selectedElements[0]).off('click');\n } else if (selectedElements.length == 1) {\n selectedElements.push($(this));\n matchingEngine();\n }\n}", "menuButtonClicked() {}", "function theClick() {\r\n console.log('inicia')\r\n dataNodes()\r\n dataElements()\r\n backEnd()\r\n}", "function onClick() {\n}", "function clickme(){\n\n\t\talert('Hey, you clicked me!');\n\t}", "viewWasClicked (view) {\n\t\tthis.parent.menuItemWasSelected(view.menuItem)\n\t}", "visitElementClicked() {\r\n this.props.visitListClick(this.props.index);\r\n }", "function the_click_callback(){\n\t\t\t\tif(typeof click_callback == 'function'){\n\t\t\t\t\tvar id = $container.attr('id');\n\t\t\t\t\tif(id==undefined || !id){\n\t\t\t\t\t\tid = '[no id]';\n\t\t\t\t\t}\n\t\t\t\t\tclick_callback(id, activenode);\n\t\t\t\t}\n\t\t\t}", "onClick() {\n // Verifica se existe a função para processar o click e a invoca\n if(this.handleClick) {\n this.handleClick(this);\n }\n }", "function mouseClicked(){\n sim.checkMouseClick();\n}", "function clickEvent(svgName, elName) {\n\t\tsvgName.selectAll(elName)\n\t\t\t\t.on(\"click\",\n\t\t\t\t\t\tfunction(d) {\n\t\t\t\t\t\t\t// var clickedBar = d3.select(this);\n\t\t\t\t\t\t\tvar firstWord = d.Song.split(\" \");\n\t\t\t\t\t\t\tvar url = \"http://musicbrainz.fluidops.net/resource/?literal=%2522\"\n\t\t\t\t\t\t\t\t\t+ firstWord[0]\n\t\t\t\t\t\t\t\t\t+ \"%2522%255E%255Ehttp%253A%252F%252Fwww.w3.org%252F2001%252FXMLSchema%2523string\";\n\t\t\t\t\t\t\twindow.location.href = url;\n\t\t\t\t\t\t});\n\t}", "function clicked() { \n if ($(this).find(\".inner-wrap\").hasClass(\"flipped\")) {\n return;\n }\n $(this).find(\".inner-wrap\").toggleClass(\"flipped\");\n checkArray.push($(this).find(\"img\").attr(\"src\"));\n idArray.push($(this).attr(\"id\"));\n check();\n }", "click() {\n this.fireEvent(\"click\");\n return this;\n }", "click() {\n this.fireEvent(\"click\");\n return this;\n }", "onclick(){}", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n // on click, go to single image page\n if (d.type==\"nii\"){\n document.location = \"neurovault.html?id=\" + d.name\n }\n }\n update(d);\n }", "function noweKonto(){\r\n clicked = true;\r\n}", "click() {\n this.elements.forEach(element => element.click());\n }", "function mouseClicked() {\n // If it has been clicked return true\n return true;\n }", "function __clickhandler() {\n buttonfunc(elemnode); return false;\n }", "function buttonClick(e) {\n\tvar element = e.memo.element;\n\tif (this.options.singleSelect) {\n\t\tthis.select(element);\n\t} else {\n\t\tif (this.isSelected(element)) {\n\t\t\tthis.deselect(element);\t\n\t\t} else {\n\t\t\tthis.select(element);\n\t\t}\n\t}\n}", "function click(d) {\r\n //console.log('clicking, d:', d);\r\n nodeScroll(d);\r\n __showDetails(d);\r\n applyColor(d.id)\r\n }", "function onMouseClick()\r\n{\r\n\tfor (var i = 0; i < activeBtns.length; i++)\r\n\t{\r\n\t\tif (activeBtns[i].over == true)\r\n\t\t{\t\r\n\t\t\tactiveBtns[i].click();\r\n\t\t\tbreak;\r\n\t\t}\t\t\r\n\t}\r\n}", "function itemClick(event) {\n event.preventDefault();\n event.stopPropagation();\n $(this)\n .trigger('pathSelected')\n .addClass('fp-trail fp-clicked')\n .closest('ul')\n .trigger('debug');\n }", "function q(a){a.click(u).mousedown(Ta)}", "function clickImage (data){\n\t\t\n\t\t/*click function on each image*/\n\t\tdelegate(\"body\",\"click\",\".clickMe\",(event) => {\n\t\t\t\n\t\t\tevent.preventDefault();\n\t\t\tvar dataCaptionId=getKeyFromClosestElement(event.delegateTarget);\n\t\t\tvar dataCaption = data.caption;\n\t\t\tdataCaption = dataCaption.replace(/\\s+/g, \"\");\n\t\t\t\n\t\t\t//match the id and render pop up with the data\n\t\t\tif (dataCaption == dataCaptionId){\n\t\t\t\trenderPopup(data, container) \n\t\t\t}\n\t\t\t\n\t\t});\n\t\t\n\t}", "on_item_clicked(id) {\n\t\tsetGlobalConstrainById(this.entity_name,id);\n\t\tpageEventTriggered(this.lowercase_entity_name+\"_clicked\",{id:id});\n\t}", "on_item_clicked(id) {\n\t\tsetGlobalConstrainById(this.entity_name,id);\n\t\tpageEventTriggered(this.lowercase_entity_name+\"_clicked\",{id:id});\n\t}", "function enableClick() {\n openCards[0].click(toggleCard);\n}", "function clickOn1(){if(goodAnswer == 1){ correctAnswerClick(1); }else{ badAnswerClick(1); }}", "function click(d) {\n if(d.name == \"GO:0003700\"){\n r_click(r_root);\n n_click(d);\n }else if(d.name == \"Groups\"){\n toggleGroups();\n if(expanded == false){\n root.children.forEach(collapse);\n r_click(r_root);\n }\n else{\n root.children.forEach(expand);\n r_click(r_root);\n }\n update(root);\n }else {\n n_click(d);\n }\n}", "clickItem(event) {\n\t\tconsole.log('Clicked item ' + JSON.stringify(event));\n\t\tthis.cursor = this.findCursorByID(event);\n\t\tconsole.log('Cursor is at ' + this.cursor);\n\t\tconsole.log('Selecting');\n\t\tthis.select();\n\t}", "function initClicks(e) {\n\t$(\"[data-click='yes']\").each(function(){\n\t\t$(this).addClass('clickable');\n\t\t$(this).click(function(e) {\n\t\t\t$(this).find('a').get(0).click();\n\t\t\te.stopPropagation();\n\t\t});\n\t\t$(this).find('a').click(function(e) {\n\t\t\te.stopPropagation();\n\t\t});\n\t});\n}", "function clickLearn() {\n\t$.trigger(\"clickLearn\");\n}", "function triggerClick() {\n $('.menu-icon-link').trigger('click');\n checkClass();\n }", "async click() {\n await t.click(selector);\n }", "function click() {\r\n\t// if the piece is highlighted, move the piece\r\n\tif(this.className == \"highlight\") {\r\n\t\tmove(this);\r\n\t}\r\n}", "clickHandler(evt) {\n if (evt.target.classList.contains('fa-check')) {\n gameApp.eventHandler(evt);\n }\n\n if (evt.target.classList.contains('assignment') || evt.target.parentElement.classList.contains('assignment')) {\n gameApp.activateContract(evt);\n }\n\n if (evt.target.classList.contains('loc')) {\n gameApp.addLoc();\n }\n\n if (evt.target.classList.contains('nav-button')) {\n let elem = evt.target;\n gameApp.gameView.changeMenue(elem);\n }\n }", "function on_click(e) {\n cloud.on_click(e.clientX, e.clientY);\n}", "function onClick () {\n navCur && navCur.click();\n }", "function click(d) {\n ex3_curr_node = d[\"name\"];\n update_all();\n}", "clickHandler(event) {\n declarativeClickHandler(this);\n }", "function selectButtonOnClick(ev)\n{\n\t//console.log(\"selectButtonOnClick(\", ev, \")\");\n\tstopPointTable.toggleCheckBoxVisibility();\n}", "function select() {\n getElements()[selection].getElementsByTagName('a')[0].click();\n\n}" ]
[ "0.7632426", "0.74783105", "0.7440332", "0.7157805", "0.6946124", "0.6902624", "0.6902624", "0.68999004", "0.68989044", "0.68989044", "0.689625", "0.68536013", "0.6851835", "0.6823585", "0.6820775", "0.6816985", "0.68127924", "0.67819476", "0.6745895", "0.6734091", "0.67057985", "0.66782993", "0.6672503", "0.66721725", "0.6668625", "0.66563314", "0.6649133", "0.66482115", "0.66398543", "0.6632685", "0.66088647", "0.65992814", "0.65917945", "0.6585164", "0.6583988", "0.6579616", "0.6566679", "0.6561105", "0.6550806", "0.6549153", "0.65357435", "0.65299046", "0.65244055", "0.65240693", "0.6519513", "0.65066683", "0.64993304", "0.6495846", "0.6486785", "0.64823294", "0.64710593", "0.6467749", "0.6464793", "0.6464649", "0.64531004", "0.6444223", "0.6442145", "0.64384925", "0.6435411", "0.6426078", "0.6424148", "0.6413398", "0.6412205", "0.6410984", "0.64099085", "0.6401688", "0.63986504", "0.6397624", "0.63936424", "0.6392739", "0.6392739", "0.6392419", "0.63884985", "0.6385438", "0.636582", "0.63631403", "0.63557416", "0.6351695", "0.63502115", "0.63468313", "0.6344745", "0.63447297", "0.6343522", "0.63400143", "0.63400143", "0.6339948", "0.63326997", "0.63249147", "0.63229644", "0.6320315", "0.63190335", "0.63174486", "0.6317091", "0.63072085", "0.6305947", "0.63051695", "0.6302194", "0.63007617", "0.62989175", "0.62968135", "0.62901336" ]
0.0
-1
TREE FOR IBN SINA COLOR
function avicenna (treeData){ // assigns the data to a hierarchy using parent-child relationships var nodes = d3.hierarchy(treeData); var treemap = d3.tree().size([400,400]) // maps the node data to the tree layout nodes = treemap(nodes); // append the svg object to the body of the page // appends a 'group' element to 'svg' // moves the 'group' element to the top left margin var svg = d3.select("#avicenna").append("svg") .attr("width", Awidth + margin.left + margin.right) .attr("height", Aheight + margin.top + margin.bottom), g = svg.append("g") .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); // adds the links between the nodes var link = g.selectAll(".link") .data( nodes.descendants().slice(1)) .enter().append("path") .attr("class", "link") .attr("d", function(d) { return "M" + d.x + "," + d.y + "C" + d.x + "," + (d.y + d.parent.y) / 2 + " " + d.parent.x + "," + (d.y + d.parent.y) / 2 + " " + d.parent.x + "," + d.parent.y; }); // adds each node as a group var node = g.selectAll(".node") .data(nodes.descendants()) .enter().append("g") .attr("class", function(d) { return "node" + (d.children ? " node--internal" : " node--leaf"); }) .attr("transform", function(d) { return "translate(" + d.x + "," + d.y + ")"; }) .attr("name", function(d) { return d.data.name }).attr("description", function(d){ return d.data.description }); var base = g.selectAll(".node").data(nodes.descendants()) .enter().append("g").attr("class",function(d) { return "node" }) .attr("transform",function(d){ return "translate(" + 100 + "," + 100 + ")"; }); base.append("circle").attr("r",20).attr("name", function() {return "BLACK"}) base.append("text") .attr("dy", ".15em") .attr("y", function(d) { return d.children ? -100 : -100; }) .style("text-anchor", "middle") .text(function(d) { return d.data.name; }); // adds the circle to the node node.append("circle") .attr("r", 35) .attr("name", function(d) { return d.data.name }) .style("fill",function(d) { return d.data.color;}) // adds the text to the node // node.append("text") // .attr("dy", ".25em") // .attr("y", function(d) { return d.children ? 5 : 5; }) // .style("text-anchor", "middle") // .text(function(d) { return d.data.name; }); node.attr("fill",function(d) { return d.data.color;}) node.on("click", function () { d3.select("#a_d").remove() d3.select(this).select("circle").style("stroke","#123fff"); var current = d3.select(this).attr('name') var content = d3.select(this).attr('description') d3.select("#a_details").append("g").attr("id","a_d").style("width",200).style("height",300).html(function(){return "<p class='content'>" + "<style='text-decoration:underline'>"+current + "</style>"+"<br>" + content + "</p>"}) }) node.on("mouseover",function() { d3.select(this).select("circle").style("stroke","#888") tooltip .style("left", d3.event.pageX + 50 +"px") .style("top", d3.event.pageY + "px") .style("display", "inline-block") .html(d3.select(this).attr('name') ); }) .on("mouseout",function() { d3.select(this).select("circle").style("stroke","#fff") tooltip.style("display", "none"); }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "colorTreeDefault() {\n let i, color = this.getDefaultColor();\n for(i in this.metadata) {\n this.metadata[i]['branch_color'] = color;\n }\n }", "function color_assign(d) {\n\t\tvar greenClassList = [];\n\t\t\n\t\tif(treeFlag == \"STATIC\"){\n\t\t\tgreenClassList = staticKPIList;\t\t\t\n\t\t}else {\n\t\t\tgreenClassList = KPIList;\n\t\t}\n\t\t\n\t\tvar lay = d.layer;\t\n\t\tif(lay == 2) {\n\t\t\tfor (var i = 0; i < greenClassList.length; i++) {\n\t\t\tif(greenClassList[i] == d.name)\n\t\t\t\treturn \"GREEN\";\n\t\t }\n\t\t\treturn \"RED\";\t \n\t\t}else if(lay == 1) {\t\t\n\t\t\tvar children = classHierarchy[\"children\"];\n\t\t\t\n\t\t\t//console.log(\"1st Level child type \"+ typeof(children));\n\t\t\t//console.log(\"1st Level child \"+ children);\n\t\t\t\n\t\t\tvar count = 0;\n\t\t\tfor(var i in children){\n\t\t\t\t//console.log(\"d.name = \"+ d.name);\n\t\t\t\t//console.log(\"children[i]['name'] = \"+ children[i][\"name\"]);\n\t\t\t\tif(children[i][\"name\"] == d.name){\n\t\t\t\t\tvar chld = children[i][\"children\"];\n\t\t\t\t\t//console.log(\"Typeof child : \"+ typeof(chld));\n\t\t\t\t\t//console.log(\"chld = \", chld);\n\t\t\t\t\tfor(var j in chld){\n\t\t\t\t\t\tfor (var i = 0; i < greenClassList.length; i++) {\n\t\t\t\t\t\t\tif(greenClassList[i] == chld[j][\"name\"]){\n\t\t\t\t\t\t\t\tcount += 1;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(chld.length == count){\n\t\t\t\t\t\tfirst_level_class_color.push(\"GREEN\");\n\t\t\t\t\t\treturn \"GREEN\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\tfirst_level_class_color.push(\"RED\");\n\t\t\t\t\t\treturn \"RED\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\t\n\t\t}else {\n\t\t\tfor(var i in first_level_class_color) {\n\t\t\t\tif(first_level_class_color[i] == \"RED\") {\n\t\t\t\t\t//console.log(\"first_level_class_color = \", first_level_class_color[i]);\n\t\t\t\t\treturn \"RED\"\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn \"GREEN\";\n\t\t} \n\t}", "function nodeColor(d) {\n if (d.name.slice(0, 4) != \"bsms\") {\n return \"silver\";\n } else {\n return \"grey\";\n }\n }", "colorTreePreset() {\n let i, value, color, keyInfo = {};\n for(i in this.metadata) {\n value = this.metadata[i][\"color_pal\"];\n color = this.getColorPal(value);\n keyInfo[value] = this.getColorHexCode(color);\n this.metadata[i]['branch_color'] = color;\n }\n return keyInfo;\n }", "function create_color(root_node) {\n\t// black color for root\n\troot_node.color = d3.rgb(0,0,0);\n\tvar hue_scale = d3.scaleLinear().domain([0,root_node.children.length-1]).range([10,250])\n\tfor(var c = 0; c < root_node.children.length; c++) {\n\t\tvar child_node = root_node.children[c];\n\t\tvar interpolator = d3.interpolateLab(d3.hsl(hue_scale(c),0.8,0.3), d3.hsl(hue_scale(c),0.8,0.8))\n\t\tchild_node.color = interpolator(0.5);\n\t\tfor(var d = 0; d < child_node.children.length; d++)\n\t\t\tchild_node.children[d].color = interpolator(d / (child_node.children.length-1));\n\t}\n}", "function colorSquare(){\n let s = new Array;\n let v = new Array;\n for (let k = 0; k <= numberofTree; k++) {\n ctx.fillRect(parseFloat($('#mortal-tree'+k).css('left'))-780,parseFloat($('#mortal-tree'+k).css('top')) - 360,29,29);\n ctx.fillStyle = \"rgb(214,236,239)\";\n }\n for (let k = 1; k <= numberofTree; k++) {\n s[k] = (parseFloat($('#mortal-tree'+k).css('left'))-780)/30;\n v[k] = (parseFloat($('#mortal-tree'+k).css('top')) - 360)/30;\n tab[i+v[k]][j+s[k]] = 4;\n } \n }", "function nodeColor(d){\n \tif('dod' in d.data) {\n \t\treturn 'crimson';\n } else {\n \t\treturn 'aquamarine';\n \t}\n }", "function color(d) \n{\n return d.name === \"Home\" ? LEVEL_1_COLOR : d.children ? LEVEL_2_COLOR : LEVEL_3_COLOR;\n}", "_getColorForNode(nodeName) {\n const underscoreInd = nodeName.indexOf('_') === -1 ? nodeName.length : nodeName.indexOf('_');\n const nodeType = nodeName.substring(0, underscoreInd);\n if (this.props.removedNodes.has(nodeName)) {\n return GRAY;\n }\n if (nodeType === 'Part') {\n return ORDINAL_COLORS(nodeName);\n } else {\n return TYPE_COLORS[nodeType];\n }\n }", "function Themes_PreProcessTreeGrid(theObject)\n{\n\tif (String_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_DEFAULT]))\n\t\ttheObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_DEFAULT] = \"#d6d4c7\";\n\tif (String_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_YSCROLLSTEP]))\n\t\ttheObject.Properties[__NEMESIS_PROPERTY_YSCROLLSTEP] = 20;\n\tif (String_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_SELECTION_TYPE]))\n\t\ttheObject.Properties[__NEMESIS_PROPERTY_SELECTION_TYPE] = \"CellOnly\";\n\tif (String_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_FONT]))\n\t\ttheObject.Properties[__NEMESIS_PROPERTY_FONT] = \"normal 8.5pt Tahoma\";\n\tswitch (theObject.InterfaceLook)\n\t{\n\t\tdefault:\n\t\t\tif (String_IsNullOrWhiteSpaceOrAuto(theObject.Properties[__NEMESIS_PROPERTY_CLIENTEDGE]) &&\n\t\t\t\tString_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_BORDER]) &&\n\t\t\t\tString_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_BORDER_LEFT]) &&\n\t\t\t\tString_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_BORDER_TOP]) &&\n\t\t\t\tString_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_BORDER_RIGHT]) &&\n\t\t\t\tString_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_BORDER_BOTTOM]))\n\t\t\t{\n\t\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_CLIENTEDGE] = \"No\";\n\t\t\t}\n\t\t\tif (theObject.InterfaceLook === __NEMESIS_LOOK_SAP_BELIZE)\n\t\t\t{\n\t\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_TVHASHLINES] = \"No\";\n\t\t\t}\n\t\t\tbreak;\n\t\tcase __NEMESIS_LOOK_SAP_ENJOY:\n\t\tcase __NEMESIS_LOOK_SAP_TRADESHOW:\n\t\tcase __NEMESIS_LOOK_SAP_SIGNATURE_CORBU:\n\t\tcase __NEMESIS_LOOK_SAP_SIGNATURE_DESIGN:\n\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_TVHASHLINES] = \"No\";\n\t\t\tif (String_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_FOCUSED]))\n\t\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_FOCUSED] = \"#fff09e\";\n\t\t\tif (String_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_SELECTED]) || theObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_SELECTED] == \"000000\")\n\t\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_SELECTED] = \"#ffcc33\";\n\t\t\tif (String_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_FG_COLOR_DEFAULT]))\n\t\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_FG_COLOR_DEFAULT] = \"#73716b\";\n\t\t\tbreak;\n\t\tcase __NEMESIS_LOOK_SAP_CORBUS:\n\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_TVHASHLINES] = \"No\";\n\t\t\tif (String_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_FOCUSED]))\n\t\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_FOCUSED] = \"<SAPCLR:58>\";\n\t\t\tif (String_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_SELECTED]) || theObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_SELECTED] == \"000000\")\n\t\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_SELECTED] = \"<SAPCLR:52>\";\n\t\t\tif (String_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_FG_COLOR_DEFAULT]))\n\t\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_FG_COLOR_DEFAULT] = \"#73716b\";\n\t\t\tbreak;\n\t\tcase __NEMESIS_LOOK_SAP_BLUE_CRYSTAL:\n\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_TVHASHLINES] = \"No\";\n\t\t\tif (String_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_FOCUSED]))\n\t\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_FOCUSED] = \"#E5F2F9\";\n\t\t\tif (String_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_SELECTED]) || theObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_SELECTED] == \"000000\")\n\t\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_SELECTED] = \"#C9E1ED\";\n\t\t\tif (String_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_FG_COLOR_DEFAULT]))\n\t\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_FG_COLOR_DEFAULT] = \"#CCCCCC\";\n\t\t\tbreak;\n\t\tcase __NEMESIS_LOOK_SAP_BELIZE:\n\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_TVHASHLINES] = \"No\";\n\t\t\tif (String_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_FOCUSED]))\n\t\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_FOCUSED] = \"#E8EFF6\";\n\t\t\tif (String_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_SELECTED]) || theObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_SELECTED] == \"000000\")\n\t\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_SELECTED] = \"#E8EFF6\";\n\t\t\tif (String_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_FG_COLOR_DEFAULT]))\n\t\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_FG_COLOR_DEFAULT] = \"#CCCCCC\";\n\t\t\tbreak;\n\t}\n}", "function TreePainter() {\n\n}", "function InstaTree(options)\n{\n this.trunk = {width : {start : 20, end : 1}, \n length : 800, \n lengthRate : 1.5,\n angle : Math.PI / 2, \n curl : 0.2, /*the randomness of the path*/\n branchProb : 0.05,\n segmentLength : 10,\n colour : {r : 128, g : 64, b : 64}};\n\n var branchObj = function()\n { \n this.width = {start : 50, end : 1}; \n this.length = 0; \n this.lengthRate = 1.0;\n this.curl = 0.2; /*the randomness of the path*/\n this.angleDelta = {min : Math.PI / 8, max : Math.PI / 2};\n this.branchProb = 0.07,\n this.angle = 30;\n this.depth = 3;\n this.graviphobia = 0.02;\n this.segmentLength = 10;\n this.colour = {r : 128, g : 64, b : 64};\n };\n \n var leafObj = function()\n {\n this.size = 20;\n this.angle = 0;\n this.colour = {r : 0, g : 255, b : 0};\n };\n \n var DrawLeaf = function(x, y, leaf, context)\n {\n var points = {x : [x,\n x + Math.cos(leaf.angle + Math.PI/4) * leaf.size/2,\n x + Math.cos(leaf.angle) * leaf.size,\n x + Math.cos(leaf.angle - Math.PI/4) * leaf.size/2], \n y : [y,\n y + Math.sin(leaf.angle + Math.PI/4) * leaf.size/2,\n y + Math.sin(leaf.angle) * leaf.size,\n y + Math.sin(leaf.angle - Math.PI/4) * leaf.size/2]};\n \n context.fillStyle = \"rgba(\" + leaf.colour.r + \",\" + leaf.colour.g + \",\" + leaf.colour.b + \", 1)\";\n context.strokeStyle = \"rgba(\" + leaf.colour.r + \",\" + leaf.colour.g + \",\" + leaf.colour.b + \", 1)\";\n context.beginPath();\n context.moveTo(points.x[0], points.y[0]); \n \n for (p = 0; p < points.x.length; p++)\n {\n context.lineTo(points.x[p], points.y[p]);\n }\n \n context.closePath();\n context.stroke();\n context.fill();\n }; \n \n \n //function :this.Draw(x, y, context)\n //date :May 1 2014\n //parameters :x, y, - the location of the base of the tree\n // :context - the drawing context\n //description :This funcion draws the trunk while arbitrarily adding branchs\n // :along the way. The objects this.trunk and this.branch hold\n // :the parameters used in constructing the tree.\n this.Draw = function(x, y, context)\n {\n var segmentLength = this.trunk.segmentLength;\n var numSegments = this.trunk.length / segmentLength;\n var segmentShrink = (this.trunk.width.end - this.trunk.width.start) / numSegments;\n\n var segment = {x : [this.trunk.width.start / -2,this.trunk.width.start / 2,0,0], y : [0,0,0,0]};\n \n var vertex = {x : 0, y : 0};\n \n var branchRight = false; //to keep the tree asymetrical, branching alternates left/right\n \n //walk along the main trunk while arbitrarily choosing branch points\n for (var s = 0; s < numSegments; s++)\n {\n //the angle for this segment based on trunk angle\n //makes the trunk more rough by shifting the angle from side to side\n var angle = this.trunk.angle + ((Math.random() - 0.5) * Math.PI * this.trunk.curl);\n \n //this is how wide the segment will be\n //each segment gets thinner as we move along the trunk\n var segmentWidth = (this.trunk.width.start + (segmentShrink * s)) / 2;\n \n //leaves are more probable near the end of the trunk\n var leafProb = s / (numSegments - 1);\n \n //calculate the end midpoint of the segment\n vertex.x -= Math.cos(angle) * segmentLength;\n vertex.y -= Math.sin(angle) * segmentLength;\n \n //calculate the end left and right points of the segment\n segment.x[2] = vertex.x + Math.cos(angle - Math.PI / 2) * segmentWidth;\n segment.y[2] = vertex.y + Math.sin(angle - Math.PI / 2) * segmentWidth;\n segment.x[3] = vertex.x + Math.cos(angle + Math.PI / 2) * segmentWidth;\n segment.y[3] = vertex.y + Math.sin(angle + Math.PI / 2) * segmentWidth;\n \n //set the colour\n context.fillStyle = \"rgba(\" + this.trunk.colour.r + \",\" + this.trunk.colour.g + \",\" + this.trunk.colour.b + \", 1)\";\n context.strokeStyle = \"rgba(\" + this.trunk.colour.r + \",\" + this.trunk.colour.g + \",\" + this.trunk.colour.b + \", 1)\";\n \n //draw the segment\n context.beginPath(); \n context.moveTo(x + segment.x[0], y + segment.y[0]);\n context.lineTo(x + segment.x[1], y + segment.y[1]);\n context.lineTo(x + segment.x[2], y + segment.y[2]);\n context.lineTo(x + segment.x[3], y + segment.y[3]); \n context.closePath(); \n context.fill();\n context.stroke();\n \n //the end points of the segment become the start points of the next segment\n segment.x[0] = segment.x[3];\n segment.y[0] = segment.y[3];\n \n segment.x[1] = segment.x[2];\n segment.y[1] = segment.y[2];\n \n //choose to add a branch if we are up far enough along the trunk\n if (Math.random() < this.trunk.branchProb && (s * segmentLength) > segmentWidth)\n {\n //create a new branch\n var branch = new branchObj();\n \n //calculate the angle of the new branch depending on if it is going left or right\n var range = branch.angleDelta.max - branch.angleDelta.min;\n var min = branch.angleDelta.min;\n var branchAngle = 0;\n \n if (branchRight === true)\n {\n branchAngle = angle - (Math.random() * range) - min;\n branchRight = false;\n }\n else\n {\n branchAngle = angle + (Math.random() * range) + min;\n branchRight = true;\n }\n \n //set up branch\n branch.angle = branchAngle;\n //length is proportional to the remaining length of the trunk\n branch.length = (segmentWidth * (numSegments - s - 1)) * this.trunk.lengthRate;\n branch.width.start = segmentWidth;\n branch.width.end = 1;\n branch.colour.r = this.trunk.colour.r;\n branch.colour.g = this.trunk.colour.g;\n branch.colour.b = this.trunk.colour.b;\n \n DrawBranch(x + vertex.x, y + vertex.y, branch, context);\n }\n \n if (Math.random() < leafProb)\n {\n var leaf = new leafObj();\n var left = Math.random() < 0.5;\n \n if (left === true)\n {\n leaf.angle = angle + Math.random() * Math.PI / 4 + Math.PI/2;\n }\n else\n {\n leaf.angle = angle - Math.random() * Math.PI / 4 - Math.PI/2;\n }\n \n leaf.colour.r = this.trunk.colour.r;\n leaf.colour.g = this.trunk.colour.g;\n leaf.colour.b = this.trunk.colour.b;\n \n DrawLeaf(x + vertex.x, y + vertex.y, leaf, context);\n }\n }\n };\n \n //function :this.DrawBranch(x, y, branch, context)\n //date :May 2 2014\n //parameters :x, y, - the location of the base of the tree\n // :branch - an object containing the properties of the branch\n // :context - the drawing context\n //description :This funcion draws the trunk while arbitrarily adding branchs\n // :along the way. The objects this.trunk and this.branch hold\n // :the parameters used in constructing the tree.\n var DrawBranch = function(x, y, branch, context)\n {\n var segmentLength = branch.segmentLength;\n var numSegments = branch.length / segmentLength;\n var segmentShrink = (branch.width.end - branch.width.start) / numSegments;\n\n var segment = {x : [branch.width.start / -2,branch.width.start / 2,0,0], y : [0,0,0,0]};\n \n var vertex = {x : 0, y : 0};\n \n var branchRight = false;\n \n //walk along the length of the branch adding more branches as needed\n for (var s = 0; s < numSegments; s++)\n {\n var angle = branch.angle + ((Math.random() - 0.5) * Math.PI * branch.curl);\n \n var segmentWidth = (branch.width.start + (segmentShrink * s))/2;\n \n var leafProb = s / (numSegments - 1);\n \n //graviphobic responce - branchs curl up away from gravity\n if (angle < 0)\n {\n branch.angle += Math.PI / 16;\n }\n else if(angle > Math.PI)\n {\n branch.angle -= Math.PI / 16;\n }\n else if(angle < Math.PI/2)\n {\n branch.angle += branch.graviphobia;\n }\n else if(angle > Math.PI/2)\n {\n branch.angle -= branch.graviphobia;\n }\n \n //choose to create a new branch as long as we are far along the branch\n //enough and ensure we don't go too deep into the recursion and \n //cause a stack overflow\n if (Math.random() < branch.branchProb && \n (s * segmentLength) > segmentWidth &&\n (branch.depth > 0))\n {\n //create new branch\n var newBranch = new branchObj();\n var range = newBranch.angleDelta.max - newBranch.angleDelta.min;\n var min = newBranch.angleDelta.min;\n var branchAngle = 0;\n \n if (this.branchRight === true)\n {\n branchAngle = angle - (Math.random() * range) - min;\n this.branchRight = false;\n }\n else\n {\n branchAngle = angle + (Math.random() * range) + min;\n this.branchRight = true;\n }\n \n //set up branch\n newBranch.angle = branchAngle;\n newBranch.length = (segmentWidth * (numSegments - s - 1)) * branch.lengthRate;\n newBranch.width.start = segmentWidth;\n newBranch.width.end = 1;\n newBranch.colour.r = branch.colour.r;\n newBranch.colour.g = branch.colour.g;\n newBranch.colour.b = branch.colour.b;\n newBranch.depth = branch.depth - 1; //count down the recursion\n \n DrawBranch(x + vertex.x, y + vertex.y, newBranch, context);\n \n }\n \n //calculate end midpoint of branch\n vertex.x -= Math.cos(angle) * segmentLength;\n vertex.y -= Math.sin(angle) * segmentLength;\n \n //calculate end points of segment\n segment.x[2] = vertex.x + Math.cos(angle - Math.PI / 2) * segmentWidth;\n segment.y[2] = vertex.y + Math.sin(angle - Math.PI / 2) * segmentWidth;\n segment.x[3] = vertex.x + Math.cos(angle + Math.PI / 2) * segmentWidth;\n segment.y[3] = vertex.y + Math.sin(angle + Math.PI / 2) * segmentWidth;\n \n //draw the segment\n context.fillStyle = \"rgba(\" + branch.colour.r + \",\" + branch.colour.g + \",\" + branch.colour.b + \", 1)\";\n context.strokeStyle = \"rgba(\" + branch.colour.r + \",\" + branch.colour.g + \",\" + branch.colour.b + \", 1)\";\n context.beginPath();\n context.moveTo(x + segment.x[0], y + segment.y[0]);\n context.lineTo(x + segment.x[1], y + segment.y[1]);\n context.lineTo(x + segment.x[2], y + segment.y[2]);\n context.lineTo(x + segment.x[3], y + segment.y[3]);\n context.closePath();\n context.fill();\n context.stroke();\n \n //end points become start points of next segment\n segment.x[0] = segment.x[3];\n segment.y[0] = segment.y[3]; \n segment.x[1] = segment.x[2];\n segment.y[1] = segment.y[2];\n \n if (Math.random() < leafProb)\n {\n var leaf = new leafObj();\n var left = Math.random() < 0.5;\n \n if (left === true)\n {\n leaf.angle = angle + Math.random() * Math.PI / 4 + Math.PI/2;\n }\n else\n {\n leaf.angle = angle - Math.random() * Math.PI / 4 - Math.PI/2;\n }\n \n leaf.colour.r = branch.colour.r;\n leaf.colour.g = branch.colour.g;\n leaf.colour.b = branch.colour.b;\n\n DrawLeaf(x + vertex.x, y + vertex.y, leaf, context);\n }\n }\n }; \n \n\n}", "function treeVisual(ecModel) {\n ecModel.eachSeriesByType('tree', function (seriesModel) {\n var data = seriesModel.getData();\n var tree = data.tree;\n tree.eachNode(function (node) {\n var model = node.getModel(); // TODO Optimize\n\n var style = model.getModel('itemStyle').getItemStyle();\n var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style');\n Object(util[\"m\" /* extend */])(existsStyle, style);\n });\n });\n}", "function Color(depth){\n if (depth < 10){\n return \"#99ff99\";\n }\n else if (depth < 30){\n return \"#66ff66\"\n }\n else if (depth < 50){\n return \"#33cc33\"\n }\n else if (depth < 70){\n return \"#009933\"\n }\n else{\n return \"#003300\";\n };\n }", "function nodeColor(d) {\n return \"#\" + md5($.url(d.name).attr('host')).slice(0,6);\n}", "function quadtree(img, sRow, sCol, path, lvl, numOfCols, parent) {\n\n var isSame = true;\n var startColor = img[sRow][sCol];\n var binStr = \"\";\n var rows = sRow + numOfCols;\n var cols = sCol + numOfCols;\n for (var i = sRow; i < rows; i++) {\n for (var j = sCol; j < cols; j++) {\n\n var cellColor = img[i][j];\n binStr += cellColor;\n if (startColor != cellColor) {\n isSame = false;\n }\n }\n }\n\n if (isSame) {\n addSiblings(parent);\n return {\n binStr: binStr,\n path: path,\n lvl: lvl,\n children: [],\n parent: parent,\n siblings: 0\n };\n\n } else {\n var child = {\n binStr: binStr,\n path: path,\n lvl: lvl,\n children: [],\n parent: parent,\n siblings: 0\n };\n addSiblings(parent);\n var halfCols = Math.floor(numOfCols / 2);\n lvl++;\n child.children.push(quadtree(img, sRow, sCol, path + \"0\", lvl, halfCols, child));\n child.children.push(quadtree(img, sRow, halfCols, path + \"1\", lvl, halfCols, child));\n child.children.push(quadtree(img, sRow + halfCols, sCol, path + \"2\", lvl, halfCols, child));\n child.children.push(quadtree(img, sRow + halfCols, sRow + halfCols, path + \"3\", lvl, halfCols, child));\n return child;\n }\n}", "function nodeColors(regualrColor, disabledColor) {\n document.getElementById(\"infoSidebar\").style.borderLeft = \"5px solid \" + regualrColor;\n document.getElementById(\"set-name\").style.color = regualrColor;\n document.getElementById(\"set-type\").style.backgroundColor = regualrColor;\n document.getElementById(\"set-node-title\").style.backgroundColor = disabledColor;\n document.getElementById(\"toggle-info-btn\").style.backgroundColor = regualrColor;\n}", "function color_node(node) {\n // console.log(\"color_node\");\n if (node.selected) { return \"red\"; }\n else { return fill(node.group);}\n }", "function color(d) {\n\t\t\t return d._children ? \"#3182bd\" : d.children ? \"#c6dbef\" : \"#fd8d3c\";\n\t\t\t}", "function drawTree() {\n noStroke();\n fill(TRUNK_COLOR);\n rect(xTrunkCorner, yTrunkCorner, 10, 50);\n\n // fill alternating columns with different colors of green\n if (i % 2 == 0) {\n fill(TREE_COLOR1);\n }\n if (i % 2 == 1) {\n fill(TREE_COLOR2);\n }\n\n // triangles that make up the treetops\n triangle(xTreeCorner1, yTreeCorner1, xTreeCorner2, yTreeCorner2, xTreeCorner3, yTreeCorner3);\n triangle(xTreeCorner1 - 5, yTreeCorner1 + 20, xTreeCorner2, yTreeCorner2 + 20, xTreeCorner3 + 5, yTreeCorner3 + 20);\n triangle(xTreeCorner1 - 10, yTreeCorner1 + 40, xTreeCorner2, yTreeCorner2 + 40, xTreeCorner3 + 10, yTreeCorner3 + 40);\n }", "function drawTree() {\n noStroke();\n fill(TRUNK_COLOR);\n rect(xTrunkCorner, yTrunkCorner, 10, 50);\n\n // fill alternating columns with different colors of green\n if (i % 2 == 0) {\n fill(TREE_COLOR1);\n }\n if (i % 2 == 1) {\n fill(TREE_COLOR2);\n }\n\n // triangles that make up the treetops\n triangle(xTreeCorner1, yTreeCorner1, xTreeCorner2, yTreeCorner2, xTreeCorner3, yTreeCorner3);\n triangle(xTreeCorner1 - 5, yTreeCorner1 + 20, xTreeCorner2, yTreeCorner2 + 20, xTreeCorner3 + 5, yTreeCorner3 + 20);\n triangle(xTreeCorner1 - 10, yTreeCorner1 + 40, xTreeCorner2, yTreeCorner2 + 40, xTreeCorner3 + 10, yTreeCorner3 + 40);\n }", "drawTree() {\r\n fuenfteAufgabe.crc2.beginPath();\r\n fuenfteAufgabe.crc2.moveTo(this.x, this.y);\r\n fuenfteAufgabe.crc2.lineTo(this.x + 30, this.y - 60);\r\n fuenfteAufgabe.crc2.lineTo(this.x + 60, this.y);\r\n fuenfteAufgabe.crc2.strokeStyle = this.color;\r\n fuenfteAufgabe.crc2.stroke();\r\n fuenfteAufgabe.crc2.fillStyle = this.color;\r\n fuenfteAufgabe.crc2.fill();\r\n }", "function NamTree(div){ //div is the <div> DOM element where this tree is to be displayed\n\t//standard/default iamges\n\tthis.imagesDir\t\t= '/egi/resources/erp2/images/';\n\tthis.collapsedGif\t= this.imagesDir + 'plus.gif';\n\tthis.expandedGif\t= this.imagesDir + 'minus.gif';\n\tthis.spaceGif\t\t= this.imagesDir + 'space.gif';\n\tthis.leafGif\t\t= this.imagesDir + 'page.gif';\n\tthis.folderGif\t\t= this.imagesDir + 'folder.gif';\n\tthis.folderOpenGif\t= this.imagesDir + 'folderopen.gif';\n\tthis.styleToShow= ''; //style.disply attribute\n\tthis.styleToHide\t= 'none';\n\n\t// configurable parameters. These can be modified with the <parameter> in XML\n\tthis.indent\t\t\t= 20; //each indent shifted by 20 pixels\n\tthis.normalBackgroundColor\t \t= 'white';\n\tthis.highlightedbackgroundColor = 'blue';\n\tthis.normalColor \t= 'navy';\n\tthis.highlightedColor= 'white';\n\tthis.fontFamily\t\t= 'arial';\n\tthis.fontSize\t\t= '9pt';\n\tthis.searchIsRequired= 'false';//making it a boolean had issues with loading from XML\n\t\n\tdiv.setAttribute('namTree', this); //link the div and tree so that we can get one from the other\n\tthis.div\t\t= div;\n\n\tthis.images\t\t= new Object(); //stores images for different types of nodes\t\n\tthis.nodeCount\t= 0;\n\tthis.nodes\t\t= new Object(); //contains all node objects as properties\n\tthis.sortedNodes= null; //sorted on a need basis and kept.\n\n\tthis.selectedNode= null;//points to the node user has clicked\n\tthis.searchString =\t\"\"; //last search string\n/* creates a new node.\n * id has to be unique. it is typically an internal code used by the system. id is not displayed. \n * name is diaplyed. need not be unique, even for a parent. \n * paentid id is optional. It is possible to first create nodes, and then 'link' them to create the tree\n * alternately, the parent id can be specified at the time of creating the node, even if the\n * parent id is not created yet.\n * This feature allows a server to just dump the rows of its table without worrying about the order\n * \n */\n\nthis.createNode = function (type, id, name, parentid){\n\tif(!id || !name) return (false);\n\t\n\tvar node\t\t= this.nodes[id];\n\tif (node){ //node exists. design is not to generate error, but just modify it\n\t\tnode.name\t= name;\n\t}else{ //create a new node\n\t\tnode\t\t= new NamNode(this, type, id, name);\n\t\tnode.tree\t= this;\n\t\tthis.nodes[id] = node;\n\t\tthis.nodeCount ++;\t\t\n\t}\n\t\n\tif (parentid)\n\t\tif ( parentid.toUpperCase() == 'NULL' || parentid == 0 || parentid == '') parentid = null;\n\tif(parentid) this.link(id,parentid);\n\treturn (node);\n}\n\n/* \n * link is used to creat/remove parent-child relationship between nodes\n * existing link is removed if the new link can be created or parent id is null\n * parent node is created if required before linking\n */\n\nthis.link = function (childid, parentid){ \n\tvar child = this.nodes[childid];\n\tif (!child) return(false);\n\t\n\tvar added\t= false;\n\tvar removed = false;\n\tvar oldparent\t= child.parent;\n\n\tif (parentid){\n\t\tvar\tparent\t\t\t= this.nodes[parentid];\n\t\tif (!parent) parent = this.createNode('node', parentid,'new',null); //create in anticipation. Name will be attached later\n\t\tif(!child.canAttachTo(parent)) return(false); //wrong connection tried :-) \n\t\tparent.children[childid] = child;\n\t\tparent.childCount++;\n\t\tchild.parent = parent;\n\t\tadded\t= true;\n\t}\n\t\n\tif(oldparent){ //old link exists\n\t\toldparent.children[childid] = null;\n\t\toldparent.childCount--;\n\t\tif(!added) child.parent = null; //this case was to just remove the link\n\t\tremoved = true;\n\t}\n\t\n\treturn (added || removed); //returns true if something was done\n}\n\n/* Creates all the HTML DOM elements to display the tree. \n * Initially, only the root nodes are visible, while the rest are all hidden\n * All the rows are created. Root nodes are set with display attribute as blocked while the rest with 'none'\n */\n\nthis.display = function (){\t\n\n\tvar div = this.div;\n\tdiv.innerHTML = ''; //zap existing content\n\tdiv.style.backgroundColor = this.normalBackgroundColor;\n\tdiv.style.color\t\t\t= this.normalColor;\n\tdiv.style.fontFamily\t= this.fontFamily;\n\tdiv.style.fontSize\t\t= this.fontSize;\n\tdiv.onclick\t\t\t\t= NamTreeClick;\n\tdiv.ondblclick\t\t\t= NamTreeDblClick;\n\tdiv.onmouseover\t\t\t= NamTreeMouseOver;\n\tdiv.onmouseout\t\t\t= NamTreeMouseOut;\n/*\n\tif (this.searchIsRequired && this.searchIsRequired.toString().toUpperCase() != 'FALSE' ){\n\t\tvar divform = document.createElement('DIV'); //for search fields and buttons\n\t\tdiv.appendChild(divform);\n\t\t\n\t\tvar ele = document.createElement('INPUT');\n\t\tele.divId = div.id;\n\t\tele.id = 'searchField';\n\t\tele.width = 15;\n\t\tele.onchange = NamTreeSearchEvent;\n\t\tdivform.appendChild(ele);\n\t\t\n\t\tele = document.createElement('INPUT');\n\t\tele.type = 'button';\n\t\tele.value = 'Search';\n\t\tele.divId = div.id;\n\t\tele.id = 'searchButton';\n\t\tele.onclick = NamTreeSearchEvent;\n\t\tdivform.appendChild(ele);\n\n\t\tele = document.createElement('INPUT');\n\t\tele.type = 'button';\n\t\tele.value = ' ++ ';\n\t\tele.title = 'Expand All';\n\t\tele.divId = div.id;\n\t\tele.id = 'expandAll';\n\t\tele.onclick = NamTreeSearchEvent;\n\t\tdivform.appendChild(ele);\n\t\t\n\t\tele = document.createElement('INPUT');\n\t\tele.type = 'button';\n\t\tele.value = ' - - ';\n\t\tele.title = 'Collapse All';\n\t\tele.divId = div.id;\n\t\tele.id = 'collapseAll';\n\t\tele.onclick = NamTreeSearchEvent;\n\t\tdivform.appendChild(ele);\n\t\t\n\t\tvar ihtm = '<input width=\"15\" onchange=\"NamTreeSearchEvent(1,\" \n\t\t\t +\"'\" +div.id +\"','\" +this.value +')\">&nbsp;';\n\t\tihtm += '<input type=\"button\" value=\"Search\" name=\"searchNode\" id=\"searchNode\" onclick=\"NamTreeSearchEvent(2,\"'\n\t\t\t +\"'\" +div.id +\"'\" +')\">&nbsp;';\n\t\tihtm += '<input type=\"button\" value=\" - - \" name=\"collapseAll\" id=\"collapseAll\" onclick=\"NamTreeSearchEvent(3,\"'\n\t\t\t +\"'\" +div.id +\"'\" +')\">&nbsp;';\n\t\tihtm += '<input type=\"button\" value=\" ++ \" name=\"expandAll\" id=\"expandAll\" onclick=\"NamTreeSearchEvent(4,\"'\n\t\t\t +\"'\" +div.id +\"'\" +')\">&nbsp;';\n\t\tdivform.innerHTML = ihtm;\n\n\t}\n\n*/\n\t\n\tvar tbl\t\t= document.createElement('TABLE');\n\ttbl.setAttribute('border','0');\n\ttbl.setAttribute('cellSpacing','0');\n\tdiv.appendChild(tbl);\n\t\n\tvar tbody = document.createElement('TBODY');\n\ttbl.appendChild(tbody);\t\n\t\n\tvar node = null;\n\tfor (var a in this.nodes){\n\t\tnode\t= this.nodes[a];\n\t\tif (node && node.parent == null)node.display(tbody, 0); //display only the root nodes. They in turn will display the branches below them\n\t}\n}\n\n/*\n * If a selected node is hidden (when one of its ancestors collapses :-)\n * the selection is shifted to the first ancestor that is visible.\n */\n\nthis.shiftSelection = function (){\n\tif (!this.selectedNode ) return true;\n\tif (this.selectedNode.displayed) return true;\n\tvar p = this.selectedNode.parent;\n\twhile (p && !p.displayed) p = p.parent; //root parent is guaranteed to be displayed always\n\tp.select(false); //false -> selected node should not be expanded,\n}\n\n/*\n * Expands or collpases the entire tree\n * expand = true means expand, else collapse\n */\n\nthis.expandCollapse = function (expand){\n\tvar n = null;\n\tfor (var a in this.nodes){\n\t\tn = this.nodes[a];\n\t\tif (!n.parent) n.expandCollapse(expand, true); //root nodes are expanded/collpased with cascade effect\n\t}\n}\n/*\n * Method to load tree from an XML file\n * This tree is designed specifically for a server that stores tree in a relational DB\n * Hence, we do not use an XML tree. The XML simply contains just one level of nodes. \n * XML can have a <confiure> tag that can set various attributes of the tree\n *\t\t an <images> section that can supply gif file names for different types of tree nodes\n *\t <tree> that contains all the nodes of the tree as is children. \n * <TO DO> write DTD for the XML\n */\n\nthis.loadFromXML = function (xmlFile){\n\tvar xmlDoc = null;\n\tvar attrib, obj, img;\n\tif( document.implementation && document.implementation.createDocument) { //W3C spec implemented\n\t\txmlDoc = document.implementation.createDocument(\"\",\"\",null);\n\t\txmlDoc.load(xmlFile);\nbootbox.alert('XML Loaded but not sure whether it completed or not. hence this alert. Press Ok after few seconds..');\n\t\t//TO DO: How to check ready state and errors???\n\t}else if ((typeof ActiveXObject) != \"undefined\"){ //IE \n\t\txmlDoc = new ActiveXObject(\"msxml2.DOMDocument.4.0\");\n\t\txmlDoc.async = false;\n\t\txmlDoc.load(xmlFile);\n\t\tif (xmlDoc.parseError && xmlDoc.parseError.errorCode != 0){\n\t\t\tbootbox.alert('Error loading XML file ' +xmlFile +'. Reason is: ' + xmlDoc.parseError.reason);\n\t\t\treturn false;\n\t\t}\n\t}else{\n\t\tbootbox.alert('Sorry, your browser doses not support XML Load.');\n\t\treturn false;\n\t}\n\tvar namtree = xmlDoc.documentElement;\n\tvar len = namtree.childNodes.length;\n//bootbox.alert('XML Loaded to namtree namtree = ' + namtree + 'namTree has ' + namtree.childNodes.length + ' children');\n\tfor(i=0; i<len; i++){\n\t\tvar node = namtree.childNodes[i];\n\t/*\n\t * XML should contain three elements at the top.\n\t * 1. <parameters .....> this element should set paramaters\n\t * 2. <types> with <type> as its children. each <type> element describes a type of node\n\t * 3. <nodes> with <node> as its children.\n\t * This rotine has hard coded this sequence of elements\n\t */\n\t\tswitch (node.nodeName){\n\t\tcase 'paramaters':\n\t\t\tobj = node.attributes;\n\t\t\tfor( var j=0; j<obj.length; j++){\n\t\t\t\tattrib = obj[j].name;\n\t\t\t\tif (this[attrib]) this[attrib] = obj[j].value;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'types':\n\t\t\tobj = node.childNodes;\n\t\t\tfor (var j=0; j<obj.length; j++){\n\t\t\t\tattrib = obj[i].getAttribute('img');\n\t\t\t\tif (attrib){\n\t\t\t\t\timg = document.createElement('IMG');\n\t\t\t\t\timg.src = this.imagesDir +attrib;\n\t\t\t\t\tthis.images[obj[j].getAttribute('value')] = img;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'nodes':\n\t\t\tobj = node.childNodes;\n\t\t\tfor (var j=0; j < obj.length; j++){\n\t\t\t\tthis.createNode(obj[j].getAttribute('type'), obj[j].getAttribute('id'), obj[j].getAttribute('name'), obj[j].getAttribute('pid'));\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n}\n/*\n * Sorting order used is 'depth-first'. It would be the order in which nodes are displayed\n *\t\twhen every node is expanded.\n */\n\nthis.sort = function (){\n\tif (this.sortedNodes)return(true);\n\t\n\tthis.sortedNodes = new Array(this.nodeCount);\n\tvar idx = 0;\n\tvar p = null;\n\tfor(var a in this.nodes){ //for each root nodes\n\t\tp = this.nodes[a];\n\t\tif (p.parent == null){\n\t\t\tthis.sortedNodes[idx] = p;\n\t\t\tp.sortedIndex = idx;\n\t\t\tidx++;\n\t\t\tthis.sortBranch(p,idx);\n\t\t}\n\t}\n}\n/*\n * Sorting order used is 'depth-first'. It would be the order in which nodes are displayed\n *\t\twhen every node is expanded.\n */\n\nthis.sortBranch = function (parent,idx){\n\tvar node = null;\n\tfor(var a in parent.children){ //for each root nodes\n\t\tnode = parent.children[a];\n\t\tthis.sortedNodes[idx] = node;\n\t\tnode.sortedIndex = idx;\n\t\tidx++;\n//if (idx == 73) bootbox.alert(\"I am in 73\");\n\t\tif (node.childCount > 0) idx = this.sortBranch(node,idx);\n\t}\n\treturn(idx);\n}\n\n/*\n * Searches for a string in the name of nodes, starting from the selected node.\n * if no match is found till end of tree, user is warned that the search will restart from beginning\n * if no match is found in the entire doc, user is informed\n */\n\nthis.search = function (strin){\n\n\tif (strin) this.searchString = strin;\n\telse strin = this.searchString;\n\t\n\tif (strin == ''){\n\t\tbootbox.alert('No search string specified');\n\t\treturn(false);\n\t}\n\t\n\tstr = new String(strin);\n\tstr = str.toUpperCase();\n\t\n\tif (!this.sortedNodes) this.sort();\n\tvar node = null;\n\tvar idx = (this.selectedNode)? this.selectedNode.sortedIndex + 1 : 0;\n\tvar restarted = false;\n\twhile (true){ //will come out based on user input\n\t\twhile (idx < this.nodeCount){\n\t\t\tnode = this.sortedNodes[idx];\n\t\t\tif (node.name.toString().toUpperCase().indexOf(str) >= 0){\n\t\t\t\tnode.select(false);\n\t\t\t\treturn(true);\n\t\t\t}\n\t\t\tidx++;\n\t\t}\n\t\t//if we reach here, we have reached the end\n\t\tif (restarted){\n\t\t\tbootbox.alert('No match found');\n\t\t\treturn(false);\n\t\t}\n\t\talert ('Reached end of tree. Going to start from beginning of tree');\n\t\trestarted = true;\n\t\tidx = 0;\n\t}\n\treturn(false);\n}\n\nthis.addImg = function (typ,img){\n\tvar imgobj = document.createElement('IMG');\n\timgobj.src = this.imagesDir+img;\n\tthis.images[typ] = imgobj;\n}\n}", "function circleColour(d) {\n if(d.type ===\"NODE\"){\n// \treturn \"#753d54\";\n return \"gray\";\n\n } else {\n \treturn \"#c41f6e\";\n }\n\n}", "function findColor(quadTree, coordinates){\n //a quad tree is a tree where each node has 4 children \n //or no children, usually used to divide a two-dimensional\n //space into coordinates\n //coordinates is an array [xpos, ypos]\n\n if (!Array.isArray(quadTree.color)){\n return quadTree.color;\n } else {\n var quadrant = findQuadrant(quadTree, coordinates); \n if (quadrant === \"NE\") {\n return findColor(quadTree.color[0], coordinates);\n } \n if (quadrant === \"SE\") {\n return findColor(quadTree.color[1], coordinates);\n }\n if (quadrant === \"SW\") {\n return findColor(quadTree.color[2], coordinates);\n } \n if (quadrant === \"NW\") {\n return findColor(quadTree.color[3], coordinates);\n }\n }\n\n function findQuadrant(quadTree, coordinates){\n var y = (quadTree.coordinates.top + quadTree.coordinates.bottom)/2;\n var x = (quadTree.coordinates.left + quadTree.coordinates.right)/2;\n if (coordinates[0] > x){\n if (coordinates[1] > y){\n return \"NE\";\n } else {\n return \"SE\";\n }\n } else {\n if (coordinates[1] > y){\n return \"NW\";\n } else {\n return \"SW\";\n }\n }\n }\n}", "function color(d) {\n\t\t\treturn d._children ? \"green\" : d.children ? \"green\" : \"#fd8d3c\";\n\t\t}", "function stripeit(div) {\n \"use strict\";\n var counter = 0, classes;\n //Go through all the root nodes.\n $(div).find('ul > li').each(function () {\n classes = get_classes($(this));\n if (contains('jstree-closed', classes)) {\n if ((counter % 2) === 0) {\n $(this).css('background-color', 'WhiteSmoke');\n } else { //Clear BG colour\n $(this).css('background-color', 'white');\n }\n counter += 1;\n /*Now we are at an open node. We need to count its ul elements\n in order to paint them and then continue*/\n } else if (contains('jstree-open', classes)) {\n if ((counter % 2) === 0) {\n $(this).css('background-color', 'WhiteSmoke');\n } else { //Clear BG colour\n $(this).css('background-color', 'white');\n }\n counter += 1;\n //Check each leaf of the expanded node now.\n (function (domobj) {\n domobj.find('li').each(function () {\n if ((counter % 2) === 0) {\n $(this).css('background-color', 'WhiteSmoke');\n } else { //Clear BG colour\n $(this).css('background-color', 'white');\n }\n counter += 1;\n });\n })($(this));\n }\n });\n}", "function updateNodesColorsByCat (net, val){\n var colors = d3.scale.category20b();\n\n net.nodes().css({\n 'background-color': function(n) {\n return n.data(\"starred\") ? \"yellow\" : colors( n.data().data[val] );\n }\n });\n\n\n}", "function color(d) {\n return d._children ? \"#3182bd\" : d.children ? \"#c6dbef\" : \"#fd8d3c\";\n }", "function color() {\n var map = {\n \"black\" : [ 0/255,0/255,0/255 ],\n \"silver\": [ 192/255,192/255,192/255 ],\n \"gray\" : [ 128/255,128/255,128/255 ],\n \"white\" : [ 255/255,255/255,255/255 ],\n \"maroon\": [ 128/255,0/255,0/255 ],\n \"red\" : [ 255/255,0/255,0/255 ],\n \"purple\": [ 128/255,0/255,128/255 ],\n \"fuchsia\": [ 255/255,0/255,255/255 ],\n \"green\" : [ 0/255,128/255,0/255 ],\n \"lime\" : [ 0/255,255/255,0/255 ],\n \"olive\" : [ 128/255,128/255,0/255 ],\n \"yellow\": [ 255/255,255/255,0/255 ],\n \"navy\" : [ 0/255,0/255,128/255 ],\n \"blue\" : [ 0/255,0/255,255/255 ],\n \"teal\" : [ 0/255,128/255,128/255 ],\n \"aqua\" : [ 0/255,255/255,255/255 ],\n \"aliceblue\" : [ 240/255,248/255,255/255 ],\n \"antiquewhite\" : [ 250/255,235/255,215/255 ],\n \"aqua\" : [ 0/255,255/255,255/255 ],\n \"aquamarine\" : [ 127/255,255/255,212/255 ],\n \"azure\" : [ 240/255,255/255,255/255 ],\n \"beige\" : [ 245/255,245/255,220/255 ],\n \"bisque\" : [ 255/255,228/255,196/255 ],\n \"black\" : [ 0/255,0/255,0/255 ],\n \"blanchedalmond\" : [ 255/255,235/255,205/255 ],\n \"blue\" : [ 0/255,0/255,255/255 ],\n \"blueviolet\" : [ 138/255,43/255,226/255 ],\n \"brown\" : [ 165/255,42/255,42/255 ],\n \"burlywood\" : [ 222/255,184/255,135/255 ],\n \"cadetblue\" : [ 95/255,158/255,160/255 ],\n \"chartreuse\" : [ 127/255,255/255,0/255 ],\n \"chocolate\" : [ 210/255,105/255,30/255 ],\n \"coral\" : [ 255/255,127/255,80/255 ],\n \"cornflowerblue\" : [ 100/255,149/255,237/255 ],\n \"cornsilk\" : [ 255/255,248/255,220/255 ],\n \"crimson\" : [ 220/255,20/255,60/255 ],\n \"cyan\" : [ 0/255,255/255,255/255 ],\n \"darkblue\" : [ 0/255,0/255,139/255 ],\n \"darkcyan\" : [ 0/255,139/255,139/255 ],\n \"darkgoldenrod\" : [ 184/255,134/255,11/255 ],\n \"darkgray\" : [ 169/255,169/255,169/255 ],\n \"darkgreen\" : [ 0/255,100/255,0/255 ],\n \"darkgrey\" : [ 169/255,169/255,169/255 ],\n \"darkkhaki\" : [ 189/255,183/255,107/255 ],\n \"darkmagenta\" : [ 139/255,0/255,139/255 ],\n \"darkolivegreen\" : [ 85/255,107/255,47/255 ],\n \"darkorange\" : [ 255/255,140/255,0/255 ],\n \"darkorchid\" : [ 153/255,50/255,204/255 ],\n \"darkred\" : [ 139/255,0/255,0/255 ],\n \"darksalmon\" : [ 233/255,150/255,122/255 ],\n \"darkseagreen\" : [ 143/255,188/255,143/255 ],\n \"darkslateblue\" : [ 72/255,61/255,139/255 ],\n \"darkslategray\" : [ 47/255,79/255,79/255 ],\n \"darkslategrey\" : [ 47/255,79/255,79/255 ],\n \"darkturquoise\" : [ 0/255,206/255,209/255 ],\n \"darkviolet\" : [ 148/255,0/255,211/255 ],\n \"deeppink\" : [ 255/255,20/255,147/255 ],\n \"deepskyblue\" : [ 0/255,191/255,255/255 ],\n \"dimgray\" : [ 105/255,105/255,105/255 ],\n \"dimgrey\" : [ 105/255,105/255,105/255 ],\n \"dodgerblue\" : [ 30/255,144/255,255/255 ],\n \"firebrick\" : [ 178/255,34/255,34/255 ],\n \"floralwhite\" : [ 255/255,250/255,240/255 ],\n \"forestgreen\" : [ 34/255,139/255,34/255 ],\n \"fuchsia\" : [ 255/255,0/255,255/255 ],\n \"gainsboro\" : [ 220/255,220/255,220/255 ],\n \"ghostwhite\" : [ 248/255,248/255,255/255 ],\n \"gold\" : [ 255/255,215/255,0/255 ],\n \"goldenrod\" : [ 218/255,165/255,32/255 ],\n \"gray\" : [ 128/255,128/255,128/255 ],\n \"green\" : [ 0/255,128/255,0/255 ],\n \"greenyellow\" : [ 173/255,255/255,47/255 ],\n \"grey\" : [ 128/255,128/255,128/255 ],\n \"honeydew\" : [ 240/255,255/255,240/255 ],\n \"hotpink\" : [ 255/255,105/255,180/255 ],\n \"indianred\" : [ 205/255,92/255,92/255 ],\n \"indigo\" : [ 75/255,0/255,130/255 ],\n \"ivory\" : [ 255/255,255/255,240/255 ],\n \"khaki\" : [ 240/255,230/255,140/255 ],\n \"lavender\" : [ 230/255,230/255,250/255 ],\n \"lavenderblush\" : [ 255/255,240/255,245/255 ],\n \"lawngreen\" : [ 124/255,252/255,0/255 ],\n \"lemonchiffon\" : [ 255/255,250/255,205/255 ],\n \"lightblue\" : [ 173/255,216/255,230/255 ],\n \"lightcoral\" : [ 240/255,128/255,128/255 ],\n \"lightcyan\" : [ 224/255,255/255,255/255 ],\n \"lightgoldenrodyellow\" : [ 250/255,250/255,210/255 ],\n \"lightgray\" : [ 211/255,211/255,211/255 ],\n \"lightgreen\" : [ 144/255,238/255,144/255 ],\n \"lightgrey\" : [ 211/255,211/255,211/255 ],\n \"lightpink\" : [ 255/255,182/255,193/255 ],\n \"lightsalmon\" : [ 255/255,160/255,122/255 ],\n \"lightseagreen\" : [ 32/255,178/255,170/255 ],\n \"lightskyblue\" : [ 135/255,206/255,250/255 ],\n \"lightslategray\" : [ 119/255,136/255,153/255 ],\n \"lightslategrey\" : [ 119/255,136/255,153/255 ],\n \"lightsteelblue\" : [ 176/255,196/255,222/255 ],\n \"lightyellow\" : [ 255/255,255/255,224/255 ],\n \"lime\" : [ 0/255,255/255,0/255 ],\n \"limegreen\" : [ 50/255,205/255,50/255 ],\n \"linen\" : [ 250/255,240/255,230/255 ],\n \"magenta\" : [ 255/255,0/255,255/255 ],\n \"maroon\" : [ 128/255,0/255,0/255 ],\n \"mediumaquamarine\" : [ 102/255,205/255,170/255 ],\n \"mediumblue\" : [ 0/255,0/255,205/255 ],\n \"mediumorchid\" : [ 186/255,85/255,211/255 ],\n \"mediumpurple\" : [ 147/255,112/255,219/255 ],\n \"mediumseagreen\" : [ 60/255,179/255,113/255 ],\n \"mediumslateblue\" : [ 123/255,104/255,238/255 ],\n \"mediumspringgreen\" : [ 0/255,250/255,154/255 ],\n \"mediumturquoise\" : [ 72/255,209/255,204/255 ],\n \"mediumvioletred\" : [ 199/255,21/255,133/255 ],\n \"midnightblue\" : [ 25/255,25/255,112/255 ],\n \"mintcream\" : [ 245/255,255/255,250/255 ],\n \"mistyrose\" : [ 255/255,228/255,225/255 ],\n \"moccasin\" : [ 255/255,228/255,181/255 ],\n \"navajowhite\" : [ 255/255,222/255,173/255 ],\n \"navy\" : [ 0/255,0/255,128/255 ],\n \"oldlace\" : [ 253/255,245/255,230/255 ],\n \"olive\" : [ 128/255,128/255,0/255 ],\n \"olivedrab\" : [ 107/255,142/255,35/255 ],\n \"orange\" : [ 255/255,165/255,0/255 ],\n \"orangered\" : [ 255/255,69/255,0/255 ],\n \"orchid\" : [ 218/255,112/255,214/255 ],\n \"palegoldenrod\" : [ 238/255,232/255,170/255 ],\n \"palegreen\" : [ 152/255,251/255,152/255 ],\n \"paleturquoise\" : [ 175/255,238/255,238/255 ],\n \"palevioletred\" : [ 219/255,112/255,147/255 ],\n \"papayawhip\" : [ 255/255,239/255,213/255 ],\n \"peachpuff\" : [ 255/255,218/255,185/255 ],\n \"peru\" : [ 205/255,133/255,63/255 ],\n \"pink\" : [ 255/255,192/255,203/255 ],\n \"plum\" : [ 221/255,160/255,221/255 ],\n \"powderblue\" : [ 176/255,224/255,230/255 ],\n \"purple\" : [ 128/255,0/255,128/255 ],\n \"red\" : [ 255/255,0/255,0/255 ],\n \"rosybrown\" : [ 188/255,143/255,143/255 ],\n \"royalblue\" : [ 65/255,105/255,225/255 ],\n \"saddlebrown\" : [ 139/255,69/255,19/255 ],\n \"salmon\" : [ 250/255,128/255,114/255 ],\n \"sandybrown\" : [ 244/255,164/255,96/255 ],\n \"seagreen\" : [ 46/255,139/255,87/255 ],\n \"seashell\" : [ 255/255,245/255,238/255 ],\n \"sienna\" : [ 160/255,82/255,45/255 ],\n \"silver\" : [ 192/255,192/255,192/255 ],\n \"skyblue\" : [ 135/255,206/255,235/255 ],\n \"slateblue\" : [ 106/255,90/255,205/255 ],\n \"slategray\" : [ 112/255,128/255,144/255 ],\n \"slategrey\" : [ 112/255,128/255,144/255 ],\n \"snow\" : [ 255/255,250/255,250/255 ],\n \"springgreen\" : [ 0/255,255/255,127/255 ],\n \"steelblue\" : [ 70/255,130/255,180/255 ],\n \"tan\" : [ 210/255,180/255,140/255 ],\n \"teal\" : [ 0/255,128/255,128/255 ],\n \"thistle\" : [ 216/255,191/255,216/255 ],\n \"tomato\" : [ 255/255,99/255,71/255 ],\n \"turquoise\" : [ 64/255,224/255,208/255 ],\n \"violet\" : [ 238/255,130/255,238/255 ],\n \"wheat\" : [ 245/255,222/255,179/255 ],\n \"white\" : [ 255/255,255/255,255/255 ],\n \"whitesmoke\" : [ 245/255,245/255,245/255 ],\n \"yellow\" : [ 255/255,255/255,0/255 ],\n \"yellowgreen\" : [ 154/255,205/255,50/255 ] };\n\n var o, i = 1, a = arguments, c = a[0], alpha;\n\n if(a[0].length<4 && (a[i]*1-0)==a[i]) { alpha = a[i++]; } // first argument rgb (no a), and next one is numeric?\n if(a[i].length) { a = a[i], i = 0; } // next arg an array, make it our main array to walk through\n if(typeof c == 'string')\n c = map[c.toLowerCase()];\n if(alpha!==undefined)\n c = c.concat(alpha);\n for(o=a[i++]; i<a.length; i++) {\n o = o.union(a[i]);\n }\n return o.setColor(c);\n}", "function getIconColor(id) {\n var colorToUse;\n colorToUse = treeHighlightColorList[adjustColorIndex(markerColorIndex[id])];\n //console.log(\"getIconColor: id=\",id,\" markerColorIndex=\",markerColorIndex[id],\" treeColor=\",colorToUse)\n return colorToUse\n}", "nodeColor (d) {\n const color = scaleOrdinal()\n .domain(['reception', 'setting', 'attack'])\n .range(['#009688', '#8BC34A', '#FFC107'])\n\n if (d.value < 1) {\n d.color = '#bbb'\n } else {\n const category = d.name.replace(/ .*/, '').toLowerCase()\n d.color = color(category)\n }\n return d.color\n }", "function drawTrees(x, y, color) {\r\n crc2.fillStyle = \"#61380B\";\r\n crc2.fillRect(x - 5, y + 60, 15, 20);\r\n crc2.beginPath();\r\n crc2.moveTo(x, y);\r\n crc2.lineTo(x + 25, y + 40);\r\n crc2.lineTo(x - 25, y + 40);\r\n crc2.closePath();\r\n crc2.fillStyle = color;\r\n crc2.fill();\r\n crc2.beginPath();\r\n crc2.moveTo(x, y + 10);\r\n crc2.lineTo(x + 25, y + 60);\r\n crc2.lineTo(x - 25, y + 60);\r\n crc2.closePath();\r\n crc2.fillStyle = color;\r\n crc2.fill();\r\n }", "function drawTrunk(){\n centerTree();\n penRGB(142,41,12,0.75);\n penDown();\n penWidth(10);\n moveForward(15);\n turnLeft(180);\n moveForward(30);\n drawLeaves();\n penUp();\n}", "function getNodeColor(nodeName) {\n /* case for whole letter grade nodes */\n if (letrs.has(nodeName))\n return sankeyColor(nodeName);\n /* case for + and - grade nodes */\n if (letrs.has(nodeName[0]))\n return getShadePlusMinus(sankeyColor(nodeName[0]), nodeName[1]);\n /* case for number grade nodes */\n return getShadeNumber(sankeyColor(gradeScale(nodeName)), nodeName);\n }", "function getColor(me) {\n\t\tlet label = getLabel(me);\n\t\tif (label == -1) return d3.lab(\"#000\");\n\t\tlet metaid = +me.parentNode.parentNode.getAttribute(\"metacluster\");\n\t\tlet col = d3.lab(color10[metaid % 10]);\n\t\tlet n = +me.parentNode.getAttribute(\"n\");\n\t\treturn col.darker(0.2 * n);\n\t}", "function addColor(treeDataArr, green, lightGreen, yellow, orange) {\n const totalTime = treeDataArr[0].renderTime;\n const workToBeDone = [treeDataArr[0]];\n while (workToBeDone.length > 0) {\n const percentTime = workToBeDone[0].individualTime / totalTime;\n if (percentTime < green) {\n workToBeDone[0].nodeSvgShape = { shape: 'ellipse', shapeProps: { rx: 20, ry: 20, fill: '#80b74c' } };\n } else if (percentTime < lightGreen) {\n workToBeDone[0].nodeSvgShape = { shape: 'ellipse', shapeProps: { rx: 20, ry: 20, fill: '#a1c94f' } };\n } else if (percentTime < yellow) {\n workToBeDone[0].nodeSvgShape = { shape: 'ellipse', shapeProps: { rx: 20, ry: 20, fill: '#e6cc38' } };\n } else if (percentTime < orange) {\n workToBeDone[0].nodeSvgShape = { shape: 'ellipse', shapeProps: { rx: 20, ry: 20, fill: '#f69d27' } };\n } else {\n workToBeDone[0].nodeSvgShape = { shape: 'ellipse', shapeProps: { rx: 20, ry: 20, fill: '#e74e2c' } };\n }\n for (let i = 0; i < workToBeDone[0].children.length; i += 1) {\n workToBeDone.push(workToBeDone[0].children[i]);\n }\n workToBeDone.shift();\n }\n return treeDataArr;\n }", "function getLabelColors () {\n return SidewalkColorScheme();\n}", "function initColorOfTagIcon() {\r\n $('.side .tag .label:odd').removeClass('teal').addClass('purple');\r\n}", "function color(d) {\n return d._children ? \"#3182bd\" : d.children ? \"#c6dbef\" : \"#fd8d3c\";\n }", "function avlTree() {\n \n}", "function getNodeColor(nodeName) {\n /* case for whole letter grade nodes */\n if (letrs.has(nodeName))\n return sankeyColor(nodeName);\n /* case for + and - grade nodes */\n if (letrs.has(nodeName[0]))\n return getShadePlusMinus(sankeyColor(nodeName[0]), nodeName[1]);\n /* case for number grade nodes */\n return getShadeNumber(sankeyColor(gradeScale(nodeName)), nodeName);\n}", "function highlight_nodes(nodes, on) {\n nodes.forEach(function(n) {\n d3.select('#node-' + n.replace(/\\s/g, '')).style('fill', function(d) {\n return on ? '#FF0000' : color(d.data.group);\n \n });\n\n });\n}", "function SetTreeState(tree) {\n\n // If the tree is on the border,\n if (IsOnBorder(tree)) {\n\n // Set the tree's state to burnt\n tree.style.backgroundColor = \"black\";\n\n } // end if\n\n // Otherwise, if the tree is not on the border\n else {\n\n // Indicate the current tree is non-burning\n tree.style.backgroundColor = \"green\";\n\n } // end else\n\n /* Make a copy of the tree's state, because when we advance the\n model, we don't want to update a tree's state until its neighbors have had\n a chance to check it. */\n tree.setAttribute(\"data-nextBackground\", tree.style.backgroundColor);\n\n} // end function SetTreeState(tree)", "DrawTree()\n {\n\n }", "function rainbow(my) {\n entities.forEach(function(element) {\n if (element.rainbow) {\n (element.color >= 17) ? element.color = 0 : element.color++\n //(element.children.color >= 17) ? element.children.color = 0 : element.children.color++\n } \n element.rainbowTime -= 1\n if (element.rainbowTime <= 0) {\n element.rainbow = false\n element.color = (room.gamemode === 'tdm') ? [10, 11, 12, 15, 13][(-element.team) - 1] : 12\n }\n }\n )}", "function uvColor (index) {\n if (index > 0 && index < 3 ) {\n green (index)\n }\n else if (index > 3 && index < 5 ) {\n yellow (index)\n }\n else if (index > 3 && index < 5 ) {\n yellow (index)\n }\n else if (index > 5 && index < 8 ) {\n orange (index)\n }\n else if (index > 8 && index < 11 ) {\n red (index)\n }\n else if (index > 11) {\n violet (index)\n }\n $(`#uvIndex2`).html(`\n <span> ${ index }</span>\n `) \n }", "function Advance() {\n\n // Loop over all tree columns, excluding the borders\n for (var x = 1; x < TREE_COUNT_X - 1; x++) {\n\n // Loop over all tree rows, excluding the borders\n for (var y = 1; y < TREE_COUNT_Y - 1; y++) {\n\n // Create a variable to store the current tree\n var tree = document.getElementById(x + \"-\" + y);\n\n // Swap in the tree's next state for its current state\n tree.style.backgroundColor = tree.getAttribute(\"data-nextBackground\");\n\n } // end for (var y)\n\n } // end for (var x)\n\n} // end function Advance()", "function color(d) {\r\n\t\t\t\t\t\t\tif (d.loadDynamic)\r\n\t\t\t\t\t\t\t\treturn \"#3182bd\";\r\n\r\n\t\t\t\t\t\t\tif (d._children)\r\n\t\t\t\t\t\t\t\treturn \"#3182bd\";\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\treturn d.color;\r\n\t\t\t\t\t\t}", "function setColor(depth){\n if (depth > 90){\n return \"#F51313\"\n } else if (depth <= 90 && depth > 70){\n return \"#F56713\"\n } else if (depth <= 70 && depth > 50){\n return \"#F59C13\"\n } else if (depth <= 50 && depth > 30){\n return \"#F5C413\"\n } else if (depth <= 30 && depth > 10){\n return \"#D2F513\"\n } else {\n return \"#83F513\"\n }\n}", "function getColor(depth){\n if(depth <= 10){\n return \"#17ff0a\"\n\n } else if(depth >10 && depth <= 30){\n return \"#5cb60a\"\n } else if(depth >30 && depth <= 50){\n return \"#f4bd09\"\n }else if(depth >50 && depth <= 70){\n return \"#f46f0c\"\n }else if(depth >70 && depth <= 90){\n return \"#ff4702\"\n }\n else{\n return \"#f90909\"\n }\n }", "function getColor(node) {\n if (node.x === 0) {\n var r = node.node * 22 % 255 - 30;\n var g = node.node * 24% 255 - 20;\n var b = node.node * 39 % 255 - 10;\n return d3.rgb(r, g, b);\n } else {\n return d3.rgb(0, 0, 0);\n }\n}", "function setColors (n, c) {\n if(n.strokeWidth=='1') { // adding time, cs, dv, nom to a node with no stroke\n n.strokeWidth = '4';\n n.strokeColor = c;\n n.nodeCol = taggedColor;\n if(dvColor==c) {\n // check if array, if not, make it an array\n // console.log(Object.prototype.toString.call(zparams.zdv));\n zparams.zdv = Object.prototype.toString.call(zparams.zdv) == \"[object Array]\" ? zparams.zdv : [];\n zparams.zdv.push(n.name);\n }\n else if(csColor==c) {\n zparams.zcross = Object.prototype.toString.call(zparams.zcross) == \"[object Array]\" ? zparams.zcross : [];\n zparams.zcross.push(n.name);\n }\n else if(timeColor==c) {\n zparams.ztime = Object.prototype.toString.call(zparams.ztime) == \"[object Array]\" ? zparams.ztime : [];\n zparams.ztime.push(n.name);\n }\n else if(nomColor==c) {\n zparams.znom = Object.prototype.toString.call(zparams.znom) == \"[object Array]\" ? zparams.znom : [];\n zparams.znom.push(n.name);\n }\n \n d3.select(\"#tab1\").select(\"p#\".concat(n.name))\n .style('background-color', hexToRgba(c));\n }\n else if (n.strokeWidth=='4') {\n if(c==n.strokeColor) { // deselecting time, cs, dv, nom\n n.strokeWidth = '1';\n n.strokeColor = selVarColor;\n n.nodeCol=colors(n.id);\n d3.select(\"#tab1\").select(\"p#\".concat(n.name))\n .style('background-color', hexToRgba(selVarColor));\n \n if(dvColor==c) {\n var dvIndex = zparams.zdv.indexOf(n.name);\n if (dvIndex > -1) { zparams.zdv.splice(dvIndex, 1); }\n }\n else if(csColor==c) {\n var csIndex = zparams.zcross.indexOf(n.name);\n if (csIndex > -1) { zparams.zcross.splice(csIndex, 1); }\n }\n else if(timeColor==c) {\n var timeIndex = zparams.ztime.indexOf(n.name);\n if (timeIndex > -1) { zparams.ztime.splice(timeIndex, 1); }\n }\n else if(nomColor==c) {\n var nomIndex = zparams.znom.indexOf(n.name);\n if (nomIndex > -1) { zparams.znom.splice(nomIndex, 1); }\n }\n }\n else { // deselecting time, cs, dv, nom AND changing it to time, cs, dv, nom\n if(dvColor==n.strokeColor) {\n var dvIndex = zparams.zdv.indexOf(n.name);\n if (dvIndex > -1) { zparams.zdv.splice(dvIndex, 1); }\n }\n else if(csColor==n.strokeColor) {\n var csIndex = zparams.zcross.indexOf(n.name);\n if (csIndex > -1) { zparams.zcross.splice(csIndex, 1); }\n }\n else if(timeColor==n.strokeColor) {\n var timeIndex = zparams.ztime.indexOf(n.name);\n if (timeIndex > -1) { zparams.ztime.splice(timeIndex, 1); }\n }\n else if(nomColor==n.strokeColor) {\n var nomIndex = zparams.znom.indexOf(n.name);\n if (nomIndex > -1) { zparams.znom.splice(nomIndex, 1); }\n }\n n.strokeColor = c;\n d3.select(\"#tab1\").select(\"p#\".concat(n.name))\n .style('background-color', hexToRgba(c));\n \n if(dvColor==c) {zparams.zdv.push(n.name);}\n else if(csColor==c) {zparams.zcross.push(n.name);}\n else if(timeColor==c) {zparams.ztime.push(n.name);}\n else if(nomColor==c) {zparams.znom.push(n.name);}\n }\n }\n}", "function highlightFolders() {\n var folder = unsafeWindow.treedata;\n $('#view span').each(\n function(index) {\n var id = $( this ). attr (\"id\");\n if (id. indexOf ( \"sp\" ) > 0 ) {\n\tvar fNum = id.substring(0, id.length-2);\n\tif (!! folder[fNum]) {\n\t var obj = folder[fNum][\"child\"];\n\t var hasData = \"\";\n\t for (var i = 0 ; i < obj.length ; ++i ) {\n\t if ( obj[i][0]. indexOf ( \"span\" ) > 0 ) {\n\t hasData = \"1\";\n\t break;\n\t }\n\t }\n\t if ( !! hasData ) {\n\t $( this ). html ( \"<span class=bldtxt>\" + $( this ). text() + \"</span>\");\n\t }\n\t}\n\n }\n }\n );\n\n}", "function depth_color(depth) {\n if (depth >90)\n return \"rgb(196, 10, 10)\";\n else if (depth > 70)\n return \" rgb(226, 77, 8)\";\n else if (depth > 50)\n return \"rgb(245, 118, 0)\";\n else if (depth > 30) \n return \"rgb(236, 177, 12)\";\n else if (depth > 10)\n return \"rgb(180, 228, 5)\";\n else \n return \"rgb(7, 224, 18)\";\n}", "function cambiacolor(precio){\n let fila=precio.parentNode;\n if(fila.className==\"RedAndWhite\"){\n fila.className=\"BlueAndYellow\";\n } else if(fila.className==\"BlueAndYellow\"){\n fila.className=\"\";\n }\n else{\n fila.className=\"RedAndWhite\";\n }\n}", "get nodeColor()\n\t{\n\t\tif (this._nodeColor == null)\n\t\t\treturn this.tree.theme.nodeColor;\n\n\t\treturn this._nodeColor;\n\t}", "function colors() {\n \n\tmap.getLayer('countylayer').style('fill', function(data) {\n\t\tvar ddi = parseFloat(data.ddi);\n\t\tif (ddi <= 38.12357875) { //1st quartile\n\t\t\treturn \"#fef0d9\";\n\t\t} else if (ddi <= 50.8602104) {\n\t\t\treturn \"#fdcc8a\";\n\t\t} else if (ddi <= 64.03133336 ) {\n\t\t\treturn \"#fc8d59\";\n\t\t} else { //4th quartile\n\t\t\treturn \"#d7301f\";\n\t\t}\n\t});\n}", "function chooseColor(depth) {\n var color_value;\n if (depth > 20) {\n color_value = \"darkred\"\n }\n else if (depth <= 20 && depth > 8) {\n color_value = \"yellow\"\n }\n else if (depth < 4) {\n color_value = \"green\"\n }\n return color_value;\n }", "function fillNeighborhoodNodes(nodeIndex, color){// Fill neighborhood \n\t\tlet v = d3.select('#node' + nodeIndex)\n\t\tlet neighborhood = v.attr('neighborhood').split(',')\n\t\tif(neighborhood.length)\n\t\t\tneighborhood.map(function(neighborLabel){\n\t\t\t\tlet node = d3.select('#' + neighborLabel)\n\t\t\t\tif(!node.attr('clique-part'))\n\t\t\t\t\tnode.attr('fill', color)\n\t\t\t\tshowNodeLabelText(neighborLabel)\n\t\t\t})\n\t}", "function color(d) {\n return d._children ? '#3182bd' : d.children ? '#c6dbef' : '#fd8d3c';\n}", "function get_color(i, v, n) {\n var color_list = [\n d3.rgb(0, 0, 0), //black\n d3.rgb(230, 159, 0), // orange\n d3.rgb(86, 180, 233), // sky blue\n d3.rgb(0, 158, 115), // bluish green\n d3.rgb(240, 228, 66), // yellow\n d3.rgb(0, 114, 178), // blue\n d3.rgb(213, 94, 0), // vermilion\n d3.rgb(204, 121, 167) // reddish purple\n ];\n if (v === (false || null)) {\n return '#eeeeee';\n }\n var c = color_list[(i + 8) % 8],\n m = 3,\n r = (255 - (255 - c.r) / m - c.r) * (n - v) / n + c.r,\n g = (255 - (255 - c.g) / m - c.g) * (n - v) / n + c.g,\n b = (255 - (255 - c.b) / m - c.b) * (n - v) / n + c.b\n ;\n return d3.rgb(r, g, b);\n }", "function randTree() {\n var tree = {};\n var pxrange;\n\n // ## Generate\n // height\n var heightMin = 8;\n var heightMax = 300;\n tree.height = Math.floor(Math.random()*heightMax+heightMin);\n\n // width\n var widthMin = 4;\n var widthMax = 120;\n tree.width = Math.floor(Math.random()*widthMax+widthMin);\n\n // number of branches\n var branchesMin = 0;\n var branchesMax = 5;\n tree.branches = Math.floor(Math.random()*branchesMax+branchesMin);\n\n // number of leaves\n var leavesMin = 0;\n var leavesMax = (tree.branches * 3) + 3;\n tree.leaves = Math.floor(Math.random()*leavesMax+leavesMin);\n\n // leaf color\n var colorLeaf = ['green', 'yellow', 'red'];\n tree.colorLeaf = colorLeaf[Math.floor(Math.random()*colorLeaf.length)];\n\n // branch color\n var colorBranch = ['brown','grey'];\n tree.colorBranch = colorBranch[Math.floor(Math.random()*colorBranch.length)];\n\n // smaller trees\n tree.img = 'tree' + Math.floor(Math.random()*9+1);\n\n return tree;\n\n}", "function circleColour(d){\n if(d.type ==\"member\"){ //node type\n return \"#ff8c69\";\n } else {\n return \"#8aded8\";\n }\n}", "function nodestring(name, folder, id, level, path, bot_id, top, open) {\n \tvar temp = '';\n \tfor (var i = level - 1; i >= 0; i--) {\n \t\ttemp += '<span class=\"indent\"></span>';\n \t};\n \tif ((folder && top) || (folder && open)) {\n \t\ttemp += '<span class=\"icon glyphicon\"></span><span class=\"icon node-icon glyphicon glyphicon-folder-open\"></span>';\n \t} else if (folder) {\n \t\ttemp += '<span class=\"icon glyphicon\"></span><span class=\"icon node-icon glyphicon glyphicon-folder-close\"></span>';\n \t}\n \tif (top) {\n \t\treturn '<span id=\"tree' + (id + bot_id) + '\" data-path=\"' + path + '\"><li class=\"list-group-item node-tree\" style=\"color:undefined;background-color:undefined;\" onclick=upFold(\"' + path + '\")><span class=\"glyphicon glyphicon-level-up\" aria-hidden=\"true\"></span>..</li><li class=\"list-group-item node-tree\" style=\"color:undefined;background-color:undefined;\" onclick=openFold(\"tree' + (id + bot_id) + '\",\"' + name + '\",\"' + folder + '\",\"' + path + '\",\"' + level + '\")>' + temp + name + '</li></span>';\n \t} else if (!open && folder) {\n \t\treturn '<span id=\"tree' + (id + bot_id) + '\" data-path=\"' + path + '\"><li class=\"list-group-item node-tree\" style=\"color:undefined;background-color:undefined;\" onclick=openFold(\"tree' + (id + bot_id) + '\",\"' + name + '\",\"' + folder + '\",\"' + path + '\",\"' + level + '\")>' + temp + name + '</li></span>';\n \t} else if (open && folder) {\n \t\treturn '<span id=\"tree' + (id + bot_id) + '\" data-path=\"' + path + '\"><li class=\"list-group-item node-tree\" style=\"color:undefined;background-color:undefined;\" onclick=closeFold(\"tree' + id + '\",\"tree' + bot_id + '\",\"' + name + '\",\"' + path + '\",\"' + level + '\")>' + temp + name + '</li></span>';\n \t} else {\n \t\treturn '<span id=\"tree' + (id + bot_id) + '\" data-path=\"' + path + '\"><li class=\"list-group-item node-tree\" style=\"color:undefined;background-color:undefined;\" onclick=openFile(\"tree' + (id + bot_id) + '\",\"' + name + '\",\"' + folder + '\",\"' + path + '\",\"' + level + '\")>' + temp + name + '</li></span>';\n \t}\n }", "function colorMarker (depth) {\n if (depth > 90 ) {\n return \"#3AB341\"\n }\n if (depth > 70) {\n return \"#00eede\"\n }\n if (depth > 50) {\n return \"#0073ee\"\n }\n if (depth > 30) {\n return \"#ee9c00\"\n }\n if (depth > 10) {\n return \"#d600ee\"\n }\n else {\n return \"#ea782c\"\n }\n}", "function treeDisplay(tree) {\n var h = tree.tall;\n for (var i = 0; i < tree.tall; i++) {\n var whitespace = (h - 1) - i;\n var num = 2 * i + 1;\n\n console.log(\" \".repeat(whitespace) + tree.char.repeat(num));\n }\n}", "function Themes_PreProcessTreeView(theObject)\n{\n\tswitch (theObject.InterfaceLook)\n\t{\n\t\tdefault:\n\t\t\tif (String_IsNullOrWhiteSpaceOrAuto(theObject.Properties[__NEMESIS_PROPERTY_CLIENTEDGE]))\n\t\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_CLIENTEDGE] = \"Yes\";\n\t\t\tif (String_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_DEFAULT]))\n\t\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_DEFAULT] = \"White\";\n\t\t\tbreak;\n\t\tcase __NEMESIS_LOOK_SAP_ENJOY:\n\t\tcase __NEMESIS_LOOK_SAP_TRADESHOW:\n\t\tcase __NEMESIS_LOOK_SAP_SIGNATURE_CORBU:\n\t\tcase __NEMESIS_LOOK_SAP_SIGNATURE_DESIGN:\n\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_TVHASHLINES] = \"No\";\n\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_CLIENTEDGE] = \"No\";\n\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_BORDER] = \"\";\n\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_BORDER_LEFT] = \"solid,<SAPCLR:48>,1px\";\n\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_BORDER_TOP] = theObject.Properties[__NEMESIS_PROPERTY_BORDER_LEFT];\n\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_BORDER_RIGHT] = \"solid,<SAPCLR:61>,1px\";\n\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_BORDER_BOTTOM] = theObject.Properties[__NEMESIS_PROPERTY_BORDER_RIGHT];\n\t\t\tif (String_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_SELECTED]))\n\t\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_SELECTED] = \"#ffcc33\";\n\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_VERTICAL_SCROLL_BAR] = \"Yes\";\n\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_HORIZONTAL_SCROLL_BAR] = \"Yes\";\n\t\t\tbreak;\n\t\tcase __NEMESIS_LOOK_SAP_CORBUS:\n\t\tcase __NEMESIS_LOOK_SAP_BLUE_CRYSTAL:\n\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_TVHASHLINES] = \"No\";\n\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_CLIENTEDGE] = \"No\";\n\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_BORDER] = \"solid,#A3A3A3,1px\";\n\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_DEFAULT] = \"<SAPCLR:51>\";\n\t\t\tif (String_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_SELECTED]))\n\t\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_SELECTED] = \"<SAPCLR:52>\";\n\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_VERTICAL_SCROLL_BAR] = \"Yes\";\n\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_HORIZONTAL_SCROLL_BAR] = \"Yes\";\n\t\t\tbreak;\n\t\tcase __NEMESIS_LOOK_SAP_BELIZE:\n\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_TVHASHLINES] = \"No\";\n\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_CLIENTEDGE] = \"No\";\n\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_BORDER] = \"solid,<SAPCLR:51>,1px\";\n\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_DEFAULT] = \"<SAPCLR:03>\";\n\t\t\tif (String_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_SELECTED]))\n\t\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_SELECTED] = \"<SAPCLR:52>\";\n\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_VERTICAL_SCROLL_BAR] = \"Yes\";\n\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_HORIZONTAL_SCROLL_BAR] = \"Yes\";\n\t\t\tbreak;\n\t}\n}", "function getColor(depth) {\n switch (true) {\n case depth > 90:\n return \"red\";\n case depth > 70:\n return \"brown\";\n case depth > 50:\n return \"orange\";\n case depth > 30:\n return \"yellow\";\n case depth > 10:\n return \"lime\";\n default:\n return \"green\";\n }\n }", "function color(d) {\n return d._children ? '#3182bd' : d.children ? '#c6dbef' : d.color;\n}", "initTrails( array ){\r\n let index = 0;\r\n let h = colorMax / ( this.var.m + 0.5 );\r\n //parent branches\r\n for( let i = this.var.n; i < this.var.l; i++ ){\r\n let first = this.var.l - 1;\r\n let second = i;\r\n let hue = h * ( i - this.var.n );\r\n this.createTrail( first, second, hue );\r\n\r\n //child branches\r\n for( let j = 0; j < array[i - this.var.n]; j++ ){\r\n first = index + j;\r\n hue = h * ( i - this.var.n ) + h / ( array[i - this.var.n] + 1 ) * ( j + 1 );\r\n this.createTrail( first, second, hue );\r\n }\r\n index += array[i - this.var.n];\r\n }\r\n }", "function tree (event) {\n \tfor (var i = 1; i <= height.value; i++) {\n console.log(\" \".repeat(height.value - i) + (char.value.repeat(i)) + (char.value.repeat(i - 1)) + \" \".repeat(height.value - i));\n\t}\n}", "function getColor(depth) {\n if (depth > 90) {\n color = \"#EB411A\";\n }\n else if (depth > 70) {\n color = \"#EB631A\";\n }\n else if (depth > 50) {\n color = \"#EB8F1A\";\n }\n else if (depth > 30) {\n color = \"#EBA954\";\n }\n else if (depth > 10) {\n color = \"#EBE554\";\n }\n else {\n color = \"#88E445\";\n }\n return color\n}", "highlight() {\n const filteredTiles = this._filterForHigher();\n if (!filteredTiles || !filteredTiles.length) {\n this._error(`No islands found buying for ${this.minimumBells} and above.`);\n return;\n }\n\n filteredTiles.forEach((tag) => {\n const parent = tag.parentElement.parentElement.parentElement;\n\n if (parent) {\n const queueInfo = this._getQueueInfo(parent);\n const islandName = this._getIslandName(parent);\n parent.setAttribute('style', 'background-color: #011B8E;');\n this._info(`Island: ${islandName} | Buying for: ${tag.innerText} | Queue information: ${queueInfo}.`);\n } \n \n tag.setAttribute('style', 'background-color: yellow; color: black;');\n });\n }", "function fillNode(group) {\n if (group < 0) {\n return \"#d62728\"; // deep pastel red\n } else {\n return nodePalette(group);\n }\n}", "set nodeColor(value)\n\t{\n\t\tthis._nodeColor = value;\n\t}", "function readCodeHighlightIcon(routine, step){\r\n let elipseColor = \"#006060\";\r\n\r\n readCodeEllipseStack[routine][step].background = elipseColor;\r\n\r\n\r\n\r\n}", "function updateKeyColor(element){\n for(node in element.parentNode.childnodes){\n element.style.backgroundColor = \"\"\n }\n element.style.backgroundColor = \"lightblue\"\n}", "function nodeColorIn(d){\n\treturn chooseColor(d.flowInto);\n}", "function setGUIColors(){\n\tdpost(\"setGUIColors()\\n\");\n\tif(myNodeInit){\n\t\tvar workingcolor = myNodeColorOn;\n\t\tif(myNodeEnable == 0)\n\t\t\tworkingcolor = myNodeColorOff;\n \n \tif(vpl_nodeCanvas.understands(\"bgfillcolor\")){\n \t//post(\"bgfillcolor\\n\");\n \tvpl_nodeCanvas.message(\"bgfillcolor\", workingcolor[0], workingcolor[1], workingcolor[2], workingcolor[3]);\n \t}\n \tif(vpl_nodeCanvas.understands(\"bgcolor\")){\n \t//post(\"bgcolor\\n\");\n \tvpl_nodeCanvas.message(\"bgcolor\", workingcolor[0], workingcolor[1], workingcolor[2], workingcolor[3]);\n \t}\n\n\t\tif(vpl_nodeEnable != null){\n\t\t//\tvpl_nodeEnable.message(\"bordercolor\", workingcolor[0], workingcolor[1], workingcolor[2], workingcolor[3]- 0.05 );\n\t\t}\n\n\t\t// setting the title bar\n\t\tworkingcolor = (myNodeSelected == 1)? myNodeColorSelected:myNodeColorUnSelected;\n\t\tif(vpl_titleBar != null){\n\t\t\tvpl_titleBar.message(\"bgcolor\", workingcolor);\n\t\t}\n\t}\n}", "function populateNodesNextToEntry(nodeArray){\n for (var i=0; i<nodeArray.length; i++){\n if (nodeArray[i].visited == true){ \n if (nodeArray[i].distance == 1){ \n //IN TESTING\n nodeArray[i].backgroundcolor = nodeArray[i].backgroundcolor[nodeArray[i].distance];\n //nodeArray[i].backgroundcolor = Maze.getBackgroundColor(nodeArray[i].distance);\n document.getElementById(nodeArray[i].id).style.backgroundColor = nodeArray[i].backgroundcolor;\n }\n }\n }\n return nodeArray; \n}", "updateNodeStyles()\n {\n for (let i in redSandRegistry.menus)\n {\n let menu = redSandRegistry.menus[i];\n if (!menu.items) continue;\n \n let item = this.menuContainsLink(menu, window.location.hash);\n if (item === undefined) continue;\n // Select new node\n simpleUtils.getDOMElement(item.DOMid).className = item.selectedClassName;\n // Deselect last node\n if ((menu.lastSelectedNode !== undefined)\n && (menu.lastSelectedNode !== item)) {\n simpleUtils.getDOMElement(menu.lastSelectedNode.DOMid).className\n \t= menu.lastSelectedNode.deselectedClassName;\n }\n // Register new node as lastly selected\n menu.lastSelectedNode = item;\n }\n }", "removalFix(tree){\n let node = this;\n while(node.color === Black && node.parent){\n let sibling = node.getSibling();\n if(sibling.color === Red){\n sibling.rotate(tree);\n sibling = node.getSibling();\n }\n if(\n (!sibling.left || sibling.left.color === Black) &&\n (!sibling.right || sibling.right.color === Black)\n ){\n sibling.color = Red;\n node = node.parent;\n }else{\n if(sibling === sibling.parent.left && (\n !sibling.left || sibling.left.color === Black\n )){\n sibling = sibling.rotateLeft(tree);\n }else if(sibling === sibling.parent.right && (\n !sibling.right || sibling.right.color === Black\n )){\n sibling = sibling.rotateRight(tree);\n }\n sibling.rotate(tree);\n node = node.parent.getSibling();\n }\n }\n node.color = Black;\n }", "function FBXTree() { }", "function TreePainterData(tree, contextPath, arr_imageRes) {\n\tthis.tree = tree; // The tree data\n\tthis.contextPath = contextPath; // Needed for SSL problem IE\n\tthis.arr_imageRes = arr_imageRes;\t // array including all the images to paint the tabset\n\tthis.DIV_PREVIX = 'tree_'; // Prefix for DIV-Tag which embedds the tree\n\n\t// StyleSheet\n\tthis.CSS_TABLE\t = 'tc'; // TreeControl\n\tthis.CSS_ROW_EVEN = 'tleven'; // odd row\n\tthis.CSS_ROW_ODD = 'tlodd'; // even row\n\tthis.CSS_TOL = 'tol'; // outline\n\tthis.CSS_TI = 'ti' // tree item\n\tthis.CSS_TIS = 'tis' // tree item selected\n\n\n\tif (null != tree) {\n\t\tthis.IMG_ICON_CHECKED = arr_imageRes[CHECKBOX_INVALID];\n\t\tthis.IMG_ICON_CHECKED0 = arr_imageRes[CHECKBOX_UNCHECKED];\n\t\tthis.IMG_ICON_CHECKED1 = arr_imageRes[CHECKBOX_CHECKED];\n\t\tthis.IMG_ICON_CHECKED2 = arr_imageRes[CHECKBOX_INDETERMINATE];\n\n\t\tthis.IMG_FOLDER_OPEN = arr_imageRes[TREE_FOLDEROPEN];\n\t\tthis.IMG_FOLDER_CLOSED = arr_imageRes[TREE_FOLDERCLOSED];\n\t\tthis.IMG_NODE = arr_imageRes[TREE_ITEM];\n\t\t\t\n\t\tthis.LINE0 = arr_imageRes[TREE_STRUCTURE];\n\t\tthis.LINE10 = arr_imageRes[TREE_STRUCTURE_10];\n\t\tthis.LINE12 = arr_imageRes[TREE_STRUCTURE_12];\n\t\tthis.LINE14 = arr_imageRes[TREE_STRUCTURE_14];\n\t\tthis.LINE16 = arr_imageRes[TREE_STRUCTURE_16];\n\t\tthis.LINE18 = arr_imageRes[TREE_STRUCTURE_18];\n\t\tthis.LINE2 = arr_imageRes[TREE_STRUCTURE_2];\n\t\tthis.LINE26 = arr_imageRes[TREE_STRUCTURE_26];\n\t\tthis.LINE30 = arr_imageRes[TREE_STRUCTURE_30];\n\t\tthis.LINE32 = arr_imageRes[TREE_STRUCTURE_32];\n\t\tthis.LINE34 = arr_imageRes[TREE_STRUCTURE_34];\n\t\tthis.LINE42 = arr_imageRes[TREE_STRUCTURE_42];\n\t\tthis.LINE46 = arr_imageRes[TREE_STRUCTURE_46];\n\t}\n}", "function getShadeNumber(baseColor, name) {\n color = d3.hsv(baseColor.h, baseColor.s, baseColor.v);\n\n //special case for 100\n if (name == \"100\") {\n color.s += 0.5;\n return color;\n }\n\n n = parseInt(name[1]); //examine the 1's column of the node name to determine shade\n\n // special case for F\n if (isNaN(n))\n return color;\n\n color.s += 0.08 * (n - 5);\n\n return color;\n }", "function drawTrees()\n{\n for(var i = 0; i < trees_x.length; i++)\n {\n \n fill(102, 51, 0)\n rect(trees_x[i].x_pos - 10, 347, 20, 85);\n \n fill(0,255,0)\n triangle(trees_x[i].x_pos, 280, trees_x [i].x_pos - 29, 369, trees_x [i].x_pos + 29, 369);\n }\n}", "function crnImg(iImg,lImg) {\nif (document.layers) {\ndocument.layers[iImg].document.layers[lImg].bgColor='#42658C';\n}\n}", "function tree (a_items, a_template) {\n this.n_tid = trees.length;\n trees[this.n_tid] = this;\n \n this.a_tpl = a_template;\n this.a_config = a_items;\n this.o_root = this;\n this.a_index = [];\n this.a_selected = [];\n this.a_deleted = [];\n this.b_selected = false;\n this.n_depth = -1;\n this.select_all = select_all;\n this.select_none= select_none;\n this.upstatus = function() {};//nothing\n this.o_parent = null;\n this.a_custom_menus = [];\n this.a_custom_menu_ids = [];\n this.n_items = 0;\n this.b_cache_children = true;\n this.get_item = function(id) { return this.a_index[id]; };\n this.item_count = function() { return this.n_items; };\n this.get_first_item = get_first_item;\n this.get_next_item = get_next_item;\n this.deleteAllChildren = deleteAllChildren;\n this.action = null;\n this.border = null;\n this.a_columns= null;\n this.a_columnWidths = null;\n this.add_tree_column = add_tree_column;\n this.timeoutId = 0; \n\n var o_icone = new Image();\n var o_iconl = new Image();\n o_icone.src = a_template['icon_e'];\n o_iconl.src = a_template['icon_l'];\n a_template['im_e'] = o_icone;\n a_template['im_l'] = o_iconl;\n\n for (var i = 0; i < 64; i++)\n if (a_template['icon_' + i]) \n {\n var o_icon = new Image();\n a_template['im_' + i] = o_icon;\n o_icon.src = a_template['icon_' + i];\n }\n \n this.expand = item_expand;\n this.toggle = toggle;\n this.select = function (n_id, e, treeid) { return this.get_item(n_id).select(e, treeid); };\n this.mover = mouse_over_item;\n this.mout = mouse_left_item;\n this.oncontextmenu = function (n_id, e, treeid) { return this.get_item(n_id).oncontextmenu(e, treeid) };\n this.show_context_menu = show_context_menu;\n this.handle_command = handle_command;\n this.on_sel_changed = null;\n this.on_expanding = null;\n this.on_context_menu= null;\n this.on_command = null;\n \n this.get_custom_menu = function(menu_name) {\n var index = this.a_custom_menu_ids[menu_name];\n return (index != undefined) ? this.a_custom_menus[index] : null;\n }\n this.add_custom_menu = function(menu_name, a_menu) { \n if (!this.get_custom_menu(menu_name))\n {\n var index = this.a_custom_menus.length;\n this.a_custom_menus[index] = a_menu;\n this.a_custom_menu_ids[menu_name] = index;\n }\n return index;\n }\n \n this.a_children = [];\n for (var i = 0; i < a_items.length; i++)\n new tree_item(this, i, this.a_config[i + (this.n_depth + 1 ? 2 : 0)]);\n\n var n_children = this.a_children.length;\n if (n_children) {\n var div = document.getElementById('tree_' + this.n_tid);\n var a_html = [];\n for (var i=0; i<n_children; i++) {\n var child = this.a_children[i];\n a_html[i] = child.init();\n child.expand();\n }\n div.innerHTML = a_html.join('');\n }\n}", "simplifyNode(node) {\n\t\tvar whiteBlackCounter = 0;\n\n\t\tfor (let i = 0; i < node.kids.length; i++) {\n\t\t\tif (node.kids[i].color == Octree.GRAY)\n\t\t\t\tthis.simplifyNode(node.kids[i]);\n\t\t\telse if (node.kids[i].color == Octree.WHITE)\n\t\t\t\twhiteBlackCounter--;\n\t\t\telse // Octree.BLACK\n\t\t\t\twhiteBlackCounter++;\n\t\t}\n\n\t\tif (whiteBlackCounter == -Octree.EIGHT) // all white\n\t\t{\n\t\t\tnode.color = Octree.WHITE;\n\t\t\tnode.kids = [];\n\t\t} else if (whiteBlackCounter == Octree.EIGHT) // all black\n\t\t{\n\t\t\tnode.color = Octree.BLACK;\n\t\t\tnode.kids = [];\n\t\t}\n\t}", "function tree (treeDet) {\n for (var i = 0; i < treeDet.height; i++) {\n console.log(' '.repeat((treeDet.height-1)-i) + treeDet.char.repeat(2*i + 1) + '\\n');\n }\n}", "function colorGroupTags( __parent )\n{\n var refLayer = new RegExp( /_REF_/gim );\n\n for ( var i = 0; i < __parent.layers.length; i++ )\n {\n var currentLayer = __parent.layers[ i ];\n var visible = currentLayer.visible;\n\n if ( !currentLayer.name.match( refLayer ) )\n {\n if ( currentLayer.typename == \"ArtLayer\" )\n {\n currentLayer.name = \"LYR_\" + i; // + \"_\" + currentLayer.blendMode;\n }\n else\n {\n \t\t\tdoc.activeLayer = currentLayer;\n \t\t\tsetLabelColor( idColors[ lastColor ] );\n \t\t\tlastColor = (lastColor + 1) % idColors.length;\n \t\t\tcurrentLayer.name = \"GRP_\" + groupNum;\n groupNum++;\n\n colorGroupTags( currentLayer );\n }\n }\n\n currentLayer.visible = visible;\n }\n}", "function adjustIconColorDocument() {\n $('.oi-icon').each(function(e) {\n if(!$(this).hasClass('colored')) {\n $(this).css('fill', '#3E2F24');\n $(this).addClass('colored');\n }\n });\n }", "function createUvLevel(uvIndex){\n if (uvIndex >= 11){\n $(\".uvLevel\").text(\"EXTREME\").css(\"background-color\",\"#B705B7\");\n }else if (uvIndex >= 8){\n $(\".uvLevel\").text(\"VERY HIGH\").css(\"background-color\",\"#F80101\");\n }else if (uvIndex >= 6 ){\n $(\".uvLevel\").text(\"HIGH\").css(\"background-color\",\"#FC840C\");\n }else if (uvIndex >= 3 ){\n $(\".uvLevel\").text(\"MODERATE\").css(\"background-color\",\"#FCFC0C\");\n }else{\n $(\".uvLevel\").text(\"LOW\").css(\"background-color\",\"#108810\");\n }\n }", "function colorPath(d) {\n // Make all grey\n let g = d3.select('.sun')\n g.selectAll('#grey').style('fill', 'grey')\n\n // Depending on the depth, make all child red\n if (d.depth == 3){\n document.querySelector(\"#sunpath\").innerHTML =\n `${d.parent.parent.data.name} -->\n ${d.parent.data.name}\n --> ${d.data.name}`\n document.querySelector(`.${d.parent.parent.data.name.replace(/ /g,\".\")}`).style = \"fill: red;\"\n document.querySelector(`.${d.parent.data.name.replace(/ /g,\".\")}`).style = \"fill: red;\"\n document.querySelector(`.${d.data.name.replace(/ /g,\".\")}`).style = \"fill: red;\"\n }\n else if (d.depth == 2){\n document.querySelector(\"#sunpath\").innerHTML =\n `${d.parent.data.name}\n --> ${d.data.name}`\n document.querySelector(`.${d.parent.data.name.replace(/ /g,\".\")}`).style = \"fill: red;\"\n document.querySelector(`.${d.data.name.replace(/ /g,\".\")}`).style = \"fill: red;\"\n }\n else if (d.depth == 1){\n document.querySelector(\"#sunpath\").innerHTML =\n `${d.data.name}`\n document.querySelector(`.${d.data.name.replace(/ /g,\".\")}`).style = \"fill: red;\"\n }\n}", "styleNeutre() {\n return {\n weight: 0.5,\n color: '#222',\n fillOpacity: 0 \n }\n }", "dfs_color(u, p) {\n if (this.color[u] == 2) {\n return;\n }\n ;\n if (this.color[u] == 1) {\n this.cycleNum += 1;\n let current = p;\n this.mark[current] = this.cycleNum;\n while (current != u) {\n current = this.parent[current];\n this.mark[current] = this.cycleNum;\n }\n return;\n }\n ;\n this.parent[u] = p;\n this.color[u] = 1;\n for (let item of this.adjacencyList[u]) {\n this.visited.push({\n 'u': u,\n 'p': p,\n 'v': item,\n 'parent[u]': this.parent[u],\n 'cycleNum': this.cycleNum\n });\n // console.log(`u: ${u}, p: ${p}, v: ${item}, parent[u]:${this.parent[u]}, cycleNum: ${this.cycleNum}, color[u]: ${this.color[u]}`);\n if (item == this.parent[u]) {\n continue;\n }\n this.dfs_color(item, u);\n }\n this.color[u] = 2;\n }", "function getShadeNumber(baseColor, name) {\n color = d3.hsv(baseColor.h, baseColor.s, baseColor.v);\n\n //special case for 100\n if (name == \"100\") {\n color.s += 0.5;\n return color;\n }\n\n n = parseInt(name[1]); //examine the 1's column of the node name to determine shade\n\n // special case for F\n if (isNaN(n))\n return color;\n\n color.s += 0.08 * (n - 5);\n\n return color;\n}", "function drawTree(){\n drawLeaves();\n drawTrunk();\n penUp();\n}", "function segColor(c){ \n return selectedColorObj[c]; \n }", "function getcolor(c) {\n if(c == \"naranja\") return '#FCAF00'; else\n if (c == \"tradicional\") return '#3FDAD6';\n\tif (c == \"aliado\") return '#FE52D4';\n }" ]
[ "0.6946722", "0.6577069", "0.6361758", "0.6277365", "0.6266196", "0.62410915", "0.6092731", "0.6043756", "0.59976643", "0.5976792", "0.59511584", "0.5934329", "0.5933131", "0.59271365", "0.5926198", "0.5875297", "0.58534205", "0.58452004", "0.5839276", "0.58094513", "0.58094513", "0.57882875", "0.5777279", "0.5753003", "0.5690483", "0.5661875", "0.5653856", "0.5617018", "0.56035817", "0.5602613", "0.5601657", "0.5591", "0.5585467", "0.55627507", "0.5562498", "0.5561469", "0.5559472", "0.5542793", "0.55241734", "0.552377", "0.5512449", "0.5510764", "0.5506152", "0.5490902", "0.54904574", "0.5466707", "0.5463422", "0.54487073", "0.5438388", "0.54310167", "0.5429982", "0.54299134", "0.54264903", "0.5426181", "0.5424189", "0.5409803", "0.5409076", "0.5403918", "0.5402486", "0.5395007", "0.53927153", "0.53894794", "0.5387574", "0.5380764", "0.53769207", "0.5376139", "0.53737795", "0.53720796", "0.5368893", "0.5364486", "0.53621495", "0.5350154", "0.5349186", "0.534529", "0.53344923", "0.5333459", "0.53329587", "0.5326905", "0.5324452", "0.5298999", "0.5296169", "0.5296013", "0.52954376", "0.52779365", "0.5276474", "0.5276473", "0.5271344", "0.5271305", "0.5264626", "0.52620053", "0.52587533", "0.5256712", "0.5247568", "0.5242615", "0.5240308", "0.5239205", "0.5238378", "0.52372426", "0.52327675", "0.5232482", "0.52322227" ]
0.0
-1
draw your cirlce with the changing colors
function draw() { circle(250, 250, 450); strokeWeight(3); text("Click me to change color!", 100, 200, 350, 300); textSize(28); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rainbowColor() {\n updatePenMode(\"random\");\n}", "function changeColorFaded() {\n\n temp = 330;\n cont1 = 0;\n cont2 = 125;\n cont3 = 254;\n\n function cycler(cont) {\n if(cont >= 255) \n op = 'decr';\n else\n op = 'incr';\n\n switch(op) {\n case 'decr':\n cont--;\n break;\n case 'incr':\n cont++;\n break;\n }\n return cont;\n }\n\n var r = cycler(cont1);\n var g = cycler(cont2);\n var b = cycler(cont3);\n // Costruisco un colore RGB utilizzando i 3 numeri creati sopra \n \n colore_rgb = \"rgb(\" + r + \",\" + g + \", \" + b + \")\";\n \n // Applico il colore al tag span id->letterN\n letterN.style.color = colore_rgb;\n }", "function colormatch(){\n\n\nreminder = Math.abs(change % (2*Math.PI));\n\nif (reminder > 0 && reminder < quarter) obcolor= (by-b > 0)? paint[1]: paint[3];\nelse if (reminder > quarter && reminder < quarter*2) obcolor= (by-b > 0)? paint[2]: paint[0];\nelse if (reminder > quarter*2 && reminder < quarter*3 ) obcolor= (by-b > 0)? paint[3]: paint[1];\nelse if (reminder > quarter*3 && reminder < quarter*4) obcolor= (by-b > 0)? paint[0]: paint[2];\n\nif (bcolor == obcolor) return 0;\nelse return 1;\n}", "function draw() { \n for (var i = 0; i < cols; i++) {\n for (var j = 0; j < rows; j++) {\n\n var x = i * 30;\n var y = j * 30;\n ctx.rect(x, y, 30, 30);\n }\n //tab[i][j] = calculateAndApplyColor(i,j);\n ctx.stroke();\n ctx.strokeStyle = \"lightgrey\";\n }\n console.log('carré dessiné');\n }", "function drawRainbow(e) {\n let R;\n let G;\n let B;\n let rgbExtract = extractRGB(e);\n if (e.target.style.backgroundColor === \"\") {\n e.target.style.backgroundColor = `rgb(${Math.round(Math.random()*255)},${Math.round(Math.random()*255)},${Math.round(Math.random()*255)})`;\n } else {\n //darkens divs that have already have color\n R = rgbExtract[0];\n G = rgbExtract[1];\n B = rgbExtract[2];\n e.target.style.backgroundColor = `rgb(${R*.7},${G*.7},${B*.7})`\n }\n \n}", "draw() {\n s.globalCompositeOperation = \"lighter\";\n s.lineWidth = 2;\n s.strokeStyle = `hsla(${this.hue}, 100%, 50%, ${this.a})`;\n s.strokeRect(\n this.x - this.size / 2,\n this.y - this.size / 2,\n this.size,\n this.size\n );\n this.update();\n }", "draw(){\n fill(this.color);\n if(this.winner){\n if(this.winner_toggle % 3 == 0){\n fill('YELLOW');\n }\n this.winner_toggle += 1;\n }\n stroke(this.color);\n rect(this.r*CELL_SIZE, this.c*CELL_SIZE, \n CELL_SIZE, CELL_SIZE);\n }", "function clrs(i, j) {\n clr_list = [\n [0, 0, 0],\n [255, 255, 255],\n [204, 82, 82],\n [204, 163, 82],\n [163, 204, 82],\n [82, 204, 82],\n [82, 204, 163],\n [82, 163, 204],\n [82, 82, 204],\n [163, 82, 204],\n [204, 82, 163],\n [204, 82, 82]\n ];\n var tmp = clr_list[i];\n var foo = d3.rgb(tmp[0], tmp[1], tmp[2])\n return d3.rgb(tmp[0], tmp[1], tmp[2]).darker(2.5).brighter(j * 5);\n}", "draw() {\n ctx.beginPath();\n ctx.arc(this.x, this.y, this.radius, 0, Math.PI * 2, true);\n if (this.state == 1) {\n ctx.fillStyle = 'purple';\n } else if (this.state == 2) {\n ctx.fillStyle = 'red';\n } else if (this.state == 3) {\n ctx.fillStyle = 'green';\n } else if (this.state == 4) {\n ctx.fillStyle = 'white';\n }\n ctx.fill();\n }", "function rainbow(ctx) {\n\tvar roygbiv = [\"#FF0000\", \"#FFA500\", \"#FFFF00\", \"#008000\", \"#0000FF\", \"#4B0082\", \"#EE82EE\"];\n\tfor (var c=0 ; c<roygbiv.length ; ++c) {\n\t\tctx.lineWidth = 0.1;\n\t\tctx.strokeStyle = roygbiv[c];\n\t\tctx.beginPath();\n\t\tctx.bezierCurveTo(-0.6, 0, 0, -0.5, 0.6, 0);\n\t\tctx.stroke();\n\t\tctx.translate(0.0, 0.1);\n\t}\n}", "function drawColorCycle() {\r\n\r\n\t// Set color cycling on or off:\r\n\tif (document.form.cycle[0].checked) {\r\n\t\tcolorCycle = true;\r\n\t\tdocument.form.direction[0].disabled = false;\r\n\t\tdocument.form.direction[1].disabled = false;\t\r\n\t}\r\n\telse if (document.form.cycle[1].checked) {\r\n\t\tcolorCycle = false;\r\n\t\tdocument.form.direction[0].disabled = true;\r\n\t\tdocument.form.direction[1].disabled = true;\t\t\r\n\t}\r\n\t\r\n\t// Set color cycling in or out\r\n\tif (document.form.direction[0].checked) {\r\n\t\tcolorCycleIn = true;\r\n\t}\r\n\telse if (document.form.direction[1].checked) {\r\n\t\tcolorCycleIn = false;\r\n\t}\r\n\t\r\n\tif (colorCycle) {\r\n\t\r\n\t\tvar imageData = image.data; // detach the pixel array from DOM\r\n\r\n\t\t// iterate trhough all pixels\r\n\t\tfor (var x = 0; x < CANVAS_WIDTH; x++) {\r\n\t\t\tfor (var y = 0; y < CANVAS_HEIGHT; y++) {\r\n\t\t\t\r\n\t\t\t\tvar i = y * CANVAS_WIDTH + x;\t\t// index of the pixel in imageData array\r\n\r\n\r\n\t\t\t\t// if the pixel is outside of the set, cycle its color by colorStep\r\n\t\t\t\tif (\"rgb(\" + imageData[4*i+0] + \", \" + imageData[4*i+1] + \", \" + imageData[4*i+2] + \")\" != \"rgb(0, 0, 0)\") {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (colorCycleIn == false) { \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// cyan to blue:\r\n\t\t\t\t\t\tif (imageData[4*i+0] == 0 && imageData[4*i+1] > 0 && imageData[4*i+2] == 255) {\r\n\t\t\t\t\t\t\timageData[4*i+1] -= colorStep;\r\n\t\t\t\t\t\t\tif (imageData[4*i+1] < 0){\r\n\t\t\t\t\t\t\t\talert(\"green is < 0\");\r\n\t\t\t\t\t\t\t\timageData[4*i+1] = 0;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// blue to magenta:\r\n\t\t\t\t\t\telse if (imageData[4*i+0] < 255 && imageData[4*i+1] == 0 && imageData[4*i+2] == 255) {\r\n\t\t\t\t\t\t\timageData[4*i+0] += colorStep;\r\n\t\t\t\t\t\t\tif (imageData[4*i+0] > 255) {\r\n\t\t\t\t\t\t\t\timageData[4*i+0] = 255;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// magenta to red:\r\n\t\t\t\t\t\telse if (imageData[4*i+0] == 255 && imageData[4*i+1] == 0 && imageData[4*i+2] > 0) {\r\n\t\t\t\t\t\t\timageData[4*i+2] -= colorStep;\r\n\t\t\t\t\t\t\tif (imageData[4*i+2] < 0) \r\n\t\t\t\t\t\t\t\timageData[4*i+2] = 0;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// red to yellow:\r\n\t\t\t\t\t\telse if (imageData[4*i+0] == 255 && imageData[4*i+1] < 255 && imageData[4*i+2] == 0) {\r\n\t\t\t\t\t\t\timageData[4*i+1] += colorStep;\r\n\t\t\t\t\t\t\tif (imageData[4*i+1] > 255) \r\n\t\t\t\t\t\t\t\timageData[4*i+1] = 255;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// yellow to green:\r\n\t\t\t\t\t\telse if (imageData[4*i+0] > 0 && imageData[4*i+1] == 255 && imageData[4*i+2] == 0) {\r\n\t\t\t\t\t\t\timageData[4*i+0] -= colorStep;\r\n\t\t\t\t\t\t\tif (imageData[4*i+0] < 0) \r\n\t\t\t\t\t\t\t\timageData[4*i+0] = 0;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// green to cyan:\r\n\t\t\t\t\t\telse if (imageData[4*i+0] == 0 && imageData[4*i+1] == 255 && imageData[4*i+2] < 255) {\r\n\t\t\t\t\t\t\timageData[4*i+2] += colorStep;\r\n\t\t\t\t\t\t\tif (imageData[4*i+2] > 255) \r\n\t\t\t\t\t\t\t\timageData[4*i+2] = 255;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\timageData[4*i+3] = 255; // Alpha value\r\n\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\r\n\t\t\t\t\telse { // color cycle in\r\n\r\n\t\t\t\t\t\t// cyan to green:\r\n\t\t\t\t\t\tif (imageData[i*4+0] == 0 && imageData[4*i+1] == 255 && imageData[i*4+2] > 0) {\r\n\t\t\t\t\t\t\timageData[i*4+2] -= colorStep;\r\n\t\t\t\t\t\t\tif (imageData[i*4+2] < 0)\r\n\t\t\t\t\t\t\t\timageData[i*4+2] = 0;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// green to yellow:\r\n\t\t\t\t\t\telse if (imageData[i*4+0] < 255 && imageData[4*i+1] == 255 && imageData[i*4+2] == 0) {\r\n\t\t\t\t\t\t\timageData[i*4+0] += colorStep;\r\n\t\t\t\t\t\t\tif (imageData[i*4+0] > 255) \r\n\t\t\t\t\t\t\t\timageData[i*4+0] = 255;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// yellow to red:\r\n\t\t\t\t\t\telse if (imageData[i*4+0] == 255 && imageData[4*i+1] > 0 && imageData[i*4+2] == 0) {\r\n\t\t\t\t\t\t\timageData[4*i+1] -= colorStep;\r\n\t\t\t\t\t\t\tif (imageData[4*i+1] < 0) \r\n\t\t\t\t\t\t\t\timageData[4*i+1] = 0;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// red to magenta:\r\n\t\t\t\t\t\telse if (imageData[i*4+0] == 255 && imageData[4*i+1] == 0 && imageData[i*4+2] < 255) {\r\n\t\t\t\t\t\t\timageData[i*4+2] += colorStep;\r\n\t\t\t\t\t\t\tif (imageData[i*4+2] > 255) \r\n\t\t\t\t\t\t\t\timageData[i*4+2] = 255;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// magenta to blue:\r\n\t\t\t\t\t\telse if (imageData[i*4+0] > 0 && imageData[4*i+1] == 0 && imageData[i*4+2] == 255) {\r\n\t\t\t\t\t\t\timageData[i*4+0] -= colorStep;\r\n\t\t\t\t\t\t\tif (imageData[i*4+0] < 0) \r\n\t\t\t\t\t\t\t\timageData[i*4+0] = 0;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// blue to cyan:\r\n\t\t\t\t\t\telse if (imageData[4*i+0] == 0 && imageData[4*i+1] < 255 && imageData[i*4+2] == 255) {\r\n\t\t\t\t\t\t\timageData[4*i+1] += colorStep;\r\n\t\t\t\t\t\t\tif (imageData[4*i+1] > 255) \r\n\t\t\t\t\t\t\t\timageData[4*i+1] = 255;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\timageData[4*i+3] = 255; // Alpha value\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\t\t\r\n\t\timage.data = imageData; // attach image data object back to DOM \r\n\t\tcontext.putImageData(image, 0, 0);\r\n\r\n\t}\r\n\t\r\n}", "function drawRed(x,y, height) {\n // makes it so that there are different color\n const color = {\n red: 247,\n green: 138,\n blue: 138,\n }\n\n const factor = Math.ceil(height/80)\n // varies the size of the corals\n const numOfBranches = 3\n const thickness = getRandomInt(factor) + factor\n var angle = -70\n\n for (let i = 0; i < numOfBranches; i++) {\n angle = angle+35\n draw(x,y, 5*thickness, angle, thickness, thickness, true, color)\n\n }\n\n console.log('AH')\n\n //inputs: startX, startY, len, angle, branchThickness color\n }", "function nextDraw() {\n ctx.clearRect(0,0,maxWidth * RATIO_MULT,maxHeight * RATIO_MULT);\n ctx.fillStyle = \"black\";\n ctx.fillRect(0,0,maxWidth * RATIO_MULT,maxHeight * RATIO_MULT);\n nextColor();\n for (var x = 0; x < grid.length; x++) {\n for (var y = 0; y < grid[x].length; y++) {\n if (grid[x][y][1] == 1) {\n if (grid[x][y][0] == 1) {\n ctx.fillStyle = colorToString();\n ctx.fillRect(x * RATIO_MULT*dotSize,y * RATIO_MULT*dotSize,dotSize * RATIO_MULT,dotSize * RATIO_MULT);\n }\n else if (grid[x][y][0] == 0) {\n ctx.fillStyle = \"#000\";\n ctx.fillRect(x * RATIO_MULT*dotSize,y * RATIO_MULT*dotSize,dotSize * RATIO_MULT,dotSize * RATIO_MULT);\n ctx.fillStyle = lightFill;\n }\n grid[x][y][1] = 0;\n }\n }\n }\n}", "function reColor() {\n\t//_ console.log('reColor()')\n\tfor (let index = 1; index <= nGavs; index++) { \n\t\tswitch (mESQ[index][0][1]) {\n\t\tcase 'A':\n\t\t\tcLinPR = cLinPRa \n\t\t\tcLinRX = cLinRXa\n\t\t\tcLinPN = cLinPNa\n\t\t\tpatPn\t =\tpatPna\n\t\t\tbreak;\n\t\tcase 'B':\n\t\t\tcLinPR = cLinPRb \n\t\t\tcLinRX = cLinRXb\n\t\t\tcLinPN = cLinPNb\n\t\t\tpatPn\t =\tpatPnb\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tcLinPR = cLinPR0 \n\t\t\tcLinRX = cLinRX0\n\t\t\tcLinPN = cLinPN0\n\t\t\tpatPn\t =\tpatPn0\n\t\t\tbreak;\n\t\t}\n\t\tvar gIDtmp = 'G' + pad(index)\n\t\t//*\tCOLORIR RECHAÇO\n\t\ttry { drawSQMA.select('#' + 'linRx0_' + gIDtmp).attr({ stroke: cLinRX }) } catch (error) {}\n\t\ttry { drawSQMA.select('#' + 'linRx1_' + gIDtmp).attr({ stroke: cLinRX }) } catch (error) {}\n\t\ttry { drawSQMA.select('#' + 'arwRx_' + gIDtmp).attr({ fill : cLinRX }) } catch (error) {}\n\t\t//*\tCOLORIR PENEIRADO\n\t\ttry { drawSQMA.select('#' + 'linPn1_' + gIDtmp).attr({ stroke: cLinPN }) } catch (error) {}\n\t\ttry { drawSQMA.select('#' + 'linPn2_' + gIDtmp).attr({ stroke: cLinPN }) } catch (error) {}\n\t\ttry { drawSQMA.select('#' + 'linPr1_' + gIDtmp).attr({ stroke: cLinPN }) } catch (error) {}\n\t\ttry { drawSQMA.select('#' + 'linPr2_' + gIDtmp).attr({ stroke: cLinPN }) } catch (error) {}\n\t\ttry { drawSQMA.select('#' + 'arwPn1_' + gIDtmp).attr({ fill : cLinPN }) } catch (error) {}\n\t\ttry { drawSQMA.select('#' + 'arwPn2_' + gIDtmp).attr({ fill : cLinPN }) } catch (error) {}\n\t\ttry { drawSQMA.select('#' + 'PnD1_' \t + gIDtmp).attr({ fill : patPn }) } catch (error) {}\n\t\ttry { drawSQMA.select('#' + 'PnD2_' \t + gIDtmp).attr({ fill : patPn }) } catch (error) {}\n\t\t//*\tCOLORIR CPoints\n\t\ttry { drawSQMA.select('#' + 'CP_Rx_' + gIDtmp).attr({ fill: cLinRX }) } catch (error) {}\n\t\ttry { drawSQMA.select('#' + 'CP_Pn1_' + gIDtmp).attr({ fill: cLinPN }) } catch (error) {}\n\t\ttry { drawSQMA.select('#' + 'CP_Pn2_' + gIDtmp).attr({ fill: cLinPN }) } catch (error) {}\n\t}\n\n\trecolorBTM()\n}", "selectColor(x, y, wd, ht){\n this.colorSec = this.colorPromedio(x, y, wd, ht);\n if (this.colorG){\n let tempG = this.colorSec.reduce((a, b) => a+b);\n this.colorSec = this.colorSec.map(t => tempG/3);\n }\n this.ctx.fillStyle = 'rgb('+this.colorSec[0]+\n ','+ this.colorSec[1]+\n ','+ this.colorSec[2]+')';\n }", "cls(c) {\n const context = this.cr.renderer;\n if (c === undefined) {\n // clear screen\n context.clearRect(0, 0, this.cr.canvas.width, this.cr.canvas.height);\n }\n else {\n // evaluate runtime errors\n this.colorRangeError(c);\n // draw the selected color on screen\n context.fillStyle = this.palette[c];\n context.fillRect(0, 0, this.cr.canvas.width, this.cr.canvas.height);\n }\n // update ticks\n this.passedTicks += 1;\n }", "function drawCirc(){\n for(y = 0; y < shapePosY.length; y++){\n for(i = 0; i < shapePosX.length; i++){\n noStroke();\n fill(colors.reverse()[i]);\n circle(shapePosX[i], shapePosY[y], 20);\n }\n }\n}", "draw() {\n ctx.fillStyle = \"red\";\n ctx.beginPath();\n ctx.arc(this.x, this.y, this.r, 0, Math.PI *2);\n ctx.fill();\n }", "dibuja() {\n\n var color;\n if (this.estado == 1) {\n color = colorV;\n } else {\n color = colorM;\n }\n\n ctx.fillStyle = color;\n ctx.fillRect(this.x * tileX, this.y * tileY, tileX, tileY);\n }", "function colorMe(now, event) {\n\tif(event.which != 1 && !now) {\n\t\treturn\n\t}\n\n\t// Draw the square\n\tevent.target.classList.replace(event.target.classList[1], document.querySelector(\"div.current-brush\").classList[1]);\n\n\tlet currentCoord = getCoords(event.target.id);\n\tif(lastCoord.length == 0) {\n\t\tlastCoord = currentCoord;\n\t}\n\n\tif(!disableLines && (Math.abs(lastCoord[0] - currentCoord[0]) > 1 || Math.abs(lastCoord[1] - currentCoord[1]) > 1)) {\n\t\t// Jumping occurred. Let's draw a line between the 2 points.\n\t\tconsole.log(\"Jump of \" + distance(currentCoord, lastCoord).toFixed(2) + \" squares occurred.\");\n\t\tlet line = calcLine(lastCoord[0], lastCoord[1], currentCoord[0], currentCoord[1]);\n\t\tline.shift();\n\n\t\tfor(coord of line) {\n\t\t\tsquare = document.getElementById(\"sq\" + getNum(coord));\n\t\t\tsquare.classList.replace(square.classList[1], document.querySelector(\"div.current-brush\").classList[1]);\n\t\t}\n\t}\n\n\tlastCoord = currentCoord;\n}", "function colores(color){\r\n\tif(color===\"rojo\"){\r\n\t\treturn \tfill(255, 0, 0);\r\n\t}\r\n\telse if(color === \"azul\"){\r\n\t\treturn \tfill(0, 0, 255);\r\n\t}else if(color===\"verde\"){\r\n\t\treturn \tfill(0, 255, 0);\r\n\t}\r\n\telse if(color===\"morado\"){\r\n\t\treturn \tfill(90, 25, 100);\r\n\t}\r\n}", "display(){\n if(this.lives != 0){\n var newcolor = \"#\";\n var x;\n for(var i=1;i<7;i++){\n x = parseInt(this.color[i],16)\n x += 2;\n if(x>15)\n x = 15;\n newcolor += x.toString(16);\n }\n var ctx = this.gameboard.disp.getContext(\"2d\");\n ctx.beginPath();\n ctx.fillStyle = newcolor;\n ctx.fillRect(this.posx, this.posy, this.sizex, this.sizey);\n ctx.stroke();\n ctx.closePath();\n ctx = this.gameboard.disp.getContext(\"2d\");\n ctx.beginPath();\n ctx.fillStyle = this.color;\n ctx.fillRect(this.posx + this.sizex/10, this.posy + this.sizey/10,this.sizex/10*8,this.sizey/10*8);\n ctx.stroke();\n ctx.closePath();\n }\n }", "function draw(c) {\n\n var points = c.getPoints(72);\n points.push(points[0]);\n\n //ctx.strokeStyle = colors[getRandomRound(0, colors.length)];\n //ctx.lineWidth = getRandomRound(0, 3)+1;\n ctx.lineWidth = 2;\n ctx.beginPath();\n for(var j = 0; j < points.length; j++) {\n ctx.lineTo(points[j].x, points[j].y);\n }\n ctx.stroke();\n\n}", "draw(){ \n ctx.beginPath();\n ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2, false)\n ctx.fillStyle = this.color\n ctx.fill();\n }", "draw(){\n ctx.beginPath();\n ctx.arc(this.x, this.y, this.size, 0, Math.PI*2, false);\n ctx.fillStyle = this.color;\n ctx.fill();\n }", "function dibujante(color, xinicial, yinicial, xfinal, yfinal)\n{\n lienzo.beginPath();\n lienzo.lineWidth = grosor;\n lienzo.strokeStyle = color;\n lienzo.moveTo(xinicial, yinicial);\n lienzo.lineTo(xfinal, yfinal);\n lienzo.stroke();\n lienzo.lineCap = \"round\";\n lienzo.closePath();\n}", "function drawColor(color) {\n //verifie ligne non complete\n if (currentPawnCombinaison == 4 ) {\n\tconsole.log(\"combinaison line over\");\n }\n else {\n\t//selectionne pion courant\n\tvar pawn = document.querySelectorAll(\"div.pion-\" + currentPawnCombinaison)[currentLine];\n\n\t//change style\n\tpawn.style.backgroundColor = color;\n\tpawn.style.border = 'none';\n\n\t// complete combinaison\n\tcombinaison += whichColor(color);\n\tcurrentPawnCombinaison++;\n\n\t// log les valeur de varaible\n\tconsole.log(currentPawnCombinaison);\n\tconsole.log(combinaison);\n }\n}", "draw() {\n\t\tnoStroke();\n\t\tfill('rgba(255,255,255,0.5)');\n\t\tcircle(this.pos.x, this.pos.y, this.size);\n\t}", "function draw(){\n background(0);\n col = document.getElementById(\"color_picker\");\n \n for(let i=0; i<myDots.length; i++){\n myDots[i].display();\n myDots[i].move();\n //Check if intersect center to reset color and size;\n if(myDots[i].intersects(myCenter)){\n myDots[i].color = myCenter.color;\n myDots[i].size = random(10, 50);\n }\n //Check if intersect other dot to reset colors\n if(rand === true){\n for(let j=0; j<myDots.length; j++){\n if(j != i){\n if(myDots[i].intersects(myDots[j])){\n myDots[i].color = color(random(255), random(255), random(255));\n myDots[j].color = color(random(255), random(255), random(255));\n }\n }\n }\n }\n }\n //Display myCenter and interact with mouse \n myCenter.display();\n if(mouseIsPressed && mouseY > 4){\n myCenter.colorChange();\n myCenter.pulse();\n }\n\n}", "draw() {\n // drawing curbs first\n const shades = ['#9ca297', '#b1bab0'];\n for (let i = 0; i < 2; i++) {\n ctx.fillStyle = shades[i];\n // curbs just big rects mildly translated so some shading\n if (i) {\n ctx.translate(0, 3.3);\n }\n ctx.fillRect(0, this.y - (this.linH / 3) * 1.5, init.w, inProptn(1, 7) + (this.linH / 3) * (3 - i * 1.5));\n }\n ctx.translate(0, -3.3);\n\n // road itself\n ctx.fillStyle = 'black';\n ctx.fillRect(0, this.y, init.w, inProptn(1, 7));\n\n this.markings();\n }", "renderPaints(ctx) {\n let { size } = this;\n _.each(this.paints, ({ start, end, color }) => {\n ctx.save();\n ctx.beginPath();\n let paintStart = rads(start - 90);\n let paintStop = rads(end - 90);\n ctx.arc(size / 2, size / 2, size / 2, paintStart, paintStop, false);\n ctx.lineWidth = 6;\n ctx.strokeStyle = color;\n ctx.stroke();\n ctx.restore();\n })\n }", "function draw() {\n \n\tvar red = 0; // Color value defined\n\tvar green = 1;\n\tvar blue = 2;\n\tvar alpha = 3;\n\n\tvar iter = 81;\n\n\tif(os){ // if oscillation is set true by oscillate(), then do oscilation of \n\t\t\t\t\t\t\t\t\t\t// julia set by using sin(angle) to set real c and cos(angle) to set imaginary c.\n\t\tcx =0.7885*cos(angle);\n\t\tcy =0.7785*sin(angle);\n\t\tangle+= 0.04;\n\t}\n\n\tvar zy = 0.0;\n\tvar zx = 0.0;\n\n loadPixels(); \n\n\n // Interate through the window demision. 'width' and 'hieght' are the with and height of our window\n for (var y = 0; y < height; y++) {\n\n for (var x = 0; x < width; x++) {\n\n\t zy = map(y, 0, height, min_i , max_i); // use map() to scale the range so it will be from \n\t\tzx = map(x, 0, width, minReal, maxReal); // minReal to maxReal and min_i to max_i\n\t\t\n\t\tif(!os && !clicked){ // if neither of 'os' or 'clicked' is true, cy and cx (real and imaginary c) will be the scale of zy and zx.\n\t\t\tcy = zy;\n\t\t\tcx = zx;\n\t\t}\n\t\t\n var counter= 0;\n\n\t\t// calculate the mandelbrot / julia set using:\n\t\t// mandelbrot: f(z) = z^2 + c where c is changing\n\t\t// julia: f(z) = z^2 + c where c is constant\n\t\twhile ((zx * zx + (zy * zy) < 16.0) && counter < iter) {\n\n\t\t\tvar zx_temp = zx * zx - zy * zy +cx\n\n\t\t\tzy = 2.0 * zx * zy+cy;\n\t\t\tzx = zx_temp;\n\n\t\t\t++counter;\n\t\t}\n\t\t\n\t var color = 255;\n\n\t\tif(counter !=iter){\n\t\t\tcolor = counter;\n\t\t}\n\n var pix = (x + y * width) * 4;\n\n pixels[pix + red] = sin(color)%255; // set pixels\n pixels[pix + green] = color;\n pixels[pix + blue] = color;\n\n pixels[pix+alpha] = 255;\n }\n }\n\n updatePixels(); \n}", "function draw() {\n background(255);\n\n //draw 25 black circles\n for(let x = 1; x < 26; x++) {\n\n //draw a blue square if the iterand is divisible by 3 AND 5\n if(x % 3 == 0 && x % 5 == 0) {\n fill('blue');\n square(x * 50, y, 25);\n } \n \n //draw a green square if the iterand is divisible by 5\n else if(x % 5 === 0) {\n fill('green');\n square(x * 50, y, 25)\n }\n\n //draw a purple circle if the iterand is divisible by 3\n else if(x % 3 === 0) {\n fill('purple');\n circle(x * 50, y, 25);\n }\n\n //Otherwise draw black circle\n else {\n fill('black');\n circle(x * 50, y, 25);\n }\n }\n}", "function update(r, g, b){\n\t\tif(r >= 0 && r <= 255) red = r;\n\t\tif(g >= 0 && g <= 255) green = g;\n\t\tif(b >= 0 && b <= 255) blue = b;\n\t\tstrip.write(buff, function(){\n\t\t}); //Write in Lovely Colors\n\t}", "function rotateColors(display) {\n var red = 0;\n var green = 0;\n var blue = 0;\n display.setColor(red, green, blue);\n setInterval(function() {\n blue += 64;\n if (blue > 255) {\n blue = 0;\n green += 64;\n if (green > 255) {\n green = 0;\n red += 64;\n if (red > 255) {\n red = 0;\n }\n }\n }\n display.setColor(red, green, blue);\n display.setCursor(0,0);\n //display.write('red=' + red + ' grn=' + green + ' ');\n display.setCursor(1,0);\n //display.write('blue=' + blue + ' '); // extra padding clears out previous text\n display.write('and cute');\n }, 1000);\n}", "function drawComponents() {\n\n for (var i = 0; i < 4; i++) {\n ctx.beginPath();\n ctx.arc(x[i], y[i], 90, start[i], end[i]);\n ctx.lineWidth = 50;\n ctx.strokeStyle = color[i];\n ctx.stroke();\n\n }\n}", "function draw(e) {\n e.target.style.backgroundColor = choosenColor();\n}", "function drawCanyon(t_canyon)\n{\n\n fill(153,27,0)\n rect(t_canyon.x_pos + 80, 430, t_canyon.width - 75,200)\n \n fill (102,178,255)\n rect(t_canyon.x_pos + 105,430, t_canyon.width - 35,200) \n \n fill(153,27,0)\n rect(t_canyon.x_pos + 150,430, t_canyon.width - 75,200) \n \n}", "circb(x0, y0, r, c) {\n // evaluate runtime errors\n this.colorRangeError(c);\n let x = 0;\n let y = r;\n let p = 3 - 2 * r;\n this.circbPixGroup(x0, y0, x, y, c);\n while (x < y) {\n x++;\n if (p < 0) {\n p = p + 4 * x + 6;\n }\n else {\n y--;\n p = p + 4 * (x - y) + 10;\n }\n this.circbPixGroup(x0, y0, x, y, c);\n }\n }", "function newRound() {\n //Animate color pattern for computer sequence\n\n playPattern();\n update();\n}", "function drawShades () {\n rgbShades.forEach((rgb, i) => {\n this.ctx.beginPath()\n\n const startAngle = ((fullCircle / rgbShades.length) * i) + quarterCircle\n const endAngle = ((fullCircle / rgbShades.length) * (i + 1)) + (1 / 2) * Math.PI\n\n this.ctx.arc(width / 2, height / 2, effectiveRadius, startAngle, endAngle)\n this.ctx.lineWidth = lineWidth // This is the width of the innerWheel.\n\n // Stroke style changes based on the shade:\n this.ctx.strokeStyle = `rgb(${rgb.r}, ${rgb.g}, ${rgb.b})`\n this.ctx.stroke()\n this.ctx.closePath()\n })\n }", "drawCircle(x,y,r){\n ctx.beginPath();\n ctx.arc(x,y,r,0,2*Math.PI);\n ctx.lineWidth = 1;\n ctx.strokeStyle = colourButton.selectedColour;\n ctx.stroke();\n }", "function drawCanvas(ctx){\r\n \r\n ctx.fillStyle = 'hsl('+ colorCount +',100%,50%)';\r\n // var random = Math.floor(Math.random() * 4);\r\n var grd = ctx.createLinearGradient(0,0,0,400);\r\n grd.addColorStop(0,'hsl('+ colorCount +',40%,70%)');\r\n grd.addColorStop(1,'hsl('+ colorCount2 +',40%,70%)');\r\n ctx.fillStyle = grd;\r\n ctx.rect(0,0, g_ctx.canvas.width, g_ctx.canvas.height);\r\n ctx.fill(); \r\n ctx.beginPath();\r\n colorCount += 0.5;\r\n colorCount2 += 0.5;\r\n}", "function pintarColor() {\n var color = document.getElementById(\"botonColor\");\n ctx.fillStyle = color.value;\n ctx.strokeStyle = color.value;\n }", "draw() {\n this.context.beginPath();\n this.context.arc(this.x, this.y, this.size, 0, 2 * Math.PI, false)\n this.context.fillStyle = this.color\n this.context.fill()\n this.context.stroke()\n }", "draw() {\n ctx.beginPath();\n ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2, false);\n ctx.fillStyle = this.color;\n ctx.fill();\n }", "constructor (color) {\n this.color = color\n this.shouldDraw = true\n }", "function draw() {\n background(\"#222831\");\n}", "function okBlink() {\n context.fillStyle = \"green\";\n context.fill();\n setTimeout(() => {\n context.fillStyle = \"black\";\n context.fill();\n }, 150);\n}", "draw() {\r\n // Kopf\r\n Aufgabe10.crc2.beginPath();\r\n Aufgabe10.crc2.arc(this.x + 30, this.y + 245, 4, 0, 2 * Math.PI);\r\n Aufgabe10.crc2.fillStyle = \"#fff7b5\";\r\n Aufgabe10.crc2.fill();\r\n // M�tze\r\n Aufgabe10.crc2.beginPath();\r\n Aufgabe10.crc2.arc(this.x + 30, this.y + 243, 4, 3, 2 * Math.PI);\r\n Aufgabe10.crc2.fillStyle = this.color;\r\n Aufgabe10.crc2.fill();\r\n Aufgabe10.crc2.beginPath();\r\n Aufgabe10.crc2.arc(this.x + 30, this.y + 238, 2, 0, 2 * Math.PI);\r\n Aufgabe10.crc2.fillStyle = this.color;\r\n Aufgabe10.crc2.fill();\r\n // K�rper\r\n Aufgabe10.crc2.beginPath();\r\n Aufgabe10.crc2.fillStyle = this.color;\r\n Aufgabe10.crc2.fillRect(this.x + 26, this.y + 252, 8, 20); // Anfang, H�he, Dicke, L�nge\r\n // Arm\r\n Aufgabe10.crc2.beginPath();\r\n Aufgabe10.crc2.moveTo(this.x + 47, this.y + 255);\r\n Aufgabe10.crc2.lineTo(this.x + 27, this.y + 255);\r\n Aufgabe10.crc2.strokeStyle = this.color;\r\n Aufgabe10.crc2.lineWidth = 4;\r\n Aufgabe10.crc2.stroke();\r\n Aufgabe10.crc2.closePath();\r\n // Kragen\r\n Aufgabe10.crc2.beginPath();\r\n Aufgabe10.crc2.arc(this.x + 30, this.y + 252, 5, 3, 2 * Math.PI); // x, y, Gr��e\r\n Aufgabe10.crc2.fillStyle = this.color;\r\n Aufgabe10.crc2.fill();\r\n // Schlitten\r\n Aufgabe10.crc2.beginPath();\r\n Aufgabe10.crc2.moveTo(this.x + 45, this.y + 266);\r\n Aufgabe10.crc2.lineTo(this.x + 70, this.y + 275);\r\n Aufgabe10.crc2.strokeStyle = \"#AE7F36\";\r\n Aufgabe10.crc2.lineWidth = 3;\r\n Aufgabe10.crc2.stroke();\r\n Aufgabe10.crc2.fill();\r\n Aufgabe10.crc2.closePath();\r\n Aufgabe10.crc2.beginPath();\r\n Aufgabe10.crc2.moveTo(this.x + 60, this.y + 235);\r\n Aufgabe10.crc2.lineTo(this.x + 45, this.y + 267);\r\n Aufgabe10.crc2.strokeStyle = \"#AE7F36\";\r\n Aufgabe10.crc2.lineWidth = 3;\r\n Aufgabe10.crc2.stroke();\r\n Aufgabe10.crc2.fill();\r\n Aufgabe10.crc2.closePath();\r\n }", "function draw(){\r\n current.forEach(index =>{\r\n squares[currentPosition + index].classList.add('tetromino')\r\n squares[currentPosition + index].style.backgroundColor= colors[random]\r\n })\r\n }", "function getNewColors() {\n circleBodyColor = getRandomColor();\n circleLineColor = getRandomColor();\n canvas.style.backgroundColor = getRandomColor();\n}", "draw() {\n\t\tnoStroke();\n\t\tfill(\"rgba(255, 255, 255, 0.1)\");\n\t\tcircle(this.pos.x, this.pos.y, this.size);\n\t}", "function criarCobra()\n{\n for(i=0; i < cobra.length; i++)\n {\n context.fillStyle = \"#5b9f02\";\n context.fillRect(cobra[i].x, cobra[i].y, box, box);\n }\n}", "function draw(canvas, ctx) {\n\t\n \n\n ctx.beginPath();\n ctx.fillStyle = \"rgba(0, 0, 0, 0.02)\";\n ctx.fillRect(-width, -height, 2*width, 2*height);\n\t\n //ctx.beginPath();\n //ctx.arc(Math.floor(width * Math.random()), Math.floor(height * Math.random()),10,Math.PI*2, false);\n \t//ctx.strokeStyle=\"white\";\n\n\n\n if (frameCount % wait === 0) {\n \n drawcycle(ctx,width/4, height/4,20*i,15,89,208,38,1-i%10/10); //89,208,38\n drawcycle(ctx,width*3/4, height/4,20*i,15,241,235,52,1-i%10/10);//241, 235, 52\n drawcycle(ctx,width/4, height*3/4,20*i,15,30,178,239,1-i%10/10);//30, 178, 239\n drawcycle(ctx,width*3/4, height*3/4,20*i,15,240,114,61,1-i%10/10);//240, 114, 61 \n i+=1;\n\n if(i==20){\n i=1;\n ctx.fillStyle = \"black\";\n ctx.fillRect(-width, -height, 2*width, 2*height);\n\n }\n\n }\n frameCount += 1;\n\n // for event handler\n for (var j=0; j<cycles.length; j++) {\n \n //random = Math.floor((Math.random() * 4));\n //drawcycle(ctx,cycles[j].x, cycles[j].y,20*i,15,colors[random].r,colors[random].g,colors[random].r.b,1-i%10/10);\n drawcycle(ctx,cycles[j].x, cycles[j].y,20*i,15,colors[j%4].r,colors[j%4].g,colors[j%4].b,1-i%10/10);\n \n }\n\n\n \n}", "draw(){\r\n ctx.beginPath()\r\n ctx.arc(this.x,this.y,this.size,0,Math.PI * 2,false)\r\n ctx.fillStyle = '#8C5523';\r\n ctx.fill();\r\n //ctx.globalAlpha=0.3;\r\n\r\n }", "function dblackpatch(x,y){\n w = 100 \n h = 100\n fill(255)\n stroke(255)\n rect(x,y,w,h)\n\txpoints = []\n ypoints = []\n\tcolorMode(HSB,255)\n\tframeRate(24)\n strokeWeight(0.01);\n noFill();\n\tstroke((128 + 128 * sin(millis() / 5000)),255,(128 + 128 * sin(millis() /1000)));\t//color fader\n\t\n\tvar i = 0;\n\tvar x1 = x;\n\tvar y1 = y;\n\tvar x2 = x;\n\tvar y2 = y;\n\tfor( i = x; i <= x+w; i = i + 10){\n x1 = x+w/2;\n \ty1 = y\n x2 = i \n y2 = y+h\n line(x1,y1,x2,y2);\n\t\tappend(xpoints,i);\t\n }\n\t\n\tfor( i = y; i <= y+h; i = i + 10){\n x1 = x\n \ty1 = y+w/2;\n x2 = x+h \n y2 = i\n line(x1,y1,x2,y2);\n append(ypoints,i);\n }\n\tfor( i = x; i <= x+w; i = i + 10){\n x1 = x+w/2;\n \ty1 = y+h\n x2 = i \n y2 = y\n line(x1,y1,x2,y2);\n }\n\tfor( i = y; i <= y+h; i = i + 10){\n x1 = x+w\n \ty1 = y+h/2;\n x2 = x \n y2 = i\n line(x1,y1,x2,y2);\n }\n\tnum = xpoints.length\n\tfor(i = 0;i<num; i++){\t\n\t\tline(x,y+h,xpoints[i],y)\n\t\tline(x,y+h,x+w,ypoints[i])\n\t\tline(x,y,xpoints[i],y+h)\n\t\tline(x,y,x+w,ypoints[i])\n\t\tline(x+w,y+h,xpoints[i],y)\n\t\tline(x+w,y+h,x,ypoints[i])\n\t\tline(x+w,y,x,ypoints[i])\n\t\tline(x+w,y,xpoints[i],y+h)\n\t}\n}", "function drawFlower(){\n let angle = number * 2.85; // this figure will change the draw interval of the flower design.\n let radius = scale * Math.sqrt(number);\n let positionX = radius * Math.sin(angle) + canvas.width/2;\n let positionY = radius * Math.cos(angle) + canvas.height/2;\n\n ctx.fillStyle = 'hsl('+ hue + ', 100%, 50%)';\n ctx.strokeStyle = 'white';\n ctx.lineWidth = 2;\n ctx.beginPath();\n ctx.arc(positionX, positionY, 8, 0, Math.PI * 2);\n ctx.closePath();\n ctx.fill();\n ctx.stroke();\n\n number++;\n hue++; // hue+=0.5;\n}", "function drawBricks() {\n for (r = 0; r < brick.rows; r++) {\n for (c = 0; c < brick.columns; c++) {\n if (r = 1) {\n context.fillStyle = 'pink';\n context.fillRect(c * brick.x + 70, r * brick.y + 20, brick.width, brick.height);\n }\n if (r = 2) {\n context.fillStyle = 'lightblue';\n context.fillRect(c * brick.x + 70, r * brick.y + 20, brick.width, brick.height);\n }\n if (r = 3) {\n context.fillStyle = 'yellow';\n context.fillRect(c * brick.x + 70, r * brick.y + 20, brick.width, brick.height);\n }\n }\n }\n}", "function fill(color) {\r\n ctx.fillStyle = color;\r\n}", "updateColor() {\n if (this.colorToLerpTo == 0) {\n if (this.r != 255) {\n this.r++;\n if (this.g != 20) this.g--;\n if (this.b != 147) this.b--;\n this.color = makeColor(this.r, this.g, this.b);\n } else {\n this.g = 20;\n this.b = 147;\n this.colorToLerpTo = 1;\n this.color = makeColor(this.r, this.g, this.b);\n }\n } else if (this.colorToLerpTo == 1) {\n if (this.g != 255) {\n this.g++;\n if (this.b != 20) this.b--;\n if (this.r != 147) this.r--;\n this.color = makeColor(this.r, this.g, this.b);\n } else {\n this.r = 147;\n this.b = 20;\n this.colorToLerpTo = 2;\n this.color = makeColor(this.r, this.g, this.b);\n }\n } else if (this.colorToLerpTo == 2) {\n if (this.b != 255) {\n this.b++;\n if (this.r != 20) this.r--;\n if (this.g != 147) this.g--;\n this.color = makeColor(this.r, this.g, this.b);\n } else {\n this.g = 147;\n this.r = 20;\n this.colorToLerpTo = 0;\n this.color = makeColor(this.r, this.g, this.b);\n }\n }\n }", "function draw() {\n createCanvas(800, 600);\n\n background(50, 50, 50);\n\n\n triangle(265, 320, 400, 500, 535, 320);\n\n rect(250, 30, 15, 270);\n\n rect(535, 30, 15, 270)\n\n fill(100, 200, 300)\n circle(400, 250, 150);\n\n for(var timer = 0; timer < eye_color.length; timer++){\n fill(eye_color[timer])\n circle(400, 250, 100)\n\n }\n}", "function update_color() {\n refresh_color_display();\n\n // Iterate over each channel on the page\n for (var cs in COLORSPACES) {\n var colorspace = COLORSPACES[cs];\n var cs_name = colorspace.identifier;\n for (var i in colorspace.channels) {\n var channel = colorspace.channels[i];\n var id = cs_name + '-' + channel.identifier;\n\n // Update value and marker position\n update_slider(colorspace, channel);\n\n // Iterate over stops and update their colors, using assume()\n // to see what they *would* be if the slider were there. Note\n // that hue and lightness are special cases; hue runs through\n // the rainbow and needs several stops, whereas lightness runs\n // from black to a full color and then back to white, needing\n // an extra stop in the middle.\n var stop_ct = channel.stops;\n\n var $canvas = $('#' + id + ' canvas');\n var ctx = $canvas[0].getContext('2d');\n\n var grad = ctx.createLinearGradient(0, 0, 100, 0);\n var assumption = {};\n for (var i = 0; i < stop_ct; i++) {\n var offset = i / (stop_ct - 1);\n assumption[channel.identifier] = offset;\n grad.addColorStop(offset, current_color.assume(assumption).to_hex());\n }\n ctx.fillStyle = grad;\n ctx.fillRect(0, 0, 100, 100);\n }\n }\n}", "function onBeat() {\n\t\n\tvar colourArray = [color(84,172,71), \n\t\t\t\t\t\t color(19,48,40,110),\n\t\t\t\t\t\t color(113,94,133,150),\n\t\t\t\t\t\t color(214,31,52,150),\n\t\t\t\t\t\t color(233,93,37,110),\n\t\t\t\t\t\t color(149,86,54,150),\n\t\t\t\t\t\t color(68,72,158,110),\n\t\t\t\t\t\t color(107,38,111,150),\n\t\t\t\t\t\t color(157,71,70,150),\n\t\t\t\t\t \t\tcolor(237, 230,229,200),\n\t\t\t\t\t \t\tcolor(254,251,250, 200)\n\t\t\t\t\t\t ]\n\tvar randomizer = int(random(1,11));\n\tvar randomizer2 = int(random(1,11));\n\t\n\tgradientcolour1 = colourArray[randomizer];\n\tgradientcolour2 = colourArray[randomizer2];\n\n\t\n //backgroundColor = colourArray[randomizer];\n rectRotate = !rectRotate;\n}", "color(r, g, b) {\n this.penColor = getColorString(this.palette, r, g, b);\n this.ctx.strokeStyle = this.penColor;\n this.drawPath();\n }", "function setColors() {\n var len = points.length / 3;\n for (var i = 0; i < len; i++) {\n colors.push(1.0);\n colors.push(0.0);\n colors.push(0.0);\n colors.push(1.0);\n }\n}", "function dessiner_boule3(c) {\n\t\n\tvar ray = cercles[c][2]*(monCanvas.height-CoordJeux[1])*0.01;\n\t\t\n\tswitch(cercles[c][5]) {\n\t\tcase 1 :\n\t\t\tctx.fillStyle=\"blue\";\n\t\t\tbreak;\n\t\tcase 2 :\n\t\t\tctx.fillStyle=\"orange\";\n\t\t\tbreak;\n\t\tcase 3 : \n\t\t\tctx.fillStyle=\"green\";\n\t\t\tbreak;\n\t\tcase 4 :\n\t\t\tctx.fillStyle=\"pink\";\n\t\t\tbreak;\n\t\tdefault:\n\t}\n\n\tctx.save();\n\tctx.translate(cercles[c][0]*CoordJeux[0]*0.001,CoordJeux[1]+cercles[c][1]*(monCanvas.height-CoordJeux[1])*0.01);\n\tctx.beginPath();\n\tctx.arc(0,0,ray,0,2*Math.PI,false);\n\tctx.fill();\n\tctx.restore();\n\n}", "function redraw() {\n\t\t//ctx.strokeStyle = 'blue';\n\t\tctx.lineWidth = '.1';\n\t\tctx.strokeRect(0, 0, window.innerWidth, window.innerHeight);\n\t}", "setColor(r, g, b, a) {\n\n let s = getColorString(r, g, b, a);\n this.ctx.fillStyle = s;\n this.ctx.strokeStyle = s;\n }", "function draw() {\n background(220);\n}", "function bgFill(c) {\n\t// 1\n\tif (c === undefined) c = 0;\n\t\n\tcx.fillStyle = c;\n\tcx.fillRect(0, 0, 9999, 9999);\n}", "function setColor() {\n var r_hex = parseInt(r.value, 10).toString(16);\n var g_hex = parseInt(g.value, 10).toString(16);\n var b_hex = parseInt(b.value, 10).toString(16);\n\n\n //updates the sliders output colors\n r_out.style.backgroundColor=\"#\"+r_hex+\"0000\";\n r_out.value=r.value;\n g_out.style.backgroundColor=\"#00\"+g_hex+\"00\";\n g_out.value=g.value;\n b_out.style.backgroundColor=\"#0000\"+b_hex;\n b_out.value=b.value;\n\n hex = \"#\" + pad(r_hex) + pad(g_hex) + pad(b_hex);\n strokeOut.style.backgroundColor=hex;\n}", "render ( context ) {\n\t\tcontext.fillStyle = `hsl(45.2, 100%, ${ this.size * 4 }%)`;\n\t\tcontext.beginPath();\n\t\tcontext.arc( this.position.x, this.position.y, this.size, 0, TWO_PI );\n\t\tcontext.fill();\n\t}", "function rendercollects () {\r\n\t\tvar i = 0;\r\n\t\twhile (i < collects.length) {\r\n\t\t\tvar collectx = collects[i];\r\n\t\t\tvar collecty = collects[i + 1];\r\n\t\t\tvar collectsize = collects[i + 2];\r\n\t\t\t/*var collectcolor;\r\n\t\t\tif (collects[i + 3] == 1) {\r\n\t\t\t\tcollectcolor = \"red\";\r\n\t\t\t}\r\n\t\t\tif (collects[i + 3] == 2) {\r\n\t\t\t\tcollectcolor = \"orange\";\r\n\t\t\t}\r\n\t\t\tif (collects[i + 3] == 3) {\r\n\t\t\t\tcollectcolor = \"yellow\";\r\n\t\t\t}\r\n\t\t\tif (collects[i + 3] == 4) {\r\n\t\t\t\tcollectcolor = \"blue\";\r\n\t\t\t}\r\n\t\t\tif (collects[i + 3] == 5) {\r\n\t\t\t\tcollectcolor = \"lime\";\r\n\t\t\t}\r\n\t\t\tif (collects[i + 3] == 6) {\r\n\t\t\t\tcollectcolor = \"purple\";\r\n\t\t\t}*/\r\n\r\n\t\t\t//collectcolor = collects[i + 3];\r\n\t\t\ti += 6;\r\n\t\t\tctx = myGameArea.context;\r\n\t\t\t/*ctx.fillStyle = collectcolor;\r\n\t\t\t//ctx.fillRect(100 ,100 ,5 ,5);\r\n\r\n\r\n\t\t\tctx.fillRect((camerax - collectx) * zoom ,(cameray - collecty) * zoom ,collectsize * zoom,collectsize * zoom);\r\n\t\t\t*/\r\n\r\n\t\t\tctx.beginPath();\r\n\t\t\tctx.arc((camerax - collectx) * zoom, (cameray - collecty) * zoom, collectsize * zoom, 0 , 2*Math.PI);\r\n\t\t\t//ctx.fillStyle = collectcolor;\r\n\t\t\tvar grd = ctx.createRadialGradient((camerax - collectx) * zoom, (cameray - collecty) * zoom, collectsize * zoom*0.1, (camerax - collectx) * zoom, (cameray - collecty) * zoom, collectsize * zoom);\r\n\t\t\tgrd.addColorStop(0, \"white\");\r\n\t\t\tgrd.addColorStop(1, \"#00001a\");\r\n\t\t\tctx.fillStyle = grd;\r\n\t\t\tctx.fill();\r\n\t\t\tctx.closePath();\r\n\r\n\t\t}\r\n\t}", "function cone (context, scale) {\n let arcWidth = 1 / 8\n\n for (let i = 0; i < 40; i++) {\n context.fillStyle = 'rgb(200, ' + (200 - i * 7) + ', 0)'\n drawAt(context, scale * i, 0, 0, () => {\n context.beginPath()\n context.arc(0, 0, i * arcWidth, 0, 2 * Math.PI, false)\n context.fill()\n })\n }\n\n for (let i = 0; i < 10; i++) {\n context.fillStyle = 'rgba(0, 0, 200, 0.1)'\n drawAt(context, scale * (i + 40), 0, 0, () => {\n context.beginPath()\n context.arc(0, 0, (40 + i) * arcWidth, 0, 2 * Math.PI, false)\n context.fill()\n })\n }\n\n for (let i = 0; i < 10; i++) {\n context.fillStyle = 'rgba(50, 200, 0, 0.1)'\n drawAt(context, scale * (i + 50), 0, 0, () => {\n context.beginPath()\n context.arc(0, 0, (50 + i) * arcWidth, 0, 2 * Math.PI, false)\n context.fill()\n })\n }\n}", "draw() {\n\t\tinfo.context.beginPath();\n\t\tinfo.context.arc(this.position.x, this.position.y, 30, 0, 2 * Math.PI);\n\t\tinfo.context.fillStyle = this.color;\n\t\tinfo.context.fill();\n\t}", "function drawcolorcode() \n\t{\n\t// var canv = document.getElementById('colorcode');\n\t// var figure = canv.getContext('2d');\t\n\n\tleng=2\n\theig=7\n\tst=40\t\n\tik=14\n\tableng=st+leng\n\tvar cctext=''\n\tfor (var i=0;i<=100;i++)\n\t\t{\n\t\tcolor = dbandscore2color(dbs[0],i);\n\t\tbegx=leng*i+st\n\t\tbegy=3+heig*0\n\t\thei=heig-2\n\t\tcctext=cctext+'<rect x='+begx+' y='+begy+' width='+leng+' height='+heig+' style=\"fill:'+color+';stroke-width:0;stroke:rgb(100,100,100)\" />'\n\t\t}\n\t\n\tfont = \"10px Arial\";\n\ttextAlign=\"right\"; \t\n\ttextBaseline =\"top\";\n\tvar labels=''\n\tst2=st-3\n\tlabels=labels+'<text x='+st2+' y=\"9\" fill=\"black\" style=\"font-family: Arial\" font-size=\"8\" text-anchor=\"end\" dominant-baseline=\"top\">pfam</text></a>';\n\tlabels=labels+'<text x='+260+' y=\"9\" fill=\"black\" style=\"font-family: Arial\" font-size=\"10\" text-anchor=\"start\" dominant-baseline=\"top\">HMMsearch</text></a>';\n\tlabels=labels+'<text x='+260+' y=\"24\" fill=\"black\" style=\"font-family: Arial\" font-size=\"10\" text-anchor=\"start\" dominant-baseline=\"bottom\">Probability</text></a>';\n\tlabels=labels+'<text x='+40+' y=\"24\" fill=\"black\" style=\"font-family: Arial\" font-size=\"8\" text-anchor=\"middle\" dominant-baseline=\"bottom\">0%</text></a>';\n\tlabels=labels+'<text x='+90+' y=\"24\" fill=\"black\" style=\"font-family: Arial\" font-size=\"8\" text-anchor=\"middle\" dominant-baseline=\"bottom\">25%</text></a>';\n\tlabels=labels+'<text x='+140+' y=\"24\" fill=\"black\" style=\"font-family: Arial\" font-size=\"8\" text-anchor=\"middle\" dominant-baseline=\"bottom\">50%</text></a>';\n\tlabels=labels+'<text x='+190+' y=\"24\" fill=\"black\" style=\"font-family: Arial\" font-size=\"8\" text-anchor=\"middle\" dominant-baseline=\"bottom\">75%</text></a>';\n\tlabels=labels+'<text x='+240+' y=\"24\" fill=\"black\" style=\"font-family: Arial\" font-size=\"8\" text-anchor=\"middle\" dominant-baseline=\"bottom\">100%</text></a>';\n\t\n\tfor (var j=1;j<8;j++)\n\t\t{\n\t\t\n\t\tfor (var i=0;i<=100;i++)\n\t\t\t{\n\t\t\tcolor = dbandscore2color(dbs[j],i);\n\t\t\tx=st+leng*i\n\t\t\ty=ik+heig*j+5\n\t\t\tlabels=labels+'<rect x='+x+' y='+y+' width='+leng+' height='+heig+' style=\"fill:'+color+';stroke-width:0;stroke:rgb(100,100,100)\" />'\n\t\t\t}\n\tyt=ik+heig*j+6.5+5\n\tst2=st-3\n\tlabels=labels+'<text x='+st2+' y='+yt+' fill='+color+' style=\"font-family: Arial\" font-size=\"8\" text-anchor=\"end\" dominant-baseline=\"top\">'+dbs[j]+'</text></a>';\n\t\t\n\t\t}\n\tlabels=labels+'<text x='+260+' y=\"45\" fill=\"black\" style=\"font-family: Arial\" font-size=\"10\" text-anchor=\"start\" dominant-baseline=\"top\">HHsearch</text></a>';\n\t//document.write(cctext)\t\n\t//document.write(labels)\n\tvar total = cctext + labels;\n\treturn total;\n\t\n\t}", "function alternateColors(){\n effectInterval = setInterval(function(){\n var red = Math.floor(Math.random() * 255);\n var green = Math.floor(Math.random() * 255);\n var blue = Math.floor(Math.random() * 255);\n var color =\"rgba(\" + red + \", \" + green + \", \" + blue + \", 100)\";\n drawScreen(color);\n }, 1500);\n}", "function setColor(color){\ncontext.fillStyle = color\ncontext.strokeStyle = color\n}", "function changeColor(){\n\tif (colorIndex >= bodyColors.length - 1) {\n\t\tcolorIndex = -1;\n\t}\n\tcolorIndex++;\n\tconsole.log(colorIndex);\n\tbodyBcg.style.backgroundColor = bodyColors[colorIndex];\n\tbodyBcg.style.color = bodyFontColors[colorIndex];\n\tcontainer.style.backgroundColor = containerColors[colorIndex];\n\tcontainer.style.color = clockFontColors[colorIndex];\n\tclock.style.backgroundColor = clockColors[colorIndex];\n}", "function draw() {\n background(\"white\");\n for (let i = 0; i < width; i += 10) {\n for (let j = 0; j < height; j += 10) {\n//applied random variable for color of circles\n randFillR = random(255);\n randFillG = random(255);\n randFillB = random(255);\n fill(randFillR, randFillG, randFillB);\n circle(i, j, r);\n }\n }\n}", "function pwned(color){ \n\tpintaFondo(\"black\");\n\tctx.fillStyle = color;\n\tctx.font = \"60px Courier New\";\n\tctx.drawImage(document.getElementById(\"DealWithIt\"),0,0, canvas.width, canvas.height);\n}", "function draw() {\r\n current.forEach((index) => {\r\n squares[currentPosition + index].classList.add(\"tetrimino\");\r\n squares[currentPosition + index].style.backgroundColor = colors[random];\r\n });\r\n }", "circ(x0, y0, r, c) {\n // evaluate runtime errors\n this.colorRangeError(c);\n // draw filled circle\n let x = 0;\n let y = r;\n let p = 3 - 2 * r;\n this.circPixGroup(x0, y0, x, y, c);\n while (x < y) {\n x++;\n if (p < 0) {\n p = p + 4 * x + 6;\n }\n else {\n y--;\n p = p + 4 * (x - y) + 10;\n }\n this.circPixGroup(x0, y0, x, y, c);\n }\n }", "function rainbowColors(e) {\n let colorA = Math.floor(Math.random() * 256);\n let colorB = Math.floor(Math.random() * 256);\n let colorC = Math.floor(Math.random() * 256);\n e.target.style.backgroundColor = `rgb(${colorA}, ${colorB}, ${colorC})`;\n}", "function drawCage(size){\n var squareSize = cs/size\n goto(-cs/2,cs/2)\n right(180)\n width(2)\n for (let i = 0; i < size; i++) {\n forward(cs)\n left(90)\n forward(squareSize)\n left(90)\n forward(cs)\n left(90)\n forward(squareSize)\n left(180)\n forward(squareSize)\n right(90)\n }\n for (let a = 0; a < size; a++) {\n for (let i = 0; i < 2; i++) {\n forward(squareSize)\n right(90)\n forward(cs)\n right(90)\n }\n forward(squareSize)\n }\n left(180)\n goto(1000,1000)\n}", "function draw(){\r\n background(\"white\");\r\n \r\n \r\n \r\n}", "function generateColor(red, green, blue)\n{\n paintColor[0] = red;\n paintColor[1] = green;\n paintColor[2] = blue;\n}", "function drawCell(i,j){\n if( (i+j)%2==0 ) {\n ctx.fillStyle = (\"#8ECC39\"); //dark green\n }else{\n ctx.fillStyle = \"#A7D948\"; //light green\n }\n ctx.fillRect(cellSize*i, cellSize*j, cellSize, cellSize);\n}", "function drawMovieCntdown(ctx, x, y, r1, r2, color, w1, w2, w){\n ctx.strokeStyle = color;\n ctx.beginPath();\n // two circles\n ctx.lineWidth = w1;\n ctx.arc(x, y, r1, 0, 2 * Math.PI, true);\n ctx.stroke();\n ctx.beginPath();\n ctx.lineWidth = w2;\n ctx.arc(x, y, r2, 0, 2 * Math.PI, true);\n ctx.stroke();\n // partial cross\n ctx.beginPath();\n ctx.lineWidth = w;\n var d = r2*0.8, l = r2*0.4+r1-r2;\n ctx.moveTo(x-d,y);ctx.lineTo(x-d-l,y);\n ctx.moveTo(x+d,y);ctx.lineTo(x+d+l,y);\n ctx.moveTo(x,y-d);ctx.lineTo(x,y-d-l); \n ctx.moveTo(x,y+d);ctx.lineTo(x,y+d+l); \n ctx.stroke();\n ctx.closePath();\n}", "function chcolor(){if(v_chcolor == 1){ document.getElementById(\"sgb\").style.color=color[x];(x < color.length-1) ? x++ : x = 0;}}", "function renderWorm(currentWorm)\r\n{\r\n\tcontext.fillStyle = currentWorm.color;\r\n\t\r\n\tfor(var i = 0; i < currentWorm.lenght; i++)\r\n\t{\r\n\t\tif(currentWorm.previousHole[i])\r\n\t\t{\r\n\t\t\t//setColor...\r\n\t\t\tcontext.fillStyle = \"rgb(2, 2, 2)\";\r\n\t\t}\r\n\t\t\r\n\t\tcontext.beginPath();\r\n\t\tcontext.arc(currentWorm.previousX[i], currentWorm.previousY[i], wormSize, 0, Math.PI*2, true);\r\n\t\t//context.stroke();\r\n\t\tcontext.fill();\r\n\t\tcontext.closePath();\r\n\t\t\r\n\t\t/*\r\n\t\t\tcontext.beginPath();\r\n\t\t\tcontext.fillStyle = \"rgb(0, 0, 0)\";\r\n\t\t\tcontext.arc(currentWorm.previousX[8], currentWorm.previousY[8], wormSize+1, 0, Math.PI*2, true);\r\n\t\t\tcontext.fill();\r\n\t\t\tcontext.closePath();\r\n\t\t\r\n\t\t\tcontext.beginPath();\r\n\t\t\t//context.fillStyle = \"rgb(220, 80, 100)\";\r\n\t\t\tcontext.fillStyle = \"rgb(2, 2, 2)\";\r\n\t\t\tcontext.arc(currentWorm.previousX[11], currentWorm.previousY[11], 2, 0, Math.PI*2, true);\r\n\t\t\tcontext.fill();\r\n\t\t\tcontext.closePath();\r\n\t\t}\r\n\t\t*/\r\n\t}\r\n\t\r\n\t//currentWorm.length++;\r\n\t\r\n\t\r\n}", "function recolor(val){\n\n\t\tjc = 0;\n\t\t\n\t\tpolies.getLayers().forEach(\n\t\t\tfunction(x){\n\t\t\t\tx.setStyle({color:getColor(refData[val][jc].dist)});\n\t\t\t\tjc +=1;\n\t\t\t\treturn x;\n\t\t\t\t\n\t\t\t}\n\t\t);\n\t\treturn 1;\n\t\t\n\t}", "function drawCircle( c ) {\n \n context.beginPath(); \n context.arc( c.x, c.y, c.size/2, 0, Math.PI * 2 );\n context.fillStyle = c.color;\n context.fill(); \t\t\t\n context.closePath(); \n \n } //drawCircle() ", "function changeColors(color) {\n\tfor (var i = 0; i < circles.length; i++)\n\t\tcircles[i].style.background = color;\n}", "highlight(color){\r\n let x = this.col * this.size / this.cols + 1\r\n let y = this.row * this.size / this.rows + 1\r\n ctx.fillStyle = color\r\n ctx.fillRect(x,y,this.size/this.cols -5,this.size/this.rows -5)\r\n }", "function changeColor() {\n for (i = 0; i < colorSquares.length; i++) {\n colorSquares[i].addEventListener('click', function () {\n ctx.strokeStyle = `${this.style.backgroundColor}`;\n })\n }\n}", "function drawCurrentColor() {\n\t$('#selected').html(' ');\n\tlet div = '<div id=\"colorSelected\"></div>';\n\t$('#selected').append(div);\n\t$('#colorSelected').css('background', SQUARE_COLORS_ARRAY[colorIndexWeAreDrawing]);\n}", "function rotateColors(display) {\nvar red = 0;\nvar green = 0;\nvar blue = 0;\ndisplay.setColor(red, green, blue);\nsetInterval(function() {\nblue += 64;\nif (blue > 255) {\n blue = 0;\n green += 64;\n if (green > 255) {\n green = 0;\n red += 64;\n if (red > 255) {\n red = 0;\n }\n }\n}\ndisplay.setColor(red, green, blue);\ndisplay.setCursor(0, 0);\ndisplay.write(' Hackster.io');\ndisplay.setCursor(1,1);\ndisplay.write('Intel Edison');\n // extra padding clears out previous text\n}, 1000);\n}", "function draw(e) {\n e.target.style.backgroundColor = \"rgb(0,0,0)\";\n}", "function drawCivilization() {\n for (y = 0; y < civilization.length; y++) {\n for (x = 0; x < civilization[y].length; x++) {\n var currentCell = civilization[y][x];\n\n //Color alive cells\n if (currentCell === 1) {\n ctx.fillStyle = aliveCellColor;\n ctx.fillRect(x * rectSize, y * rectSize, rectSize, rectSize);\n //Color dead cells that were once alive\n } else if (currentCell === 2) {\n ctx.fillStyle = onceAliveCellColor;\n ctx.fillRect(x * rectSize, y * rectSize, rectSize, rectSize);\n //Color dead cells white\n } else {\n ctx.clearRect(x * rectSize, y * rectSize, rectSize, rectSize);\n }\n }\n }\n}" ]
[ "0.6903112", "0.68646705", "0.6826152", "0.67670554", "0.67198145", "0.6673409", "0.6670136", "0.6663968", "0.66530085", "0.6643956", "0.6628434", "0.65776885", "0.6567765", "0.6561271", "0.6554733", "0.65501", "0.653363", "0.65150607", "0.65150255", "0.65147173", "0.6505295", "0.6485736", "0.64827055", "0.646431", "0.64460766", "0.64381534", "0.64328355", "0.64295745", "0.6403867", "0.64032733", "0.6393732", "0.6389261", "0.6379927", "0.63697153", "0.6361888", "0.63608384", "0.6350035", "0.6342593", "0.63390285", "0.6335718", "0.6328689", "0.6325505", "0.63230926", "0.6322034", "0.6321802", "0.6314882", "0.6314681", "0.6314141", "0.6312872", "0.631118", "0.6310595", "0.63062894", "0.63006425", "0.6300411", "0.62849003", "0.62788975", "0.6267942", "0.62676793", "0.6266696", "0.6264926", "0.62630135", "0.6258184", "0.62532246", "0.6251634", "0.6249083", "0.62470144", "0.62375873", "0.6236698", "0.6233684", "0.6232937", "0.62279373", "0.62175745", "0.6215828", "0.6205771", "0.6203655", "0.62002385", "0.6194455", "0.6192732", "0.6188699", "0.6187834", "0.61871535", "0.6180369", "0.6176789", "0.6170209", "0.61691564", "0.6168649", "0.6167051", "0.6167034", "0.61627936", "0.61585957", "0.61583143", "0.61578864", "0.6156974", "0.61542475", "0.614991", "0.6144384", "0.6139915", "0.6139811", "0.6139372", "0.6129869", "0.6128792" ]
0.0
-1
create function when mouse is clicked, the circle will change colors
function mouseClicked() { var randomColor = colors[Math.floor(Math.random() * colors.length)]; if(randomColor == "purple") { fill(colors[0]); }else if(randomColor == "red") { fill(colors[1]); }else if(randomColor == "orange") { fill(colors[2]); }else { fill(colors[3]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mouseClicked() {\n colorindex = ((colorindex+1)%colors.length)\n bgColor = colors[2][1]\n circleColor = colors[2][0];\n}", "function my_mousedown(e)//e is an event which has relation with mousedown\r\n{\r\n //taking color from input box\r\n color = document.getElementById(\"input1\").value;\r\n \r\n \r\n \r\n mouse_x = e.clientX - canvas.offsetLeft;//moves mouse to x coordinate of canvas when clicked\r\n mouse_y = e.clientY - canvas.offsetTop;//moves mouse to y coordinate of canvas when clicked\r\n\r\n \r\n circle(mouse_x , mouse_y); //passing coordinates to circle function \r\n}", "function mousePressed() {\n randomizeColors();\n resetDirection();\n createCircles ^= true;\n}", "function mouseShape()\n {\n fill(106,90,205);\n circle(mouseShapeX, mouseShapeY, 35);\n }", "function mousePressed(){\n //Check if Mouse is inside circle\n let d=dist(mouseX,mouseY,360,200);\n if (d<100){\n //pick different color values \n r=random(255);\n g=random(255);\n b=random(255);\n }\n}", "function mouseClicked() {\n fill(starColour);\n rect(mouseX, mouseY, 8, 8);\n}", "function mouseClicked() {\n fill('#222222');\n rect(300,300,150,150)\n return false;\n }", "function mousePressed() {\n // Check if mouse is inside the circle\n var d = dist(mouseX, mouseY, mouseX, mouseY); // measuring the distance between the center of the circle and the mouse\n if (d < 50) { // if it's in the circle, do what's below\n // Pick new random color values for circle\n r = random(255); // when mouse is pressed, changes to random red hue\n g = random(255); // when mouse is pressed, changes to random green hue\n b = random(255); // when mouse is pressed, changes to random blue hue\n // pick random color value for background\n r2 = random(255)\n g2 = random(255)\n b2 = random(255)\n }\n}", "function draw() {\r\n ellipse(mouseX, mouseY, 20, 20); // Draw a circle\r\n if (mouseIsPressed) {\r\n // When the mouse button is pressed\r\n // change the colour randomly\r\n fill(random(255), random(255), random(255));\r\n }\r\n}", "function mousePressed() {\n // Check if mouse is inside the circle\n let d = dist(mouseX, mouseY, 360, 200);\n if (d < 100) {\n // Pick new random color values\n r = random(225);\n g = random(225);\n b = random(225);\n }\n}", "function changeColor(e) {}", "_colorEventListener() {\r\n d3.selectAll('[data-color]').on('click', function () {\r\n d3.selectAll('[data-color]').classed('active', false);\r\n d3.select(this).classed('active', true);\r\n\r\n this.color = d3.select(this).attr('data-color');\r\n\r\n })\r\n }", "onClick(d) {\n\n scatterplot.onClickCircle(d);\n }", "function onClickColor(index) {\n // set clicked = true and set the color that is clicked to pass to colorbox.js\n setClicked(true);\n setCircleClicked(index);\n\n // set the color in app.js\n setSelectedColor(index);\n\n // console.log('clicked: ', index);\n }", "function mouseoverCircle() {\n\n\t// Get circle\n\tvar circle = d3.select(this);\n\n\t// Display activated circle\n\tcircle.attr(\"r\", circle.attr(\"r\") * circleEnlargeConstant);\n\n}", "function mousePressed() {\n fill(40,60,255,5);\n}", "function drawCircle(x, y, num) {\n vis_nodes.append('circle')\n .attr('class', 'node-circle')\n .attr('id', num)\n .attr('fill','#1D2326')\n .attr('cx', x)\n .attr('cy', y)\n .attr('r', 8)\n .on('click', function(){\n if (states['#edges']) {\n c = d3.select(this);\n c.attr('fill','#5990D9');\n var n = endpoints.push(c);\n drawEdges(n); \n }\n else if (states['#select']) {\n c = d3.select(this);\n var n = startEnd.push(c);\n selectStartEnd(n);\n }\n });\n}", "drawCircle(x,y,r){\n ctx.beginPath();\n ctx.arc(x,y,r,0,2*Math.PI);\n ctx.lineWidth = 1;\n ctx.strokeStyle = colourButton.selectedColour;\n ctx.stroke();\n }", "function SwatterCircle() {\n ctx.beginPath();\n ctx.arc(mouse.x + 28, mouse.y + 27, 15, 0, Math.PI * 2, false);\n ctx.strokeStyle = '#D04D00';\n ctx.stroke();\n}", "function draw() {\n background(70);\n diffCircle.update();\n if (mouseIsPressed) {\n diffCircle = diffCircle - 300 ;\n } else {\n diffCircle = diffCircle + 300;\n }\n }", "function red_circle (event, bMouse, type) {\n var svg_box = document.getElementById (\"foreground\");\n\n var rect = svg_box.getBoundingClientRect ();\n\n var x = rect.width / 2;\n var y = rect.height / 2;\n\n if (bMouse) {\n\tif (event.buttons || event.button) {\n\t x = event.clientX - rect.x;\n\t y = event.clientY - rect.y;\n\t}\n } else {\n\tif ((type == \"start\") || (type == \"move\")) {\n\t if (event.touches.length) {\n\t\tvar touch = event.touches[0];\n\t\tx = touch.pageX - rect.left;\n\t\ty = touch.pageY - rect.top;\n\t }\n\t}\n\tevent.preventDefault ();\n\tevent.stopPropagation ();\n }\n\n /* Adjust for coordinate system\n */\n x = x - rect.width / 2;\n y = rect.height / 2 - y;\n\n if (x < -rect.width / 2) {\n\tx = -rect.width / 2;\n }\n if (y < -rect.height / 2) {\n\ty = -rect.height / 2;\n }\n if (x > rect.width / 2) {\n\tx = rect.width / 2;\n }\n if (y > rect.height / 2) {\n\ty = rect.height / 2;\n }\n\n var c_red = document.getElementById (\"circle_red\");\n\n c_red.setAttribute (\"cx\", x.toFixed (3));\n c_red.setAttribute (\"cy\", y.toFixed (3));\n\n user_control (2 * x / rect.width, 2 * y / rect.height);\n}", "function initColorChange(){\n var colorButton = document.querySelectorAll('.circle');\n [].forEach.call(colorButton,function(item) {\n item.addEventListener('click',function (e) {\n [].forEach.call(colorButton,function (item) {\n if(item.classList.contains('selected')){\n item.classList.remove('selected');\n }\n })\n model.data.currentColor = colorList.indexOf(item.id);\n update();\n })\n\n })\n}", "function mouseClicked() {\n \n rect(Math.floor(Math.floor(mouseX) / scale), Math.floor(Math.floor(mouseY) / scale), scale, scale);\n fill(51);\n}", "function draw() {\n \n\n noStroke() /// the color changing functions must be defined before the shape function\n fill(255)\n\n // mouseX and mouseY are built in variables that are the cursor position relative to the canvas 0,0\n circle(mouseX,mouseY,20)\n}", "onColorClick (event) {\n let pos = getDOMOffset(this.colorPicker);\n pos.x += 30;\n pos.y = editor.heightAtLine(this.line) - 15;\n\n this.picker = new ColorPicker(this.colorPicker.style.backgroundColor);\n\n this.picker.presentModal(pos.x, pos.y);\n this.picker.on('changed', this.onColorChange.bind(this));\n }", "function mousePressed()\n{ \n // Check if mouse is inside the circle\n let d = dist(mouseX, mouseY, ball.x, ball.y);\n if (d < 100) {\n // Pick new random color values\n r = random(255);\n g = random(255);\n b = random(255);\n }\n}", "function liElementClicked() {\n changeColor()\n }", "function draw() {\n circle(250, 250, 450);\n strokeWeight(3);\n text(\"Click me to change color!\", 100, 200, 350, 300);\n textSize(28);\n}", "function colorChanger(color){\n\n mouse.color = color;\n hold.style.background = color;\n\n\n\n\n}", "function mousePressed(){\n for(var i=0; i<arrColor.length; i++){\n arrColor[i].click=false;\n arrColor[i].size=30;\n arrColor[i].strokeCol='black';\n arrColor[i].clicked();\n }\n\n playBtn.clicked();\n cameraBtn.clicked();\n}", "function circle(x, y, px, py) {\n //this is the speed part making the size be determined by speed of mouse\n var distance = abs(x-px) + abs(y-py);\n stroke(r, g, b);\n strokeWeight(2);\n //first set of variables for bigger circle\n r = random(255);\n g = random(255);\n b = random(255);\n\n//second set of colours so the inner circle is different colour or else it is the same\n r2 = random(255);\n g2 = random(255);\n b2 = random(255);\n //this is the big circle\n fill(r, g, b);\n ellipse(x, y, distance, distance);\n //this is the smaller inner circle\n fill(r2, g2, b2);\n ellipse(x, y, distance/2, distance/2);\n}", "function mouseClicked() {\r\n if(value === 0) {\r\n value = 200;\r\n bgcolor = color(value, opacity);\r\n } else {\r\n value = 0;\r\n bgcolor = color(value, opacity);\r\n }\r\n}", "onClickCircle(d) {\n\n // Deselect other articles\n const circles_clicked = d3.selectAll(\".article-clicked\")\n circles_clicked.classed(\"article-clicked\", false);\n\n const selected_circle = d3.select(\"#article_\" + d.article_id);\n\n // Highlight selected circle\n selected_circle.transition()\n .attr(\"r\", circle_radius + 0.2)\n .style(\"stroke\", \"Goldenrod\")\n .style(\"stroke-width\", \"0.8\");\n\n selected_circle.classed(\"article-clicked\", true);\n\n // Prepare and load single article view\n // scatterplot.transitionToSingleArticleView(d.article_name);\n loadArticleProgress(d.article_name);\n }", "function itsClicked1(event) {\n r = r + 1;\n result.style.backgroundColor = \"rgb(\" + r + \",\" + g + \",\" + b + \")\";\n color.innerHTML = `${r},${g},${b}`;\n}", "function updateCircleColor(newColor, handlerClass) {\n\t\tvar len = circles.length;\n\t\tfor (var i = 0; i < len; i++) {\n\t\t\tif (circles[i].node.className.baseVal == handlerClass) {\n\t\t\t\tconsole.log(circles[i].node.className.baseVal, handlerClass);\n\t\t\t\tcircles[i].attr(\"fill\", newColor);\n\t\t\t\tconsole.log(\"circle color function\");\n\t\t\t}\n\t\t}\n\t}", "function circle() {\n\n}", "function mouseclick(d) {\n\t\n\t\tif(!clicked) {\n\t\t\tclicked = !clicked;\n\t\t\t\n\t\t\t//d3.select(this).select(\"circle, rect\").attr(\"class\", \"clicked\");\n\t\t\thighlight(d);\n\t\t\t\n\n\t\t}\n\t\telse {\n\t\t\tclicked = !clicked;\n\t\t\tsvg.selectAll('circle, rect, text')\n\t\t\t\t.transition().duration(750)\n\t\t\t\t.style(\"opacity\", 1);\n\t\t\t\n\t\t\tsvg.selectAll('line')\n\t\t\t\t.transition().duration(750)\n\t\t\t\t.style(\"visibility\", \"visible\");\n\t\t}\n\t}", "function mouseoverTrainCircle() {\n console.log(\"MOUSE OVER\");\n var circle = d3.select(this);\n var circleID = circle.attr(\"id\");\n\n if ((popupOpen && circleID != currentCircleID) || editting)\n return;\n\n currentCircleID = circleID;\n currentCircle = circle;\n\n currentCircle\n .transition().duration(200)\n .attr(\"style\", \"cursor:pointer\")\n .attr(\"r\", 5);\n\n defineChanges(circleID);\n\n popupOpen = true;\n\n updatePopupCircleSize(currentCircle);\n updatePopupCircleContent();\n}", "function mouseClicked() {\n colorBg.r = map(mouseX, 0, windowWidth, 0, 255);\n colorBg.g = map(mouseY, 0, windowHeight, 0, 255);\n colorBg.b = floor(random(0, 255));\n\n background(colorBg.r, colorBg.g, colorBg.b);\n}", "clickedTargetColor(p, c) {\n \n if(p) {\n this.upperBarCounterCircles.children[c-1].style = \"background-color: #0ebb25;\"; \n } else {\n this.upperBarCounterCircles.children[c-1].style = \"background-color: #bb263a;\";\n }\n }", "function mouseOverCircle() {\n $(this).css(\"opacity\", \"0.5\");\n }", "_colorEventListener() {\r\n d3.selectAll('.stroke-width').on('click', function () {\r\n\r\n this.stroke = d3.select(this).property('value');\r\n\r\n })\r\n }", "detectClick(){\r\n // It associate and event to each colour, at the same time it calls the method to detect the color.\r\n this.color.cyan.addEventListener('click',this.detectColor)\r\n this.color.violet.addEventListener('click',this.detectColor)\r\n this.color.orange.addEventListener('click',this.detectColor)\r\n this.color.green.addEventListener('click',this.detectColor)\r\n}", "function pickColor(event) {\r\n\t\t//récupération de la position au clic\r\n\t\tvar paletteOffset = $palette.offset();\r\n\t\tvar paletteX = Math.floor(event.pageX - paletteOffset.left);\r\n\t\tvar paletteY = Math.floor(event.pageY - paletteOffset.top);\r\n\t\t//récupération des infos de couleur à cette position\r\n\t\tvar imageData = ctx.getImageData(paletteX, paletteY, 1, 1);\r\n\t\tvar pixel = imageData.data;\r\n\t\t//utilisation de la couleur sélectionnée comme couleur en cours\r\n\t\tcolor = 'rgba('+pixel[0]+','+pixel[1]+','+pixel[2]+','+pixel[3]+')';\r\n\t\tcolorPreview();\t//mise à jour de l'affichage de la couleur en cours\r\n\t}", "function mousePressed() {\n circObjs.push(\nnew Circ(mouseX, mouseY, random(255)));\n}", "function draw(e) {\n e.target.style.backgroundColor = choosenColor();\n}", "function setMouseClick(node) {\n click_active = true; //Disable mouseover events\n\n mouse_zoom_rect.on('mouseout', null); //Send out for pop-up\n\n showTooltip(node); //Find all edges and nodes connected to the \"found\" node\n\n setSelection(node); //Draw the connected edges and nodes\n\n drawSelected(); //Draw the edges on the hidden canvas for edge hover\n\n drawHiddenEdges(node); //Add the extra click icon in the bottom right\n\n renderClickIcon(node); //Draw rotating circle around the hovered node\n\n drawDottedHoverCircle(node); //Set for reference\n\n current_click = node;\n } //function setMouseClick", "function setMouseClick(node) {\n click_active = true; //Disable mouseover events\n\n mouse_zoom_rect.on('mouseout', null); //Send out for pop-up\n\n showTooltip(node); //Find all edges and nodes connected to the \"found\" node\n\n setSelection(node); //Draw the connected edges and nodes\n\n drawSelected(); //Draw the edges on the hidden canvas for edge hover\n\n drawHiddenEdges(node); //Add the extra click icon in the bottom right\n\n renderClickIcon(node); //Draw rotating circle around the hovered node\n\n drawDottedHoverCircle(node); //Set for reference\n\n current_click = node;\n } //function setMouseClick", "function circleColour(){\n return(\"gray\");\n \n}", "function mousePressed(){\n if (mouseY<31) {\n col = \"green\";\n }else if (mouseY > 30 && mouseY < 61){\n col = \"blue\";\n } else if (mouseY > 60 && mouseY < 91){\n col = \"yellow\";\n }\n}", "function draw(){\n\n\n if(mouseIsPressed) {\n fill(0)\n } else {\n fill(255);\n }\n\n ellipse(mouseX, mouseY, 80, 80);\n}", "onMouseDown(coord, event) {\n this.context.fillStyle = colorPicker.colors[0].hexString;\n this.context.strokeStyle = colorPicker.colors[0].hexString;\n this.context.lineJoin = \"round\";\n this.context.lineWidth = $('#pen-width').val();;\n \n this.context.beginPath();\n this.context.moveTo(coord[0], coord[1]);\n this.draw(coord[0], coord[1]);\n }", "function mousePressed() {\n stroke(r, g, b, 120);\n strokeWeight(10);\n ellipse(mouseX, mouseY, 25, 25);\n randomColor();\n line(r, g, random(0, 600), random(0, 600));\n}", "function draw() {\n //background is pink\n //circle\n stroke(90,255,127); // an RGB color for the circle's border\n strokeWeight(10);\n fill(255,90,127,255); // an RGB color for the inside of the circle (the last number refers to transparency (min. 0, max. 255))\n ellipse(mouseX,height/2,100,seethru); // center of canvas, 20px dia\n fill(255,255,251,seethru);\n \n rect(50,200,400,100);\n}", "function mouseClicked(){\n\tif(clicked){\n\t\tclicked =false; // check clicked status: first click set cy and cx, second click go back to regular mandlebrot. \n\t}\n\telse{\n\t\tclicked=true;\n\t\tcx = map(mouseX,0,width, -1.0, 1.0);\n\t\tcy = map(mouseY,0,height,-1.0,1.0);\n\t}\n}", "function Circle(x, y, dx, dy, radius, r, g, b) {\n this.x = x;\n this.y = y;\n this.dx = dx;\n this.dy = dy;\n this.radius = radius;\n this.minRadius = radius;\n this.r = r;\n this.g = g;\n this.b = b;\n this.color = colorArray[Math.floor(Math.random() * colorArray.length)]\n\n this.draw = function () {\n c.beginPath();\n c.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false);\n // c.strokeStyle = `rgb(${r}, ${g}, ${b})`;\n // c.fillStyle = `rgb(${r}, ${g}, ${b})`;\n c.fillStyle = this.color\n // c.stroke();\n c.fill();\n }\n this.update = function () {\n if (this.x + this.radius > innerWidth || this.x - this.radius < 0) {\n this.dx = -this.dx;\n }\n if (this.y + this.radius > innerHeight || this.y - this.radius < 0) {\n this.dy = -this.dy;\n }\n this.x += this.dx;\n this.y += this.dy;\n\n\n //INTERACTIVITY portion\n if (mouse.x - this.x < 50 \n && mouse.x - this.x > -50\n && mouse.y - this.y < 50 \n && mouse.y - this.y > -50) {\n if (this.radius < maxRadius) {\n this.radius += 1;\n }\n } else if (this.radius > this.minRadius) {\n this.radius -= 1;\n }\n\n this.draw();\n }\n}", "clicked(x, y) {}", "function setFuncCircle() {\n\tcanvas.removeEventListener(\"mousedown\", currentFunc);\n\tcurrentFunc = drawCircle;\n\tcanvas.addEventListener(\"mousedown\", currentFunc);\n}", "function selectPaint(event) {\r\n /* change the colour when different paint colour selected */\r\n var x = event.target.id;\r\n colour = x;\r\n }", "function modeAdd()\n{\n $('#shape').show();\n changeShape();\n canvas.on(\"click\", function()\n {\n drawFunc = buttonFuncs[shape];\n if (drawFunc != null)\n {\n drawFunc(canvas, d3.mouse(this)[0], \n d3.mouse(this)[1], 50, color);\n }\n });\n}", "function mousePressed() {\n background(\"rgb(233, 255, 232)\");\n\n}", "function OnMouseDown()\n{\t\n if(manager.turn == color)\n {\n if(color == 0 && gameObject.tag == \"Inactive White Piece\")\n {\n transform.gameObject.tag = \"Active White Piece\";\n movement();\n }\n else if(color == 0 && gameObject.tag == \"Active White Piece\")\n {\n \tmanager.unhighlightAllSquares();\n \ttransform.gameObject.tag = \"Inactive White Piece\";\n }\n else if(color == 1 && gameObject.tag == \"Inactive Black Piece\")\n {\n transform.gameObject.tag = \"Active Black Piece\";\n movement();\n }\n else if(color == 1 && gameObject.tag == \"Active Black Piece\")\n {\n \tmanager.unhighlightAllSquares();\n \ttransform.gameObject.tag = \"Inactive Black Piece\";\n }\n }\n}", "function activate(event){\n\n /* Mark the initiate_coloring_walls as true so that rects can be alloted colors as if it is false then color cannot be performed */\n initiate_coloring_walls = true;\n\n /* \n * Get the id of the target which is clicked using event object and if the marked is already of wall color that means\n * the user wants to initiate the remove walls procedure.\n */\n if(document.getElementById(event.target.id).style.fill === walls_color){\n switch_coloring_walls = false;\n }else{ /* Otherwise if the user clicks empty rect then user wants to start creating walls procedure */\n switch_coloring_walls = true;\n }\n\n /* \n * Reply_click is a function that will manage the coloring of the individual rect and will color if and only if \n * initiate_coloring_walls is true otherwise it will return */\n reply_click(event);\n}", "function colorsFigure(){\n console.log(color)\n selectedFigure.setColor(color);\n redrawFigures();\n}", "function draw() {\n //comment this back in to see a dynamic animation!!\n // if (mouseIsPressed) {\n // square(mouseX, mouseY, 90);\n // } else {\n // circle(mouseX, mouseY, 90);\n // }\n}", "function mousePressed() {\n //Clears the canvas\n background(127.5);\n \n //Colour and shapes for the target\n fill(0);\n ellipse(mouseX, mouseY, 200, 200);\n fill(255);\n ellipse(mouseX, mouseY, 100, 100);\n fill(0);\n ellipse(mouseX, mouseY, 50, 50);\n fill(255);\n ellipse(mouseX, mouseY, 25, 25);\n fill(0);\n ellipse(mouseX, mouseY, 12.5,12.5);\n \n}//End function mousePressed", "function increaseColor(event){\n red = red + 1;\n colorChange();\n}", "function mouseClick(element){\n if(!d3.select(\"#playButton\").classed(\"active\")){\n\n initColorNode(element);\n\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 changeColor() {\n for (i = 0; i < colorSquares.length; i++) {\n colorSquares[i].addEventListener('click', function () {\n ctx.strokeStyle = `${this.style.backgroundColor}`;\n })\n }\n}", "function coloring(event) {\n event.target.style.backgroundColor = pickColor();\n}", "function box_1()\n{\n push()\n const left = box1.button_left\n const right = box1.button_left + box1.button_width + 200\n const top = box1.button_top\n const bottom = box1.button_top + box1.button_height \n\n const within_x = mouseX > left && mouseX < right\n const within_y = mouseY > top && mouseY < bottom\n box1.mouseIsOver = within_x && within_y\n\n let fill_colors = 220\n if(box1.mouseIsOver)\n {\n if(mouseIsPressed)\n {\n fill_colors = 50\n }\n else\n {\n fill_colors = 100\n }\n fill(fill_colors)\n }\n translate(box1.button_left, box1.button_top )\n rect(0, 0, box1.button_width, box1.button_height)\n pop()\n}", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n\n // highlight the selected circle\n d3.select(this).select(\"circle\").style(\"stroke\", \"red\");\n d3.select(this).select(\"circle\").style(\"stroke-width\", \"2\");\n } else {\n d.children = d._children;\n d._children = null;\n\n // reset the highlight\n d3.select(this).select(\"circle\").style(\"r\", 2.5);\n d3.select(this).select(\"circle\").style(\"stroke\", \"\");\n }\n update();\n }", "function makeClickable(svg_obj, gridD){\n svg_obj\n .data(gridD)\n .selectAll(\".square\") \n\t.on('click', function(d) {\n d.click ++;\n if ((d.click)%2 == 0 ) { \n d3.select(this).style(\"fill\",\"#fff\");\n d.value = 0;\n }\n\t if ((d.click)%2 == 1 ) { \n d3.select(this).style(\"fill\",\"#000000\");\n d.value = 1;\n } \n }); \n\n return gridD\n}", "function Target(){\n let gw = GWindow(GWINDOW_WIDTH,GWINDOW_HEIGHT);\n let x = GWINDOW_WIDTH / 2 ;\n let y = GWINDOW_HEIGHT / 2 ;\n gw.add(createFilledCircle(x,y,OUTER_RADIUS,\"Red\"));\n gw.add(createFilledCircle(x,y,OUTER_RADIUS * 2 / 3,\"White\"));\n gw.add(createFilledCircle(x,y,OUTER_RADIUS / 3,\"Red\"));\n}", "outerWheelClicked (evtPos) {\n // returns an rgba array of the pixel-clicked.\n const rgbaArr = this.ctx.getImageData(evtPos.x, evtPos.y, 1, 1).data\n const [r, g, b] = rgbaArr\n\n const rgb = { r, g, b }\n\n // Whether the user wants rgb-strings or rgb objects returned.\n const rgbArg = convertObjToString(rgb) // TODO: Let user set different return values in props; e.g. rbg obj, string, etc.\n\n this.props.onColourSelected(rgbArg)\n\n this.setState({\n rgb,\n innerWheelOpen: true,\n centerCircleOpen: true\n }, () => {\n this.drawInnerWheel()\n this.drawCenterCircle()\n })\n }", "function mousePressed() {\n if (mouseButton === LEFT){\n // Check if mouse is inside the circle\n let d = dist(mouseX, mouseY, 360, 200);\n if (d < 100) {\n // Pick new random color values\n r[0] = 0;\n g[0] = 0;\n b[0] = 100;\n r[3] = 0;\n g[3] = 0;\n b[3] = 100;\n }}\n\n if (mouseButton === RIGHT){\n // Check if mouse is inside the circle\n let d = dist(mouseX, mouseY, 360, 200);\n if (d < 100) {\n // Pick new random color values\n r[0] = 100;\n g[0] = 0;\n b[0] = 0;\n r[2] = 100;\n g[2] = 0;\n b[2] = 0;\n r[4] = 0;\n g[4] = 100;\n b[4] = 0;\n }}\n\n\n\n if (mouseButton === LEFT){\n // Check if mouse is inside the circle\nlet d = dist(mouseX, mouseY, 580, 200);\nif (d < 100) {\n // Pick new random color values\n r[1] = 0;\n g[1] = 0;\n b[1] = 100;\n r[3] = 0;\n g[3] = 0;\n b[3] = 100;\n r[6] = 0;\n g[6] = 0;\n b[6] = 100;\n r[7] = 100;\n g[7] = 0;\n b[7] = 0;\n\n}}\n\n if (mouseButton === RIGHT){\n // Check if mouse is inside the circle\nlet d = dist(mouseX, mouseY, 580, 200);\n if (d < 100) {\n // Pick new random color values\nr[1] = 100;\ng[1] = 0;\nb[1] = 0;\nr[3] = 0;\ng[3] = 100;\nb[3] = 0;\nr[8] = 100;\ng[8] = 0;\nb[8] = 0;\n\n\n\n}}\n\n\n\n if (mouseButton === LEFT){\n // Check if mouse is inside the circle\n let d = dist(mouseX, mouseY, 800, 200);\n if (d < 100) {\n // Pick new random color values\n r[2] = 0;\n g[2] = 0;\n b[2] = 100;\n }}\n\n if (mouseButton === RIGHT){\n // Check if mouse is inside the circle\n let d = dist(mouseX, mouseY, 800, 200);\n if (d < 100) {\n // Pick new random color values\n r[2] = 100;\n g[2] = 0;\n b[2] = 0;\n r[4] = 0;\n g[4] = 100;\n b[4] = 0;\n r[8] = 100;\n g[8] = 0;\n b[8] = 0;\n }}\n\n\n\n if (mouseButton === LEFT){\n // Check if mouse is inside the circle\n let d = dist(mouseX, mouseY, 360, 420);\n if (d < 100) {\n // Pick new random color values\n r[3] = 0;\n g[3] = 0;\n b[3] = 100;\n r[5] = 0;\n g[5] = 100;\n b[5] = 0;\n r[7] = 0;\n g[7] = 0;\n b[7] = 100;\n\n }}\n\n if (mouseButton === RIGHT){\n // Check if mouse is inside the circle\n let d = dist(mouseX, mouseY, 360, 420);\n if (d < 100) {\n // Pick new random color values\n r[3] = 100;\n g[3] = 0;\n b[3] = 0;\n }}\n\n\n\n if (mouseButton === LEFT){\n // Check if mouse is inside the circle\n let d = dist(mouseX, mouseY, 580, 420);\n if (d < 100) {\n // Pick new random color values\n r[4] = 0;\n g[4] = 0;\n b[4] = 100;\n r[5] = 0;\n g[5] = 0;\n b[5] = 100;\n r[6] = 0;\n g[6] = 0;\n b[6] = 100;\n r[0] = 100;\n g[0] = 0;\n b[0] = 0;\n\n }}\n\n if (mouseButton === RIGHT){\n // Check if mouse is inside the circle\n let d = dist(mouseX, mouseY, 580, 420);\n if (d < 100) {\n // Pick new random color values\n r[4] = 100;\n g[4] = 0;\n b[4] = 0;\n r[1] = 100;\n g[1] = 0;\n b[1] = 0;\n r[3] = 0;\n g[3] = 100;\n b[3] = 0;\n }}\n\n\n\n if (mouseButton === LEFT){\n // Check if mouse is inside the circle\n let d = dist(mouseX, mouseY, 800, 420);\n if (d < 100) {\n // Pick new random color values\n r[5] = 0;\n g[5] = 0;\n b[5] = 100;\n r[8] = 0;\n g[8] = 0;\n b[8] = 100;\n r[1] = 0;\n g[1] = 100;\n b[1] = 0;\n r[4] = 100;\n g[4] = 0;\n b[4] = 0;\n\n\n\n\n\n }}\n\n if (mouseButton === RIGHT){\n // Check if mouse is inside the circle\n let d = dist(mouseX, mouseY, 800, 420);\n if (d < 100) {\n // Pick new random color values\n r[5] = 100;\n g[5] = 0;\n b[5] = 0;\n r[6] = 100;\n g[6] = 0;\n b[6] = 0;\n r[7] = 100;\n g[7] = 0;\n b[7] = 0;\n }}\n\n\n\n if (mouseButton === LEFT){\n // Check if mouse is inside the circle\n let d = dist(mouseX, mouseY, 360, 640);\n if (d < 100) {\n // Pick new random color values\n r[6] = 0;\n g[6] = 0;\n b[6] = 100;\n }}\n\n if (mouseButton === RIGHT){\n // Check if mouse is inside the circle\n let d = dist(mouseX, mouseY, 360, 640);\n if (d < 100) {\n // Pick new random color values\n r[6] = 100;\n g[6] = 0;\n b[6] = 0;\n }}\n\n\n\n if (mouseButton === LEFT){\n // Check if mouse is inside the circle\n let d = dist(mouseX, mouseY, 580, 640);\n if (d < 100) {\n // Pick new random color values\n r[7] = 0;\n g[7] = 0;\n b[7] = 100;\n r[1] = 0;\n g[1] = 0;\n b[1] = 100;\n r[2] = 0;\n g[2] = 100;\n b[2] = 0;\n\n\n }}\n\n if (mouseButton === RIGHT){\n // Check if mouse is inside the circle\n let d = dist(mouseX, mouseY, 580, 640);\n if (d < 100) {\n // Pick new random color values\n r[7] = 100;\n g[7] = 0;\n b[7] = 0;\n r[0] = 0;\n g[0] = 0;\n b[0] = 100;\n r[5] = 0;\n g[5] = 100;\n b[5] = 0;\n }}\n\n\n\n if (mouseButton === LEFT){\n // Check if mouse is inside the circle\n let d = dist(mouseX, mouseY, 800, 640);\n if (d < 100) {\n // Pick new random color values\n r[8] = 0;\n g[8] = 0;\n b[8] = 100;\n r[2] = 0;\n g[2] = 100;\n b[2] = 0;\n r[4] = 0;\n g[4] = 100;\n b[4] = 0;\n\n }}\n\n if (mouseButton === RIGHT){\n // Check if mouse is inside the circle\n let d = dist(mouseX, mouseY, 800, 640);\n if (d < 100) {\n // Pick new random color values\n r[8] = 100;\n g[8] = 0;\n b[8] = 0;\n r[6] = 100;\n g[6] = 0;\n b[6] = 0;\n }}\n\n\n\n\n\n\n//resetbutton\n if (mouseButton === LEFT){\n // Check if mouse is inside the circle\n let d = dist(mouseX, mouseY, 1000, 200);\n if (d < 50) {\n // Pick new random color values\n r[0] = 0;\n r[1] = 0;\n r[2] = 0;\n r[3] = 0;\n r[4] = 0;\n r[5] = 0;\n r[6] = 0;\n r[7] = 0;\n r[8] = 0;\n\n g[0] = 100;\n g[1] = 100;\n g[2] = 100;\n g[3] = 100;\n g[4] = 100;\n g[5] = 100;\n g[6] = 100;\n g[7] = 100;\n g[8] = 100;\n \n b[0] = 0;\n b[1] = 0;\n b[2] = 0;\n b[3] = 0;\n b[4] = 0;\n b[5] = 0;\n b[6] = 0;\n b[7] = 0;\n b[8] = 0;\n}}\n\nif (mouseButton === RIGHT){\n // Check if mouse is inside the circle\n let d = dist(mouseX, mouseY, 1000, 200);\n if (d < 50) {\n // Pick new random color values\n r[0] = 0;\n r[1] = 0;\n r[2] = 0;\n r[3] = 0;\n r[4] = 0;\n r[5] = 0;\n r[6] = 0;\n r[7] = 0;\n r[8] = 0;\n\n g[0] = 100;\n g[1] = 100;\n g[2] = 100;\n g[3] = 100;\n g[4] = 100;\n g[5] = 100;\n g[6] = 100;\n g[7] = 100;\n g[8] = 100;\n \n b[0] = 0;\n b[1] = 0;\n b[2] = 0;\n b[3] = 0;\n b[4] = 0;\n b[5] = 0;\n b[6] = 0;\n b[7] = 0;\n b[8] = 0;\n}}\n\n\n//winresetbuttonRED\nif (mouseButton === LEFT){\n // Check if mouse is inside the circle\n let d = dist(mouseX, mouseY, 580, 440);\n if (d < h[0]) {\n // Pick new random color values\n r[0] = 0;\n r[1] = 0;\n r[2] = 0;\n r[3] = 0;\n r[4] = 0;\n r[5] = 0;\n r[6] = 0;\n r[7] = 0;\n r[8] = 0;\n\n g[0] = 100;\n g[1] = 100;\n g[2] = 100;\n g[3] = 100;\n g[4] = 100;\n g[5] = 100;\n g[6] = 100;\n g[7] = 100;\n g[8] = 100;\n \n b[0] = 0;\n b[1] = 0;\n b[2] = 0;\n b[3] = 0;\n b[4] = 0;\n b[5] = 0;\n b[6] = 0;\n b[7] = 0;\n b[8] = 0;\n}}\n\nif (mouseButton === RIGHT){\n // Check if mouse is inside the circle\n let d = dist(mouseX, mouseY, 580, 440);\n if (d < h[0]) {\n // Pick new random color values\n r[0] = 0;\n r[1] = 0;\n r[2] = 0;\n r[3] = 0;\n r[4] = 0;\n r[5] = 0;\n r[6] = 0;\n r[7] = 0;\n r[8] = 0;\n\n g[0] = 100;\n g[1] = 100;\n g[2] = 100;\n g[3] = 100;\n g[4] = 100;\n g[5] = 100;\n g[6] = 100;\n g[7] = 100;\n g[8] = 100;\n \n b[0] = 0;\n b[1] = 0;\n b[2] = 0;\n b[3] = 0;\n b[4] = 0;\n b[5] = 0;\n b[6] = 0;\n b[7] = 0;\n b[8] = 0;\n}}\n\n//winresetbuttonBLUE\nif (mouseButton === LEFT){\n // Check if mouse is inside the circle\n let d = dist(mouseX, mouseY, 580, 440);\n if (d < h[1]) {\n // Pick new random color values\n r[0] = 0;\n r[1] = 0;\n r[2] = 0;\n r[3] = 0;\n r[4] = 0;\n r[5] = 0;\n r[6] = 0;\n r[7] = 0;\n r[8] = 0;\n\n g[0] = 100;\n g[1] = 100;\n g[2] = 100;\n g[3] = 100;\n g[4] = 100;\n g[5] = 100;\n g[6] = 100;\n g[7] = 100;\n g[8] = 100;\n \n b[0] = 0;\n b[1] = 0;\n b[2] = 0;\n b[3] = 0;\n b[4] = 0;\n b[5] = 0;\n b[6] = 0;\n b[7] = 0;\n b[8] = 0;\n}}\n\n//winresetbuttonBLUE\nif (mouseButton === RIGHT){\n // Check if mouse is inside the circle\n let d = dist(mouseX, mouseY, 580, 440);\n if (d < h[1]) {\n // Pick new random color values\n r[0] = 0;\n r[1] = 0;\n r[2] = 0;\n r[3] = 0;\n r[4] = 0;\n r[5] = 0;\n r[6] = 0;\n r[7] = 0;\n r[8] = 0;\n\n g[0] = 100;\n g[1] = 100;\n g[2] = 100;\n g[3] = 100;\n g[4] = 100;\n g[5] = 100;\n g[6] = 100;\n g[7] = 100;\n g[8] = 100;\n \n b[0] = 0;\n b[1] = 0;\n b[2] = 0;\n b[3] = 0;\n b[4] = 0;\n b[5] = 0;\n b[6] = 0;\n b[7] = 0;\n b[8] = 0;\n}}\n\n\n\n\nif (mouseButton === RIGHT){\n // Check if mouse is inside the circle\n let d = dist(mouseX, mouseY, 360, 200);\n if (d < 1000) {\n // Pick new random color values\n seed = random(255);\n \n }\n}\n\n\nif (mouseButton === LEFT){\n // Check if mouse is inside the circle\n let d = dist(mouseX, mouseY, 360, 200);\n if (d < 1000) {\n // Pick new random color values\n seed = random(255);\n \n }\n}\n}", "function my_mousedown(e) {\r\n\r\n // Setting color, width & radius values\r\n\r\n color = document.getElementById(\"color\").value;\r\n width = document.getElementById(\"width\").value;\r\n radius = document.getElementById(\"radius\").value;\r\n mouseEvent = \"mouseDown\";\r\n}", "function onClick(ev) {\n var coords = getCanvasXY(ev);\n var x = coords[0];\n var y = coords[1];\n\n//here is the problem....how do we know we clicked on canvas\n /*var fig=STACK.figures[STACK.figureGetMouseOver(x,y,null)];\n if(CNTRL_PRESSED && fig!=null){\n TEMPORARY_GROUP.addPrimitive();\n STACK.figureRemove(fig);\n STACK.figureAdd(TEMPORARY_GROUP);\n }\n else if(STACK.figureGetMouseOver(x,y,null)!=null){\n TEMPORARY_GROUP.primitives=[];\n TEMPORARY_GROUP.addPrimitive(fig);\n STACK.figureRemove(fig);\n }*/\n//draw();\n}", "show(){\n fill(255);\n circle(this.x, this.y, this.r);\n }", "function Circle(x, y, dx, dy, radius, minimumRadius) {\n this.x = x;\n this.y = y;\n this.dx = dx;\n this.dy = dy;\n this.radius = radius;\n this.minimumRadius = radius;\n this.color = colors[Math.round(Math.random() * colors.length - 1)];\n\n this.draw = function () {\n c.beginPath(); //need to have this beginPath to prevent the begin point connect to the previous\n c.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false);\n c.fillStyle = this.color;\n // c.fillStyle = colors[Math.round(Math.random()*colors.length - 1)] //randomize the color, but this will blink\n c.fill();\n };\n\n this.update = function() {\n this.x = this.x + this.dx;\n this.y = this.y + this.dy;\n c.beginPath();\n c.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false);\n\n if (this.x > innerWidth - this.radius || this.x < 0 + this.radius) {\n this.dx = -this.dx;\n };\n if (this.y > innerHeight - this.radius || this.y < 0 + this.radius) {\n this.dy = -this.dy;\n };\n\n //interactivity\n if (mouse.x - this.x < 50 && mouse.x - this.x > -50 && mouse.y - this.y < 50 && mouse.y - this.y > -50) {\n if(this.radius < maximumRadius){\n this.radius += 1;\n }\n } else if (this.radius > this.minimumRadius) {\n this.radius -= 1;\n } //make sure the circle have a distance from the mouse x horizontally and vertically\n //and make sure they are within the maximum and minimum radius range;\n\n this.draw();\n }\n\n}", "function changeScribbleColor(e){\n pureweb.getFramework().getState().setValue('ScribbleColor', document.getElementById('color').value);\n}", "function mouseClicked() {\n /*To make sure the mouse is inside the circle\n when clicked; the circle will move elsewhere\n on the screen*/\n var d = dist(mouseX, mouseY, x, y);\n if (d < radius) {\n newCircle();\n score++; //add a point when the circle is clicked\n }\n \n //add to the \"miss\" count when the player clicks outside the circle\n if (d > radius) {\n miss += 1;\n }\n //Shrink the circle slightly after every point\n if (score <= 65) {\n radius -= 1;\n }\n\n //Shrink the circle with every miss\n if (d > radius) {\n radius -= 1;\n }\n}", "function circle(){\n\tcanvas.onmousedown=circleDown;\n\tcanvas.onmouseup=circleUp;\n\tcanvas.onmousemove=circleMove;\n\t\t\n\tvar draw3=false;\n\tfunction circleDown(e){\n \t\timageData=context.getImageData(0,0,canvas.width,canvas.height);\n\t\tstartX= e.x - this.offsetLeft;\n \t\tstartY=e.y - this.offsetTop;\n \t\tdraw3=true;\n\t}\n\tfunction circleUp(e){\n\t\tdraw3=false;\n\t}\n\tfunction circleMove(e){\n\t\tif (draw3){\n\t\t\tcontext.putImageData(imageData,0,0);\n\t\t\n\t\t\trectWidth=(e.x - this.offsetLeft)-startX;\n\t\t\trectHeight=(e.y - this.offsetTop)-startY;\n\t \n\t\t\tvar radius=Math.sqrt(rectWidth*rectWidth+rectHeight*rectHeight)/2;\n\t\t\tcontext.beginPath();\n\t\t\tcontext.arc(startX,startY,radius,0,2*Math.PI);\t\t\t\n\n\t\t\tcontext.closePath();\n\t\t\tcontext.stroke();\n\t\t\tif (fillFlag==1){\n\t\t\t\tcontext.fill();\n\t\t\t}\n\t\t}\n\t}\n}", "function paint(event){\n event.target.style.backgroundColor = color;\n}", "function mouseclick(){\n\n\t\tvar stage = cmngl1.getStage();\n\t\tvar clickedresno;\n\t\tvar rectnamelist = cmsvg.rectnamelist();\n\t\tvar colorlist = cmsvg.colorlist();\n\t\tvar alignToSeq = cmsvg.alignToSeq();\n\t\tvar clickedatom = clickedatom1;\n\n\t\tstage.signals.clicked.add(\n\t\t\tfunction( pickingData ){\t\n\t\t\t\tif(pickingData && pickingData.atom){\n\t\t\t\t\tclickedresno = pickingData.atom.residueIndex;\n\n\n\t\t\t\t\tvar atominfo = \"\";\n\n\t\t\t\t\tif(alignArr[0].length === 0){\n\t\t\t\t\t\td3.selectAll(\".blue\").selectAll(\"rect\").style(\"fill\", \"steelblue\");\n\t\t\t\t\t\td3.selectAll(\"rect\").each(function(d){\t\n\t\t\t\t\t\t\tif(d[0] === clickedresno || d[1] === clickedresno){\n\t\t\t\t\t\t\t\td3.select(this).style(\"fill\",\"orange\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tatominfo = \"Clicked atom: \"+ \"[\" + pickingData.atom.resname + \"]\" + pickingData.atom.resno + pickingData.atom.inscode + \":\" + pickingData.atom.chainname + \".CA\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\n\t\t\t\t\tif(alignArr[0].length !== 0){\n\t\t\t\t\t\tfor(var i = 0 ; i < rectnamelist.length; i++){\n\t\t\t\t\t\t\tvar classname = \".\"+rectnamelist[i];\n\t\t\t\t\t\t\td3.selectAll(classname).selectAll(\"rect\").style(\"fill\", colorlist[i]).style(\"opacity\", 0.5);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar clickedprotein = pickingData.atom.residue.structure.name;\n\n\t\t\t\t\t\tvar proteinindex = -1;\n\t\t\t\t\t\tfor(var i = 0; i < pdbidlist.length; i++){\n\t\t\t\t\t\t\tvar currname = pdbidlist[i];\n\t\t\t\t\t\t\tif(currname === clickedprotein){\n\t\t\t\t\t\t\t\tproteinindex = i;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar curraligntoseq = alignToSeq[proteinindex];\n\t\t\t\t\t\t//i = id of the rect\n\t\t\t\t\t\t//d = data insert into rect \n\t\t\t\t\t\td3.selectAll(\"rect\").each(function(d){\n\t\t\t\t\t\t\tif(curraligntoseq[d[0]] === clickedresno || curraligntoseq[d[1]] === clickedresno){\n\t\t\t\t\t\t\t\td3.select(this).style(\"fill\",\"black\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tatominfo =\"Clicked protein: \" + clickedprotein + \", Clicked atom: \"+ \"[\" + pickingData.atom.resname + \"]\" + pickingData.atom.resno + pickingData.atom.inscode + \":\" + pickingData.atom.chainname + \".CA\";\n\t\t\t\t\t}\n\n\t\t\t\t\tdocument.getElementById(clickedatom).innerHTML= atominfo;\n\t\t\t\t}\n\n\t\t\t\telse{\n\t\t\t\t\tif(alignArr[0].length === 0){\n\t\t\t\t\t\td3.selectAll(\".blue\").selectAll(\"rect\").style(\"fill\", \"steelblue\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\n\t\t\t\t\tif(alignArr[0].length !== 0){\n\t\t\t\t\t\tfor(var i = 0 ; i < rectnamelist.length; i++){\n\t\t\t\t\t\t\tvar classname = \".\"+rectnamelist[i];\n\t\t\t\t\t\t\td3.selectAll(classname).selectAll(\"rect\").style(\"fill\", colorlist[i]).style(\"opacity\", 0.5);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdocument.getElementById(clickedatom).innerHTML = \"Clicked nothing\";\n\t\t\t\t}\n\t\t\t} \n\t\t);\n\t}", "function mouseMove(e) {\n if (clickObj.ele.id == String(c.sv.box).replace(/[#.]/g,'')) {\n // Saturation/Value box\n var satVal = moveSatValMarker(e.clientX - clickObj.parentLeft, e.clientY - clickObj.parentTop);\n c.color.sat = satVal.sat;\n c.color.val = satVal.val;\n debugObj.setHSV(c.color.hue, c.color.sat, c.color.val);\n refreshSelectorColors(c.color.hue, c.color.sat, c.color.val);\n \n } else if (clickObj.ele.id == String(c.hue.box).replace(/[#.]/g,'')) {\n // Hue box\n c.color.hue = moveHueMarker(e.clientY - clickObj.parentTop);\n debugObj.setHSV(c.color.hue, c.color.sat, c.color.val);\n refreshSelectorColors(c.color.hue, c.color.sat, c.color.val);\n } else if (clickObj.ele.id == String(c.name).replace(/[#.]/g,'')) {\n // Color Selector window\n $(c.name).css('left', e.clientX - clickObj.parentLeft);\n $(c.name).css('top', e.clientY - clickObj.parentTop);\n };\n e.preventDefault();\n e.stopPropagation();\n return true;\n }", "function drawCircle(radius, x, y) { svg.append(\"circle\").attr(\"fill\", \"red\").attr(\"r\", radius).attr(\"cx\", x).attr(\"cy\", y); }", "function newcircle(name, transcost, info, type){\n var figure = new draw2d.shape.basic.Circle({height: 40, width:40});\n var title\n\n figure.userData = {\"name\": String(name), \"transcost\": transcost, \"addinfo\": info}\n figure.add(new draw2d.shape.basic.Label({text:figure.userData.name, stroke:0}), new draw2d.layout.locator.BottomLocator())\n figure.setSelectable(false)\n figure.setDraggable(false)\n\n if (type == 'raw' ){\n var rawcolor = new draw2d.util.Color(\"#f7ee36\")\n figure.resetPorts();\n figure.createPort(\"output\", new draw2d.layout.locator.RightLocator()).setSelectable(false).setResizeable(false)\n figure.setBackgroundColor(rawcolor)\n figure.setColor(rawcolor.darker())\n title = \"Raw Material Information\"\n }\n\n if (type == 'final'){\n var rawcolor = new draw2d.util.Color(\"#2ad148\")\n figure.resetPorts();\n figure.createPort(\"input\", new draw2d.layout.locator.LeftLocator()).setSelectable(false).setResizeable(false)\n figure.setBackgroundColor(rawcolor)\n figure.setColor(rawcolor.darker())\n title = \"Final Product Information\"\n }\n\n if (type == 'int') {\n var rawcolor = new draw2d.util.Color(\"#3ea9f0\")\n figure.resetPorts();\n figure.createPort(\"input\", new draw2d.layout.locator.LeftLocator()).setSelectable(false).setResizeable(false)\n figure.createPort(\"output\", new draw2d.layout.locator.RightLocator()).setSelectable(false).setResizeable(false)\n figure.setBackgroundColor(rawcolor)\n figure.setColor(rawcolor.darker())\n title = \"Intermediate Product Information\"\n }\n\n figure.on(\"dblclick\", function(emitter, event) {\n $('.productinfo').html(\"\");\n var productinfoHTML = '<p> *Product name: </p> <input class=\"ajs-input\" id=\"inpOne\" type=\"text\" value = \"'+ String(figure.userData.name)+ '\" /> <p> *Transportation cost [USD/tonne/km]: </p> <input class=\"ajs-input\" id=\"inpTwo\" type=\"number\" step = 0.1 min = 0 value = \"'+String(figure.userData.transcost)+'\" /> <p> Additional information: </p> <input class=\"ajs-input\" id=\"inpThree\" type=\"text\" value = \"'+String(figure.userData.addinfo)+'\" />';\n\n\n alertify.confirm(productinfoHTML).set('onok', function(closeEvent) {\n\n var prodname = $('#inpOne').val();\n var transcost = $('#inpTwo').val();\n var addinfo = $('#inpThree').val();\n\n\n if (prodname != \"\" && transcost != \"\"){\n if (transcost < 0) {\n alertify.error('Input not valid!');}\n else{\n figure.resetChildren()\n figure.add(new draw2d.shape.basic.Label({text:prodname, stroke: 0}), new draw2d.layout.locator.BottomLocator());\n figure.userData = {\"name\": prodname, \"transcost\": transcost, \"addinfo\": addinfo}\n }\n } else {\n alertify.error('Please enter required information!');\n }\n $('.productinfo').html(empty_prod_form)\n }).set('oncancel', function(closeEvent){\n $('#inpOne')[0].value = figure.userData.name;\n $('#inpTwo')[0].value = figure.userData.transcost;\n $('#inpThree')[0].value = figure.userData.addinfo;\n $('.productinfo').html(empty_prod_form)}).set('title', title).set('labels', {ok:'Ok', cancel:'Cancel'}).set('closable',false);\n })\n\n return figure\n}", "function circle(x,y,r) {\n ctx.fillStyle= \"#00BFFF\";\n //this colours my circle blue\n ctx.beginPath();\n ctx.arc(x, y, r, 0, Math.PI*2, true);\n ctx.closePath();\n ctx.fill();\n \n}", "function createCircle(colour) {\n var colour = colour || getRandomColour();\n var $circle = $(\"<div>\").addClass('circle ' + colour);\n $circle.css(getRandomPosition());\n // so overlapping circles don't give away the hidden circles\n // brings non hidden circles up 1 layer\n if (colour !== startColour) {\n $circle.css('z-index', 1);\n }\n $('#circles-area').append($circle);\n $circle.click(function() {\n // toggle glow around clicked circle\n $circle.toggleClass('glow');\n });\n}", "function drawCircle(ctx, center, r, sc, lw, fc, mousePos, withPoints){\n\t\tif(!center) return;\n\t\tvar x = center.x, y = center.y;\n\t\tctx.strokeStyle = sc || ctx.strokeStyle;\n\t\tctx.lineWidth = lw || ctx.lineWidth;\n\t\tctx.fillStyle = fc || ctx.fillStyle;\n\t\t\n\t\t//if the r parameter is null, it means that we are constructing a circle, so we determine the radius based on the mouse position\n\t\tif(!r){\n\t\t\tr = Math.sqrt((mousePos['x'] - x)*(mousePos['x'] - x) + (mousePos['y'] - y)*(mousePos['y'] - y));\n\t\t\t\n\t\t\t//also, we connect the center point with the pouse position, drawing a radius\n\t\t\tdrawLine(ctx, center, mousePos, sc, lw);\n\t\t}\n\t\tctx.beginPath();\n\t\tctx.arc(x, y, r, 0, 2 * Math.PI, false);\n\t\tctx.fill();\n\t\tctx.closePath();\n\t\tctx.stroke();\n\t\t\n\t\t//if we are in the edit mode and this circle is selected\n\t\tif(withPoints){\n\t\t\tsetPoint(ctx, center, M.radius, M.curColor, M.lineWidth, M.curColor);\n\t\t\tdrawLine(ctx, center, {x:center.x + r, y:center.y}, sc, lw);\n\t\t\tsetPoint(ctx, {x:center.x + r, y:center.y}, 4, M.curColor, M.lineWidth, M.curColor);\n\t\t\tdrawLine(ctx, center, {x:center.x - r, y:center.y}, sc, lw);\n\t\t\tsetPoint(ctx, {x:center.x - r, y:center.y}, 4, M.curColor, M.lineWidth, M.curColor);\n\t\t\tdrawLine(ctx, center, {x:center.x, y:center.y + r}, sc, lw);\n\t\t\tsetPoint(ctx, {x:center.x, y:center.y + r}, 4, M.curColor, M.lineWidth, M.curColor);\n\t\t\tdrawLine(ctx, center, {x:center.x, y:center.y - r}, sc, lw);\n\t\t\tsetPoint(ctx, {x:center.x, y:center.y - r}, 4, M.curColor, M.lineWidth, M.curColor);\n\t\t}\n\t}", "function clickShape() {\n\tidName('shape-layer').style.pointerEvents = 'auto';\n\tclassName('upper-canvas')[0].style.pointerEvents = 'auto';\n\tidName('paint-layer').style.pointerEvents = 'none';\n}", "function circleMoreRed(){\n r = r + 40;\n}", "function draw(e) {\n e.target.style.backgroundColor = \"rgb(0,0,0)\";\n}", "onClick(event) {\n\t\t// console.log(\"mouse click\");\n\t\tthis.draw(event);\n\t}", "function drawCircle(x,y,radius,color)\r\n{\r\n\tdrawArc(x, y, radius, 0, Math.PI * 2, color);\r\n}", "function mouseoutCircle() {\n\n\t// Get circle\n\tvar circle = d3.select(this);\n\n\t// Display idle circle\n\tcircle.attr(\"r\", circle.attr(\"r\") / circleEnlargeConstant);\n\n}", "function draw() {\n let isClicked = false;\n const cells = document.querySelectorAll('.container-item');\n\n cells.forEach((item) => item.addEventListener('mousedown', () => {\n isClicked = true;\n }));\n\n cells.forEach((item) => item.addEventListener('mousemove', (event) => {\n if (isClicked === true) {\n event.target.style.background = colors[currentColor];\n }\n }));\n\n cells.forEach((item) => item.addEventListener('mouseup', () => {\n isClicked = false;\n }));\n}", "function mouseMoved(){\n stroke(r, g, b, 120);\n strokeWeight(5);\n fill(r, g, b, 100);\n ellipse(mouseX, mouseY, 10);\n}" ]
[ "0.79036605", "0.73699594", "0.7361039", "0.7254562", "0.72188544", "0.7134071", "0.7116854", "0.70512164", "0.7038741", "0.7017429", "0.6928681", "0.6914697", "0.6912164", "0.6903515", "0.688787", "0.68528533", "0.6838384", "0.68348575", "0.6834563", "0.6782425", "0.67741406", "0.6759038", "0.6710348", "0.6708937", "0.67027986", "0.6701781", "0.66822547", "0.66676086", "0.666111", "0.663766", "0.6624645", "0.6612863", "0.65909946", "0.6567966", "0.654881", "0.65400803", "0.65380114", "0.65195644", "0.6519425", "0.6513752", "0.65062916", "0.65057564", "0.6492754", "0.64860296", "0.64792156", "0.6476856", "0.6476573", "0.6476573", "0.64723915", "0.64532346", "0.64412785", "0.6420264", "0.6420239", "0.64121455", "0.6395697", "0.63928473", "0.6392369", "0.6390427", "0.6388217", "0.6340331", "0.63402605", "0.6335806", "0.633302", "0.6331253", "0.63258696", "0.63221484", "0.6316769", "0.6316394", "0.63084716", "0.6282852", "0.62746507", "0.62700534", "0.62663174", "0.62662154", "0.6265575", "0.62625384", "0.6262185", "0.6253784", "0.6239057", "0.62389886", "0.62342", "0.6229073", "0.6227994", "0.62245834", "0.6224212", "0.62205076", "0.62180555", "0.6215564", "0.6210101", "0.6206335", "0.62057215", "0.6203585", "0.6194624", "0.61930305", "0.61895543", "0.6176283", "0.61694384", "0.6164643", "0.6149162", "0.614419" ]
0.68567854
15
5 ways to customize the infowindow 2015 en.marnoto.com
function getSellNearby(positon) { latitude = positon.latitude; longitude = positon.longitude; jQuery.ajax({ url:baseURL + 'json/mapsjson', type:'POST', data: {lat: latitude, lng: longitude ,form : form}, error: function(xhr, status, err) { //console.log('error'); //console.log(xhr, status, err); }, success:function(data){ var i = 1; clearMarkers(); jQuery.each(data, function(key,value){ if( value.price != 'Thương lượng' ) { var html = '<div class="modal-content '+value.ads+'">\n'; html += '<div class="modal-header">\n'; value.ads == "hot" ? html += '<div class="hot"><p>HOT</p></div>\n' : null; html += '<button type="button" class="close" data-dismiss="modal" title="Đóng">&times;</button>\n'; html += '<a href="'+value.link+'" target="_blank"><img data-src="'+value.image+'"></a>\n'; html += '</div>\n'; html += '<div class="modal-body">\n'; html += '<h4><a href="'+value.link+'" target="_blank">'+value.title+'</a></h4>\n'; html += '<br/>\n'; html += '<p class="gia">\n'; html += '<span class="price_top">'+value.pricediv+'/</span>\n'; html += '<span class="area_top">'+value.sqft+'</span>\n'; html += '</p>\n'; html += '<p class="giadientich">Giá/ diện tích '+value.price_app+'</p>\n'; html += '<p class="location"><i class="fa fa-map-marker"></i> '+value.adress+'</p>\n'; html += '<table>\n'; html += '<tr>\n'; html += '<td style="width: 20%;"><i class="fa fa-home"></i></td>\n'; html += '<td style="width: 40%;">Diện tích </td>\n'; html += '<td style="width: 40%;">'+value.sqft+'</td>\n'; html += '</tr>\n'; html += '<tr>\n'; html += '<td><i class="fa fa-bed"></i></td>\n'; html += '<td>Phòng ngủ </td>\n'; html += '<td>'+value.user+'</td>\n'; html += '</tr>\n'; html += '<tr>\n'; html += '<td><i class="fa fa-calendar"></i></td>\n'; html += '<td>Ngày đăng </td>\n'; html += '<td>'+value.date+'</td>\n'; html += '</tr>\n'; html += '</table>\n'; html += '<p class="content">'+value.content+'</p>\n'; html += '</div>\n'; html += '<div class="modal-footer">\n'; html += '<a class="btn btn-succes" target="_blank" href="'+value.link+'">Xem</a>\n'; html += '</div>\n'; html += '</div>\n'; createMarker(new google.maps.LatLng(value.latitude, value.longitude), i, html, value.price, value._class, value.link); i = i + 1; } }); var image = baseURL + 'frontend/images/icon-map.png'; marker = new MarkerWithLabel({ position: new google.maps.LatLng( latitude, longitude ), map: map, icon: image, zIndex: -9, optimized: false, }); markers.push(marker); jQuery('#basic').sly('reload'); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setInfowindowMarkup(info) {\n return '<h4>'+ info['name'] +'</h4>' +\n '<p>'+ info['street'] + ' ' + info['city'] + ' ' + info['state'] + '</p>';\n}", "function modifyInfoWindowCss() {\n\tvar c = document.querySelector(\".gm-style-iw\");\n\n\t//these lines change the right and width css elements of the infowindow so that the close button \"floats\" on top of the content added to the window\n\tc.style.setProperty(\"right\", c.style.left, \"important\");\n\tc.style.setProperty(\"margin\", \"0 auto\");\n\tc.style.setProperty(\"padding-left\", \"0\");\n\tc.style.setProperty(\"padding-right\", \"0\");\n\n\t//the lines below affect the infowindow close button. you can use this path in the DOM to change other css\n\t//c.nextElementSibling.style.setProperty(\"position\", \"absolute\");\n\tc.nextElementSibling.style.setProperty('display', 'none', 'important');\n\t//c.nextElementSibling.style.setProperty('top', '30');\n\t//this value moves the clsoe button up and down\n\t//c.nextElementSibling.style.setProperty('right', '0');\n\t//this value moves the close button left and right.\n\t//c.nextElementSibling.style.setProperty('border', '1px dotted red');\n\n\t//the lines below affect the infowindow class itself. you can use this path in the dom to change other css\n\t//c.parentNode.style.setProperty('border','2px dotted black');\n\n}", "function createInfoWindow(KMLEvent_latLng, infoData) {\r\n CommonInfoWindow.close();\r\n //$(\"#map-loader\").hide();\r\n\r\n var content = \"<div class='content infoDiv'>\";\r\n if (infoData.establishments.length > 1) {\r\n content += \"<div class='row infoRow'><div class='col-md-12'><span class='infoImportant'>\" + infoData.address + \"</span></div></div>\";\r\n content += \"<div class='row infoRow infoHeader'><div class='col-md-12'>\" + infoData.establishments.length + \" establishments at this address</div></div>\";\r\n } else {\r\n content += \"<div class='row infoRow infoHeader'><div class='col-md-12'><span class='infoImportant'>\" + infoData.address + \"</span></div></div>\";\r\n \r\n }\r\n for (var i = 0; i < infoData.establishments.length; i++) {\r\n content += \"<div class='row infoRow'><div class='col-md-12'><img src='\" + statusIcons[infoData.establishments[i].status].medium + \"'>&nbsp;&nbsp;<span class='infoImportant orgLink'><a href='#' data-id='\" + infoData.establishments[i].estId + \"'>\" + infoData.establishments[i].name + \"</a></span></div></div>\";\r\n }\r\n content += \"<div class='row infoRow'><div class='col-md-12'><a class='svLink' href='#' data-latlng='\" + KMLEvent_latLng + \"'><img src='\" + STREET_VIEW_ICON + \"' alt='StreetView'></a></div></div>\";\r\n \r\n //} \r\n content += \"</div>\"; \r\n CommonInfoWindow.setOptions({ \"position\": KMLEvent_latLng,\r\n \"pixelOffset\": 0, //KMLEvent.pixelOffset,\r\n \"content\": content}); //KMLEvent.featureData.infoWindowHtml.replace(/ target=\"_blank\"/ig, \"\") });\r\n CommonInfoWindow.open(gblMap);\r\n}", "function initialize() {\n infoWindow = new google.maps.InfoWindow();\n\n /*\n * infoWindow customization, referenced from:\n * http://en.marnoto.com/2014/09/5-formas-de-personalizar-infowindow.html\n */\n google.maps.event.addListener(infoWindow, 'domready', function() {\n\n // Reference to the DIV which receives the contents of the infowindow using jQuery\n var iwOuter = $('.gm-style-iw');\n\n var iwBackground = iwOuter.prev();\n\n // Remove the background shadow DIV\n iwBackground.children(':nth-child(2)').css({'display' : 'none'});\n\n // Remove the white background DIV\n iwBackground.children(':nth-child(4)').css({'display' : 'none'});\n\n// Moves the arrow 70px to the left margin\n iwBackground.children(':nth-child(3)').attr('style', function(i,s){ return s + 'left: 70px !important; bottom: 5px !important;'});\n\n iwBackground.children(':nth-child(3)').find('div').children().css({'z-index' : '1',\n 'border': '5px solid ' + rating.colour});\n iwOuter.css({'max-width': '160px', 'width':'160px', 'border': '5px solid ' + rating.colour});\n\n var iwCloseBtn = iwOuter.next();\n\n// Reposition the button\n iwCloseBtn.css({\n opacity: '1', // by default the close button has an opacity of 0.7\n right: '20px', top: '20px', // button repositioning\n });\n });\n // initialize map\n var mapOptions = {\n zoom: 10,\n center: new google.maps.LatLng(-37.8141,144.9633),\n streetViewControl: false,\n mapTypeControl: false,\n fullscreenControl: false\n };\n map = new google.maps.Map(document.getElementById('mapDemo'),\n mapOptions);\n\n\n //configure search bar\n input = document.getElementById('search');\n\n //restrict the search and autocomplete to VIC\n searchBound = new google.maps.LatLngBounds(\n new google.maps.LatLng(-38.54816, 144.42077),\n new google.maps.LatLng(-37.35269, 145.49743)\n );\n var option = {\n bounds: searchBound,\n strictBounds: true\n }\n autoCom = new google.maps.places.Autocomplete(input, option);\n\n geoCodingService = new google.maps.Geocoder; //initialise geocoding\n\n //perform auto search function, results automatically show if choose suggested location, or hit enter to do the search\n autoCom.addListener('place_changed', function() {\n placeSearched = autoCom.getPlace();\n if (!placeSearched || !placeSearched.geometry) {\n manualLookUp(); //if it's not a valid place object, perform a geocoding search to find location\n } else { //get risk info and display to website\n $('#search').addClass('searchBarLoading');\n locationInfoByCoords(placeSearched.geometry.location.lat(), placeSearched.geometry.location.lng());\n }\n });\n\n//request pm10 data and store it\n $.ajax({\n url: 'scripts/pm10Request.php',\n type: 'GET'\n }).done(function(res) {\n pm10Measures = res;\n }).fail(function() {\n alert('Oops, Something wrong at the back');\n pm10Measures = '[]';\n }).always(function() {\n displayDefault(); //function to display the default locations when loading the page\n initLocate(); //function to location user current location when loading the page\n });\n\n\n //add listener for user to click to view default location info from pop up and info box\n map.data.addListener('click', function(event) {\n displayInfoInBox(event.feature.getProperty(\"city\"), event.feature.getProperty(\"riskScore\"));\n infoWindow.setContent(\n setInfoWindowContent(event.feature.getProperty(\"city\"),\n event.feature.getProperty(\"temp\"),\n event.feature.getProperty(\"weather\"),\n event.feature.getProperty(\"riskScore\"))\n );\n infoWindow.setOptions({\n position:{\n lat: event.latLng.lat(),\n lng: event.latLng.lng()\n },\n pixelOffset: {\n width: -13,\n height: -20\n }\n });\n infoWindow.open(map);\n });\n}", "function displayInfobox(e) {\n infowindow.setOptions({description: e.target.Description, visible: true, showPointer: false});\n infowindow.setLocation(e.target.getLocation());\n }", "showInfoWindow(){\n var infowindow = $(\"#infoiwnd\");\n infowindow.removeClass(\"d-none\");\n infowindow.addClass(\"d-block\");\n }", "function populateInfoWindow(infowindow, location) {\n if (infowindow.marker != location.marker) {\n if (infowindow.marker != undefined) {\n infowindow.marker.setIcon('http://maps.google.com/mapfiles/ms/icons/red-dot.png');\n }\n\n infowindow.marker = location.marker;\n location.marker.setIcon('http://maps.google.com/mapfiles/ms/icons/green-dot.png');\n infowindow.setContent('<img style=\"border-radius: 100%; float: right\" src=\"' + location.img + '\">' + '<div><h1>' + location.marker.title + '</h1></div>' +\n '<div style=\"text-transform: capitalize\">' + location.weather + '</div>' + '<div>' + location.temp.toFixed(2) + '&degC</div>' +\n '<div>' + location.description + '</div>');\n infowindow.open(map, location.marker);\n infowindow.addListener('click', function() {\n location.marker.setIcon('http://maps.google.com/mapfiles/ms/icons/red-dot.png');\n infowindow.setMarker(null);\n });\n } else {\n infowindow.marker = null;\n location.marker.setIcon('http://maps.google.com/mapfiles/ms/icons/red-dot.png');\n infowindow.close();\n }\n}", "function InfoBox(opt_opts){opt_opts=opt_opts||{};google.maps.OverlayView.apply(this,arguments);this.content_=opt_opts.content||\"\";this.disableAutoPan_=opt_opts.disableAutoPan||false;this.maxWidth_=opt_opts.maxWidth||0;this.pixelOffset_=opt_opts.pixelOffset||new google.maps.Size(0,0);this.position_=opt_opts.position||new google.maps.LatLng(0,0);this.zIndex_=opt_opts.zIndex||null;this.boxClass_=opt_opts.boxClass||\"infoBox\";this.boxStyle_=opt_opts.boxStyle||{};this.closeBoxMargin_=opt_opts.closeBoxMargin||\"2px\";this.closeBoxURL_=opt_opts.closeBoxURL||\"//www.google.com/intl/en_us/mapfiles/close.gif\";if(opt_opts.closeBoxURL===\"\"){this.closeBoxURL_=\"\";}\nthis.infoBoxClearance_=opt_opts.infoBoxClearance||new google.maps.Size(1,1);if(typeof opt_opts.visible===\"undefined\"){if(typeof opt_opts.isHidden===\"undefined\"){opt_opts.visible=true;}else{opt_opts.visible=!opt_opts.isHidden;}}\nthis.isHidden_=!opt_opts.visible;this.alignBottom_=opt_opts.alignBottom||false;this.pane_=opt_opts.pane||\"floatPane\";this.enableEventPropagation_=opt_opts.enableEventPropagation||false;this.div_=null;this.closeListener_=null;this.moveListener_=null;this.contextListener_=null;this.eventListeners_=null;this.fixedWidthSet_=null;}", "function createInfoWindow (marker){\n // Create the InfoWindow\n var infoWindow = new google.maps.InfoWindow();\n // Create StreetViewService to show a street view window for marker location or nearest places within 50 meter\n var StreetViewService = new google.maps.StreetViewService();\n var radius = 50;\n //Create an onclick event listener to open\n marker.addListener('click', function(){\n infoWindow.marker = marker;\n infoWindow.setContent('<div Id=\"infoWindowDiv\"><h5>' + marker.title +'</h5></div>');\n\n //** One options to be displayed in InfoWindow **//\n /* 1) Displaying Wikipedia articals: */\n var wikiURL = 'http://en.wikipedia.org/w/api.php?action=opensearch&search=' + marker.title + '&format=json&callback=wikiCallback';\n var wikiRequestTimeout = setTimeout(function() {\n alert(\"failed to load wikipedia resources\");\n }, 8000);\n $.ajax({\n url: wikiURL,\n dataType: \"jsonp\",\n success: function(response) {\n var articalsList = response[1];\n var atricalTitle ;\n $('#infoWindowDiv').append('<div Id=\"wikiDiv\"><ul id=\"wikiListItem\"></ul></div>');\n for (var i = 0 , length = articalsList.length; i < length && i < 4 ; i++ ){\n atricalTitle = articalsList[i];\n $('#wikiListItem').append('<li><a href=\"http://en.wikipedia.org/wiki/'+atricalTitle+'\">'+atricalTitle+'</a></li>');\n }\n clearTimeout(wikiRequestTimeout);\n },\n });\n infoWindow.open(map, marker);\n });\n\n\n //** Other options to be displayed in InfoWindow **//\n /* 2) Displaying an Image usign URL parameters: (Note: Not working well for some reasons)\n -------> Should be placed before infoWindow.Open()\n\n $('#pano').append('<img src= https://maps.googleapis.com/maps/api/streetview?'+\n 'size=200x150&location='+marker.position+'&heading=151.78&pitch=-0.76'+\n '&key=AIzaSyBpcOjPqBYX5nfyfSKIUp3NXwUIiQHP0lQ></img>'); */\n\n /* 3) Displaying an Street view object: (Note: Not working well for some reasons)\n -------> Should be placed before infoWindow.Open()\n StreetViewService.getPanoramaByLocation(marker.position, radius, getViewStreet);\n function getViewStreet(data, status){\n if (status === 'Ok'){\n infoWindow.setContent('<div><h5>' + marker.title +'</h5><div Id=\"pano\"></div></div>');\n var nearViewStreetLocation = data.location.latLng;\n var heading = google.map.geometry.spherical.computeHeading(nearViewStreetLocation, marker.position);\n var panoramaOptions = {\n position : nearViewStreetLocation,\n pov :{ heading: heading, pitch: 30 }\n };\n var panorama = new google.maps.StreetViewPanorama(document.getElementById('pano'),panoramaOptions);\n map.setStreetView(panorama);\n }\n else{\n infoWindow.setContent('<div><h5>' + marker.title +'</h5><div>No Street View Found</div></div>');\n }\n }*/\n\n }", "function createInfoWindow(marker, content) {\n // open info window with created content\n infoWindow = new google.maps.InfoWindow({\n content: content\n });\n\n infoWindow.open(map, marker);\n \n // turn popover windows on\n $('[data-toggle=\"popover\"]').popover();\n\n // to close mobile popovers\n $('[data-toggle=\"popover\"]').click(function(evt) {\n $(this).popover(\"hide\");\n });\n\n\n }", "function InfoBox(opt_opts){opt_opts=opt_opts||{};google.maps.OverlayView.apply(this,arguments);this.content_=opt_opts.content||\"\";this.disableAutoPan_=opt_opts.disableAutoPan||false;this.maxWidth_=opt_opts.maxWidth||0;this.pixelOffset_=opt_opts.pixelOffset||new google.maps.Size(0,0);this.position_=opt_opts.position||new google.maps.LatLng(0,0);this.zIndex_=opt_opts.zIndex||null;this.boxClass_=opt_opts.boxClass||\"infoBox\";this.boxStyle_=opt_opts.boxStyle||{};this.closeBoxMargin_=opt_opts.closeBoxMargin||\"2px\";this.closeBoxURL_=opt_opts.closeBoxURL||\"http://www.google.com/intl/en_us/mapfiles/close.gif\";if(opt_opts.closeBoxURL===\"\"){this.closeBoxURL_=\"\";}\nthis.infoBoxClearance_=opt_opts.infoBoxClearance||new google.maps.Size(1,1);this.isHidden_=opt_opts.isHidden||false;this.alignBottom_=opt_opts.alignBottom||false;this.pane_=opt_opts.pane||\"floatPane\";this.enableEventPropagation_=opt_opts.enableEventPropagation||false;this.div_=null;this.closeListener_=null;this.eventListener1_=null;this.eventListener2_=null;this.eventListener3_=null;this.moveListener_=null;this.contextListener_=null;this.fixedWidthSet_=null;}", "function infoWindows(marker, data) {\n //Event listener for when a marker i clicked \n google.maps.event.addListener(marker, \"click\", function (e) {\n //Wrap the content inside an HTML DIV in order to set height and width of InfoWindow.\n infoWindow.setContent(\"<div style = 'max-height:300px'>\" + \"<p style='font-size: 24px; text-color: red;'><strong>Meetup only supports location accuracy by zip code within the USA, Canda and GB</strong></p><br><p style='font-size: 18px;'>Here is a list of all the Meetups in the city of \" + data.city + ':' + '</p><br><a style=\"font-size: 18px;\" href=\"http://www.meetup.com/cities/'+data.country+'/'+data.city+'\" target=\"blank\">List of all Meetups in '+data.city+'</a></div>');\n //Open the markers infowindow\n infoWindow.open(map, marker);\n });\n }", "function initMap() {\n var cbnu = { lat: 36.629695, lng: 127.456253 } //일단 지도 중심은 학교로 설정\n var map = new google.maps.Map(document.getElementById('map'), {\n zoom: 15,\n center: cbnu,\n })\n\n // markers 배열\n var marker, i\n for (i = 0; i < markers.length; i++) {\n marker = new google.maps.Marker({\n id: i,\n position: new google.maps.LatLng(markers[i][0], markers[i][1]),\n map: map,\n })\n }\n\n // 마커 클릭하면 정보 표시\n var infowindow = new google.maps.InfoWindow()\n google.maps.event.addListener(\n marker,\n 'click',\n (function (marker, i) {\n return function () {\n //html로 표시될 인포 윈도우의 내용\n infowindow.setContent(\n '<div class=\"wrap\"><div class=\"text-box\"><h6>작가1</h6><div class=\"img-box\"><img src=\"현근창1.jpg\"></div><div><a class=\"material-icons\" href=\"first.html\">perm_identity</a>정보보기</div><div><a class=\"material-icons\" href=\"first.html\">chat_bubble</a>채팅하기</div></div>'\n )\n\n //인포윈도우가 표시될 위치\n infowindow.open(map, marker)\n }\n })(marker, i)\n )\n}", "function InfoBox(a){a=a||{};google.maps.OverlayView.apply(this,arguments);this.content_=a.content||\"\";this.disableAutoPan_=a.disableAutoPan||false;this.maxWidth_=a.maxWidth||0;this.pixelOffset_=a.pixelOffset||new google.maps.Size(0,0);this.position_=a.position||new google.maps.LatLng(0,0);this.zIndex_=a.zIndex||null;this.boxClass_=a.boxClass||\"infoBox\";this.boxStyle_=a.boxStyle||{};this.closeBoxMargin_=a.closeBoxMargin||\"2px\";this.closeBoxURL_=a.closeBoxURL||\"http://www.google.com/intl/en_us/mapfiles/close.gif\";if(a.closeBoxURL===\"\"){this.closeBoxURL_=\"\"}this.infoBoxClearance_=a.infoBoxClearance||new google.maps.Size(1,1);if(typeof a.visible===\"undefined\"){if(typeof a.isHidden===\"undefined\"){a.visible=true}else{a.visible=!a.isHidden}}this.isHidden_=!a.visible;this.alignBottom_=a.alignBottom||false;this.pane_=a.pane||\"floatPane\";this.enableEventPropagation_=a.enableEventPropagation||false;this.div_=null;this.closeListener_=null;this.moveListener_=null;this.contextListener_=null;this.eventListeners_=null;this.fixedWidthSet_=null}", "function toggleInfoWindow(event){\t\t\n\t\tif (!self.infowindow)\n\t\t\t// console.log(event.latLng);\n\t\t\t// console.log(self.message);\n\t\t\t initInformationWindow(event.latLng, self.message);\n\t\t\t \n\t\tif (self.infowindow.getMap())\n\t\t\tself.infowindow.close();\n\t\telse\n\t\t\tself.infowindow.open(GoogleMaps.map, self.marker);\n\t\t// Show flicker api images\n\t\t//alert('http://'+window.location.host + '/studier/API-programmering/Uppgift-4-App/ShareYourVacation/public/api/flickr?lat='+self.location_lat+'&lng='+self.location_lng);\n\t\tGoogleMaps.ajax = new Ajax();\n\t\tGoogleMaps.ajax.get( 'http://'+window.location.host + '/studier/API-programmering/Uppgift-4-App/ShareYourVacation/public/api/flickr?lat='+self.location_lat+'&lng='+self.location_lng , parseFlickrImages);\n\n\t}", "function testInfoWindow(){\n var infoWindow = new google.maps.InfoWindow({\n content: \"<div class='latestPhotoInfo'><img src='http://distilleryimage7.instagram.com/8ae63806970311e1af7612313813f8e8_7.jpg'/></div>\",\n position: new google.maps.LatLng(0, 151)\n });\n infoWindow.open(realtimeMap);\n}", "function buildMarkers(){\n\tfor (q=0; q<=2; q++){\n\t\tinfoWindow[q] = new google.maps.InfoWindow({\n\t\t\tcontent: contentString[q]\n\t });\n\t\t\t\n\t}\n}", "function showInfoWindow() { \n currentmarker = this;\n infoWindow.open(map, currentmarker);\n buildIWContent();\n\n}", "function infoBox(map, marker, item) {\n var infoWindow = new google.maps.InfoWindow();\n // Attaching a click event to the current marker\n google.maps.event.addListener(marker, \"click\", function (e) {\n //map.setZoom(8),\n map.setCenter(marker.getPosition());\n infoWindow.setContent(this.html);\n infoWindow.open(map, marker);\n });\n\n\n\n\n }//fin funcion informacion de marcador", "function setMarkerInfo(info) {\n infoWindow.setContent(info);\n }", "function infoWindows(marker, data) {\n //Event listener for when a marker i clicked\n google.maps.event.addListener(marker, \"click\", function (e) {\n //Wrap the content inside an HTML DIV in order to set height and width of InfoWindow.\n infoWindow.setContent(\"<div style = 'max-height:300px'>\" + '<p style=\"font-size: 24px; text-decoration: underline;\"><strong><a href=\"' + data.link + '\" target=\"blank\">' + data.name + '</a></strong></p>' + \"<br><p>\" + data.description + \"</p></div>\");\n //Open the markers infowindow\n infoWindow.open(map, marker);\n });\n }", "function populateInfoWindow(marker, infowindow) {\n if (infowindow.marker != marker) {\n infowindow.marker = marker;\n // Img src based on lat lng of location (street view)\n infowindow.setContent('<img src=\"' + 'https://maps.googleapis.com/maps/api/streetview?size=180x130&location=' + marker.positionLat + ',' + marker.positionLng + '&fov=90&heading=235&pitch=10' + '\" alt=\"Street View\">' + '<div>' + '<strong>' + marker.title + '</strong>' + '</div>' + '<div>' + marker.positionLat + ', ' + marker.positionLng + '</div>' + '<div class=\"locAdress\">' + self.fullAddress() + '</div>');\n infowindow.open(map, marker);\n // Make sure the marker property is cleared if the infowindow is closed\n infowindow.addListener('closeclick', function() {\n infowindow.marker = null;\n marker.setIcon(null);\n map.setZoom(15);\n });\n }\n }", "function initMap() {\n var myLatLng = {lat: -39.994738, lng: 176.554233};\n \n /* Sets the location and aerial zoom level */\n CHBVetsMap = new google.maps.Map(document.getElementById('map'), {\n center: myLatLng,\n zoom: 18\n });\n \n /* Set location of marker */\n var marker = new google.maps.Marker({\n position: myLatLng,\n map: CHBVetsMap,\n title: 'CHB Vets Ltd'\n });\n \n /* Ties info box to marker and activates when marker is clicked */\n var contentString = '<p><b>CHB Vets Ltd</b></p>' + '<p>5 Northumberland St<br>Waipukurau<br>4200<br>New Zealand</p>';\n var infowindow = new google.maps.InfoWindow({\n content: contentString\n });\n marker.addListener('click', function() {\n infowindow.open(CHBVetsMap, marker);\n });\n}", "function addInfoWindow(marker, message,myLatLng,i) {\nvar infoWindow = new google.maps.InfoWindow({\n content: \"\"\n});\n var geocoder = new google.maps.Geocoder;\n google.maps.event.addListener(marker, 'click', function () {\n\t\t\tgeocodeLatLng(geocoder, map,marker, infoWindow,myLatLng,i);\n\t\t\t//infoWindow.open(map, marker);\n });\n}", "function populateInfoWindow(marker, infowindow) {\n // Check to make sure the infowindow is not already opened on this marker.\n if (infowindow.marker == marker) {\n return;\n } else if (infowindow.marker) {\n // Unhighlight the previous listing\n unsetIcon(infowindow.marker);\n }\n infowindow.addContent = function(stuff) {\n infowindow.setContent(infowindow.getContent() + stuff);\n }\n\n // Highlight the current listing\n setIcon(marker);\n\n infowindow.marker = marker;\n var title = '<h2>' + marker.title + '</h2><br>';\n\n // Make sure the marker is cleared if the infowindow is closed.\n infowindow.addListener('closeclick', function() {\n // Unhighlight the listing\n unsetIcon(infowindow.marker);\n infowindow.marker = null;\n });\n\n var streetViewService = new google.maps.StreetViewService();\n var radius = 50;\n\n // In case the status is OK, which means the pano was found, compute the\n // position of the streetview image, then calculate the heading, then get a\n // panorama from that and set the options\n function getStreetView(data, status) {\n if (status == google.maps.StreetViewStatus.OK) {\n var loc = marker.position;\n var imgUrl = 'http://maps.googleapis.com/maps/api/streetview'+\n '?size=600x400&location='+loc.lat()+','+loc.lng();\n var panorama = '<img class=\"image\" alt=\"'+marker.title+'\" src=\"'+\n imgUrl+'\" /><br>';\n\n /* ---------- NOTE ----------\n * I reused existing code to show an streetview image instead of a\n * panorama\n * ---------- NOTE ---------- */\n infowindow.setContent(title + panorama);\n } else {\n infowindow.setContent(title +\n '<div class=\"text\">No Image Found</div><br>');\n }\n };\n wikiArtcl(marker.title, infowindow);\n\n // Use streetview service to get the closest streetview image within\n // 50 meters of the markers pposition.\n streetViewService.getPanoramaByLocation(\n marker.position, radius, getStreetView);\n // Open the infowindow on the correct marker.\n infowindow.open(map, marker);\n}", "function openInfowindow (name) {\n \n //loc.hideYelp ();\n loc.setName(name);\n \n infowindow.close();\n infowindow.setOptions ({\n maxWidth: 200,\n maxHeight: 150\n });\n\n infowindow.open(map, loc.marker);\n infowindow.setContent($(\"#infowindowData .loading\").html());\n \n loc.animateMarker();\n \n loc.getYelpData (function () {\n infowindow.open(map, loc.marker);\n infowindow.setContent($(\"#infowindowData .content\").html());\n });\n}", "function locationMarkers(location) {\n\n for(i=0; i<location.length; i++) {\n location[i].holdMarker = new google.maps.Marker({\n position: new google.maps.LatLng(location[i].lat, location[i].lng),\n map: map,\n title: location[i].title,\n icon: {\n url: 'img/marker.png',\n size: new google.maps.Size(25, 40),\n origin: new google.maps.Point(0, 0),\n anchor: new google.maps.Point(12.5, 40)\n }\n });\n\nbounds.extend(location[i].holdMarker.position);\n\n\n//Binds infoWindow content to each marker\n\nlocation[i].contentString =location[i].title +\n location[i].title + '</strong><br><p>' +\n location[i].streetAddress + '<br>' +\n location[i].cityAddress + '<br></p><a class=\"web-links\" href=\"http://' + location[i].url +\n '\" target=\"_blank\">' + location[i].url + '</a>';\n\n//triggers infowindow upon click\n\n\nviewModel.showInfo = function(location){\n google.maps.event.trigger(location.holdMarker,'click');\n}\n\n\n//opens infowindow when link or marker is clicked\n location[i].holdMarker.addListener ( 'click', (function(marker, i) {\n return function() {\n infowindow.setContent(location[i].contentString);\n marker.setAnimation(google.maps.Animation.BOUNCE);\n infowindow.open(map,marker);\n map.setZoom(16);\n map.setCenter(location[i]);\n setTimeout(function () {\n infowindow.close();\n marker.setAnimation(google.maps.Animation.DROP);\n }, 1400);\n //***GET WIKIPEDIA INFO***\n getWikiInfo(marker.title);\n };\n })(location[i].holdMarker, i));\n\n }\n\n}", "function populateInfoWindow(marker, infowindow) {\n\t\t\t// Check to make sure the infowindow is not already opened on this marker.\n\t\t\t\tif (infowindow.marker != marker) {\n\t\t\t\t\t\tinfowindow.marker = marker;\n\t\t\t\t\t\t// Wiki(marker.location);\n\t\t\t\t\t\tmarker.setAnimation(google.maps.Animation.BOUNCE);\n\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t\t\tmarker.setAnimation(null);\n\t\t\t\t\t\t}, 1000);\n\t\t\t\t\t\t// Wiki(marker.location);\n\t\t\t\t\t\t\n\t\t\t\t\t\tinfowindow.setContent(wikicontent + '<hr>' + '<div>' + marker.title + '</div>');\n\t\t\t\t\t\tconsole.log('information window : '+ wikicontent);\n\t\t\t\t\t\tinfowindow.open(map, marker);\n\t\t\t\t\t\t// Make sure the marker property is cleared if the infowindow is closed.\n\t\t\t\t\t\tinfowindow.addListener('closeclick', function() {\n\t\t\t\t\t\t\t\tinfowindow.marker = null;\n\t\t\t\t\t\t});\n\t\t\t\t}\n\t\t}", "function openInfoWindow(e, current) {\r\n\t\tcloseInfoWindow(); \r\n\t\tvar x = e.pageX - parseInt($('#inner').css('left')) - $['mapsettings'].element.get(0).offsetLeft - 9;\r\n\t\tvar y = e.pageY - parseInt($('#inner').css('top')) - $['mapsettings'].element.get(0).offsetTop - 10;\r\n\t\t$['mapsettings'].infoWindowLocation[$['mapsettings'].zoom] = new Point(x,y);\r\n\t\t$('<div id = \"infowindow\" />').css('left',x-4).css('top',y-53).html('<div class = \"inner\">'+ $['mapsettings'].exitLink + $['mapsettings'].infoDisplay + '</div>').appendTo('#infowindows').hide();\r\n\t\tvar infow = $('#infowindow');\r\n\t\tinfoWidth = infow.innerWidth();\r\n\t\tinfoHeight = infow.innerHeight();\r\n\t\tinfow.css('left', x-4).css('top',y-16-infoHeight).show();\r\n\t\t$(\"#infowindows\").append($['mapsettings'].infoImage);\r\n\t\t$(\"#infowindows img\").css('left',x).css('top',y-15);\r\n\t\t$('#infowindows form').submit(function(e) { \r\n\t\t\te.preventDefault(); \r\n\t\t\tcloseInfoWindow();\r\n\t\t\taddMarker(new Point(x,y), function(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\topenInfoWindowHtml(markerPoint(this), \"<h2>Some Name</h2><p>Some Description.</p>\");\r\n\t\t\t});\r\n\t\t\t\r\n\t\t });\r\n\t\t$(\"#exitLink\").click(function(e){\r\n\t\t\te.preventDefault();\r\n\t\t\tcloseInfoWindow();\r\n\t\t\treturn false;\r\n\t\t});\r\n\t\t$['mapsettings'].hasOpenInfoWindow = true;\r\n\t}", "function tohere(i) {\r\n // gmarkers[i].openInfoWindowHtml(to_htmls[i]);\r\n infowindow.setContent(to_htmls[i]);\r\n infowindow.open(map, gmarkers[i]);\r\n}", "function initMap() {\n var latLng = {\n lat: 20.6772885,\n lng: -103.3856328\n }\n var map = new google.maps.Map(document.getElementById('mapa'), {\n 'center': latLng,\n 'zoom': 14,\n 'mapTypeId':google.maps.MapTypeId.ROADMAP,\n /*\n 'draggable' : false,\n 'scrollwheel ':false\n */\n });\n\n var contenido = '<h2>GDLWEBCAMP</h2>'+\n '<p>Del 10 al 12 de Diciembre</p>'+\n '<p>Visitanos!</p>'\n\n var informacion = new google.maps.InfoWindow({\n content: contenido\n });\n\n var marker = new google.maps.Marker({\n position: latLng,\n map: map,\n title:'GDLWEBCAMP'\n });\n\n marker.addListener('click',function(){\n informacion.open(map, marker);\n });\n\n}", "function initialize() {\n var map;\n var bounds = new google.maps.LatLngBounds();\n var mapOptions = {\n mapTypeId: 'roadmap',\n\t\tscrollwheel: false\n };\n \n // Display a map on the page\n map = new google.maps.Map(document.getElementById(\"map_canvas\"), mapOptions);\n map.setTilt(45);\n \n // Multiple Markers\n var markers = [\n ['Los Angeles, USA', 33.9205022,-118.2472962], // Location 1 Text and co-ordinates\n ['London, UK', 51.5135917,-0.14125609999996414], // Location Text 2 co-ordinates\n\t\t['Moscow, Russia', 55.57452,42.00816199999997] // Location Text 3 co-ordinates\n ];\n \n // Info Window Content\n var infoWindowContent = [\n ['<div class=\"info_content\">' +\n '<h5>Striking<small>Los Angeles</small></h5>' +\n '<p>Call Us: <strong>123-456-7890</p>' + '</div>'],\n ['<div class=\"info_content\">' +\n '<h5>Striking<small>London</small></h5>' +\n '<p>Call Us: <strong>123-456-7890</p>' + '</div>'],\n ['<div class=\"info_content\">' +\n '<h5>Striking<small>Moscow</small></h5>' +\n '<p>Call Us: <strong>123-456-7890</p>' + '</div>']\n ];\n \n // Display multiple markers on a map\n var infoWindow = new google.maps.InfoWindow(), marker, i;\n \n // Loop through our array of markers & place each one on the map \n for( i = 0; i < markers.length; i++ ) {\n var position = new google.maps.LatLng(markers[i][1], markers[i][2]);\n bounds.extend(position);\n marker = new google.maps.Marker({\n position: position,\n map: map,\n title: markers[i][0]\n });\n \n // Allow each marker to have an info window \n google.maps.event.addListener(marker, 'click', (function(marker, i) {\n return function() {\n infoWindow.setContent(infoWindowContent[i][0]);\n infoWindow.open(map, marker);\n }\n })(marker, i));\n\n // Automatically center the map fitting all markers on the screen\n map.fitBounds(bounds);\n }\n\n // Override our map zoom level once our fitBounds function runs (Make sure it only runs once)\n var boundsListener = google.maps.event.addListener((map), 'bounds_changed', function(event) {\n\t\t\n this.setZoom(3); // Set your zoom level like 14 or 15 insted 3\n\t\t\n google.maps.event.removeListener(boundsListener);\n });\n \n}", "function initMap() {\n // Constructor creates a new map - only center and zoom are required.\n map = new google.maps.Map(document.getElementById('map'), {\n //Set center of map\n center: {lat: 38.576661, lng: -121.493637},\n zoom: 13\n }); \n //\n //Create infowindow\n var largeInfowindow = new google.maps.InfoWindow();\n maxWidth: 200;\n //Create bounds that will be displayed on map\n var bounds = new google.maps.LatLngBounds();\n //Loop through our locations and display our markers\n for (var i = 0; i < locations.length; i++) {\n //Get our position from our array of locations\n var content = locations[i].content;\n var title = locations[i].title;\n var position = locations[i].location;\n //Create new markers where their locations are at\n var marker = new google.maps.Marker({\n title: title,\n id: i,\n map: map,\n position: position,\n animation: google.maps.Animation.DROP,\n });\n //Push markers to the map\n //markers.push(marker);\n locations[i].marker = marker;\n //Extend our map to where markers are\n bounds.extend(marker.position);\n //Open infowindow when marker is clicked\n marker.addListener('click', function() {\n populateInfoWindow(this, largeInfowindow);\n toggleBounce(this, marker);\n }) \n\n\n }\n\n //Function to display infowindow\n function populateInfoWindow(marker, infowindow) {\n if (infowindow.marker != marker) {\n infowindow.marker = marker;\n //Make infowindow close on second click\n infowindow.addListener('closeclick', function() {\n infowindow.setMarker(null);\n })\n var streetViewService = new google.maps.StreetViewService();\n var radius = 50;\n\n function getStreetView(data, status) {\n if (status == google.maps.StreetViewStatus.OK) {\n var nearStreetViewLocation = data.location.latLng;\n var heading = google.maps.geometry.spherical.computeHeading(nearStreetViewLocation, marker.position);\n //Possibly set infowindow here?\n var panoramaOptions = {\n position: nearStreetViewLocation,\n pov: {\n heading: heading,\n pitch: 30\n }\n };\n var panorama = new google.maps.StreetViewPanorama(document.getElementById('pano'), panoramaOptions);\n } else {\n infowindow.setContent('<div>' + marker.title + '</div>' + '<div>No Street View Found!</div');\n }\n \n }\n\n\n //Create wiki url with our search string inside:\n var wikiUrl = 'https://en.wikipedia.org/w/api.php?action=opensearch&search=' + marker.title;\n\n\n //Create ajax request object\n $.ajax({\n url: wikiUrl,\n dataType: \"jsonp\",\n success: function( response ) {\n var wikiStr = response[1];\n var wikipediaURL = 'https://en.wikipedia.org/wiki/' + wikiStr;\n infowindow.setContent('<h2>' + marker.title + '</h2>' + '</div><div id=\"pano\"></div>' + '<p>' + '<a href=\"' + wikipediaURL + '\">' + '</p><p>' + response[2] + '</p>');\n infowindow.open(map, marker);\n streetViewService.getPanoramaByLocation(marker.position, radius, getStreetView);\n\n },\n error: function(msg) {\n console.log(msg);\n }\n\n });\n }\n\n } \n\n //Fit map to bounds\n map.fitBounds(bounds);\n //Make markers bounce when clicked!\n function toggleBounce(marker) {\n //Create function to animate markers when clicked\n marker.setAnimation(google.maps.Animation.BOUNCE);\n setTimeout(function() {\n marker.setAnimation(google.maps.Animation.null);\n }, 500);\n \n }\n viewModel = new ViewModel();\n //Apply bindings so model will update when events are clicked\n ko.applyBindings(viewModel);\n\n }", "function information() {\n\t//alert(\"Created by Monica Michaud\\nIn the Institute for New Media Studies\\nAdviser: Gordon Carlson, PhD\\nDev Version: 0.2 (Apr 25)\");\n\n\tvar mapInfoBoxString;\n\t\n\tmapInfoBoxString = '<div id=\"content\"><h1 id=\"infoWindowHeading\" class=\"infoWindowHeading\">Information : </h1>' +\n\t\t'<div id=\"infoWindowBodyContent\"><p>Created by Monica Michaud <br /> In the Institute for New Media Studies <br /> Adviser: Gordon Carlson, PhD <br /> Dev Version: 0.2 (Apr 25)</p></div></div>';\n\t\n\tmap.setCenter(MAP_CENTER_COORDINATES); \n\tinfoWindow.setContent(mapInfoBoxString);\n\tinfoWindow.setPosition(MAP_CENTER_COORDINATES);\n\tinfoWindow.open(map);\n}", "function initInformationWindow(position, content){\t\t\n\t\tvar options\t\t\t= new Object();\n\t\toptions.content\t\t= content;\n\n\t\tself.infowindow = new google.maps.InfoWindow(options);\n\t}", "function populateInfoWindow(marker, infowindow) {\r\n // Check to make sure the infowindow is not already opened on this marker.\r\n if (infowindow.marker != marker) {\r\n // Clear the infowindow content to give the streetview time to load.\r\n infowindow.setContent('');\r\n infowindow.marker = marker;\r\n // Make sure the marker property is cleared if the infowindow is closed.\r\n infowindow.addListener('closeclick', function() {\r\n infowindow.marker = null;\r\n });\r\n var streetViewService = new google.maps.StreetViewService();\r\n var radius = 500;\r\n // In case the status is OK, which means the pano was found, compute the\r\n // position of the streetview image, then calculate the heading, then get a\r\n // panorama from that and set the options\r\n function getStreetView(data, status) {\r\n if (status == google.maps.StreetViewStatus.OK) {\r\n var nearStreetViewLocation = data.location.latLng;\r\n var heading = google.maps.geometry.spherical.computeHeading(\r\n nearStreetViewLocation, marker.position);\r\n //setting the infowindow with both street view panorama and the wikipedia link.\r\n infowindow.setContent('<div>' + marker.title + '</div><hr><div id=\"pano\"></div><div><a href=' + marker.wikiurl + '> Click here for more info </a></div>');\r\n var panoramaOptions = {\r\n position: nearStreetViewLocation,\r\n pov: {\r\n heading: heading,\r\n pitch: 30\r\n }\r\n };\r\n var panorama = new google.maps.StreetViewPanorama(\r\n document.getElementById('pano'), panoramaOptions);\r\n } else {\r\n infowindow.setContent('<div>' + marker.title + '</div>' +\r\n '<div>No Street View Found</div>');\r\n }\r\n }\r\n // Use streetview service to get the closest streetview image within\r\n // 50 meters of the markers position\r\n streetViewService.getPanoramaByLocation(marker.position, radius, getStreetView);\r\n // Open the infowindow on the correct marker.\r\n infowindow.open(map, marker);\r\n }\r\n }", "function populateInfoWindow(marker, wikiArticles, infowindow) {\n if (infowindow.marker != marker) {\n infowindow.marker = marker;\n infowindow.setContent('');\n infowindow.addListener('closeclick', function() {\n infowindow.setMarker = null;\n });\n var streetViewService = new google.maps.StreetViewService();\n var radius = 50;\n\n // Function to getStreetView details and set the InfoWindow content.\n function getStreetView(data, status) {\n if (status == google.maps.StreetViewStatus.OK) {\n var nearStreetViewLocation = data.location.latLng;\n var heading = google.maps.geometry.spherical.computeHeading(\n nearStreetViewLocation, marker.position);\n infowindow.setContent('<div>' + '<h3>' + marker.title + '</h3>' + '<h4>Relevant Wikipedia Articles</h4>' + wikiArticles + '</div><div id=\"pano\"></div>');\n var panoramaOptions = {\n position: nearStreetViewLocation,\n pov: {\n heading: heading,\n pitch: 30\n }\n };\n var panorama = new google.maps.StreetViewPanorama(\n document.getElementById('pano'), panoramaOptions);\n } else {\n infowindow.setContent('<div>' + marker.title + '<div>' + '<div>No Street View Found</div>');\n }\n }\n streetViewService.getPanoramaByLocation(marker.position, radius, getStreetView);\n infowindow.open(map, marker);\n }\n}", "function openInfoWindow(locationClick){\n\t\tvar marker = locationClick.marker;\n\t\tvar content = \"<div> \"+ marker.title + \"<br>\" + \"<img src=\"+marker.rating +\"></img><br><img src=\"+ marker.imageSnapShot+\"> </img></div>.\";\n\t\t\tinfowindow.setContent(content); \n \t\tinfowindow.open(map, marker);\n\t}", "function populateInfoWindow(marker, infowindow) {\n // Check to make sure the infowindow is not already opened on this marker.\n var imgURL = '';\n var summary = '';\n var title = '';\n\n // Get wikipedia image url from global array \n for (var i = 0; i < wikiContent.length; i++) {\n if (marker.title == wikiContent[i].title) {\n imgURL = wikiContent[i].url;\n summary = wikiContent[i].summary;\n title = wikiContent[i].title;\n }\n }\n\n if (infowindow.marker != marker) {\n // Clear the infowindow content to give the streetview time to load.\n infowindow.setContent('');\n infowindow.marker = marker;\n // Make sure the marker property is cleared if the infowindow is closed.\n infowindow.addListener('closeclick', function() {\n infowindow.marker = null;\n });\n\n if (imgURL !== '') {\n infowindow.setContent(\n '<div id=\"iw-container\"><h4 id=\"iw-title\">' +\n title +\n '</h4>' +\n '<a href=\"' +\n imgURL + '\"\">' +\n '<img src=\"' +\n imgURL +\n '\" height=\"200\">' +\n '</a>' +\n '<div id=summary>' +\n summary +\n '</div><div id=iw-attr> Wikipedia </div></div>');\n } else {\n infowindow.setContent(\n '<div>Could not load Wikipedia content for </div><h4>' +\n marker.title +\n '</h4>'\n );\n }\n // Open the infowindow on the correct marker.\n infowindow.open(map, marker);\n }\n}", "function setMarkers(map) {\n\n var image = {\n url: 'images/flag.png',\n /* This marker is 20 pixels wide by 32 pixels high. */\n size: new google.maps.Size(20, 32),\n /* The origin for this image is (0, 0). */\n origin: new google.maps.Point(0, 0),\n /* The anchor for this image is the base of the flagpole at (0, 32). */\n anchor: new google.maps.Point(0, 32)\n };\n /* Shapes define the clickable region of the icon. The type defines an HTML\n <area> element 'poly' which traces out a polygon as a series of X,Y points.\n The final coordinate closes the poly by connecting to the first coordinate. */\n var shape = {\n coords: [1, 1, 1, 20, 18, 20, 18, 1],\n type: 'poly'\n };\n for (var i = 0; i < localListing[selectedCity][selectedCategory].length; i++) {\n var localList = localListing[selectedCity][selectedCategory][i];\n\n /* Add the circle for this city to the map. */\n var cityCircle = new google.maps.Circle({\n strokeColor: '#00FF00',\n strokeOpacity: 0.2,\n strokeWeight: 2,\n fillColor: '#0000FF',\n fillOpacity: 0.1,\n map: map,\n center: citymap[selectedCity].center,\n radius: Math.sqrt(citymap[selectedCity].population) * 7\n });\n\n cityCircles.push(cityCircle);\n\n /* InfoWindow content */\n var content = '<div id=\"iw-container\">' +\n '<div class=\"iw-title\">' + localList[0] + '</div>' +\n '<div class=\"iw-content\">' +\n '<div class=\"iw-subTitle\">Details</div>' +\n '<img src=\"images/listing_image.jpg\" alt=\"'+localList[0]+'\" height=\"115\">' +\n '<p>' + localList[3] + '</p>' +\n '<div class=\"iw-subTitle\">Contacts</div>' +\n '<p>' + selectedCity + '<br>' +\n '<br>Phone. +91 1800 320 600<br>e-mail: [email protected]<br></p>' +\n '</div>' +\n '<div class=\"iw-bottom-gradient\"></div>' +\n '</div>';\n\n\n infowindow = new google.maps.InfoWindow({\n content: content,\n maxWidth: 350\n });\n var marker = new google.maps.Marker({\n position: {\n lat: localList[1],\n lng: localList[2]\n },\n map: map,\n icon: image,\n shape: shape,\n title: localList[0],\n zIndex: localList[4]\n });\n\n infoWindows.push(infowindow)\n markers.push(marker);\n (function(infowindow, marker) {\n marker.addListener('click', function() {\n infowindow.open(map, marker);\n });\n })(infowindow, marker);\n\n /*\n START INFOWINDOW CUSTOMIZE.\n The google.maps.event.addListener() event expects\n the creation of the infowindow HTML structure 'domready'\n and before the opening of the infowindow, defined styles are applied.\n */\n google.maps.event.addListener(infowindow, 'domready', function() {\n /* Reference to the DIV that wraps the bottom of infowindow */\n\n var iwOuter = document.getElementsByClassName(\"gm-style-iw\");\n for (var i = 0; i < iwOuter.length; i++) {\n iwOuter[i].previousSibling.style.display = \"none\";\n }\n });\n }\n }", "function openInfo(lat,lng,content) {\n\tvar latLng = new google.maps.LatLng(lat,lng);\n\n\n\tif (content == null) {\n\t var m = latLngCache.get(latLng.toString());\n\n\t var content = tag('div',{},[\n\t\ttext(m.place.name)\n\t ]);\n\t}\n\n\n\tinfowindow.setContent(content);\n\tinfowindow.setPosition(latLng);\n\t\n\tif (m != null) {\n\t infowindow.open(googleMap,m.marker);\n\t \n\t} else {\n\t infowindow.open(googleMap);\n\n\n\t}\n\n\n\n\n\n\n }", "function info_marker(marker, infowindow){\n var marker_position = {lat:marker.position.lat()+0.003, lng:marker.position.lng()};\n // console.log(marker_position);\n infowindow.setPosition(marker_position);\n infowindow.setContent(\"<div style='font-size:14px; margin-top:5px;'><b>\"+marker.title+'</b><br>'+'</div>'+'<br>'+'<div id=\"pano\"></div>'); \n infowindow.open(map); \n}", "function createNewInfoWindow(coord, content){\n // information window is displayed at click position\n\tmapCollector.infowindow = new google.maps.InfoWindow({\n\t \tcontent: content,\n\t \tposition: coord\n\t});\n }", "function plotBrewery(element, index, array)\n{\n console.log(\"\\t\"+element.brewery.name);\n console.log(\"\\t\"+element.latitude + \"\\t\" + element.longitude);\n\n //Object to be mapped\n breweryLatLng = new google.maps.LatLng({lat: element.latitude, lng: element.longitude});\n\n var marker = new google.maps.Marker({\n position: breweryLatLng,\n map: map,\n title: element.brewery.name\n });\n\n marker.addListener('click', function() {\n if (infoWindowGlobal && infoWindowGlobal !== undefined)\n infoWindowGlobal.close();\n\n var infoWindowContentStr = fillInfoWindowTemplateWithBrewery(element);\n\n infoWindowGlobal = new google.maps.InfoWindow({\n content: infoWindowContentStr\n });\n\n // Add a listener to clean up and restyle the infowindow when it's loaded\n // http://en.marnoto.com/2014/09/5-formas-de-personalizar-infowindow.html\n google.maps.event.addListener(infoWindowGlobal, 'domready', function() {\n\n // Reference to the DIV which receives the contents of the infowindow using jQuery\n var iwOuter = $('.gm-style-iw');\n var iwBackground = iwOuter.prev();\n // Remove the background shadow DIV\n iwBackground.children(':nth-child(2)').css({'display' : 'none'});\n // Remove the white background DIV\n iwBackground.children(':nth-child(4)').css({'display' : 'none'});\n\n // Using the .next() method of JQuery you reference the following div to .gm-style-iw.\n // Is this div that groups the close button elements.\n var iwCloseBtn = iwOuter.next();\n\n // Apply the desired effect to the close button\n iwCloseBtn.css({\n width: '19px',\n height: '19px',\n overflow: 'hidden',\n position: 'absolute',\n opacity: '1', // by default the close button has an opacity of 0.7\n right: '-15px', top: '3px', // button repositioning\n border: '3px solid #00274c', // increasing button border and new color\n 'border-radius': '13px', // circular effect\n 'box-shadow': '0 0 5px #3990B9' // 3D effect to highlight the button\n });\n\n // The API automatically applies 0.7 opacity to the button after the mouseout event.\n // This function reverses this event to the desired value.\n iwCloseBtn.mouseout(function(){\n $(this).css({opacity: '1'});\n });\n\n iwBackground.children(':nth-child(3)').find('div').children().css({'box-shadow': 'rgba(72, 181, 233, 0.6) 0px 1px 6px', 'z-index' : '1'});\n\n // Old css work that may be worth playing with at a later time but is a bit complicated for now\n\n // // Moves the infowindow 115px to the right.\n // iwOuter.parent().parent().css({left: '115px'});\n // // Moves the shadow of the arrow 76px to the left margin\n // iwBackground.children(':nth-child(1)').attr('style', function(i,s){ return s + 'left: 33px !important;'});\n // // Moves the arrow 76px to the left margin\n // iwBackground.children(':nth-child(3)').attr('style', function(i,s){ return s + 'left: 33px !important;'});\n // Changes the desired color for the tail outline.\n // The outline of the tail is composed of two descendants of div which contains the tail.\n // The .find('div').children() method refers to all the div which are direct descendants of the previous div.\n\n // Style the outer div\n // iwOuter.css({\n // right: '115px',\n // left: 'initial'\n // });\n });\n\n infoWindowGlobal.open(map, marker);\n });\n\n markers.push(marker);\n\n bounds.extend(breweryLatLng);\n}", "function initMap() {\n const originalMapCenter = new google.maps.LatLng(49.806460365521126, 24.061589398252167);\n const map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 17,\n center: originalMapCenter,\n disableDefaultUI: true\n });\nconst marker = new google.maps.Marker({\n position: originalMapCenter,\n map: map,\n title: \"adres\"\n});\nconst infowindow = new google.maps.InfoWindow({\n content: \n \"<br><b>Ми знаходимось тут!</b><br><br><b>НАш номер телефону:</b><br><a href=tel:+38 (067) 467-37-67>+38 (067) 467-37-67</a> \",\n position: originalMapCenter,\n});\n marker.addListener(\"click\", () => {\n infowindow.open(map, marker);\n});\ninfowindow.open(map);\n}", "function initMap() {\r\n let infowindow = new google.maps.InfoWindow();\r\n const map = new google.maps.Map(document.getElementById(\"map\"), {\r\n zoom: 7,\r\n center: {\r\n lat: 52.2126958,\r\n lng: 18.8807217\r\n }\r\n });\r\n\r\n function placeMarkerInterMarche(loc) {\r\n const marker = new google.maps.Marker({\r\n position: new google.maps.LatLng(loc.lat, loc.lng),\r\n map: map,\r\n icon: \"/markersImages/intermarche.png\"\r\n });\r\n google.maps.event.addListener(marker, 'click', function () {\r\n infowindow.close(); // Close previously opened infowindow\r\n infowindow.setContent(`<div class=\"popup\">\r\n <p class=\"popup-city\">${loc.city}</p>\r\n <p class=\"popup-address\">${loc.street}</p>\r\n <p class=\"popup-address\">${loc.zip}</p>\r\n </div>`);\r\n infowindow.open(map, marker);\r\n });\r\n }\r\n\r\n function placeMarkerMakro(loc) {\r\n const marker = new google.maps.Marker({\r\n position: new google.maps.LatLng(loc.lat, loc.lng),\r\n map: map,\r\n icon: \"/markersImages/makro.png\",\r\n zIndex: 999,\r\n });\r\n google.maps.event.addListener(marker, 'click', function () {\r\n infowindow.close(); // Close previously opened infowindow\r\n infowindow.setContent(`<div class=\"popup\">\r\n <p class=\"popup-city\">${loc.city}</p>\r\n <p class=\"popup-address\">${loc.street}</p>\r\n <p class=\"popup-address\">${loc.zip}</p>\r\n </div>`);\r\n infowindow.open(map, marker);\r\n });\r\n }\r\n\r\n // Minimize carrefour icon\r\n let iconCarrefour = {\r\n url: \"/markersImages/carrefour.png\", // url\r\n scaledSize: new google.maps.Size(50, 50), // scaled size\r\n origin: new google.maps.Point(0, 0), // origin\r\n anchor: new google.maps.Point(0, 0) // anchor\r\n };\r\n\r\n function placeMarkerSelgros(loc) {\r\n const marker = new google.maps.Marker({\r\n position: new google.maps.LatLng(loc.lat, loc.lng),\r\n map: map,\r\n icon: \"/markersImages/selgros.png\",\r\n zIndex: 999,\r\n });\r\n google.maps.event.addListener(marker, 'click', function () {\r\n infowindow.close(); // Close previously opened infowindow\r\n infowindow.setContent(`<div class=\"popup\">\r\n <p class=\"popup-city\">${loc.city}</p>\r\n <p class=\"popup-address\">${loc.street}</p>\r\n <p class=\"popup-address\">${loc.zip}</p>\r\n </div>`);\r\n infowindow.open(map, marker);\r\n });\r\n }\r\n\r\n\r\n\r\n function placeMarkerCarrefour(loc) {\r\n const marker = new google.maps.Marker({\r\n position: new google.maps.LatLng(loc.lat, loc.lng),\r\n map: map,\r\n icon: iconCarrefour,\r\n zIndex: 999,\r\n });\r\n google.maps.event.addListener(marker, 'click', function () {\r\n infowindow.close(); // Close previously opened infowindow\r\n infowindow.setContent(`<div class=\"popup\">\r\n <p class=\"popup-city\">${loc.city}</p>\r\n <p class=\"popup-address\">${loc.street}</p>\r\n <p class=\"popup-address\">${loc.zip}</p>\r\n </div>`);\r\n infowindow.open(map, marker);\r\n });\r\n }\r\n\r\n // ITERATE ALL LOCATIONS. Pass every location to placeMarker and generating objects from shopList folder\r\n\r\n fetch(\"/shopList/intermarche.json\").then(response => response.json()).then(interMarche => \r\n interMarche.forEach(placeMarkerInterMarche)\r\n )\r\n\r\n fetch(\"/shopList/makro.json\").then(response => response.json()).then(makro => \r\n makro.forEach(placeMarkerMakro)\r\n )\r\n\r\n fetch(\"/shopList/selgros.json\").then(response => response.json()).then(selgros => \r\n selgros.forEach(placeMarkerSelgros)\r\n )\r\n\r\n fetch(\"/shopList/carrefour.json\").then(response => response.json()).then(carrefour => \r\n carrefour.forEach(placeMarkerCarrefour)\r\n )\r\n}", "function initMap() {\n\n\n \n var uluru = {lat: 23.874758, lng:90.382677};\n var map = new google.maps.Map(document.getElementById('map'), {\n zoom: 17,\n center: uluru\n });\n var marker = new google.maps.Marker({\n position: uluru,\n map: map\n });\n \n var infoWindow = new google.maps.InfoWindow({\n content: '<h1>Jasim Uddin Road</h1><p>Latitude : <b><big>23.874758</big></b>&emsp;Longitude : <b><big>90.382677</big></b>'\n });\n\n\n marker.addListener('click', function() {\n infoWindow.open(map, marker);\n });\n}", "function GoogleMapHotel(){\n if($('#hotel-maps').length){\n var map;\n var bounds = new google.maps.LatLngBounds();\n\n var mapOptions = {\n zoom:16,\n scrollwheel:false,\n mapTypeId:google.maps.MapTypeId.ROADMAP\n };\n \n // Display a map on the page\n map = new google.maps.Map(document.getElementById(\"hotel-maps\"), mapOptions);\n \n // Multiple Markers\n var markers = [\n ['Bondi Beach', 41.0237, -73.701239],\n ['Coogee Beach', 41.005615, -73.69566551],\n ['Cronulla Beach', 40.9756737, -73.65614],\n ['Manly Beach', 40.973478, -73.8433],\n ['Maroubra Beach', 41.04579, -73.7464],\n ['Maroubra Beach', 41.0563, -73.75618],\n ['Maroubra Beach', 40.9442, -73.8554]\n ];\n \n var infoWindowContent = [[\"\\\n <div class='maps-item'>\\\n <a href='#' class='maps-image'>\\\n <img src='images/hotel/img-10.jpg' alt=''>\\\n </a>\\\n <div class='maps-text'>\\\n <h2><a href='#'>The Cosmopolitan</a></h2>\\\n <span>\\\n <i class='glyphicon glyphicon-star'></i>\\\n <i class='glyphicon glyphicon-star'></i>\\\n <i class='glyphicon glyphicon-star'></i>\\\n <i class='glyphicon glyphicon-star'></i>\\\n <i class='glyphicon glyphicon-star'></i>\\\n </span>\\\n <address>Great Cumberland Place, London W1H 7DL</address>\\\n <p>My stay at cumberland hotel was amazing, loved the location, was close to all the major attraction.. <a href=''>view all 125 reviews</a>\\\n </p>\\\n <hr class='hr'>\\\n <span class='price'>From-<ins>$345</ins>/night</span>\\\n </div>\\\n </div>\\\n \"]];\n\n var infoWindow= new google.maps.InfoWindow({maxWidth:600}),\n marker, i, \n image = 'images/icon-maker.png';\n\n for( i = 0; i < markers.length; i++ ) {\n var beach = markers[i];\n var position = new google.maps.LatLng(beach[1], beach[2]);\n bounds.extend(position);\n marker = new google.maps.Marker({\n position: position,\n map: map,\n icon: image,\n title: beach[0]\n });\n \n // Allow each marker to have an info window \n google.maps.event.addListener(marker, 'click', (function(marker, i) {\n return function() {\n infoWindow.setContent(infoWindowContent[0][0]); \n infoWindow.open(map, marker);\n }\n })(marker, i));\n\n // Automatically center the map fitting all markers on the screen\n map.fitBounds(bounds);\n }\n }\n }", "function populateInfoWindow(marker, infowindow) {\n // This just makes sure the window is not already open\n if (infowindow.marker != marker) {\n infowindow.marker = marker;\n var streetviewUrl='https://maps.googleapis.com/maps/api/streetview?size=220x120&location='+marker.lat+','+marker.lng;\n //OpenWeatherMap api\n var weatherUrl='http://api.openweathermap.org/data/2.5/weather?q='+marker.title+'&lat='+marker.lat+'&lon='+marker.lng+'&APPID=302e5c9ce22283a076002344330d532b'\n $.get(weatherUrl,function(data){\n var temp_min=parseFloat(data.main.temp_min-273).toFixed(2);\n var temp_max=parseFloat(data.main.temp_max-273).toFixed(2);\n var weather='<p> Min Temprature: '+temp_min+'&deg;C</p><p> Max Temperature: '+temp_max+'&deg;C</p>'\n infowindow.setContent('<div>' + marker.title + '</div>'+ '<div>' +'<img src='+streetviewUrl+'>'+'</div>'+'<div>' + marker.position + '</div>'+ weather);\n });\n //This sets the content ofthe info window\n //infowindow.setContent('<p>'+marker.title+'</p>');//+'<img src='+streetviewUrl+'>'+weather);\n //infowindow.setContent('<div>' + marker.title + '</div>'+ '<div>' + marker.position + '</div>'+ weather);\n infowindow.open(map, marker);\n // Make sure the infoWindow is cleared if the close button is clicked\n infowindow.addListener('closeclick', function() {\n infowindow.marker = null;\n //Makes sure the animation of the marker is stopped if the infoWindow close button is clicked\n marker.setAnimation(null);\n });\n }\n}", "function setInfoWindow(allPage, k, i, marker, netDisplacement, totalDistance, avgVelocity,\n totalTime, legLength, legSpeed, legTime, GEBCODepth, EEZ, lat, lng) {\n // No more live requests since the data get read by grabIndData\n // makeWMSrequest(dataPoints[k]);\n\n google.maps.event.addListener(marker, 'click', function (event) {\n // close existing windows\n closeIWindows();\n if (allPage!=='drop'){\n markerIndex = k;\n }\n\n //Redeclare variables for jQuery (it doesn't work if I don't do this, I have no idea why)\n dropMarkerList = dropMarkers;\n currentMarker = dropMarkers.findIndex(item => {\n if (item.title === marker.title) {\n return true;\n }\n return false;\n });\n tempClose = closeIWindows;\n\n // Pan to include entire infowindow\n let offset = -0.32 + (10000000) / (1 + Math.pow((map.getZoom() / 0.0035), 2.07));\n let center = new google.maps.LatLng(\n parseFloat(marker.position.lat() + offset / 1.5),\n parseFloat(marker.position.lng() + offset / 2)\n );\n map.panTo(center);\n let iwindow;\n // info window preferences\n if (allPage===\"drop\") {\n iwindow = new InfoBubble({\n maxWidth: 270,\n maxHeight: 150,\n shadowStyle: 1,\n padding: 10,\n backgroundColor: 'rgb(255,255,255)',\n borderRadius: 4,\n arrowSize: 20,\n borderWidth: 2,\n borderColor: '#000F35',\n disableAutoPan: true,\n hideCloseButton: false,\n arrowPosition: 30,\n backgroundClassName: 'phoney',\n arrowStyle: 0,\n disableAnimation: 'true'\n });\n\n } else {\n iwindow = new InfoBubble({\n maxWidth: 320,\n maxHeight: 265,\n shadowStyle: 1,\n padding: 10,\n backgroundColor: 'rgb(255,255,255)',\n borderRadius: 4,\n arrowSize: 20,\n borderWidth: 2,\n borderColor: '#000F35',\n disableAutoPan: true,\n hideCloseButton: false,\n arrowPosition: 30,\n backgroundClassName: 'phoney',\n arrowStyle: 0,\n disableAnimation: 'true'\n });\n }\n\n let floatTabContent;\n\n if (allPage === true) {\n // content for float data tab\n floatTabContent = '<div id=\"tabContent\">' +\n // '<b>Float Name:</b> ' + dataPoints[i].name +\n // '<br/> ' +\n '<b>UTC:</b> ' + dataPoints[i].stdt +\n // '<br/><b>Your Date:</b> ' + dataPoints[i].loct +\n '<br/><b>GPS Lat/Lon:</b> ' + dataPoints[i].stla + ', ' + dataPoints[i].stlo +\n '<br/><b>GPS Hdop/Vdop:</b> ' + dataPoints[i].hdop + ' m , ' + dataPoints[i].vdop + ' m' +\n '<br/><b>GEBCO WMS Depth:</b> ' + GEBCODepth + ' m' +\n '<br/><b>EEZ:</b> ' + EEZ +\n '<br/> ' +\n '<br/><b>Battery:</b> ' + dataPoints[i].Vbat + ' mV' +\n '<br/><b>Internal Pressure:</b> ' + dataPoints[i].Pint + ' Pa' +\n '<br/><b>External Pressure:</b> ' + dataPoints[i].Pext + ' mbar' +\n '<br/> ' +\n '<br/><b>Total Time:</b> ' + roundit(totalTime,0) + ' h' +\n '<br/><b>Distance Travelled:</b> ' + roundit(totalDistance,0) + ' km' +\n '<br/><b>Average Speed:</b> ' + roundit(avgVelocity,3) + ' km/h' +\n '<br/><b>Net Displacement:</b> ' + roundit(netDisplacement,0) + ' km';\n } else if (allPage === 'drop'){\n // content for dropped marker tab\n floatTabContent = '<div id=\"tabContent\">' +\n '<br/><b>GPS Lat/Lon:</b> ' + lat + ', ' + lng +\n '<br/><b>GEBCO WMS Depth:</b> ' + GEBCODepth + ' m' +\n '<br/><b>EEZ:</b> ' + EEZ +\n //This next line we create an <a> tag with an href that calls a javascript function using jQuery\n '<br/><br/><span style=\"cursor:pointer;display:inline-block;\"><a href=\"javascript:dropMarkerList[currentMarker].setMap(null);tempClose();void dropMarkerList.splice(currentMarker,1);\"><b>Clear Marker</b></a></span>';\n } else {\n // content for float data tab\n floatTabContent = '<div id=\"tabContent\">' +\n // '<b>Float Name:</b> ' + dataPoints[i].name +\n // '<br/> ' +\n '<b>UTC:</b> ' + dataPoints[i].stdt +\n // '<br/><b>Your Date:</b> ' + dataPoints[i].loct +\n '<br/><b>GPS Lat/Lon:</b> ' + dataPoints[i].stla + ', ' + dataPoints[i].stlo +\n // '<br/><b>GPS Hdop/Vdop:</b> ' + dataPoints[i].hdop + ' m , ' + dataPoints[i].vdop + ' m' +\n // We're not making a WMS request here so no more datapoint and now more that field\n // '<br/><b>GEBCO WMS Depth:</b> ' + dataPoints[i].wmsdepth + ' m' +\n '<br/><b>GEBCO WMS Depth:</b> ' + GEBCODepth + ' m' +\n '<br/><b>EEZ:</b> ' + EEZ +\n // '<br/> ' +\n // '<br/><b>Battery:</b> ' + dataPoints[i].Vbat + ' mV' +\n // '<br/><b>Internal Pressure:</b> ' + dataPoints[i].Pint + ' Pa' +\n // '<br/><b>External Pressure:</b> ' + dataPoints[i].Pext + ' mbar' +\n '<br/> ' +\n '<br/><b>Leg Length:</b> ' + roundit(legLength,1) + ' km' +\n '<br/><b>Leg Time:</b> ' + roundit(legTime,2) + ' h' +\n '<br/><b>Leg Speed:</b> ' + roundit(legSpeed,3) + ' km/h' +\n '<br/> ' +\n '<br/><b>Total Time:</b> ' + roundit(totalTime,0) + ' h' +\n '<br/><b>Distance Travelled:</b> ' + roundit(totalDistance,0) + ' km' +\n '<br/><b>Average Speed:</b> ' + roundit(avgVelocity,3) + ' km/h' +\n '<br/><b>Net Displacement:</b> ' + roundit(netDisplacement,0) + ' km';\n }\n // content for earthquake tabs\n let earthquakeTabContent = '<div id=\"tabContent\">' +\n '<b>Code:</b> ' + \"/* filler */\" +\n '<br/><b>UTC:</b> ' + \"/* filler */\" +\n '<br/><b>Your Date:</b> ' + \"/* filler */\" +\n '<br/><b>Lat/Lon:</b> ' + \"/* filler */\" +\n '<br/><b>Magnitude:</b> ' + \"/* filler */\" +\n '<br/><b>Great Circle Distance:</b> ' + \"/* filler */\" +\n '<br/><b>Source:</b> ' + \"/* filler */\";\n \n let floatName;\n\n if(allPage === 'drop'){\n floatName = '<div id=\"tabNames\">' + '<b>' + 'Drop Pin' + '</b> ';\n } else {\n floatName = '<div id=\"tabNames\">' + '<b>' + dataPoints[i].name + '</b> ';\n }\n\n let earthquakeName = '<div id=\"tabNames\">' + '<b>EarthQuake Info</b> ';\n\n let seismograms = '<div id=\"tabNames\">' + '<b>Seismograms</b> ';\n \n // add info window tabs\n iwindow.addTab(floatName, floatTabContent);\n // iwindow.addTab(earthquakeName, earthquakeTabContent);\n // iwindow.addTab(seismograms, \"\");\n\n iwindow.open(map, this);\n iwindows.push(iwindow);\n });\n }", "function infoMarkers(marker){\r\n\t\t\tvar infowindow = new google.maps.InfoWindow({\r\n\t\t\t content: marker.title,\r\n\t\t\t});\r\n\t\t\t \r\n\t\t\tmarker.addListener('click', function(){\r\n\t\t\t infowindow.open(marker.get('map'),marker);\r\n\t\t\t});\r\n\r\n\t\t}", "function callMaltaMap() {\n var map = new google.maps.Map(document.getElementById(\"map-two\"), {\n zoom: 10,\n center: {\n lat: 35.917973,\n lng: 14.409943\n }\n });\n var locations = [\n [{\n lat: 36.0468259,\n lng: 14.1899414\n }, \"Gozo\"],\n [{\n lat: 35.9597241,\n lng: 14.3388661\n }, \"Popeye Village\"],\n [{\n lat: 36.0139938,\n lng: 14.3053178\n }, \"Blue Lagoon, Comino\"],\n [{\n lat: 35.8984601,\n lng: 14.5089412\n }, \"Valletta\"],\n [{\n lat: 35.8872941,\n lng: 14.4018906\n }, \"Mdina\"],\n ];\n var infoWindow = new google.maps.InfoWindow();\n locations.forEach(([position, title]) => {\n const marker = new google.maps.Marker({\n position,\n map,\n title: `${title}`,\n optimized: false,\n });\n\n marker.addListener(\"click\", () => {\n infoWindow.close();\n infoWindow.setContent(marker.getTitle());\n infoWindow.open(marker.getMap(), marker);\n });\n });\n}", "function initMap() {\r\n var myCenter = new google.maps.LatLng(-26.412462, 31.177307);\r\n var mapCanvas = document.getElementById(\"map\");\r\n var mapOptions = {center: myCenter, zoom: 13};\r\n var map = new google.maps.Map(mapCanvas, mapOptions);\r\n var marker = new google.maps.Marker({position:myCenter});\r\n marker.setMap(map);\r\n google.maps.event.addListener(marker,'click',function() {\r\n var infowindow = new google.maps.InfoWindow({\r\n content:'<a href=\"https://www.facebook.com/MTNSz/\">Swazi MTN URL</a>'\r\n });\r\n infowindow.open(map,marker);\r\n });\r\n}", "function populateInfoWindow(marker, infowindow) {\n // Check to make sure the infowindow is not already opened on this marker.\n if (infowindow.marker != marker) {\n infowindow.marker = marker;\n\n //Get google streetview image(it has own error handle )\n var content = '';\n content = '<div>' + marker.title + '</div>';\n var streetViewUrl = 'http://maps.googleapis.com/maps/api/streetview?size=' + image_size + '&location=' + locations[marker.id].location.lat + ',' + locations[marker.id].location.lng + '';\n content += '<img class=\"mark-img\" src=\"' + streetViewUrl + '\">';\n\n\n //Error handle for wikipedia\n var wikiRequestTimeout = setTimeout(function() {\n content += '<div>' + 'wiki seems not work' + '</div>';\n }, 8000);\n //Get Wikipedia data\n var wikiUrl = 'http://en.wikipedia.org/w/api.php?action=opensearch&search=' + marker.title + '&format=json&callback=wikiCallback';\n $.ajax({\n url: wikiUrl,\n dataType: \"jsonp\",\n jsonp: \"callback\",\n success: function(response) {\n var articleList = response[1];\n //Only show the first article\n articleStr = articleList[0];\n //console.log(articleStr);\n var url = 'http://en.wikipedia.org/wiki/' + articleStr.split(' ').join('_');\n content += '<div><a href=' + url + '>' + 'Wikipedia: ' + articleStr + '</a></div>';\n infowindow.setContent(content);\n infowindow.open(map, marker);\n clearTimeout(wikiRequestTimeout);\n },\n //Error handling for ajax\n error: function(jqXHR, textStatus, errorThrown) {\n content += '<div>' + 'request wiki data meet error' + '</div>';\n infowindow.setContent(content);\n infowindow.open(map, marker);\n clearTimeout(wikiRequestTimeout);\n }\n });\n\n //Show infowindow\n infowindow.setContent(content);\n infowindow.open(map, marker);\n\n // Make sure the marker property is cleared if the infowindow is closed.\n infowindow.addListener('closeclick', function() {\n infowindow.marker = null;\n });\n }\n}", "function initializeMap() {\n var myLatLng = new google.maps.LatLng(50.4664452, 30.50814);\n var mapOptions = {\n zoom: 18,\n center: myLatLng,\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n scrollwheel: true,\n draggable: true\n };\n var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);\n var info = new google.maps.InfoWindow({\n content: '<h5>Artikus</h5><p>вул. Льва Товстого, 3</p>'\n });\n var marker = new google.maps.Marker({\n map: map,\n position: myLatLng,\n title: 'Office'\n });\n google.maps.event.addListener(marker, 'click', function () {\n return info.open(map, marker);\n });\n var styles = [{\n stylers: [{\n hue: '#0200e6'\n }, {\n saturation: -20\n }]\n }, {\n featureType: 'road',\n elementType: 'geometry',\n stylers: [{\n lightness: 100\n }, {\n visibility: 'simplified'\n }]\n }, {\n featureType: 'road',\n elementType: 'labels',\n stylers: [{\n visibility: 'off'\n }]\n }];\n map.setOptions({\n styles: styles\n });\n}", "function setMarkers(location, info, map, largeInfowindow, places) {\n var image = {\n url: 'https://developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png',\n // This marker is 20 pixels wide by 32 pixels high.\n size: new google.maps.Size(20, 32),\n // The origin for this image is (0, 0).\n origin: new google.maps.Point(0, 0),\n // The anchor for this image is the base of the flagpole at (0, 32).\n anchor: new google.maps.Point(0, 32)\n };\n // Shapes define the clickable region of the icon. The type defines an HTML\n // <area> element 'poly' which traces out a polygon as a series of X,Y points.\n // The final coordinate closes the poly by connecting to the first coordinate.\n var shape = {\n coords: [1, 1, 1, 20, 18, 20, 18, 1],\n type: 'poly'\n };\n // Convert lat and lng data to required format.\n var latlng = new google.maps.LatLng(info.lat, info.lng);\n // Send data to markers.\n var marker = new google.maps.Marker({\n icon: image,\n shape: shape,\n position: latlng,\n map: map,\n animation: google.maps.Animation.DROP,\n content: \"<h4><mark><strong>\" + info.title + \"</strong></mark></h4>\" +\n info.address + \"<br>\" +\n \"<p style='color:red'>\" + \"Rating: \" + info.rating + \"/10</p>\" +\n \"<a href='\" + info.url + \"'>\" + info.url + \"</a>\"\n });\n var infoWindow = new google.maps.InfoWindow({\n content: marker.content\n });\n // Dispay marker one by one.\n marker.infowindow = infoWindow;\n largeInfowindow.push(marker);\n places()[places().length - 1].marker = marker;\n google.maps.event.addListener(marker, 'click', function() {\n for (var i = largeInfowindow().length - 1; i >= 0; i--) {\n largeInfowindow()[i].infowindow.close();\n }\n infoWindow.open(map, marker);\n });\n google.maps.event.addListener(marker, 'click', function() {\n toggleBounce(marker);\n });\n}", "function openInfoView(loc) {\n infoWindow.close(); //closes currently displayed infoView (if it is there). \n \n //center the map at the marker for which infoView is displayed.\n map.setCenter(new google.maps.LatLng(loc.lat, loc.lon)); \n var htmlStrings = [];\n htmlStrings[0] = '<div>' + '<strong>' + loc.name + '</strong>' + '</div>';\n htmlStrings[1] = '<p>' + loc.category + '</p>';\n htmlStrings[2] = '<p>' + loc.address + '</p>';\n htmlStrings[3] = '<p>' + 'Phone No. ' + loc.phone + '</p>';\n var html = htmlStrings.join('');\n infoWindow.setContent(html);//'html' has the infoView content\n \n //sets the BOUNCE animation on marker\n loc.marker.setAnimation(google.maps.Animation.BOUNCE);\n \n //switch off the animation after 1second.\n setTimeout(function() { loc.marker.setAnimation(null);},1000);\n infoWindow.open(map, loc.marker);\n}", "function makeInfoWindow(marker, infowindow) {\n if (infowindow.marker != marker) {\n var infoContent = '<div>' + marker.title + '</div><div id=\"pano\"></div>';\n infowindow.marker = marker;\n\n infowindow.addListener('closeclick', function() {\n marker.setAnimation(null);\n infowindow.marker = null;\n });\n var streetViewService = new google.maps.StreetViewService();\n var radius = 50;\n //Wikipedia api\n var wikiUrl = 'https://en.wikipedia.org/w/api.php?action=opensearch&search=' + marker.title +\n '&limit=1&format=json&callback=wikiCallback';\n\n var wikiReqTimeOut = setTimeout(function() {\n alert('Failed to load Wikipedia link.');\n }, 5000);\n //callback\n $.ajax({\n url: wikiUrl,\n type: 'GET',\n dataType: \"jsonp\",\n success: function(response) {\n var wikiLink = response[3];\n\n if (wikiLink.length != 0) {\n infoContent += '<br><a href=' + wikiLink + '>' + wikiLink + '</a>';\n } else {\n infoContent += '<br><p>Unable to find wikipedia link</p>';\n }\n infowindow.setContent(infoContent);\n clearTimeout(wikiReqTimeOut);\n streetViewService.getPanoramaByLocation(marker.position, radius, getStreetView);\n }\n });\n\n //function to get streetview object from google maps api, from course\n function getStreetView(data, status) {\n if (status == google.maps.StreetViewStatus.OK) {\n var nearStreetViewLocation = data.location.latLng;\n var heading = google.maps.geometry.spherical.computeHeading(\n nearStreetViewLocation, marker.position);\n infowindow.setContent(infoContent);\n var panoramaOptions = {\n position: nearStreetViewLocation,\n pov: {\n heading: heading,\n pitch: 30\n }\n };\n var panorama = new google.maps.StreetViewPanorama(\n document.getElementById('pano'), panoramaOptions);\n } else {\n infowindow.setContent('<div>No Street View Found</div>' + infoContent);\n }\n }\n\n infowindow.open(map, marker);\n }\n}", "function populateInfoWindow(marker, infowindow) {\n\n if (infowindow.marker != marker) {\n\n infowindow.marker = marker;\n\n infowindow.setContent(\n '<div id=\"infowindow\">' +\n '<h1>' + marker.title + '</h1>' +\n '<div id=\"infowindow-details\" class=\"container\"></div>'\n );\n\n //Obtem detalhes das locations\n var service = new google.maps.places.PlacesService(map);\n\n service.getDetails({placeId: marker.id}, function(place, status) {\n\n if (status === 'OK') {\n\n infowindow.marker = marker;\n\n var innerHTML = '<div>';\n\n if (place.formatted_address) {\n innerHTML += place.formatted_address;\n };\n\n if (place.opening_hours) {\n innerHTML += '<br><br><h2>Horários:</h2>' +\n place.opening_hours.weekday_text[0] + '<br>' +\n place.opening_hours.weekday_text[1] + '<br>' +\n place.opening_hours.weekday_text[2] + '<br>' +\n place.opening_hours.weekday_text[3] + '<br>' +\n place.opening_hours.weekday_text[4] + '<br>' +\n place.opening_hours.weekday_text[5] + '<br>' +\n place.opening_hours.weekday_text[6];\n };\n\n if (place.photos) {\n innerHTML += '<br><br>';\n innerHTML += '<img class=\"img-responsive\" alt=\"foto do parque\" src=\"' +\n place.photos[0].getUrl({maxHeight: 100, maxWidth: 120}) + '\">';\n innerHTML += '<img class=\"img-responsive\" alt=\"foto do parque\" src=\"' +\n place.photos[1].getUrl({maxHeight: 100, maxWidth: 120}) + '\">';\n };\n\n innerHTML += '</div></div>';\n\n infowindow.setContent(infowindow.content + innerHTML);\n\n } else {\n\n infowindow.setContent(infowindow.content + '<p>Não foi possível obter ' +\n 'maiores detalhes no Google. Atualize a página para tentar novamente' +\n '</p></div>');\n };\n });\n\n infowindow.open(map, marker);\n\n infowindow.addListener('closeclick', function() {\n resetMarkersIcons();\n showMarkers();\n\n infowindow.marker = null;\n });\n\n activeInfowindow = infowindow;\n\n };\n}", "function repositionInfoWindow(zoom) {\r\n\t\tif(!$['mapsettings'].hasOpenInfoWindow) return true;\r\n\t\tif(typeof($['mapsettings'].infoWindowLocation[zoom]) != 'undefined') {\r\n\t\t\toffset = $['mapsettings'].infoWindowLocation[zoom];\r\n\t\t} else {\r\n\t\t\tpoint = $['mapsettings'].infoWindowLocation[sets.zoom];\r\n\t\t\toffset = getPointZoomOffset(point, zoom);\r\n\t\t\t$['mapsettings'].infoWindowLocation[zoom] = offset;\r\n\t\t}\r\n\t\t$(\"#infowindows img\").css('left',offset.x).css('top',offset.y-15);\r\n\t\tvar infow = $('#infowindow').css('left',offset.x).css('top',offset.y-15).hide();\r\n\t\tinfoHeight = infow.innerHeight();\r\n\t\tinfow.css('left', offset.x-4).css('top',offset.y-16-infoHeight).show();\r\n\t}", "function populateInfoWindow(marker, infoWindow) {\n // First check to make sure infoWindow is not already opened on this marker\n if (infoWindow.marker != marker) {\n infoWindow.setContent('');\n infoWindow.marker = marker;\n\n // Make sure marker property is cleared if the infoWindow is closed\n infoWindow.addListener('closeclick', function() {\n infoWindow.marker = null;\n });\n\n // If status is OK, which means pano was found, compute the position of streetView\n // image, then calculate the heading, then get a panorama from that and\n // set the options\n function getStreetView(data, status) {\n if (status == google.maps.StreetViewStatus.OK) {\n var nearStreetViewLocation = data.location.latLng;\n\n // heading variable controls the initial pitch of streetview\n var heading = google.maps.geometry.spherical.computeHeading(nearStreetViewLocation, marker.position);\n infoWindow.setContent('<div class=\"marker-title\">' + marker.title + '</div><div id=\"pano\"></div>');\n\n // Set the properties of streetview\n var panoramaOptions = {\n position: nearStreetViewLocation,\n pov: {\n heading: heading,\n pitch: 10\n }\n };\n // Create the streetview panorama that appears in the infoWindow\n var panorama = new google.maps.StreetViewPanorama(document.getElementById('pano'), panoramaOptions);\n } else {\n infoWindow.setContent('<div>' + marker.title + '</div>' + '<div>No Street View Found</div>');\n }\n }\n\n var streetViewService = new google.maps.StreetViewService();\n var radius = 50;\n // Use streetview service to get closest streetview image within\n // 50 meters of the markers position\n streetViewService.getPanoramaByLocation(marker.position, radius, getStreetView);\n // Open the infoWindow on the correct marker\n infoWindow.open(map, marker);\n }\n}", "function initialize() {\n var map;\n var panorama;\n var var_latitude = 39.7715865; // Google Map Latitude\n var var_longitude = 19.997841; // Google Map Longitude\n var pin = 'images/icons/pin.svg';\n\n //Map pin-window details\n var title = \"Hotel Himara - Click to see\";\n var hotel_name = \"Hotel Himara\";\n var hotel_address = \"Lorem ipsum dolor, 25, Himara\";\n var hotel_desc = \"5 star deluxe Hotel\";\n var hotel_more_desc = \"Lorem ipsum dolor sit amet, consectetur.\";\n\n var hotel_location = new google.maps.LatLng(var_latitude, var_longitude);\n var mapOptions = {\n center: hotel_location,\n zoom: 14,\n scrollwheel: false,\n streetViewControl: false,\n styles: [{\n \"featureType\": \"administrative\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#444444\"\n }]\n }, {\n \"featureType\": \"landscape\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"color\": \"#f5f5f5\"\n }]\n }, {\n \"featureType\": \"poi\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n }, {\n \"featureType\": \"road\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"saturation\": -100\n }, {\n \"lightness\": 45\n }]\n }, {\n \"featureType\": \"road.highway\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"visibility\": \"simplified\"\n }]\n }, {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"labels.icon\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n }, {\n \"featureType\": \"transit\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n }, {\n \"featureType\": \"water\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"color\": \"#1dc1f8\"\n }, {\n \"visibility\": \"on\"\n }]\n }]\n };\n\n map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);\n\n var contentString =\n '<div id=\"infowindow_content\">' +\n '<p><strong>' + hotel_name + '</strong><br>' +\n hotel_address + '<br>' +\n hotel_desc + '<br>' +\n hotel_more_desc + '</p>' +\n '</div>';\n\n var var_infowindow = new google.maps.InfoWindow({\n content: contentString\n });\n var marker = new google.maps.Marker({\n position: hotel_location,\n map: map,\n icon: pin,\n title: title,\n maxWidth: 500,\n optimized: false,\n });\n google.maps.event.addListener(marker, 'click', function() {\n var_infowindow.open(map, marker);\n });\n panorama = map.getStreetView();\n panorama.setPosition(hotel_location);\n panorama.setPov( /** @type {google.maps.StreetViewPov} */ ({\n heading: 265,\n pitch: 0\n }));\n var openStreet = document.getElementById('openStreetView');\n if (openStreet) {\n document.getElementById(\"openStreetView\").onclick = function() {\n toggleStreetView()\n };\n }\n\n function toggleStreetView() {\n var toggle = panorama.getVisible();\n if (toggle == false) {\n panorama.setVisible(true);\n } else {\n panorama.setVisible(false);\n }\n }\n }", "function initializeMap() {\n my_map_options = {\n center: my_center, // to change this value, change my_center above\n zoom: 13, // higher is closer-up\n mapTypeId: google.maps.MapTypeId.HYBRID // you can also use TERRAIN, STREETMAP, SATELLITE\n };\n\n // this one line creates the actual map\n my_map = new google.maps.Map(document.getElementById(\"map_canvas\"),\n my_map_options);\n // this is an *array* that holds all the marker info\n var all_my_markers =\n [{position: new google.maps.LatLng(41.9000,12.5000),\n map: my_map,\n icon: blueURL, // this sets the image that represents the marker in the map to the one\n // located at the URL which is given by the variable blueURL, see above\n title: \"first Marker\",\n window_content: \"<h1>Marker1</h1><p> and this would be the extended description</p>\"\n },\n {position: new google.maps.LatLng(41.8902,12.4923),\n map: my_map,\n icon: blueURL, // this sets the image that represents the marker in the map\n title: \"second Marker\",\n window_content: \"<h1>Marker2</h1><p> and <a href='http://something'>this would</a> be the extended description</p>\"\n },\n {position: new google.maps.LatLng(41.8986,12.4768),\n map: my_map,\n icon: redURL, // this sets the image that represents the marker in the map\n title: \"third Marker\",\n window_content: '<h1>Marker3</h1><img title=\"Picture of Quote. Src: someone, some year\" src=\"https://s-media-cache-ak0.pinimg.com/736x/6d/e2/25/6de2251b8b4be709dcc936ae4f0caaaf.jpg\"/>' +\n '<blockquote>quote quote quote quote</blockquote>'\n }\n ];\n\n for (j = 0; j < all_my_markers.length; j++) {\n var marker = new google.maps.Marker({\n position: all_my_markers[j].position,\n map: my_map,\n icon: all_my_markers[j].icon,\n title: all_my_markers[j].title,\n window_content: all_my_markers[j].window_content});\n\n // this next line is ugly, and you should change it to be prettier.\n // be careful not to introduce syntax errors though. \n legendHTML +=\n \"<div class=\\\"pointer\\\" onclick=\\\"locateMarker(my_markers[\" + j + \"])\\\"> \" +\n marker.window_content + \"</div>\";\n marker.info = new google.maps.InfoWindow({content: marker.window_content});\n var listener = google.maps.event.addListener(marker, 'click', function() {\n // if you want to allow multiple info windows, uncomment the next line\n // and comment out the two lines that follow it\n //this.info.open(this.map, this);\n infowindow.setContent (this.window_content);\n infowindow.open(my_map, this);\n });\n my_markers.push({marker:marker, listener:listener});\n if (all_my_markers[j].icon == blueURL ) {\n blue_markers.push({marker:marker, listener:listener});\n } else if (all_my_markers[j].icon == redURL ) {\n red_markers.push({marker:marker, listener:listener});\n }\n \n }\n document.getElementById(\"map_legend\").innerHTML = legendHTML;\n my_map.data.addGeoJson(myGeoJSON);\n\n var romeCircle = new google.maps.Rectangle({\n strokeColor: '#FF0000',\n strokeOpacity: 0.8,\n strokeWeight: 2,\n fillColor: '#FF0000',\n fillOpacity: 0.35,\n // in general, we always have to *set the map* when we\n // add features. \n map: my_map,\n bounds: {\n north: 42.685,\n south: 40.671,\n east: 12.501,\n west: 12.485\n },\n\n center: {\"lat\": 41.9000, \"lng\":12.5000},\n radius: 1000\n }); \n my_map.data.setStyle(function (feature) {\n var thisColor = feature.getProperty(\"myColor\");\n return {\n fillColor: thisColor,\n strokeColor: thisColor,\n strokeWeight: 5\n };\n\n});\n}", "function InfoBarWindow(){}", "function populateInfoWindow(marker, infowindow, contentString) {\n infowindow.marker = marker;\n infowindow.setContent(contentString);\n infowindow.open(map, marker);\n map.panBy(10,-120);\n // Make sure the marker property is cleared if the infowindow is closed.\n infowindow.addListener('closeclick',function(){\n marker.setAnimation(null);\n infowindow.setMarker = null;\n centerMap();\n });\n }", "function infowindowAdd(start_time, id, latitude, longitude, timestamp, infowincontent) {\n\t/* Sets the element as a bold element on the info window */\n var strong = document.createElement('strong');\n /* Creates a string with the Bus ID and puts it on the info window */\n strong.textContent = \"Bus ID: \" + id;\n infowincontent.appendChild(strong);\n infowincontent.appendChild(document.createElement('br'));\n\n\t/* Sets the element as a plaintext element on the info window */\n var lat = document.createElement('text');\n /* Creates a string with the Latitude and puts it on the info window */\n lat.textContent = \"Latitude: \" + latitude;\n\tinfowincontent.appendChild(lat);\n\tinfowincontent.appendChild(document.createElement('br'));\n\n\t/* Sets the element as a plaintext element on the info window */\n\tvar lon = document.createElement('text');\n\t/* Creates a string with the longitude and puts it on the info window */\n lon.textContent = \"Latitude: \" + longitude;\n\tinfowincontent.appendChild(lon);\n\tinfowincontent.appendChild(document.createElement('br'));\n\n\t/* Sets the element as a plaintext element on the info window */\n\tvar start = document.createElement('text');\n\t/* Creates a string with the Start Time and puts it on the info window */\n start.textContent = \"Start Time: \" + start_time;\n\tinfowincontent.appendChild(start);\n\tinfowincontent.appendChild(document.createElement('br'));\n\n\t/* Splits the timestamp into hours, minutes and seconds */\n\tvar hours = timestamp.getHours();\n\tvar minutes = timestamp.getMinutes();\n\tvar seconds = timestamp.getSeconds();\n\t\n\tif (minutes < 10) {\n\t\tminutes = '0' + minutes;\n\t}\t\n\tif (seconds < 10) {\n\t\tseconds = '0' + seconds;\n\t}\n\t\t\t\t\t\t\t\t\n\tvar real_time = hours + ':' + minutes + ':' + seconds;\n var text = document.createElement('text1');\n /* Displays the split timestamp on the info window */\n text.textContent = \"Timestamp: \" + real_time;\n infowincontent.appendChild(text);\t\t\t \n}", "function setMarkers(map) {\n\n // defines the clickable region of the icon\n // no real use yet\n // var shape = {\n // coords: [1, 1, 1, 20, 18, 20, 18, 1],\n // type: 'poly'\n // };\n\n for (var i=0; i<pins.length; i++) {\n // object (one pin)\n var pin = pins[i];\n\n var status = pin.fields.status;\n\n if (status === 'Barrier')\n var url = '/static/img/map-marker-barrier.png';\n else if (status === 'In Progress')\n var url = '/static/img/map-marker-in-progress.png';\n else if (status === 'Resolved')\n var url = '/static/img/map-marker-resolved.png';\n else if (status === 'Best Practice')\n var url = '/static/img/map-marker-best-practice.png';\n else\n var url = '/static/img/map-marker.png';\n\n var image = {\n url: url\n // size: new google.maps.Size(20, 32),\n // origin: new google.maps.Point(0, 0),\n // anchor: new google.maps.Point(0, 32)\n };\n\n if (pin.fields.address != null)\n var address = pin.fields.address;\n else\n var address = '';\n\n if (pin.fields.date_updated != null)\n var date = pin.fields.date_updated;\n else\n var date = '';\n\n // data of a detailed window\n var contentString = '<div id=\"content\" style=\"color: black\">'+\n '<div id=\"siteNotice\">'+\n '</div>'+\n '<h1 id=\"firstHeading\" class=\"firstHeading\">' + pin.fields.tag + '</h1>'+\n '<div id=\"bodyContent\">'+\n '<div><b>Status: </b>'+ status +'</div>'+\n '<div><b>Description: </b>'+ pin.fields.description +'</div>'+\n '<div><b>Address: </b>'+ address +'</div>'+\n '<div><b>Date created: </b>'+ pin.fields.date_created.slice(0,10) + \" \" + pin.fields.date_created.slice(11,19) +'</div>'+\n '<div><b>Date updated: </b>'+ date.slice(0,10) + \" \" + date.slice(11,19) +'</div>'+\n '<div><a href=\"/pins/' + (i+1) + '\">See more</a>' +\n '</div>'+\n '</div>';\n\n var infowindow = new google.maps.InfoWindow({\n content: contentString,\n maxWidth: 450\n });\n\n // creating the marker\n var marker = new google.maps.Marker({\n position: {\n lat: pin.fields.location_latitude, \n lng: pin.fields.location_longitude\n },\n map: map,\n icon: image,\n infowindow: infowindow,\n // shape: shape,\n // title: pin[0],\n zIndex: i // determines which pin is on top if they overlap\n });\n\n // listener for clicking on a pin\n marker.addListener('click', function() {\n this.infowindow.open(map, this);\n });\n\n\n }\n}", "function inicializarMapa() {\n // The location of Córdoba\n var casaCentral = { lat: -31.4662446, lng: -64.3983766 } //casa central en Córdoba\n // The map, centered at localizacion\n var map =new google.maps.Map(document.getElementById('maps'),{zoom: 4, center: casaCentral});\n\n localizaciones.forEach(localizacion => {\n //cargo los marcadores\n var marker = new google.maps.Marker({\n position: localizacion.position, \n map: map\n }); \n //cuando hace click se abre la ventanita infowindows con el nombre \n var infowindow = new google.maps.InfoWindow({\n content: localizacion.content\n });\n \n marker.addListener('click', function() {\n infowindow.open(map, marker);\n });\n }); \n \n}", "function callNewZealandMap() {\n var map = new google.maps.Map(document.getElementById(\"map-three\"), {\n zoom: 5,\n center: {\n lat: -41.387115,\n lng: 173.271459\n }\n });\n\n var locations = [\n [{\n lat: -44.0524874,\n lng: 169.8888116\n }, \"Lake Pukaki\"],\n [{\n lat: -37.8721191,\n lng: 175.6807515\n }, \"Hobbiton\"],\n [{\n lat: -36.8277959,\n lng: 175.7883369\n }, \"Cathedral Cove\"],\n [{\n lat: -45.4202475,\n lng: 167.6827424\n }, \"Fiordland National Park\"],\n [{\n lat: -39.2967528,\n lng: 174.0546445\n }, \"Mount Taranaki\"],\n ];\n var infoWindow = new google.maps.InfoWindow();\n locations.forEach(([position, title]) => {\n const marker = new google.maps.Marker({\n position,\n map,\n title: `${title}`,\n optimized: false,\n });\n\n marker.addListener(\"click\", () => {\n infoWindow.close();\n infoWindow.setContent(marker.getTitle());\n infoWindow.open(marker.getMap(), marker);\n });\n });\n}", "function createInfoWindow(map) {\n console.log(\"creating info window\");\n infowindow = new google.maps.InfoWindow();\n google.maps.event.addListener(map, 'mouseover', function() {\n infowindow.close();\n });\n return infowindow;\n}", "function klikInfoWindow(id, marker)\n{\n google.maps.event.addListener(marker, \"click\", function(){\n detailmes_infow(id);\n\n });\n\n}", "function populateInfoWindow(marker, image, infourl, description, infowindow) {\n // Check to make sure the infowindow is not already opened on this marker.\n if (infowindow.marker != marker) {\n infowindow.marker = marker;\n infowindow.setContent('<div class=\"info-window-content\"><div class=\"title\"><b>' + marker.title + \"</b></div>\" +\n '<div class=\"content\"><img src=\"' + image +'\" class=\"responsive-img valign\"></div>' +\n '<div class=\"content\"><p>' + description + '</p></div>' +\n '<div class=\"content\"><a href=\"' + infourl +'\" target=\"_blank\">' + infourl + \"</a></div>\" +\n \"</div>\");\n infowindow.open(map, marker);\n // Make sure the marker property is cleared if the infowindow is closed.\n infowindow.addListener('closeclick', function() {\n infowindow.marker = null;\n });\n\n }\n}", "function callMoroccoMap() {\n var map = new google.maps.Map(document.getElementById(\"map-four\"), {\n zoom: 5,\n center: {\n lat: 31.794525,\n lng: -7.0849336\n }\n });\n\n var locations = [\n [{\n lat: 31.0466925,\n lng: -7.1342039\n }, \"Aït Benhaddou\"],\n [{\n lat: 35.7633932,\n lng: -5.9045097\n }, \"Tangier\"],\n [{\n lat: 31.1458509,\n lng: -3.9765326\n }, \"Erg Chebbi\"],\n [{\n lat: 31.6347485,\n lng: -8.0778931\n }, \"Marrakesh\"],\n [{\n lat: 31.5109789,\n lng: -9.7800517\n }, \"Essaouira\"],\n ];\n var infoWindow = new google.maps.InfoWindow();\n locations.forEach(([position, title]) => {\n const marker = new google.maps.Marker({\n position,\n map,\n title: `${title}`,\n optimized: false,\n });\n\n marker.addListener(\"click\", () => {\n infoWindow.close();\n infoWindow.setContent(marker.getTitle());\n infoWindow.open(marker.getMap(), marker);\n });\n });\n}", "function addMarkerInfo() {\n\n for (var i = 0; i < markersOnMap.length; i++) {\n var contentString = '<div id=\"content\"><h1>' + markersOnMap[i].placeName +\n\n '</h1><p>' + markersOnMap[i].description + ' <a href=\"walks.html\">See our Walks page for further details</a>r</p></div>';\n\n const marker = new google.maps.Marker({\n position: markersOnMap[i].LatLng[0],\n map: map\n });\n\n const infowindow = new google.maps.InfoWindow({\n content: contentString,\n maxWidth: 200\n });\n\n marker.addListener('click', function () {\n closeOtherInfo();\n infowindow.open(marker.get('map'), marker);\n InforObj[0] = infowindow;\n });\n\n }\n}", "function getInfoWindowContent(data, type) {\n var html = ``;\n switch(type) {\n\n // Customer\n case 'customer':\n html += `<div class=\"gmap__infowindow ${type}\">`;\n html += `<div class=\"row\">`;\n html += `<div class=\"col__icon\"><i class='material-icons'>&#xe0af</i></div>`;\n html += `<div class=\"col__content\"><b>${data.name}</b><br/>${data.address}</div>`;\n html += `</div>`;\n html += `<div class=\"row\"><hr/></div>`;\n html += `<div class=\"row\">`;\n html += `<div class=\"col__icon\">&nbsp;</div>`;\n html += `<div class=\"col__content\"><b>Last visited:</b> ${data.last_visit}<br/>`;\n html += `<a href=\"#\" data-toggle=\"appointment-modal\" data-cname=\"${data.name}\" data-cid=\"${data.id}\" data-srname=\"${data.sr_name}\" data-srid=\"${data.sr_id}\" data-addr=\"${data.address}\">Schedule Appointment...</a></div>`;\n html += `</div>`;\n html += `</div>`;\n break;\n \n // Sales Rep Checked-In Location\n case 'checkin':\n html += `<div class=\"gmap__infowindow ${type}\">`;\n html += `<div class=\"row\">`;\n html += `<div class=\"col__icon\"><i class='material-icons'>event</i></div>`;\n html += `<div class=\"col__content\">${data.visit_time} &nbsp;&nbsp; ${data.visit_date}</div>`;\n html += `</div>`;\n html += `<div class=\"row\"><hr/></div>`;\n html += `<div class=\"row\">`;\n html += `<div class=\"col__icon\"><i class='material-icons'>&#xe0af</i></div>`;\n html += `<div class=\"col__content\"><b>Customer Name:</b><br/>`;\n html += `${data.customer}<br/>`;\n html += `${data.customer_address}<br/>`;\n html += `<span class=\"loc__last-checkin\" style=\"margin-top:5px\">`;\n html += `<i class=\"material-icons\">beenhere</i>`;\n html += `<span>${data.last_seen} </span>`;\n html += `</span></div>`;\n html += `</div>`;\n html += `<div class=\"row\"><hr/></div>`;\n html += `<div class=\"row\">`;\n html += `<div class=\"col__icon\"><i class='material-icons text-danger'>&#xe55f</i></div>`;\n html += `<div class=\"col__content\"><b>GPS Address</b><br/>${data.gps_address}</div>`;\n html += `</div>`;\n html += `<div class=\"row\" style=\"margin-top:13px\">`;\n html += `<div class=\"col__icon\"><i class='material-icons' style=\"color:#32DB64\">beenhere</i></div>`;\n html += `<div class=\"col__content\"><b>Rep Reported Address</b><br/>${data.address}</div>`;\n html += `</div>`;\n html += `</div>`;\n break;\n \n // Sales Rep GPS Location\n case 'salesrep':\n html += `<div class=\"gmap__infowindow ${type}\">`;\n html += `<div class=\"row\">`;\n html += `<div class=\"col__icon\"><i class='material-icons'>&#xe7fd</i></div>`;\n html += `<div class=\"col__content\">Sales Rep: <b>${data.name}</b></div>`;\n html += `</div>`;\n html += `<div class=\"row\" style=\"margin-top:13px\">`;\n html += `<div class=\"col__icon\"><i class='material-icons text-danger'>&#xe55f</i></div>`;\n html += `<div class=\"col__content\"><b>GPS Address</b><br/>${data.address}</div>`;\n html += `</div>`;\n html += `</div>`;\n break;\n }\n return html;\n}", "function initializeVer(){\n\tvar mapProp = {center:myCenterVer, zoom:14, mapTypeId:google.maps.MapTypeId.ROADMAP};\n\n\tmapVer = new google.maps.Map(document.getElementById(\"googleMapVer\"),mapProp);\n\n\tgoogle.maps.event.addListener(mapVer, 'click', function(event){ placeMarkerVer(event.latLng); });\n\n\tvar marcador;\n\tvar infowindows = [];\n\tvar markerActu = [];\n\tfor(var i = 0; i < (PuntosLimpios.length); i++){\n\t\tconsole.log(PuntosLimpios[i]+\" \"+PuntosLimpios[i+1]);\n\t\tmarcador = new google.maps.Marker({position: {lat: parseFloat(PuntosLimpios[i]), lng: parseFloat(PuntosLimpios[i+1])}, map: mapVer,});\n\t\tinfowindow = new google.maps.InfoWindow({content:PuntosLimpios[i+2]});\n\t\tmarkerActu.push(marcador);\n\t\tinfowindows.push(infowindow);\n\t\tgoogle.maps.event.addListener(markerActu[parseInt(i/6)], 'click', function(k){\n\t\t\treturn function(){\n\t\t\t\tfor (var j = 0; j < infowindows.length; j++) {\n\t\t\t\t\tinfowindows[j].close();\n\t\t\t\t\tmarkerActu[j].setAnimation(null);\n\t\t\t\t}\n\t\t\t\tmarkerActu[k].setAnimation(google.maps.Animation.BOUNCE);\n\t\t\t\tinfowindows[k].open(mapVer, markerActu[k]);\n\n\t\t\t\tvar latitud = markerActu[k].getPosition().lat();\n\t\t\t\tvar longitud = markerActu[k].getPosition().lng();\n\t\t\t\tdocument.getElementById('coorX').value = latitud;\n\t\t\t\tdocument.getElementById(\"coordX\").innerHTML = latitud;\n\t\t\t\tdocument.getElementById('coorY').value = longitud;\n\t\t\t\tdocument.getElementById(\"coordY\").innerHTML = longitud;\n\n\t\t\t\tvar direccion = \"http://maps.googleapis.com/maps/api/geocode/json?latlng=\"+latitud+\",\"+longitud+\"&sensor=true\";\n\t\t\t\tconsole.log(direccion);\n\t\t\t\t$.getJSON(direccion, function(result){\n\t\t\t\t\tvar address = result.results[0].formatted_address;\n\t\t\t\t\tdocument.getElementById(\"dir\").innerHTML = address;\n\t\t\t\t\tdocument.getElementById(\"direccion\").value = address;\n\t\t\t\t});\n\t\t\t\tvar infoI = k*7 + 2;\n\t\t\t\tdocument.getElementById(\"nombreJunta\").innerHTML = PuntosLimpios[infoI];\n\t\t\t\tdocument.getElementById(\"nombre\").innerHTML = PuntosLimpios[infoI+2];\n\t\t\t\tdocument.getElementById(\"telefono\").innerHTML = PuntosLimpios[infoI+3];\n\t\t\t\tdocument.getElementById(\"email\").innerHTML = PuntosLimpios[infoI+4];\n\t\t\t\tdocument.getElementById(\"fecha\").innerHTML = PuntosLimpios[infoI+1];\n\t\t\t\t$('#collapseVerInfo').collapse(\"show\");\n\t\t\t}\n\t\t}(parseInt(i/7)));\n\t\ti += 6;\n\t}\n\n\tvar marcadorExistente;\n\tinfowindowsExistente = [];\n\tmarkerActuExistente = [];\n\tfor(var i = 0; i < (PuntosLimpiosExistente.length); i++){\n\t\tconsole.log(PuntosLimpiosExistente[i]+\" \"+PuntosLimpiosExistente[i+1]);\n\t\tmarcadorExistente = new google.maps.Marker({position: {lat: parseFloat(PuntosLimpiosExistente[i]), lng: parseFloat(PuntosLimpiosExistente[i+1])}, map: mapVer,icon:\"resources/pinkball.png\",});\t\t\n\t\tinfowindowExistente = new google.maps.InfoWindow({content:PuntosLimpiosExistente[i+2]});\n\t\tmarcadorExistente.setVisible(false);\n\t\tmarkerActuExistente.push(marcadorExistente);\n\t\tinfowindowsExistente.push(infowindowExistente);\n\t\tgoogle.maps.event.addListener(markerActuExistente[parseInt(i/3)], 'click', function(k){\n\t\t\treturn function(){\n\t\t\t\tfor (var j = 0; j < infowindowsExistente.length; j++) {\n\t\t\t\t\tinfowindowsExistente[j].close();\n\t\t\t\t}\n\t\t\t\tinfowindowsExistente[k].open(mapVer, markerActuExistente[k]);\n\t\t\t}\n\t\t}(parseInt(i/3)));\n\t\ti += 2;\n\t}\n}", "function populateInfoWindow(marker, infowindow, street, city) {\r\n // Check to make sure the infowindow is not already opened on this marker.\r\n if (infowindow.marker != marker) {\r\n infowindow.marker = marker;\r\n infowindow.setContent('');\r\n infowindow.open(map, marker);\r\n // Make sure the marker property is cleared if the infowindow is closed.\r\n infowindow.addListener('closeclick', function() {\r\n infowindow.setMarker = null;\r\n });\r\n\r\n var streetViewService = new google.maps.StreetViewService();\r\n var radius = 50;\r\n var infoContent = '<h4>' + marker.title + '</h4>' +\r\n '<p>' + street + \"<br>\" + city + \"</p>\";\r\n\r\n //create a streetview image code refrenced from udacity course\r\n function getStreetView(data, status) {\r\n if (status == google.maps.StreetViewStatus.OK) {\r\n var nearStreetViewLocation = data.location.latLng;\r\n var heading = google.maps.geometry.spherical.computeHeading(\r\n nearStreetViewLocation, marker.position);\r\n infowindow.setContent(infoContent + '<div id=\"pano\"></div>');\r\n var panoramaOptions = {\r\n position: nearStreetViewLocation,\r\n pov: {\r\n heading: heading,\r\n pitch: 30\r\n }\r\n };\r\n var panorama = new google.maps.StreetViewPanorama(\r\n document.getElementById('pano'), panoramaOptions);\r\n } else {\r\n infowindow.setContent(infoContent +\r\n '<div>No Street View Found</div>');\r\n }\r\n }\r\n streetViewService.getPanoramaByLocation(marker.position, radius, getStreetView);\r\n // Open the infowindow on the correct marker.\r\n infowindow.open(map, marker);\r\n }\r\n}", "function setInfoWindow(marker, infoWindow) {\n if (infoWindow.marker != marker) {\n infoWindow.marker = marker;\n infoWindow.setContent(\"<div class='title'>\" + marker.title + \"</div>\" + marker.contentString);\n }\n marker.setAnimation(google.maps.Animation.BOUNCE);\n setTimeout(function() {\n marker.setAnimation(null);\n }, 500);\n infoWindow.open(map, marker);\n \n infoWindow.addListener('closeclick', function() {\n infoWindow.setMarker = null;\n });\n\n //Automatically close info window after 3 seconds\n window.setTimeout(function(){\n infoWindow.close();\n }, 3000);\n }", "function showPanel(placeResult) {\n // If infoPane is already open, close it\n clearExsiting();\n // Clear the previous details\n infoPane.style.backgroundColor = \"#f29900\";\n if (placeResult.photos) {\n let firstPhoto = placeResult.photos[0];\n let photo = document.createElement('img');\n photo.classList.add('hero');\n photo.style.width = \"100%\";\n photo.style.height = \"250px\";\n photo.style.borderRadius = \"25px\";\n photo.style.alignSelf = \"center\";\n photo.src = firstPhoto.getUrl();\n infoPane.appendChild(photo);\n }\n\n //calculate current day of week \n var d = new Date();\n var n = d.getDay();\n console.log(\"current day : \" + n);\n //getDay counts Sunday as 0 and Saturday as 6, whereas Google Map Places Details counts Monday as 0 and Sunday as 6\n // subtracting 1 is necessary to grab current day's operating hours from the API\n n = n - 1;\n if (n < 0){\n n = 6;\n }\n // Add place details with text formatting\n let name = document.createElement('p');\n let isOpen = document.createElement('p');\n let hours = document.createElement('p');\n name.classList.add('place');\n name.textContent = placeResult.name;\n \n if (placeResult.rating) {\n name.textContent += ` \\u272e${placeResult.rating}`;\n }\n if (placeResult.opening_hours.open_now){\n isOpen.textContent = \"Open\";\n isOpen.style.color = \"#2FC80D\";\n }\n else {\n isOpen.textContent = \"Closed at this moment\";\n isOpen.style.color = \"red\";\n }\n isOpen.style.fontWeight = \"bold\";\n isOpen.classList.add('details');\n hours.classList.add('details');\n hours.textContent = placeResult.opening_hours.weekday_text[n];\n\n infoPane.appendChild(name);\n infoPane.appendChild(isOpen);\n infoPane.appendChild(hours);\n if (placeResult.website) {\n let websitePara = document.createElement('p');\n let websiteLink = document.createElement('a');\n let websiteUrl = document.createTextNode(placeResult.website);\n websiteLink.appendChild(websiteUrl);\n websiteLink.title = placeResult.website;\n websiteLink.href = placeResult.website;\n websitePara.appendChild(websiteLink);\n infoPane.appendChild(websitePara);\n }\n// create a list of 5 reviews in the 'reviewbox' html element\n document.getElementById('reviewbox').style.backgroundColor = \"#2FC80D\";\n placeResult.reviews.forEach(review => {\n let rdetail = document.createElement('div');\n let author = document.createElement('p');\n let rateNtime = document.createElement('p');\n let user_text = document.createElement('p');\n let user_rating = \"\";\n let time = review.relative_time_description;\n\n for(var i = 0; i < review.rating ; i++){\n user_rating += \"\\u272e\";\n }\n author.textContent = review.author_name;\n author.style.marginTop = \"8px\";\n author.style.fontWeight = \"bold\";\n author.style.fontSize = \"15px\";\n rateNtime.textContent = user_rating + \" || \" + time;\n rateNtime.style.marginBottom = \"0px\";\n user_text.textContent = review.text;\n user_text.style.marginTop = \"0px\";\n rdetail.appendChild(author);\n rdetail.appendChild(rateNtime);\n rdetail.appendChild(user_text);\n\n reviewList.appendChild(rdetail);\n\n });\n }", "function initialize_map() {\r\n var map;\r\n var bounds = new google.maps.LatLngBounds();\r\n var mapOptions = {\r\n mapTypeId: 'roadmap'\r\n };\r\n \r\n // Display a map on the page\r\n map = new google.maps.Map(document.getElementById(\"map_canvas\"), mapOptions);\r\n map.setTilt(45);\r\n \r\n // Multiple Markers\r\n\tvar k = 0;\r\n\tvar markers = [];\r\n\tfor(var j = (current_page-1)*7; j < (current_page-1)*7+7; j++){\r\n\t\tmarkers.push(earth_list[j]);\r\n\t\tk ++;\r\n\t}\r\n \r\n // Info Window Content\r\n var infoWindowContent = [];\r\n\tfor(var i = 0; i < 7; i++){\r\n\t\tinfoWindowContent.push(['<div class=\"info_content\">' +\r\n '<h3>' + markers[i][0] + '</h3>' +\r\n '</div>']);\r\n\t}\r\n \r\n // Display multiple markers on a map\r\n var infoWindow = new google.maps.InfoWindow(), marker, i;\r\n\r\n // Loop through our array of markers & place each one on the map \r\n for( i = 0; i < markers.length; i++ ) {\r\n var position = new google.maps.LatLng(markers[i][1], markers[i][2]);\r\n bounds.extend(position);\r\n marker = new google.maps.Marker({\r\n position: position,\r\n map: map,\r\n title: markers[i][0]\r\n });\r\n // Allow each marker to have an info window \r\n google.maps.event.addListener(marker, 'mouseover', (function(marker, i) {\r\n return function() {\r\n infoWindow.setContent(infoWindowContent[i][0]);\r\n infoWindow.open(map, marker);\r\n }\r\n })(marker, i));\r\n // Automatically center the map fitting all markers on the screen\r\n map.fitBounds(bounds);\r\n }\r\n // Override our map zoom level once our fitBounds function runs (Make sure it only runs once)\r\n var boundsListener = google.maps.event.addListener((map), 'bounds_changed', function(event) {\r\n this.setZoom(1);\r\n google.maps.event.removeListener(boundsListener);\r\n });\r\n}", "function initMap() {\ngeocoder = new google.maps.Geocoder();\nmap = new google.maps.Map(document.getElementById('map'), {\nzoom: 13,\ncenter: new google.maps.LatLng(37.4419, -122.1419),\nscrollwheel: false,\n//custom colors\nstyles: [{\"featureType\":\"landscape\",\"stylers\":[{\"hue\":\"#FFA800\"},{\"saturation\":0},{\"lightness\":0},{\"gamma\":1}]},{\"featureType\":\"road.highway\",\"stylers\":[{\"hue\":\"#53FF00\"},{\"saturation\":-73},{\"lightness\":40},{\"gamma\":1}]},{\"featureType\":\"road.arterial\",\"stylers\":[{\"hue\":\"#FBFF00\"},{\"saturation\":0},{\"lightness\":0},{\"gamma\":1}]},{\"featureType\":\"road.local\",\"stylers\":[{\"hue\":\"#00FFFD\"},{\"saturation\":0},{\"lightness\":30},{\"gamma\":1}]},{\"featureType\":\"water\",\"stylers\":[{\"hue\":\"#00BFFF\"},{\"saturation\":6},{\"lightness\":8},{\"gamma\":1}]},{\"featureType\":\"poi\",\"stylers\":[{\"hue\":\"#679714\"},{\"saturation\":33.4},{\"lightness\":-25.4},{\"gamma\":1}]}]\n});\n\n//var infoWindow = new google.maps.InfoWindow({map: map});\n\n // Geolocation services, start user at current geolocation\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\n infoWindow.setPosition(pos);\n infoWindow.setContent('Your Location');\n map.setCenter(pos);\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\n}", "function initialize()\r\n{\r\n\r\nvar mapOpt = {\r\n center: myCenter,\r\n zoom:15,\r\n mapTypeId:google.maps.MapTypeId.ROADMAP\r\n };\r\nvar map=new google.maps.Map(document.getElementById(\"maps\"),mapOpt);\r\n\r\nvar marker=new google.maps.Marker({\r\n position:myCenter,\r\n });\r\n\r\nmarker.setMap(map);\r\n\r\nvar infowindow = new google.maps.InfoWindow({\r\n content:\"Prypiat\"\r\n });\r\n\r\ngoogle.maps.event.addListener(marker, 'click', function() {\r\n infowindow.open(map,marker);\r\n });\r\n\r\n\r\n}", "function initMap() {\n \t'use strict';\n\t\tvar myCenter = new google.maps.LatLng(48.2089816, 16.3732133),\n\t\t mapCanvas = document.getElementById(\"officeMap\"),\n\t\t mapOptions = {center: myCenter, zoom: 13, scrollwheel: false},\n\t\t map = new google.maps.Map(mapCanvas, mapOptions);\n\n\t \tvar locations = markers;\n\t \tvar marker, i;\n\t \tvar infowindow = new google.maps.InfoWindow();\n\t \tvar image = {\n\t \t\turl: \"img/officemarker.png\",\n\t \t\tscaledSize: new google.maps.Size(30, 30), // scaled size\n\t \t};\n\t for (i = 0; i < locations.length; i++) { \n\t \tmarker = new google.maps.Marker({\n\t\t position: new google.maps.LatLng(locations[i][0], locations[i][1]),\n\t\t map: map,\n\t\t icon: image\n\t });\n\n\t google.maps.event.addListener(marker, 'click', (function(marker, i) {\n\t return function() {\n\t infowindow.setContent(locations[i][2]);\n\t infowindow.open(map, marker);\n\t map.setZoom(16);\n\t \t map.setCenter(marker.getPosition());\n\t }\n\t })(marker, i));\n\t }\n\t}", "function populateInfoWindow(marker, infowindow) {\n fourSquare(marker);\n}", "function populateInfoWindow(marker, infowindow) {\n if (infowindow.marker != marker) {\n infowindow.marker = marker;\n //Make infowindow close on second click\n infowindow.addListener('closeclick', function() {\n infowindow.setMarker(null);\n })\n var streetViewService = new google.maps.StreetViewService();\n var radius = 50;\n\n function getStreetView(data, status) {\n if (status == google.maps.StreetViewStatus.OK) {\n var nearStreetViewLocation = data.location.latLng;\n var heading = google.maps.geometry.spherical.computeHeading(nearStreetViewLocation, marker.position);\n //Possibly set infowindow here?\n var panoramaOptions = {\n position: nearStreetViewLocation,\n pov: {\n heading: heading,\n pitch: 30\n }\n };\n var panorama = new google.maps.StreetViewPanorama(document.getElementById('pano'), panoramaOptions);\n } else {\n infowindow.setContent('<div>' + marker.title + '</div>' + '<div>No Street View Found!</div');\n }\n \n }\n\n\n //Create wiki url with our search string inside:\n var wikiUrl = 'https://en.wikipedia.org/w/api.php?action=opensearch&search=' + marker.title;\n\n\n //Create ajax request object\n $.ajax({\n url: wikiUrl,\n dataType: \"jsonp\",\n success: function( response ) {\n var wikiStr = response[1];\n var wikipediaURL = 'https://en.wikipedia.org/wiki/' + wikiStr;\n infowindow.setContent('<h2>' + marker.title + '</h2>' + '</div><div id=\"pano\"></div>' + '<p>' + '<a href=\"' + wikipediaURL + '\">' + '</p><p>' + response[2] + '</p>');\n infowindow.open(map, marker);\n streetViewService.getPanoramaByLocation(marker.position, radius, getStreetView);\n\n },\n error: function(msg) {\n console.log(msg);\n }\n\n });\n }\n\n }", "function setupInfoWindow() {\n var marker, photoUrl;\n for (var i = 0; i < markers.length; i++) {\n markers[i].infoWindow = new google.maps.InfoWindow();\n markers[i].photoUrl = photos[i];\n markers[i].addListener('click', function (marker) {\n return function () {\n toggleBounce(marker);\n populateInfoWindow(marker);\n }\n\n }(markers[i]));\n markers[i].addListener('mouseover', function (marker) {\n return function () {\n marker.setIcon(highlightedIcon);\n }\n\n }(markers[i]));\n markers[i].addListener('mouseout', function (marker) {\n return function () {\n marker.setIcon(defaultIcon);\n }\n }(markers[i]));\n }\n // Apply bindings after map as been loaded and the images have been received.\n ko.applyBindings(new PlaceViewModal());\n}", "function setMarkers(map) {\n \n// Initialise infowindown instance\n var infowindow = new google.maps.InfoWindow({\n \tcontent: locationsAmerica\n \t});\n \n \n// Loop through each marker location in the array\n for (var i = 0; i < locationsAmerica.length; i++) {\n var location = locationsAmerica[i];\n \n var marker = new google.maps.Marker({\n position: {lat: location[1], lng: location[2]},\n map: map,\n icon: 'https://simonjosling.com/assets/images/pinvector.svg',\n title: location[0],\n zIndex: location[3],\n url: location[4]\n });\n \n// Add event listener for marker click\n\n google.maps.event.addListener( marker, 'click', function() {\n// Set infowindow content to string containing URL and title\n \tinfowindow.setContent( \n \t\t'<a href=\"' + this.url + '\">' + this.title + '</a>'\n \t);\n// Open infowindow\n \tinfowindow.open( map, this );\n });\n// Add DOM listener for buttons for changing map centre and zoom level\n google.maps.event.addDomListener(document.getElementById('btnAsia'), 'click', function () {\n \tmap.setCenter(new google.maps.LatLng(15,104));\n \tmap.setZoom(5);\n });\n google.maps.event.addDomListener(document.getElementById('btnAmerica'), 'click', function () {\n \tmap.setCenter(new google.maps.LatLng(-10,-60));\n \tmap.setZoom(3);\n });\n google.maps.event.addDomListener(document.getElementById('btnOceania'), 'click', function () {\n \tmap.setCenter(new google.maps.LatLng(-30,160));\n \tmap.setZoom(3);\n });\n }\n}", "function openInfoWindowHtml(point, html) {\r\n\t\tcloseInfoWindow();\r\n\t\tvar x = point.x;\r\n\t\tvar y = point.y;\r\n\t\t$['mapsettings'].infoWindowLocation[$['mapsettings'].zoom] = new Point(x,y);\r\n\t\t$('<div id = \"infowindow\" />').css('left',x-4).css('top',y-53).html('<div class = \"inner\">' + $['mapsettings'].exitLink + html + '</div>').appendTo('#infowindows').hide();\r\n\t\tvar infow = $('#infowindow');\r\n\t\tinfoWidth = infow.innerWidth();\r\n\t\tinfoHeight = infow.innerHeight();\r\n\t\tinfow.css('left', x-4).css('top',y-16-infoHeight).show();\r\n\t\t$(\"#infowindows\").append($['mapsettings'].infoImage);\r\n\t\t$(\"#infowindows img\").css('left',x).css('top',y-15);\r\n\t\t$(\"#exitLink\").click(function(e){\r\n\t\t\te.preventDefault();\r\n\t\t\tcloseInfoWindow();\r\n\t\t\treturn false;\r\n\t\t});\r\n\t\t$['mapsettings'].hasOpenInfoWindow = true;\r\n\t}", "function hook_event_listener(marker, name, id, img, date, des) {\n \n marker.addListener('click', function() {\n open_url(name, id); // click to open url\n });\n\n \n marker.addListener('mouseout', function() {\n infowindow.close(map, marker);\n });\n marker.addListener('mouseover', function() {\n \n //html thumb image display string \n var contentString = '<div>'+\n '<img class=\"thumbnail popup-th-img\" src=\"'+img+'\" alt=\"'+name+'\">'+\n '<h3>'+name+'</h3>'+des+\n '</p>'+\n '</div>';\n\n //create new object infowindow\n infowindow = new google.maps.InfoWindow({\n content: contentString,\n maxWidth: 400\n });\n //invoke infowindow Object\n infowindow.open(map, marker);\n \n });\n} // End of hook_event_listener function", "function pushMarker(json) {\n\n geocode({ 'address': json.location }, function (results, status) {\n if (status != google.maps.GeocoderStatus.OK) {\n console.log(status);\n return;\n }\n var coordinates = results[0].geometry.location;\n // if the coordinates are fine, create the marker and the infoWindow\n if (status == google.maps.GeocoderStatus.OK) {\n // check if the marker is already on the named location\n var getIndex;\n for (var i = 1; i < markers.length; i++) {\n if (coordinates.G == markers[i].getPosition().lat() && coordinates.K == markers[i].getPosition().lng()) {\n getIndex = i;\n break;\n }\n }\n // if the marker already exists, just change the infoWindow\n if (getIndex != null) {\n var content = infoViews[getIndex - 1].getContent();\n }\n // create the content of the infoWindow\n var contentString =\n '<div id=\"content\">' +\n '<div id=\"siteNotice\">' +\n '</div>' +\n '<h1 id=\"firstHeading\" class=\"firstHeading\">' + json.title + '</h1>';\n\n if (json.related != null) {\n contentString = contentString + '<h4 style=\"font-size: small;font-style: italic\">' + json.artist + ' is related to ' + json.related + '</h4>';\n }\n\n var contentString = contentString +\n '<h5 id=\"secondHeading\">' + json.type + '</h5>' +\n '<div id=\"bodyContent\">' +\n '<p>' + json.description + '</p>' +\n '</div>' +\n '</div>';\n\n // if marker already on the map, just change the content \n if (getIndex != null) {\n var newContent = content + contentString;\n infoViews[getIndex - 1].setContent(newContent);\n markers[getIndex].title = 'Miscellaneous';\n var icon = 'https://chart.googleapis.com/chart?chst=d_map_pin_letter&chld=M|00FF00|0000FF';\n markers[getIndex].setIcon(icon);\n markers[getIndex].addListener('click', function () {\n infoViews[getIndex - 1].open(map, markers[getIndex]);\n });\n return;\n }\n // otherwise\n else {\n // create the infoWindow containing the content string\n var infoWindow = new google.maps.InfoWindow({\n content: contentString\n });\n infoViews.push(infoWindow);\n\n // set the propper icon\n var icon;\n if (json.type == 'TwitterLocation') {\n icon = 'https://chart.googleapis.com/chart?chst=d_map_pin_letter&chld=T|4099FF|0000FF'\n } else if (json.type == 'Tweet') {\n icon = 'https://chart.googleapis.com/chart?chst=d_map_pin_letter&chld=T|4099FF|0000FF'\n } else if (json.type == 'Performance') {\n icon = 'https://chart.googleapis.com/chart?chst=d_map_pin_letter&chld=P|FF4500|0000FF'\n } else if (json.type == 'Release') {\n icon = 'https://chart.googleapis.com/chart?chst=d_map_pin_letter&chld=R|9400D3|0000FF'\n }\n\n var marker = new google.maps.Marker({\n animation: google.maps.Animation.DROP,\n icon: icon,\n position: coordinates,\n map: map,\n title: json.title\n });\n markers.push(marker);\n\n marker.addListener('click', function () {\n infoWindow.open(map, marker);\n });\n }\n }\n });\n}", "function infoBox(){\n\t//\tCreate a new instance of Google Maps infowindows\n\tvar infobox = new google.maps.InfoWindow();\n\t// Adding a click event to the Marker\n\tgoogle.maps.event.addListener(marker, \"click\", function(){\n\t\t//\tsetContent is just like innerHTML. You can write HTML into this document\n\t\tinfobox.setContent(\"<div><strong>\"+marker.title+\"</strong></div><hr>\"+\n\t\t\t\t\t\t\t\"<div>\"+marker.description+\"</div>\"\n\t\t\t);\n\t\t//\tOpening the infoBox\n\t\tinfobox.open(map, marker);\n\t});\n\n}", "function insertMicrosoftMarker(map) {\n // Microsoft Location\n var MicrosoftLocation = new google.maps.LatLng(47.6371, -122.1237);\n var MicrosoftLocationMarker = new google.maps.Marker({\n position: MicrosoftLocation,\n icon: {\n url: \"http://maps.google.com/mapfiles/ms/icons/green-dot.png\"\n }\n });\n\n MicrosoftLocationMarker.setMap(map);\n\n // This block of code is for the small info window\n var contentMicrosoft =\n ' <h1 style=\"text-align: center;\">MICROSOFT CORPORATION</h1>' +\n ' <img src=\"./assets/Images/microsoftInfoImg.jpg\"' +\n ' style=\"float:left; width: 34%; border-radius: 30px 50px 0 50px; float: left; width: 34% !important;\">' +\n ' <p style = \"text-align: center;\"><b>MICROSOFT</b> is an American multinational technology company ' +\n 'with headquarters in Redmond, Washington. The company develops, manufactures, licenses, supports, ' +\n 'and sells computer software <br>' +\n '<a href=\"https://en.wikipedia.org/wiki/Microsoft\"><button type=\"button\" class=\"common-btn-styling\">LEARN MORE!</button></a>' +\n ' </p>';\n\n\n var infoMicrosoft = new google.maps.InfoWindow({\n content: contentMicrosoft\n });\n\n\n\n var MicrosoftLocationInfo = new google.maps.InfoWindow({\n content: \"MICROSOFT\"\n });\n\n google.maps.event.addListener(MicrosoftLocationMarker, 'click', function () {\n MicrosoftLocationInfo,\n infoMicrosoft.open(map, MicrosoftLocationMarker);\n });\n}", "function insertOracleMarker(map) {\n // Oracle Location\n var OracleLocation = new google.maps.LatLng(37.4852, -122.2364);\n var OracleLocationMarker = new google.maps.Marker({\n position: OracleLocation,\n icon: {\n url: \"http://maps.google.com/mapfiles/ms/icons/yellow-dot.png\",\n scaledSize: new google.maps.Size(20, 20)\n }\n });\n\n OracleLocationMarker.setMap(map);\n\n // This block of code is for the small info window\n var contentOracle =\n ' <h1 style=\"text-align: center;\">ORACLE CORPORATION</h1>' +\n ' <img src=\"./assets/Images/oracleInfoImg.jpg\" ' +\n ' style=\"float:left; width: 34%; border-radius: 30px 50px 0 50px; float: left; width: 34% !important;\">' +\n ' <p style = \"text-align: center;\"><b>ORACLE</b> is an American multinational computer technology corporation ' +\n 'headquartered in Redwood Shores, California. The company sells database software and technology, ' +\n 'cloud engineered systems, and enterprise software products.<br>' +\n '<a href=\"https://en.wikipedia.org/wiki/Oracle_Corporation\"><button type=\"button\" class=\"common-btn-styling\">LEARN MORE!</button></a>' +\n ' </p>';\n\n\n var infoOracle = new google.maps.InfoWindow({\n content: contentOracle\n });\n\n\n var OracleLocationInfo = new google.maps.InfoWindow({\n content: \"ORACLE\"\n });\n\n google.maps.event.addListener(OracleLocationMarker, 'click', function () {\n OracleLocationInfo,\n infoOracle.open(map, OracleLocationMarker);\n });\n\n}", "function getInfoWindowContent(location){\r\n\tvar content = '';\r\n\tvar placeType = '';\r\n\tfor (var i=0; i < locationInfo.length; i++) {\r\n\t\tif (locationInfo[i].place === location) {\r\n\t\t\tplaceType = getPlaceType(locationInfo[i].type);\r\n\r\n\t\t\tcontent += '<div class=\"info-window clearfix\">'\r\n\t\t\tcontent += '<h4 class=\"map-title\">' + locationInfo[i].place + '</h4>';\r\n\t\t\tcontent += '<h5 class=\"map-title\">' + placeType + '</h5>';\r\n\t\t\tcontent += '<p>' + locationInfo[i].description + '</p>';\r\n\t\t\tcontent += '<div class=\"info-window-pic-container\">'\r\n\t\t\tcontent += '<img class=\"info-window-pic\" src=\"' + locationInfo[i].image_url + '\" alt=\"' + locationInfo[i].image_alt + '\">'\r\n\t\t\tcontent += '<p class=\"map-image-caption\"> Image courtesy of ' + locationInfo[i].image_attribute + '</>'\r\n\t\t\tcontent += '</div>'\r\n\t\t\tcontent += '</div>'\r\n\t\t}\r\n\t}\r\n\treturn content;\r\n}", "function LoadMap() {\n\n var mapOptions = {\n center: new google.maps.LatLng(infoApartments[0].lat, infoApartments[0].lng),\n zoom: 13,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n }\n var map = new google.maps.Map(document.getElementById(\"dvMap\"), mapOptions)\n\n //Create and open InfoWindow.\n var infoWindow = new google.maps.InfoWindow()\n var myLatlng\n for ( i = 0; i < infoApartments.length; i++) {\n data = infoApartments[i]\n myLatLng = new google.maps.LatLng(data.lat, data.lng)\n marker = new google.maps.Marker({\n position: myLatLng,\n map: map,\n title: data.description\n }); // leave semi-colon here\n //Attach click event to the marker.\n \n /* when function inside (), means it is self-starting function - just runs without being called. \n () after closing }) shows functions' parameters (if any) */\n (function(marker, data) {\n google.maps.event.addListener(marker, \"click\", function(e) {\n //Wrap the content inside an HTML DIV in order to set height and width of InfoWindow.\n infoWindow.setContent(\"<div style = 'width:150px;min-height:35px'>\" + data.description + \"</div>\")\n infoWindow.open(map, marker)\n }) \n }\n )(marker, data) \n \n } // for looop\n}", "function populateInfoWindow(marker, infowindow) {\n if (infowindow.marker != marker) {\n infowindow.marker = marker;\n infowindow.setContent('<div>'+ marker.title +'</div>' +\n '<div>Address: '+ marker.listElement.address +'</div>' +\n '<div> <i class=\"fa fa-foursquare\" aria-hidden=\"true\"></i> Check-Ins: '+ marker.listElement.checkins +'</div>');\n infowindow.open(map, marker);\n infowindow.addListener('closeclick', function() {\n infowindow.marker = null;\n });\n }\n}", "function setInfowindow(infowin, marker, title, address, phone) {\n infowin.marker = marker;\n infowin.setContent (\n '<h3 class=\"title\">' + title + '</h3>' +\n '<div class=\"phone\"><p><i class=\"fa fa-phone\" aria-hidden=\"true\"></i>: ' + phone + '</p></div>' +\n '<div class=\"address\"><p><i class=\"fa fa-map-marker\" aria-hidden=\"true\"></i>: ' + address + '</p></div>'\n );\n infowin.open(map, marker);\n // Make sure the marker property is cleared if the infowindow is closed.\n infowin.addListener('closeclick', function() {\n infowin.marker = null;\n });\n}", "function createMarker(latlng, name, address1){\r\n var marker = new google.maps.Marker({\r\n map: map,\r\n position: latlng,\r\n title: name,\r\n icon : {url:'images/'+name+'.jpg',scaledSize:new google.maps.Size(50,50),}\r\n });\r\n\r\n // This event expects a click on a marker\r\n // When this event is fired the Info Window content is created\r\n // and the Info Window is opened.\r\n google.maps.event.addListener(marker, 'click', function() {\r\n \r\n // Creating the content to be inserted in the infowindow\r\n var iwContent = '<div id=\"iw_container\">' +\r\n '<div class=\"iw_title\">' + name + '</div>' +\r\n '<div class=\"iw_content\">' + address1 + '<br />' +\r\n '</div></div>';\r\n \r\n // including content to the Info Window.\r\n infoWindow.setContent(iwContent);\r\n\r\n // opening the Info Window in the current map and at the current marker location.\r\n infoWindow.open(map, marker);\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 initMap() {\n \"use strict\";\n map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 13,\n center: center,\n mapTypeControl: false\n });\n\n // Create the info window\n largeInfowindow = new google.maps.InfoWindow();\n \n // Make sure the marker property is cleared when infowindow is closed.\n largeInfowindow.addListener(\"closeclick\", function () {\n largeInfowindow.marker = null;\n });\n\n setMarkers();\n showItems();\n}", "function createMarker(event) {\n let filter = $(\"#filterTag\")[0].value;\n let locationString = event.location;\n let latlng = parseLocation(locationString);\n \n // InfoWindow content\n \n var content = '<div class=\"infowindow\">' +\n '<div>' +\n '<h4>' + event.brief + '</h4>' +\n '<p>' + event.detail + '</p >' +\n '<div>Contacts</div>' +\n '<p>' + event.contact + '</p >' +\n '<div>Start_time</div>' +\n '<p>' + event.startTime + '</p >' +\n '<div>End_time</div>' +\n '<p>' + event.endTime + '</p >' +\n '</div>' +\n '</div>';\n \n // A new Info Window is created and set content\n var infowindow = new google.maps.InfoWindow({\n content: content,\n // Assign a maximum value for the width of the infowindow allows\n // greater control over the various content elements\n maxWidth: 350\n });\n\n // marker options\n var marker = new google.maps.Marker({\n position: latlng,\n map: map,\n title: event.brief\n });\n \n // This event expects a click on a marker\n // When this event is fired the Info Window is opened.\n google.maps.event.addListener(marker, 'click', function() {\n infowindow.open(map, marker);\n });\n // Event that closes the Info Window with a click on the map\n google.maps.event.addListener(map, 'click', function() {\n infowindow.close();\n });\n \n gmarkers.push(marker);\n \n nearEvents.append(\"<a href='#myModal' id='\" + event.id + \"' address='\" + event.address + \"' brief='\" + event.brief + \"' detail='\" + event.detail + \"' flag='\" + 0 +\"' contact='\" + event.contact + \"' startTime='\" + event.startTime + \"' endTime='\" + event.endTime + \"' location='\" + event.location + \"' onclick='showOnMap(this)' class=' list-group-item list-group-item-action' data-toggle='modal'>\" + event.brief + \"</a>\")\n tags.push(event.tag);\n if (filter == \"All\" || filter == event.tag) {\n show.push(1);\n marker.setMap(map);\n } else {\n show.push(0);\n marker.setMap(null);\n }\n}" ]
[ "0.75189227", "0.7462796", "0.72227335", "0.7085148", "0.69793844", "0.69731957", "0.69239324", "0.69016284", "0.68652046", "0.68544126", "0.68542325", "0.68365407", "0.68193793", "0.68162847", "0.68126047", "0.68051314", "0.67933226", "0.6792738", "0.6780027", "0.67756647", "0.67595506", "0.6743239", "0.67405933", "0.67322373", "0.6724965", "0.6720277", "0.66825634", "0.6678748", "0.6669809", "0.6663348", "0.66564035", "0.66500556", "0.6638817", "0.662641", "0.6607743", "0.6605208", "0.6601318", "0.6599105", "0.65951055", "0.6590954", "0.6574481", "0.65646774", "0.6562693", "0.6559003", "0.65541375", "0.6553538", "0.655092", "0.65491116", "0.6527748", "0.6525589", "0.6505797", "0.649829", "0.64973074", "0.6491091", "0.64887226", "0.6482995", "0.64795566", "0.64787775", "0.647668", "0.64753485", "0.6475299", "0.64736587", "0.64697456", "0.64689386", "0.646581", "0.6463631", "0.6461542", "0.64516956", "0.64398575", "0.64375573", "0.64340115", "0.6433042", "0.6428848", "0.6421747", "0.6421549", "0.640459", "0.6393886", "0.6393221", "0.6391798", "0.6387556", "0.638611", "0.63859", "0.6383867", "0.63833225", "0.6380752", "0.6380267", "0.6379764", "0.6377206", "0.6377197", "0.6374741", "0.63738596", "0.6373486", "0.63687044", "0.6368033", "0.63675946", "0.63675845", "0.6364285", "0.63634396", "0.6356883", "0.63563854", "0.6354129" ]
0.0
-1
Bias the autocomplete object to the user's geographical location, as supplied by the browser's 'navigator.geolocation' object.
function geolocate() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(function(position) { var geolocation = { lat: position.coords.latitude, lng: position.coords.longitude }; var circle = new google.maps.Circle({ center: geolocation, radius: position.coords.accuracy }); autocomplete.setBounds(circle.getBounds()); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "biasAutocompleteLocation () {\n if (this.enableGeolocation) {\n this.updateGeolocation((geolocation, position) => {\n let circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n this.autocomplete.setBounds(circle.getBounds());\n })\n }\n }", "function geolocate() {\r\n\t// Hard code for Canada\r\n\tvar geolocation = new google.maps.LatLng(62, -110.0);\r\n\tautocomplete.setBounds(new google.maps.LatLngBounds(geolocation,\r\n\t\t\tgeolocation));\r\n}", "geolocate() {\n\t\tif (navigator.geolocation) {\n\t\t\tnavigator.geolocation.getCurrentPosition((position) => {\n\t\t\t\tvar geolocation = {\n\t\t\t\t\tlat: position.coords.latitude,\n\t\t\t\t\tlng: position.coords.longitude\n\t\t\t\t};\n\t\t\t\tvar circle = new google.maps.Circle({\n\t\t\t\t\tcenter: geolocation,\n\t\t\t\t\tradius: position.coords.accuracy\n\t\t\t\t});\n\t\t\t\tthis.autocomplete.setBounds(circle.getBounds());\n\t\t\t});\n\t\t}\n\t}", "function geolocate() {\n /*if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n document.getElementById('latitude').value = geolocation.lat.toFixed(6);\n document.getElementById('longitude').value = geolocation.lng.toFixed(6); \n //console.log(geolocation); \n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocomplete.setBounds(circle.getBounds());\n });\n }*/\n }", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n //use position.coords. to biase towards current browser location\n lat: 51.528, //position.coords.latitude,\n lng: -0.381 //position.coords.longitude\n };\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocomplete.setBounds(circle.getBounds());\n });\n }\n }", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var circle = new google.maps.Circle(\n {center: geolocation, radius: position.coords.accuracy});\n autocomplete.setBounds(circle.getBounds());\n });\n }\n}", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var circle = new google.maps.Circle(\n {center: geolocation, radius: position.coords.accuracy});\n autocomplete.setBounds(circle.getBounds());\n });\n }\n}", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = new google.maps.LatLng(\n position.coords.latitude, position.coords.longitude);\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocomplete.setBounds(circle.getBounds());\n });\n }\n}", "function geolocate() {\r\n if (navigator.geolocation) {\r\n navigator.geolocation.getCurrentPosition(function(position) {\r\n var geolocation = {\r\n lat: position.coords.latitude,\r\n lng: position.coords.longitude\r\n };\r\n var circle = new google.maps.Circle({\r\n center: geolocation,\r\n radius: position.coords.accuracy\r\n });\r\n autocomplete.setBounds(circle.getBounds());\r\n });\r\n }\r\n }", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function (position) {\n var geolocation = new google.maps.LatLng(\n position.coords.latitude, position.coords.longitude);\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocomplete.setBounds(circle.getBounds());\n });\n }\n}", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocomplete.setBounds(circle.getBounds());\n });\n }\n}", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocomplete.setBounds(circle.getBounds());\n });\n }\n}", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocomplete.setBounds(circle.getBounds());\n });\n }\n}", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocomplete.setBounds(circle.getBounds());\n });\n }\n }", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocomplete.setBounds(circle.getBounds());\n });\n }\n }", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n }\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n })\n autocomplete.setBounds(circle.getBounds())\n })\n }\n}", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n\n });\n autocomplete.setBounds(circle.getBounds());\n });\n }\n}", "function geolocate() {\n\tif (navigator.geolocation) {\n\t\tnavigator.geolocation.getCurrentPosition(function(position) {\n\t\t\tvar geolocation = {\n\t \t\tlat: position.coords.latitude,\n\t \t\tlng: position.coords.longitude\n\t \t};\n\t \tvar circle = new google.maps.Circle({\n\t \t\tcenter: geolocation,\n\t \t\tradius: position.coords.accuracy\n\t \t});\n\t \tautocomplete.setBounds(circle.getBounds());\n\t \t});\n\t}\n}", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocomplete.setBounds(circle.getBounds());\n });\n }\n}", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocomplete.setBounds(circle.getBounds());\n });\n }\n}", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocomplete.setBounds(circle.getBounds());\n });\n }\n}", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocomplete.setBounds(circle.getBounds());\n });\n }\n}", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocomplete.setBounds(circle.getBounds());\n });\n }\n}", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocomplete.setBounds(circle.getBounds());\n });\n }\n }", "function geolocate() {\r\n if (navigator.geolocation) {\r\n navigator.geolocation.getCurrentPosition(function (position) {\r\n var geolocation = {\r\n lat: position.coords.latitude,\r\n lng: position.coords.longitude\r\n };\r\n var circle = new google.maps.Circle({\r\n center: geolocation,\r\n radius: position.coords.accuracy\r\n });\r\n autocomplete.setBounds(circle.getBounds());\r\n });\r\n }\r\n}", "function geolocate() {\r\n if (navigator.geolocation) {\r\n navigator.geolocation.getCurrentPosition(function(position) {\r\n var geolocation = {\r\n lat: position.coords.latitude,\r\n lng: position.coords.longitude\r\n };\r\n var circle = new google.maps.Circle({\r\n center: geolocation,\r\n radius: position.coords.accuracy\r\n });\r\n autocomplete.setBounds(circle.getBounds());\r\n });\r\n }\r\n}", "function geolocate() {\r\n if (navigator.geolocation) {\r\n navigator.geolocation.getCurrentPosition(function(position) {\r\n var geolocation = {\r\n lat: position.coords.latitude,\r\n lng: position.coords.longitude\r\n };\r\n var circle = new google.maps.Circle({\r\n center: geolocation,\r\n radius: position.coords.accuracy\r\n });\r\n autocomplete.setBounds(circle.getBounds());\r\n });\r\n }\r\n}", "function geolocate() {\n const google = window.google;\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function (position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude,\n };\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy,\n });\n autocomplete.setBounds(circle.getBounds());\n });\n }\n}", "function geolocate() {\n console.log(\"geolocate\");\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocomplete.setBounds(circle.getBounds());\n });\n }\n }", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocompleteDeparture.setBounds(circle.getBounds());\n autocompleteDestination.setBounds(circle.getBounds());\n });\n }\n }", "function geolocate() {\n console.log('geolocate');\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocomplete.setBounds(circle.getBounds());\n });\n }\n}", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocomplete1.setBounds(circle.getBounds());\n });\n }\n}", "function getLocation() {\n if (navigator.geolocation) {\n locationRaw = navigator.geolocation.getCurrentPosition(getPosition, showError);\n \n } else { \n $('#user-search-location').parent().parent().append('Cound not determine location automatically, please search your country above.')\n locationRaw = $(\"#user-search-location\").val();\n }\n}", "function geolocate() {\n console.log(\"geolocating...\");\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n console.log(position);\n let geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n let circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n autocomplete.setBounds(circle.getBounds());\n });\n } else {\n console.log(\"no\");\n }\n}", "geolocate() {\n const geolocation = {\n // lat: position.coords.latitude,\n // lng: position.coords.longitude,\n lat: -37.881812,\n lng: 145.058236,\n };\n const circle = new google.maps.Circle({\n center: geolocation,\n radius: 250000,\n // radius: 50,\n // language: en,\n });\n this.autocomplete.setBounds(circle.getBounds());\n }", "function geolocate() {\r\n if (navigator.geolocation) {\r\n console.log(navigator.geolocation);\r\n navigator.geolocation.getCurrentPosition(function (position) {\r\n var geolocation = {\r\n lat: position.coords.latitude,\r\n lng: position.coords.longitude\r\n };\r\n var circle = new google.maps.Circle({\r\n center: geolocation,\r\n radius: position.coords.accuracy\r\n });\r\n //console.log(\"circle\");\r\n //console.log(circle);\r\n autocomplete.setBounds(circle.getBounds());\r\n });\r\n }\r\n}", "function useCurrentLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function (position) {\n state.location1 = [position.coords.longitude, position.coords.latitude];\n showLocationsOnMap();\n reverseGeocode(state.location1, function (address) {\n $(\"#fromInput\").val(address);\n //fromFieldInputDetected(document.getElementById(\"fromInput\"));\n });\n }, function (error) {\n if (error.code === error.PERMISSION_DENIED) {\n if (typeof (Storage) !== \"undefined\") {\n localStorage.setItem(\"geolocation.permission.denieddate\", new Date());\n }\n } else {\n console.warn(\"Accessing geolocation failed.\", error);\n }\n });\n if (typeof (Storage) !== \"undefined\") {\n localStorage.removeItem(\"geolocation.permission.denieddate\");\n }\n } else {\n console.warn(\"Geolocation is not supported by this browser.\");\n }\n}", "setGeoLocation() {\n navigator.geolocation.getCurrentPosition(function (pos) {\n _position.lat = pos.coords.latitude;\n _position.long = pos.coords.longitude;\n });\n }", "function doGeolocation()\n\t{\n\t\tif( typeof navigator.geolocation != 'undefined' )\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tnavigator.geolocation.getCurrentPosition(\n\t\t\t\t\tfunction(position)\n\t\t\t\t\t{\n\t\t\t\t\t\t$.mobile.pageLoading();\n\t\t\t\t\t\tvar userLocation = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);\n\t\t\t\t\t\tsetSingleLocation(userLocation);\n\n\t\t\t\t\t\tvar geocoder = new google.maps.Geocoder();\n\t\t\t\t\t\tgeocoder.geocode({latLng: userLocation},\n\t\t\t\t\t\t\tfunction( data, status )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif( google.maps.GeocoderStatus.OK == status && data.length > 0 )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvar firstAddress = data[0];\n\t\t\t\t\t\t\t\t\t$('#fromAddress').val(firstAddress.formatted_address);\n\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\tfunction(error)\n\t\t\t\t\t{\n\t\t\t\t\t\t// @TODO Give a nice message to users that have location disabled\n\t\t\t\t\t\t//alert(error.code + ': ' + error.message);\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t\tcatch(e)\n\t\t\t{\n\t\t\t}\n\t\t}\n\t}", "function autoDetectLocation() {\n if (!navigator.geolocation) return;\n \n navigator.geolocation.getCurrentPosition(function(position) {\n var my_location = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);\n\n requestPlaces(my_location);\n infowindow.close(); // close any open infowindows\n map.panTo(my_location);\n }); \n }", "function initiate_geolocation() { \n navigator.geolocation.getCurrentPosition(handle_geolocation_query); \n}", "function getLocationUser () {\n if (navigator.geolocation) {\n var location_timeout = setTimeout(\"geolocFail()\", 10000);\n \n navigator.geolocation.getCurrentPosition(function(position) {\n clearTimeout(location_timeout);\n \n locationUser.lat = position.coords.latitude;\n locationUser.lng = position.coords.longitude;\n loadNearby()\n // console.log(locationUser)\n }, function(error) {\n clearTimeout(location_timeout);\n console.log('failed to get location')\n });\n } else {\n console.log('failed to get location')\n }\n}", "function geolocate() {\n // console.log(\"i am geolocate\");\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var geolocation = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n var circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords.accuracy\n });\n //console.log(\"radius is :\",circle.radius);\n autocomplete.setBounds(circle.getBounds());\n });\n }\n }", "function setAddress(autocomplete) {\n var place = autocomplete.getPlace();\n if (!place.geometry) {\n window.alert(\"No details available for input: '\" + place.name + \"'\");\n return;\n }\n\n map.setCenter(place.geometry.location);\n map.setZoom(15);\n\n buildRequest(place.geometry.location);\n}", "function geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n // this will override freegeoip settings\n defaultLat = position.coords.latitude;\n defaultLng = position.coords.longitude;\n defaultRad = position.coords.accuracy;\n });\n }\n\n // only ask once\n flag_prompted = true;\n }", "function setMapToCurrentLocation() {\n var location;\n\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(pos) {\n location = {\n lat: pos.coords.latitude,\n lng: pos.coords.longitude\n };\n\n setMapToLocation(location);\n }, handleError);\n } else {\n displayErrorMessage(\"Something went wrong with the Geolocation search.\");\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\n return location;\n}", "function initAutocomplete() {\n\n var initialInput = document.getElementById('pac-input');\n googleMapObject.controls[google.maps.ControlPosition.TOP_RIGHT].push(initialInput);\n watchID = navigator.geolocation.watchPosition(function(position) {\n // Set the center of the map to the user's location.\n var currPosition = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n\n // Create the search box and link it to the UI element.\n var input = document.getElementById('pac-input');\n googleMapObject.setCenter(currPosition)\n var currLat = googleMapObject.getCenter().lat();\n var currLng = googleMapObject.getCenter().lng();\n var initialBounds = new google.maps.LatLngBounds(\n new google.maps.LatLng(currLat - 0.1, currLng),\n new google.maps.LatLng(currLat + 0.1, currLng)\n );\n var searchBox = new google.maps.places.SearchBox(input, {\n bounds: initialBounds\n });\n\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 googleMapObject.addListener('bounds_changed', function() {\n searchBox.setBounds(googleMapObject.getBounds());\n });\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\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 googleMapObject.fitBounds(bounds);\n });\n });\n\n}", "function bookingAutocomplete() {\n // setup autcomplete to input fields and set location search/return values\n var input = document.getElementById('initalCollectionPoint');\n var options = {\n componentRestrictions: {country: \"za\"}\n };\n var autocomplete = new google.maps.places.Autocomplete(input, options);\n autocomplete.setFields(['adr_address', 'geometry']);\n\n}", "function initialLocation() {\n var IPapiKey = \"602f8d85bc584bb4b0b520771a9d3287\";\n var IPapi = \"https://ipgeolocation.abstractapi.com/v1/?api_key=\" + IPapiKey;\n fetch(IPapi)\n .then((r) => r.json())\n .then((d) => {\n // assign user's lat/long to variables place them on the map\n searchLat = d.latitude;\n searchLng = d.longitude;\n initMap()\n });\n}", "setCurrentLocation() {\n if ('geolocation' in navigator) {\n navigator.geolocation.getCurrentPosition((position) => {\n this.latitude = position.coords.latitude;\n this.longitude = position.coords.longitude;\n this.zoom = 8;\n this.getAddress(this.latitude, this.longitude);\n });\n }\n }", "setCurrentLocation() {\n if ('geolocation' in navigator) {\n navigator.geolocation.getCurrentPosition((position) => {\n this.latitude = position.coords.latitude;\n this.longitude = position.coords.longitude;\n this.zoom = 8;\n this.getAddress(this.latitude, this.longitude);\n });\n }\n }", "function initAutocomplete() {\n // Create the autocomplete object, restricting the search to geographical location types.\n autocomplete = new google.maps.places.Autocomplete(\n /** @type {!HTMLInputElement} */\n (searchEl), {\n // options(from google documentation)\n types: ['geocode'],\n componentRestrictions: { country: \"us\" }\n })\n}", "function userLocation() {\n if (navigator.geolocation) {\n //geolocation available\n navigator.geolocation.getCurrentPosition(successfulLookup, console.log);\n }\n}", "geolocate () {\n this.updateGeolocation ((geolocation, position) => {\n this.updateCoordinates(geolocation)\n })\n }", "function geoLocate() { \n if(navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var latlng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);\n\n var currentAddress = null;\n\n geocoder.geocode({'latLng': latlng}, function(results, status) {\n if (status == google.maps.GeocoderStatus.OK) {\n currentAddress = results[0].formatted_address;\n document.getElementById('starting_point').value = currentAddress;\n updateRouteWithStartPoint(latlng);\n }\n }); \n });\n }\n }", "function getLocation() {\n var geolocation = navigator.geolocation;\n geolocation.getCurrentPosition(showLocation);\n }", "function getCurrentLocationLatLong(){\n globalspace.searchClinicsKeyword=\"\";\n $(\"#searchClinicsKeyword\").val('');\n if(deviceAgent == \"PC\"){\n if(navigator.geolocation)\n navigator.geolocation.getCurrentPosition(searchClinicsInCurrentLocation, geoLocationError);\n else{\n //showAlert(\"Geolocation is not supported by this browser.!\");\n }\n } else{\n navigator.geolocation.getCurrentPosition( searchClinicsInCurrentLocation, geoLocationError, { enableHighAccuracy: true } );\n }\n}", "setLocationSuggestions(event){\n if (this.country_mode) return false;\n let display_location_mode = this.input_location_mode_changed ? this.input_location_mode : 1;\n let get_started = this,\n new_location = {\n input_location_mode: display_location_mode,\n input_location: event.target.value\n };\n\n get_started.setState({\n input_location: event.target.value,\n show_location_suggestions: true\n });\n\n if (get_started.$set_location_suggestions){\n clearTimeout(get_started.$set_location_suggestions);\n }\n\n // debounce location suggestions by 500ms.\n get_started.$set_location_suggestions = setTimeout(()=>{\n CalculatorApi.getAutoComplete(new_location)\n .then((locations)=>{\n get_started.setState({\n locations: locations,\n show_location_suggestions: true\n });\n });\n }, 500);\n }", "function getUserLocation() {\n geolocationService.getCurrentPosition()\n .then(function(coords) {\n setUserCoordinates(coords.latitude, coords.longitude);\n geolocationService\n .getAddressName(coords.latitude, coords.longitude)\n .then(function(addressName) {\n $scope.filters.address = addressName;\n $scope.getVenues();\n })\n }, function(){\n $scope.showSpinner = false;\n $scope.noResults = true;\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 initAutocomplete() {\n var input = document.getElementById('location');\n var defaultBounds = new google.maps.LatLngBounds(\n new google.maps.LatLng(20.5937, 78.9629));\n var searchBox = new google.maps.places.SearchBox(input, {bounds: defaultBounds});\n searchBox.addListener('places_changed', function() {\n var places = searchBox.getPlaces();\n if (places.length == 0)\n return;\n var bounds = new google.maps.LatLngBounds();\n places.forEach(function(place) {\n if (!place.geometry) \n return;\n });\n });\n }", "function getLocation(evt) {\n evt.preventDefault();\n $('#search-results').empty();\n $('#search-results').css('display', 'inline');\n $('#map').removeClass('col-md-offset-3');\n\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(submitCoords);\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() {\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 initAutocomplete() {\n var input = document.getElementById('person')\n var options = {\n componentRestrictions: {country: \"sg\"}\n };\n\n var autocomplete = new google.maps.places.Autocomplete(input, options);\n\n google.maps.event.addListener(autocomplete, 'place_changed', function() {\n var place = autocomplete.getPlace();\n var lat = place.geometry.location.lat();\n var lng = place.geometry.location.lng();\n\n document.getElementById(\"lat\").value = lat;\n document.getElementById(\"long\").value = lng;\n });\n}", "function getLocation() {\n\tif (navigator.geolocation) {\n\t\tnavigator.geolocation.getCurrentPosition(postLocation, showError);\n\t}\n}", "function initializeAutocomplete() {\n var input = document.getElementById('community_search_field');\n searchBox = new google.maps.places.Autocomplete(input);\n searchBox.setComponentRestrictions({'country': ['us']});\n searchBox.addListener('place_changed', setLocationValue);\n}", "function fillInAddress() {\n var place = autocomplete.getPlace();\n}", "function onPlaceChanged() {\n var place = autocomplete.getPlace();\n if (place.geometry) {\n map.panTo(place.geometry.location);\n map.setZoom(15);\n search(\"bike share\");\n search(\"food\");\n search(\"coworking space\");\n } else {\n document.getElementById(\"autocomplete\").placeholder = \"Enter a city\";\n }\n}", "function initAutocomplete() {\n autocomplete = new google.maps.places.Autocomplete(\n /** @type {!HTMLInputElement} */\n (document.getElementById(\"location\")), {\n types: [\"geocode\"]\n });\n autocomplete.addListener(\"place_changed\", callbackPlace);\n}", "function initializeAutocomplete() {\n var input = document.getElementById('search_field');\n searchBox = new google.maps.places.Autocomplete(input, {\n types: ['(cities)'],\n componentRestrictions: {country: 'us'}\n });\n // searchBox.setComponentRestrictions({'country': ['us']});\n searchBox.addListener('place_changed', setLocationValue);\n}", "setAutocompleteToAirport() {\n if (this.autocomplete) {\n this.setAirport(this.autocomplete.name, this.autocomplete.iataCode);\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 getLocation() {\n var x = document.getElementById(\"SearchString\");\n if (navigator.geolocation) {\n navigator.geolocation.watchPosition(showPosition);\n } else {\n x.value = \"Geolocation is not supported by this browser.\";\n }\n}", "function autocomplete() {\n\n // Autocomplete for search location\n let autocompleteSearch = $(\"#search-location\")[0];\n var autocompletedSearch = new google.maps.places.Autocomplete(autocompleteSearch);\n\n}", "function autosuggest() {\n /** Variables for Autocomplete */\n var input = document.getElementById('searchTextField');\n var options = {componentRestrictions: {country: 'US'}};\n var autocomplete = new google.maps.places.Autocomplete(input, options);\n\n /** Creates listener for when place changes */\n google.maps.event.addListener(autocomplete, 'place_changed', function (){\n /** Initialize variable to store formatted input address */\n address = autocomplete.getPlace().formatted_address;\n /** Convert given address to geocode */\n geocoder.geocode({address: address}, function(results, status){\n if (status == google.maps.GeocoderStatus.OK){\n /** Get first result */\n var locData = results[0].geometry.location;\n /** Set new geocode based off of location input */\n var lat = String(locData.lat());\n var lng = String(locData.lng());\n /** Set new location */\n loc = new google.maps.LatLng(lat, lng);\n /** Perform new search with given location */\n initialize(loc);\n /** Pins the given location with a blue marker */\n pin(loc);\n }\n });\n });\n}", "function Geolocate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(GetPosition);\n } else {\n CreateLocationForm();\n }\n}", "function initAutocomplete() {\n\n const input = document.getElementById(\"pac-input\");\n let autocomplete = new google.maps.places.Autocomplete(input);\n\n autocomplete.setComponentRestrictions({\n country: [\"in\"],\n });\n\n autocomplete.addListener(\"place_changed\", () => {\n\n const place = autocomplete.getPlace();\n\n document.getElementById('lat-input').value = place.geometry.location.lat();\n document.getElementById('lng-input').value = place.geometry.location.lng();\n });\n}", "setLocation(forcedLng, forcedLat) {\n const { updateMapCoordinates, disabled } = this.props;\n let options =\n !!forcedLng && !!forcedLat\n ? {\n setCurrentPosition: false,\n lat: forcedLat,\n lng: forcedLng\n }\n : {};\n let lp = new LocationPicker(`map${this.timestamp}`, options, {\n zoom: 15 // You can set any google map options here, zoom defaults to 15\n });\n if (!disabled) {\n // Listen to when user finished interacting with map and send new coordinates to form\n if (!!this.listener) {\n window.google.maps.event.removeListener(this.listener);\n }\n this.listener = window.google.maps.event.addListener(\n lp.map,\n 'idle',\n function(event) {\n let location = lp.getMarkerPosition();\n updateMapCoordinates(location.lng, location.lat);\n }\n );\n }\n }", "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}", "function findLocation(location) {\r\n document.getElementById(\"originCity\").value = location;\r\n document.getElementById(\"originCity\").focus();\r\n}", "function autocomplete() {\n element = document.getElementById('autocomplete-position');\n var top = $('#autocomplete-position').offset().top - $('#position-fixer').offset().top;\n var rect = element.getBoundingClientRect();\n var width = element.offsetWidth;\n $('.autocomplete-suggestions').css('top', top).css('left', rect.left).css('width', width).css('display', 'block');\n}", "function getUserLocationforDrinkups() {\n if (navigator.geolocation) {\n var options={timeout:30000};\n navigator.geolocation.getCurrentPosition(initializeMarkers,unableToGetLocation,options);\n } \n}", "function setAutocompleteCountry() {\n const country = document.getElementById(\"country\").value;\n if (country == \"all\") {\n autocomplete.setComponentRestrictions({\n country: [],\n });\n map.setCenter({\n lat: 15,\n lng: 0,\n });\n map.setZoom(3);\n } else {\n autocomplete.setComponentRestrictions({\n country: country,\n });\n map.setCenter(countries[country].center);\n map.setZoom(countries[country].zoom);\n }\n clearResults();\n clearMarkers();\n}", "function getUserLocation() {\n\tif (navigator.geolocation) {\n\t\tnavigator.geolocation.getCurrentPosition(showUserPosition);\n\t} \n}", "getBrowserLocation() {\n if (!navigator.geolocation) {\n console.log('<p>Geolokation wird von ihrem Browser nicht unterstützt</p>')\n return\n }\n const { searchParams } = this.state\n const success = (position) => {\n const { latitude } = position.coords\n const { longitude } = position.coords\n searchParams.latitude = latitude\n searchParams.longitude = longitude\n this.updateSearchParams(searchParams)\n }\n const error = () => {\n console.log('Es war nicht möglich Sie zu lokalisieren')\n searchParams.latitude = 51.9624047\n searchParams.longitude = 7.6255008\n this.hasGeoSelector = true\n this.updateSearchParams(searchParams)\n }\n navigator.geolocation.getCurrentPosition(success, error)\n }", "function setAutocompleteCountry() {\n var country = document.getElementById(\"country\").value\n if (country == \"all\") {\n autocomplete.setComponentRestrictions({ country: [] })\n map.setCenter({ lat: 15, lng: 0 })\n map.setZoom(2)\n } else {\n autocomplete.setComponentRestrictions({ country: country })\n map.setCenter(countries[country].center)\n map.setZoom(countries[country].zoom)\n }\n clearResults()\n clearMarkers()\n}", "function getLocation() {\n     if (navigator.geolocation) {\n // showPosition is a reference to a JS function below\n         navigator.geolocation.getCurrentPosition(showPosition);\n     }\n }", "setCurrentLocation() {\n if ('geolocation' in navigator) {\n navigator.geolocation.getCurrentPosition((position) => {\n this.latitude = position.coords.latitude;\n this.longitude = position.coords.longitude;\n this.zoom = 15;\n });\n }\n }", "setCurrentLocation() {\n if ('geolocation' in navigator) {\n navigator.geolocation.getCurrentPosition((position) => {\n this.latitude = position.coords.latitude;\n this.longitude = position.coords.longitude;\n this.zoom = 15;\n });\n }\n }", "setCurrentLocation() {\n if ('geolocation' in navigator) {\n navigator.geolocation.getCurrentPosition((position) => {\n this.latitude = position.coords.latitude;\n this.longitude = position.coords.longitude;\n this.zoom = 15;\n });\n }\n }", "setCurrentLocation() {\n if ('geolocation' in navigator) {\n navigator.geolocation.getCurrentPosition((position) => {\n this.latitude = position.coords.latitude;\n this.longitude = position.coords.longitude;\n this.zoom = 15;\n });\n }\n }", "function initGeolocation() {\n var myOptions = {\n zoom: 6,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n };\n var coordLocation;\n var defaultLocation = new google.maps.LatLng(17.385044, 78.486671); //Hyderabad\n var map = new google.maps.Map(document.getElementById(\"map_canvas\"), myOptions);\n // Try W3C Geolocation (Preferred)\n \n if(navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n coordLocation = new google.maps.LatLng(position.coords.latitude,position.coords.longitude);\n map.setCenter(coordLocation);\n setAppCity(coordLocation);\n\n });\n }\n else {\n map.setCenter(defaultLocation);\n setAppCity(defaultLocation);\n }\n}", "function initAutocomplete() {\n\n // Create the autocomplete object, restricting the search predictions to\n // geographical location types.\n autocomplete = new google.maps.places.Autocomplete(\n document.getElementById('autocomplete'), {types: ['geocode'], componentRestrictions: {country: 'au'}});\n \n // Avoid paying for data that you don't need by restricting the set of\n // place fields that are returned to just the address components.\n autocomplete.setFields(['formatted_address']);\n \n // When the user selects an address from the drop-down, populate the\n // address fields in the form.\n autocomplete.addListener('place_changed', fillInAddress);\n }", "componentDidMount() {\n Geolocation.getCurrentPosition(\n position => {\n console.log(position);\n this.setState({\n userLocation: {\n latitude: position.coords.latitude,\n longitude: position.coords.longitude,\n latitudeDelta: 0.0922,\n longitudeDelta: 0.0421,\n },\n });\n console.log(\n 'userlocation latitude --> ' + this.state.userLocation.latitude,\n );\n console.log(\n 'userlocation longitude --> ' + this.state.userLocation.longitude,\n );\n },\n error => {\n // See error code charts below.\n console.log(error.code, error.message);\n },\n {enableHighAccuracy: false, timeout: 20000}, //this worked for me\n );\n }", "_getLocation() {\n navigator.geolocation.getCurrentPosition(\n (position) => {\n var crd = position.coords;\n this.setState({\n location: {lat: crd.latitude, long: crd.longitude, city: null},\n located: true\n });\n console.log(crd);\n },\n (error) => alert(error.message),\n {enableHighAccuracy: true, timeout: 10000, maximumAge: 0}\n );\n }", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(getPosition, showError);\n } else {\n console.log('Geolocation is not supported by this browser.');\n userCountry = 'Spain';\n showTopForCountry(userCountry);\n }\n}", "function UserLocation(position) {\r\n NearestCity(position.coords.latitude, position.coords.longitude);\r\n}" ]
[ "0.75768244", "0.71500534", "0.7034972", "0.6981597", "0.6909035", "0.6877536", "0.6877536", "0.68604773", "0.6839155", "0.68207216", "0.67982835", "0.67982835", "0.67982835", "0.67975265", "0.67975265", "0.67974573", "0.6784004", "0.67660946", "0.67501795", "0.67501795", "0.67501795", "0.67501795", "0.67501795", "0.6747039", "0.6743263", "0.6721811", "0.6711349", "0.6672679", "0.6668482", "0.666684", "0.66393393", "0.66085196", "0.6541792", "0.646432", "0.64430916", "0.6421273", "0.6400278", "0.63954484", "0.6309813", "0.62196255", "0.6204269", "0.61707735", "0.6159378", "0.6129445", "0.60784805", "0.602658", "0.60248166", "0.602361", "0.6021362", "0.5993748", "0.5993748", "0.59833384", "0.5982613", "0.5945361", "0.5920848", "0.5909223", "0.59051895", "0.5884601", "0.5860746", "0.58445024", "0.58445024", "0.58409476", "0.5828571", "0.58271855", "0.58257794", "0.58257794", "0.58202285", "0.5817988", "0.58154863", "0.5815452", "0.5807203", "0.5807052", "0.5794864", "0.57917744", "0.5789691", "0.57862103", "0.57744527", "0.5774321", "0.57738715", "0.5771118", "0.57691973", "0.57670456", "0.5756579", "0.57517505", "0.5747684", "0.5746138", "0.5745569", "0.574313", "0.57415164", "0.57335824", "0.5729816", "0.5729816", "0.5729816", "0.5729816", "0.5721216", "0.5718424", "0.57182425", "0.57123584", "0.5711102", "0.57057476" ]
0.6729638
25
DISPLAY HAIKU ON WEBSITE
generate() { this.post = document.createElement("div"); this.post.setAttribute("id", "haiku"+this.id); this.post.setAttribute("class", "posts " + this.gridClass); let postElements = []; let post_header = document.createElement("div"); post_header.setAttribute("class", "post-header"); post_header.setAttribute("style", "background-image: url('../uploads/background/" + this.background + "');"); let posts_haiku = document.createElement("div"); posts_haiku.setAttribute("class", "posts-haiku"); let post_haiku = document.createElement("div"); post_haiku.setAttribute("class", "post-haiku"); post_haiku.innerHTML = this.content; posts_haiku.appendChild(post_haiku); post_header.appendChild(posts_haiku); postElements.push(post_header); if(this.contentNative != "NO") { let lang_switch = document.createElement("div"); lang_switch.setAttribute("class", "lang-switch"); let lang_switcher = document.createElement("label"); lang_switcher.setAttribute("class", "lang-switcher"); let lang_input = document.createElement("input"); lang_input.setAttribute("type", "checkbox"); lang_input.setAttribute("class", "language-value"); let lang_slider = document.createElement("span"); lang_slider.setAttribute("class", "lang-slider"); lang_switcher.appendChild(lang_input); lang_switcher.appendChild(lang_slider); lang_switch.appendChild(lang_switcher); postElements.push(lang_switch); } let post_nav = document.createElement("div"); post_nav.setAttribute("class", "post-nav"); var post_nav_dot = document.createElement("div"); post_nav_dot.setAttribute("class", "post-nav-dot"); post_nav.appendChild(post_nav_dot); let post_nav_handwriting = document.createElement("div"); post_nav_handwriting.setAttribute("class", "post-nav-handwriting"); post_nav_handwriting.setAttribute("id", "post-nav-handwriting"); post_nav_handwriting.setAttribute("style", "background-image: url(../uploads/handwriting/"+ this.handwriting +")"); let post_nav_handwriting_close = document.createElement("div"); post_nav_handwriting_close.setAttribute("class", "post-nav-handwriting-close"); post_nav_handwriting_close.setAttribute("id", "post-nav-handwriting-close"); post_nav_handwriting.appendChild(post_nav_handwriting_close); post_nav.appendChild(post_nav_handwriting); var post_nav_sub = document.createElement("div"); post_nav_sub.setAttribute("class", "post-nav-sub"); let options = ["Handwriting", "Report"]; if(this.loggedIn == true) options = ["Handwriting", "Edit", "Delete"]; options.forEach(option => { let post_nav_sub_option = document.createElement("div"); post_nav_sub_option.setAttribute("class", "post-nav-sub-option"); post_nav_sub_option.textContent = option; post_nav_sub.appendChild(post_nav_sub_option); }); post_nav.appendChild(post_nav_sub); postElements.push(post_nav); let post_footer = document.createElement('div'); post_footer.setAttribute("class", "post-footer"); let post_author = document.createElement('div'); post_author.setAttribute("class", "post-author"); post_author.textContent = this.authorName; post_footer.appendChild(post_author); let post_country = document.createElement('div'); post_country.setAttribute("class", "post-country"); post_country.textContent = this.authorCountry; post_footer.appendChild(post_country); let post_like = document.createElement('div'); post_like.setAttribute("class", "post-like"); if(this.likeStatus == true) post_like.style.backgroundImage = "url('img/icons/heart_full_normal.svg')"; let post_like_counter = document.createElement('span'); post_like_counter.textContent = this.likes; post_like.appendChild(post_like_counter); post_footer.appendChild(post_like); postElements.push(post_footer); postElements.forEach(element => { this.post.appendChild(element); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createHaiku () {\n outputHaiku();\n }", "function outputHaiku () {\n var start = '<p>&gt;&gt; ';\n var end = '</p><hr/>';\n\n // Turn off button function while working:\n unbindEventHandlers();\n\n // Append a new poem to the output window, calling the haiku API method:\n $('#output').append(start + _haiku.generateHaiku() + end);\n\n // Measure the new window height, and scroll to the bottom to show the newest:\n var height = $('#output')[0].scrollHeight;\n $('#outputScroll').scrollTop(height);\n\n // Add a little timeout to prevent button spamming:\n setTimeout(function () {\n bindEventHandlers();\n }, 300);\n }", "function generateHaiku() {\n // Make a DIV with the new sentence\n var expansion = cfree.getExpansion('<start>');\n expansion = expansion.replace(/%/g, '<br/>');\n var par = createP(expansion);\n par.class('text');\n}", "function hc(app) {\n app.get(\"/public/hc\", (req, res) => {\n res.end(\"OK\");\n });\n}", "function getHaploview()\n{\n\tExt.Ajax.request({\t\t\t\t\t\t\n\t\turl: pageInfo.basePath+\"/asyncJob/createnewjob\",\n\t\tmethod: 'POST',\n\t\tsuccess: function(result, request)\n\t\t{\n\t\t\tRunHaploViewer(result, GLOBAL.DefaultCohortInfo.SampleIdList, GLOBAL.CurrentGenes);\n\t\t},\n\t\tfailure: function(result, request)\n\t\t{\n\t\t\tExt.Msg.alert('状态', '无法创建heatmap工作.');//<SIAT_zh_CN original=\"Status\">状态</SIAT_zh_CN><SIAT_zh_CN original=\"Unable to create the heatmap job\">无法创建heatmap工作</SIAT_zh_CN>\n\t\t},\n\t\ttimeout: '1800000',\n\t\tparams: {jobType: \"Haplo\"}\n\t});\t\n}", "function displayHelp(http) {\r\n\t\tvar helpPanel = document.getElementById('help_container');\r\n\t\thelpPanel.innerHTML = http.responseText;\r\n\t}", "function showUsage(req, res) {\n\tvar egPayload = {\n\t\t\"username\": \"soandso\",\n\t\t\"message\": \"Hello bot\",\n\t\t\"vars\": {\n\t\t\t\"name\": \"Soandso\"\n\t\t}\n\t};\n\tres.writeHead(200, {\"Content-Type\": \"text/plain\"});\n\tres.write(\"Usage: curl -i \\\\\\n\");\n\tres.write(\" -H \\\"Content-Type: application/json\\\" \\\\\\n\");\n\tres.write(\" -X POST -d '\" + JSON.stringify(egPayload) + \"' \\\\\\n\");\n\tres.write(\" http://localhost:2001/reply\");\n\tres.end();\n}", "function show() {\n\t\tinit(username, socketId);\n\t}", "function showHome(request){\n\trequest.respond(\"This is the home page.\");\n}", "async function showHelloJulioServlet() {\n const responseFromServer = await fetch('/hello');\n const textFromResponse = await responseFromServer.text();\n\n const helloJulioContainer = document.getElementById('helloJulio-container');\n helloJulioContainer.innerText = textFromResponse;\n}", "function index (request, response) {\n var contextData = {\n 'pageTitle': 'Kognas in CH',\n };\n response.render('index.html', contextData);\n}", "function help() {\n return new Promise((resolve, reject) => {\n var response;\n multichain.help({\n\n },\n (err, res) => {\n console.log(res)\n if (err == null) {\n return resolve({\n response: res,\n message: \"help at your desk...!\"\n });\n } else {\n console.log(err)\n return reject({\n status: 500,\n message: 'Internal Server Error !'\n });\n }\n }\n )\n })\n}", "function logHelp() {\r\n console.log([\r\n ' ', ' Houston :: A cool static files server', ' ', ' Available options:', '\\t --port, -p \\t Listening port to Houston, default to 8000 ', '\\t --path, -d \\t Dir of starting point to Houston, default to actual dir', '\\t --browser,-b \\t open browser window, (true,false) default to true', '\\t --help, -h \\t show this info', '\\t --version,-v \\t Show the current version of Houston', ' ', ' :: end of help ::'\r\n ].join('\\n'));\r\n process.kill(0);\r\n }", "function displayHud() {\n // 2D screen-aligned rendering section\n easycam.beginHUD()\n // this._renderer._enableLighting = false // fix for issue #1\n let state = easycam.getState()\n\n // Render the background box for the HUD\n noStroke()\n fill(0)\n rect(x, y, 20, 100)\n fill(50, 50, 52, 200) // a bit of transparency\n rect(x + 20, y, 380, 100)\n\n // Render the labels\n fill(69, 161, 255)\n text(\"Distance:\", x + 35, y + 25)\n text(\"Center: \", x + 35, y + 25 + 20)\n text(\"Rotation:\", x + 35, y + 25 + 40)\n text(\"Framerate:\", x + 35, y + 25 + 60)\n\n // Render the state numbers\n fill(69, 161, 255)\n text(nfs(state.distance, 1, 2), x + 125, y + 25)\n text(nfs(state.center, 1, 2), x + 125, y + 25 + 20)\n text(nfs(state.rotation, 1, 3), x + 125, y + 25 + 40)\n text(nfs(frameRate(), 1, 2), x + 125, y + 25 + 60)\n easycam.endHUD()\n}", "function show()\n{\n // Restart any timers that were stopped on hide\n\t\n\tvar url = widget.preferenceForKey(instancePreferenceKey('url'));\n var username = widget.preferenceForKey(instancePreferenceKey('username'));\n\n\tvar u = splitURL(url);\n\tvar password;\n\tif (u) {\n\t\tpassword = KeychainPlugIn.getPassword(username, u.serverName, u.serverPath);\n\t}\n}", "function help() {\n res.send(\n {\n \"response_type\": \"ephemeral\",\n \"text\": \"Type `/support` for status accross all filters. Add a case link `https://help.disqus.com/agent/case/347519` or an email `[email protected]` to get specific.\",\n }\n )\n }", "function home(){\n\tapp.getView().render('vipinsider/insider_home.isml');\n}", "async index({ request, response, view }) {\n \t\tconst kajians = await Kajian.all()\n\n \t\treturn view.render('kajian.index', { kajians: kajians.rows })\n\t}", "function homepage(res, req) {\n\tlog.trace('homepage: begin');\n\n\tvar body = '<html>'\n\t + '<head>'\n\t + '<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />'\n\t + '<title>OpenKarotz Emulator</title>'\n\t + '</head>'\n\t + '<body>'\n\t + '<h1>OpenKarotz Emulator</h1>'\n\t + '<h2>Status</h2>'\n\t + '<ul>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/status\">status</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/get_version\">get_version</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/get_free_space\">get_free_space</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/sleep\">sleep</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/wakeup?silent=0\">wakeup</a>, <a target=\"results\" href=\"/cgi-bin/wakeup?silent=1\">wakeup(silent)</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/reboot\">reboot</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/reset_install_flag\">reset_install_flag</a></li>'\n\t + '</ul>'\n\t + '<h2>Leds</h2>'\n\t + '<ul>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/leds\">leds</a></li>'\n\t + '</ul>'\n\t + '<h2>Ears</h2>'\n\t + '<ul>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/ears\">ears</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/ears_reset\">ears_reset</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/ears_random\">ears_random</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/ears_mode?disable=0\">ears_mode(enabled)</a>, <a target=\"results\" href=\"/cgi-bin/ears_mode?disable=1\">ears_mode(disabled)</a></li>'\n\t + '</ul>'\n\t + '<h2>Sound</h2>'\n\t + '<ul>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/sound_list\">sound_list</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/radios_list\">radios_list</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/sound?id=bip\">sound(id)</a>, <a target=\"results\" href=\"/cgi-bin/sound?url=http://play/sound\">sound(url)</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/sound_control?cmd=quit\">sound_control(quit)</a>, <a target=\"results\" href=\"/cgi-bin/sound_control?cmd=pause\">sound_control(pause)</a></li>'\n\t + '</ul>'\n\t + '<h2>Speech</h2>'\n\t + '<ul>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/voice_list\">voice_list</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/tts?text=Hello%20World\">tts</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/display_cache\">display_cache</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/clear_cache\">clear_cache</a></li>'\n\t + '</ul>'\n\t + '<h2>Photos</h2>'\n\t + '<ul>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/snapshot\">snapshot</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/snapshot_ftp\">snapshot_ftp</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/snapshot_list\">snapshot_list</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/snapshot_get\">snapshot_get</a>, <a target=\"results\" href=\"/cgi-bin/snapshot_get?filename=snapshot.thumb.gif\">snapshot_get(thumbnail)</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/clear_snapshots\">clear_snapshots</a></li>'\n\t + '</ul>'\n\t + '<h2>RFID</h2>'\n\t + '<ul>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/rfid_list\">rfid_list</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/rfid_list_ext\">rfid_list_ext</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/rfid_start_record\">rfid_start_record</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/rfid_stop_record\">rfid_stop_record</a></li>'\n\t + '</ul>'\n\t + '<h2>Misc.</h2>'\n\t + '<ul>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/moods_list\">moods_list</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/stories_list\">stories_list</a></li>'\n\t + '</ul>'\n\t + '<h2>Apps</h2>'\n\t + '<ul>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/apps/clock\">clock</a>, <a target=\"results\" href=\"/cgi-bin/apps/clock?hour=12\">clock(12)</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/apps/moods\">moods</a>, <a target=\"results\" href=\"/cgi-bin/apps/moods?id=50\">moods(50)</a></li>'\n\t + '</ul>'\n\t + '<hr/>'\n\t + '<p><small>'\n\t + '<a href=\"https://github.com/hobbe\">Copyright &copy 2013</a> - '\n\t + '<a href=\"https://github.com/hobbe/openkarotz-emulator\">OpenKarotz Emulator</a> - '\n\t + '<a href=\"https://github.com/hobbe/openkarotz-emulator/raw/master/LICENSE\">MIT License</a>'\n\t + '</small></p>'\n\t + '</body>'\n\t + '</html>';\n\n\tres.writeHead(200, {\n\t 'Server': 'OpenKarotz Emulator WebServer 1.0',\n\t 'Connection': 'close',\n\t 'Accept-Ranges': 'bytes',\n\t 'Content-Type' : 'text/html',\n\t 'Access-Control-Allow-Origin': '*'\n\t});\n\tres.write(body);\n\tres.end();\n\tlog.trace('homepage: end');\n}", "spaceDashboard (baseUrl,username,spacename){\n browser.get(baseUrl + username + \"/\" + spacename);\n }", "function renderHhwDeployed(req,res){\n if(req.valid==0)\n res.render('admin/views/household_maintenance/deployed',\n {\n usertab: req.user, \n itemtab: req.displayDeployedHhworker, \n HWreqtab: req.houseHoldReq\n });\n else if(req.valid==1)\n res.render('admin/views/invalidpages/normalonly');\n else\n res.render('login/views/invalid');\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}", "function discoverHikes(req, res, next) {\n \tconsole.log(req.user);\n\tres.render('main', req.user);\n}", "function displayHelpText() {\n console.log();\n console.log(' Usage: astrum figma [command]');\n console.log();\n console.log(' Commands:');\n console.log(' info\\tdisplays current Figma settings');\n console.log(' edit\\tedits Figma settings');\n console.log();\n}", "function showHome(request){\n request.serveFile(\"index.html\"); \n}", "handler_HELO(command, callback) {\n let parts = command.toString().trim().split(/\\s+/);\n let hostname = parts[1] || '';\n\n if (parts.length !== 2) {\n this.send(501, 'Error: Syntax: HELO hostname');\n return callback();\n }\n\n this.hostNameAppearsAs = hostname.toLowerCase();\n\n this._resetSession(); // HELO is effectively the same as RSET\n this.send(250, this.name + ' Nice to meet you, ' + this.clientHostname);\n\n callback();\n }", "function user(request, response) {\n //if url == \"/....\"\n var username = request.url.replace(\"/\", \"\");\n if(username.length > 0) {\n response.writeHead(200, {'Content-Type': 'text/plain'}); // response.writeHead(statusCode[, statusMessage][, headers])\n response.write(\"Header\\n\"); // Node.js API: response.write\n response.write(\"User Name: \" + username + \"\\n\");\n response.end('Footer\\n');\n \n \n //get json from Treehouse\n //on \"end\"\n //show profile\n //on \"error\"\n //show error\n }\n}", "function getHostnames() {\n api.send({\n \"Method\": \"SendHostname\"\n });\n}", "function findHaiku(data, query, cb) {\n\n var tweets = JSON.parse(data).statuses\n var numTweets = tweets.length\n var foundHaiku = false\n var i = 0\n\n // for (var i = 0; i <= count - 1; i++) {\n while (foundHaiku == false) {\n\n if (i >= numTweets) {\n console.log('--possible re-poll oportunity--')\n cb({ \"line1\": \"Could not find haiku...\", \"line2\": \"\", \"line3\": \"\" })\n break\n }\n\n str = tweets[i].text\n haiku(str, function (err, data) {\n if (err) {\n console.error('Error! '.red, err)\n i++\n }\n else {\n console.log('Found haiku GOOD'.green)\n data.url = \"http://twitter.com/\" + tweets[i].user.screen_name + \"/status/\" + tweets[i].id_str\n console.log(data)\n data['q'] = query\n cb(data)\n foundHaiku = true\n }\n })\n }\n}", "function displayIndex(url, req, res) {\n fs.readFile(__dirname + '/index.html', function (err, data) {\n res.writeHead(200, {\n 'Content-Type': 'text/html'\n })\n res.end(data)\n })\n\n}", "function help() {\r\n common.displayHelp('tsu-amqp');\r\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 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 openAHOFbar(){\n servePage('AHOF', 'pages/LargeBlocksTemplate', 'A History of Forests');\n}", "function HRdisplayEnvironment() {\r\n var environmentKey = '';\r\n var environmentName = '';\r\n\r\n /*if (document.domain.indexOf(\"dv.ep\") >= 0 ||\r\n document.domain.indexOf(\"localhost\") >= 0 ||\r\n window.location.protocol == \"file:\") {\r\n environmentKey = 'dv';\r\n environmentName = 'd<br />e<br />v';\r\n } else */\r\n\r\n if (document.domain.indexOf(\"pp.ep\") >= 0 ||\r\n document.domain.indexOf(\"eicixzq\") >= 0) {\r\n environmentKey = 'pp';\r\n environmentName = 'p<br />r<br />e<br />p<br />r<br />o<br />d';\r\n } else if (document.domain.indexOf(\"eicixzi\") >= 0) {\r\n environmentKey = 'test';\r\n environmentName = 't<br />e<br />s<br />t';\r\n } else if(document.domain.indexOf(\"eicixzp\") == -1) {\r\n environmentKey = 'dv';\r\n environmentName = 'd<br />e<br />v';\r\n }\r\n\r\n if (environmentKey) {\r\n $('<div>')\r\n .prependTo('body')\r\n .addClass('environment-display')\r\n .addClass('environment-' + environmentKey)\r\n .append(\r\n $('<div>')\r\n .addClass('environment-name')\r\n .html(environmentName)\r\n );\r\n }\r\n}", "updateUILogout() {\n $('.anon').show()\n $('.auth').hide()\n\n $('.my-games').hide().attr('href', '#users/[username]/games')\n }", "function showHelpMessage(hm) {\n $('#helpMessage').html(hm).showv();\n}", "function showHelp() {\r\n console.log(\"\\nUsage: \");\r\n console.log(\"\\t phantomjs \" + args[0] + \" <user_number> <user_password>\");\r\n}", "function displayLogin(req, res) {\n\tres.sendFile(path.join(__dirname, './public/index.html'));\n}", "function display_root(url, req, res){\r\n\t\tvar myHTML = '<html>';\r\n\t\tmyHTML += '<body><h1>Home Page</h1>';\r\n\t\tmyHTML += \"<a href='/portfolio'>Portfolio</a>\";\r\n\t\tmyHTML += '</body></html>';\r\n\t\tres.writeHead(200, {'Content-Type': 'text/html'});\r\n\r\n\t\tres.end(myHTML);\r\n\t}", "function showHud(id) {\n // check if the hud exist\n if (!HDEF[id] || HDEF[id].active === false ) {\n console.log(`LSH hud ${id} is not defined or it is inactive`);\n return;\n }\n if (!HUD[id]) {\n createHud(id)\n return;\n }\n if ( HDEF[id].hud_type === \"normal\" || HDEF[id].hud_type === \"freestyle\" ) {\n if ( HUD[id].win ) { HUD[id].win.show() }\n }\n\n}", "function checkEtcHost() {\r\n page.onResourceRequested = function(requestData, networkRequest) {\r\n var pattern = /https?:\\/\\/(.+)\\.ey\\.sandcats\\.io/;\r\n var match = pattern.exec(requestData.url);\r\n if (match !== null && match[1]) {\r\n if (config(WILDCARD_DOMAIN_PREFIX + match[1]) === undefined) {\r\n if (fs.isFile('/etc/hosts')) {\r\n var hosts = fs.open('/etc/hosts', 'r');\r\n var current = hosts.read();\r\n hosts.close();\r\n if (current.indexOf(match[1] + \".ey.sandcats.io\") < 0) {\r\n // append\r\n var ahosts = fs.open('/etc/hosts', 'a');\r\n if (current[current.length - 1] != '\\n') {\r\n ahosts.write('\\n');\r\n }\r\n ahosts.write('10.20.124.1\\t' + match[1] + '.ey.sandcats.io' + '\\n');\r\n ahosts.close();\r\n }\r\n config(WILDCARD_DOMAIN_PREFIX + match[1], true);\r\n }\r\n }\r\n }\r\n };\r\n}", "function super_boss_tongji_setUserInfos(infoArray) {\r\n\tvar flag = \"browserType=\" + getBrowser(\"v\") + \"&browser=\" + getBrowser(\"n\")\r\n\t\t\t+ \"&taobaoNick=\" + infoArray[0] + \"&top_parameters=\"\r\n\t\t\t+ getQueryString(\"top_parameters\") + \"&resolution=\"\r\n\t\t\t+ getBrowserResolution() + \"&typeId=\" + infoArray[1] + \"&source=\"\r\n\t\t\t+ encodeURIComponent(document.referrer);\r\n\tdocument.write(\"<img src='\" + super_boss_tongji_domain\r\n\t\t\t+ \"/getClientInfo.jsp?\" + flag + \"' style='display:none;' /> \");\r\n}", "function displayHelpPage() {\n // Set display to \"no category selected\".\n pageCollection.setCategory('noCat');\n // Display the default page.\n pageCollection.setPage('helpPage');\n}", "function HomeHandler (request, reply) {\n reply.view('views/home.html');\n}", "static GetVKInfo() {\n connect.send(\"VKWebAppGetUserInfo\", {});\n }", "function HomeKitPlatform(log, config, api) {\n log(\"HomeKitPlatform Init\");\n var platform = this;\n this.log = log;\n this.config = config;\n this.accessories = [];\n \n // Save the API object as plugin needs to register new accessory via this object.\n this.api = api;\n \n //Create a way to track items in the browser\n this.mdnsAccessories=[];\n\n //Create a way to track accessories provided from homebridge\n this.priorAccessories=[];\n\n // Listen to event \"didFinishLaunching\", this means homebridge already finished loading cached accessories\n // Platform Plugin should only register new accessory that doesn't exist in homebridge after this event.\n // Or start discover new accessories\n this.api.on('didFinishLaunching', function() {\n var browser = mdns.createBrowser('_hap._tcp'); \n browser.on('serviceUp', function(info, flags) { \n console.log(\"HomeKit Accessory Found: \"+info.name);\n if (platform.config.HAPAccessories[info.name]!==undefined)\n InitializeAccessory({ \"Name\" : info.name, \"IP\":info.addresses[info.addresses.length-1], \"Port\":info.port, \"PIN\":platform.config.HAPAccessories[info.name]});\n \n }); \n browser.on('serviceDown', function(info, flags) { \n console.log(\"down \"+info.name); \n //\n }); \n browser.on('error', function(error) {\n //console.error(error.stack);\n });\n browser.start();\n }.bind(this));\n\n function InitializeAccessory(HAPInformation) {\n PairingData={};\n PairingData.my_username = uuid.generate('hap-nodejs:client:'+HAPInformation.Name);\n PairingData.acc_mdnsname=HAPInformation.Name;\n\t PairingData.acc_lastip=HAPInformation.IP;\n\t PairingData.acc_lastport=HAPInformation.Port;\n PairingData.acc_pin=HAPInformation.PIN;\n\n var myPairing = new pairing(); \n PairingData.PairProcess = myPairing;\n //throw an even instead of doing it here.\n myPairing.PairAccessory(PairingData);\n\n }\n}", "function dictionaryLoaded () {\n _haiku = new haiku.Haiku();\n\n // Call outputHaiku to generate and print a new random poem:\n outputHaiku();\n }", "updateUILogin(username) {\n $('.anon').hide()\n $('.auth').show()\n\n $('.my-games').show().attr('href', '#users/'+username+'/games')\n }", "function renderKeyInfo(key, data) {\n\tvar element = document.createDocumentFragment()\n\tvar icon = document.createElement('img')\n\ticon.src = protocol()+\"//sbapi.me/get/\"+data.path+\"/META/icon\"\n\ticon.className = \"metaIcon\"\n\telement.appendChild(icon)\n\telement.appendChild(textItem(data.filename, \"pre metaTitle\"))\n\telement.appendChild(textItem(data.author.name, \"pre metaAuthor\")) //todo: link with sbs account somehow?\n\treturn element\n}", "function display(path) {\n\tredirect('/api' + path);\n}", "function pageHome(request, response) {\r\n response.send('<h1>Welcome to Phonebook</h1>')\r\n}", "function showWebsite(p_name, p_url) {\n\n\tif (v_connTabControl)\n\t\thideAbout();\n\t\tv_connTabControl.tag.createWebsiteOuterTab(p_name,p_url);\n\n}", "function controller_by_user(){\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\t\r\n\t\t} catch(e){\r\n\t\t\tconsole.log(\"%cerror: %cPage: `help` and field: `Custom Controller`\",\"color:blue;font-size:18px\",\"color:red;font-size:18px\");\r\n\t\t\tconsole.dir(e);\r\n\t\t}\r\n\t}", "function RunHaploViewer(result, SampleIdList, genes)\n{\n\t//Get the job information returned from the web service call that created the job.\n\tvar jobNameInfo = Ext.util.JSON.decode(result.responseText);\t\t\t\t\t \n\tvar jobName = jobNameInfo.jobName;\n\n\tgenePatternReplacement();\n\t/*//Show the window that displays the steps in the workflow.\n\tshowJobStatusWindow(result);\t\n\t\n\t//Log into GenePattern\n\tdocument.getElementById(\"gplogin\").src = pageInfo.basePath + '/analysis/gplogin';\n\n\t//Run the HaploView\n\tExt.Ajax.request\n\t\t\t({\t\t\t\t\t\t\n\t\t\t\turl: pageInfo.basePath+\"/genePattern/runhaploviewersample\",\n\t\t\t\tmethod: 'POST',\n\t\t\t\ttimeout: '1800000',\n\t\t\t\tparams: {sampleIdList: SampleIdList,\n\t\t\t\t\tgenes: genes,\n\t\t\t\t\tjobName: jobName\n\t\t\t\t}\n\t\t\t});\n\t\n\t//Start the status polling.\n\tcheckJobStatus(jobName);*/\n}", "function usage(){\n\tmsg.setBodyAsHTML('Bash Help:');\n\tview.echoSentMessageToDisplay(msg);\n\tmsg.setBodyAsHTML(' Display a Quote: /bash [integer]');\n\tview.echoSentMessageToDisplay(msg);\n\tmsg.setBodyAsHTML(' Display a Random Quote: /bash random');\n\tview.echoSentMessageToDisplay(msg);\n\tmsg.setBodyAsHTML(' Display Help: /bash help');\n\tview.echoSentMessageToDisplay(msg);\n\tmsg.setBodyAsHTML(' Ex: /bash 5273');\n\tview.echoSentMessageToDisplay(msg);\n}", "function render_scatterHoeGaatHet() {\n var plotS = hgiScatter().mapping(['uw_eigen_factor', 'hoe_gaat_het_met_u']).addLOESS(true).xLabel('Uw eigen factor').yLabel('Hoe gaat het met u?').xTicks(5).yTicks(5);\n d3.select('#scatterHoeGaatHet').datum(data).call(plotS);\n}", "function makeURL(domain, userApiKey) {\r\n var base = \"https://api.shodan.io/shodan/host/search?key=\";\r\n var url = base + userApiKey + '&query=hostname:' + domain;\r\n console.log(url);\r\n return url;\r\n}", "function displaySplashScreen() {\n config.windowSize = process.stdout.getWindowSize();\n\n arciiArt.font(' magikServer', 'Doom', 'magenta', function(rendered) {\n console.log('\\u001B[2J\\u001B[0;0f');\n console.log(rendered);\n console.log(pad(config.windowSize[0], config.versionInfo).green);\n console.log(pad('-', config.windowSize[0], '-').grey);\n\n if(config.portChanged) {\n console.log('WARNING port %s in use, changed to %s'.red, config.portChanged, config.port);\n }\n console.log(('started magik-server on http://' + config.address + ':' + config.port).green);\n console.log('Hit CTRL-C to stop (waiting for requests)'.green);\n console.log(pad('-', config.windowSize[0], '-').grey);\n cursor.hide();\n });\n}", "function downloadWikiPlugin(operatorId)\n{\n $('#fieldStatus-process').html('Processing request. This may takes a few seconds <img src=\"' + webappPath +\n 'img/wait16.gif\"/>');\n\n registerWikiTenant(operatorId);\n}", "function serveHTML(resource, viewTemplate, sekiResponse, queryResponse) {\n log.debug(\"in serveHTML, viewTemplate = \" + viewTemplate);\n if (!viewTemplate) {\n viewTemplate = htmlTemplates.contentTemplate; // \n }\n\n var saxer = require('./srx2map');\n var stream = saxer.createStream();\n\n sekiResponse.pipe(stream);\n\n queryResponse.on('data', function(chunk) {\n log.debug(\"CHUNK: \" + chunk);\n stream.write(chunk);\n });\n\n queryResponse.on('end', function() {\n\n stream.end();\n\n var bindings = stream.bindings;\n\n // verbosity(\"bindings \" + JSON.stringify(bindings));\n\n if (!bindings || !bindings.title) { // // this is shite\n var creativeMap = {\n \"uri\": resource,\n \"title\": \"Enter title\",\n \"content\": \"Enter content\",\n \"login\": \"nickname\"\n }\n // \"uri\" : sekiRequest.url\n };\n\n sekiResponse.writeHead(200, sekiHeaders);\n\n bindings[\"uri\"] = resource;\n\n var html = freemarker.render(viewTemplate, bindings);\n\n log.info(\"404\");\n\n // log.debug(\"viewTemplate = \"+viewTemplate);\n // log.debug(\"bindings = \"+JSON.stringify(bindings));\n sekiResponse.end(html);\n });\n}", "function publish_hass_discovery_info() {\n mqtt.publish(\n \"homeassistant/switch/pool_heater/config\",\n '{\"name\": \"Pool Heater\", \"device_class\": \"heat\", \"state_topic\": \"pool/pool_heater/state\", \"command_topic\": \"pool/pool_heater/set\"}')\n// '{\"name\": \"Pool Heater\", \"device_class\": \"heat\", \"~\": \"pool/pool_heater\", \"state_topic\": \"~/state\", \"command_topic\": \"~/set\"}')\n }", "function getLandingPageMeta(hostname,lpi,handleBarMeta,config){\n\tvar lpiDoc=DefinitionStore.get(lpi);\n\tvar meta=\"\";\n\tvar image_src=\"\";\n\tif(config && config.cloudPointHostId && config.cloudPointHostId==\"schemaengine\"){\n\t\timage_src=\"https://res.cloudinary.com/dzd0mlvkl/image/upload/v1623462816/wk_icon.jpg\"\n\t}\n\tvar mtitle=(config.htmlMeta && config.htmlMeta.title)?config.htmlMeta.title:handleBarMeta.title;\n\tvar desc=(config.htmlMeta && config.htmlMeta.description)?config.htmlMeta.description:\"\";\n\tvar metaKeywords=(config.htmlMeta && config.htmlMeta.keywords)?config.htmlMeta.keywords:\"\";\n\tvar ogTitle=mtitle;\n\tvar ogDescription=desc;\n\tif(lpiDoc && lpiDoc.htmlMeta){\n\t\tmtitle=lpiDoc.htmlMeta.title;\n\t\tdesc=lpiDoc.htmlMeta.description;\n\t\tmetaKeywords=lpiDoc.htmlMeta.keywords;\n\t\tif(lpiDoc.htmlMeta.image_src){\n\t\t\timage_src=lpiDoc.htmlMeta.image_src;\n\t\t}\n\t\togTitle=mtitle;\n\t\togDescription=desc;\n\t\tif(lpiDoc.htmlMeta.ogTitle && lpiDoc.htmlMeta.ogTitle!=\"\"){\n\t\t\togTitle=lpiDoc.htmlMeta.ogTitle;\n\t\t}\n\t\tif(lpiDoc.htmlMeta.ogDescription && lpiDoc.htmlMeta.ogDescription!=\"\"){\n\t\t\togDescription=lpiDoc.htmlMeta.ogDescription;\n\t\t}\n\t}\n\tmtitle=mtitle.replace(metaCleanRegEx,' ');\n\tdesc=desc.replace(metaCleanRegEx,' ');\n\togTitle=ogTitle.replace(metaCleanRegEx,' ');\n\togDescription=ogDescription.replace(metaCleanRegEx,' ');\n\tmetaKeywords=metaKeywords.toString().replace(metaCleanRegEx,' ');\n\ttry{\n\t\tmeta = \"<title>\"+mtitle+\"</title>\\n\" +\n\t\t\t\t\"<meta name='author' content='\"+ (config.title?config.title:\"schemaengine\") +\"'/>\\n\" +\n\t\t\t\t\"<meta name='description' content='\"+ desc +\"'/>\\n\" +\n\t\t\t\t\"<meta name='keywords' content='\"+ metaKeywords +\"'/>\\n\"+\n\t\t\t\t\"<link href='\"+ image_src +\"' rel='image_src'/>\\n\"+\n\n\t\t\t\t\"<meta property='og:image' content='\"+ image_src +\"' xmlns:og='http://opengraphprotocol.org/schema/'/>\\n\"+\n\t\t\t\t\"<meta property='og:title' content='\"+ogTitle+\"' />\\n\"+\n\t\t\t\t\"<meta property='og:description' content='\"+ ogDescription +\"' />\\n\"+\n\t\t\t\t\"<meta property='og:type' content='website' />\\n\"+\n\n\t\t\t\t\"<meta name='twitter:card' content='summary'/>\\n\" +\n\t\t\t\t\"<meta name='twitter:title' content='\"+ogTitle+\"'/>\\n\" +\n\t\t\t\t\"<meta name='twitter:description' content='\"+ogDescription+\"'/>\\n\" +\n\t\t\t\t\"<meta name='twitter:image' content='\"+image_src+\"'/>\\n\";\n\t\tif(lpiDoc && !lpiDoc.webCrawlerIndex){\n\t\t\tmeta+=\"\\n<meta name='robots' content='noindex' />\";\n\t\t\tmeta+=\"<meta name='robots' content='nofollow' />\\n\";\n\t\t}\n\n\t}catch(err){\n\t\tlogger.error({type:\"landingPageMetaConstruction\",error:err.message});\n\t}\n\treturn meta;\n}", "function controller_by_user(){\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\t\r\n\t\t} catch(e){\r\n\t\t\tconsole.log(\"%cerror: %cPage: `hsn_code` and field: `Custom Controller`\",\"color:blue;font-size:18px\",\"color:red;font-size:18px\");\r\n\t\t\tconsole.dir(e);\r\n\t\t}\r\n\t}", "static renderHosts(hosts) {\n const mainWrapper = document.getElementById('hosts-wrapper');\n hosts.forEach(host => {\n mainWrapper.innerHTML += HtmlParser.renderHost(host);\n });\n }", "function showHelp() {\n console.log(\"showing map in Alert Panel\")\n\n // Width depends on device\n // [TODO] check device\n xapi.status.get(\"SystemUnit ProductPlatform\").then((product) => {\n console.debug(`running on a ${product}`)\n \n let width = 51 // when the Alert is shown on a Touch 10\n if (product == \"DX80\") {\n console.debug('has no Touch10 attached')\n width = 31 // when the Alert is shown on a screen\n }\n\n // show Aletr panel \n xapi.command('UserInterface Message Alert Display', {\n Title: 'With a little help from ... the bot',\n Text: game.buildMapAsWrapped(width, true),\n Duration: 5\n })\n })\n}", "function HAProxyTemplate () {\n\tthis.webAppAddresses = [];\n\tthis.users = {};\n}", "showWebsite() {\n require('electron').shell.openExternal('https://codef0x.dev');\n }", "function who(){\n\t$(\"#connect\").css(\"display\", \"none\");\n\t$(\"#visitorAccess\").css(\"display\", \"none\");\n\t$(\"#welcome\").css(\"display\", \"flex\");\n}", "function showResult()\n{\n //console.log(hang.resultString); // log the result\n if(hang.resultValue){\n\t//document.getElementById(\"h1\").innerHTML = hang.resultString;\n\tif(hang.resultString==\"Kurucz Gábor\"){\n\t\tlocation.href = 'https://avatars0.githubusercontent.com/u/42976086?s=400&v=4';\n\t}\n\telse{\n\tdocument.write(\"<h1>\"+hang.resultString+\"<br>\");\n\t}\n }\n}", "function displaySpotify() {\n if (process.argv[3]) {\n spotifySong = process.argv[3];\n }\n spotify\n .search({ type: 'track', query: spotifySong })\n .then(function (response) {\n\n dataOutPut = \"\\n\" + commandRequest + \"\\n---------------------------------------------------------------------------------------------------------------------------------\" +\n \"\\nArtist(s): \" + response.tracks.items[0].artists[0].name + \"\\n\" +\n \"\\nSong: \" + response.tracks.items[0].name + \"\\n\" +\n \"\\nPreview: \" + response.tracks.items[0].preview_url + \"\\n\" +\n \"\\nAlbum: \" + response.tracks.items[0].album.name + \"\\n\" +\n \"---------------------------------------------------------------------------------------------------------------------------------\";\n logOutPut();\n })\n .catch(function (err) {\n console.log(err);\n });\n}", "index(request, response) {\n const loggedInUser = accounts.getCurrentUser(request); \n logger.info('about rendering');\n if (loggedInUser) {\n \n const viewData = {\n title: 'About the Horselist App',\n developers: developerStore.getAllDevelopers(),\n fullname: loggedInUser.firstName + ' ' + loggedInUser.lastName,\n picture: loggedInUser.picture,\n messages: messageStore.getAllMessages(),\n };\n response.render('about', viewData);\n }\n else response.redirect('/'); \n }", "function indexhHandler(req,res){\n res.render('index_page')\n}", "showOneHike(hikeName) {}", "function showHomePage() {\n $('#greet-user').text('Bookmarks');\n $('#logout-button').hide();\n $('#login-div').show();\n $('#register-div').hide();\n $('#bookmarks-view').hide();\n }", "async function getHipHop() {\n let response = await fetch(\"http://wordpress.oscho.dk//wp-json/wp/v2/posts?_embed&categories=5\");\n let data = await response.json();\n console.log(data);\n appendHipHop(data);\n //showLoader(false);\n}", "function getTawkTo(group){\n if(group == \"administrator\"){\n var Tawk_API=Tawk_API||{}, Tawk_LoadStart=new Date();\n (function(){\n var s1=document.createElement(\"script\"),s0=document.getElementsByTagName(\"script\")[0];\n s1.async=true;\n s1.src='https://embed.tawk.to/5cb4a313c1fe2560f3feedbc/default';\n s1.charset='UTF-8';\n s1.setAttribute('crossorigin','*');\n s0.parentNode.insertBefore(s1,s0);\n })();\n }\n}", "function metaOutput(data) {\n if (data !== \"\") {\n //search metadata from response\n var search_title = data.title;\n var search_link = data.link;\n //build heading output for metadata heading\n var metaHeading = '<h6>'+search_title+' | <a href=\"'+search_link+'\">Flickr</a></h6>';\n //render metadata to contextual-output\n $(\".contextual-output\").prepend(metaHeading);\n }\n }", "function homeRouteHandler(request, response) {\n response.status(200).send('Welcome to City Explorer App');\n}", "function HostService() {\n /*host: string = \"http://localhost:900S0/\"*/\n /*host: string = \"http://localhost:9000/imersa/\"*/\n /*host: string = \"http://192.168.0.20:9000/imersa/\";*/\n /*\thost: string = \"http://localhost:9000/\"*/\n // host: string = \"http://localhost:8080/\";\n /*host: string = \"http://localhost:7089/\" */\n /*host: string = \"http://localhost:8080/imersa_backend-req4/\"*/\n // host: string = \"http://grupocubus.dyndns.org:50001/\";\n //host: string = \"http://ykssistemas.dyndns.org:50001/imersa/\";\n this.host = \"http://ec2-18-217-145-105.us-east-2.compute.amazonaws.com:9000/imersa/\";\n }", "function showEcho(echo){\n var echoView = document.getElementById(\"echoView\");\n var header = document.createElement(\"h2\");\n header.textContent = \"Echo\";\n //echoView.appendChild(header);\n document.body.appendChild(echoView);\n var echoObject = {\"Meta\": echo};\n printEchoSet(echoObject, null, echoView);\n}", "function htmlHeaders(k) {\n \n document.writeln(\"<h1>\" + gameHeader[k] + \"</h1>\");\n }", "function oneKey(event) {\n\t\n\tlet displayTextHere = document.getElementById('displayTextHere');\n\tlet displayingTextH1 = document.createElement('h1');\n\tdisplayingTextH1.innerText = event.key;\n\tdisplayTextHere.appendChild(displayingTextH1);\n}", "function display() {\n document.write(\"Hello, user!\");\n}", "function display_index(req, res){\n res.writeHead(200, {'Content-Type': 'text/html'});\n\n fs.readFile('./html/index.html', function(e, c) {\n res.end(c);\n });\n }", "function uitloggen(req, res) {\n req.session.loggedIN = false;\n req.flash('succes', 'U bent uitgelogd');\n res.render('index');\n console.log('U bent uitgelogd');\n}", "function startKupu() {\n // first let's load the message catalog\n // if there's no global 'i18n_message_catalog' variable available, don't\n // try to load any translations\n if (window.i18n_message_catalog) {\n var request = new XMLHttpRequest();\n // sync request, scary...\n request.open('GET', 'kupu-pox.cgi', false);\n request.send('');\n if (request.status != '200') {\n alert('Error loading translation (status ' + status +\n '), falling back to english');\n } else {\n // load successful, continue\n var dom = request.responseXML;\n window.i18n_message_catalog.initialize(dom);\n };\n };\n\n // initialize the editor, initKupu groks 1 arg, a reference to the iframe\n var frame = getFromSelector('kupu-editor'); \n var kupu = initKupu(frame);\n\n kupu.registerContentChanger(getFromSelector('kupu-editor-textarea'));\n\n var navigatingAway = function () {\n TWikiVetoIfChanged(kupu, true);\n }\n\n if (kupu.getBrowserName() == 'IE') {\n // IE supports onbeforeunload, so let's use that\n addEventHandler(window, 'beforeunload', navigatingAway);\n } else {\n // some versions of Mozilla support onbeforeunload (starting with 1.7)\n // so let's try to register and if it fails fall back on onunload\n var re = /rv:([0-9\\.]+)/\n var match = re.exec(navigator.userAgent)\n if (match[1] && parseFloat(match[1]) > 1.6) {\n addEventHandler(window, 'beforeunload', navigatingAway);\n } else {\n addEventHandler(window, 'unload', navigatingAway);\n };\n };\n\n // and now we can initialize...\n kupu.initialize();\n\n return kupu;\n}", "getServerName() {\n return \"RedHat YAML Language Server\";\n }", "index(request, response) {\n const viewData = {\n title: \"Login or Signup\",\n };\n response.render(\"index\", viewData);\n }", "function controller_by_user(){\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\t\r\n\t\t} catch(e){\r\n\t\t\tconsole.log(\"%cerror: %cPage: `sp2hp` and field: `Custom Controller`\",\"color:blue;font-size:18px\",\"color:red;font-size:18px\");\r\n\t\t\tconsole.dir(e);\r\n\t\t}\r\n\t}", "index(request, response) {\n // Set the user to the username of the logged in users name or an empty string.\n const user = request.session.user ? request.session.user.username : '';\n // Render the main page\n response.render(\n 'index.ejs',\n {\n // Pass eventual username.\n user: user,\n // Pass eventual message.\n message: this.message\n }\n );\n // Reset the message to an empty string.\n this.message = '';\n }", "help(cb) {\n this.outputHelp(cb);\n process.exit(1);\n }", "function display404(url, req, res) {\n res.writeHead(404, {\n 'Content-Type': 'text/html'\n });\n res.write(\"<h1>404 Not Found </h1>\");\n res.end(\"The page you were looking for: \" + url + \" can not be found \");\n}", "function createHud(hudid) {\n console.log(\"LSH: createHud() \", hudid);\n // Create the browser window.\n if ( HUD[hudid]) {\n console.log(`LSH: hud ${hudid} already exists`);\n return;\n }\n //reference this huds definition\n let hdef = HDEF[hudid]\n // setup values to check\n let show_win = true\n let paint_win = true\n let skip_taskbar = true\n let transparent_win = false\n let resizable_win = hdef.resizable\n let framed_win = hdef.frame\n if (hdef.hud_type === \"normal\" && hdef.is_hidden === true){ show_win = false }\n if (hdef.hud_type === \"freestyle\" && hdef.show_on_startup === false || hdef.hud_type === \"background\") {\n show_win = false\n //paint_win = false\n }\n if (hdef.hud_type === \"freestyle\" ){ skip_taskbar = false }\n // setup for transparent window if enabled\n if (hdef.transparent === true && args.includes(\"-t\") ) {\n console.log(\"LSH: Creating transparent window\");\n transparent_win = true\n resizable_win = false\n framed_win = false\n }\n\n HUD[hudid] = {}\n HUD[hudid].focus = false\n HUD[hudid].win = new BrowserWindow({\n x:hdef.x,\n y:hdef.y,\n width: hdef.width,\n height: hdef.height,\n transparent:transparent_win,\n frame:framed_win,\n show:show_win,\n skipTaskbar:skip_taskbar,\n paintWhenInitiallyHidden:paint_win, // maybe don't need this\n resizable:resizable_win,\n webPreferences: {\n contextIsolation: false,\n preload: path.join(hdef.path , 'preload.js')\n\n },\n icon: path.join(hdef.path, 'assets/icon.png')\n })\n HUD[hudid].winid = HUD[hudid].win.getNativeWindowHandle().readUInt32LE()\n console.log(`LSH: ${hudid} native window id: `, HUD[hudid].winid);\n // hide the default electron menu\n HUD[hudid].win.setMenuBarVisibility(false)\n // set skiptaskbar\n HUD[hudid].win.setSkipTaskbar(skip_taskbar)\n // load the html of the hud or specified url.\n if (hdef.load_url === null){\n HUD[hudid].win.loadFile( path.join(hdef.path ,`index.html`) )\n } else {\n HUD[hudid].win.loadURL( hdef.load_url )\n }\n\n HUD[hudid].views = {}\n // check for and load browser views\n if (hdef.browser_views.length > 0){\n hdef.browser_views.forEach((bv, i) => {\n let setin = false\n if (i = 0 && hdef.load_browser_view === true ) { setin = true }\n if (bv.auto_load === true || setin === true){\n createBrowserView(hudid,bv, setin)\n }\n });\n }\n\n // Open the DevTools.\n if ( hdef.open_dev_tools === true ) {\n HUD[hudid].win.webContents.openDevTools({mode:\"detach\"})\n }\n\n // set always on top\n if ( hdef.always_on_top === true ) {\n HUD[hudid].win.setAlwaysOnTop(true)\n }\n\n\n\n HUD[hudid].win.webContents.on(\"did-finish-load\",() =>{\n console.log(`LSH: hud ${hudid} did-finish-load`);\n HUD[hudid].ready = true\n // send the hud it's config definition\n HUD[hudid].win.webContents.send(\"from_mainProcess\",{type:\"config_definition\", data:HDEF[hudid]})\n hudSendPositionSize(hudid)\n if (hdef.hud_type === \"normal\" ){ checkHudsReady(hudid) }\n\n })\n\n HUD[hudid].win.on(\"blur\",() =>{\n //console.log(`HUD ${hudid} is blurred`);\n HUD[hudid].focus = false\n if (config.autohide === true ) {\n if ( hdef.hud_type === \"normal\" || hdef.hud_type === \"freestyle\" ){\n setTimeout(checkAllBlurred,config.autohide_delay)\n }\n }\n\n })\n HUD[hudid].win.on(\"focus\",() =>{\n //console.log(`HUD ${hudid} is focused`);\n HUD[hudid].focus = true\n if ( hdef.hud_type === \"normal\" ) {\n focused_hud = hudid\n }\n\n })\n HUD[hudid].win.on(\"resize\",() =>{\n //console.log(`HUD ${hudid} is resize`);\n hudSendPositionSize(hudid)\n })\n HUD[hudid].win.on(\"move\",() =>{\n //console.log(`HUD ${hudid} is move`);\n hudSendPositionSize(hudid)\n })\n HUD[hudid].win.on(\"closed\",() =>{\n destroyHud(hudid)\n\n })\n\n\n}", "function createRemoteHostSpan() {\n var span = $('<span>');\n if (node.logsLocation !== 'not available') {\n $('<a>')\n .attr('target', '_blank')\n .attr('href', node.logsLocation)\n .text(node.configuration.remoteHost)\n .appendTo(span);\n } else {\n $(span).text(node.configuration.remoteHost);\n }\n return span;\n }", "function destroyAHAH(e) {\n\tvar http_request;\n\n\tif (window.XMLHttpRequest) { // Mozilla, Safari, IE7\n\t\thttp_request = new XMLHttpRequest();\n\t\tif (http_request.overrideMimeType) {\n\t\t\thttp_request.overrideMimeType(\"text/html\");\n\t\t}\n\t} else if (window.ActiveXObject) { // IE6\n\t\ttry {\n\t\t\thttp_request = new ActiveXObject(\"MSXML2.XMLHTTP.6.0\");\n\t\t} catch (e) {\n\t\t\ttry {\n\t\t\t\thttp_request = new ActiveXObject(\"MSXML2.XMLHTTP\"); // Version 3\n\t\t\t} catch (e) { }\n\t\t}\n\t}\n\n\tif (!http_request) return;\n\thttp_request.open(\"GET\", 'http://' + window.location.host + '/AJAX-NMenuLoader.ashx?clearCache=1', false);\n\thttp_request.send(null);\n\t//alert(http_request.status + ': if 200, the session cache object was term\\'d where needed be.');\n}", "function GetDeviceIP(){\n showBackgroundImage('wait_message');\n getContent('','/cgi-bin/setup.cgi?GetDeviceIP','function:ShowGetDeviceIP');\n}", "function exportConfigToHuman(format) {\n saveSession()\n var config = getConfig()\n summary = buildHumanSummary(config)\n\n if(format == \"markdown\") {\n saveToFile(summary, \"titan-project-description.md\", \"text/markdown\")\n } else { // Html\n converter = new showdown.Converter()\n converter.setFlavor('github');\n html = converter.makeHtml(summary);\n\n var newWin = open('url','Logstash configuration summary');\n newWin.document.write(html);\n }\n\n}", "function displayAll(assistant) {\n const username = req.body.result.parameters[USERNAME_PARAM].toLowerCase();\n const name = req.body.result.parameters[FIRST_NAME_PARAM];\n const displayBool = req.body.result.parameters[DISPLAY_BOOL_PARAM];\n const user = dbRoot.child(username);\n const displayUpdates = {};\n displayUpdates['/news/settings/active'] = stringBoolMap[displayBool];\n displayUpdates['/time/settings/active'] = stringBoolMap[displayBool];\n displayUpdates['/weather/settings/active'] = stringBoolMap[displayBool];\n displayUpdates['/pet/settings/active'] = stringBoolMap[displayBool];\n user.update(displayUpdates);\n const status = stringBoolMap[displayBool] ? 'Enjoy your Myao mirror display.' : 'Enjoy your boring mirror.';\n const speech = `Here you go ${name}! ${status}`;\n assistant.ask(speech);\n }", "function homePage(req,res) {\r\n superagent.get('https://digimon-api.herokuapp.com/api/digimon')\r\n .then((data)=>{\r\n let allDigimon = data.body.map((val)=>{\r\n return new Digimon(val);\r\n })\r\n res.render('digimonExam/index', {results:allDigimon});\r\n }).catch((err)=>errorHandler(err,req,res));\r\n}", "function showText() {\n\tfiglet('Twitch', function(err, data) {\n\t if (err) {\n\t console.log('Something went wrong...');\n\t console.dir(err);\n\t return;\n\t }\n\t console.log(data);\n\t console.log(' Twitch streamers status '.inverse + '\\r\\n');\n\t //console.log('loading...');\n\t});\n}" ]
[ "0.6880327", "0.5804156", "0.5489704", "0.53743845", "0.5319809", "0.5255089", "0.517453", "0.51510435", "0.5038686", "0.5033053", "0.4988563", "0.49569926", "0.49349216", "0.49086455", "0.48765478", "0.48379108", "0.480791", "0.47908065", "0.47840333", "0.47663835", "0.476532", "0.47620302", "0.47616547", "0.47512227", "0.47474506", "0.47420564", "0.47396895", "0.4738517", "0.47318983", "0.47316372", "0.47276923", "0.47214934", "0.47079468", "0.47037515", "0.4702644", "0.47000125", "0.46996394", "0.46916", "0.4679306", "0.46662644", "0.46646026", "0.46620128", "0.4656831", "0.46336636", "0.46276334", "0.46275884", "0.46067554", "0.46022007", "0.4585422", "0.458324", "0.45814258", "0.45734194", "0.4570912", "0.45666537", "0.4557911", "0.45549646", "0.45526433", "0.4543911", "0.4539309", "0.4535878", "0.45337465", "0.45249555", "0.45126352", "0.45116052", "0.45106867", "0.45098442", "0.4505277", "0.45011446", "0.45010698", "0.45001593", "0.44973427", "0.4493246", "0.4489941", "0.44878826", "0.4487483", "0.44783983", "0.44705823", "0.44687873", "0.44687483", "0.4466357", "0.4463868", "0.446386", "0.4462213", "0.4455113", "0.4451699", "0.44515195", "0.4450412", "0.44375998", "0.44300905", "0.44296762", "0.44277328", "0.44206342", "0.44205984", "0.44185817", "0.44159293", "0.44118503", "0.44112122", "0.44100356", "0.44097704", "0.44078556", "0.44012567" ]
0.0
-1
LIKE OR DISLIKE HAIKU, DEPENDS ON CURRENT LIKE STATUS
likeOrdislike() { const dbChange = new XMLHttpRequest; dbChange.onreadystatechange = () => { if (dbChange.readyState == 4 && dbChange.status == 200) { const result = JSON.parse(dbChange.responseText); if(result[0] == true) { const icon = document.querySelector("#haiku"+this.id+" .post-like"); switch(this.likeStatus) { case true: { this.likeStatus = false; this.likes--; icon.style.backgroundImage = "url('img/icons/heart_normal.svg')"; saveLikesData(this.id, "remove"); break; } case false: { this.likeStatus = true; this.likes++; icon.style.backgroundImage = "url('img/icons/heart_full_normal.svg')"; saveLikesData(this.id, "add"); break; } } document.querySelector("#haiku"+this.id+" .post-like span").textContent = this.likes; } showCommunicate(result); } }; dbChange.open("POST", "../resources/haiku_like.php", true); dbChange.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); if(this.likeStatus == true) dbChange.send("like=false&hid="+this.id); else dbChange.send("like=true&hid="+this.id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkLIKE()\n\t\t{\n\t\t\t db_connection.query(query, function(err, result)\n\t \t\t{\n\t \t\t\tif (err) \n\t \t\t\t{\n\t \t\t\t\tres.send(\"A database error occurred: \" + err);\n\t \t\t\t}\n\t \t\t\telse\n\t \t\t\t{\n\t \t\t\t\tif (result.length < 1)\n\t \t\t\t\t{\n\t \t\t\t\t\taddLIKE();\n\t \t\t\t\t}\n\t \t\t\t}\n\t\t \t});\n\t\t}", "function addLIKE()\n\t\t{\n\t\t db_connection.query(query_1, function(err, result)\n\t \t\t{\n\t \t\t\tif (err) \n\t \t\t\t{\n\t \t\t\t\tres.send(\"A database error occurred: \" + err);\n\t \t\t\t}\n\t \t\t\telse\n\t \t\t\t{\n\t \t\t\t\tupdateLIKES();\n\t \t\t\t}\n\t\t \t});\n\t\t}", "async checkLikeExist(params) {\n const { fromUser, toUser } = params;\n\n const [rows] = await mysqlUtil.query('SELECT 1 FROM `like` WHERE fromUser = ? AND toUser = ?', [fromUser, toUser]);\n\n return rows.length !== 0;\n }", "function BOT_onLike() {\r\n\tBOT_traceString += \"GOTO command judge\" + \"\\n\"; // change performative\r\n\tBOT_theReqJudgement = \"likeable\";\r\n\tBOT_onJudge(); \t\r\n\tif(BOT_reqSuccess) {\r\n\t\tvar ta = [BOT_theReqTopic,BOT_theReqAttribute]; \r\n\t\tBOT_del(BOT_theUserTopicId,\"distaste\",\"VAL\",ta);\r\n\t\tBOT_add(BOT_theUserTopicId,\"preference\",\"VAL\",ta);\r\n\t}\r\n}", "async like(params) {\n const { fromUser, toUser } = params;\n if (await this.checkLikeExist(params) === true) {\n await mysqlUtil.query(\n 'DELETE FROM `like`\\\n WHERE fromUser = ? \\\n AND toUser = ?',\n [fromUser, toUser]\n );\n await User.decrementLikeCount(toUser);\n } else {\n await mysqlUtil.query(\n 'INSERT INTO `like` \\\n (fromUser, toUser) \\\n VALUES (?, ?);',\n [fromUser, toUser]\n );\n await User.incrementLikeCount(toUser);\n }\n }", "function findHaiku(data, query, cb) {\n\n var tweets = JSON.parse(data).statuses\n var numTweets = tweets.length\n var foundHaiku = false\n var i = 0\n\n // for (var i = 0; i <= count - 1; i++) {\n while (foundHaiku == false) {\n\n if (i >= numTweets) {\n console.log('--possible re-poll oportunity--')\n cb({ \"line1\": \"Could not find haiku...\", \"line2\": \"\", \"line3\": \"\" })\n break\n }\n\n str = tweets[i].text\n haiku(str, function (err, data) {\n if (err) {\n console.error('Error! '.red, err)\n i++\n }\n else {\n console.log('Found haiku GOOD'.green)\n data.url = \"http://twitter.com/\" + tweets[i].user.screen_name + \"/status/\" + tweets[i].id_str\n console.log(data)\n data['q'] = query\n cb(data)\n foundHaiku = true\n }\n })\n }\n}", "static usernameCheck(username) {\n const wl = new Wordlist();\n\n return wl.load().then(() => {\n if (wl.regexp.banned.test(username)) {\n throw new ErrContainsProfanity(username);\n }\n });\n }", "function like (data, archetype) {\n var name;\n\n for (name in archetype) {\n if (archetype.hasOwnProperty(name)) {\n if (data.hasOwnProperty(name) === false || typeof data[name] !== typeof archetype[name]) {\n return false;\n }\n\n if (object(data[name]) && like(data[name], archetype[name]) === false) {\n return false;\n }\n }\n }\n\n return true;\n }", "function searchCheck() {\n switch(searchType) {\n case \"my-tweets\":\n\tmyTweets();\n\tbreak;\n case \"spotify-this-song\":\n\tcheckName();\n\tbreak;\n case \"movie-this\":\n checkName();\n\tbreak;\n case \"do-what-this-says\":\n\trandomSearch();\n\tbreak;\n }\n}", "function checkSynonymsRelevant(word, wrapper){\n //Get to the span in header row, remove \"for \" and compare to current word\n return wrapper.find(\".filters\").find(\".heading-row\").find(\"span\")\n .text().substring(4).toLowerCase() === word.toLowerCase();\n}", "function getRecipesWithNameLike(req, res, mysql, context, complete) {\n //sanitize the input as well as include the % character\n var query = \"SELECT recipes.recipe_id as id, recipe_name, recipe_description, recipe_type, recipe_origin, prep_time, cook_time FROM recipes WHERE recipes.recipe_name LIKE \" + mysql.pool.escape(req.params.s + '%');\n console.log(query)\n \n mysql.pool.query(query, function(error, results, fields){\n if(error){\n res.write(JSON.stringify(error));\n res.end();\n }\n context.people = results;\n complete();\n });\n }", "static async usernameCheck(username) {\n const duplicateCheck = await db.query(\n `SELECT username \n FROM users \n WHERE UPPER(username) = UPPER($1)`,\n [username]\n );\n // returns true if username is already in use\n return duplicateCheck.rows.length > 0;\n }", "function searchByTerm(searchTerm){\n knexInstance\n .select('*')\n .from('shopping_list')\n .where('name', 'ILIKE', `%${searchTerm}%`)\n .then(result => {\n console.log('Drill 1:', result)\n })\n}", "function doubleSearch () {}", "function word_present(command, synonyms){\n for (n in synonyms){\n var synonym = synonyms[n];\n if (synonym.charAt(0) == \"<\"){\n //must be an exact match\n synonym = synonym.substring(1);\n if (command == synonym)\n return true;\n }\n else{\n if (command.includes(synonym))\n return true;\n }\n }\n return false;\n}", "search() {\n return db.many(`\n SELECT *\n FROM parks p\n WHERE p.borough LIKE '%ook%'\n `);\n }", "function masterSearch(){\n switch (userCommand) {\n\n case \"my-tweets\":\n findTweets();\n break;\n\n case \"spotify-song\":\n spotifyNow();\n break;\n\n case \"movie-please\":\n movie();\n break;\n\n case \"directions-por-favor\":\n followDirections();\n break;\n }\n}", "function test_bottleneck_host() {}", "function suggestCommand(prefix) {\n if (prefix == \"\") return\n\n commands.forEach(cmd => {\n cmd.aliases.forEach(alias => {\n if (alias.startsWith(prefix)) {\n suggbar.placeholder = data.symbol + alias\n return\n }\n })\n });\n}", "function OrderSearchByKeyWords(database,word,orderkey,func) {\r\n var pword=word.split(' ').join('%').concat('%');\r\n var ppword='%'.concat(pword);\r\n database.query('SELECT books_basic.ID,Title,Subtitle,Image FROM books_basic INNER JOIN books_detail ON books_basic.ID=books_detail.ID WHERE Title LIKE \"'+ppword+'\" OR Subtitle LIKE \"'+ppword+'\" OR Description LIKE \"'+ppword+'\" ORDER BY '+orderkey+ ';',func);\r\n}", "like() {\r\n return this.getItem().then(i => {\r\n return i.like();\r\n });\r\n }", "static checkHowAvailability(next, howKey) {\n howKey = howKey.toLowerCase();\n\n let error = new Error('The :how key \\'' + howKey + '\\' must be \\'asc\\' or \\'desc\\'');\n error.code = 400;\n\n if (howKey !== \"asc\" && howKey !== \"desc\") return next(error);\n }", "function afterMatchFound(result, ctx) {\n\n if(ctx.friendlies.indexOf(result.user.toLowerCase()) > -1) {\n result.relevance += ((1.0 - result.relevance) * 0.5); // up the relevance because it comes from a friendly\n }\n\n if(result.tags.length > 0) { // result.relevance\n console.debug(\"Found relevant match\" + (result.volatile ? \" [VOLATILE]\" : \"\") + \".\");\n console.debug(result.tweetid + \" [\"+result.relevance+\"]: \" + JSON.stringify(result.tags));\n // send through to InfluxDB\n saveTweetToInflux(result)\n } else {\n console.debug(\"Event not found to be relevant.\");\n }\n}", "function verifLike(indexUser, sauceLike, userId) {\n console.log(\"entrer dans verif like \");\n if (indexUser >= 0 && userId == sauceLike.usersLiked[indexUser]) {\n var retour = true;\n console.log(\"Userid dans userliked : \" + userId);\n\n } else {\n\n var retour = false;\n\n }\n\n console.log(\"Sortie verif like : \" + retour);\n return retour;\n}", "function getGuideWithNameLike(req, res, mysql, context, complete) {\n var query = \"SELECT tour_guide.tourGuide_ID as guide_ID, tour_guide.first_Name as first_name, tour_guide.last_Name as last_name, \" +\n \"COUNT(assignment.tourGuide_travelLocation) AS count_assignments, \" +\n \"COUNT(travel_location.travelLocation_ID) AS count_locations \" +\n \"FROM tour_guide \" +\n \"LEFT JOIN assignment ON tour_guide.tourGuide_ID = assignment.tourGuide_ID \" +\n \"LEFT JOIN travel_location ON assignment.travelLocation_ID = travel_location.travelLocation_ID \" +\n \"WHERE tour_guide.first_Name LIKE \" + mysql.pool.escape(req.params.s + '%');\n console.log(query);\n mysql.pool.query(query, function (error, results, fields) {\n if (error) {\n res.write(JSON.stringify(error));\n res.end();\n }\n context.tour_guide = results;\n console.log(results);\n complete();\n });\n }", "retrieve_by_wildcard_and(wildcard_json, table_name, callback) {\r\n\t\tvar query_str = \"SELECT * from \" + table_name + \" where \";\r\n\t\t\r\n\t\tvar count = 0;\r\n\t\t// iterate through the query json , appending each specifier \r\n\t\tfor (var key in wildcard_json) { \r\n\t\t\tvar value = wildcard_json[key];\r\n\t\t\tvar form_key = key;\r\n\t\t\t\r\n\t\t\tvar temp = form_key + \" like '%\" + value + \"%'\";\r\n\t\t\t\r\n\t\t\tquery_str += temp;\r\n\t\t\tcount +=1;\r\n\t\t\t// Check if the item is last in json object,\r\n\t\t\t// If so, terminate the query and execute\r\n\t\t\tif(count == Object.keys(wildcard_json).length){\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tquery_str += \" AND \" ;\r\n\t\t}\r\n\t\t\r\n\t\tthis.db_connection.query(\r\n\t\t\tquery_str, \r\n\t\t\tfunction(err, results, fields)\r\n\t\t\t{\r\n\t\t\t\tcallback(err, results);\r\n\t\t\t}\t\t\r\n\t\t);\r\n\t}", "textContains(text){\n return !!SEARCHABLE_PROPERTIES.find(key => {\n return (this.get(key) && (this.get(key).toLowerCase()).indexOf(text.toLowerCase()) > -1) \n })\n }", "handleElectronSpellCheck(text) {\n if (!this.currentSpellchecker) return true;\n\n if (isMac) {\n return !this.isMisspelled(text);\n }\n\n let result = this.isMisspelled(text);\n\n return !result;\n }", "function handleNormalSearch(query) {\n\tconsole.log(\"doing normal search with query: \" + query);\n\t// TODO: you should do normal search here\n}", "async function darLike() {\n if (user) {\n db.collection(\"Likes\")\n .doc(eventId)\n .set({\n eventId\n });\n\n await likesQuery().set({ eventId });\n sumarLike();\n setGusto(true);\n }\n }", "function goWiki(term) {\n counter = counter + 1;\n //Check if Adolf Hitler\n if (term == 'Adolf Hitler') {\n console.log('Found Hitler')\n console.log('In', counter, 'Random Searches');\n } else {\n let url = searchUrl + term;\n loadJSON(url, gotSearch, 'jsonp');\n }\n}", "function checkLike(req, res) {\n var noteId = req.params.noteId;\n var userId = req.params.userId;\n if(noteId.length <10){\n noteModel\n .checkApiLike(noteId, userId)\n .then(function (score) {\n res.json(score);\n });\n }else{\n noteModel\n .checkOwnLike(noteId, userId)\n .then(function (score) {\n res.json(score);\n });\n }\n }", "function Search(path, items, options){\n\n this.path = path;\n this.items = items;\n this.options = options;\n \n var prefixes;\n if (options.prefixes) {\n prefixes = options.prefixes;\n }\n\n // TODO: Make this more solid (case insensitive?)\n for (var k in prefixes) if (prefixes.hasOwnProperty(k)) {\n prefixes[k] = new RegExp(prefixes[k]);\n Titanium.API.debug('REGEX: ' + prefixes[k]);\n }\n \n var caches = {};\n \n function findCache(abbr){\n var len = abbr.length;\n while (len--) {\n if (caches[abbr]) return caches[abbr];\n abbr = abbr.substr(0, len);\n }\n return null;\n }\n\n this.score = function(abbr){\t\n var i,j,k,\n len, len2, ch, ranges, str, found, lastIdx,\n result = [],\n d1, d2;\n\n d1 = (new Date).getTime();\n\n var cache, newCache;\n\n // Caches store files NOT-FOUND, otherwise the stop-at-limit won't work since\n // we don't do a full scan if we reach a max. number of matched items \n cache = findCache(abbr);\n // TODO: Do not create new cache if abbr.length is longer than X\n if (cache !== caches[abbr]) {\n // If previous cache was found clone its contents!!!!\n newCache = caches[abbr] = cache ? cache.clone() : (new Bits(items.length));\n }\n\n // Extract prefix from abbr if pressent\n var prefixRe, ofs = abbr.indexOf(':');\n if (-1 < ofs) {\n prefixRe = abbr.substr(0, ofs);\n if (prefixes[prefixRe]) {\n abbr = abbr.substr(ofs+1);\n prefixRe = prefixes[prefixRe];\n } else {\n prefixRe = null;\n }\n }\n\n // Build a regexp to match the abbreviation\n var ch, re = '', chars = abbr.toLowerCase().split('');\n for (i=0; i<abbr.length; i++) {\n ch = abbr.charAt(i).replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, \"\\\\$&\");\n re += '[^' + ch + ']*' + ch;\n }\n if (re) {\n re = new RegExp('^' + re, 'i');\n }\n\n\n var skipped = skippedRE = 0;\n for (i=0, len=items.length; i<len; i++) {\n\n if (cache && cache.test(i)) {\n skipped++;\n continue;\n }\n\n str = items[i];\n\n // At this point we need to check if it needs path expansion\n if (str.charAt(0) === '^') {\n // Look back in the list to find the previous item with a path\n // TODO: Improve this by caching the last found path\n for (j=i-1; j>=0; j--) {\n if (items[j].charAt(0) !== '^') {\n str = items[j].substr(0, items[j].lastIndexOf('/')) + str.substr(1);\n break;\n }\n }\n }\n\n\n // Comparing against regexp is actually much faster than doing it with indexOf\n // We use it just to tell if all the abbr letters are present\n if (re && !re.test(items[i])) {\n skippedRE++;\n newCache && newCache.set(i);\n continue;\n }\n\n // If a prefix was used filter it\t\t\t\n if (prefixRe && !prefixRe.test(items[i])) {\n newCache && newCache.set(i);\n continue;\n }\n\n ranges = [];\n str = items[i].toLowerCase();\n found = true;\n lastIdx = -1;\n for (j=0, len2=abbr.length; j<len2; j++) {\n ch = abbr.charAt(j);\n \n // SLOW DOWN to test a more realistic matcher\n for (var k=0; k<10; k++) {\n str.toLowerCase().indexOf(ch, lastIdx+1);\n }\n \n lastIdx = str.indexOf(ch, lastIdx+1);\n \n if (-1 === lastIdx) {\n found = false;\n break;\n }\n ranges.push(lastIdx);\n }\n \n if (found) {\n result.push({\n value: items[i],\n ranges: ranges\n });\n\n // Fetch at most 1000 items\n // TODO: Should be configurable with an option to disable it\n // TODO: Breaking without doing a full scan means that the cache is not complete!!!\n if (result.length >= 1000) break;\n } else {\n if (newCache) {\n newCache.set(i);\n } else {\n // Update an incomplete cache\n cache.set(i);\n }\n }\n }\n\n d2 = (new Date).getTime();\t\n Titanium.API.debug('SCORE JOB: ' + ((d2-d1)/1000).toFixed(4) + 's Items: ' + result.length + ' Skipped: ' + skipped + ' / ' + skippedRE);\t\n return result;\n };\n}", "function colorLike() {\n setLike(!like);\n }", "search(now, old) {\n return db.drugs.query(`function(doc) {\n if ( ~ doc.name.indexOf('${now}'))\n emit(true)\n }`)\n }", "function match(uiname, uipath) {\n var path = removeMetadata(uipath.slice(1, -1));\n var found = path.indexOf(uiname) >= 0;\n //console.log(`> match(${uiname},${path} [${uipath}]) -> ${found}`);\n return found;\n}", "async likeASymbol ( symbol, ip ) {\n const likes = await this.getLikes( symbol, ip );\n if ( likes ) return false;\n \n const update = await this.Likes.update(\n { symbol },\n {\n $push : { IPs : ip },\n $inc : { likes : 1 }\n },\n { upsert: true }\n );\n return update;\n }", "function likeVsLikes(toyLikeCount){\n\t\tif (toyLikeCount == 1){\n\t\t\treturn 'Like';\n\t\t} else {\n\t\t\treturn 'Likes';\n\t\t}\n\t}", "async checkIsSpilloverHasStatus(bucket_name, status) {\n console.log('Checking for spillover status ' + status + ' for bucket ' + bucket_name);\n try {\n const system_info = await this._client.system.read_system({});\n const buckets = system_info.buckets;\n const indexBucket = buckets.findIndex(values => values.name === bucket_name);\n const spilloverPool = system_info.buckets[indexBucket].spillover;\n if ((status) && (spilloverPool !== null)) {\n console.log('Spillover for bucket ' + bucket_name + ' enabled and uses ' + spilloverPool);\n } else if ((!status) && (spilloverPool === null)) {\n console.log('Spillover for bucket ' + bucket_name + ' disabled ');\n }\n } catch (err) {\n console.log('Failed to check spillover for bucket ' + bucket_name + err);\n throw err;\n }\n }", "async handleTextSearch(evento) {\n const search = evento.target.value;\n const res = await api.get(\n `${process.env.REACT_APP_BASE_URL}?${\n this.isChecked ? `tags_like=${search}` : `q=${search}`\n }`\n );\n this.setState({\n notes: res.data,\n });\n console.log(\"search\", res.data);\n }", "function vaksinHalal(agent) {\n return connectToDatabase().then((connection) => {\n return queryDatabase(connection).then((result) => {\n console.log(result);\n if (result.length === 0) {\n agent.add(\"kata-kunci tidak ditemukan di basis-data\");\n }\n result.map((content) => {\n if (keywords === content.keyword) {\n agent.add(`${content.results}`);\n }\n });\n connection.end();\n });\n });\n }", "handleSearch(e) {\n e.persist();\n // eslint-disable-next-line\n for (let key in this.state.addons) {\n if (!key.includes(e.target.value.toLowerCase())) {\n this.setState(prevState => ({\n addons: {\n ...prevState.addons,\n [key]: false\n }\n }));\n } else {\n this.setState(prevState => ({\n addons: {\n ...prevState.addons,\n [key]: true\n }\n }));\n }\n }\n }", "function addLikes() {\n if (propLike?.includes(user.username)) {\n let index = propLike.indexOf(user.username);\n let removeLike = [\n ...propLike.slice(0, index),\n ...propLike.slice(index + 1),\n ];\n setLikeGet(removeLike);\n setPropLike(removeLike);\n setRedLike(\"\");\n\n addToLike(eventid, removeLike);\n } else {\n let likesArr = [...propLike, `${user.username}`];\n\n setLikeGet(likesArr);\n setPropLike(likesArr);\n setRedLike(\"red\");\n addToLike(eventid, likesArr);\n }\n }", "function LK_likeIt(elem) {\n var likeGroup = elem.getAttribute(LK_LIKEGROUP);\n var likeValue = elem.getAttribute(LK_LIKEVALUE);\n localStorage[likeGroup] = likeValue;\n\n // Change the style of the liker nodes\n var siblings = elem.parentNode.childNodes;\n for (var i = 0; i < siblings.length; i++) {\n if (siblings[i].style) { \n LK_applyNormalStyle(siblings[i]);\n }\n }\n LK_applySelectedStyle(elem, likeValue);\n\n // Change the value of any mini likers\n var allSpans = document.getElementsByTagName('span');\n for (var i = 0; i < allSpans.length; i++) {\n var span = allSpans[i];\n if (span.getAttribute(LK_LIKEGROUP) == likeGroup) {\n if (span.getAttribute(LK_LIKETYPE) == 'mini') {\n span.innerHTML = LK_MAPPINGS[likeValue].label;\n LK_applySelectedStyle(allSpans[i], likeValue);\n }\n }\n }\n}", "function checkDescription(item) {\n return item.description.toLowerCase().includes(searchTerm.toLowerCase()) // Make it case insensitive\n }", "function buscar(arg){\n\tquery = \"SELECT * FROM tabla WHERE nombre LIKE '%\"+arg+\"%' OR apellido LIKE '%\"+arg+\"%'\";\n\tloadData(query);\n}", "function BOT_wordIsPer(word,i) {\r\n\tif(i == 0 && BOT_member(BOT_commandList,word)) return(true) \r\n\treturn (false)\r\n}", "function lookup(i) {\n if(i<words.length){\n var wrd = words[i].replace(/[\\.,-\\/#!$%\\^&\\*;:{}=\\-_`~()\\\"\\']/g,\"\"),\n stem = wrd.stem();\n console.log(\"\\n=====================\\nLooking up: \"+ words[i] + \" -> \"+wrd+ \" -> \"+stem);\n wordnet.lookup(wrd, function(results) {\n var trueCount = 0;\n results.forEach(function(result) {\n if(result.pos===\"a\" || result.pos===\"s\" || result.pos===\"r\") {\n trueCount++;\n console.log(\"true: \" + trueCount + \" times\");\n } \n //More checks for importance here!\n });\n if(trueCount/results.length>0.7){\n //marked=true;\n console.log(\"True percentage: \"+trueCount/results.length);\n console.log(\"- Very likely an Adj or Adv\");\n resultStr+=' <span class=\"unimportant1\" style=\"color:#dedede\"> '+words[i]+'</span>';\n } \n else if(trueCount/results.length>0.49){\n //marked=true;\n console.log(\"True percentage: \"+trueCount/results.length);\n console.log(\"- Possibly an Adj or Adv\");\n resultStr+=' <span class=\"unimportant2\" style=\"color:#999\"> '+words[i]+'</span>';\n }\n else {\n console.log(\"- Possibly not an Adj or Adv\");\n resultStr+=' '+words[i];\n }\n lookup(i+1);\n });\n } else {\n connection.sendUTF(resultStr);\n }\n \n }", "_search() {\n console.log(\"Not found\");\n }", "logHealthcheck() {\n (async () => {\n await module.exports.checkPg();\n module.exports.calcUptime();\n lumServer.logger.info('healthcheck', lumServer.healthcheck);\n })();\n }", "function shortURLExists(shorturl) {\n if (urlDatabase[shorturl]) return true;\n else return false;\n}", "function $wildcard() {\n return { \n type: 'wildcard',\n pattern: '*'\n };\n}", "checkAvailability() {\n var self = this;\n this.attachTimeout(new Promise((resolve) => {\n this.cache.randomkey((error) => {\n if (_.isNull(error) === false) {\n throw error;\n }\n self._isReachable = true;\n resolve(true);\n });\n }));\n }", "function test_bottleneck_cluster() {}", "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 searchByProduceName(searchTerm) {\n knexInstance\n .select('product_id', 'name', 'price', 'category')\n .from('amazong_products')\n .where('name', 'ILIKE', `%${searchTerm}%`)\n .then(result => {\n console.log(result)\n });\n}", "function namestatus(){}", "_searchChanged(term,oldTerm){// only load up the lunr source data once they have 3 or more characters\nif(3<=term.length&&typeof this.dataSource===typeof void 0){this.dataSource=\"lunrSearchIndex.json\"}}", "'*=' ({ attr, value, insensitive }) {\n return attr.includes(value)\n }", "\"wikiexplore\"(term) {\n check(term, String);\n console.log(\"backend: searching \" + term);\n return new Promise((resolve, reject) => {\n wikipedia.page.data(term, { content: true }, resolve);\n });\n }", "getKeyword(req, res, next) {\n const limit = config_1.config.response_limit;\n const { keyword } = req.query;\n list\n .find({ keyword: { $regex: keyword }, isVerified: 1 })\n .limit(8)\n .then(user => {\n const count = user.length;\n if (count === 0) {\n res.send({\n message: 'Result Not Found',\n code: 404\n });\n }\n else {\n res.send({\n status: \"Ok\",\n message: \"Fetch KeyWord succesfully\",\n data: {\n user\n },\n count\n });\n }\n })\n .catch(err => {\n res.send({\n code: 403,\n Error: err\n });\n });\n }", "function suggestNames(username) {\n // If there are any groups of non-digit characters, use that as a key phrase, otherwise check\n // for groups of numbers. From Hillary2016 we can have two key phrases [\"hillary\", \"2016\"].\n\t\tvar wordMatch = username.match(/[a-zA-Z]+/),\n \t\tnumberMatch = username.match(/\\d+/),\n \tsuggestions = [];\n \n \tif (wordMatch) {\n for (var i = 0; i < CHGLIB.length; i++) {\n suggestion1 = CHGLIB[i] + wordMatch + Math.floor((Math.random() * 9999) + 1000);\n suggestion2 = wordMatch + CHGLIB[i] + Math.floor((Math.random() * 9999) + 1000);\n\t\t\t\t\tsuggestions.push(suggestion1, suggestion2);\n }\n }\n \n if (numberMatch) {\n for (var i = 0; i < CHGLIB.length; i++) {\n suggestion1 = CHGLIB[i] + numberMatch + numberMatch;\n suggestion2 = numberMatch + CHGLIB[i] + Math.floor((Math.random() * 9999) + 1000);\n\t\t\t\t\tsuggestions.push(suggestion1, suggestion2);\n }\n }\n \n // now check all the suggestions availability\n var params = suggestions.join(\",\");\n checkAvail(params, function(response) {\n \tvar taken = [];\n \tif (!$.isEmptyObject(response) && response.length != 0) {\n // go thru response and make array of usernames\n for (var i = 0; i < response.length; i++) {\n \ttaken.push(response[i].username);\n }\n // compare what we know is taken from our list of suggestions\n var available = suggestions.diff(taken);\n if (available.length > 2) { // we want at least 3 here\n \tchgAlert(\"That username is not available. How about one of these:\" + available[0] + \",\" + available[1] + \",\" + available[2], \"error\");\n return;\n }\n \n // if we don't have enough to make 3 suggestions, do it again\n if (available.length < 3) {\n \tsuggestions = [];\n \tsuggestNames(username);\n }\n \n return;\n }\n \n chgAlert(\"That username is not available. How about one of these:\" + suggestions[0] + \",\" + suggestions[1] + \",\" + suggestions[2], \"error\");\n });\n }", "function judgeByPartialMatch(word, query, queryStartWithUpper) {\n var _a, _b;\n if (query === \"\") {\n return {\n word: Object.assign(Object.assign({}, word), { hit: word.value }),\n value: word.value,\n alias: false,\n };\n }\n if (lowerStartsWith(word.value, query)) {\n if (queryStartWithUpper &&\n word.type !== \"internalLink\" &&\n word.type !== \"frontMatter\") {\n const c = capitalizeFirstLetter(word.value);\n return { word: Object.assign(Object.assign({}, word), { value: c, hit: c }), value: c, alias: false };\n }\n else {\n return {\n word: Object.assign(Object.assign({}, word), { hit: word.value }),\n value: word.value,\n alias: false,\n };\n }\n }\n const matchedAliasStarts = (_a = word.aliases) === null || _a === void 0 ? void 0 : _a.find((a) => lowerStartsWith(a, query));\n if (matchedAliasStarts) {\n return {\n word: Object.assign(Object.assign({}, word), { hit: matchedAliasStarts }),\n value: matchedAliasStarts,\n alias: true,\n };\n }\n if (lowerIncludes(word.value, query)) {\n return {\n word: Object.assign(Object.assign({}, word), { hit: word.value }),\n value: word.value,\n alias: false,\n };\n }\n const matchedAliasIncluded = (_b = word.aliases) === null || _b === void 0 ? void 0 : _b.find((a) => lowerIncludes(a, query));\n if (matchedAliasIncluded) {\n return {\n word: Object.assign(Object.assign({}, word), { hit: matchedAliasIncluded }),\n value: matchedAliasIncluded,\n alias: true,\n };\n }\n return { word: word, alias: false };\n}", "function search_algo(f, term) {\r\n var mach = 0;\r\n var srch = searchEntities(term);\r\n var name = searchEntities(f.name);\r\n _.each(srch, function (s) {\r\n s = jQuery.trim(s)\r\n _.each(name, function (n) {\r\n n = jQuery.trim(n)\r\n if (n.indexOf(s) != -1) {mach++;}\r\n if (n.indexOf(s) === 0) {mach++;}\r\n if (n == s) {mach++;}\r\n if (f.id == s) {mach += 2;}\r\n });\r\n });\r\n if (mach > 0 && !f.server) mach++;\r\n return mach;\r\n}", "async function _prefixHandle(msg, jerry) {\n //test for dev prefix and authorized user\n if ((config.owners.includes(msg.author.id)) && (msg.content.startsWith(config.devPrefix))) {\n const args = msg.content.split(\" \").slice(1);\n const cmdLabelar = msg.content.split(\" \").slice(0, 1);\n const label = cmdLabelar[0].slice(config.devPrefix.length).toLowerCase();\n return [\"dev\", label, args];\n }\n //test for a guild's normal prefix\n if (msg.content.startsWith(config.prefix)) {\n const args = msg.content.split(\" \").slice(3);\n const cmdLabelar = msg.content.split(\" \").slice(2, 3);\n const label = cmdLabelar[0].trim().toLowerCase();\n return [\"normal\", label, args];\n }\n //test for mention prefix\n let contentClean = msg.content.replace(/<@!/g, \"<@\");\n if (contentClean.startsWith(jerry.user.mention)) {\n const args = msg.content.split(\" \").slice(2);\n const cmdLabelar = contentClean.split(\" \").slice(1, 2);\n const label = cmdLabelar[0].trim().toLowerCase();\n return [\"normal\", label, args];\n }\n //no command prefix found, so no command will be checked for\n return [\"none\", null, null];\n}", "searchBicycles(category, value, success) {\n connection.query(\n 'SELECT * FROM Bicycles inner join HomeLocation on HomeLocation.BicycleID = Bicycles.BicycleID inner join CurrentLocation on CurrentLocation.BicycleId = Bicycles.BicycleID WHERE ' +\n category +\n ' LIKE ' +\n \"'\" +\n value +\n \"'\",\n [category, value],\n (error, results) => {\n if (error) return console.error(error);\n\n success(results);\n }\n );\n }", "satisfied() { return false; }", "function handleQuery(){var searchText=$scope.searchText||'';var term=searchText.toLowerCase();// If caching is enabled and the current searchText is stored in the cache\n\tif(!$scope.noCache&&cache[term]){// The results should be handled as same as a normal un-cached request does.\n\thandleResults(cache[term]);}else{fetchResults(searchText);}ctrl.hidden=shouldHide();}", "function ScanForContests(){\t\n\tscanContestsInterval = setTimeout(ScanForContests, config['scan_update_time']*1000);\n\n\tif (ratelimit_search[2] >= config['min_ratelimit_search']){\n\n\t\tfor (var search_query of config['search_queries']){\n\t\t\tTwitter.get('search/tweets', {'q':search_query, 'result_type':'recent', 'count':100, 'lang': 'en'}, function(err, data, response) {\n\t\t\t\tif (err) {\t\n\t\t\t\t\tconsole.log(\"Search error: \" + err);\n\t\t\t\t} else {\n\t\t\t\t\tfor(var tweet of data.statuses){\n\t\t\t\t\t\tvar tweet_id = tweet['id_str'];\n\t\t\t\t \t\tvar original_id;\n\t\t\t\t \t\tvar screen_name = tweet['user']['screen_name'];\n\n\t\t\t\t\t\tif(tweet.hasOwnProperty('retweeted_status')){\n\t\t\t\t \t\t\toriginal_id = tweet['retweeted_status']['id_str'];\n\t\t\t\t \t\t} else if (tweet['in_reply_to_status_id_str'] != null) {\n\t\t\t\t \t\t\toriginal_id = tweet['in_reply_to_status_id_str'];\n\t\t\t\t \t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(ignore_list.indexOf(tweet_id) < 0 && ignore_list.indexOf(original_id) < 0 && ignore_list.indexOf(screen_name) < 0) {\n\t\t\t\t\t\t\tvar no_ignore_keyword = true;\n\t\t\t\t\t\t\tvar no_ignore_screen_name = true;\n\n\t\t\t\t\t\t\tfor (let ignore_keyword of ignore_keywords){\n\t\t\t\t\t\t\t\tif(tweet['text'].toLowerCase().indexOf(ignore_keyword) >= 0) no_ignore_keyword = false;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tfor (let ignore_screen_name of config['ignore_screen_names']){\n\t\t\t\t\t\t\t\tif(tweet['user']['name'].toLowerCase().indexOf(ignore_screen_name) >= 0) no_ignore_screen_name = false;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (no_ignore_keyword && no_ignore_screen_name){\n\t\t\t\t\t\t\t\tpost_list.push(tweet);\n\t\t\t\t\t \t\t\taddToIgnoreList(tweet_id);\n\t\t\t\t\t \t\t\taddToIgnoreList(original_id);\n\t\t\t\t\t \t\t\taddToIgnoreList(screen_name);\n\t\t\t\t \t\t\t}\n\t\t\t\t \t\t} \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t}\n}", "function notfound() {\n\tOutput('<span>command not found</span></br>');\n}", "function aliasGetHint(data,callback){\n gun.get(data.alias).once(function(data, key){\n //console.log(data);\n if(data){\n if(data.hint){\n console.log('FOUND HINT');\n callback(data.hint);\n }else{\n console.log('FAIL HINT');\n callback('FAIL');\n }\n }else{\n callback('FAIL');\n }\n });\n}", "async function isLiked(rec_id) {\n const response = await axios.get(`/meals/${rec_id}/check-if-like`);\n // const response = await axios.get(`/meals/${rec_id}/check-if-like`);\n\n if (response.data.result === \"like\") {\n return true;\n }\n else {\n return false;\n }\n }", "isUsernameAvailable(callback) {\n var self = this;\n \n var sql = \"SELECT 1 FROM user WHERE username = ?\";\n pool.getConnection(function(con_err, con) {\n if(con_err) {\n console.log(\"Error - \" + Date() + \"\\nUnable to connect to database.\");\n callback(con_err);\n return;\n }\n \n con.query(sql, [self.username], function (err, result) {\n if (err) {\n console.log('Error encountered on ' + Date());\n console.log(err);\n callback(null, false);\n con.release();\n return;\n } \n \n if(result.length == 0) \n callback(null, true);\n else\n callback(null, false);\n \n \n con.release();\n });\n });\n }", "async search() {\n this.mixpanelTrack(\"Discover Stax Search Started\");\n if(this.state.catgorychoosen==Strings.discover_category_home)\n { \n await this.catWisestax(this.state.searchquery);\n }\n else\n { \n await this.categoryselected(\"\", this.state.catgorychoosen)\n }\n }", "like() {\r\n return this.clone(Item, \"like\").postCore();\r\n }", "function handleQuery () {\n var searchText = $scope.searchText,\n term = searchText.toLowerCase();\n //-- if results are cached, pull in cached results\n if (!$scope.noCache && cache[ term ]) {\n ctrl.matches = cache[ term ];\n updateMessages();\n } else {\n fetchResults(searchText);\n }\n\n ctrl.hidden = shouldHide();\n }", "function pengembanganVaksin(agent) {\n return connectToDatabase().then((connection) => {\n return queryDatabase(connection).then((result) => {\n console.log(result);\n if (result.length === 0) {\n agent.add(\"kata-kunci tidak ditemukan di basis-data\");\n }\n result.map((content) => {\n if (keywords === content.keyword) {\n agent.add(`${content.results}`);\n }\n });\n connection.end();\n });\n });\n }", "checkTopStoriesSearchTerm(searchTerm){\n return !this.state.results[searchTerm];\n }", "function checkEtcHost() {\r\n page.onResourceRequested = function(requestData, networkRequest) {\r\n var pattern = /https?:\\/\\/(.+)\\.ey\\.sandcats\\.io/;\r\n var match = pattern.exec(requestData.url);\r\n if (match !== null && match[1]) {\r\n if (config(WILDCARD_DOMAIN_PREFIX + match[1]) === undefined) {\r\n if (fs.isFile('/etc/hosts')) {\r\n var hosts = fs.open('/etc/hosts', 'r');\r\n var current = hosts.read();\r\n hosts.close();\r\n if (current.indexOf(match[1] + \".ey.sandcats.io\") < 0) {\r\n // append\r\n var ahosts = fs.open('/etc/hosts', 'a');\r\n if (current[current.length - 1] != '\\n') {\r\n ahosts.write('\\n');\r\n }\r\n ahosts.write('10.20.124.1\\t' + match[1] + '.ey.sandcats.io' + '\\n');\r\n ahosts.close();\r\n }\r\n config(WILDCARD_DOMAIN_PREFIX + match[1], true);\r\n }\r\n }\r\n }\r\n };\r\n}", "function search(term) {\n RtThisRun = 0\n console.log('Search: ' + JSON.stringify(term));\n T.get('search/tweets', { q: term, count: 10 }, function(err, reply) {\n if (err) {\n return err;\n }\n \n var tweets = reply.statuses;\n tweets.forEach(function(o) { checkStatus(o) });\n });\n}", "function searchUser(name) {\n\n if (system.searched.indexOf(name) === -1 || settings.tag_only) {\n searching = name;\n\n loadMore()\n }\n\n if (system.searched.indexOf(name) != -1 && !settings.tag_only) {\n system.searchingUsers = false;\n searchUsers()\n }\n }", "function mapMEStatusName(statusName) {\r\n\tif (statusName.indexOf('internal') >= 0) return ('onhdd');\r\n\telse if (statusName.indexOf('external') >= 0) return ('oncd');\r\n\telse if (statusName.indexOf('deleted') >= 0) return ('deleted');\r\n\telse if (statusName.indexOf('unknown') >= 0) return (\"unknown\");\r\n\telse if (statusName.indexOf('mixed') >= 0) return (\"mixed\");\r\n}", "function search(command, query) {\n if (command === \"concert-this\") {\n searchBand(query);\n }\n //song search\n else if (command === \"spotify-this-song\") {\n //no song provided. defaulting to \"The Sign\" by Ace of Base\n if (query === undefined) {\n query = \"The Sign\";\n }\n searchSong(query);\n }\n //movie search\n else if (command === \"movie-this\") {\n //no movie provided. defaulting to \"Mr Nobody\"\n if (query === undefined) {\n query = \"Mr Nobody\";\n }\n searchMovie(query);\n }\n //command not recognized\n else {\n console.log(\"command not recognized\");\n }\n}", "async likePost(_, { postId }, context) {\n const { username } = checkAuth(context)\n const post = await findPost(postId)\n\n const userLiked = username => like => like.username === username\n const likeOrUnlike = R.ifElse(\n R.find(userLiked(username)), // Condition\n R.reject(userLiked(username)), // onTrue\n R.append({ username }) // onFalse\n )\n\n post.likes = likeOrUnlike(post.likes)\n return formatPost(await post.save())\n }", "function kandunganVaksin(agent) {\n return connectToDatabase().then((connection) => {\n return queryDatabase(connection).then((result) => {\n console.log(result);\n if (result.length === 0) {\n agent.add(\"kata-kunci tidak ditemukan di basis-data\");\n }\n result.map((content) => {\n if (keywords === content.keyword) {\n agent.add(`${content.results}`);\n }\n });\n connection.end();\n });\n });\n }", "function executeAdminStackSearch(searchObject, callback) {\n var sql = \"\";\n\n if (searchObject.datasource.toLowerCase() === \"custom\" && typeof searchObject.customid !== \"undefined\"){\n\n sql = buildAdminStackCustomQuery(searchObject.customid, searchObject.stackid, searchObject.adminlevel, searchObject.returnGeometry, searchObject.datasource);\n common.log(sql);\n\n common.executePgQuery(sql, callback);\n }\n //See if this is a spatial (WKT) search or not\n else if (searchObject.isSpatial == false) {\n //lookup by id, datasource and level\n //build sql query\n sql = buildAdminStackQuery(searchObject.stackid, searchObject.datasource, searchObject.adminlevel, searchObject.returnGeometry);\n common.log(sql);\n\n //run it\n common.executePgQuery(sql, callback);\n }\n else {\n //do a spatial search\n\n //If user specifies admin level, then use that to start with, otherwise, start with the lowest level for that datasource\n var adminLevel = 2;\n\n if (searchObject.adminlevel) {\n //use user's level\n adminLevel = searchObject.adminlevel;\n }\n else {\n //use a specified level\n adminLevel = settings.dsLevels[searchObject.datasource.toLowerCase()];\n }\n\n common.log(adminLevel);\n\n //Admin level will be passed in iteratively until we find a match.\n function hitTest(level) {\n if (level >= 0) {\n //Do Hit Test, starting with lowest available admin level\n common.log(\"In hit test loop. checking level \" + level);\n sql = buildAdminStackSpatialQuery(searchObject.wkt, searchObject.datasource, level, searchObject.returnGeometry);\n common.executePgQuery(sql, function (err, result) {\n if (err) {\n //continue searching\n hitTest(level - 1);\n }\n else {\n //we found a match, break out.\n if (result.rows.length > 0) {\n callback(err, result);\n return;\n }\n else {\n //continue searching\n hitTest(level - 1);\n }\n }\n });\n }\n else {\n //We've hit the end of the road\n common.log(\"checked all levels for \" + searchObject.wkt + \", found nothing.\");\n callback(null, { rows: [], status: \"success\" });\n }\n }\n\n //initiate loop\n hitTest(adminLevel);\n }\n }", "function autoSearchNFix() {\r\n\t\tvar args = autoPlgCmdFix.apply(this, arguments); \r\n\t\tif ( args[args.length - 1] === 'and' || args[args.length - 1] === 'or' ) {\r\n\t\t\tif ( typeof args[args.length - 2] == \"number\" ) {\r\n\t\t\t\targs.splice(args.length - 1, 0, 'S0', true);\r\n\t\t\t} else if ( /S\\d+/.test(args[args.length - 2]) || Array.isArray(args[args.length - 2]) ) {\r\n\t\t\t\targs.splice(args.length - 1, 0, true);\r\n\t\t\t} else if ( !args.some( function( arg ) { return typeof arg === 'number' } ) ) {\r\n\t\t\t\targs.splice(args.length - 1, 0, 0, 0, 'S0', true);\r\n\t\t\t}\r\n\t\t} else if ( typeof args[args.length - 1] === \"string\" || ( Array.isArray(args[args.length - 1]) && typeof args[args.length - 1][0] === \"string\" ) || typeof args[args.length - 1] === \"boolean\" ) {\r\n\t\t\tif ( ( /S\\d+/.test(args[args.length - 1]) || Array.isArray(args[args.length - 1]) ) && args.some( function( arg ) { return typeof arg === 'number' } ) ) { // ('Tom'*, 1, 2, 'S0')\r\n\t\t\t\targs.push(true);\r\n\t\t\t\targs.push('or');\r\n\t\t\t} else if ( typeof args[args.length - 2] == \"number\" ) { // ('Tom'*, 1, 2, 'cond')\r\n\t\t\t\targs.splice(args.length - 1, 0, \"S0\");\r\n\t\t\t\targs.push('or');\r\n\t\t\t} else if ( !args.some( function( arg ) { return typeof arg === 'number' } ) ) { // ('Tom'*)\r\n\t\t\t\targs.push(0);\r\n\t\t\t\targs.push(0);\r\n\t\t\t\targs.push(\"S0\");\r\n\t\t\t\targs.push(true);\r\n\t\t\t\targs.push('or');\r\n\t\t\t} else {\r\n\t\t\t\targs.push('or');\r\n\t\t\t}\t\t\t\t\r\n\t\t} else { // ('Tom'*, 1, 2)\r\n\t\t\targs.push(\"S0\");\r\n\t\t\targs.push(true);\r\n\t\t\targs.push('or');\r\n\t\t};\r\n\t\treturn args;\r\n\t}", "function handleQuery () {\n var searchText = $scope.searchText || '',\n term = searchText.toLowerCase();\n //-- if results are cached, pull in cached results\n if (!$scope.noCache && cache[ term ]) {\n ctrl.matches = cache[ term ];\n updateMessages();\n } else {\n fetchResults(searchText);\n }\n\n ctrl.hidden = shouldHide();\n }", "function oob_system(){\n\t\ntest_find_conflict();\n}//end function oob_system", "function cursorCheck(str) {\n let result = str.search(new RegExp('ostap|cursor|ironman', 'i'));\n access = (result > 0) ? true : false; \n return access;\n}", "function containsStr1 (string) {\n \t\tif(string.indexOf('offline') > -1) {\n \t\t\treturn true;\n \t\t} else {\n \t\t\treturn false;\n \t\t}\n }", "function handleLikes() {\n // Get a random number\n let randomNumber = Math.random();\n // To make it unpredictable, only change the likes if =>\n if (randomNumber < REVEAL_PROBABILITY) {\n defineLikes();\n }\n}", "static async isRegisteredUsername(username) {\n let res = await db.query('SELECT * FROM users WHERE username = $1', [username]);\n return res.rowCount > 0;\n }", "function match(query, entry) {\n\n // all words must match\n for (var i = 0; i < query.length; ++i) {\n if (!matchWord(query[i], entry)) {\n return false;\n }\n }\n return true;\n }", "getServerPODs(){\n let vk = 'vk-' + this.props.foreignCluster.status.outgoing[\"remote-peering-request-name\"];\n this.state.incomingPods = this.props.incomingPods.filter(po => {\n try {\n return po.metadata.annotations.home_nodename === vk\n }catch{return false}\n })\n }", "function searchRecom() {\n\t// store keyword in localSession\n\twindow.localStorage.setItem('kw', keyWord);\n\t// Fuse options\t\t\t\t\n\tvar options = {\n\t\tshouldSort: true,\n\t\ttokenize: true,\n\t\tthreshold: 0.2,\n\t\tlocation: 0,\n\t\tdistance: 100,\n\t\tincludeScore: true,\n\t\tmaxPatternLength: 32,\n\t\tminMatchCharLength: 2,\n\t\tkeys: [\"title.recommendation_en\",\n\t\t\t \"title.title_recommendation_en\",\n\t\t\t \"topic.topic_en\"]\n\t};\n\t//Fuse search\n\tvar fuse = new Fuse(recommends, options); //https://fusejs.io/\n\tconst results = fuse.search(keyWord);\n\treturn results;\n}", "pingCheck(pc, idPC) {\r\n let ip = pc.lanIP;\r\n let hostAddress = ip;\r\n if (hostAddress === G.THIS_PC.lanInterface.ip_address) {\r\n hostAddress = '127.0.0.1'; //self scan specific\r\n //20171018 Ping('localhost') doesnt work with the ping-bluebird nodejs package on windows10\r\n }\r\n return new Promise(function (resolve) {\r\n Ping(hostAddress, {timeout: 4})\r\n .catch(function (res) {\r\n //required to resolve(finalResult) after ping fail\r\n }).then(function (res) {\r\n let finalResult = {\r\n idPC: idPC,\r\n lanIP: ip,\r\n 'respondsTo-ping': res.alive\r\n };\r\n //res.time non supporte par npm package ping-bluebird\r\n if (finalResult[\"respondsTo-ping\"]) {\r\n //add lastResponse (already in F.checkData() for httpCheck and socketCheck)\r\n finalResult.lastResponse = new Date().toISOString();\r\n }\r\n resolve(finalResult);\r\n });\r\n });\r\n }", "async function searchSongs(term) {\n try {\n const response = await fetch(`${apiURL}/suggest/${term}`);\n const data = await response.json();\n\n // to display data\n showData(data);\n } catch (err) {\n console.error(err.message);\n }\n}", "function test_bottleneck_provider() {}", "function respondUsage(bot, message) {\n bot.reply(message, {\n type: \"typing\"\n });\n\n bot.reply(message, bot.i18n.__({phrase:'connect_command_respond_usage', locale:message.haystack_locale}));\n }", "function search(hymnal, query) {\n\n var ranks = new Array();\n for(var i = 0; i < hymnal.length; i++) {\n ranks.push({hymn: hymnal[i], rank: 0});\n }\n\n if(category !== null) ranks = ranks.filter(isC);\n if(subcategory !== null) ranks = ranks.filter(isS);\n\n // Similarity Check. 70%\n // var wt = 0.7; var wt1 = 0.8 * wt; var wt2 = 0.2 * wt; // Number or Title: 80% (56%)\n for(var i = 0; i < ranks.length; i++) {\n var numberRank = (compare(query, ranks[i].hymn.number)) * 0.7;\n var titleRank = (compare(query.toLowerCase().removeDiacritics().removePunctutation(), ranks[i].hymn.name.toLowerCase().removeDiacritics().removePunctutation())) * 0.7;\n ranks[i].rank += (numberRank > titleRank) ? numberRank : titleRank;\n }\n // Content: 20% (14%)\n // Not computed \"on the fly\" to save memory, should be indexed\n\n // Overall Popularity. 20%\n var freq;\n if(database)\n for(var i = 0; i < ranks.length; i++) {\n if(freq = database[loaded_hymnal_id][ranks[i].hymn.number]) {\n ranks[i].rank += f2(freq)/2;\n // log(`hymn ${ranks[i].hymn.number} freq ${freq} weight ${f2(freq)}`)\n }\n }\n\n // History. 10%\n var str = getLocalStorageKey(\"history\");\n if(str) {\n var obj = JSON.parse(str)\n if(obj) {\n var list = obj[loaded_hymnal_id];\n if(list) {\n var occurences = {};\n for(var j = 0; j < list.length; j++) {\n if(!occurences[list[j]]) occurences[list[j]] = 0;\n occurences[list[j]]++;\n }\n var times = 0;\n for(var i = 0; i < ranks.length; i++) {\n if(times = occurences[ranks[i].hymn.number]) ranks[i].rank += f1(times);\n }\n // log(occurences)\n }\n }\n }\n\n // Last Category. 10%\n if(lastHymn && (lastHymn.category || lastHymn.subcategory)) {\n if(lastHymn.category)\n var similar = ranks.filter(function(elem) {return elem.hymn.category == lastHymn.category;})\n if(lastHymn.subcategory)\n var similar = ranks.filter(function(elem) {return elem.hymn.subcategory == lastHymn.subcategory;})\n\n for(var entry of similar)\n entry.rank += 10;\n // log('similar');\n // log(similar.map(function(e) {return `${e.hymn.subcategory || e.hymn.category} ${e.hymn.number} ${e.hymn.name}`}));\n } else {\n for(var entry in ranks)\n entry.rank += 10;\n }\n\n ranks.sort(compareRanks);\n\n var maxResults = 5;\n ranks = ranks.slice(0, maxResults);\n\n // log(ranks.filter(weakRanks).map(function(e) {return `${e.rank} ${e.hymn.name}`}));\n\n return ranks.filter(weakRanks);\n}" ]
[ "0.6668786", "0.6520516", "0.54066104", "0.5209519", "0.51465327", "0.49282894", "0.47131824", "0.46957508", "0.46890873", "0.46882218", "0.46877024", "0.4685029", "0.46770513", "0.46724275", "0.46634877", "0.46395558", "0.4604136", "0.4587301", "0.45797825", "0.4569413", "0.45628226", "0.45586097", "0.45291123", "0.4495315", "0.4494325", "0.44873527", "0.4479824", "0.44719815", "0.4469538", "0.44474873", "0.44457686", "0.4443943", "0.44394517", "0.4431181", "0.442469", "0.44039628", "0.4400182", "0.43953323", "0.43914333", "0.43866038", "0.4380494", "0.4380371", "0.43719622", "0.43674928", "0.43629423", "0.4353606", "0.43520707", "0.43517584", "0.43491524", "0.43489152", "0.4348721", "0.4346491", "0.4343331", "0.43396163", "0.4336912", "0.4335973", "0.43301418", "0.43273458", "0.43238485", "0.4323152", "0.43226287", "0.43204904", "0.43199965", "0.43070468", "0.43019858", "0.43011492", "0.4300483", "0.42998463", "0.42992926", "0.42947194", "0.429271", "0.42902434", "0.42864054", "0.4281785", "0.42808145", "0.42785296", "0.42775533", "0.42727104", "0.42710555", "0.42689085", "0.42674294", "0.42644548", "0.42612213", "0.42605507", "0.42570168", "0.42550287", "0.4253231", "0.42495474", "0.42484853", "0.4246809", "0.4239856", "0.42379168", "0.42367488", "0.42351976", "0.42344728", "0.4230642", "0.4227028", "0.422519", "0.42248052", "0.42240912", "0.42171863" ]
0.0
-1
import Video from "./SaranyuPlayer/Video";
function App() { return ( <span> {/* <VideoPlayer src="https://www.learningcontainer.com/wp-content/uploads/2020/05/sample-mp4-file.mp4" /> */} <SaranyuVideoPlayer /> {/* <Video /> */} </span> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function VideoPlayer(){}", "function onPlayerReady(event) {\n //event.target.playVideo();\n}", "function onPlayerReady(event) {\n //event.target.playVideo();\n}", "function onPlayerReady(event) {\r\n //event.target.playVideo();\r\n}", "function onPlayerReady(event) {\nevent.target.playVideo();\n}", "render() {\n return (\n\n <div className=\"container is-fluid\">\n\n <div className=\"video-container\">\n\n\t\t <video id=\"video\" preload=\"true\" autoPlay loop muted style={style.video}></video>\n </div>\n\n\n\n </div>\n\n\n\n )\n }", "function Player(){\n return(\n <div id=\"embeddedPlayer\"><EmbeddedPlayer url=\"https://www.youtube.com/watch?v=GO5FwsblpT8\" controls={true} /></div>\n );\n}", "function InteractiveVideo(props) {\n const { src, alt } = props;\n\n return (\n <Player playsInline poster=\"/assets/poster.png\" src=\"/static/video/HT-Campaign.mp4\">\n <ControlBar autoHide={false} className=\"my-class\" />\n </Player>\n );\n}", "function onPlayerReady(event) {\n // event.target.playVideo();\n}", "function onPlayerReady(event) {\n // event.target.playVideo();\n}", "render(){\n return(\n <video width=\"300\" height=\"300\" >\n\n </video>\n\n\n )\n }", "function onPlayerReady(event) {\n event.target.playVideo();\n }", "function onPlayerReady(event) {\n // event.target.playVideo();\n }", "function onPlayerReady(event) {\n\t//event.target.playVideo();\n}", "isVideoTrack() {\n return this.getType() === _service_RTC_MediaType__WEBPACK_IMPORTED_MODULE_3__[\"VIDEO\"];\n }", "function onPlayerReady (event) {\n event.target.playVideo()\n}", "function onPlayerReady(event) {\n console.log(\"GO Video\");\n // event.target.playVideo();\n}", "componentDidMount() {\n let self = this;\n let videoDiv = document.getElementById(this.props.id);\n let player = new Clappr.Player({\n source: self.props.liveurl,\n height: 360,\n width: 640\n });\n player.attachTo(videoDiv);\n }", "function importPlayer() {\n PlayerDao = require('../../app/player/PlayerDao');\n }", "function onPlayerReady(event) { \n //event.target.playVideo();\n detenerVideo();\n}", "render() {\n return (\n <div className=\"video-player\">\n <div data-vjs-player>\n <video ref={node => (this.videoNode = node)} className=\"video-js\" />\n </div>\n </div>\n )\n }", "function onPlayerReady(event) {\n event.target.playVideo();\n}", "function onPlayerReady(event) {\n event.target.playVideo();\n}", "function onPlayerReady(event) {\n event.target.playVideo();\n}", "function onPlayerReady(event) {\n event.target.playVideo();\n}", "function onPlayerReady(event) {\n event.target.playVideo();\n}", "function onPlayerReady(event) {\n event.target.playVideo();\n}", "function onPlayerReady(event) {\n event.target.playVideo();\n}", "function onPlayerReady(event) {\n event.target.playVideo();\n}", "function onPlayerReady(event) {\n event.target.playVideo();\n}", "function onPlayerReady(event) {\r\n event.target.playVideo();\r\n}", "function onPlayerReady(event) {\n event.target.playVideo();\n }", "function onPlayerReady(event) {\n event.target.playVideo();\n}", "function onPlayerReady(event) {\n event.target.playVideo();\n}", "function onPlayerReady(event) {\n event.target.playVideo();\n}", "function onPlayerReady(event) {\n event.target.playVideo();\n}", "function onPlayerReady(event) {\n event.target.playVideo();\n}", "get player () {\n return videojs(this.playerId);\n }", "constructor() {\n super({\n key: \"LoadingScreen\"\n // pack: {\n // files: [\n // {\n // type: 'video',\n // key: 'simple_bg',\n // url: './assets/videos/intro.mp4'\n // }\n // ]\n // }\n });\n this.isLoading = true;\n this.isFading = false;\n }", "render() {\n const isDash = this.player ? this.player.dash != null : false;\n return (\n <Row>\n <Col md={4}>\n {isDash ? (\n this.player.dash.mediaPlayer\n ? <DashInfo mediaPlayer={this.player.dash.mediaPlayer} />\n : \"Loading...\"\n ) : (\n <Mp4Stream player={this.player} loadedmetadata={this.state.loadedmetadata} />\n )}\n </Col>\n <Col md={6}>\n <div data-vjs-player className=\"player\">\n <video ref={node => this.videoNode = node} className=\"video-js vjs-default-skin\" data-setup='{\"fluid\": true}' />\n </div>\n <div>\n { isDash &&\n <DashTimeSeries mediaPlayer={this.player.dash.mediaPlayer} />\n }\n </div>\n </Col>\n <Col md={2}>\n <VideojsInfo player={this.player} playerready={this.state.playerready} />\n { isDash &&\n <DashOverallMetrics mediaPlayer={this.player.dash.mediaPlayer} />\n }\n </Col>\n </Row>\n );\n }", "play() {\n this.video.play();\n }", "function onPlayerReady(event) {\n event.target.playVideo();\n console.log(\"start!!\");\n}", "function onPlayerReady(event) {\n \n console.log('onPlayerReady:'+event.data);\n //event.target.playVideo();\n}", "render() {\n return (\n <div className=\"player-container\">\n <video ref={ node => this.videoNode = node } className=\"video-js\">\n </video>\n </div>\n )\n }", "render() {\n return (\n <div data-vjs-player>\n <div>\n <video ref={ node => this.videoNode = node } className=\"video-js vjs-default-skin\"></video>\n </div>\n <div>\n <button onClick={ this.play }>Play</button>\n <button onClick={ this.stop }>Stop</button>\n <button onClick={ this.jumpToOneMinute }>Jump to one minute</button>\n </div>\n </div>\n )\n }", "createPlayer() {\n if (this.player || !this.props.stream) {\n console.log('no stream yet')\n return;\n }\n\n const {id} = this.props.match.params\n // creating instance of player\n // important to know that until the stream is fetched we should not try to attach to video ref\n this.player = flv.createPlayer({\n type: 'flv',\n url: `http://localhost:8000/live/${id}.flv`\n });\n\n // attached video to specific element of dom\n this.player.attachMediaElement(this.videoRef.current);\n // loading the video instead of playing automatically\n this.player.load();\n }", "function onPlayerReady(event) {\n event.target.playVideo();\n }", "render() {\n return (\n <div data-vjs-player>\n {/* eslint-disable-next-line no-return-assign */}\n <video ref={node => (this.videoNode = node)} className=\"video-js\" />\n {/* language=CSS */}\n <style jsx>{`\n div[data-vjs-player] {\n width: 100%;\n height: 20rem;\n }\n `}</style>\n </div>\n );\n }", "render() {\n return (\n <div>\n <div>\n <video ref={node => this.videoNode = node} id=\"my_video_1\" className=\"video-js vjs-default-skin\" \n controls preload=\"none\" poster='http://video-js.zencoder.com/oceans-clip.jpg'\n data-setup='{ \"aspectRatio\":\"640:350\", \"playbackRates\": [1, 1.5, 2] },'>\n <source src={this.props.sources[0]} type='video/mp4' />\n </video>\n </div>\n </div>\n )\n }", "static _getName() {\n return 'ContentPlayback';\n }", "function onPlayerReady(event) {\n //writeUserData(video)\n //event.target.playVideo();\n}", "function App() {\n return (\n <div className=\"App\">\n <link\n href=\"https://fonts.googleapis.com/css?family=Pacifico&display=swap\"\n rel=\"stylesheet\"\n ></link>\n <header className=\"header-video\">\n <ButtonListContainer />\n </header>\n <section className=\"video-display\">\n <Route exact path=\"/trailer/:name\" component={TestingReactPlayer} />\n </section>\n\n <section className=\"carousel-section\">\n <SimpleSlider />\n </section>\n </div>\n );\n}", "function onPlayerReady(event) {\n event.target.playVideo();\n\n }", "function TestComponent() {\n return (\n <div className=\"video\">\n <iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/5TbUxGZtwGI\" frameBorder=\"0\" allow=\"autoplay; encrypted-media\" title=\"time video\" allowFullScreen></iframe>\n </div>\n );\n}", "function onPlayerReady(event) {\n\tevent.target.playVideo();\n}", "videoComponent(videoSrc) {\n if (!videoSrc || videoSrc.length === 0 || !videoSrc[0].url)\n return ''; //if src not exist or empty\n\n const video = videoSrc[0].url;\n return `<video width=\"100%\" controls>\n <source src=\"${video}\" type=\"video/mp4\">\n Your browser does not support HTML5 video.\n </video>`;\n }", "onVideoClick (video) {\n this.setState ({\n singleVideo: video\n });\n }", "function onPlayerReady(event) {\n player.loadPlaylist(viewmodel.Hindivideolist());\n player.setShuffle(true);\n player.setLoop(true);\n //event.target.playVideo();\n}", "function onPlayerReady(event) {\n event.target.loadVideo();\n }", "function onPlayerReady(event) {\n //event.target.playVideo();\n event.target.pauseVideo();\n }", "function onPlayerReady(event) {\n Controller.load_video();\n }", "doVideo( stream ) {\n this.root.src = window.URL.createObjectURL( stream );\n }", "function onPlayerReady(event) {\n\t event.target.playVideo();\n }", "get videoShareKind() {\n return 'VIDEO';\n }", "function onPlayerReady(event) {\n // event.target.playVideo();\n event.target.loadPlaylist(listeVideosNature);\n}", "function onPlayerReady() {\r\n player.playVideo();\r\n /*let time = player.getCurrentTime();\r\n if(player.stopVideo()){\r\n let time2 = player.getCurrentTime();\r\n \r\n player.playVideo(time2);\r\n }*/\r\n \r\n }", "playSong(){\n spotifyApi.play({});\n }", "function onPlayerReady(event) {\n event.target.playVideo();\n }", "function videoComponent( options ){\n\n this.model = {\n source:'<iframe src=\"https://www.youtube.com/embed/DWcJFNfaw9c\" ' +\n 'frameborder=\"0\" allowfullscreen></iframe>'\n };\n\n if (options && options.state){\n this.model.source = options.source;\n }\n\n // define how the model is displayed to the user\n this.views = [\n {\n // returns html to be placed in destination element\n renderer: function(model){\n return \"<div class='videoComponent'>\" + String(model.source) + \"</div>\";\n },\n destination:options.destination,\n destinationInsertionFunction:\"html\"\n\n }\n ];\n\n this.adapters = [];\n}", "render() {\n return (<div>\n <Nav />\n <div className=\"col-md-7\">\n <VideoPlayer video={this.state.currentVideo}/>\n </div>\n <div className=\"col-md-5\">\n <VideoList videos={this.state.videolist} steven={this.onVideoClick.bind(this)}/>\n </div>\n </div>);\n }", "function ytOnPlayerReady(event) {\n event.target.playVideo();\n}", "buildPlayer() {\n // if the player exist or if the stream doesn't yet exist return\n if (this.player || !this.props.stream) {\n return\n }\n // otherwise\n const { id } = this.props.match.params\n\n // create and assign flv player and pass in a options object\n this.player = flv.createPlayer({\n // specify type of video we are trying to receive\n type: \"flv\",\n // url of streaming video with the id of the stream we are trying to play\n url: `http://localhost:8000/live/${id}.flv`\n })\n // call attach media element to flv player and pass in a reference to the actual video element that is being rendered inside component\n this.player.attachMediaElement(this.videoRef.current)\n // load player\n this.player.load()\n }", "function AudioPage(){\n\n return (\n <div className=\"App\">\n <AudioPlayer /> \n </div>\n\n )\n}", "render() {\n const { data } = this.props;\n const { play } = this.state;\n\n console.log('play',play);\n return (\n <div> \n <div data-vjs-player>\n <div className=\"player\">\n <div className=\"player__header\">\n <div className=\"player__logo\"></div>\n <div className=\"player__userpic\"></div>\n <div className=\"player__heading\">\n <div className=\"player__name\">{ data.title }</div>\n <div className=\"player__author\">{ data.author }</div>\n </div>\n <div className=\"player__menu player__menu_direction_row\">\n {/* <div className=\"button player__button\"><FontAwesomeIcon icon={faVk} className=\"button__icon\" /></div> */}\n {/* <div className=\"button player__button\"><FontAwesomeIcon icon={faFacebook} className=\"button__icon\" /></div> */}\n {/* <div className=\"button player__button\"><FontAwesomeIcon icon={faTwitter} className=\"button__icon\" /></div> */}\n <div className=\"button player__button\"><FontAwesomeIcon icon={faShare} className=\"button__icon\" /></div>\n <div className=\"button player__button\"><FontAwesomeIcon icon={faBookmark} className=\"button__icon\" /></div>\n <div className=\"button player__button\"><FontAwesomeIcon icon={faCog} className=\"button__icon\" /></div>\n </div>\n </div>\n <div className=\"player__main\">\n <div className=\"player__side\">\n <div className=\"player__menu player__menu_direction_column\">\n <div className=\"button player__button\"><FontAwesomeIcon icon={faInfo} className=\"button__icon\" /></div>\n <div className=\"button player__button\"><FontAwesomeIcon icon={faListOl} className=\"button__icon\" /></div>\n <div className=\"button player__button\"><FontAwesomeIcon icon={faClone} className=\"button__icon\" /></div>\n <div className=\"player__menu-area\"></div>\n <div className=\"button player__button\"><FontAwesomeIcon icon={faFastBackward} className=\"button__icon\" /></div>\n </div>\n <div className=\"player__side-main\">\n <div className=\"player__side-header\">\n <div className=\"player__menu player__menu_direction_row\">\n <div className=\"player__menu-area\">\n <div className=\"button button_width_available player__button\"><span className=\"button__text\">Описание</span></div>\n </div>\n <div className=\"player__menu-area\">\n <div className=\"button button_width_available player__button\"><span className=\"button__text\">Оглавление</span></div>\n </div>\n </div>\n </div>\n <div className=\"player__side-content\">\n <ul className=\"collapse\">\n { this._renderChapter() }\n </ul>\n </div>\n <div className=\"player__side-footer\">\n <div className=\"player__menu player__menu_direction_row\">\n <div className=\"button player__button\"><FontAwesomeIcon icon={faStepBackward} className=\"button__icon\" /></div>\n <div className=\"player__menu-area\">\n <div className=\"button button_width_available player__button\" onClick={ () => this.playToggle() }>\n <FontAwesomeIcon icon={ play ? faPause : faPlay } className=\"button__icon\" />\n </div>\n </div>\n <div className=\"button player__button\"><FontAwesomeIcon icon={faStepForward} className=\"button__icon\" /></div>\n <div className=\"button player__button\"><FontAwesomeIcon icon={faFastForward} className=\"button__icon\" /></div>\n </div>\n </div>\n </div>\n </div>\n <div className=\"player__frame\">\n <div className=\"player__content\">\n <video ref={ node => this.videoNode = node } className=\"video-js vjs-default-skin player__video\" />\n {/* <div className=\"player__transparent\" /> */}\n </div>\n <div className=\"player__menu player__menu_direction_row\">\n <div className=\"button player__button\"><FontAwesomeIcon icon={faVolumeUp} className=\"button__icon\" /></div>\n <div className=\"volume\">\n <input type=\"range\"/>\n </div>\n <div className=\"timing\">3:34 / 4:58</div>\n <div className=\"button player__button\"><FontAwesomeIcon icon={faClosedCaptioning} className=\"button__icon\" /></div>\n <div className=\"button player__button\"><FontAwesomeIcon icon={faDesktop} className=\"button__icon\" /></div>\n </div>\n </div>\n <div className=\"player__side\">\n <div className=\"player__side-main\">\n <div className=\"player__side-header\">\n <div className=\"player__menu player__menu_direction_row\">\n <div className=\"player__menu-area\">\n <div className=\"button button_width_available player__button\"><span className=\"button__text\">Очередь</span></div>\n </div>\n <div className=\"player__menu-area\">\n <div className=\"button button_width_available player__button\"><span className=\"button__text\">Похожие</span></div>\n </div>\n </div>\n </div>\n <div className=\"player__side-content\">\n <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequuntur, dignissimos, voluptatum! Aspernatur obcaecati nihil maxime! Nostrum, impedit. Qui at ea eligendi incidunt impedit recusandae, ipsam, saepe veniam consequatur, voluptatibus dolore!</p>\n <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequuntur, dignissimos, voluptatum! Aspernatur obcaecati nihil maxime! Nostrum, impedit. Qui at ea eligendi incidunt impedit recusandae, ipsam, saepe veniam consequatur, voluptatibus dolore!</p>\n </div>\n <div className=\"player__side-footer\">\n <div className=\"player__menu player__menu_direction_row\">\n <div className=\"button player__button\"><FontAwesomeIcon icon={faPaperclip} className=\"button__icon\" /></div>\n <div className=\"player__menu-area\">\n <div className=\"input input_width_available\">\n <div className=\"input__box\">\n <textarea className=\"input__control\"></textarea>\n </div>\n </div>\n </div>\n <div className=\"button player__button\"><FontAwesomeIcon icon={faHome} className=\"button__icon\" /></div>\n </div>\n </div>\n </div>\n <div className=\"player__menu player__menu_direction_column\">\n <div className=\"player__menu-area\">\n <div className=\"button button_height_available player__button\"><FontAwesomeIcon icon={faThumbsUp} className=\"button__icon\" /></div>\n </div>\n <div className=\"player__menu-area\">\n <div className=\"button button_height_available player__button\"><FontAwesomeIcon icon={faThumbsDown} className=\"button__icon\" /></div>\n </div>\n <div className=\"button player__button\"><FontAwesomeIcon icon={faComments} className=\"button__icon\" /></div>\n </div>\n </div>\n </div>\n <div className=\"player__footer\">\n <div className=\"player__progress\">\n <input\n className=\"player__current\"\n type=\"range\"\n min=\"0\"\n max=\"100\"\n value=\"33\"\n onChange={ () => {} }/>\n </div>\n <div className=\"player__ruler\">\n <div className=\"player__ruler-content\">\n <div className=\"player__ruler-chapter\"></div>\n <div className=\"player__ruler-chapter\"></div>\n <div className=\"player__ruler-chapter\"></div>\n <div className=\"player__ruler-chapter\"></div>\n <div className=\"player__ruler-chapter\"></div>\n </div>\n <input\n className=\"player__current\"\n type=\"range\"\n min=\"0\"\n max=\"100\"\n value=\"33\"\n onChange={ () => {} }/>\n </div>\n </div>\n </div>\n </div>\n </div>\n )\n }", "function onPlayerReady(event) {\n\n\tloadVideoId();\n\tevent.target.playVideo();\n\n}", "function onPlayerReady(event) {\n event.target.playVideo();\n }", "function onPlayerReady(event) {\n event.target.playVideo();\n }", "function onPlayerReady(event) {\n event.target.playVideo();\n }", "componentDidMount() {\n this.props.fetchVideos('youtubers');\n }", "render() {\n return (\n <div className=\"landing\">\n <div className=\"dark-overlay landing-inner text-light\">\n {/* <video muted autoPlay = \"true\" loop =\"true\">\n <source src = {code} />\n </video> */}\n <div className=\"container\">\n <div className=\"row\">\n <div className=\"col-md-12 text-center\">\n <h1 className=\"display-3 mb-4\">Developer Connector\n </h1>\n <p className=\"lead\"> Create a developer profile/portfolio, share posts and get help from other developers</p>\n <hr />\n <Link to=\"/register\" className=\"btn btn-lg btn-info mr-2\">Sign Up</Link>\n <Link to=\"/login\" className=\"btn btn-lg btn-light\">Login</Link>\n </div>\n </div>\n </div>\n </div>\n </div>\n )\n }", "function onPlayerReady(event) {\r\n event.target.playVideo();\r\n }", "function onPlayerReady(event) {\n\t\t\tevent.target.playVideo();\n\t\t}", "async function showVideo(videoSrc, videoType, videoLinkFromUrl) {\n // fetch video settings\n const videoPlayerSettings = await getVideoPlayerSettings(); \n // update info\n document.title = \"Watching Video By Provided Link\"; \n document.body.classList = \"watching-video-body\";\n basic.websiteContentContainer().classList = \"watching-video-websiteContentContainer\";\n let displayChromecast;\n try { \n if (videoPlayerSettings.chromecast == true) {\n displayChromecast = true;\n } else {\n displayChromecast = false;\n }\n } catch (error) {\n displayChromecast = false;\n }\n // create video player\n const videoPlayer = basic.createSection(basic.websiteContentContainer(), \"video-js\", \"vjs-default-skin vjs-big-play-centered\", \"video\");\n videoPlayer.style.width = \"100vw\";\n videoPlayer.style.height = \"100vh\";\n const Button = videojs.getComponent(\"Button\"); // eslint-disable-line\n if (videoType == \"application/x-mpegURL\") {\n const player = videojs(videoPlayer, { // eslint-disable-line\n controls: true,\n autoplay: true,\n preload: \"auto\",\n html5: {\n vhs: {\n overrideNative: true\n },\n nativeAudioTracks: false,\n nativeVideoTracks: false \n }\n }); \n\n // change icon from vjs-icon-cog to vjs-icon-hd - needs to be implemented better\n const httpSourceSelectorIconChange = document.createElement(\"style\");\n httpSourceSelectorIconChange.innerHTML = \".vjs-icon-cog:before { content: \\\"\\\\f114\\\"; font-size: 16px; }\";\n document.head.appendChild(httpSourceSelectorIconChange);\n\n const qualityLevels = player.qualityLevels(); \n // disable quality levels with less one qualityLevel options\n qualityLevels.on(\"addqualitylevel\", function(event) {\n let qualityLevel = event.qualityLevel; \n if(qualityLevels.levels_.length <= 1){ \n // dont show httpSourceSelector\n qualityLevel.enabled = false;\n } else{ \n // show httpSourceSelector\n player.httpSourceSelector();\n qualityLevel.enabled = true;\n } \n });\n\n let hlsVideoSrc; \n try { \n // check if desired chunklist is in videoSrc\n if(videoSrc.substr(videoSrc.length - 4) == \"m3u8\"){ \n // get chunklist\n const chunklist = videoSrc.substring( \n videoSrc.lastIndexOf(\"/\") + 1, \n videoSrc.lastIndexOf(\".m3u8\")\n ); \n // if chunklist contains chunklist \n if(chunklist.includes(\"chunklist\")){ \n // hls video src == new video src\n hlsVideoSrc = videoSrc.slice(0,videoSrc.lastIndexOf(\"/\")+1) + \"playlist\" + \".m3u8\";\n // replace url from orignial video src to new video src\n history.replaceState(null, \"\", `?t=${videoType}?v=${hlsVideoSrc}`);\n } else{ // orignial video src = hls video src\n hlsVideoSrc = videoSrc;\n } \n } else{ // orignial video src = hls video src\n hlsVideoSrc = videoSrc; \n }\n } catch (error) { // if error orignial video src = hls video src\n hlsVideoSrc = videoSrc; \n } \n \n // video hotkeys\n // eslint-disable-next-line no-undef\n videojs(videoPlayer).ready(function() {\n this.hotkeys({\n volumeStep: 0.05,\n seekStep: false,\n enableModifiersForNumbers: false,\n // just in case seekStep is active, return undefined\n forwardKey: function() {\n // override forwardKey to not trigger when pressed\n return undefined;\n },\n rewindKey: function() { \n // override rewindKey to not trigger when pressed\n return undefined;\n }\n });\n });\n\n // record stream\n const StopRecButton = videoButton.stopRecStreamButton(player, Button);\n const RecButton = videoButton.RecStreamButton(player, Button, StopRecButton, videoSrc, videoType);\n\n videojs.registerComponent(\"RecButton\", RecButton); // eslint-disable-line\n player.getChild(\"controlBar\").addChild(\"RecButton\", {}, 1);\n\n const topControls = videoButton.topPageControlBarContainer(player);\n videoButton.backToHomePageButton(topControls, videoLinkFromUrl); // closes player\n player.play(); // play video on load\n player.muted(videoPlayerSettings.muted); // set mute video settings on load\n player.volume(videoPlayerSettings.volume); // set volume video settings on load\n document.getElementById(\"video_html5_api\").onvolumechange = () => { // update global video player volume/mute settings\n updateVideoPlayerVolume(player.volume(), player.muted()); \n };\n player.src({ // video type and src\n type: videoType,\n src: hlsVideoSrc\n });\n // hide time from live video player\n const style = document.createElement(\"style\");\n style.innerHTML = `\n .video-js .vjs-time-control{display:none;}\n .video-js .vjs-remaining-time{display: none;}\n `;\n document.head.appendChild(style);\n } else if ( videoType == \"application/dash+xml\" ) {\n const player = videojs(videoPlayer, { // eslint-disable-line\n controls: true,\n autoplay: true,\n preload: \"auto\"\n });\n\n // video hotkeys\n // eslint-disable-next-line no-undef\n videojs(videoPlayer).ready(function() {\n this.hotkeys({\n volumeStep: 0.05,\n seekStep: 5,\n enableModifiersForNumbers: false\n });\n });\n\n const topControls = videoButton.topPageControlBarContainer(player);\n videoButton.backToHomePageButton(topControls, videoLinkFromUrl); // closes player\n player.play(); // play video on load\n player.muted(videoPlayerSettings.muted); // set mute video settings on load\n player.volume(videoPlayerSettings.volume); // set volume video settings on load\n document.getElementById(\"video_html5_api\").onvolumechange = () => { // update global video player volume/mute settings\n updateVideoPlayerVolume(player.volume(), player.muted()); \n };\n player.src({ // video type and src\n type: videoType,\n src: videoSrc\n });\n } else {\n const player = videojs(videoPlayer, { // eslint-disable-line\n \"playbackRates\":[0.25,0.5, 1, 1.25, 1.5, 2],\n controls: true,\n techOrder: [ \"chromecast\", \"html5\" ],\n plugins: {\n chromecast: {\n addButtonToControlBar: displayChromecast\n },\n seekButtons: {\n forward: 30,\n back: 10\n }\n }\n });\n \n // video hotkeys\n // eslint-disable-next-line no-undef\n videojs(videoPlayer).ready(function() {\n this.hotkeys({\n volumeStep: 0.05,\n seekStep: 5,\n enableModifiersForNumbers: false\n });\n });\n\n const topControls = videoButton.topPageControlBarContainer(player);\n const downloadVideoContainer = basic.createSection(topControls, \"div\", \"vjs-downloadVideo-container\");\n const downloadVideoButton = basic.createSection(downloadVideoContainer, \"button\", \"vjs-downloadVideo fa fa-download vjs-control vjs-button\", \"downloadVideoButton\");\n downloadVideoButton.title = \"Download Video\";\n\n const downloadVideoMenu = basic.createSection(downloadVideoContainer, \"section\", \"vjs-menu vjs-downloadVideo-menu\");\n downloadVideoMenu.style.display = \"none\";\n const downloadVideoMenuContent = basic.createSection(downloadVideoMenu, \"div\", \"vjs-menu-content\");\n\n videoButton.downloadVideoButton(downloadVideoMenuContent, videoSrc, videoType);\n videoButton.createTrimVideo(player, downloadVideoContainer, downloadVideoMenu,downloadVideoButton, downloadVideoMenuContent, videoSrc, videoType);\n\n downloadVideoContainer.onmouseover = function(){\n document.getElementById(\"downloadVideoButton\").focus();\n downloadVideoMenu.style.display = \"block\";\n document.getElementById(\"downloadVideoButton\").onclick = document.getElementById(\"downloadVideoButton\").blur();\n };\n downloadVideoContainer.onmouseout = function(){\n document.getElementById(\"downloadVideoButton\").blur();\n downloadVideoMenu.style.display = \"none\";\n };\n\n videoButton.backToHomePageButton(topControls, videoLinkFromUrl); // closes player\n player.play(); // play video on load\n player.muted(videoPlayerSettings.muted); // set mute video settings on load\n player.volume(videoPlayerSettings.volume); // set volume video settings on load \n document.getElementById(\"video_html5_api\").onvolumechange = () => { // update global video player volume/mute settings\n updateVideoPlayerVolume(player.volume(), player.muted()); \n }; \n player.src({ // video type and src\n type: videoType,\n src: videoSrc\n });\n }\n}", "function playVideoInModal() {\n\t\tplayer = videojs('modalVideo');\n\t\tplayer.ready( function() {\n\t\t\tplayer.currentTime(5);\n\t\t\tplayer.volume(0.5);\n\t\t\tplayer.play();\n\t\t});\n \t\t\n \t\t// event zakończenia filmu \n\t\tplayer.on('ended', function() {\n\t\t\tmodal.classList.remove('modalOpen');\n\t\t\tplayer.dispose();\n\t\t});\n\t}", "get SamsungTVPlayer() {}", "function onPlayerReady(event) {\n event.target.playVideo();\n }", "static get pluginName() {\n return 'mediaBrowser'\n }", "render() {\n return (\n <TouchableWithoutFeedback\n onPress={ this.events.onScreenTouch }\n style={[ styles.player.container, this.styles.containerStyle ]}\n >\n <View style={[ styles.player.container, this.styles.containerStyle ]}>\n <Video\n { ...this.props }\n ref={ videoPlayer => this.player.ref = videoPlayer }\n\n resizeMode={ this.state.resizeMode }\n volume={ this.state.volume }\n paused={ this.state.paused }\n muted={ this.state.muted }\n rate={ this.state.rate }\n\n onLoadStart={ this.events.onLoadStart }\n onProgress={ this.events.onProgress }\n onError={ this.events.onError }\n onLoad={ this.events.onLoad }\n onEnd={ this.events.onEnd }\n\n style={[ styles.player.video, this.styles.videoStyle ]}\n\n source={ this.props.source }\n />\n { this.renderError() }\n { this.renderLoader() }\n </View>\n </TouchableWithoutFeedback>\n );\n }", "function loadNewVideo(vid){\n console.log('loadNewVideo:',vid);\n player.loadVideoById(vid);\n}", "function playVidya(url, event){\n\t if(player){\n\t\t player.cueVideoById(url, 0);\n\t\t player.playVideo();\n\t } \t \n}", "function RunningBackgroundVideo() {\n return (\n <video muted loop autoPlay>\n <source src={runningVideo} type=\"video/mp4\" />\n </video>\n );\n}", "function MediaCard(props) {\n const { classes } = props;\n return (\n <Card style={{ borderRadius: 0, marginTop: m ? 80 : 5 }}>\n <div style={{ background: '#121210' }}>\n <ReactFlowPlayer\n playerInitScript=\"https://releases.flowplayer.org/7.2.4/commercial/flowplayer.min.js\"\n playerId=\"reactFlowPlayer\"\n hlsPlugin={true}\n hlsUrl=\"https://releases.flowplayer.org/hlsjs/flowplayer.hlsjs.light.min.js\"\n title=\" \"\n live={true}\n sources={[\n {\n type: \"application/x-mpegurl\",\n src: \"http://bigjtv.livebox.co.in/bigjtvhls/live.m3u8\"\n }\n ]}\n />\n </div>\n </Card>\n );\n}", "render(){\n return (\n <div className=\"ui grid container\">\n <VideoDetail video={this.props.selectedVideo} />\n <VideoList videos={this.props.videos} handleClick={this.props.selectVideo} />\n </div>\n )\n }", "renderYoutubePlayer() {\n const { videoId, id, track } = this.props.playlist[0];\n\n return (\n <YoutubePlayer\n onMouseOver={this.handleHover}\n id={id}\n videoId={videoId}\n removeVideo={this.props.removeVideo}\n channel={this.props.match.params.channel}\n addNowPlaying={this.props.addNowPlaying}\n track={track}\n />\n );\n }", "function playPlayer() {\n console.log(\"play\");\n player.internalPlayer.playVideo();\n whenUnPause();\n }", "function Video(title, uploader, seconds) {\n\tthis.title = title;\n\tthis.uploader = uploader;\n\tthis.seconds = seconds;\n}", "showLocalVideo() {}", "function loadVideo(video) {\n\tvideoPlayer.src = \"footage/\" + video;\n\tvideoPlayer.load();\n\t\n\t/*changes the pause back to play when new video is clicked*/\n\tvar button = document.getElementById(\"play-pause-btn\");\n\tchangeButton(button,\"&#9654;\");\n\t\n\t/*splits the fileName and the file tag with '.' .split creates an array*/\n\tvar fileName = video.split('.');\n\t\n\t/*calls the folder posters + a specific fileName [which is an array] + jpg extension*/\n\tvideoPlayer.poster = \"posters/\" + fileName[0] + \".jpg\";\n}", "onNextVideo() {\n const { controller } = this.props;\n if (typeof controller.requestNextVideo === 'function') {\n controller.requestNextVideo();\n }\n }", "render() {\n const { rate, volume, resizeMode, muted } = this.state\n return (\n <View style={{ flex: 1, backgroundColor: 'black' }}>\n <StatusBar barStyle=\"default\" />\n <Video\n source={require(vid)}\n ref={ref => this.videoRef = ref}\n rate={rate}\n volume={volume}\n muted={muted}\n resizeMode={resizeMode}\n onEnd={this.onEnd}\n onBuffer={this.onBuffer}\n onError={this.videoError}\n style={styles.backgroundVideo} />\n </View>\n );\n }" ]
[ "0.67883414", "0.628995", "0.628995", "0.626998", "0.62494785", "0.62154454", "0.6121657", "0.6107251", "0.6103174", "0.6102647", "0.60809976", "0.60392433", "0.6021456", "0.60100764", "0.5986119", "0.5975372", "0.5967229", "0.59636736", "0.5937823", "0.5931005", "0.5924925", "0.5920608", "0.5920608", "0.5920608", "0.5920608", "0.5920608", "0.5920608", "0.5920608", "0.5920608", "0.5920608", "0.5919092", "0.59183425", "0.59119344", "0.59119344", "0.59119344", "0.59119344", "0.59119344", "0.5901284", "0.58718055", "0.5835636", "0.5823128", "0.5814981", "0.581346", "0.5794851", "0.57928306", "0.5790269", "0.5783046", "0.5768952", "0.5767455", "0.57674235", "0.5760144", "0.57560766", "0.57531804", "0.57521415", "0.5748299", "0.5746883", "0.5744157", "0.5710054", "0.57097524", "0.57095814", "0.57044196", "0.5701057", "0.5698826", "0.56971", "0.56946665", "0.56836134", "0.5680112", "0.5666233", "0.5642189", "0.56330234", "0.563009", "0.562765", "0.56272274", "0.56215435", "0.56200653", "0.55813503", "0.55813503", "0.55813503", "0.55790555", "0.5561499", "0.55518603", "0.5549141", "0.55456716", "0.55439705", "0.55388945", "0.55282336", "0.55184215", "0.5504396", "0.5504351", "0.55026895", "0.5501208", "0.5500208", "0.54904205", "0.54817516", "0.54791486", "0.54747206", "0.54670113", "0.5460681", "0.5459166", "0.54547626" ]
0.7422757
0
/ / This cheeky function just grabs the first part of the url after the first forward slash It will return just the 'v1' or 'v5' depending on what is passed to it This means there is no need for duplicate code for each iteration oh and it only works up to to v9
function getVersion(a) { var secondBracket = a.url.indexOf('/', 1); return a.url.substring(1, secondBracket) || "v1"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getFirstPart(url) {\n var indexOfTS = url.indexOf(\"//\");\n if(indexOfTS==-1) {\n return url.split(\"/\")[0];\n }\n else {\n var fp = url.substring(indexOfTS+2);\n return url.substring(0,indexOfTS)+\"//\"+fp.split(\"/\")[0];\n }\n\n }", "function getVersion(path) {\n const url = new URL(path, 'https://foo.bar');\n const segments = url.pathname.split('/');\n return segments.find((segment) => segment.match(/v[0-9]+(.[0-9]+)?/));\n}", "function getFirstPart(url) {\n var indexOfTS = url.indexOf(\"//\");\n if(indexOfTS==-1) {\n return url.split(\"/\")[0];\n }\n else {\n var fp = url.substring(indexOfTS+2);\n return url.substring(0,indexOfTS)+\"//\"+fp.split(\"/\")[0];\n }\n\n }", "function getFirstPart(url) {\n var indexOfTS = url.indexOf(\"//\");\n if(indexOfTS==-1) {\n return url.split(\"/\")[0];\n }\n else {\n var fp = url.substring(indexOfTS+2);\n return url.substring(0,indexOfTS)+\"//\"+fp.split(\"/\")[0];\n }\n\n }", "function getIndexVonMitarbeiter() {\n var query = window.location.href\n console.log(query)\n var vars = query.split(\"/\");\n\n return vars[4]\n\n}", "function smartUrl(url) {\n\n if (url.indexOf(languagemastersPath) > -1) {\n url = url.split(languagemastersPath)[1];\n } else if (url.indexOf(languagePath) > -1) {\n url = url.split(languagePath)[1];\n } else if (url.indexOf(liveURL) > -1) {\n url = url.split(liveURL)[1].substring(parseInt(languagecodelength) + 2);\n } else if (url.indexOf(publishURL) > -1) {\n url = url.split(publishURL)[1].substring(parseInt(languagecodelength) + 2);\n } else if (url.indexOf(stageLiveURL) > -1) {\n url = url.split(stageLiveURL)[1].substring(parseInt(languagecodelength) + 2);\n } else if (url.indexOf(stagePublishURL) > -1) {\n url = url.split(stagePublishURL)[1].substring(parseInt(languagecodelength) + 2);\n } else if(url.indexOf(previewURL)> -1){\n url = url.split(previewURL)[1].substring(3);\n }\n\n\n if (url.indexOf(\".html\") > -1) {\n url = url.split(\".html\")[0];\n }\n\n return url;\n\n}", "resource(fullUrl){\n //Pega o caminho da URL ou seja a string que vem após a porta e antes das querys\n //protocolo://domínio:porta/RECURSO/.../RECURSO?query_string#fragmento\n let parsedUrl = url.parse(fullUrl).pathname\n return parsedUrl\n }", "function getBase(url) {\n\t\t\treturn url.split('?')[0];\t\n\t\t}", "function getQueryVariableShortened(url){\n\n return url.split(\"/\")[3];\n}", "GetURLResource(url) {\r\n let parts = url.split('/');\r\n let lastSection = parts.pop() || parts.pop();\r\n if (lastSection) {\r\n return lastSection;\r\n }\r\n else {\r\n return \"unknown\";\r\n }\r\n }", "function asFullUrl(slug, version, path) {\n return `/${slug}/api/${version}/${stripInitialSlash(path)}`;\n}", "function serverBase(url) { // 11458\n return url.substring(0, url.indexOf('/', url.indexOf('//') + 2)); // 11459\n} // 11460", "function _get_url( els ) {\n\treturn basepath + els.join('/');\n}", "splitURL(url){\n let UrlParts = url.substring(1).split('/');\n return UrlParts;\n }", "static makeUrlRelative(url) {\r\n if (!isUrlAbsolute(url)) {\r\n // already not absolute, just give it back\r\n return url;\r\n }\r\n let index = url.indexOf(\".com/v1.0/\");\r\n if (index < 0) {\r\n index = url.indexOf(\".com/beta/\");\r\n if (index > -1) {\r\n // beta url\r\n return url.substr(index + 10);\r\n }\r\n }\r\n else {\r\n // v1.0 url\r\n return url.substr(index + 9);\r\n }\r\n // no idea\r\n return url;\r\n }", "parseDefaultRoute(url) {\n if (url.trim() === '/')\n throw Error('Url is index!');\n if (url[url.length - 1] === '/')\n url = url.slice(0, -1);\n if (url[0] === '/')\n url = url.slice(1, url.length);\n var indexAnyRoute = -1;\n for (var i = 0; i < this.routes.length; i++) {\n let route = this.routes[i];\n let routePath = route.path;\n if (routePath.trim() === '*')\n indexAnyRoute = i;\n if (routePath.trim() === '/')\n continue;\n if (routePath[routePath.length - 1] === '/')\n routePath = routePath.slice(0, -1);\n if (routePath[0] === '/')\n routePath = routePath.slice(1, routePath.length);\n var rBread = routePath.split('/');\n var urlBread = url.split('/');\n if (rBread.length !== urlBread.length)\n continue;\n for (let k = 0; k < urlBread.length; k++) {\n if (urlBread[k] === rBread[k] && k < urlBread.length - 1)\n continue;\n else if (urlBread[k] !== rBread[k] && k < urlBread.length - 1)\n break;\n else {\n if (k === urlBread.length - 1 && rBread[k].trim() === '*') {\n return i;\n }\n }\n }\n }\n if (indexAnyRoute !== -1)\n return indexAnyRoute;\n throw Error('Test');\n }", "function get_v(page_url){\r\n\tvar v = 0;\r\n\tif (page_url.indexOf(\"&v=\")!=-1){\r\n\t\t//this assumes the v is always at the end, could modify to check that there isn't another & after it\r\n\t\tv = page_url.substring(page_url.indexOf(\"&v=\")+3);\r\n\t}\r\n\treturn v;\r\n}", "function getVarenummer(){\n var url = window.location.pathname.split('/');\n var varenummer = url[url.length- 1];\n return varenummer;\n}", "_getPathFromUrl () {\n return window.location.toString().split(/[?#]/)[0]\n }", "function refineUrl()\n{\n //get full url\n var url = window.location.href;\n //get url after/ \n var value = url = url.slice( 0, url.indexOf('?') );\n //get the part after before ?\n value = value.replace('@System.Web.Configuration.WebConfigurationManager.AppSettings[\"BaseURL\"]',''); \n return value; \n}", "function recuperaPath(url)\n{\n\ttry {\n\t\tvar result = url.match(/[-_\\w]+[.][\\w]+$/i)[0];\n\t}\n\tcatch(err) {\n\t\t//console.log(err);\n\t\tvar result = \" \";\n\t}\n\treturn result;\n}", "function serverBase(url){return url.substring(0,url.indexOf('/',url.indexOf('//')+2));}", "function serverBase(url){return url.substring(0,url.indexOf('/',url.indexOf('//')+2));}", "function mirrorbrain_getVersionForDownloadFolder( version ) {\n\tvar s = null;\n\tif ( version.indexOf( \"_\" ) > -1 ) {\n\t\ts = version.split( \"_\" )[0];\n\t} else {\n\t\ts = version;\n\t}\n\n\tif ( version == VERSION ) {\n\t\treturn version;\n\t} else if ( version == OLD_VERSION ) {\n\t\treturn version;\n\t} else if ( version == RC_VERSION ) {\n\t\treturn s;\n\t} else if ( version == BETA_VERSION ) {\n\t\treturn version;\n\t} else if ( version == DEV1_VERSION ) {\n\t\treturn version;\n\t} else if ( version == DEV2_VERSION ) {\n\t\treturn version;\n\t} else if ( version == TEST_VERSION ) {\n\t\treturn version;\n\t}\n\t// error\n\treturn null;\n}", "function what(){\r\n var url = window.location.pathname;\r\n var reg = url.match(/\\/([s])\\/([0-9a-zA-Z]+)/g);\r\n var reg_entries = url.match(/\\/wpisy/);\r\n var reg_comments = url.match(/\\/komentarze/);\r\n console.log ( url );\r\n if( url == '/' ) \r\n\t\treturn \"contents\";\r\n if( reg )\r\n \treturn \"contents\"; \r\n if( reg_entries) \r\n\t\treturn \"entries\";\r\n\tif( reg_comments)\r\n\t\treturn \"content_comments\";\r\n \r\n return false;\r\n}", "function getVideoId(url)\r\n{\r\n url = url.split(\"?v=\")[1]\r\n try { url = url.split(\"&\")[0]; }\r\n catch (error) {}\r\n return url;\r\n}", "function getBaseAndPath(u){\n var parts = normalize(u).split('#');\n return [ parts[0], unescapePath(((parts[1] || '').split('/').slice(1) || '')) ];\n}", "function GetURLResource(url) {\n var parts = url.split('/');\n var lastSection = parts.pop() || parts.pop();\n if (lastSection) {\n return lastSection;\n }\n else {\n return \"unknown\";\n }\n }", "function getURLSearch() {\n return window.location.search.substring(1);\n}", "function idFromUrl(url) {\n var last3 = url.slice(-3);\n if (last3[0] === \"/\") return url.slice(-2)\n if (last3[1] === \"/\") return url.slice(-1);\n return last3;\n }", "function breakUpFileUrl(sUrl) {\n const nMax = sUrl.length;\n const result = {}\n\n try {\n result.path = \"\"\n result.fileName = sUrl\n \n for (let n=nMax-1;n>-1;n--) {\n if (sUrl.substr(n,1) === \"/\") {\n result.fileName = sUrl.substr(n+1)\n result.path = sUrl.substr(0,n+1)\n break;\n } // end if\n } // next n\n \n return result;\n } catch(err) {\n console.dir(err)\n debugger \n } // end of try/catch\n \n } // end of breakUpFileUrl()", "function _getServerURL() {\r\n var breakPoints = [ 'docs', 'test' ];\r\n var oldArr = location.href.split( '/' );\r\n var newArr = [];\r\n\r\n for( var i = 0; i < oldArr.length; i++ ) {\r\n if( breakPoints.indexOf( oldArr[ i ] ) !== -1 ) break;\r\n\r\n newArr.push( oldArr[ i ] );\r\n }\r\n\r\n newArr.push( 'server/' );\r\n\r\n return newArr.join( '/' );\r\n }", "function generateGetURL(path, data){\n\tvar i = 0;\n\tvar url = base_url + path;\n\tfor (i=0; i<data.length; i++){\n\t\tif (isNaN(data[i]) && data[i].indexOf(\"/\") > 0){\n\t\t\tstep1 = data[i].replace('/','-');\n\t\t\tstep2 = step1.replace('/','-');\n\t\t\tdata[i] = step2;\t\t\t\n\t\t}\n\t\telse if (data[i]==\"\"){\n\t\t\tdata[i] = '-';\n\t\t}\n\t\turl = url + encodeURIComponent(data[i]) + \"/\";\t\t\n\t}\n\turl = url.substring(0, url.length -1);\n\treturn decodeURIComponent(url);\n}", "function getFallbackRedirects (req, requestedVersion) {\n if (versionSatisfiesRange(requestedVersion, `<${firstVersionDeprecatedOnNewSite}`)) return\n if (versionSatisfiesRange(requestedVersion, `>${lastVersionWithoutStubbedRedirectFiles}`)) return\n\n const pathWithNewVersion = req.path.replace(requestedVersion, latest)\n\n // look for a page with the same path on a currently supported version\n const currentlySupportedPage = findPage(pathWithNewVersion, req.context.pages, req.context.redirects)\n if (!currentlySupportedPage) return\n\n // get an array of viable old paths\n return Object.keys(currentlySupportedPage.redirects)\n // filter for just languageless and versionless enterprise old paths\n // example: [\n // '/enterprise/user/articles/viewing-contributions',\n // '/enterprise/user/articles/viewing-contributions-on-your-profile-page',\n // '/enterprise/user/articles/viewing-contributions-on-your-profile'\n // ]\n .filter(oldPath => oldPath.startsWith('/enterprise') && patterns.enterpriseNoVersion.test(oldPath))\n // add in the current language and version\n .map(oldPath => path.join('/', req.context.currentLanguage, oldPath.replace('/enterprise/', `/enterprise/${requestedVersion}/`)))\n // ignore paths that match the requested path\n .filter(oldPath => oldPath !== req.path)\n}", "function route(...etc)\n{\n etc.unshift(stockAPI);\n let sOut = etc.reduce((acc, curr)=>acc+=curr+'/');\n return sOut;\n}", "function baseVersion() {\n location = \"baseVersion.html\";\n}", "getSubRoute(){\n var app = \"\"\n var doc = \"\"\n var url = window.location.href.split(\"#\")\n if (url.length > 1) {\n var parts = url[1].split(\"/\")\n app = parts[1]\n doc = parts[2]\n }\n return [app,doc]\n }", "function myUrlBase ( pathMarker = \"/\" )\n{\n\tlet docUrl = document.documentURI;\n\tlet i = docUrl.lastIndexOf ( pathMarker ); // search the tail\n\tif ( i < 0 ) return docUrl; // found it?\n\t\n\treturn docUrl.substring ( 0, i ); // if yes, return everything but that tail\n}", "function getOmniSplitUrl() {\n var URL = window.location.href;\n var splitURL = URL.split(window.location.protocol + \"//\")[1].split(\"#\")[0].split(\"?\")[0].split(\"/\");\n for (i = 0; i < splitURL.length; i++) {\n if (splitURL[i] === \"\") {\n splitURL.pop();\n }\n }\n return splitURL;\n}", "function transformPageUrl(manuname){\r\n var chosenurl=\"none\";\r\n var urls = document.getElementById(\"manuurl\");\r\n for (var i = 0; i < urls.options.length; i++) {\r\n if(urls.options[i].value.split(\"+\")[0] ==manuname){\r\n\r\n chosenurl=urls.options[i].value.split(\"+\")[1];\r\n break;\r\n }\r\n \r\n }\r\n\r\n return chosenurl;\r\n}", "static getContextStringForUrl(url) {\n let initialUrl = url;\n if (url.startsWith(\"http://\")) {\n url = url.substr(7)\n } else if (url.startsWith(\"https://\")) {\n url = url.substr(8)\n }\n\n let host = url.substr(0, url.indexOf(\"/\"));\n\n console.log(\"picking host=\" + host + \" for url \" + initialUrl);\n return host\n }", "function normalizeVersion(version) {\n const preStrings = [\"beta\", \"rc\", \"preview\"];\n const versionPart = version.split(\".\");\n if (versionPart[1] == null) {\n //append minor and patch version if not available\n // e.g. 2 -> 2.0.0\n return version.concat(\".0.0\");\n }\n else {\n // handle beta and rc\n // e.g. 1.10beta1 -? 1.10.0-beta1, 1.10rc1 -> 1.10.0-rc1\n if (preStrings.some(el => versionPart[1].includes(el))) {\n versionPart[1] = versionPart[1]\n .replace(\"beta\", \".0-beta\")\n .replace(\"rc\", \".0-rc\")\n .replace(\"preview\", \".0-preview\");\n return versionPart.join(\".\");\n }\n }\n if (versionPart[2] == null) {\n //append patch version if not available\n // e.g. 2.1 -> 2.1.0\n return version.concat(\".0\");\n }\n else {\n // handle beta and rc\n // e.g. 1.8.5beta1 -> 1.8.5-beta1, 1.8.5rc1 -> 1.8.5-rc1\n if (preStrings.some(el => versionPart[2].includes(el))) {\n versionPart[2] = versionPart[2]\n .replace(\"beta\", \"-beta\")\n .replace(\"rc\", \"-rc\")\n .replace(\"preview\", \"-preview\");\n return versionPart.join(\".\");\n }\n }\n return version;\n}", "function chooseUri(variants) {\n let randomNum = Math.round(Math.random());\n let chosenUri = variants[randomNum];\n versionNumber = (randomNum + 1).toString(10);\n return chosenUri; \n}", "function getURL(){\n var url;\n if(window.location.hostname.includes('.')){\n switch (window.location.hostname.split('.')[1]) {\n case \"youtube\":\n url = document.location.href.split('&')[0];\n break;\n case \"netflix\":\n case \"nytimes\":\n case \"amazon\":\n url = document.location.href.split('?')[0];\n break;\n default:\n url = document.location.href;\n }\n }else{\n url = document.location.href;\n }\n return url;\n}", "function serverBase(url) {\n\t return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n\t}", "function serverBase(url) {\n\t return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n\t}", "function getParam(regex){\r\n\treturn document.location.pathname.match(regex);\r\n}", "function getVersion(baseUri) {\n return fetch(normalizeBaseUri(baseUri) + \"v1/version\", {\n method: 'get',\n headers: {\n 'Content-Type': 'application/json;charset=UTF-8',\n 'Accept': 'application/json'\n }\n })\n .then(function (r) { return r.json(); });\n}", "function rebaseURL(base, url) {\n if (url.indexOf(\"://\")!==-1 || url[0]===\"/\")\n return url;\n return base.slice(0, base.lastIndexOf(\"/\")+1) + url;\n }", "function normalizeVersion(version) {\n const preStrings = [\"beta\", \"rc\", \"preview\"];\n const versionPart = version.split(\".\");\n // drop invalid\n if (versionPart[1] == null) {\n //append minor and patch version if not available\n // e.g. 2 -> 2.0.0\n return version.concat(\".0.0\");\n }\n else {\n // handle beta and rc\n // e.g. 1.10beta1 -? 1.10.0-beta1, 1.10rc1 -> 1.10.0-rc1\n if (preStrings.some(el => versionPart[1].includes(el))) {\n versionPart[1] = versionPart[1]\n .replace(\"beta\", \".0-beta\")\n .replace(\"rc\", \".0-rc\")\n .replace(\"preview\", \".0-preview\");\n return versionPart.join(\".\");\n }\n }\n if (versionPart[2] == null) {\n //append patch version if not available\n // e.g. 2.1 -> 2.1.0\n return version.concat(\".0\");\n }\n else {\n // handle beta and rc\n // e.g. 1.8.5beta1 -> 1.8.5-beta1, 1.8.5rc1 -> 1.8.5-rc1\n if (preStrings.some(el => versionPart[2].includes(el))) {\n versionPart[2] = versionPart[2]\n .replace(\"beta\", \"-beta\")\n .replace(\"rc\", \"-rc\")\n .replace(\"preview\", \"-preview\");\n return versionPart.join(\".\");\n }\n }\n return version;\n}", "function makeNormalUrl(urlPart) {\n return __WEBPACK_IMPORTED_MODULE_0__constants__[\"f\" /* domainBase */] + __WEBPACK_IMPORTED_MODULE_0__constants__[\"a\" /* apiBaseUrl */] + urlPart;\n}", "function makeNormalUrl(urlPart) {\n return __WEBPACK_IMPORTED_MODULE_0__constants__[\"f\" /* domainBase */] + __WEBPACK_IMPORTED_MODULE_0__constants__[\"a\" /* apiBaseUrl */] + urlPart;\n}", "function parseVid(url) {\n // use positive lookahead, starting to match after \"?v=\"\n const regex = /(?<=\\?v\\=)([A-Za-z0-9_-]+)/;\n const found = url.match(regex);\n\n if (found !== null) {\n return found[0];\n } else {\n return null;\n }\n}", "getVideoID(){\n return location.href.split('/').pop().replace('#','');\n }", "function get_videoID()\r\n{\r\n\tv_id_patch=url.split(\"v=\");\r\n\tid_offset=v_id_patch[1].indexOf(\"&\");\r\n\tif(id_offset==-1) id_offset=v_id_patch[1].length;\r\n\tvid_id=v_id_patch[1].substring(0,id_offset);\r\n}", "function serverBase(url) {\n\t\treturn url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n\t}", "function makeNormalUrl(urlPart) {\n return __WEBPACK_IMPORTED_MODULE_0__constants__[\"b\" /* domainBase */] + __WEBPACK_IMPORTED_MODULE_0__constants__[\"c\" /* apiBaseUrl */] + urlPart;\n}", "function makeNormalUrl(urlPart) {\n return __WEBPACK_IMPORTED_MODULE_0__constants__[\"b\" /* domainBase */] + __WEBPACK_IMPORTED_MODULE_0__constants__[\"c\" /* apiBaseUrl */] + urlPart;\n}", "function getLastNum(url) {\n let end = url.lastIndexOf('/')\n let start = end - 2\n if (url.charAt(start) === '/') {\n start++\n }\n return url.slice(start, end)\n}", "function makeNormalUrl(urlPart) {\n\t return constants.domainBase + constants.apiBaseUrl + urlPart;\n\t}", "function serverBase(url) {\n return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n }", "getTagFromLocation() {\n let a = location.hash.slice(1).split('/')\n return a[a.length-1];\n }", "static normalizeURL(url) {\n if (url == null)\n return null;\n let pos1 = url.indexOf('//');\n if (pos1 == -1)\n return null;\n let pos2 = url.indexOf('/', pos1 + 2);\n if (pos2 == -1)\n return url;\n let pkgName = url.substr(pos1 + 2, pos2 - pos1 - 2);\n let srcName = url.substr(pos2 + 1);\n return UIPackage.getItemURL(pkgName, srcName);\n }", "pathFromUrl(url) {\n return url.substring(0, url.lastIndexOf(\"/\") + 1);\n }", "pathFromUrl(url) {\n return url.substring(0, url.lastIndexOf(\"/\") + 1);\n }", "getTagFromLocation() {\n let a = location.hash.slice(1).split('/')\n return a[a.length-2];\n }", "function normalizeUrl(url) {\n return (url.indexOf('/') === 0 ? url.substr(1) : url);\n }", "function getBaseLink (link) {\n var tmpLinkArr = link.split(/\\//)\n return tmpLinkArr.slice(0, 3).join('/')\n }", "function get_next_slice_url(new_start) {\n var url = new URL(window.location.href);\n var search_params = new URLSearchParams(url.search);\n search_params.set(\"start\", new_start);\n url.search = search_params.toString();\n return url.toString();\n}", "function getURL() {\n var url = window.location.pathname.split('/').slice(0, 4).join('/')\n\n return url + '/' + cid + '/'\n}", "function ksfData_baseUrl()\n{\n\treturn location.href.split(\"#\")[0];\n}", "function getResourceUrl() { return \"http://\"+location.href.split(\"//\")[1].split(\"/\").splice(0,3).join(\"/\")+'.json?api_key='+MoviePilot.apikey;}", "function GetPageFromUrl(url) {\r\n\r\n //var $url = $(this);\r\n parts = url.split('/'),\r\n lastPart = parts.pop() == '' ? parts[parts.length - 1] : parts.pop();\r\n return lastPart;\r\n}", "function serverBase(url) {\n return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n}", "function serverBase(url) {\n return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n}", "function serverBase(url) {\n return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n}", "function serverBase(url) {\n return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n}", "function serverBase(url) {\n return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n}", "function serverBase(url) {\n return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n}", "function serverBase(url) {\n return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n}", "function serverBase(url) {\n return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n}", "function serverBase(url) {\n return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n}", "function serverBase(url) {\n return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n}", "function serverBase(url) {\n return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n}", "function serverBase(url) {\n return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n}", "function serverBase(url) {\n return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n}", "function serverBase(url) {\n return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n}", "function serverBase(url) {\n return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n}", "function serverBase(url) {\n return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n}", "function serverBase(url) {\n return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n}", "function serverBase(url) {\n return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n}", "function serverBase(url) {\n return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n}", "function serverBase(url) {\n return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n}", "function serverBase(url) {\n return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n}", "function serverBase(url) {\n return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n}", "function serverBase(url) {\n return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n}", "function serverBase(url) {\n return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n}", "function serverBase(url) {\n return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n}", "function serverBase(url) {\n return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n}", "function serverBase(url) {\n return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n}" ]
[ "0.629994", "0.6248497", "0.6241973", "0.6241973", "0.6169043", "0.5998651", "0.58641255", "0.5807509", "0.577553", "0.57436085", "0.573082", "0.57080716", "0.5697199", "0.56947345", "0.56690013", "0.5661327", "0.5617613", "0.560411", "0.55708545", "0.5549006", "0.55392975", "0.5529501", "0.5529501", "0.55138206", "0.550698", "0.54716414", "0.54638034", "0.5426696", "0.5395617", "0.53824896", "0.53813374", "0.5366971", "0.53666973", "0.5362449", "0.5359834", "0.5326071", "0.5312559", "0.53114164", "0.5297179", "0.5282261", "0.5274914", "0.52583086", "0.5254099", "0.5253509", "0.5251767", "0.5251767", "0.5237515", "0.5225166", "0.52188516", "0.52164835", "0.5214881", "0.5214881", "0.5213104", "0.5206111", "0.52012", "0.520085", "0.51939005", "0.51939005", "0.518908", "0.5186922", "0.51843417", "0.5183928", "0.51809496", "0.51809347", "0.51809347", "0.5180008", "0.5169007", "0.5167869", "0.5166377", "0.51639867", "0.5156336", "0.51557064", "0.51464003", "0.5141894", "0.5141894", "0.5141894", "0.5141894", "0.5141894", "0.5141894", "0.5141894", "0.5141894", "0.5141894", "0.5141894", "0.5141894", "0.5141894", "0.5141894", "0.5141894", "0.5141894", "0.5141894", "0.5141894", "0.5141894", "0.5141894", "0.5141894", "0.5141894", "0.5141894", "0.5141894", "0.5141894", "0.5141894", "0.5141894", "0.5141894" ]
0.74001163
0
Here is a helper function to populate info windows
function populateInfoWindow(marker, infowindow) { // Check to make sure the infowindow is not already opened on this marker. if (infowindow.marker != marker) { infowindow.marker = marker; infowindow.setContent('<div>' + marker.title + '</div>'); infowindow.open(map, marker); // Make sure the marker property is cleared if the infowindow is closed. infowindow.addListener('closeclick', function() { infowindow.marker = null; }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setInfoWindowContents() {\n for (const store of brewData) {\n coordObj.lat = store.latitude;\n coordObj.lng = store.longitude;\n createMarker(store, coordObj);\n\n loc = new google.maps.LatLng(marker.position.lat(), marker.position.lng());\n bounds.extend(loc);\n\n hours = store.hoursOfOperation || '';\n\n address = store.streetAddress || '';\n\n description = store.brewery.description || 'No Description Avaliable';\n\n phone = store.phone || '';\n\n if (store.website === undefined) {\n website = '';\n brewName = '';\n } else {\n website = store.website;\n brewName = store.brewery.name;\n }\n\n if (store.brewery.images === undefined) {\n logo = '';\n } else {\n logo = `<img src=${store.brewery.images.medium}>`;\n }\n\n\n content = '<div id=\"content\">' +\n `<h3 id=\"firstHeading\" class=\"firstHeading\">${store.brewery.name}</h3>` +\n `<div>${logo}` +\n '<div id=\"bodyContent\">' +\n `${description} ` +\n '</div>' +\n '</br>' +\n `<div>${address}</div>` +\n '</br>' +\n `<div>${hours}</div>` +\n '</br>' +\n `<div><a href='tel:${phone}'>${phone}</div>` +\n '</br>' +\n `<div><a href=${website}>${brewName}</div>` +\n '</div>';\n\n infowindow = new google.maps.InfoWindow({\n content: content\n });\n\n setEventListner();\n }\n }", "function InfoBarWindow(){}", "function information() {\n\t//alert(\"Created by Monica Michaud\\nIn the Institute for New Media Studies\\nAdviser: Gordon Carlson, PhD\\nDev Version: 0.2 (Apr 25)\");\n\n\tvar mapInfoBoxString;\n\t\n\tmapInfoBoxString = '<div id=\"content\"><h1 id=\"infoWindowHeading\" class=\"infoWindowHeading\">Information : </h1>' +\n\t\t'<div id=\"infoWindowBodyContent\"><p>Created by Monica Michaud <br /> In the Institute for New Media Studies <br /> Adviser: Gordon Carlson, PhD <br /> Dev Version: 0.2 (Apr 25)</p></div></div>';\n\t\n\tmap.setCenter(MAP_CENTER_COORDINATES); \n\tinfoWindow.setContent(mapInfoBoxString);\n\tinfoWindow.setPosition(MAP_CENTER_COORDINATES);\n\tinfoWindow.open(map);\n}", "function infoWindowCreate() {\n var infoWindows = new google.maps.InfoWindow();\n return infoWindows;\n}", "function populateInformationModal() {\n\t// add text to the label\n\tvar category = allViews[activeView];\n\t// trim the heading \"TissueSpecific\" if necessary\n\tif (category.substr(0,14) == \"TissueSpecific\") {\n\t\tcategory = category.substr(14);\n\t}\n\t$('#informationLabel').text(category+\" Information\"); \n\t\n\t// now put info text in body\n\t$('#informationBody').html(allInfoFiles[activeView]);\n\t\n}", "function showInfoWindow() { \n currentmarker = this;\n infoWindow.open(map, currentmarker);\n buildIWContent();\n\n}", "function createInfoWindow(KMLEvent_latLng, infoData) {\r\n CommonInfoWindow.close();\r\n //$(\"#map-loader\").hide();\r\n\r\n var content = \"<div class='content infoDiv'>\";\r\n if (infoData.establishments.length > 1) {\r\n content += \"<div class='row infoRow'><div class='col-md-12'><span class='infoImportant'>\" + infoData.address + \"</span></div></div>\";\r\n content += \"<div class='row infoRow infoHeader'><div class='col-md-12'>\" + infoData.establishments.length + \" establishments at this address</div></div>\";\r\n } else {\r\n content += \"<div class='row infoRow infoHeader'><div class='col-md-12'><span class='infoImportant'>\" + infoData.address + \"</span></div></div>\";\r\n \r\n }\r\n for (var i = 0; i < infoData.establishments.length; i++) {\r\n content += \"<div class='row infoRow'><div class='col-md-12'><img src='\" + statusIcons[infoData.establishments[i].status].medium + \"'>&nbsp;&nbsp;<span class='infoImportant orgLink'><a href='#' data-id='\" + infoData.establishments[i].estId + \"'>\" + infoData.establishments[i].name + \"</a></span></div></div>\";\r\n }\r\n content += \"<div class='row infoRow'><div class='col-md-12'><a class='svLink' href='#' data-latlng='\" + KMLEvent_latLng + \"'><img src='\" + STREET_VIEW_ICON + \"' alt='StreetView'></a></div></div>\";\r\n \r\n //} \r\n content += \"</div>\"; \r\n CommonInfoWindow.setOptions({ \"position\": KMLEvent_latLng,\r\n \"pixelOffset\": 0, //KMLEvent.pixelOffset,\r\n \"content\": content}); //KMLEvent.featureData.infoWindowHtml.replace(/ target=\"_blank\"/ig, \"\") });\r\n CommonInfoWindow.open(gblMap);\r\n}", "function info(title) {\r\n var text = \"...\"\r\n var string = \"<html><head><style>li { padding: 5px; } .help_text_header { font-size: 1.3em; font-weight: bold; }</style><title>\" + title + \"</title><body style='font-family: Arial,Helvetica,sans-serif; font-size: 80%;'>\";\r\n string += \"<h2>\" + title + \"</h2> \";\r\n string += \"<p style='text-align: justify'>\" + dummy_text + \"</p>\";\r\n string += \"<br/><br/><a href='javascript:window.close()' style='color: #A14685; font-size: 0.9em; font-weight: bold; text-decoration: none;'>\" + \"CLOSE\" + \"</a>\";\r\n string += \"</body></html>\";\r\n var popupWidth = 700;\r\n var popupHeight = 500;\r\n var left = (screen.width - popupWidth) / 2;\r\n var top = (screen.height - popupHeight) / 4;\r\n helpWindow = window.open('', 'id1', 'scrollbars=yes, left=' + left + ', top=' + top + ', width=' + popupWidth + ', height=' + popupHeight);\r\n helpWindow.document.open(\"text/html\");\r\n helpWindow.document.write(string);\r\n helpWindow.document.close();\r\n}", "function buildInfoWindow(id) {\r\n\t// Information shown in window\r\n\tvar name;\r\n\tvar publish;\r\n\tvar pubmed;\r\n\tvar integ;\r\n\tvar zfin;\r\n\tvar anatomy;\r\n\tvar scanned;\r\n\tvar smed;\r\n\r\n\t// Finding line's information based on id and type\r\n\tif(includes(TRANSGENIC, id)) {\r\n\t\tvar index = TRANSGENIC.indexOf(id);\r\n\t\tname = TRANSGENIC_NAMES[index];\r\n\t\tpublish = TRANSGENIC_PUBLISHED[index];\r\n\t\tpubmed = TRANSGENIC_PUBMED[index];\r\n\t\tinteg = TRANSGENIC_INTEGRATION_SITE[index];\r\n\t\tzfin = TRANSGENIC_ZFIN_FEATURE[index];\r\n\t\tanatomy = TRANSGENIC_ANATOMY[index];\r\n\t\tscanned = TRANSGENIC_SCANNED[index];\r\n\t\tsmed = TRANSGENIC_SPUBMED[index];\r\n\t} else if(includes(GAL4, id)) {\r\n\t\tvar index = GAL4.indexOf(id);\r\n\t\tname = GAL4_NAMES[index];\r\n\t\tpublish = GAL4_PUBLISHED[index];\r\n\t\tpubmed = GAL4_PUBMED[index];\r\n\t\tinteg = GAL4_INTEGRATION_SITE[index];\r\n\t\tzfin = GAL4_ZFIN_FEATURE[index];\r\n\t\tanatomy = GAL4_ANATOMY[index];\r\n\t\tscanned = GAL4_SCANNED[index];\r\n\t\tsmed = GAL4_SPUBMED[index];\r\n\t} else if(includes(CRE, id)) {\r\n\t\tvar index = CRE.indexOf(id);\r\n\t\tname = CRE_NAMES[index];\r\n\t\tpublish = CRE_PUBLISHED[index];\r\n\t\tpubmed = CRE_PUBMED[index];\r\n\t\tinteg = CRE_INTEGRATION_SITE[index];\r\n\t\tzfin = CRE_ZFIN_FEATURE[index];\r\n\t\tanatomy = CRE_ANATOMY[index];\r\n\t\tscanned = CRE_SCANNED[index];\r\n\t\tsmed = CRE_SPUBMED[index];\r\n\t} else if(includes(MISC, id)) {\r\n\t\tvar index = MISC.indexOf(id);\r\n\t\tname = MISC_NAMES[index];\r\n\t\tpublish = MISC_PUBLISHED[index];\r\n\t\tpubmed = MISC_PUBMED[index];\r\n\t\tinteg = MISC_INTEGRATION_SITE[index];\r\n\t\tzfin = MISC_ZFIN_FEATURE[index];\r\n\t\tanatomy = MISC_ANATOMY[index];\r\n\t\tscanned = MISC_SCANNED[index];\r\n\t\tsmed = MISC_SPUBMED[index];\r\n\t} else {\r\n\t\tname = HUC_CER_NAME[0];\r\n\t\tpublish = HUC_CER_PUBLISHED[0];\r\n\t\tpubmed = HUC_CER_PUBMED[0];\r\n\t\tinteg = HUC_CER_INTEGRATION_SITE[0];\r\n\t\tzfin = HUC_CER_ZFIN_FEATURE[0];\r\n\t\tanatomy = HUC_CER_ANATOMY[0];\r\n\t\tscanned = HUC_CER_SCANNED[0];\r\n\t\tsmed = HUC_CER_SPUBMED[0];\r\n\t}\r\n\r\n\t// Constructing HTML for info window\r\n\t// Styles are also provided in style tags because this window doesn't link to any stylesheets\r\n\tvar infoText = \t'<title>' +\r\n\t\t\t\t\t\t(name == '' ? id : name) + ' Info' +\r\n\t\t\t\t\t'</title>' +\r\n\t\t\t\t\t'<style>' +\r\n\t\t\t\t\t'body {' +\r\n\t\t\t\t\t\t'margin: 0;' +\r\n\t\t\t\t\t\t'overflow-y: hidden;' +\r\n\t\t\t\t\t'}' +\r\n\t\t\t\t\t'.ind-info {' +\r\n\t\t\t\t\t\t'font-family: verdana;' +\r\n\t\t\t\t\t\t'position: absolute;' +\r\n\t\t\t\t\t\t'top: 8px;' +\r\n\t\t\t\t\t\t'bottom: 8px;' +\r\n\t\t\t\t\t\t'left: 8px;' +\r\n\t\t\t\t\t\t'right: 8px;' +\r\n\t\t\t\t\t\t'color: white;' +\r\n\t\t\t\t\t\t'padding: 19px;' +\r\n\t\t\t\t\t\t'border-radius: 20px;' +\r\n\t\t\t\t\t\t'box-shadow: 0 0 20px black;' +\r\n\t\t\t\t\t\t'background: #555555;' +\r\n\t\t\t\t\t'}' +\r\n\t\t\t\t\t'.header-p {' +\r\n\t\t\t\t\t\t'margin-bottom: 0;' +\r\n\t\t\t\t\t\t'font-weight: bold;' +\r\n\t\t\t\t\t'}' +\r\n\t\t\t\t\t'.text-p {' +\r\n\t\t\t\t\t\t'margin-top: 0;' +\r\n\t\t\t\t\t'}' +\r\n\t\t\t\t\t'.zfin-link {' +\r\n\t\t\t\t\t\t'color: white;' +\r\n\t\t\t\t\t'}' +\r\n\t\t\t\t\t'</style>' +\r\n\t\t\t\t\t'<div id=\"' + id + '-info\" class=\"ind-info\">' +\r\n\t\t\t\t\t\t'<p class=\"header-p\">Line:</p>' +\r\n\t\t\t\t\t\t'<p class=\"text-p\">' + (name == '' ? id : name) + '</p>' +\r\n\t\t\t\t\t\t'<p class=\"header-p\">Published:</p>' +\r\n\t\t\t\t\t\t'<p class=\"text-p\">' + (pubmed == '' ? '' : '<a class=\"zfin-link\" href=\"https://www.ncbi.nlm.nih.gov/pubmed/' + pubmed + '\" target=\"_blank\">') + publish + (pubmed == '' ? '' : '</a>') + '</p>' +\r\n\t\t\t\t\t\t'<p class=\"header-p\">Integration Site:</p>' +\r\n\t\t\t\t\t\t'<p class=\"text-p\">'+ integ + '</p>' +\r\n\t\t\t\t\t\t'<p class=\"header-p\">ZFIN Feature:</p>' +\r\n\t\t\t\t\t\t'<p class=\"text-p\"><a class=\"zfin-link\" href=\"' + zfin + '\" target=\"_blank\">' + zfin + '</a></p>' +\r\n\t\t\t\t\t\t'<p class=\"header-p\">Anatomy:</p>' +\r\n\t\t\t\t\t\t'<p class=\"text-p\">' + anatomy + '</p>' +\r\n\t\t\t\t\t\t'<p class=\"header-p\">Scanned By:</p>' +\r\n\t\t\t\t\t\t'<p class=\"text-p\">' + (smed == '' ? '' : '<a class=\"zfin-link\" href=\"https://www.ncbi.nlm.nih.gov/pubmed/' + smed + '\" target=\"_blank\">') + scanned + (smed == '' ? '' : '</a>') + '</p>' +\r\n\t\t\t\t\t'</div>';\r\n\r\n\t// Opening info window\r\n\tvar infoWindow = window.open('', id + '-window-' + windowCounter++, 'width=500px,height=500px'); // windowCounter is used and incremented to make sure every window opened is unique\r\n\tinfoWindow.document.write(infoText); // Writing constructed HTML to window\r\n}", "function infoWindows(marker, data) {\n //Event listener for when a marker i clicked\n google.maps.event.addListener(marker, \"click\", function (e) {\n //Wrap the content inside an HTML DIV in order to set height and width of InfoWindow.\n infoWindow.setContent(\"<div style = 'max-height:300px'>\" + '<p style=\"font-size: 24px; text-decoration: underline;\"><strong><a href=\"' + data.link + '\" target=\"blank\">' + data.name + '</a></strong></p>' + \"<br><p>\" + data.description + \"</p></div>\");\n //Open the markers infowindow\n infoWindow.open(map, marker);\n });\n }", "function buildMarkers(){\n\tfor (q=0; q<=2; q++){\n\t\tinfoWindow[q] = new google.maps.InfoWindow({\n\t\t\tcontent: contentString[q]\n\t });\n\t\t\t\n\t}\n}", "function openInfoWindow() {\n infobox.close();\n infobox.setContent(contentString.replace('%user', walker.user).replace('%phone', walker.phone));\n infobox.setOptions(infoBoxOptions);\n infobox.open(map, marker);\n }", "function getInfoWindowContent(location){\r\n\tvar content = '';\r\n\tvar placeType = '';\r\n\tfor (var i=0; i < locationInfo.length; i++) {\r\n\t\tif (locationInfo[i].place === location) {\r\n\t\t\tplaceType = getPlaceType(locationInfo[i].type);\r\n\r\n\t\t\tcontent += '<div class=\"info-window clearfix\">'\r\n\t\t\tcontent += '<h4 class=\"map-title\">' + locationInfo[i].place + '</h4>';\r\n\t\t\tcontent += '<h5 class=\"map-title\">' + placeType + '</h5>';\r\n\t\t\tcontent += '<p>' + locationInfo[i].description + '</p>';\r\n\t\t\tcontent += '<div class=\"info-window-pic-container\">'\r\n\t\t\tcontent += '<img class=\"info-window-pic\" src=\"' + locationInfo[i].image_url + '\" alt=\"' + locationInfo[i].image_alt + '\">'\r\n\t\t\tcontent += '<p class=\"map-image-caption\"> Image courtesy of ' + locationInfo[i].image_attribute + '</>'\r\n\t\t\tcontent += '</div>'\r\n\t\t\tcontent += '</div>'\r\n\t\t}\r\n\t}\r\n\treturn content;\r\n}", "function showInfoWindow() {\n var marker = this;\n places.getDetails({ placeId: marker.placeResult.place_id },\n function(place, status) {\n if (status !== google.maps.places.PlacesServiceStatus.OK) {\n return;\n }\n infoWindow.open(map, marker);\n buildIWContent(place);\n\n // Checks what the dropdown list is currently selected on and fills either\n // text boxes with the location's name.\n if (document.getElementById('poi').value === 'lodging') {\n document.getElementsByClassName('selectedHotelTB')[0].value =\n place.name,\n // Stores address for Navigation.\n startID = place.formatted_address;\n // Displays the text boxes for selected locations.\n showDisplayTwo();\n\n }\n else {\n document.getElementsByClassName('selectedPOItb')[0].value =\n place.name,\n // Stores address for Navigation.\n finishID = place.formatted_address;\n // Displays the POI textbox.\n showDisplayFour();\n }\n // if textbox ISN'T empty then display satnav btn.\n if (document.getElementsByClassName('selectedPOItb')[0].value !== \"\") {\n showDisplayThree();\n }\n else {\n return;\n }\n });\n}", "function setInfowindowMarkup(info) {\n return '<h4>'+ info['name'] +'</h4>' +\n '<p>'+ info['street'] + ' ' + info['city'] + ' ' + info['state'] + '</p>';\n}", "function createInfoWindowContent(place) {\n console.log(place);\n var content = '<div id=info>' +\n '<h4>' + place.name + '</h4>';\n\n if (place.shouldShowRating) {\n content = content.concat('<p>FourSquare Rating: ' + place.rating + '</p>');\n }\n\n if (place.status) {\n var cssClass = place.isOpen ? \"status-open\" : \"status-closed\";\n content = content.concat('<div class=' + cssClass + '>');\n content = content.concat('<p>' + place.status + '</p>');\n content = content.concat('</div>');\n }\n\n if (place.url) {\n content = content.concat('<a href=' + place.url + '>' + place.url +'</a>');\n }\n\n content = content.concat('<p>Powered by FourSquare</p>');\n\n return content;\n\n}", "function populateInfoWindow(marker, infoWindow) {\n // close open infoWindow\n infoWindow.close();\n\n // Animate marker\n marker.setAnimation(google.maps.Animation.BOUNCE);\n setTimeout(function() {\n marker.setAnimation(null);\n }, 1440);\n\n // Create a list used to display 3 pictures of each location\n var picList = \"<ul class=\\\"pic-list\\\">\";\n\n marker.photos.forEach(function(picture){\n if (picture.prefix && picture.suffix) {\n picList += \"<li class=\\\"pic-list-item\\\"><img src=\\\"\" + picture.prefix + 100 + picture.suffix + \"\\\" class=\\\"info-img\\\">\";\n }\n });\n\n picList += \"</ul>\";\n\n // Create infoWindow content\n var content = \"<div>\" +\n picList +\n \"<ul class=\\\"info-list\\\">\" +\n \"<li><h4>\" + marker.name + \"</h4></li>\" +\n \"<li>\" + marker.address + \"</li>\" +\n \"<li>\" + marker.city + \", \" + marker.state + \" \" + marker.postalCode + \"</li>\" +\n \"<li><a href=\\\"tel:\" + marker.phone + \"\\\">\" + marker.phone + \"</a></li>\" +\n \"<li><a href=\\\"\" + marker.markerURL + \"\\\" target=blank>\" + marker.markerURL + \"</a></li>\" +\n \"</ul>\" +\n \"<p>Powered by Foursquare</p>\" +\n \"</div>\";\n\n // set content and location of infoWindow\n infoWindow.setContent(content);\n infoWindow.setPosition(marker.position);\n infoWindow.open(map, marker);\n }", "function testInfoWindow(){\n var infoWindow = new google.maps.InfoWindow({\n content: \"<div class='latestPhotoInfo'><img src='http://distilleryimage7.instagram.com/8ae63806970311e1af7612313813f8e8_7.jpg'/></div>\",\n position: new google.maps.LatLng(0, 151)\n });\n infoWindow.open(realtimeMap);\n}", "function pop_up_window(abbrev,def)\r\n {\r\n //\r\n var generator=window.open('','info','height=' + \r\n info_window_height + ',width=' +\r\n info_window_width + ',resizable=yes,scrollbars=yes,toolbar=yes');\r\n //\r\n //\r\n generator.document.write('<html><head><title>Abbreviation: ' + abbrev + '</title>');\r\n generator.document.write('<link rel=\"stylesheet\" href=\"reset.css\">');\r\n generator.document.write('<link rel=\"stylesheet\" href=\"text.css\">');\r\n generator.document.write('<link rel=\"stylesheet\" href=\"960.css\">');\r\n generator.document.write('<link rel=\"stylesheet\" href=\"wwi.css\">');\r\n generator.document.write('</head><body>');\r\n generator.document.write('<div class=\"container_16\"><div class=\"grid_14 prefix_1 suffix_1\">');\r\n \r\n generator.document.write('<h1 class=\"heading1\">Abbreviation: ' + abbrev + '</h1>');\r\n generator.document.write('<p class=\"body\">Abbreviation: ' +\r\n abbrev + '<br class=\"x\"/> Definition: ' + def + '</p>');\r\n generator.document.write('<p><a href=\"javascript:self.close()\">Close</a> the popup.</p>');\r\n generator.document.write('</div><div class=\"clear\"></div></div>'); // end all divs\r\n generator.document.write('</body></html>');\r\n generator.document.close();\r\n }", "function populateInfoWindow(marker, infowindow) {\n if (infowindow.marker != marker) {\n infowindow.marker = marker;\n infowindow.setContent('<div id=infoWindow>' + marker.title + '</div>');\n infowindow.open(map, marker);\n infowindow.addListener('closeclick', function() {\n infowindow.setMarker = null;\n });\n }\n }", "function infoWindows(marker, data) {\n //Event listener for when a marker i clicked \n google.maps.event.addListener(marker, \"click\", function (e) {\n //Wrap the content inside an HTML DIV in order to set height and width of InfoWindow.\n infoWindow.setContent(\"<div style = 'max-height:300px'>\" + \"<p style='font-size: 24px; text-color: red;'><strong>Meetup only supports location accuracy by zip code within the USA, Canda and GB</strong></p><br><p style='font-size: 18px;'>Here is a list of all the Meetups in the city of \" + data.city + ':' + '</p><br><a style=\"font-size: 18px;\" href=\"http://www.meetup.com/cities/'+data.country+'/'+data.city+'\" target=\"blank\">List of all Meetups in '+data.city+'</a></div>');\n //Open the markers infowindow\n infoWindow.open(map, marker);\n });\n }", "function populateInfoWindow(marker, infowindow) {\n if (infowindow.marker == marker) {\n infowindow.marker = marker;\n infowindow.addListener('closeclick', function() {\n infowindow.marker = null;\n marker.setIcon(makeMarkerIcon('0091ff'));\n });\n \n // Add content to info window. Can be made richer and as needed.\n var content = \"<div class='infoWindowTitle'>\" + marker.title + \"</div>\";\n if(marker.content) {\n content += \"<div class='infoWindowContent'>\" + marker.content + \"</div>\";\n }\n \n infowindow.setContent(content);\n infowindow.open(map, marker);\n }\n}", "function createInfoWindow(marker, content) {\n // open info window with created content\n infoWindow = new google.maps.InfoWindow({\n content: content\n });\n\n infoWindow.open(map, marker);\n \n // turn popover windows on\n $('[data-toggle=\"popover\"]').popover();\n\n // to close mobile popovers\n $('[data-toggle=\"popover\"]').click(function(evt) {\n $(this).popover(\"hide\");\n });\n\n\n }", "function openInfoWindow(map, marker, infoWindow) {\n const windowNode = document.createElement(\"div\");\n\n let owner = document.createElement(\"div\");\n owner.innerText = marker.owner;\n owner.className = \"user-nickname\";\n windowNode.appendChild(owner);\n\n let overview = document.createElement(\"div\");\n overview.innerText = marker.overview;\n overview.className = \"task-content-marker\";\n windowNode.appendChild(overview);\n\n let category = document.createElement(\"div\");\n category.innerText = \"#\" + marker.category;\n category.className = \"task-category\";\n windowNode.appendChild(category);\n\n let dateTime = document.createElement(\"div\");\n dateTime.innerText = marker.dateTime;\n dateTime.className = \"task-date-time\";\n windowNode.appendChild(dateTime);\n\n // adds help out option\n if (marker.get(\"isCurrentUser\") == false) {\n const helpOutButton = document.createElement(\"button\");\n helpOutButton.innerText = \"Help Out\";\n helpOutButton.className = \"help-out-marker\";\n\n // adds help out button click event\n helpOutButton.addEventListener(\"click\", function(e) {\n let helpOverlay = document.getElementById(\"help-overlay-map\");\n helpOverlay.style.display = \"block\";\n\n // adds confirm help click event\n document.getElementById(\"confirm-map\").addEventListener(\"click\", function(e) {\n confirmHelp(marker.get(\"key\"));\n helpOverlay.style.display = \"none\";\n e.stopPropagation();\n });\n\n // adss exit help click event\n document.getElementById(\"exit-help-map\").addEventListener(\"click\", function(e) {\n helpOverlay.style.display = \"none\";\n e.stopPropagation();\n });\n e.stopPropagation();\n });\n windowNode.appendChild(helpOutButton);\n }\n\n // adds click even to open up the task details modal\n windowNode.addEventListener(\"click\", function() {\n showTaskInfo(marker.get(\"key\"));\n });\n \n infoWindow.setContent(windowNode);\n infoWindow.open(map, marker);\n infoWindows.push(infoWindow);\n}", "function showInfoWindowApi() {\n var marker = this;\n\n console.log(infoWindow);\n infoWindow.open(map, marker);\n buildIWContentApi(marker.placeResult);\n}", "function populateInfoWindow(details, marker, infowindow) {\n\n var content = '<div class=\"card\" style=\"width: 12rem;\">\\n' +\n ' <img class=\"card-img-top\" src=\"'+details.picture+'\" alt=\"Card image cap\">\\n' +\n ' <div class=\"card-body\">\\n' +\n ' <h5 class=\"card-title\">'+details.name+'</h5>\\n' +\n ' <p class=\"card-text\">'+details.address+'</p>\\n' +\n ' </div>\\n' +\n '</div>';\n // check if infoWindow is already opened\n if (infowindow.marker != marker) {\n infowindow.marker = marker;\n infowindow.setContent(content);\n infowindow.open(map, marker);\n // clear marker when infoWindow is closed\n infowindow.addListener(\"closeclick\", function(){\n infowindow.setMarker = null;\n });\n }\n }", "function showInfoWindow() {\n var marker = this\n places.getDetails({ placeId: marker.placeResult.place_id }, function(\n place,\n status\n ) {\n if (status !== google.maps.places.PlacesServiceStatus.OK) {\n return\n }\n\n buildIWContent(map, marker, place)\n })\n}", "function initInformationWindow(position, content){\t\t\n\t\tvar options\t\t\t= new Object();\n\t\toptions.content\t\t= content;\n\n\t\tself.infowindow = new google.maps.InfoWindow(options);\n\t}", "function showInfoWindow() {\n var marker = this;\n placesService.getDetails({placeId: marker.placeResult.place_id},\n function(place, status) {\n if (status !== google.maps.places.PlacesServiceStatus.OK) {\n return;\n }\n infoWindow.open(map, marker);\n buildIWContent(place);\n });\n }", "function populateInfoWindow(marker, infowindow) {\n // Check to make sure the infowindow is not already opened on this marker.\n if (infowindow.marker != marker) {\n infowindow.marker = marker;\n infowindow.setContent(\"<div class='markerTitle'>\" + marker.title + \"</div>\");\n infowindow.setContent(\"<div class='markerDescription'>\" + marker.description + \"</div>\");\n infowindow.open(map, marker);\n // Make sure the marker property is cleared if the infowindow is closed.\n infowindow.addListener(\"closeclick\", function() {\n infowindow.marker = null;\n });\n }\n }", "function populateInfoWindow(marker, infowindow) {\n\t\t\t// Check to make sure the infowindow is not already opened on this marker.\n\t\t\t\tif (infowindow.marker != marker) {\n\t\t\t\t\t\tinfowindow.marker = marker;\n\t\t\t\t\t\t// Wiki(marker.location);\n\t\t\t\t\t\tmarker.setAnimation(google.maps.Animation.BOUNCE);\n\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t\t\tmarker.setAnimation(null);\n\t\t\t\t\t\t}, 1000);\n\t\t\t\t\t\t// Wiki(marker.location);\n\t\t\t\t\t\t\n\t\t\t\t\t\tinfowindow.setContent(wikicontent + '<hr>' + '<div>' + marker.title + '</div>');\n\t\t\t\t\t\tconsole.log('information window : '+ wikicontent);\n\t\t\t\t\t\tinfowindow.open(map, marker);\n\t\t\t\t\t\t// Make sure the marker property is cleared if the infowindow is closed.\n\t\t\t\t\t\tinfowindow.addListener('closeclick', function() {\n\t\t\t\t\t\t\t\tinfowindow.marker = null;\n\t\t\t\t\t\t});\n\t\t\t\t}\n\t\t}", "function getInfoWindowContent(data, type) {\n var html = ``;\n switch(type) {\n\n // Customer\n case 'customer':\n html += `<div class=\"gmap__infowindow ${type}\">`;\n html += `<div class=\"row\">`;\n html += `<div class=\"col__icon\"><i class='material-icons'>&#xe0af</i></div>`;\n html += `<div class=\"col__content\"><b>${data.name}</b><br/>${data.address}</div>`;\n html += `</div>`;\n html += `<div class=\"row\"><hr/></div>`;\n html += `<div class=\"row\">`;\n html += `<div class=\"col__icon\">&nbsp;</div>`;\n html += `<div class=\"col__content\"><b>Last visited:</b> ${data.last_visit}<br/>`;\n html += `<a href=\"#\" data-toggle=\"appointment-modal\" data-cname=\"${data.name}\" data-cid=\"${data.id}\" data-srname=\"${data.sr_name}\" data-srid=\"${data.sr_id}\" data-addr=\"${data.address}\">Schedule Appointment...</a></div>`;\n html += `</div>`;\n html += `</div>`;\n break;\n \n // Sales Rep Checked-In Location\n case 'checkin':\n html += `<div class=\"gmap__infowindow ${type}\">`;\n html += `<div class=\"row\">`;\n html += `<div class=\"col__icon\"><i class='material-icons'>event</i></div>`;\n html += `<div class=\"col__content\">${data.visit_time} &nbsp;&nbsp; ${data.visit_date}</div>`;\n html += `</div>`;\n html += `<div class=\"row\"><hr/></div>`;\n html += `<div class=\"row\">`;\n html += `<div class=\"col__icon\"><i class='material-icons'>&#xe0af</i></div>`;\n html += `<div class=\"col__content\"><b>Customer Name:</b><br/>`;\n html += `${data.customer}<br/>`;\n html += `${data.customer_address}<br/>`;\n html += `<span class=\"loc__last-checkin\" style=\"margin-top:5px\">`;\n html += `<i class=\"material-icons\">beenhere</i>`;\n html += `<span>${data.last_seen} </span>`;\n html += `</span></div>`;\n html += `</div>`;\n html += `<div class=\"row\"><hr/></div>`;\n html += `<div class=\"row\">`;\n html += `<div class=\"col__icon\"><i class='material-icons text-danger'>&#xe55f</i></div>`;\n html += `<div class=\"col__content\"><b>GPS Address</b><br/>${data.gps_address}</div>`;\n html += `</div>`;\n html += `<div class=\"row\" style=\"margin-top:13px\">`;\n html += `<div class=\"col__icon\"><i class='material-icons' style=\"color:#32DB64\">beenhere</i></div>`;\n html += `<div class=\"col__content\"><b>Rep Reported Address</b><br/>${data.address}</div>`;\n html += `</div>`;\n html += `</div>`;\n break;\n \n // Sales Rep GPS Location\n case 'salesrep':\n html += `<div class=\"gmap__infowindow ${type}\">`;\n html += `<div class=\"row\">`;\n html += `<div class=\"col__icon\"><i class='material-icons'>&#xe7fd</i></div>`;\n html += `<div class=\"col__content\">Sales Rep: <b>${data.name}</b></div>`;\n html += `</div>`;\n html += `<div class=\"row\" style=\"margin-top:13px\">`;\n html += `<div class=\"col__icon\"><i class='material-icons text-danger'>&#xe55f</i></div>`;\n html += `<div class=\"col__content\"><b>GPS Address</b><br/>${data.address}</div>`;\n html += `</div>`;\n html += `</div>`;\n break;\n }\n return html;\n}", "function createNewInfoWindow(coord, content){\n // information window is displayed at click position\n\tmapCollector.infowindow = new google.maps.InfoWindow({\n\t \tcontent: content,\n\t \tposition: coord\n\t});\n }", "function PopUp_Info(i) {\n console.log(i);\n $('<div id=\"window-popup\"><div id=\"window-content\"></div></div>').appendTo('body');\n $('<div id = \"close\"><img src=\"IMG/close-button.gif\"></div>').appendTo('#window-content');\n\n $('<div class = \"text\"><img id = \"pic\" src=' + data[i].image + '></div>').appendTo('#window-content');\n $('<div class = \"text\"><b>' + data[i].name + '</b></div>').appendTo('#window-content');\n $('<hr>').appendTo('#window-content');\n $('<div id = \"description\">' + data[i].desc + '</div>').appendTo('#window-content');\n $('#close').click(function() {\n $('#window-popup').remove();\n });\n }", "function setListingInfo(info){\n\n\tconsole.log('setListingInfo.1.0: ', info);\n\t//setup the popup.html, show the available listing\n\t$('#status').text(info.status);\n\t$('#manage').text(info.manage);\n\t$('#postdate').text(info.postedDate);\n\t$('#title').text(info.title);\n}", "function makeInfoBox(config) {\n var html = '' +\n '<div class=\"mappopup\">' +\n '<h4>' + config.title + '</h4>' +\n '<p>' + config.content + '</p>' +\n '<a href=\"' + config.url + '\" ' + (config.external ? 'target=\"_blank\"' : '') + '>' +\n config.linktext +\n '</a>' +\n '</div>';\n\n return new google.maps.InfoWindow({\n content: html\n });\n}", "function populateInfoWindow(marker, infowindow) {\n\t//check if the infowindow is already opened on this marker\n\tif (!infowindow || infowindow.marker == marker)\n\t\treturn;\n\n\t// Animate the marker\n\tmarker.setAnimation(google.maps.Animation.BOUNCE)\n\tsetTimeout(function(){\n\t\tmarker.setAnimation(null);\n\t},700);\n\n\tinfowindow.setContent('<div class=\"iw-container\">'+\n '<div class=\"iw-title\">' + marker.title + '</div>'+\n '<div class=\"info-container\">');\n\tinfowindow.marker = marker;\n\t// Clear the marker property when closing the infowindow.\n infowindow.addListener('closeclick', function() {\n infowindow.marker = null;\n });\n\n loadFoursquare_Wikipedia(marker.position, marker.title, infowindow);\n\n map.panTo(marker.getPosition());\n\n infowindow.open(map, marker);\n}", "function infoBox(){\n\t//\tCreate a new instance of Google Maps infowindows\n\tvar infobox = new google.maps.InfoWindow();\n\t// Adding a click event to the Marker\n\tgoogle.maps.event.addListener(marker, \"click\", function(){\n\t\t//\tsetContent is just like innerHTML. You can write HTML into this document\n\t\tinfobox.setContent(\"<div><strong>\"+marker.title+\"</strong></div><hr>\"+\n\t\t\t\t\t\t\t\"<div>\"+marker.description+\"</div>\"\n\t\t\t);\n\t\t//\tOpening the infoBox\n\t\tinfobox.open(map, marker);\n\t});\n\n}", "function createInfoWindow(item, index) {\n let content = `<a href=\"${item.website()}\" target=\"_blank\"><h3>` +\n `${item.name()}</h3></a><p>${item.info()}<br> `+\n `<div><span>Current Weather:</span><canvas id=\"weather-info-${index}\"` +\n ` width=\"32\" height=\"32\"></canvas></div>` +\n `Rating:${item.rating()}/5</p>`;\n return new google.maps.InfoWindow({\n content: content\n })\n}", "function populateInfoWindow(marker, infowindow) {\n // Check to make sure the infowindow is not already opened on this marker.\n var imgURL = '';\n var summary = '';\n var title = '';\n\n // Get wikipedia image url from global array \n for (var i = 0; i < wikiContent.length; i++) {\n if (marker.title == wikiContent[i].title) {\n imgURL = wikiContent[i].url;\n summary = wikiContent[i].summary;\n title = wikiContent[i].title;\n }\n }\n\n if (infowindow.marker != marker) {\n // Clear the infowindow content to give the streetview time to load.\n infowindow.setContent('');\n infowindow.marker = marker;\n // Make sure the marker property is cleared if the infowindow is closed.\n infowindow.addListener('closeclick', function() {\n infowindow.marker = null;\n });\n\n if (imgURL !== '') {\n infowindow.setContent(\n '<div id=\"iw-container\"><h4 id=\"iw-title\">' +\n title +\n '</h4>' +\n '<a href=\"' +\n imgURL + '\"\">' +\n '<img src=\"' +\n imgURL +\n '\" height=\"200\">' +\n '</a>' +\n '<div id=summary>' +\n summary +\n '</div><div id=iw-attr> Wikipedia </div></div>');\n } else {\n infowindow.setContent(\n '<div>Could not load Wikipedia content for </div><h4>' +\n marker.title +\n '</h4>'\n );\n }\n // Open the infowindow on the correct marker.\n infowindow.open(map, marker);\n }\n}", "function formatInfoWindowContent(place) {\n var infoContent =\n \"<div class='infoWindowElement'><div class='infoTitle'>\" +\n place.name +\n \"</div><div><span>adr:</span> \" +\n formatAddress(place) +\n \"</div><div><span>åpen:</span> \" +\n getOpeningHours(place) +\n \"</div><div><span>tlf:</span> \" +\n place.formatted_phone_number +\n \"</div><div><a href='\" +\n place.website +\n \"' target='_blank'>\" +\n place.website +\n \"</a></div><div><a href='\" +\n place.url +\n \"' target='_blank'>Vis i Google</a></div></div>\";\n return infoContent;\n}", "function populateInfoWindow(marker, infowindow) {\n // Check to make sure the infowindow is not already opened on this marker.\n if (infowindow.marker != marker) {\n infowindow.marker = marker;\n infowindow.setContent('<div>' + marker.title + '</div>');\n infowindow.open(map, marker);\n \n // Make sure the marker property is cleared if the infowindow is closed.\n infowindow.addListener('closeclick', function() {\n infowindow.marker = null;\n });\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 Allinfobox(marker){\n\tif(infobox){\n\t\tinfobox.close();\n\t}\n\tinfobox = new google.maps.InfoWindow();\n\tgoogle.maps.event.addListener(marker, \"click\", function(){\n\t\tinfobox.setContent(\"<div><strong>\"+marker.title+\"</strong></div><hr>\"+\n\t\t\t\t\t\t\t\"<div>\"+marker.description+\"</div>\"\n\t\t\t);\n\t\tinfobox.open(map, marker);\n\t});\n}", "function reposInfoWindow() {\n\t// use the outer div for infowindow for calculations\n\tvar $infoWindowBox = $('.infowindow').parents().eq(3);\n\n\t// delay repositioning to account for Maps API's own repositioning\n\t// otherwise `.panBy()` stops panning prematurely\n\tsetTimeout(function() {\n\t\tvar marker = infoWindow.marker;\n\t\tvar iwHeight = $infoWindowBox.height();\n\t\tvar offset = -1 * ((iwHeight / 2) + 40);\n\n\t\tmap.setCenter(marker.getPosition());\n\t\tmap.panBy(0, offset);\n\t}, 100);\n}", "function generateInfoBox()\n{\n\tvar out = '<a href=\"' + url + '\" class=\"gmap-title\">' + title + '</a><div class=\"gmap-description\">' + description + '</div>';\n\n\tif ('undefined' != typeof address)\n\t{\n\t\tout += '<div class=\"gmap-address\">' + address + ', ' + city + ', ' + state + ', ' + zip + '</div>';\n\t}\n\n\treturn out;\n}", "function populateInfoWindow(marker, largeInfoWindow) {\n /* First, let's get details from the Google Places Detail API */\n placesService.getDetails(\n {\n placeId: marker.id\n },\n function(place, status) {\n if (status === google.maps.places.PlacesServiceStatus.OK) {\n // Prepare to populate info window content with the results\n var content = `<div>`;\n\n if (place.name) {\n if (place.website) {\n content += `<a href=${place.website} target=\"_blank\">${\n place.name\n }</a>`;\n } else {\n content += `${place.name}`;\n }\n }\n\n if (place.types) {\n content += ` <span class=\"label label-default\">${place.types[0]\n .charAt(0)\n .toUpperCase() + place.types[0].slice(1)}</span>`;\n }\n\n if (place.opening_hours) {\n if (place.opening_hours.open_now) {\n content += ` <span class=\"label label-success\">Open Now</span>`;\n } else {\n content += ` <span class=\"label label-danger\">Closed</span>`;\n }\n }\n\n if (place.formatted_address) {\n content += `<br><br><span>${place.formatted_address}</span>`;\n }\n\n if (place.formatted_phone_number) {\n content += `<br><span><a href=\"tel: ${\n place.formatted_phone_number\n }\">${place.formatted_phone_number}</a></span>`;\n }\n\n if (place.website) {\n content += `<br><span><a href=${place.website}>${\n place.website\n }</a></span><br>`;\n }\n\n if (place.rating) {\n content += `<br><i class=\"fa fa-google\" aria-hidden=\"true\"></i> <span>Rating: ${place.rating.toFixed(\n 1\n )}</span>`;\n }\n\n if (place.url) {\n content += ` <a class=\"btn btn-default btn-xs\" href=${\n place.url\n } target=\"_blank\">Open in GMaps</a>`;\n }\n\n /* Next, let's get some additional details from the Yelp Fusion API */\n searchYelpBusiness(place, function(data, status) {\n if (status === \"success\") {\n var yelpBusiness = data.businesses[0];\n\n if (yelpBusiness) {\n if (yelpBusiness.rating) {\n content += `<br><i class=\"fa fa-yelp\" aria-hidden=\"true\"></i> <span>Rating: ${yelpBusiness.rating.toFixed(\n 1\n )}</span>`;\n }\n\n if (yelpBusiness.url) {\n content += ` <a class=\"btn btn-default btn-xs\" href=${\n yelpBusiness.url\n } target=\"_blank\">Open in Yelp</a>`;\n }\n }\n }\n\n /* Finally, make the re-orient the map and set the content to the info window*/\n map.setCenter(marker.getPosition());\n map.setZoom(15);\n\n // Assign the info window to the marker\n largeInfoWindow.marker = marker;\n largeInfoWindow.setContent(content);\n largeInfoWindow.open(map, marker);\n\n largeInfoWindow.addListener(\"click\", function() {\n largeInfoWindow.open(map, marker);\n });\n\n largeInfoWindow.addListener(\"closeclick\", function() {\n largeInfoWindow.marker = null;\n });\n });\n }\n }\n );\n}", "function populateInfoWindow(marker, infowindow) {\n // Check to make sure the infowindow is not already opened on this marker.\n if (infowindow.marker != marker) {\n infowindow.marker = marker;\n infowindow.setContent('<div class=\"venue-name\">' + marker.title + '</div>');\n infowindow.open(map, marker);\n // Make sure the marker property is cleared if the infowindow is closed.\n infowindow.addListener('closeclick', function () {\n infowindow.marker = null;\n });\n }\n}", "function makeInfoWindow(position, msg) {\n // close old window if it exists\n if (infoWindow) infoWindow.close();\n\n // make a new InfoWindow\n infoWindow = new google.maps.InfoWindow({\n map: map,\n position: position,\n\n content: \"<b>\" + msg + \"</b>\"\n });\n}", "function createWindow() {\n\t\tpopulateData(\"employment\",1);\n\t}", "function generateInfo(genreID, albumID, year){\n\tvar x = offset.left;\n\tvar y = offset.top;\n\tvar html = [];\n\t//var h = \"<div class='popup' style='\" + style + \"'>test content</div>\";\n\thtml.push(\"<span style='color: #FFA72D'><h3>\" + year + \" \" + genreID + \"</h3></span>\");\n\thtml.push(releaseInfo[genreID][albumID].artist);\n\thtml.push(\"<i>\" + releaseInfo[genreID][albumID].title + \"</i>\");\n\thtml.push(releaseInfo[genreID][albumID].year);\n\tdocument.getElementById(\"album-info\").innerHTML = html.join(\"<br>\");\n\t$albumDiv.css({'top' : y + 'px', 'left' : x + 'px', 'display': 'inline', 'width' : unit*.75 + 'px'});\n}", "function infoPopUpWindow(sInfo)\n{\n\tvar sPopUpId = '#popup_info .popup_info_sms';\n\t$(sPopUpId).append(\"<div id='sPopup-container'>\"+\n\t\t\t\t\t\t\"<div id='sPopup-popup'>\"+\n\t\t\t\t\t\t\t\"<div title='close' id='sPopup-close'></div>\"+\n\t\t\t\t\t\t\t\t\"<div style='clear:both;'></div>\"+\n\t\t\t\t\t\t\t\t\tsInfo+\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$('body').css({ overflow : 'hidden' });\n\t$(sPopUpId).fadeIn(400, function(){\n\t\t$(this).css({ display: 'block' });\n\t});\n\t$('#sPopup-close').click(function(){\n\t\t$('body').css({ overflow : 'auto' });\n\t\t$('#sPopup-container').fadeOut(400, function(){\n\t\t\t$(this).remove();\n\t\t});\n\t});\t\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 showInfoWindow() {\n const marker = this;\n places.getDetails(\n {\n placeId: marker.placeResult.place_id,\n },\n (place, status) => {\n if (status !== google.maps.places.PlacesServiceStatus.OK) {\n return;\n }\n infoWindow.open(map, marker);\n buildIWContent(place);\n }\n );\n}", "function setMarkerInfo(info) {\n infoWindow.setContent(info);\n }", "function populateInfoWindow(marker) {\n var infowindow = largeInfowindow;\n // Check to make sure the infowindow is not already opened on this marker.\n if (infowindow.marker != marker) {\n infowindow.marker = marker;\n infowindow.setContent('<div>' + marker.title + '</div>');\n infowindow.open(map, marker);\n // Make sure the marker property is cleared if the infowindow is closed.\n infowindow.addListener('closeclick', function() {\n infowindow.marker = null;\n });\n }\n}", "function populateInfoBox(locationObj, infowindow) {\n var marker = locationObj.marker;\n var name = locationObj.name; // name of eatery (from location data)\n if(locationObj.apiResponse) {\n var weatherTemp = locationObj.apiResponse.currently.apparentTemperature; // temperature\n var weatherSummary = locationObj.apiResponse.currently.summary; // weather summary\n // set infowindow text content to eatery name and weather info\n infowindow.setContent(\n '<div>' + '<strong>' + name + '</strong>' + '</div>' + \n '<div>' + weatherTemp + \" degrees\" + '</div>' + \n '<div>' + weatherSummary + '</div>'\n );\n }\n else if(locationObj.apiError) {\n // set infowindow text content to eatery name and weather info\n infowindow.setContent(\n '<div>' + '<strong>' + name + '</strong>' + '</div>' + \n // message to display on API error\n '<div>' + '<em>' + \"Error retrieving weather information\" + '</em>' + '</div>'\n );\n }\n\n}", "function populateInfoWindow(marker, infowindow,k) {\n // Check to make sure the infowindow is not already opened on this marker.\n if (infowindow.marker != marker) {\n infowindow.marker = marker;\n //ajax call to get the infowindow material from 4square\n search = 'https://api.foursquare.com/v2/venues/search?client_id=EFJRVLNR02C5ARL21YDRPO4ZE0CXGEBNMVHQBILAQTIZN3CD&client_secret=4QZXSPT0ZVOKRACO2VOVKFMPLXQGCO2VPJWMLMVTJ4PXVCH5&ll=36.101340,-115.172182&query='+ clubs[k].title +'&v=20130815'; \n $.ajax({\n url: search,\n dataType: 'json',\n success: function(data) {\n var ve = data.response.venues[0];\n var output = '';\n output += '<div id=\"'+ clubs[k].title +'\">';\n output += '<h3>'+ clubs[k].title +'</h3>';\n output += '<p>Address: '+ ve.location.address +'</p>';\n if (ve.contact.facebookUsername !== undefined) {\n output += '<p>FB: '+ ve.contact.facebookUsername +'</p>';\n } else { output += '<p>FB: None </p>';}\n output += '<p>Phone#: '+ ve.contact.phone +'</p>';\n output += '</div>';\n //append the info in the didden div that google map api can pull from;\n infowindow.setContent(output);\n }\n }).fail(function(e) {alert('Request has failed...');});\n\n infowindow.open(map, marker);\n // Make sure the marker property is cleared if the infowindow is closed.\n infowindow.addListener('closeclick',function(){\n infowindow.setMarker = null;\n });\n }\n }", "function makeResultInfoWindow(position, result) {\n // close old window if it exists\n if (infoWindow) infoWindow.close();\n let pir = \"unknown\";\n if(result.price)\n {\n pir = result.price;\n }\n // make a new InfoWindow\n infoWindow = new google.maps.InfoWindow({\n map: map,\n position: position,\n // edit this section for CSS markdown (Alex)\n content: '<div id=\"infoWindowContent\">' +\n '<a href=\"'+ result.url +'\" \" ><h1 id=\"nameHeading\">'+result.name+ '</h1></a>'+\n '<div id=\"keyInfo\">'+\n '<h4 id=\"rating\">Rating: '+result.rating+'</h4>'+\n '<h5>'+pir+'</h5>'+\n '<h5>Phone: '+result.display_phone+'</h4>'+\n '<h5>Address: '+ result.location.address1 +'</h5>'+\n //'<img src=\"'+result.image_url+'\">'+\n '<h5>Distance: '+getMiles(result.distance).toFixed(1)+' miles</h5>'+\n '<img id=\"img\" src=\"'+result.image_url+'\">'+\n '</div>'\n });\n}", "function showInfoWindow() {\n var marker = this;\n places.getDetails({\n placeId: marker.placeResult.place_id,\n },\n function(place, status) {\n if (status !== google.maps.places.PlacesServiceStatus.OK) {\n return;\n }\n infoWindow.open(map, marker);\n buildIWContent(place);\n }\n );\n}", "function createInfoWindow (marker){\n // Create the InfoWindow\n var infoWindow = new google.maps.InfoWindow();\n // Create StreetViewService to show a street view window for marker location or nearest places within 50 meter\n var StreetViewService = new google.maps.StreetViewService();\n var radius = 50;\n //Create an onclick event listener to open\n marker.addListener('click', function(){\n infoWindow.marker = marker;\n infoWindow.setContent('<div Id=\"infoWindowDiv\"><h5>' + marker.title +'</h5></div>');\n\n //** One options to be displayed in InfoWindow **//\n /* 1) Displaying Wikipedia articals: */\n var wikiURL = 'http://en.wikipedia.org/w/api.php?action=opensearch&search=' + marker.title + '&format=json&callback=wikiCallback';\n var wikiRequestTimeout = setTimeout(function() {\n alert(\"failed to load wikipedia resources\");\n }, 8000);\n $.ajax({\n url: wikiURL,\n dataType: \"jsonp\",\n success: function(response) {\n var articalsList = response[1];\n var atricalTitle ;\n $('#infoWindowDiv').append('<div Id=\"wikiDiv\"><ul id=\"wikiListItem\"></ul></div>');\n for (var i = 0 , length = articalsList.length; i < length && i < 4 ; i++ ){\n atricalTitle = articalsList[i];\n $('#wikiListItem').append('<li><a href=\"http://en.wikipedia.org/wiki/'+atricalTitle+'\">'+atricalTitle+'</a></li>');\n }\n clearTimeout(wikiRequestTimeout);\n },\n });\n infoWindow.open(map, marker);\n });\n\n\n //** Other options to be displayed in InfoWindow **//\n /* 2) Displaying an Image usign URL parameters: (Note: Not working well for some reasons)\n -------> Should be placed before infoWindow.Open()\n\n $('#pano').append('<img src= https://maps.googleapis.com/maps/api/streetview?'+\n 'size=200x150&location='+marker.position+'&heading=151.78&pitch=-0.76'+\n '&key=AIzaSyBpcOjPqBYX5nfyfSKIUp3NXwUIiQHP0lQ></img>'); */\n\n /* 3) Displaying an Street view object: (Note: Not working well for some reasons)\n -------> Should be placed before infoWindow.Open()\n StreetViewService.getPanoramaByLocation(marker.position, radius, getViewStreet);\n function getViewStreet(data, status){\n if (status === 'Ok'){\n infoWindow.setContent('<div><h5>' + marker.title +'</h5><div Id=\"pano\"></div></div>');\n var nearViewStreetLocation = data.location.latLng;\n var heading = google.map.geometry.spherical.computeHeading(nearViewStreetLocation, marker.position);\n var panoramaOptions = {\n position : nearViewStreetLocation,\n pov :{ heading: heading, pitch: 30 }\n };\n var panorama = new google.maps.StreetViewPanorama(document.getElementById('pano'),panoramaOptions);\n map.setStreetView(panorama);\n }\n else{\n infoWindow.setContent('<div><h5>' + marker.title +'</h5><div>No Street View Found</div></div>');\n }\n }*/\n\n }", "function populateInfoWindow(marker, infowindow) {\n if (infowindow.marker != marker) {\n infowindow.marker = marker;\n infowindow.setContent('<div>'+ marker.title +'</div>' +\n '<div>Address: '+ marker.listElement.address +'</div>' +\n '<div> <i class=\"fa fa-foursquare\" aria-hidden=\"true\"></i> Check-Ins: '+ marker.listElement.checkins +'</div>');\n infowindow.open(map, marker);\n infowindow.addListener('closeclick', function() {\n infowindow.marker = null;\n });\n }\n}", "function addMarkerInfo() {\n\n for (var i = 0; i < markersOnMap.length; i++) {\n var contentString = '<div id=\"content\"><h1>' + markersOnMap[i].placeName +\n\n '</h1><p>' + markersOnMap[i].description + ' <a href=\"walks.html\">See our Walks page for further details</a>r</p></div>';\n\n const marker = new google.maps.Marker({\n position: markersOnMap[i].LatLng[0],\n map: map\n });\n\n const infowindow = new google.maps.InfoWindow({\n content: contentString,\n maxWidth: 200\n });\n\n marker.addListener('click', function () {\n closeOtherInfo();\n infowindow.open(marker.get('map'), marker);\n InforObj[0] = infowindow;\n });\n\n }\n}", "function setInfoWindow(place, marker) {\n //clone a new element for window content and set the place name\n var content = $(\"#place-info\").clone().removeAttr('id');\n content.find('.name').text(place.name);\n \n //set address if available\n if(typeof place.formatted_address === 'undefined') {\n content.find('.address').remove();\n }\n else {\n content.find('.address').text(place.formatted_address);\n }\n \n //set phone number if available\n if(typeof place.formatted_phone_number === 'undefined') {\n content.find('.phone').remove();\n }\n else {\n content.find('.phone').prop('href', 'tel:' + place.formatted_phone_number).text(place.formatted_phone_number);\n }\n \n //set directions button action\n content.find('button').click(function() {\n app.calcRoute(place.geometry.location);\n app.infoWindow.close();\n });\n \n //set the window content and open it\n app.infoWindow.setContent(content[0]);\n app.infoWindow.open(app.map, marker);\n }", "function setup_showInfo() {\n\tdocument.getElementById(\"basic\").style.display = \"none\";\n\tdocument.getElementById(\"create\").style.display = \"none\";\n\tdocument.getElementById(\"source\").style.display = \"none\";\n\tdocument.getElementById(\"info\").style.display = \"block\";\n}", "function generateWindowContent(location) {\n return ('<div class=\"info_content\">' +\n '<h2>' + location.name + '</h2>' +\n '<h3>' + location.address + '</h3>' +\n '<p>' + location.details + '</p>' +\n '</div>'\n );\n}", "function showInfoWindow(i) {\n return function(place, status) {\n // Closes other windows when one is clicked\n if (infowindow) {\n infowindow.close();\n infowindow = null;\n }\n\n // Displays window\n if (status == google.maps.places.PlacesServiceStatus.OK) {\n infowindow = new google.maps.InfoWindow({\n content: getIWContent(place)\n });\n infowindow.open(map, markers[i]); \n }\n }\n}", "function moreInfo() {\n var infoWindowElem = $('.info-window');\n infoWindowElem.css('top', '0');\n infoWindowElem.css('height', '100vh');\n infoWindowElem.css('overflow', 'scroll');\n}", "function prepareInfoContent(title, tip, imgUrl) {\n var content = \"\";\n content = \"<div class='infoWindow'>\" +\n \"<h3>\" + title + \"</h3>\" +\n \"<img id='infoImg' alt='location img' src='\" + imgUrl + \"'>\" +\n \"<h3>Tip:</h3>\" +\n \"<p class='tip'>\" + tip + \"</p></div>\";\n return content;\n}", "openInfoWindow(location) {\n this.closeInfoWindow();\n this.state.infowindow.open(this.state.map, location.marker);\n this.state.infowindow.setContent(\"Looking Up . . . \");\n this.getWindowData(location);\n }", "function openinfo(n,myvar) {\r\n\tz = window.open((n==0?\"data/\":\"\") + \"SingleClass.html?soc=\"+myvar,\"_blank\",\"channelmode=no,directories=no,fullscreen=no,height=\"+(myvar>999?500:350)+\",left=50,location=no,menubar=no,resizable=yes,scrollbars=yes,status=yes,titlebar=no,toolbar=no,top=50,width=700\",false);\r\n}", "function populateInfoWindow(marker, image, infourl, description, infowindow) {\n // Check to make sure the infowindow is not already opened on this marker.\n if (infowindow.marker != marker) {\n infowindow.marker = marker;\n infowindow.setContent('<div class=\"info-window-content\"><div class=\"title\"><b>' + marker.title + \"</b></div>\" +\n '<div class=\"content\"><img src=\"' + image +'\" class=\"responsive-img valign\"></div>' +\n '<div class=\"content\"><p>' + description + '</p></div>' +\n '<div class=\"content\"><a href=\"' + infourl +'\" target=\"_blank\">' + infourl + \"</a></div>\" +\n \"</div>\");\n infowindow.open(map, marker);\n // Make sure the marker property is cleared if the infowindow is closed.\n infowindow.addListener('closeclick', function() {\n infowindow.marker = null;\n });\n\n }\n}", "function fillInfo() {\n nameLabel.innerHTML = cocktail[0];\n cocktailInfoLabel.innerHTML = cocktailInfo;\n}", "function setupInfoWindow() {\n var marker, photoUrl;\n for (var i = 0; i < markers.length; i++) {\n markers[i].infoWindow = new google.maps.InfoWindow();\n markers[i].photoUrl = photos[i];\n markers[i].addListener('click', function (marker) {\n return function () {\n toggleBounce(marker);\n populateInfoWindow(marker);\n }\n\n }(markers[i]));\n markers[i].addListener('mouseover', function (marker) {\n return function () {\n marker.setIcon(highlightedIcon);\n }\n\n }(markers[i]));\n markers[i].addListener('mouseout', function (marker) {\n return function () {\n marker.setIcon(defaultIcon);\n }\n }(markers[i]));\n }\n // Apply bindings after map as been loaded and the images have been received.\n ko.applyBindings(new PlaceViewModal());\n}", "function createInfoWindow(marker, centerMarker) {\n var onclick;\n var centerMarkerId\n var rating = (marker.rating == \"None\") ? \"\" : \"Rating: \" + Math.round(marker.rating) + \"/100\";\n var errorMessage = ($(\"#err\").length) ? $(\"#err\").html() : \"\";\n\n // There is no centerMarker if the marker is on our path\n if (centerMarker == null) {\n onclick = ' id=\"removeBtn\" onclick=\"removePoint(' + marker.id + ');\">' +\n '<span class=\"glyphicon glyphicon-trash\"></span>';\n } else {\n centerMarkerId = centerMarker.id;\n onclick = ' id=\"addBtn\" onclick=\"addPoint(' + marker.id + ', ' +\n centerMarker.id + ');\">Add';\n }\n\n var content = '<p>' + marker.name + '</p><p>' +\n rating + '</p><p id=\"err\">' + errorMessage +\n '</p><div class=\"btn btn-primary btn-sm\"' + onclick +\n '</div><div class=\"btn btn-link btn-sm\"' +\n 'onclick=\"setInfoWindowContent('+ marker.id + ', ' + centerMarkerId +\n ');\">More Info...</div>';\n\n namespace.popWindow.marker = marker;\n namespace.popWindow.setContent(content);\n namespace.popWindow.open(namespace.map, marker);\n}", "function bindInfoWindow(item, loc, code, data) {\n\t// html string to display 'weight : count'\n\tvar count_text = \"\";\n\tfor (var i = 0; i<data[\"counts\"].length; i++) {\n\t\tcount_text += i.toString() + \" : \" + data[\"counts\"][i].toString() + \"<br>\";\n\t}\n\t\n\tgoogle.maps.event.addListener(item, 'mouseover', function() {\n\t\tinfoWindow.setContent(\"<div class='info-box'><b>\" + code + \"</b><br>\" + count_text + \"</div>\");\n\t\tinfoWindow.setPosition(loc);\n\t\tinfoWindow.open(map);\n\t});\n\tgoogle.maps.event.addListener(item, 'mouseout', function() {\n\t\tinfoWindow.close();\n\t});\n\treturn item;\n}", "displayInfo() {\n this.getTime();\n $('#modalTitle').html(`${this.name}`);\n $('#modalInfo').html(\n `<li>Current Time: &nbsp; ${this.time}</li><li>Latitude: &nbsp; ${this.latitude}</li><li>Longitude: &nbsp; ${this.longitude}</li><li>Distance from your location: &nbsp; ${this.distance}km</li>`\n );\n $('#wikiInfo').removeClass('show');\n $('#forecastInfo').removeClass('show');\n $('#weatherInfo').removeClass('show');\n $('#generalInfo').addClass('show');\n $('#infoModal').modal();\n }", "function showSwimlaneWindow() {\n $(\"#currentSwimlane\").html(\"\");\n var sw = $(\"#kanban th\");\n for (var i = 0; i < sw.length; i++) {\n\n // Attributes\n var name = $(\".swName\", sw[i]).html();\n var id = $(sw[i]).attr(\"data-id\");\n var type = $(sw[i]).attr(\"data-type\");\n\n var objtext = getSwimlaneDisplay(name, id, type);\n\n // Append to container\n $(\"#currentSwimlane\").append(objtext);\n }\n}", "function showInfoWindow() {\n var marker = this;\n jsonifyPlace(marker);\n console.log(\"Debugging Marker\" , marker);\n placesService.getDetails({ placeId: marker.placeResult.place_id }, \n function(place,status) {\n if (status !== google.maps.places.PlacesServiceStatus.OK) {\n return;\n }\n infoWindow.open(map, marker);\n buildIWContent(place);\n });\n}", "function fillInfoWindow(marker, infowindow) {\r\n// Check to make sure the infowindow is not already opened\r\n if (infowindow.marker != marker) {\r\n// Fill the content of information window\r\n infowindow.setContent('<img src=\"' + marker.image + '\" alt=\"Image of ' +\r\n marker.title + '\"><br><hr style=\"margin-bottom: 5px\"><strong>' +\r\n marker.title + '</strong><br><p>' + marker.address+'<br><p>Link to Wikipedia Article:</p><br><div id=\"wiki-list-link\"></div>');\r\n infowindow.marker = marker;\r\n marker.setAnimation(google.maps.Animation.BOUNCE);\r\n// Make sure the marker property is cleared if the infowindow is closed\r\n infowindow.addListener('closeclick', function() {\r\n infowindow.marker = null;\r\n marker.setAnimation(null);\r\n });\r\n// Open the infowindow on the correct marker\r\n infowindow.open(map, marker);\r\n }\r\n\r\n var wikiListURL = 'http://en.wikipedia.org/w/api.php?action=opensearch&search='+marker.title+'&format=json&callback=wikiCallback';\r\n\r\n $.ajax({\r\n url: wikiListURL,\r\n dataType: \"jsonp\",\r\n success: function(response) {\r\n var articleList = response[0];\r\n console.log(articleList);\r\n var list = $(\"#wiki-list-link\")\r\n var url = 'http://en.wikipedia.org/wiki/' + articleList;\r\n console.log(url);\r\n list.append('<a href=\"' + url + '\">' + articleList + '</a>');\r\n }\r\n });\r\n }", "function populateInfoWindow(marker, infowindow, place) {\n\n if (infowindow.marker != marker) {\n // Clear the infowindow content to give the streetview time to load.\n infowindow.setContent('');\n infowindow.marker = marker;\n\n infowindow.setContent('<div id=\"place_title\">' + marker.title +\n '<BR><img id=\"' + IMAGE_TAG_ID + '\" class=\"thumbnail\" src=\"' +\n getPhoto(place.googlePlaceId()) + '\" alt=\"no image\">' +\n '</div><b>Wikipedia:</b><div id=\"' + WIKI_DIV_ID +\n '\"><img src=\"' + LOADING_IMAGE + '\" alt=\"loading ..\"></div>');\n\n infowindow.open(map, marker);\n // Make sure the marker property is cleared if the infowindo is closed.\n infowindow.addListener('closeclick', function() {\n infowindow.marker = null;\n });\n\n getWikiInformation(place.wikiSearchTerm());\n\n }\n}", "function showDetails() {\n _('infoDiv').innerHTML = infoText;\n _('infoPanel').style.display = 'block';\n}", "function openInfoWindow(e, current) {\r\n\t\tcloseInfoWindow(); \r\n\t\tvar x = e.pageX - parseInt($('#inner').css('left')) - $['mapsettings'].element.get(0).offsetLeft - 9;\r\n\t\tvar y = e.pageY - parseInt($('#inner').css('top')) - $['mapsettings'].element.get(0).offsetTop - 10;\r\n\t\t$['mapsettings'].infoWindowLocation[$['mapsettings'].zoom] = new Point(x,y);\r\n\t\t$('<div id = \"infowindow\" />').css('left',x-4).css('top',y-53).html('<div class = \"inner\">'+ $['mapsettings'].exitLink + $['mapsettings'].infoDisplay + '</div>').appendTo('#infowindows').hide();\r\n\t\tvar infow = $('#infowindow');\r\n\t\tinfoWidth = infow.innerWidth();\r\n\t\tinfoHeight = infow.innerHeight();\r\n\t\tinfow.css('left', x-4).css('top',y-16-infoHeight).show();\r\n\t\t$(\"#infowindows\").append($['mapsettings'].infoImage);\r\n\t\t$(\"#infowindows img\").css('left',x).css('top',y-15);\r\n\t\t$('#infowindows form').submit(function(e) { \r\n\t\t\te.preventDefault(); \r\n\t\t\tcloseInfoWindow();\r\n\t\t\taddMarker(new Point(x,y), function(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\topenInfoWindowHtml(markerPoint(this), \"<h2>Some Name</h2><p>Some Description.</p>\");\r\n\t\t\t});\r\n\t\t\t\r\n\t\t });\r\n\t\t$(\"#exitLink\").click(function(e){\r\n\t\t\te.preventDefault();\r\n\t\t\tcloseInfoWindow();\r\n\t\t\treturn false;\r\n\t\t});\r\n\t\t$['mapsettings'].hasOpenInfoWindow = true;\r\n\t}", "function populateInfoWindow(marker, infowindow) {\n // Check infowindow is not already opened on this marker\n if (infowindow.marker != marker) {\n // Checks for link on marker, removes broken link on failure\n // Allows for individual link errors\n if (marker.wikiLink === undefined) {\n infowindow.setContent('<div class=\"info-window\">' + marker.title + '</div><div class=\"info-window link-failure\">Wikipedia connection failure</div>');\n } else {\n infowindow.setContent('<div class=\"info-window\">' + marker.title + '</div><div class=\"info-window\"><a href=\"'\n + marker.wikiLink + '\">'+ marker.wikiLink +'</a></div>');\n }\n infowindow.marker = marker;\n // Make sure the marker property is cleared if the infowindow is closed\n infowindow.addListener('closeclick', function() {\n infowindow.marker = null;\n marker.setIcon(defaultMarker);\n marker.setAnimation(null);\n });\n infowindow.open(map, marker);\n }\n }", "function populateInfoWindow(marker, infowindow) {\n\n if (infowindow.marker != marker) {\n\n infowindow.marker = marker;\n\n infowindow.setContent(\n '<div id=\"infowindow\">' +\n '<h1>' + marker.title + '</h1>' +\n '<div id=\"infowindow-details\" class=\"container\"></div>'\n );\n\n //Obtem detalhes das locations\n var service = new google.maps.places.PlacesService(map);\n\n service.getDetails({placeId: marker.id}, function(place, status) {\n\n if (status === 'OK') {\n\n infowindow.marker = marker;\n\n var innerHTML = '<div>';\n\n if (place.formatted_address) {\n innerHTML += place.formatted_address;\n };\n\n if (place.opening_hours) {\n innerHTML += '<br><br><h2>Horários:</h2>' +\n place.opening_hours.weekday_text[0] + '<br>' +\n place.opening_hours.weekday_text[1] + '<br>' +\n place.opening_hours.weekday_text[2] + '<br>' +\n place.opening_hours.weekday_text[3] + '<br>' +\n place.opening_hours.weekday_text[4] + '<br>' +\n place.opening_hours.weekday_text[5] + '<br>' +\n place.opening_hours.weekday_text[6];\n };\n\n if (place.photos) {\n innerHTML += '<br><br>';\n innerHTML += '<img class=\"img-responsive\" alt=\"foto do parque\" src=\"' +\n place.photos[0].getUrl({maxHeight: 100, maxWidth: 120}) + '\">';\n innerHTML += '<img class=\"img-responsive\" alt=\"foto do parque\" src=\"' +\n place.photos[1].getUrl({maxHeight: 100, maxWidth: 120}) + '\">';\n };\n\n innerHTML += '</div></div>';\n\n infowindow.setContent(infowindow.content + innerHTML);\n\n } else {\n\n infowindow.setContent(infowindow.content + '<p>Não foi possível obter ' +\n 'maiores detalhes no Google. Atualize a página para tentar novamente' +\n '</p></div>');\n };\n });\n\n infowindow.open(map, marker);\n\n infowindow.addListener('closeclick', function() {\n resetMarkersIcons();\n showMarkers();\n\n infowindow.marker = null;\n });\n\n activeInfowindow = infowindow;\n\n };\n}", "function formatInfoWindow(topThreeRoutes) {\n\t\n // Convert the JPID into a Line ID user can understand\n for (var i = 0; i < topThreeRoutes.length; i++) {\n\t\t// If it's a subroute then display that info\n\t\tvar subRoute = topThreeRoutes[i][1][topThreeRoutes[i][1].length -1];\n var temp = topThreeRoutes[i][1].slice(0,4);\n if (temp.charAt(0) == \"0\") temp = temp.replace(0, \"\");\n if (temp.charAt(0) == \"0\") temp = temp.replace(0, \"\");\n topThreeRoutes[i][1] = temp;\n\t\tif (subRoute != \"1\") topThreeRoutes[i][1] = topThreeRoutes[i][1] + \" (Sub-Route)\";\n }\n // Convert the Time into hh:mm\n if (searchPreference == \"searchByWalkingDistance\") {\n for (var i = 0; i < topThreeRoutes.length; i++) {\n topThreeRoutes[i][0] = topThreeRoutes[i][0].toFixed(1) + \"km\";\n }\n }\n // Convert distance into km with one decimal point\n if (searchPreference == \"searchByArrivalTime\") {\n for (var i = 0; i < topThreeRoutes.length; i++) {\n topThreeRoutes[i][0] = topThreeRoutes[i][0].slice(0, 5);\n }\n }\n\tif (topThreeRoutes.length == 1) {\n\t\tinfoWindow.setContent(\n\t\t\"<h2 style='color:#0014ff;'>\" + topThreeRoutes[0][1] + \": \" + topThreeRoutes[0][0] + \"</h2>\" +\n\t\ttopThreeRoutes[0][4] + \"<br><b>Stop ID:</b> \" + topThreeRoutes[0][2]);\n\t} else if (topThreeRoutes.length == 2) {\n\t\tinfoWindow.setContent(\n\t\t\"<h2 style='color:#0014ff;'>\" + topThreeRoutes[0][1] + \": \" + topThreeRoutes[0][0] + \"</h2>\" +\n\t\ttopThreeRoutes[0][4] + \"<br><b>Stop ID:</b> \" + topThreeRoutes[0][2] +\n\t\t\"<h2 style='color:#ffd800;'>\" + topThreeRoutes[1][1] + \": \" + topThreeRoutes[1][0] + \"</h2>\" +\n\t\ttopThreeRoutes[1][4] + \"<br><b>Stop ID:</b> \" + topThreeRoutes[1][2]);\n\t} else {\n\t\tinfoWindow.setContent(\n\t\t\"<h2 style='color:#0014ff;'>\" + topThreeRoutes[0][1] + \": \" + topThreeRoutes[0][0] + \"</h2>\" +\n\t\t\ttopThreeRoutes[0][4] + \"<br><b>Stop ID:</b> \" + topThreeRoutes[0][2] + \n\t\t\"<h2 style='color:#ffd800;'>\" + topThreeRoutes[1][1] + \": \" + topThreeRoutes[1][0] + \"</h2>\" +\n\t\t\ttopThreeRoutes[1][4] + \"<br><b>Stop ID:</b> \" + topThreeRoutes[1][2] +\n\t\t\"<h2 style='color:#FF0000;'>\" + topThreeRoutes[2][1] + \": \" + topThreeRoutes[2][0] + \"</h2>\" +\n\t\ttopThreeRoutes[2][4] + \"<br><b>Stop ID:</b> \" + topThreeRoutes[2][2]);\n\t\t}\n}", "createInfoWindow(marker, infoWindow, map) {\n\t\tif (this.onReadyInfoWindow) window.google.maps.event.removeListener(this.onReadyInfoWindow);\n\t\tif (this.onCloseInfoWindow) window.google.maps.event.removeListener(this.onCloseInfoWindow);\n\t\tinfoWindow.marker = marker;\n\t\tinfoWindow.setContent('<div id=\"infoWindow\" />');\n\t\tthis.onReadyInfoWindow = infoWindow.addListener('domready', e => {\n\t\t\trender(<InfoWindow marker={marker} />, document.getElementById('infoWindow'));\n\t\t});\n\t\tthis.onCloseInfoWindow = infoWindow.addListener('closeclick', function() {\n\t\t\tinfoWindow.marker = null;\n\t\t});\n\t\tinfoWindow.open(map, marker);\n\t}", "function add_infoWindow(map_id, mapObject, infoWindow, objectAttribute, attributeValue) {\n\n //'use strict';\n\n mapObject.set(objectAttribute, attributeValue);\n\n if (mapObject.chart_type === undefined) {\n\n google.maps.event.addListener(mapObject, 'click', function(event){\n\n // the listener is being bound to the mapObject. So, when the infowindow\n // contents are updated, the 'click' listener will need to see the new information\n // ref: http://stackoverflow.com/a/13504662/5977215\n mapObject.setOptions({\"info_window\": mapObject.get(objectAttribute)});\n\n infoWindow.setContent(mapObject.get(objectAttribute));\n infoWindow.setPosition(event.latLng);\n infoWindow.open(window[map_id + 'map']);\n });\n\n } else {\n\n mapObject.setOptions({\"info_window\": attributeValue});\n\n google.maps.event.addListener(mapObject, 'click', function(event) {\n\n var c = chartObject(this);\n infoWindow.setContent(c);\n infoWindow.setPosition(event.latLng);\n infoWindow.open(window[map_id + 'map']);\n });\n }\n}", "function populateInfoWindow(marker, infowindow) {\n // Check to make sure the infowindow is not already opened on this marker.\n if (infowindow.marker != marker) {\n infowindow.marker = marker;\n infowindow.marker.setAnimation(google.maps.Animation.BOUNCE);\n infowindow.setContent( '<h2>' + marker.text + '</h2>' + '<div>' + marker.title + '</div>');\n infowindow.open(map, marker);\n // Make sure the marker property is cleared if the infowindow is closed.\n infowindow.addListener('closeclick', function() {\n infowindow.marker = null;\n });\n }\n}", "function bindInfoWindow(marker, map, infoWindow, contentString, yelpID) {\n google.maps.event.addListener(marker, 'click', function () {\n for (var i in infoWindowArray) {\n infoWindowArray[i].close();\n }\n infoWindow.setContent(contentString);\n infoWindow.open(map, marker);\n var targetScrollRow = document.getElementById('tablerow-' + yelpID);\n targetScrollRow.scrollIntoView();\n });\n }", "function createInfoWindow(marker, infowindow) {\n // Verify if the info window is already open\n if (infowindow.marker != marker) {\n // Set the current infowindow to the marker\n infowindow.marker = marker;\n // Create a basic content with the title of the marker\n infowindow.setContent('<div class=\"text-dark font-weight-bold\">'+ marker.title +'</div>');\n // Get a photo of the marker from Foursquare API and\n // set info window content\n getFoursquareContent(marker, infowindow);\n // Add a function to the close button on the info window\n infowindow.addListener('closeclick', function(){\n infowindow.marker = null;\n })\n // Open the info windows\n infowindow.open(map, marker);\n }\n}", "function build_protein_info_panel(data, div) {\n div.empty();\n var protein = data.controller.get_current_protein();\n div.append(protein['description']);\n div.append(\"<br>----<br>\");\n div.append(dict_html(protein['attr']));\n}", "function fillInfoBox(year, weapons, info) {\n\n var infoboxChart = $('#stats .infobox-after');\n\n //Retrieves from database\n infoboxChart.find('#stat-year').html(\"Årtal \" + year);\n infoboxChart.find('#stat-weapons').html(weapons + \" Miljarder kr\");\n infoboxChart.find('#stat-info').html(info);\n\n //Displays correct infobox\n changeInfobox();\n}", "function InfoBox() {\n}", "function setInfoWindowContent(city, degree, condition, score) {\n rating = getRiskRating(score);\n var content = \"<div id='windowContainer'>\" +\n \"<br /><strong>\" + city + \"</strong>\" +\n \"<br />\" + degree + \"&deg;C\" +\n \"<br/>\" + condition +\n \"<br />\" + \"Risk Level:\" + \"<strong>\" + rating.rating + \"</strong>\" +\n \"</div>\";\n return content;\n}", "function popupInfoSite(path, x_html, x_registerProject) {\n var oWindow = null;\n var iWidth = 500;\n var iHeight = 500;\n oWindow = window.open(path + \"/help/info.\" + x_html + \".jsp?registerProject=\" + x_registerProject, \"POPUP_INFO\", \"dependent=yes,locationbar=no,menubar=no,scrollbars=yes,resizable=yes,status=no,screenX=0,screenY=0,height=\" + iHeight + \",width=\" + iWidth);\n if (top.window.opener) {\n oWindow.opener = top.window.opener;\n }\n centerWindow(oWindow, iWidth, iHeight);\n}", "function openInfoView(loc) {\n infoWindow.close(); //closes currently displayed infoView (if it is there). \n \n //center the map at the marker for which infoView is displayed.\n map.setCenter(new google.maps.LatLng(loc.lat, loc.lon)); \n var htmlStrings = [];\n htmlStrings[0] = '<div>' + '<strong>' + loc.name + '</strong>' + '</div>';\n htmlStrings[1] = '<p>' + loc.category + '</p>';\n htmlStrings[2] = '<p>' + loc.address + '</p>';\n htmlStrings[3] = '<p>' + 'Phone No. ' + loc.phone + '</p>';\n var html = htmlStrings.join('');\n infoWindow.setContent(html);//'html' has the infoView content\n \n //sets the BOUNCE animation on marker\n loc.marker.setAnimation(google.maps.Animation.BOUNCE);\n \n //switch off the animation after 1second.\n setTimeout(function() { loc.marker.setAnimation(null);},1000);\n infoWindow.open(map, loc.marker);\n}", "function populateInfoWindow(marker) {\n marker.infoWindow.marker = marker;\n marker.infoWindow.setContent(`<div><img src=\"${marker.photoUrl}\"/></div>`);\n marker.infoWindow.open(map, marker);\n if (openInfoWindow !== null) {\n openInfoWindow.close();\n openInfoWindow = null;\n }\n openInfoWindow = marker.infoWindow;\n // Make sure the marker property is cleared if the infowindow is closed.\n marker.infoWindow.addListener('closeclick', function() {\n marker.infoWindow.marker = null;\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 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}" ]
[ "0.70738375", "0.7036141", "0.70106614", "0.6887406", "0.6834321", "0.67894465", "0.67829996", "0.67723346", "0.66904205", "0.6652281", "0.6643724", "0.6637937", "0.6592185", "0.6585021", "0.6573603", "0.654398", "0.6534161", "0.6527184", "0.6511927", "0.6489387", "0.6471036", "0.6458064", "0.6448663", "0.64479446", "0.64406085", "0.6433292", "0.64180404", "0.6385771", "0.63808006", "0.6375621", "0.63678396", "0.6366448", "0.6353826", "0.6342141", "0.6340778", "0.6331388", "0.6327735", "0.6314925", "0.63087463", "0.6298096", "0.6296704", "0.62933177", "0.62833196", "0.6271781", "0.6255337", "0.6254101", "0.62504613", "0.62473166", "0.6235822", "0.62314063", "0.6228163", "0.6226354", "0.6219395", "0.62175417", "0.6213549", "0.621318", "0.6201386", "0.6195798", "0.6192954", "0.61874664", "0.6182201", "0.61817193", "0.61777097", "0.6176826", "0.6172521", "0.6172474", "0.6167766", "0.6167533", "0.6148925", "0.613565", "0.61331445", "0.613169", "0.6125116", "0.61203796", "0.6114621", "0.61129695", "0.61054206", "0.60997856", "0.6098947", "0.60957754", "0.6093779", "0.60858643", "0.6079362", "0.60707676", "0.6070047", "0.6062631", "0.6056012", "0.60551614", "0.60496265", "0.6049234", "0.6043646", "0.60386133", "0.6027768", "0.60265917", "0.60224277", "0.6020303", "0.60187066", "0.6007799", "0.60038114", "0.6003146" ]
0.6472697
20
This function will loop through the markers array and display them all.
function showListings() { var bounds = new google.maps.LatLngBounds(); // Extend the boundaries of the map for each marker and display the marker for (var i = 0; i < markers.length; i++) { markers[i].setMap(map); bounds.extend(markers[i].position); } map.fitBounds(bounds); map.setCenter(markers[0].location) var mapOptions = {styles: mapStyles.default} map.setOptions(mapOptions); map.setZoom(14); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showMarkers (marker_array, map) {\n for (var j in marker_array) {\n marker_array[j].marker.setMap(map);\n }\n}", "function showMarkers(markers) {\n for (var i = 0; i < markers.length; i++) {\n addMarker(markers[i]);\n }\n }", "function drawAllMarkers(){\n\tfor(var i=0;i<results.length;i++){\n\t\tdrawMarker(results[i],i);\n\t}\n}", "function displayAllMarkers(map) {\n for (var i = 0; i < markers.length; i++) {\n markers[i].setMap(map);\n }\n }", "function showOverlays() {\n if (markersArray) {\n for (i in markersArray) {\n markersArray[i].setMap(map);\n }\n }\n}", "function showOverlays() {\n if (markersArray) {\n for (i in markersArray) {\n markersArray[i].setMap(map);\n }\n }\n}", "function showMarkers() {\n for (var i=0; i < markers.length; i++) {\n markers[i].setVisible(true);\n }\n }", "function displayAllMarkers(map) {\n for (let i = 0; i < markers.length; i++) {\n markers[i].setMap(map);\n }\n }", "function displayMarkers(){\r\n for(var i=0; i<self.markerArray().length; i++){\r\n self.markerArray()[i][1].setVisible(true);\r\n\tself.markerArray()[i][1].setIcon(defaultIcon);\r\n }\r\n}", "function showMarkers() {\n displayAllMarkers(map);\n }", "function showAllMarkers(){\n\tcenterMap();\n\tfor (var i=0, len = mapMarkers.length; i < len; i++){\n\t\tmapMarkers[i].setVisible(true);\n\t}\n\n}", "function showMarker() {\n for (var i = 0; i < self.markerArray().length; i++) {\n self.markerArray()[i][1].setVisible(true);\n }\n}", "function showHotelOverlays() {\n if (markersArray) {\n for (var i in markersArray) {\n markersArray[i].setMap(gmap);\n }\n }\n}", "showAllMarkers() {\n\t\tthis.showMarkers(this.markers);\n\t}", "function showOverlays() {\n if (manualMarkersArray) {\n for (i in manualMarkersArray) {\n manualMarkersArray[i].setMap(map);\n }\n }\n }", "function showMarkers() {\n\t\t\t \n\t\t\t setAllMap(map);\n\t\t\t\n\t\t\t}", "function showSelectedMarkers() {\n // locations = initMaps();\n\n var count;\n\n for (count = 0; count < locations.length; count++) {\n\n marker = new google.maps.Marker({\n position: new google.maps.LatLng(locations[count][1], locations[count][2]),\n map: map,\n title: locations[count][0],\n animation: google.maps.Animation.DROP\n });\n\n map.setZoom(12);\n\n\n //Attach click event to the marker.\n (function (marker) {\n google.maps.event.addListener(marker, \"click\", function (e) {\n //Wrap the content inside an HTML DIV in order to set height and width of InfoWindow.\n infoWindow.setContent(\"<div style = 'width:200px;min-height:40px'>\" + marker.title + \"</div>\");\n infoWindow.open(map, marker);\n });\n })(marker);\n\n markers.push(marker);\n }\n}", "function showMarkers() {\n\t setAllMap(map);\n\t}", "function showMarkers() {\n\t setAllMap(map);\n\t}", "function displayMarkers(){\n\n // this variable sets the map bounds according to markers position\n var bounds = new google.maps.LatLngBounds();\n \n // for loop traverses markersData array calling createMarker function for each marker \n for (var i = 0; i < markersData.length; i++){\n\n var latlng = new google.maps.LatLng(markersData[i].lat, markersData[i].lng);\n var name = markersData[i].name;\n var address1 = markersData[i].address1;\n var address2 = markersData[i].address2;\n var postalCode = markersData[i].postalCode;\n\n createMarker(latlng, name, address1, address2);\n\n // marker position is added to bounds variable\n bounds.extend(latlng); \n }\n\n // Finally the bounds variable is used to set the map bounds\n // with fitBounds() function\n map.fitBounds(bounds);\n}", "function displayMarkers(){\n\n\t// set the map bounds according to markers position\n\tvar bounds = new google.maps.LatLngBounds();\n\n\t// get Spiderfier to work with Google Maps\n\tvar oms = new OverlappingMarkerSpiderfier(map);\n\n\t// for loop traverses markersData array calling createMarker function for each marker\n\tfor (var i = 0; i < markersData.length; i++){\n\n\t\tvar latlng = new google.maps.LatLng(markersData[i].lat, markersData[i].lng);\n\n\t\t// Spiderfier alternative - change position\n\t\t// var a = 360.0 / markersData.length;\n\t\t// var newLat = markersData[i].lat + -1 * Math.cos((+a*i) / 180 * Math.PI); // x\n\t\t// var newLng = markersData[i].lng + -1 * Math.sin((+a*i) / 180 * Math.PI); // Y\n\t\t// var latlng = new google.maps.LatLng(newLat,newLng);\n\n\t\tmarker = createMarker(latlng, markersData[i]);\n\n\t\t// add marker to Spiderfier\n\t\toms.addMarker(marker);\n\n\t\t// marker position is added to bounds variable\n\t\tbounds.extend(latlng);\n\t}\n\n\t// Finally the bounds variable is used to set the map bounds\n\tmap.fitBounds(bounds);\n}", "function displayMarkers(map) {\n if (self.markers().length > 0) {\n for (i = 0; i < self.markers().length; i++) {\n self.markers()[i].setMap(map);\n }\n }\n }", "function showMarkers() {\n\tsetAllMap(map);\n}", "function displayMarkers(){\r\n\r\n // this variable sets the map bounds according to markers position\r\n var bounds = new google.maps.LatLngBounds();\r\n \r\n // for loop traverses markersData array calling createMarker function for each marker \r\n for (var i = 0; i < markersData1.length; i++){\r\n\r\n var latlng = new google.maps.LatLng(markersData1[i].lat, markersData1[i].lng);\r\n var name = markersData1[i].name;\r\n var address1 = markersData1[i].address1;\r\n \r\n\r\n createMarker(latlng, name, address1);\r\n\r\n // marker position is added to bounds variable\r\n bounds.extend(latlng); \r\n }\r\n\r\n // Finally the bounds variable is used to set the map bounds\r\n // with fitBounds() function\r\n map.fitBounds(bounds);\r\n}", "function showMarkers() {\n setAllMap(map);\n }", "function showListings() {\n for (var z = 0; z < markers.length; z++) {\n markers[z].setMap(map);\n }\n }", "function showAllMarkers() {\n\tsetAllMap(map);\n}", "function showOverlays(map) {\n if (markersArray) {\n for (var i=0; i<markersArray.length; i++) {\n markersArray[i].setMap(map);\n }\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 showMarkers() {\n\t\t setMapOnAll(map);\n\t\t}", "function showMarkers() {\n\t\t setMapOnAll(map);\n\t\t}", "function showMarkers() {\n\t\t\t\t setMapOnAll(map);\n\t\t\t\t}", "function drawMarkers() {\n\t\tfor (var i=0; i < gon.hotspots.length; i++) \n\t\t{\n\t\t\tvar pinImage = new google.maps.MarkerImage(\"http://www.googlemapsmarkers.com/v1/H/FF0000/FFFFFF/FFFFFF/\");\n\t\t\tvar latitude = gon.hotspots[i].latitude;\n\t\t\tvar longitude = gon.hotspots[i].longitude;\n\t\t\tvar myLatlng= new google.maps.LatLng(latitude, longitude);\n\t\t\tvar name = gon.hotspots[i].name;\n\t\t\tvar description = gon.hotspots[i].description;\n\t\t\tvar poster = gon.users[i];\n\t\t\tvar created_at = gon.hotspots[i].created_at;\n\t\t\tvar marker = new google.maps.Marker({\n\t\t\t\ticon: pinImage,\n\t\t\t position: myLatlng,\n\t\t\t map: map,\n\t\t\t info: \"<div class='row' id='view_info'>\"\n\t\t\t\t\t\t + \"<div class='col-md-12'><h3 id='view_name'>\"+ name + \"</h3></div>\"\n\t\t\t\t\t\t + \"</div>\"\n\t\t\t\t\t\t + \"<div class='row'>\"\n\t\t\t\t\t\t + \"<div class='col-md-12'><p id='view_description'>\" + description + \"</p></div>\"\n\t\t\t\t\t\t + \"</div>\"\n\t\t\t\t\t\t + \"<div class='row'>\"\n\t\t\t\t\t\t + \"<div class='col-md-12'><p id='view_poster'>~ \" + poster + \" ~</p></div>\"\n\t\t\t\t\t\t + \"</div>\"\n\t\t\t\t\t\t + \"<div class='row'>\"\n\t\t\t\t\t\t + \"<div class='col-md-12'><p id='view_date'>\" + created_at + \"</p></div>\"\n\t\t\t\t\t\t + \"</div>\"\n\t\t\t\t});\n\t\t\tvar infowindow = new google.maps.InfoWindow(\n\t\t\t{\n\t\t\t\tcontent: \"\"\n\t\t\t});\n\n\t\t\tgoogle.maps.event.addListener(marker, 'mouseover', function() \n\t\t\t{\n\t\t\t\tinfowindow.setContent(this.info)\n\t\t\t\tinfowindow.open(map,this);\n\t \t\t});\n\t\t\t\n\t\t};\n\n\t}", "function showListings() {\n let bounds = new google.maps.LatLngBounds();\n // Extend the boundaries of the map for each marker and display the marker\n for (let i = 0; i < markersArray.length; i++) {\n markersArray[i].setMap(map);\n bounds.extend(markersArray[i].position);\n }\n map.fitBounds(bounds);\n}", "function showMarkers() {\n\t setMapOnAll(map);\n\t}", "function showMarkers() {\r\n setMapOnAll(map);\r\n }", "function showMarkers() {\r\n setMapOnAll(map);\r\n }", "function showMarkers() {\n setAllMap(map);\n}", "function showMarkers() {\n setAllMap(map);\n}", "function showMarkers() {\n setAllMap(map);\n}", "function showMarkers() {\n setAllMap(map);\n}", "function showMarkers() {\n setMapOnAll(map);\n }", "function showMarkers() {\n setMapOnAll(map);\n }", "function showMarkers() {\n setMapOnAll(map);\n }", "function showMarkers(markers) {\n setMapOnAll(map,markers);\n }", "function showMarkers() {\n setMapOnAll(map);\n \n }", "function showMarkers() {\r\n setMapOnAll(map);\r\n }", "function showMarkers(markersArray, map) {\n return markersArray.map((elem) => {\n return elem.setMap(map);\n });\n}", "function showMarkers() {\n setMapOnAll(map);\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 showMarkers() {\n\n setAllMap(map);\n\n}", "function showMarkers() {\n\t\t\tsetMapOnAll(map);\n\t\t}", "function showMarkers() {\r\n myVModel.sQuery('');\r\n var bLimit = new google.maps.LatLngBounds();\r\n for (var x = 0; x < markers.length; x++) {\r\n markers[x].setMap(map);\r\n bLimit.extend(markers[x].position);\r\n }\r\n map.fitBounds(bLimit);\r\n}", "function showMarkers() {\n\tsetMapOnAll(map);\n}", "function showMarkers() {\r\n setMapOnAll(map);\r\n}", "function showMarkers() {\r\n setMapOnAll(map);\r\n}", "function showMarkers() {\r\n setMapOnAll(map);\r\n}", "function displayMarkers(setMap){\n \n var markersData;\n var map;\n \n if(setMap == \"mapTop\"){\n markersData = markersDataTop;\n map = mapTop;\n } else if(setMap == \"mapBottom\") {\n markersData = markersDataBottom;\n map = mapBottom;\n } else if (setMap == \"mapCenter\") {\n markersData = markersDataCenter;\n map = mapCenter;\n }\n \n // this variable sets the map bounds according to markers position\n var bounds = new google.maps.LatLngBounds();\n \n // for loop traverses markersData array calling createMarker function for each marker \n for (var i = 0; i < markersData.length; i++){\n\n var latlng = new google.maps.LatLng(markersData[i].lat, markersData[i].lng);\n var name = markersData[i].name;\n var address1 = markersData[i].address1;\n var address2 = markersData[i].address2;\n var html = markersData[i].html;\n\n createMarker(setMap, latlng, name, address1, address2, html);\n\n // marker position is added to bounds variable\n bounds.extend(latlng); \n }\n\n // Finally the bounds variable is used to set the map bounds\n // with fitBounds() function\n map.fitBounds(bounds);\n}", "function showMarkers() {\r\n setMapOnAll(map);\r\n}", "function showMarkers() {\n setMapOnAll(mapa);\n}", "function showMarkers() {\n setMapOnAll(ourMap);\n}", "function pull_markers(locations_array, map) {\n var infowindow = new google.maps.InfoWindow;\n var marker, i;\n //Placing the markers\n for (i = 0; i < locations_array.length; i++) {\n marker = new google.maps.Marker({\n position: new google.maps.LatLng(locations_array[i].latitude, locations_array[i].longitude),\n map: map\n });\n markers.push(marker);\n var markerObj = locations_array[i];\n //Setting the google maps infowindow (appears when clicked) of the marker based on the index of the array, i.\n google.maps.event.addListener(marker, 'click', (function (infowindow, markerObj, marker) {\n return function () {\n var content_string = markerObj.create_content();\n infowindow.open(map, marker);\n infowindow.setContent(content_string);\n markerObj.add_listeners(infowindow, marker);\n };\n })(infowindow, markerObj, marker));\n }\n}", "function showMarkers(){\n for(var i=0;i<self.restaurantList().length;i++){\n var m = self.restaurantList()[i].marker.marker;\n m.setAnimation(null);\n m.setVisible(true);\n }\n }", "function showMarkers() {\n setMapOnAll(mainMap);\n}", "function makeMarkers(array, map) {\n \n let markers = [];\n let infoWindows = [];\n let contentString = '';\n \n\n for(let i = 0; i < array.length; i++) {\n let marker = new google.maps.Marker({position: { lat: array[i][\"lat\"], lng: array[i][\"lng\"] }, map: map })\n /*\n\n\n currently hard coded, content string for each infoWindow should reflect each marker's information\n markers are pulled from selectedBirdSightings\n\n\n */\n\n contentString = '<div id=\"content\">'+\n '<div id=\"siteNotice\">'+\n '</div>'+\n `<h1 id=\"firstHeading\" class=\"firstHeading\">${array[i].comName}</h1>`+\n `<p><i>${array[i].sciName}</i></p>`+ \n '<div id=\"bodyContent\">'+\n `<p>Seen at this location: ${array[i].locName}</p>`+\n `<p>Number seen: ${array[i].howMany}</p>`+\n '</div>'+\n '</div>';\n\n \n infowindow = new google.maps.InfoWindow({\n content: contentString\n });\n infoWindows.push(infowindow)\n\n marker.addListener('click', () => {\n infoWindows[i].open(map, marker)\n });\n markers.push(marker)\n }\n console.log('this should be all the markers: ', markers)\n return markers\n }", "function showMarkers() {\n setMapOnAll(map);\n}", "function showMarkers() {\n setMapOnAll(map);\n}", "function showMarkers() {\n setMapOnAll(map);\n}", "function showMarkers() {\n setMapOnAll(map);\n}", "function showMarkers() {\n setMapOnAll(map);\n}", "function showMarkers() {\n setMapOnAll(map);\n}", "function showMarkers() {\n setMapOnAll(map);\n}", "function showMarkers() {\n setMapOnAll(map);\n}", "function showMarkers() {\n setMapOnAll(map);\n}", "function showMarkers() {\n setMapOnAll(map);\n}", "function showMarkers() {\n setMapOnAll(map);\n}", "function addAllMarkers(){\n\t//\tLooping over every marker in the Array\n\tfor (var i = 0; i < AllMarkers.length; i++) {\n\t\t//\tCreating a new instance of Google Maps Markers\n\t\tmarker = new google.maps.Marker({\n\t\t\tposition:{\n\t\t\t\tlat: AllMarkers[i].lat,\n\t\t\t\tlng: AllMarkers[i].lng\n\t\t\t},\n\t\t\tmap: map,\n\t\t\tanimation: google.maps.Animation.DROP,\n\t\t\t//\tChanging the icon image\n\t\t\ticon: \"imgs/bicycle.png\",\n\t\t\ttitle: AllMarkers[i].title,\n\t\t\tdescription: AllMarkers[i].description\n\t\t})\n\t\t//\tCreating an array for all of the Markers that are on screen\n\t\t//\tPushing each of the markers into the Array\n\t\tmarkers.push(marker);\n\t\t//\tLink the infobox to this Marker\n\t\t//\tThis used to be called AllInfobox(marker);\n\t\t//\tAllinfobox(marker);\n\t\t//\tAnd is now called MarkerClickEvent(marker); as more than one event will be added\n\t\tMarkerClickEvent(marker);\n\t};\n}", "function showMarkers() {\n setMapOnAll(map);\n}", "function showMarkers() {\n setMapOnAll(map);\n}", "function showMarkers() {\n setMapOnAll(map);\n}", "function showMarkers() {\n setMapOnAll(map);\n}", "function showMarkers() {\n setMapOnAll(map);\n}", "function showMarkers() {\n setMapOnAll(map);\n}", "function showMarkers() {\n setMapOnAll(map);\n}", "function showMarkers() {\n setMapOnAll(map);\n}", "function showMarkers() {\n setMapOnAll(map);\n}", "function showMarkers() {\n setMapOnAll(map);\n}", "function showMarkers() {\n setMapOnAll(map);\n}", "function showMarkers() {\n setMapOnAll(map);\n}", "function showMarkers() {\n setMapOnAll(map);\n}", "function displayMarker(filterMarkers) {\n\tfor (i = 0; i < markers.length; i++) {\n\t\tif (filterMarkers.includes(markers[i])) {\n\t\t\tmarkers[i].setMap(map);\n\t\t} else {\n\t\t\tmarkers[i].setMap(null);\n\t\t}\n\t}\n}", "function setMarkersVisible() {\n for (var i = 0; i < markers.length; i++) {\n markers[i].setMap(map);\n }\n}", "function showMarkers(tipo) {\n for (var i = 0; i < markers.length; i++) {\n if (republicas[i].tipo == tipo) {\n markers[i].setMap(MAP);\n }\n }\n}", "function showAllMarkers() {\n var bounds = new google.maps.LatLngBounds();\n // Extend the boundaries of the map for each marker and display the marker\n for (var i = 0; i < markers.length; i++) {\n markers[i].setMap(map);\n markers[i].setAnimation(google.maps.Animation.DROP);\n bounds.extend(markers[i].position);\n }\n google.maps.event.addDomListener(window, 'resize', function() {\n map.fitBounds(bounds); // `bounds` is a `LatLngBounds` object\n });\n map.fitBounds(bounds);\n}", "function showAllMarkers() {\n setMarkersOnMap(map);\n map.setZoom(12);\n map.setCenter(new google.maps.LatLng(49.246292, -123.116226));\n}", "function showListings() {\r\n var bounds = new google.maps.LatLngBounds();\r\n // Extend the boundaries of the map for each marker and display the marker\r\n for (var i = 0; i < markers.length; i++) {\r\n markers[i].setMap(map);\r\n bounds.extend(markers[i].position);\r\n }\r\n map.fitBounds(bounds);\r\n }", "function drawMarkers(markerArray) {\n // Delete existing markers\n for (let marker of markerArray) {\n marker.setMap(null);\n }\n markerArray = [];\n for (let response of results) {\n let lat = response[0];\n let lng = response[1];\n markerArray.push(new google.maps.Marker({\n position: {\n lat: lat,\n lng: lng\n },\n map: map,\n icon: {\n url: icons[iconset][response[2]],\n anchor: new google.maps.Point(5,5)\n },\n clickable: false\n }))\n }\n return markerArray;\n}", "function showMarkers() {\n setMapOnAll(guhMap);\n}", "function displayMarkersPlace(place){\r\n for(var i=0;i<self.markerArray().length; i++){\r\n if(place.location.lat == self.markerArray()[i][0].lat && place.location.lng == self.markerArray()[i][0].lng){\r\n self.markerArray()[i][1].setVisible(true);\r\n\t self.markerArray()[i][1].setIcon(defaultIcon);\r\n }\r\n }\r\n}", "function refreshMarkers(){\n\t\t// Build the map pins.\n\n\t\tif(!pinsLoaded)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t\t\n\t\tvar counter = 1;\n\t\tvar foodCounter = 1;\n\t\tvar indexTxt = \"<b>R\" + row + \"C\" + col + \"</b><br /><br />\";\n\t\tvar indexTxtFood = \"<b>R\" + row + \"C\" + col + \"</b><br /><br />\";\n\t\tvar indexTxtStar = \"<b>R\" + row + \"C\" + col + \"</b><br /><br />\";\n\t\t\n\t\t\n\t\t\n\t\t// Clear the last set of map pins\n\t\twhile(0 != singleMapArray.length)\n\t\t{\n\t\t\tsingleMapArray.pop();\n\t\t}\n\t\twhile(0 != starbucksArray.length)\n\t\t{\n\t\t\tstarbucksArray.pop();\n\t\t}\t\t\n\t\t\n\t\twhile(0 != toilettesArray.length)\n\t\t{\n\t\t\ttoilettesArray.pop();\n\t\t}\n\t\t\n\t\twhile(0 != foodArray.length)\n\t\t{\n\t\t\tfoodArray.pop();\n\t\t}\t\t\n\t\t\n\t\twhile(0 != stationArray.length)\n\t\t{\n\t\t\tstationArray.pop();\n\t\t}\t\t\t\t\n\t\t\n\t\tmapBounds = map.getBounds();\n\t\t\n\t\tvar textColor = \"000000\";\n\n\t\t// Walk the master list and build the pins for the current segment\n\t\tfor( var pin = 0; pin < masterMapPinArray.length; pin++)\n\t\t{\n\t\t\tvar tempPin = masterMapPinArray[pin];\n\t\t\tvar pinLatLng = new google.maps.LatLng(tempPin.slat, tempPin.slng);\n\t\t\n\t\t\tif(mapBounds.contains(pinLatLng))\n\t\t\t{\n\t\t\t\tif(tempPin.type.toUpperCase() == \"STARBUCKS\")\n\t\t\t\t{\n\t\t\t\t\tstarbucksArray.push(new google.maps.Marker({position:pinLatLng, icon:starbucksIcon}));\n\t\t\t\t}\n\t\t\t\telse if(tempPin.type.toUpperCase() === \"WC\")\n\t\t\t\t{\n\t\t\t\t\ttoilettesArray.push(new google.maps.Marker({position:pinLatLng, icon:toilettesIcon}));\n\t\t\t\t}\n\t\t\t\telse if(tempPin.type.toUpperCase() == \"RESTAURANT\" ||\n\t\t\t\t tempPin.type.toUpperCase() == \"BISTRO\" ||\n\t\t\t\t tempPin.type.toUpperCase() == \"CAFE\" ||\n\t\t\t\t tempPin.type.toUpperCase() == \"BOULANGER\" ||\n\t\t\t\t tempPin.type.toUpperCase() == \"BRASSERIE\"\n\t\t\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\ttempPin.pinNumber = foodCounter.toString();\n\t\t\t\t\tvar textColor = \"000000\";\n\t\t\t\t\tif(firstPinIndex < foodCounter && foodCounter < firstPinIndex+31)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(tempPin.webpage != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tindexTxtFood += tempPin.pinNumber + \" \";\n\t\t\t\t\t\t\tindexTxtFood += \"<a href=\\\"\" + tempPin.webpage+ \"\\\" target=\\\"_blank\\\">\";\n\t\t\t\t\t\t\tindexTxtFood += tempPin.name;\n\t\t\t\t\t\t\tindexTxtFood += \"</a>\";\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\tindexTxtFood += tempPin.pinNumber + \" \" + tempPin.name;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(showMetro && tempPin.subway != null && tempPin.subway != \"???\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tindexTxtFood += \" -- \" + getIndexIcon(tempPin.subway);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tindexTxtFood += \"<br />\";\n\t\t\t\t\t\t//foodArray.push(new StyledMarker({styleIcon: new StyledIcon(StyledIconTypes.MARKER,\n\t\t\t\t\t\t//\t{color:tempPin.pinColor, fore:textColor, text:tempPin.pinNumber}),\n\t\t\t\t\t\t//\tposition:pinLatLng, title:tempPin.name}));\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t//var newMarkerFood = new StyledMarker({styleIcon: new StyledIcon(StyledIconTypes.MARKER,\n\t\t\t\t\t\t//\t{color:tempPin.pinColor, fore:textColor, text:tempPin.pinNumber}),\n\t\t\t\t\t\t//\tposition:pinLatLng, title:tempPin.name})\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tvar newMarkerFood = new google.maps.Marker({ position: pinLatLng, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t title: 'Pin1', \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t icon: 'https://chart.googleapis.com/chart?chst=d_map_pin_letter&chld='+tempPin.pinNumber+'|'+tempPin.pinColor+'|000000'\n\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\tgoogle.maps.event.addListener(newMarkerFood, 'click', (function(newMarkerFood, pin) {\n\t\t\t\t\t\t\t\t\treturn function() {\n\t\t\t\t\t\t\t\t\t stationIcons = getBubbleStationIcons(masterMapPinArray[pin].station);\n\t\t\t\t\t\t\t\t\t bubbleText = masterMapPinArray[pin].pinText+ \"<br/>\" + stationIcons;\n\t\t\t\t\t\t\t\t\t infoBubble.setContent(bubbleText);\n\t\t\t\t\t\t\t\t\t infoBubble.open(map, newMarkerFood);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t })(newMarkerFood, pin));\n\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\tfoodArray.push(newMarkerFood);\n\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tfoodCounter++;\n\n\t\t\t\t}\n\t\t\t\telse if(tempPin.type.toUpperCase() == \"MCD\")\n\t\t\t\t{\n\t\t\t\t\tstarbucksArray.push(new google.maps.Marker({position:pinLatLng, icon:mcdonaldsIcon}));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttempPin.pinNumber = counter.toString();\n\t\t\t\t\t\n\t\t\t\t\t// If we are zoomed out and the number goes to three (or 4) digits, use the rightmost 2\n\t\t\t\t\tif(2 <tempPin.pinNumber.length)\n\t\t\t\t\t{\n\t\t\t\t\t\ttextLength = tempPin.pinNumber.length;\n\t\t\t\t\t\ttempPin.pinNumber = tempPin.pinNumber.slice(textLength-2);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif(firstPinIndex < counter && counter < firstPinIndex+31)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Build an index item\n\t\t\t\t\t\t// This trip gets BOLD\n\t\t\t\t\t\tif(tempPin.type.toUpperCase() == \"THISTRIP\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tindexTxt += \"<b>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Add the name of the pin\n\t\t\t\t\t\tif(tempPin.webpage != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tindexTxt += tempPin.pinNumber + \" \";\n\t\t\t\t\t\t\tindexTxt += \"<a href=\\\"\" + tempPin.webpage+ \"\\\" target=\\\"_blank\\\">\";\n\t\t\t\t\t\t\tindexTxt += tempPin.name;\n\t\t\t\t\t\t\tindexTxt += \"</a>\";\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\tindexTxt += tempPin.pinNumber + \" \" + tempPin.name;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Add the note for the pin\n\t\t\t\t\t\tif(tempPin.note != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//\"Best Thing\" gets BOLD\n\t\t\t\t\t\t\tif(tempPin.type.toUpperCase() == \"BESTTHING\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tindexTxt += \"<b>\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(tempPin.note != \"\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tindexTxt += \" -- \" + tempPin.note;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(tempPin.type.toUpperCase() == \"BESTTHING\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tindexTxt += \"</b>\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t// Add the subway stop icons\n\t\t\t\t\t\tif(showMetro && tempPin.subway != null && tempPin.subway != \"???\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tindexTxt += \" -- \" + getIndexIcon(tempPin.subway);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\n\t\t\t\t\t\tindexTxt += \"<br />\";\n\n\t\t\t\t\t\tif(tempPin.type.toUpperCase() == \"THISTRIP\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tindexTxt += \"</b>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Make a marker and save it\n\t\t\t\t\t\t// var newMarker = new StyledMarker({styleIcon: new StyledIcon(StyledIconTypes.MARKER,\n\t\t\t\t\t\t\t// {color:tempPin.pinColor, \n\t\t\t\t\t\t\t// fore:textColor, \n\t\t\t\t\t\t\t// text:tempPin.pinNumber}),\n\t\t\t\t\t\t\t// position:pinLatLng, title:tempPin.name})\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tvar newMarker = new google.maps.Marker({ position: pinLatLng, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t title: 'Pin1', \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t icon: 'https://chart.googleapis.com/chart?chst=d_map_pin_letter&chld='+tempPin.pinNumber+'|'+tempPin.pinColor+'|000000'\n\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\t\n\t\t\t\t\t\t\tgoogle.maps.event.addListener(newMarker, 'click', (function(newMarker, pin) {\n\t\t\t\t\t\t\t\t\treturn function() {\n\t\t\t\t\t\t\t\t\t stationIcons = getBubbleStationIcons(masterMapPinArray[pin].station);\n\t\t\t\t\t\t\t\t\t bubbleText = masterMapPinArray[pin].pinText+ \"<br/>\" + stationIcons;\n\t\t\t\t\t\t\t\t\t infoBubble.setContent(bubbleText);\n\t\t\t\t\t\t\t\t\t infoBubble.open(map, newMarker);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t })(newMarker, pin));\n\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\t\n\t\t\t\t\t\tsingleMapArray.push(newMarker);\n\t\t\t\t\t}\n\t\t\t\t\tcounter++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tpinCount = counter;\n\t\t\n\t\tfor(var pin = 0; pin < masterStationArray.length; pin++)\n\t\t{\n\t\t\tvar tempPin = masterStationArray[pin];\n\t\t\tvar pinLatLng = new google.maps.LatLng(tempPin.slat, tempPin.slng);\n\t\t\tif(mapBounds.contains(pinLatLng))\n\t\t\t{\n\t\t\t\tstationArray.push(masterStationArray[pin].stationPin);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//latlngNE = document.getElementById('latlngNE');\n\t\t//latlngNE.innerHTML = mapBounds.getNorthEast().lat() + \" \" + mapBounds.getNorthEast().lng();\n\t\t\n\t\t//latlngSW = document.getElementById('latlngSW');\n\t\t//latlngSW.innerHTML = mapBounds.getSouthWest().lat() + \" \" + mapBounds.getSouthWest().lng();\n\t\t//cornerPinLatLng = mapBounds.getNorthEast();\n\t\t\n\t\t//singleMapArray.push(new StyledMarker({styleIcon: new StyledIcon(StyledIconTypes.MARKER,\n\t\t//\t\t\t\t{color:\"FFFFFF\"}),\n\t\t//\t\t\t\tposition:cornerPinLatLng}));\n\t\t\n\t\t\n\t\tvar index = document.getElementById('mapindex');\n\n\t\tmgr.clearMarkers(); \n\n\t\tif(showMetro)\n\t\t{\n\t\t\tmgr.addMarkers(stationArray,10);\n\t\t\tmgr.addMarkers(entranceArray, 17);\n\t\t}\n\t\tif(showStarbucks)\n\t\t{\n\t\t\tmgr.addMarkers(starbucksArray,10);\n\t\t}\n\t\tif(showToilettes)\n\t\t{\n\t\t\tmgr.addMarkers(toilettesArray,10);\n\t\t}\n\n\t\tif(showFood)\n\t\t{\n\t\t\tmgr.addMarkers(foodArray,10);\n\t\t\tindex.innerHTML = indexTxtFood;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tmgr.addMarkers(singleMapArray, 10);\n\t\t\t// Debugging\n\t\t\t//indexTxt += debuggingString;\n\t\t\t//var markerCount = mgr.getMarkerCount(10);\n\t\t\t\n\t\t\t//indexTxt += \"<br />Debugging: MarkerCount at refresh time =\" + markerCount + \"<br />\";\n\t\t\t//End debugging\n\t\t\t\n\t\t\tindex.innerHTML = indexTxt;\n\t\t}\n\t\t\n\t\t//if(showArrondissement)\n\t\t//{\n\t\t//\tpolyline1.setMap(map);\n\t\t//\tpolyline2.setMap(map);\n\t\t//\tpolyline3.setMap(map);\n\t\t//\tpolyline4.setMap(map);\n\t\t//\tpolyline5.setMap(map);\n\t\t//\tpolyline6.setMap(map);\n\t\t//\tpolyline7.setMap(map);\n\t\t//\tpolyline8.setMap(map);\n\t\t//\tpolyline9.setMap(map);\n\t\t//\tpolyline10.setMap(map);\n\t\t//\tpolyline11.setMap(map);\n\t\t//\tpolyline12.setMap(map);\n\t\t//\tpolyline13.setMap(map);\n\t\t//\tpolyline14.setMap(map);\n\t\t//\tpolyline15.setMap(map);\n\t\t//\tpolyline16.setMap(map);\n\t\t//\tpolyline17.setMap(map);\n\t\t//\tpolyline18.setMap(map);\n\t\t//\tpolyline19.setMap(map);\n\t\t//\tpolyline20.setMap(map);\n\t\t//}\n\t\t\n\t\tmgr.refresh();\n\t}", "function showListings() {\n var bounds = new google.maps.LatLngBounds();\n // Extend the boundaries of the map for each marker and display the marker\n for (var i = 0; i < markers.length; i++) {\n markers[i].setMap(map);\n bounds.extend(markers[i].position);\n }\n map.fitBounds(bounds);\n }" ]
[ "0.8040027", "0.80266863", "0.79570055", "0.79342085", "0.7777212", "0.7777212", "0.7773515", "0.77402323", "0.7708924", "0.7641455", "0.7548494", "0.75341374", "0.7511257", "0.74889493", "0.74577504", "0.74266666", "0.74018806", "0.7395818", "0.7395818", "0.7391396", "0.73902667", "0.73733675", "0.73492193", "0.73419446", "0.7340275", "0.7339394", "0.733191", "0.73201686", "0.73147917", "0.7307458", "0.7307458", "0.7300523", "0.72884464", "0.72762823", "0.7264311", "0.72288245", "0.72207487", "0.7212404", "0.7212404", "0.7212404", "0.7205498", "0.71973515", "0.71958095", "0.71958095", "0.71954006", "0.71935755", "0.71924555", "0.7190609", "0.71897686", "0.71869284", "0.7164347", "0.714771", "0.71263003", "0.71259856", "0.7125549", "0.7125549", "0.7125549", "0.7108576", "0.7087631", "0.70720893", "0.7061792", "0.7037673", "0.70374274", "0.70370406", "0.7036481", "0.7035707", "0.7035707", "0.7035707", "0.7035707", "0.7035707", "0.7035707", "0.7035707", "0.7035707", "0.7035707", "0.7035707", "0.7035707", "0.7029745", "0.702902", "0.702902", "0.702902", "0.702902", "0.702902", "0.702902", "0.702902", "0.702902", "0.702902", "0.702902", "0.702902", "0.702902", "0.702902", "0.70242214", "0.701151", "0.70024", "0.6994063", "0.6990063", "0.69711846", "0.6971041", "0.6967996", "0.6966655", "0.696558", "0.6959128" ]
0.0
-1
This function will loop through the listings and hide them all.
function hideListings() { for (var i = 0; i < markers.length; i++) { markers[i].setMap(null); var bounds = new google.maps.LatLngBounds(); bounds.extend({lat:52.515919, lng:13.454574}); map.fitBounds(bounds); map.setZoom(13); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hideListings() {\n for (var z = 0; z < markers.length; z++) {\n markers[z].setMap(null);\n }\n }", "function hideListings() {\r\n for (var i = 0; i < markers.length; i++) {\r\n markers[i].setMap(null);\r\n }\r\n }", "function hideListings() {\n for (var i = 0; i < markers.length; i++) {\n markers[i].setMap(null);\n }\n}", "function hideListings() {\n for (var i = 0; i < markers.length; i++) {\n markers[i].setMap(null);\n }\n}", "function hideListings() {\n for (var i = 0; i < markers.length; i++) {\n markers[i].setMap(null);\n }\n}", "function hideListings() {\r\n for (var i = 0; i < markers.length; i++) {\r\n markers[i].setMap(null);\r\n }\r\n}", "function filterSmoking(){\r\n for(let i = 0; i < listings.length; i++){\r\n let l = listings[i].val;\r\n listings[i].visible = l.smoking && listings[i].visible;\r\n }\r\n}", "function hideList() {\r\n\tdocument.querySelector(\".search-list2\").style.display=\"none\";\r\n\tdocument.querySelector(\".list\").style.display=\"block\";\r\n\twindow.location.href=\"Job listings with filtering.html\";\r\n}", "function hideAll(){\n for (let i = 0; i < studentList.length; i ++){\n studentList[i].style.display = 'none';\n}\n}", "function hideList (studentList) {\n for(let i = 0; i < studentList.length; i++)\n studentList[i].style.display = 'none';\n}", "function showAll() {\n UI.list.find('li').show();\n UI.showMore.hide();\n }", "function showAll(){\n var tasks = document.querySelectorAll('#list li');\n for(let i=0;i<tasks.length;i++){\n tasks[i].style.visibility='visible';\n \n }\n}", "function hideAllStudents() {\n for(let i = 0; i < studentLI.length; i++) {\n studentLI[i].style.display = \"none\";\n }\n}", "function hideMuseumListings() {\n for (let i = 0; i < markersMuseum.length; i++) {\n markersMuseum[i].setMap(null);\n }\n}", "function hideHotelListings() {\n for (let i = 0; i < markersHotel.length; i++) {\n markersHotel[i].setMap(null);\n }\n}", "function hideAll() {\n $(\"[id*='.list']\").not(\"[id*='metadata.list']\").not(\"[id='regions.list']\").not(\"[id*='filters.list']\").hide()\n // Add special case excluded by above selector\n $(\"[id*='metric_filters.list']\").hide()\n\n $(\"[id*='.details']\").hide()\n var element = document.getElementById('scout_display_account_id_on_all_pages')\n if ((element !== undefined) && (element.checked === true)) {\n showRow('account_id')\n }\n currentResourcePath = ''\n}", "function hideList(list) {\n list.style.display = \"none\";\n}", "function filterBaths(bathNum){\r\n for(let i = 0; i < listings.length; i++){\r\n let l = listings[i].val;\r\n if(bathNum === 3) {\r\n listings[i].visible = l.bathNum >= bathNum && listings[i].visible;\r\n } else {\r\n listings[i].visible = l.bathNum === bathNum && listings[i].visible;\r\n }\r\n }\r\n}", "function hideRestaurantListings() {\n for (let i = 0; i < markersRestaurant.length; i++) {\n markersRestaurant[i].setMap(null);\n }\n}", "function hideElements() {\n for (let i = 0; i < numOfItems; i++) {\n studentList[i].style.display = 'none';\n }\n}", "function showListings() {\n for (var z = 0; z < markers.length; z++) {\n markers[z].setMap(map);\n }\n }", "function hideAll() {\n divInfo.forEach(function(el) {\n el.style.display = 'none';\n });\n}", "function hideFilterSelections() {\n // hides years and states that have no shootings \n $('ul.filter li > a').not('.check').parent().css('display', 'none');\n}", "function hideParkListings() {\n for (let i = 0; i < markersPark.length; i++) {\n markersPark[i].setMap(null);\n }\n}", "function hideAllPosts() {\n\tfor(var i = 0; i < allPosts.length; i++) {\n\t\tallPosts[i].style.display = \"none\";\n\t}\n}", "function hideAll() {\n for (var i=0; i<lessonsClass.length; i++){\n document.getElementById(lessonsClass[i].id).style.display = \"none\";\n }\n}", "hideOffscreenElements() {\n const startIndex = Math.floor(-(this.scrollContainer.y - this.y) / this.itemHeight);\n const endIndex = Math.floor(startIndex + (this.height / this.itemHeight));\n for (let i = 0; i < this.items.length; i++) {\n const item = this.items[i];\n item.visible = false;\n if (i >= startIndex && i <= endIndex + 1) {\n item.visible = true;\n }\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}", "function hideItems() {\n \"use strict\";\n var i;\n for (i = 0; i < markers.length; i += 1) {\n markers[i].setVisible(false);\n }\n markers = [];\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 HideFlakes()\r\n{\r\n\tfor(i = 0; i < maxFlakes; i++)\r\n\t{\r\n\t\taFlake = arFlakes[i];\r\n\r\n\t\tel = document.getElementById(\"dot\" + aFlake.id);\r\n\t\tel.style.visibility = \"hidden\";\r\n\t\taFlake.visible = false;\r\n\t}\r\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 hide_all() {\n\tcategories.forEach(category => hide(category));\n}", "function filterPets(){\r\n for(let i = 0; i < listings.length; i++){\r\n let l = listings[i].val;\r\n listings[i].visible = l.pets && listings[i].visible;\r\n }\r\n}", "function hideAll(){\n $$('.contenido').each(function(item){\n item.hide();\n })\n}", "function hideStar() {\n\tconst starList = document.querySelectorAll('.stars li');\n\tfor (star of starList) {\n\t\tif (star.style.display !== 'none')\n\t\t{\n\t\t\tstar.style.display = 'none';\n\t\t\tbreak;\n\t\t}\n\t}\n}", "function showListings() {\n if(isShowingMarkers == true) {\n hideListings();\n isShowingMarkers = false;\n return;\n } else {\n var bounds = new google.maps.LatLngBounds();\n // Extend the boundaries of the map for each marker and display the marker\n for (var i = 0; i < markers.length; i++) {\n markers[i].setMap(map);\n bounds.extend(markers[i].position);\n }\n map.fitBounds(bounds);\n isShowingMarkers = true;\n return;\n }\n}", "function showListById(id) {\n $(\"[data-hook='list-books-\" + id + \"']\").removeClass(\"hidden\").removeClass(\"invis\");\n}", "function whack() {\n\tvar $t = $(\"ol\"); // do the same thing as above but name it $t\n if (shown) { // see if shown is true, and if it is,\n shown = false; // set shown to false (for next time),\n $t.hide(1300); // hide all the 'ol' items over 1300 milliseconds\n } else { // if shown is not true, \n shown = true; // set shown to false (for next time)\n $t.show(1300); // show all the 'ol' items over 1300 milliseconds\n }\n}", "function setAllNamesDisplayNone(){\n for(let i = 0; i < studentList.length; i++){\n studentList[i].style.display = 'none';\n }\n}", "function hideStar() {\n const starList = document.querySelectorAll('.stars li');\n for (star of starList) {\n if (star.style.display !== 'none') {\n star.style.display = 'none';\n break;\n }\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 }", "hideSongsList() {\n var self = this;\n moveElement(self.PLbar, self.hideX[0], false, 12, function(){\n self.pageContentGR.style.gridColumn = \"1/3\"\n self.songInfoGR.style.gridColumn = \"1/3\"\n });\n moveElement(self.PLfoldBTN, self.hideX[1], false, 15, function(){\n self.PLfoldBTN.innerHTML = \"&gt;\";\n self.foldMouseOn = Date.now() + 2000;\n });\n this.songsListHidden = true;\n }", "function hideStar() {\n const starLi = document.querySelectorAll('.stars li');\n for (star of starLi) {\n if (star.style.display !== 'none') {\n star.style.display = 'none';\n break;\n }\n\n }\n}", "function hideStar() {\n const stars = document.querySelectorAll(\".stars li\");\n for (star of stars) {\n if (star.style.display !== 'none') {\n star.style.display = 'none';\n break;\n }\n }\n}", "function hideStar(){\n const starsNodeList = document.querySelectorAll('.stars li');\n console.log(starsNodeList);\n for(star of starsNodeList){\n if(star.style.display !== 'none'){\n star.style.display = 'none';\n break;\n }\n }\n}", "function samling() {\n\n\n\n\t\tif (jQuery(sam).hide) {\n\t\t\tfor (var i = 0; i < sam.length; i++) {\n\t\t\t\tjQuery(mod[i]).hide();\n\t\t\t\tjQuery(ren[i]).hide();\n\t\t\t\tjQuery(sam[i]).show();\n\t\t\t\tjQuery(fors[i]).hide();\n\n\t\t\t}\n\t\t\tsv.scrollIntoView(true);\n\t\t}\n\n\t}", "function displayNoneList() {\n document.querySelector('ul').style.display = \"none\";\n}", "function showPage(list, page) { \n const startIndex = (page * pageMax) - pageMax; //startIndex becomes 0 if the page is 1, 10 if page is 2, etc.\n const endIndex = (page * pageMax) - 1; //endIndex becomes 9 if page is 1, 19 if page is 2, etc.\n for (let i = 0; i < list.length; i++) //for loop will run through the entire number of list items before stopping\n if ( i >= startIndex && i <= endIndex) {\n list[i].style.display = ''; //displays all list items within the range of startIndex' value and endIndex' value\n } else {\n list[i].style.display = 'none'; //hides all list items not contained within the start and end Index values.\n }\n\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 }", "_hideItems () {\n const firstFour = this.listItems.filter(notHidden => !notHidden.classList.contains(\"responsive-hidden\") && notHidden.querySelector(SELECTORS.SUB) === null && this._el.querySelector(\"UL\") === notHidden.parentElement);\n\n if (this.submenus.length > 0) {\n this.submenus.forEach(levelTwo => {\n levelTwo.parentElement.classList.add(\"responsive-hidden\");\n });\n\n if (firstFour.length > 4) {\n firstFour.slice(4).forEach(item => {\n item.parentElement.classList.add(\"responsive-hidden\");\n });\n }\n } else {\n this.listItems.slice(4).forEach(items => {\n items.classList.add(\"responsive-hidden\");\n });\n }\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 filterPageDisplayAll() {\n $record_lines.show();\n $no_record_lines.hide();\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 disappear(y, j) {\n for (let i = 0; i < y.length; i += 1) {\n let li = y[i];\n const top = j * 10;\n const bottom = top - 11;\n if(i < top && i > bottom) {\n li.style.display = 'block';\n } else {\n li.style.display = 'none';\n }\n }\n}", "function showFiltersTop2(odsLenght) {\n\tfor (var i=6; i<parseInt(odsLenght);i++) {\n\t\tvar li = \"liOds\"+(i);\n\t\tdocument.getElementById(li).style.display = 'block';\n\t\tdocument.getElementById('f_vermas2').style.display = 'none';\n\t}\n}", "function hideAll() {\n for (i = 0; i < checkerArray.length; i++) {\n checkerArray[i].style.display = \"none\";\n }\n}", "function hideStudents(studentsList,page){\n\n let startIndex = (page*studentsPerPage) - studentsPerPage;\n let endIndex = page*studentsPerPage;\n console.log('Students list '+studentsList.length);\n console.log('Start '+startIndex);\n console.log('EndIndex '+endIndex);\n\n //Initially hide all students\n for(let i=0;i<studentsListItems.length;i++){\n \n let liElement = studentsListItems[i];\n liElement.style.display='none';\n }\n\n //Show those whose index is between start and end index of given page param\n for(let i=0;i<studentsList.length;i++){\n\n let liElement = studentsList[i];\n if(i>=startIndex && i<endIndex ){\n //console.log(liElement.textContent);\n liElement.style.display='block';\n \n }\n /*else{\n liElement.style.display='none';\n }*/\n }\n}", "function hideStar() {\n for(star of stars) {\n if(star.style.visibility !== \"hidden\") {\n (star.style.visibility = \"hidden\")\n starList.pop();\n break;\n }\n }\n}", "function hideShowPagination() {\n\t\t\tif (newsList.matchingItems.length == 0) {\n\t\t\t\t(0, _jquery2.default)('.news-pagination-wrapper').hide();\n\t\t\t} else {\n\t\t\t\t(0, _jquery2.default)('.news-pagination-wrapper').show();\n\t\t\t}\n\t\t}", "function hideField() {\n var camelArray = [camelBlue, camelGreen, camelRed, camelYellow];\n var waitingMessArray = [waitingForBlueCamelRider,waitingForGreenCamelRider,waitingForRedCamelRider,waitingForYellowCamelRider]\n\n $.each(waitingMessArray, function (index) {\n this.attr({\n visibility: 'hidden'\n });\n\n });\n\n\n\n\n $.each(camelArray, function (index) {\n this.attr({\n visibility: 'hidden'\n });\n\n });\n\n $.each(fieldArray, function (index) {\n this.attr({\n visibility: 'hidden'\n });\n });\n\n\n\n if(Session.get('PlayerId')== 0) blueidentity.attr({ visibility: 'hidden' });\n if(Session.get('PlayerId')== 1) greenidentity.attr({ visibility: 'hidden'});\n if(Session.get('PlayerId')== 2) redidentity.attr({ visibility: 'hidden' });\n if(Session.get('PlayerId')== 3) yellowidentity.attr({ visibility: 'hidden' });\n\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 displayListings(data) {\n // Target the housing container already present in index.html\n var $housing = $('.js-housing');\n $housing.empty();\n var $container, i;\n // Loop through each listing\n for (i=0; i<data.length; i++) {\n var listing = data[i].properties;\n var coordinates = data[i].geometry.coordinates;\n // Creates a basic listing\n if (listing.sublease) {\n $container = displaySublease(listing, i, coordinates);\n //console.log(\"listing in displaysublease: \", listing);\n //console.log('sublease listing');\n } else {\n $container = displayPromo(listing, i, coordinates);\n //console.log('promo listing');\n }\n // Add the listing to the DOM\n $housing.append($container);\n }\n}", "function hideBuilding() {\n hideMarker( buildingIndex );\n}", "function hideAllChildren(){\n uki.map( screens, function(screen){\n screen.visible(false);\n });\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 hideMarkers() {\n\tfor(var i = 0; i < markers.length; i++) {\n\t\tmarkers[i].setVisible(false);\n\t}\n}", "function hideUlUnder( id )\r\n{ \r\n document.getElementById(id).getElementsByTagName('ul')[0].style['visibility'] = 'hidden';\r\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 ];\n elementsArr.forEach($elem => $elem.hide());\n }", "function filter(filterList) {\r\n\r\n for (var i = 0; i < jobList.length; i++) {\r\n if (filterList.includes(jobList[i].Category) || filterList.length == 0 ) {\r\n document.getElementById(i).style.display = \"block\"\r\n } else { \r\n document.getElementById(i).style.display = \"none\"\r\n }\r\n }\r\n}", "function hideAll(){\n $$('.contenido').each(function(item){\n item.hide();\n //console.log(item);\n })\n counter=0;\n}", "function buttonFilterNearEvent(){\n var ul = document.getElementsByClassName(\"eventListTable\");\n var filtro = ul[0].getElementsByTagName(\"h2\");\n var li = ul[0].getElementsByTagName(\"li\");\n var name = ul[0].getElementsByTagName(\"h1\");\n for (i = 0; i < li.length; i++){\n var flag=0;\n for (i2 = 0; i2 < nearEvents.length; i2++){\n if(nearEvents[i2].latitude===filtro[i].textContent.split(',')[1] & nearEvents[i2].longitude===filtro[i].textContent.split(',')[0]){\n li[i].style.display = \"\";\n console.log(name[i]);\n flag++;\n }\n }\n if(flag==0){\n li[i].style.display = \"none\";\n }\n }\n}", "function hide_all() {\n $('#punctual-table-wrapper').collapse(\"hide\")\n $(\"#meta-info\").hide()\n $(\"#progress_bar\").hide()\n $(\"#arrived-late\").hide()\n $(\"#punctual\").hide()\n $(\"#left-early\").hide()\n $(\"#punctual-day-chart\").hide()\n $(\"#breakdown p\").hide()\n}", "function hideMarkers(currentMarkers) {\n for (var i = 0; i < currentMarkers.length; i++) {\n currentMarkers[i].setVisible(false);\n }\n} //end setMapOnAll", "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 hideItems(){\n $(\".bap-objective\").each(function(){\n $(this).css({'display' : 'none'});\n });\n \n $(\".bap-actions\").each(function(){\n $(this).css({'display' : 'none'});\n });\n \n return false;\n}", "function removeInvisible() {\n $(\"li\").each(function() {\n var el = $(this);\n var offset = el.offset();\n var wHeight = $(window).innerHeight();\n if( offset.top > wHeight ) {\n el.remove();\n Meteor.call( 'deleteGram', el.data('id') );\n }\n });\n}", "function hideUserlists() {\n if (readify('beta-userlist', false)) {\n debu(\"Hiding userlists!\")\n var s = document.createElement(\"style\")\n s.id = \"beta-style-userlist\"\n\n s.textContent = \".c_view-list { display: none !important } \"\n\n document.body.appendChild(s)\n }\n}", "function checkVisible() {\r\n var $items = ['registration', 'messages', 'sponsors'];\r\n $('.ipWidget').find('.myl-module-game').each(function(){\r\n var $name = $(this).attr('data-module-name');\r\n var $active = $(this).children('div').data('module-visible');\r\n\r\n if(($.inArray($name, $items) !== -1) && $active == 'no') {\r\n $(this).parent().css('display', 'none');\r\n }\r\n });\r\n }", "function hideSelectedHideables(hideables){\n for (let hideMe of hideables){\n if(document.getElementById(hideMe)){\n document.getElementById(hideMe).classList.add(\"displayNone\");\n }\n }\n }", "function showPage(list, page) {\n // loop over list and show items between page start and page end indexes, hide the rest\n for (let i = 0, j = list.length; i < j; i++) {\n if (i >= (page * per_page) - per_page && i < page * per_page) {\n list[i].style.display = '';\n } else {\n list[i].style.display = 'none';\n }\n }\n}", "function hideList() {\n document.querySelector('.cat-list').classList.remove('cat-list-visible');\n}", "function hideFilters() {\n\tvar filters = $$('dd.tags');\n\tfilters.each(function(filter) {\n\t\tvar tags = filter.select('input');\n\t\tvar selected = false;\n\t\ttags.each(function(tag) {if (tag.checked) selected=true});\n\t\tif (selected != true) {toggleFilters(filter.id, 0);}\n\t});\t\n}", "hideSpellContextItems() {\n if (this.spellContextItems.length > 0) {\n for (let i = 0; i < this.spellContextItems.length; i++) {\n let item = document.getElementById(this.viewer.owner.element.id + this.spellContextItems[i].id);\n if (!isNullOrUndefined(item)) {\n item.style.display = 'none';\n }\n }\n }\n }", "function hide_games(status){\n if (counter > 0){\n if (status){\n [].forEach.call(document.getElementsByClassName('inactive'), function (row) {row.style.display=\"none\"});\n }else{\n [].forEach.call(document.getElementsByClassName('inactive'), function (row) {row.style.display=\"table-row\"});\n }\n }else{\n gameListCheckbox.checked = false;\n }\n}", "function hideIgnoredForumThreadsFromCommnuityList() {\n var allPosts = $(\"h3:contains('Notable Forum Posts')\").next().find(\"li\");\n $.each(allPosts, function (key, li) {\n if (threadId = $(li).html().match(/href=\"\\/Forum\\/([^-]*)/mi)) {\n Database.readIndex(Database.Table.BlacklistedForumThreads, Database.Row.BlacklistedForumThreads.ThreadId, threadId[1], function (thread) {\n if (thread) {\n $(li).hide();\n }\n })\n }\n })\n}", "function showPage (list , page){\n\n \n const pageNum = parseInt (page);\n const upperIndex = (page*listNum);\n const lowerIndex = (page*listNum)-listNum;\n\n for (let i=0;i<list.length;i++){\n\n if (i >= lowerIndex && i< upperIndex){\n list[i].style.display = '';\n }; \n\n if(i < lowerIndex || i >= upperIndex ){\n\n list[i].style.display = 'none';\n };\n };\n \n \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 stars(){\n let starList = document.querySelectorAll(\".stars li\");\n for (star of starList){\n if (star.style.display != \"none\"){\n star.style.display = \"none\";\n break;\n }\n }}", "function showFlightAllAirlineFilters()\r\n{\r\n var filter = $(\"#filter\");\r\n var airlineFilter = filter.find(\".airline li\");\r\n var airlineFilterMore = filter.find(\".airline a.more\");\r\n\r\n airlineFilterMore.hide();\r\n airlineFilter.each(function()\r\n {\r\n $(this).show();\r\n });\r\n}", "function 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 ls__hideAll(taggd) {\r\n tagsArr = taggd.tags;\r\n for (i = 0; i < tagsArr.length; i++) {\r\n tagsArr[i].hide();\r\n }\r\n }", "function hideAll() {\n $('#album1').hide();\n $('#album2').hide();\n $('#album3').hide();\n $('#album4').hide();\n }", "function showAll() {\n $('.movie-list').empty();\n \n $.get('/allmovies', function(data) {\n if (data.length > 0) {\n for (let i in data) {\n buildMovieList(data[i]);\n }\n $('.not-found').css(\"display\", \"none\");\n $('.movie-list').css(\"display\", \"block\");\n }\n else {\n $('.movie-list').css(\"display\", \"none\");\n $('.not-found').css(\"display\", \"block\");\n }\n });\n}", "function showIncomplete(){\n var tasks = document.querySelectorAll('#list li');\n for(let i=0;i<tasks.length;i++){\n if(tasks[i].className=='checked'){\n tasks[i].style.visibility='hidden';\n \n }else{\n tasks[i].style.visibility='visible';\n }\n \n }\n}", "function determineVisibility() {\n\t'use strict';\n\tvar allMarkersLength = allMarkers.length;\n\tfor (var i = 0; i < allMarkersLength; i++) {\n\t\tif (allMarkers[i].shouldDisplay === true) {\n\t\t\tallMarkers[i].holdMarker.setMap(map);\n\t\t} else {\n\t\t\tallMarkers[i].holdMarker.setMap(null);\n\t\t}\n\t}\n}", "function returnToList() {\r\n id(\"book-list\").classList.remove(\"hidden\");\r\n id(\"single-book\").classList.add(\"hidden\");\r\n id(\"back\").classList.add(\"hidden\");\r\n }", "function hideOldArchives() {\n var oldArchiveLinks = document.getElementsByClassName(\"lwOldArchives\");\n for(i = 0; i < oldArchiveLinks.length; i++) {\n oldArchiveLinks[i].style.display=\"none\";\n var showOldAText = document.createTextNode(\"show all\");\n var showOldASpan = document.createElement(\"span\");\n showOldASpan.setAttribute(\"class\",\"showOldArchives\");\n showOldASpan.appendChild(showOldAText);\n oldArchiveLinks[i].parentNode.appendChild(showOldASpan);\n\t\tEvent.observe(showOldASpan, 'click', showOldArchives);\n }\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 }" ]
[ "0.75084364", "0.73898536", "0.7083239", "0.7083239", "0.7083239", "0.69783634", "0.696466", "0.6868263", "0.68675905", "0.6838958", "0.68072605", "0.6697919", "0.6673561", "0.6646163", "0.66455066", "0.66282815", "0.6608529", "0.6577435", "0.6565506", "0.65653145", "0.65509963", "0.6534904", "0.6526169", "0.6515029", "0.6480671", "0.64405364", "0.6435735", "0.6421783", "0.6411202", "0.6410839", "0.6386907", "0.6386808", "0.6385624", "0.6362977", "0.6351773", "0.6340087", "0.6339302", "0.6337705", "0.63355845", "0.6296621", "0.6292385", "0.62907815", "0.6290392", "0.62880963", "0.62862796", "0.62847465", "0.6275488", "0.6263814", "0.62570333", "0.6256353", "0.625365", "0.6251322", "0.6245487", "0.6240013", "0.62318146", "0.6211706", "0.6203059", "0.61984974", "0.618823", "0.61831045", "0.617914", "0.6169841", "0.6165251", "0.61556184", "0.61475927", "0.6138705", "0.6137911", "0.6125963", "0.61257017", "0.61257017", "0.61198884", "0.61130786", "0.6107934", "0.6092212", "0.60894126", "0.6085155", "0.60779136", "0.6067598", "0.6064846", "0.6048084", "0.6041046", "0.6035268", "0.6032234", "0.60302687", "0.60233766", "0.6022457", "0.6019377", "0.6018348", "0.60168695", "0.60085297", "0.60059315", "0.6002035", "0.59996563", "0.5999368", "0.59922975", "0.59894025", "0.5988734", "0.5986787", "0.59839845", "0.5983945" ]
0.6837366
10
Event on button closeclick
function zoomToArea() { // Initialize the geocoder. var geocoder = new google.maps.Geocoder(); // Get the address or place that the user entered. var address = document.getElementById('address-input').value; // Make sure the address isn't blank. if (address == '') { window.alert('You must enter an area, or address.'); } else { // Geocode the address/area entered to get the center. Then, center the map // on it and zoom in geocoder.geocode( { address: address, componentRestrictions: {locality: 'Berlin'} }, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { var position=results[0].geometry.location; var title=address; var marker=new google.maps.Marker({ position:position, title:title, animation:google.maps.Animation.DROP }); marker.addListener('click',function(){ populateInfoWindow(this,largeInfoWindow); }) markers.push(marker); showListings(); map.setCenter(results[0].geometry.location); map.setZoom(15); } else { window.alert('We could not find that location - try entering a more' + ' specific place.'); } }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_handleCloseClick() {\n\t\tthis.close();\n\t}", "function handleCloseClick(){\n handleClose()\n }", "function onCloseBtnClick() {\n ui.toggleClosePopup();\n }", "_onCloseButtonTap() {\n this.fireDataEvent(\"close\", this);\n }", "function onCloseButtonClick(){\n\t\tt.hide();\n\t}", "function onCloseButtonClick(event){\n if (event.target.classList.contains('close-button')){\n taskWrapper.removeChild(taskWrapper.lastChild); \n window.utils.restore(); \n document.querySelector('.main-audio').play();\n }\n }", "function close_btn() {\n\n\t//Close window on click\n\t$(\".close-this\").click(function(){\n\t\t$(this).parent().hide();\n\t});\n}", "function clickCloseButton(event_) {\n\t\t\tevent_.preventDefault();\n\t\t\tstop();\n\t\t}", "'click .close' (event) {\n console.log(\"MODAL CLOSED VIA X\");\n modal.hide();\n }", "function buttonCancelClickFunc(){\r\n\t\tself.close(); //关闭对话框\r\n\t\tif(self.buttonCancelCallback!=null){\r\n\t\t\tself.buttonCancelCallback();\r\n\t\t}\r\n\t}", "clickedClose() {\n this.close(\"slide\");\n }", "function onCloseButtonClick(event) {\n //delete app-container\n _iframe.tell('close-app-view', {});\n }", "function setCloseBtn() {\n\n\t\t\t\t_$parent.find('#close-btn').on('click',function() {\n\n\t\t\t\t\t_$parent.animate({\n\t\t\t\t\t\topacity : 0,\n\t\t\t\t\t\ttop : parseInt(_$parent.css('top')) + 50 + 'px'\n\t\t\t\t\t},100, function() {\n\t\t\t\t\t\t_$parent.add($('#onigiri-style')).remove();\n\t\t\t\t\t});\n\t\t\t\t});\n\n\t\t\t\treturn false;\n\t\t\t}", "function buttonPoweClicked()\n{\n this.window.close();\n}", "function CloseEvent() {}", "function btnClick(btnID) {\r\n if (btnID == 'close') {\r\n closeWindow();\r\n }\r\n}", "closeButton() {\n if (this.openDoors == true) {\n this.closeDoors();\n }\n }", "onClose() {\n\t\t}", "close() {\n this.closeButton.on('click', null);\n this.modal(false);\n this.window.remove();\n }", "onClose(){}", "function _onClickCloseButton(e){ \n _close();\n _callback && _callback(new Error('co.grantges.azure.adal::USER_EXIT - User initiated close of dialog', 'adalWebview.js', 78));\n}", "close() {\n this._qs(\"#close-popup\").addEventListener(\"click\", () => {\n this.exitDock();\n });\n }", "onCloseButtonClick(event) {\n if ((event.type === 'click' || event.type === 'touch')) {\n\n [].forEach.call(this.content.querySelectorAll(this.options.closeButtonsSelector), closeButton => {\n if (closeButton === event.target || closeButton.contains(event.target)) {\n this.callCustom('preEsc');\n event.stopPropagation();\n this.close('onCloseButtonClickEvent');\n this.callCustom('postEsc');\n }\n });\n }\n }", "close() {\n this.sendAction('close');\n }", "function handleClose() {\n navigate(\"/EscolherCondominio\"); // vai pra tela de condominios\n setDialog(false);\n }", "handleCloseClick()\n {\n invokeCloseModal() \n this.close()\n }", "function handleClose() {\n setDialog(false);\n }", "function handleClose() {\n setDialog(false);\n }", "closeDialog_(event) {\n this.userActed('close');\n }", "function closePressed() {\n $uibModalInstance.dismiss('cancel');\n }", "function close() {\n $modalInstance.dismiss();\n }", "handleModalClose() {}", "close(){Overlay.overlayStack.closeOverlay(this.overlayElement);}", "function onCancelButtonClick() {\n modal.close();\n }", "function onCancelButtonClick() {\n modal.close();\n }", "function cropperClose() {\n\t$('mb_close_link').addEvent('click', function() {\n\t\tif($('yt-CropperFrame')) $('yt-CropperFrame').remove();\n\t\tif($('mb_Title')) $('mb_Title').remove();\n\t\tif ($('mb_Error')) $('mb_Error').remove();\n\t\tif ($('mb_contents')) $('mb_contents').removeClass('mb_contents');\n\t\tif($('mb_header')) $('mb_header').removeClass('yt-Panel-Primary');\n\t});\n}", "function returntomeni() {\r\n if ($(\".overlay-content\").css(\"display\", \"none\")) {\r\n $(\".closebtn\").removeAttr(\"onclick\");\r\n $(\".closebtn\").click(function () {\r\n $(\".newcntnt\").fadeOut(400);\r\n $(\".overlay-content\").show(500);\r\n $(\".overlay-content\").css(\"display\", \"block\");\r\n if ($(\".overlay-content\").css(\"display\", \"block\")) {\r\n $(\".closebtn\").attr(\"onClick\", \"fclose()\");\r\n }\r\n });\r\n }\r\n}", "function menu_action_close(e)\n{\n\ttry {\n\t\tif( e.button == 2 || e.button == 3 )\n\t\t{\n\t\t\treturn;\n\t\t}\n\t}\n\tcatch( acold ) {};\n\t\n\tipsmenu.close(e);\n}", "function closeDialog() {\n document.querySelector(\"#inq_student\").classList.add(\"hide\");\n document.querySelector(\"#inq_student .closebutton\").removeEventListener(\"click\", closeDialog);\n }", "close(e, closeFunction){\n if (e.target.className === \"popup-close-btn\"){\n closeFunction();\n }\n }", "onClose() {}", "onClose() {}", "handle_closing() {\n if (!this.app || !this.element) {\n return;\n }\n /* The AttentionToaster will take care of that for AttentionWindows */\n /* InputWindow & InputWindowManager will take care of visibility of IM */\n if (!this.app.isAttentionWindow && !this.app.isCallscreenWindow &&\n !this.app.isInputMethod) {\n this.app.setVisible && this.app.setVisible(false);\n }\n this.switchTransitionState('closing');\n }", "function close() {\n $(this).parent().hide();\n}", "function watchCloseClick() {\n $('.light-box-area').on('click', '.close-button', function() {\n $('.light-box-area').prop('hidden', true);\n $('iframe').attr('src', '');\n });\n}", "function close() {\n $uibModalInstance.dismiss('exit');\n }", "function close() {\n $uibModalInstance.dismiss('exit');\n }", "function close() {\n $uibModalInstance.dismiss('exit');\n }", "close() {\n this._showPopup = false;\n }", "function closeBtnEventHandler () {\n if (KH.cur_territory) {\n KH.globalMap.removeLayer(KH.cur_territory)\n KH.cur_territory = undefined\n }\n}", "_close() {\n set(this, 'isOpen', false);\n set(this, 'isToStep', false);\n\n let action = get(this, 'attrs.closeAction');\n let vals = get(this, '_dates');\n let isRange = get(this, 'range');\n\n if (action) {\n action(isRange ? vals : vals[0] || null);\n }\n\n this._destroyOutsideListener();\n }", "function buttonClicked() {\r\n document.querySelector(\"#closeButton\").addEventListener(\"click\", function () {\r\n document.querySelector(\"#main\").style.display = \"grid\";\r\n document.querySelector(\"#hidden\").style.display = \"none\";\r\n })\r\n }", "handleDoneButtonClicked_() {\n this.handleEmitMetrics_(FeedbackAppPostSubmitAction.kClickDoneButton);\n window.close();\n }", "close() {\n this.showDayView = this.showMonthView = this.showYearView = false\n if (!this.isInline) {\n this.$el.querySelector('.vdp-datepicker div').style.boxShadow = \"none\";\n this.$emit('closed');\n document.removeEventListener('click', this.clickOutside, false)\n }\n }", "function onBackdropClick() {\n close();\n }", "function handleClose() {\n setOpen(false)\n }", "closeModal() {\n this.close();\n }", "function closeHandler() {\n $('#sf_close').click(() => {\n closeOverlay();\n });\n}", "function buttonCloseModal() {\n\tvar btnClose = $('.button-close');\n\tif (btnClose.length > 0) {\n\t\tbtnClose.bind('click', function(e) {\n\t\t\te.preventDefault();\n\t\t\tvar modal = $(e.target.closest('.modal'));\n\t\t\tif (modal.length > 0) {\n\t\t\t\t$(modal).removeClass('show');\n\t\t\t}\n\t\t});\n\t}\n}", "externalClickCallback() {\n this.opened = false;\n this.behave(\"close\");\n }", "function ClosePopUpOnContinue() {\n $('div.btnClose').click();\n}", "function handleClose() {\n setOpenModalId(0);\n }", "close() {\n this.$emit('close');\n }", "function hideCloseButton() {\n\t$(this).find(\".close_button\").hide();\n}", "close() {\n console.log(' this is close function');\n this.showAlert = false;\n }", "function close(element){\n element.style.display = \"none\";\n}", "function bindCloseButtonEvent(){\n\t\t\t\ttry{\n\t\t\t\t\tlogger.debug(\"bindCloseButtonEvent\", \"remove existing events\");\n\t\t\t\t\tunregisterEventHandler(lpChatID_lpChatCloseChatBtn, \"click\", lpChatCloseChatBtnClick);\n\t\t\t\t\tregisterEventHandler(lpChatID_lpChatCloseChatBtn, \"click\", lpChatCloseChatBtnClick);\n\t\t\t\t\t\n\t\t\t\t\tif(!lpCWAssist.isPostMessageSupported()){\n\t\t\t\t\t\tlogger.debug(\"bindCloseButtonEvent\", \"remove existing events\");\n\t\t\t\t\t\t$(jqe(lpChatID_lpChatCloseChatBtn)).hide();\n\t\t\t\t\t}\n\t\t\t\t}catch(excp){\n\t\t\t\t\tlogger.debug(\"Exception in bindCloseButtonEvent, error message\", excp);\n\t\t\t\t}\n\t\t\t}", "function closeInClose() {\n if ($('#header-account2')\n .hasClass('skip-active') != true) {\n animateCloseWindow('login', true, false);\n animateCloseWindow('register', true, false);\n animateCloseWindow('confirmmsg', true, false);\n }\n }", "closeCleanup() {\n this.hide();\n this.addPopUpListener();\n }", "function flexiCSSMenus_clickHandlerForCloseButton(event) {\n var parentNode = $(this).parent().parent();\n if (event.stopPropagation) event.stopPropagation();\n event.preventDefault();\n flexiCSSMenus_deselectButton(parentNode);\n try {\n var level = flexiCSSMenus_getButtonLevel(parentNode);\n } catch (e) {\n //console.error(e);\n }\n if (level > 0) {\n CSSMenus.flexiCSSMenus_currentButton = parentNode.parent().parent();\n } else {\n CSSMenus.flexiCSSMenus_currentButton = undefined;\n }\n CSSMenus.flexiCSSMenus_currentLevel = level - 1;\n }", "function modalClose() {\t\t\n\t\tif($('mb_Title')) $('mb_Title').remove();\n\t\tif($('mb_Error')) $('mb_Error').remove();\n\t\tif($('mb_header')) $('mb_header').removeClass('yt-Panel-Primary');\n\n\t\t$('mb_center').style.display = 'none';\n\t\t\n\t\t$('mb_contents').getChildren()[0].remove();\n\t\t$('mb_overlay').setStyle('opacity',0);\n\t\t$('mb_frame').setStyle('opacity',0);\n\t\twindow.location.reload(true); \n}", "close() {\n this.panelNode.classList.remove(gShownCssClass);\n if (this.onClose !== undefined) {\n this.onClose();\n }\n }", "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 }", "close() {\n this.overlayManager.close(this.overlayName);\n }", "w3_close() {\n\t\tthis.mySidenav.style.display = \"none\";\n\t\tthis.overlayBg.style.display = \"none\";\n\t}", "function lpChatCloseChatBtnClick() {\t\t\n\t\t\t\tlogger.debug(\"lpChatCloseChatBtnClick\", \"...chatWinCloseable=\"+chatWinCloseable);\n\t\t\t\t\n\t\t\t\tif(typeof webserviceTimer != \"undefined\")\n\t\t\t\t\tclearInterval(webserviceTimer);\n\t\t\t\t\n\t\t\t\t//close the PCI if visible\n\t\t\t\tcloseSlideOut();\n\t\t\t\t\n\t\t\t\tif(chatWinCloseable){\n\t\t\t\t\t//case when not in chat\n\t\t\t\t\tsessionMgr.deleteChatSessionStorage();\n\t\t\t\t\tdisposeEndChat();\n\t\t\t\t}else{\n\t\t\t\t\t//case when in chat\n\t\t\t\t\tif(chatState == chat.chatStates.WAITING){\n\t\t\t\t\t\tchatWinCloseable = true;\n\t\t\t\t\t\tlpChatShowView(\"\", true); //clear screen\n\t\t\t\t\t\thideChatWizContainer();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tendChat();\n\t\t\t\t}\n\t\t\t}", "function handleClose() {\n props.handleDialog(false);\n }", "function close () {\n\tcMessage.style.cssText = '';\n\theading.style.cssText = '';\n\tscorePanel.style.cssText = '';\n\tdeck.style.cssText = '';\n\tcopyright.style.cssText = '';\n\trestartButton.classList.remove('disable');\n\tcopyright.classList.remove('disable');\n}", "get onClosing() {\n this.document.documentElement.classList.remove(DIALOG_OPEN_HTML_CLASS);\n }", "function closeInterest() {\n interestDiv.style.display = 'none';\n homeView.style.display = 'block';\n information.style.display='block';\n events.style.display='none';\n sights.style.display='none';\n closeButton.style.display='none';\n informationButton.className = 'categoryButton selected material-icons';\n sightsButton.className = 'categoryButton material-icons';\n eventsButton.className = 'categoryButton material-icons';\n readButton.style.display = 'inline-block';\n pauseButton.style.display = 'none';\n stopButton.style.display = 'none';\n stop();\n}", "closePressed() {\n this.$uibModalInstance.dismiss('cancel');\n }", "closeInteliUiModal() {\n $(this.target.boxContainer).parents().find('.modal-content').find('#btnClose').click();\n }", "close() {\n // Remove blockchain buttons and nodes - full reset\n wallets.page.boxes.c2.buttonRanges.inputControls.removeButtons();\n }", "closeWithAction() {\n this.dismissWithAction();\n }", "handleCloseClick(event) {\n event.preventDefault();\n this.doFormCancel();\n }", "function close(event) {\r\n\tevent.preventDefault();\r\n\tDOM.switchClasses(this.previewElement, 'opened', 'closed');\r\n}", "closeWindow() {\r\n\r\n }", "function closeSetupClickHandler() {\n closePopup();\n }", "close(){\n isfull = false;\n myWindow.close();\n return \"bye\";\n }", "close(){\n isfull = false;\n myWindow.close();\n return \"bye\";\n }", "handleClosePopup (event) {\n const closeEvent = new CustomEvent ('closeevent');\n this.dispatchEvent(closeEvent);\n }", "function handleClose() {\n setIsactive(false);\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 }", "_close() {\n const that = this,\n closingEvent = that.$.fireEvent('closing');\n\n if (!closingEvent.defaultPrevented) {\n that.$.calendarDropDown.disabled = true;\n\n that.$calendarButton.removeClass('jqx-calendar-button-pressed');\n that.$.calendarButton.removeAttribute('active');\n that.$dropDownContainer.addClass('jqx-visibility-hidden');\n that.opened = false;\n that._positionDetection.removeOverlay(true);\n\n that.$.fireEvent('close');\n\n if (that._edgeMacFF && !that.hasAnimation) {\n that.$.dropDownContainer.style.top = null;\n that.$.dropDownContainer.style.left = null;\n that.$dropDownContainer.addClass('not-in-view');\n }\n }\n else {\n that.opened = true;\n }\n }", "close() {\n\n this.overlay.remove();\n this.overlay = null;\n\n }", "handleClick() {\n this.closeModal();\n }", "onCancel_() {\n this.close();\n }", "function _onProjectClose() {\n // console.log('[' + EXTENSION_ID + '] :: _onProjectClose');\n if ($appButton.hasClass('active')) {\n Resizer.toggle($appPanel);\n _command.setChecked(false);\n _command.setEnabled(false);\n $appButton.removeClass('active');\n }\n if (!_.isNull($issuesList) && $issuesList.length) {\n $issuesList.html('');\n }\n $appButton.hide();\n $issuesList = null;\n _repositoryUrl = false;\n }", "function clickclose(){\n modal.style.display=\"none\";\n}", "function handleClose(event) {\n LG.isNative && window.NetCastBack();\n }", "function onClosed()\n\t{\n\t\t//cancel dialog with no data\n\t\tModalDialog.close();\n\t}" ]
[ "0.81372964", "0.8077299", "0.8055487", "0.8003884", "0.77704084", "0.7613444", "0.75654536", "0.75609225", "0.745435", "0.743126", "0.740943", "0.7404588", "0.739827", "0.73932004", "0.73738915", "0.73310226", "0.7314271", "0.72916704", "0.725016", "0.7228566", "0.72230667", "0.72028494", "0.720122", "0.7189471", "0.7188669", "0.71658474", "0.7158934", "0.7158934", "0.7125058", "0.7124511", "0.7112445", "0.70992005", "0.7095498", "0.70920014", "0.70920014", "0.70500165", "0.7044701", "0.70410293", "0.7025927", "0.7012479", "0.70122486", "0.70122486", "0.70120376", "0.70073754", "0.70073456", "0.7002751", "0.7002751", "0.7002751", "0.7001334", "0.69805986", "0.69805664", "0.6975613", "0.69725215", "0.6947428", "0.6946479", "0.69398826", "0.6932215", "0.6925205", "0.6920136", "0.69164205", "0.69124794", "0.6904732", "0.6904555", "0.69036466", "0.69003826", "0.6894489", "0.6885436", "0.68837535", "0.688204", "0.68809587", "0.68735623", "0.6869938", "0.6863603", "0.68633336", "0.6860718", "0.68596315", "0.6851444", "0.6850775", "0.6848217", "0.68473595", "0.6843872", "0.6838454", "0.6838396", "0.6834364", "0.6833759", "0.68115485", "0.68107194", "0.6801883", "0.67979014", "0.67979014", "0.67931294", "0.67893034", "0.6784445", "0.67730385", "0.67663735", "0.6744253", "0.67409575", "0.6737806", "0.6737079", "0.67349046", "0.6733701" ]
0.0
-1
Defines a new person, their attributes, and their functions
function pawn(id, x, y, initialAngle) { //General characteristics this.id = id; this.width = 10; this.height = 10; this.color = "grey"; //Movement attributes this.x = x; this.y = y; this.speed = 1; //Angle is in radians. Neat. this.angle = initialAngle; //Health attributes this.health = "Healthy"; this.recoveryTime = 0; this.update = function() { ctx = cityArea.context; ctx.fillStyle = this.color; ctx.fillRect(this.x, this.y, this.width, this.height); //Infection status update if (this.recoveryTime > 0) { this.recoveryTime -= 1; if (this.recoveryTime == 0) { this.health = "Recovered"; } } if (this.health == "Infected") this.color = "red"; if (this.health == "Recovered") this.color = "blue"; if (this.health == "Protected") this.color = "purple"; if (this.health == "Healthy") this.color = "grey"; }, this.hitWall = function() { var collide = false; if (this.x <= 0 || this.x >= 790 || this.y <= 0 || this.y >= 390) collide = true; return collide; }, this.collideWith = function(otherobj) { var myleft = this.x; var myright = this.x + 10; var mytop = this.y; var mybottom = this.y + 10; var otherleft = otherobj.x; var otherright = otherobj.x + 10; var othertop = otherobj.y; var otherbottom = otherobj.y + 10; var collide = true; if ((mybottom < othertop) || (mytop > otherbottom) || (myright < otherleft) || (myleft > otherright)) { collide = false; } return collide; }, this.newPos = function() { this.x += this.speed * Math.sin(this.angle); this.y -= this.speed * Math.cos(this.angle); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Person(fname,lname){\n\tthis.fname = fname;\n\tthis.lname = lname;\n\tthis.create_ting = function(){\n\t\tthis.fname + this.lname ;\n\t}\n}", "function Person (){}", "function makePerson(name, age){\n var person = {};\n person.name = name;\n person.age = age;\n person.speak = function(){\n console.log(\"Hello, my name is \" + this.name);\n }\n return person;\n}", "function Newperson(name){\n\treturn {\n\t\tname: name,\n\t\tsay_name: function(){console.log(name);}\n\t}\n}", "function makePerson(firstName, lastName, email, telephone, gender, birthDate, birthPlace) {\n var _person = {\n firstName: firstName,\n lastName: lastName,\n email: email,\n telephone: telephone,\n gender: gender,\n birthDate: birthDate,\n birthPlace: birthPlace,\n \n name: function() { return _person.firstName + ' ' + _person.lastName; }\n };\n return _person;\n}", "function NewPerson (name) {\n\tthis.name = name;\n\tthis.speak = function () {\n\t\tconsole.log(`my name is ${this.name}`);\n\t}\n}", "function createPerson(firstName, lastName, age) {\n var fullName = firstName + \" \" + lastName;\n return {\n firstName: firstName,\n lastName: lastName,\n fullName: fullName,\n isSenior: function () {\n return age > 60;\n },\n isSeniorfunc: function () {\n return age > 60;\n }\n };\n}", "function createNewPerson(person) {\n var person = {};\n person.name = name;\n person.age = age;\n person.email = email;\n person.phone = phone;\n}", "function Person(attributes) {\n this.name = attributes.name;\n this.age = attributes.age;\n this.speak = function () {\n console.log(`Hi my name is ${this.name}`);\n };\n}", "function createPerson(firstname,lastname, age, gender){\n\treturn {\n\t\tfirstname: firstname,\n\t\tlastname: lastname,\n\t\tage: age,\n\t\tgender: gender\n\t};\n}", "function addPerson () {\n new Person(inputFirst, inputLast, inputPhone, inputEmail);\n\n}", "function person(first_name, last_name) {\n\tthis.first_name = first_name;\n\tthis.last_name = last_name;\n}", "function Person(firstName, lastName, birthday) {\n this.firstName = firstName;\n this.lastName = lastName;\n this.birthday = new Date(birthday);\n // this code bellow will redefined each new object was created\n this.greeting = function () {\n return 'Hello' + this.firstName;\n }\n}", "function person(name, age, city){\n\n this.name = name,\n\n this.age = age,\n\n this.city = city\n\n}", "function Person(){}", "function Person(){}", "function Person() {}", "function Person() {}", "function Person() {}", "function Person() {}", "function Person() {}", "function Person() {}", "function Person() {}", "function Person() {}", "function Person () {}", "function person(firstName, lastName) {\n this.firstName = firstName;\n this.lastName = lastName;\n}", "function person(name, age) {\r\n this.name= name; \r\n this.age = age;\r\n this.yearOfBirth = bornYear;\r\n}", "function Person(first, last, age, gender, interest){\n this.name ={\n first, last\n };\n this.age = age;\n this.gender = gender;\n this.interest = interest;\n}", "function person(first, last, age) {\n this.firstName = first;\n this.lastName = last;\n this.age = age;\n\n}", "function person(name, age) {\r\n this.name = name; \r\n this.age = age; \r\n this.yearOfBirth = bornYear; \r\n}", "function Person(fname,lname,age){\n this.firstname=fname;\n this.lname=lname;\n this.age=age;\n}", "function person(name, age) {\r\n this.name= name; \r\n this.age = age;\r\n this.yearOfBirth = bornYear;\r\n }", "function Person(attributes) {\n this.age = attributes.age;\n this.name = attributes.name;\n this.homeTown = attributes.homeTown;\n}", "function Person(name, attitude, age, wine) {\n this.name = name;\n this.attitude = attitude;\n this.age = age;\n this.wine = wine;\n}", "function Person(name, age, profession) {\n this.name = name;\n this.age = age;\n this.profession = profession;\n}", "function person(a, b, c) {\n this.name = a;\n this.age = b;\n this.vocation = c;\n}", "function person(first, last, age, gender, interests) {\n this.name = {\n first,\n last\n };\n this.age = age;\n this.gender = gender;\n this.interests = interests;\n }", "function Person (){\n\n}", "function persona(name,age,interests,height){\n this.name=name\n this.age=age\n this.interests=interests\n this.height=height \n}", "function Person(){\r\n}", "function createPerson(name, age, job) {\n var o = new Object();\n o.name = name;\n o.age = age;\n o.job = job;\n o.sayName = function() {\n return this.name;\n }\n return o;\n}", "function Person(firstname, lastname) {\n this.firstname = firstname;\n this.lastname = lastname;\n}", "function Person(first, last, age, gender, occupation, interests) {\n this.name = {\n 'first': first,\n 'last': last,\n },\n this.age = age,\n this.gender = gender,\n this.occupation = occupation,\n this.interests = interests;\n this.bio = function() {\n alert(this.name.first + ' ' + this.name.last + ' is ' + this.age + ' years old and works as a(n) ' + this.occupation\n + '. ' + genderPronoun(this.gender) + getInterests(this.interests) + '.')\n }\n this.greeting = function() {\n alert('Hi! I\\'m ' + this.name + '.');\n }\n}", "function createPerson()\n{ \n var person = new Object();\n person.name = \"siri\";\n person.age =\"28\";\n person.designation=\"trainer\";\n person.Phno = 9998788667;\n return person;\n}", "function Person(firstname, lastname, role){\n\tthis.firstname = firstname;\n\tthis.lastname = lastname;\n\tthis.role = role;\n}", "function Person(fname , age ,last , height){\n this.firstName = fname;\n this.Lname = last;\n this.perAge = age;\n this.Pheight = height;\n this.NAME=function fullname(){\n return this.firstName+ \" \"+ this.Lname\n }\n // to add some new property we have to add in the constructor function\n this.class = '6th';\n}", "function Person(){\n\n}", "function Person(){\n\n}", "function Person(){\n\n}", "function Person(lname, fname, age){\n this.lastName=lname;\n this.firstName=fname;\n this.age=age;\n}", "function Person (firstname, lastname) {\n\n\tthis.firstname = firstname,\n\tthis.lastname = lastname,\t\n\tthis.greet = function () {\n\t\tconsole.log('greet works');\n\t\treturn 'Hi ' + this.firstname;\n\t}\n}", "function Person(name, profession) {\n\tthis.name = name;\n\tthis.profession = profession;\n}", "function Person(firstname, lastname) {\n\t\n\tthis.firstname = firstname;\n\n\tthis.lastname = lastname;\n}", "function Person() {\n \n}", "function Person(firstname, lastname) {\n this.firstname = firstname;\n this.lastname = lastname;\n}", "function Person(fn,ln,age) {\n \t this.fn = fn;\n \t this.ln = ln;\n \t this.age = age;\n \t getName = function() {\n \t \treturn \"My name is \" + this.fn + \" \" + this.ln + \" and my age is \" + this.age; \n \t }\n }", "function Person(){\n}", "function Person(first, last, age, gender, interests) {\n // property and method definitions\n}", "function createPerson(name) {\n return {\n talk: function() {\n \tconsole.log(`Say my name ${name}`);\n },\n };\n}", "function Person(first, last, age, gender, interests) {\n this.name = {\n first: first,\n last: last\n };\n this.age = age;\n this.gender = gender;\n this.interests = interests;\n}", "function createPerson(firstName, lastName, age) {\n return {\n firstName: firstName,\n lastName: lastName,\n age: age\n }\n}", "function Person() {\n\n this.firstmame = 'John';\n this.lastname = 'Doe';\n}", "function person(name, age) {\r\n this.name = name;\r\n this.age = age;\r\n }", "function MakePerson(name, photo, quote) {\n var person = {};\n person.name = name;\n person.photo = photo;\n person.quote = quote;\n\n person.getName = function() {\n return person.name;\n }\n\n person.getPhoto = function() {\n return person.photo;\n }\n person.getQuote = function() {\n return person.quote;\n }\n return person;\n }", "function Person(named, employNum, salary, rating) {\n this.named = named;\n this.employNum = employNum;\n this.salary = salary;\n this.rating = rating;\n}", "function makePerson(name, age) {\r\n\t// add code here\r\n\tlet personObj = Object.create(null);\r\n personObj.name = name;\r\n personObj.age = age;\r\n \r\n return personObj;\r\n\r\n}", "function Person(first, last, age, eye) {\r\n this.firstName = first;\r\n this.lastName = last;\r\n this.age = age;\r\n this.eyeColor = eye;\r\n}", "function Person(first, last, age, eye) {\n this.firstName = first;\n this.lastName = last;\n this.age = age;\n this.eyeColor = eye;\n}", "function makePerson4(first, last) {\n this.first = first;\n this.last = last;\n}", "function Person (name, age, occupation){\n\tthis.name = name;\n\tthis.age = age;\n\tthis.occupation = occupation;\n\t\n\tthis.getName = function(){\n\t\treturn (this.name)\t\n\t};\n\n}", "function person(firstName,yearOfBirth,lastName='Smith',nationality='american'){\n\tthis.firstname: firstName;\n\tthis.lastName: lastName;\n\tthis.yearOfBirth: yearOfBirth;\n\tthis.nationality: nationality;\n}", "function person(firstName, lastName) {\n this.firstName = firstName;\n this.lastName = lastName;\n this.fullName = function () {\n return this.firstName + \" \" + this.lastName;\n }\n}", "function person (name, lastName, heigth){\n this.name = name // this. is the reference to the object.\n this.lastName = lastName\n this.heigth = heigth\n}", "function Person(name, surname){\n this.name=name;\n this.surname=surname;\n}", "function Person(first, last, age, gender, interests) {\n this.first = first;\n this.last =last;\n this.age = age;\n this.gender = gender;\n this.interests = interests;\n this.bio = function() {\n console.log(this.first + ' ' + this.last + ' is ' + this.age + ' years old. He likes ' + this.interests[0] + ' and ' + this.interests[1] + '.');\n };\n this.greeting = function() {\n console.log('Hi! I\\'m ' + this.first + '.');\n };\n }", "function Person(fn, ln, s) {\n this.firstName = fn;\n this.lastName = ln;\n this.favoriteSport = s;\n}", "function Person(name, age, hair, lastName) {\n this.name = name;\n this.age = age;\n this.hair = hair;\n this.lastName = lastName;\n this.getInfo = function() {\n return `${this.name} ${this.age} ${this.hair}`\n }\n}", "function MyNewObj(attributes) {\n this.name = attributes.name;\n this.age = attributes.age;\n this.speak = function() {\n return \"My name is \" + this.name;\n };\n}", "function person(name, age, height, gender) {\n var personObj = {\n name: 'name',\n age: 'age',\n height: 'height',\n gender: 'gender'\n }\n return personObj\n }", "function person(name, age, color){\n this.name = name;\n this.age = age;\n this.favColor = color;\n}", "function MakePerson(name, birthday, ssn) {\n this.name = name;\n this.birthday = birthday;\n this.ssn = ssn;\n}", "function PersonFn(firstName, lastName, salary) {\n this.fName = firstName;\n this.lName = lastName;\n this.salary = salary;\n}", "function Person(name, age) {\n //Assigning values through constructor\n this.name = name;\n this.age = age;\n //functions\n this.sayHi = function() {\n return this.name + \" Says Hi\";\n };\n }", "function Person(first,last,age) {\n this.firstName = first;\n this.lastName = last;\n this.age = age;\n}", "function createNewPerson(name) {\n var obj = {};\n obj.name = name;\n obj.greeting = function() {\n alert('Hi! I\\'m ' + this.name + '.');\n };\n return obj;\n}", "function Person3 (name, age, job) {\n this.name = name;\n this.age = age;\n this.job = job;\n // every function is a new object\n this.sayName = sayName;\n}", "function Person (firstName, lastName) {\n this.firstName = firstName\n this.lastName = lastName\n this.age = 0\n}", "function Person( firstName, lastName ) {\n this.firstName = firstName;\n this.lastName = lastName;\n}", "function personMaker(name, family, role) {\r\n person = {\r\n name: name,\r\n family: family,\r\n role: role,\r\n }\r\n people.push(person);\r\n}", "function Person (name, surname) {\n this.name = name;\n this.surname = surname;\n}", "function createPerson(first, middle, last)\n{\n var getName = function(){\n return first + \" \" + middle + \" \" + last;\n }\n\n return {getName: getName}\n}", "function Person(firstname, lastname, number, email){\n this.firstname = firstname,\n this.lastname = lastname,\n this.number = number,\n this.email = email\n}", "function Person(name, age, gender,){\n\tthis.name = name;\n\tthis.age = age;\n\tthis.gender = gender;\n}", "function Person(name, weapon) {\n this.name = name;\n this.weapon = weapon;\n}", "function Person(x, y, pref) {\n this.pref = pref; //'x' or 'y'\n if (inManPlane(x,y)) this.sex = 'm';\n else if (inWomPlane(x,y)) this.sex = 'w';\n else alert(\"what u doing\");\n if (this.sex == 'm') {\n this.id = manId;\n manId++;\n } else {\n this.id = womId;\n womId++;\n }\n this.setX(x);\n this.setY(y);\n}", "function getPerson(first, last, age, eyeColor)\n{\n var person ={\n firstName : first,\n lastName : last,\n age : age,\n eyeColor : eyeColor,\n fullName : function (){\n return this.firstName + \" \" + this.lastName;\n }\n };\n\n return person;\n\n}", "function MakePerson(name,birthday,ssn){\n return info = {\n name: name,\n birthday: birthday,\n ssn: ssn\n };\n }", "function Person(firstName, lastName){\n this.firstName = firstName;\n this.lastName = lastName;\n}", "function Person(firstName, lastName){\n this.firstName = firstName;\n this.lastName = lastName;\n}", "function Person(firstName, lastName){\n this.firstName = firstName;\n this.lastName = lastName;\n}", "function createPerson(name, age) {\n return {\n name: name,\n age: age\n };\n}" ]
[ "0.7688492", "0.7538134", "0.7464108", "0.74461716", "0.7440062", "0.74346125", "0.73382473", "0.73341423", "0.7321965", "0.73120505", "0.7281405", "0.72570854", "0.72306174", "0.72051144", "0.7195276", "0.7195276", "0.71852493", "0.71852493", "0.71852493", "0.71852493", "0.71852493", "0.71852493", "0.71852493", "0.71852493", "0.7184988", "0.71727353", "0.7157947", "0.71534365", "0.7149802", "0.71180224", "0.71174175", "0.7109738", "0.7108129", "0.71063054", "0.7104255", "0.71024805", "0.7100512", "0.70985097", "0.7096394", "0.7069089", "0.7064477", "0.7050088", "0.704874", "0.7048699", "0.704641", "0.70427054", "0.70403415", "0.70403415", "0.70403415", "0.70292556", "0.70261997", "0.7026191", "0.70221496", "0.7020959", "0.7013032", "0.70063186", "0.699264", "0.69850343", "0.69845235", "0.6973463", "0.6967505", "0.69669855", "0.69656265", "0.69649285", "0.6963948", "0.69597685", "0.69582736", "0.69490725", "0.69400555", "0.69393194", "0.6938977", "0.69340193", "0.69337606", "0.6917618", "0.6913872", "0.6912157", "0.6908665", "0.6907979", "0.69069475", "0.69058233", "0.69055146", "0.688987", "0.68896556", "0.6885265", "0.6882472", "0.6881897", "0.6880781", "0.6877181", "0.68716073", "0.6862255", "0.68527436", "0.6848872", "0.6843697", "0.68404275", "0.6837321", "0.68359303", "0.68328094", "0.6831239", "0.6831239", "0.6831239", "0.68262285" ]
0.0
-1
Kick it all off
function startScript() { vaccinated = parseInt(document.getElementById("txtVaccinated").value); if (vaccinated >= 0 && vaccinated < 200) { cityArea.start(); popGraph.start(); initializePopulation(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "off() {\n this.mocking = false;\n this.clear();\n }", "function onDestruct () \n\t{\n\t\tself.allOff();\n\t}", "function off() {\n on[i] = false;\n finishTime = new Date().getTime();\n utregningTid();\n updateView();\n}", "off() {\n\t\tthis._lamps.off();\n\t}", "_reset()\n {\n this.stopped = false;\n this.currentTarget = null;\n this.target = null;\n }", "_turnOff() {\n this.log.error('Rumble: Implement me: ' + this._turnOff().name);\n }", "function reset() { }", "function shutdown() {\n Object.reset(OPENED);\n Object.reset(NEXT_IDS);\n }", "reset(){\n this.enable();\n this.init();\n this.buildAll();\n }", "function reset() {\n\nstart();\n\n}", "turnOff() {\r\n return this.operatePlug({ onOff: false });\r\n }", "unbind() {}", "reset() {\n this.home();\n this.clean();\n this.begin();\n }", "unsee() {}", "destroy() {\r\n this.off();\r\n }", "Reset() {}", "reset() {}", "reset() {}", "reset() {}", "resetGhost() {}", "function reset () {\n noty.clear();\n resetTimeout();\n }", "function reset() {\n\n }", "destroy() {\n this.off();\n super.destroy();\n }", "function clear () {\n insight.optOut = undefined;\n}", "function offAllButtons() {\n $startButton.off();\n $strictButton.off();\n $(\"#onOff\").off();\n $buttons.off();\n}", "function takeOff() {\n\tclient.takeoff(function(){\n\t\tisFlying = true;\n\t\tconsole.log('3, 2, 1, take off!');\n\t});\n}", "async wipe() {\n await this.handleBoot();\n\n await this.enable();\n\n await this.write(\"stack unconfigure me\");\n await this.write(\"y\", false);\n\n await this.write(\"erase start\");\n await this.write(\"reload\");\n await this.write('y', false);\n await this.write('y', false);\n }", "function reset(){\n setup();\n}", "stop() { \r\n enabled = false;\r\n // TODO: hide PK block list\r\n }", "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 start() {\nreset();\n}", "resetSkier () {\n \n this.isJumping =false;\n this.setDirection(this.direction);\n }", "function powerOff(){\n\n\t\t\t//Generate empty terminal\n\t\t\t$('#terminal').html(framework['empty']);\n\n\t\t\t//Change background image\n\t\t\t$('#terminal-container').css(\"background-image\", \"url('images/monitorborder.png')\");\n\n\t\t\t//Change button to powerOn\n\t\t\tbuttonOn();\n\t\t}", "function reset() {\r\n // noop\r\n }", "off() {\r\n\t\t\tif (this.active) {\r\n\t\t\t\tthis.p.pop();\r\n\t\t\t\tthis.active = false;\r\n\t\t\t}\r\n\t\t}", "function reset() {\n capsLockOn = null;\n }", "off() {\n control.off.apply(this, [].slice.call(arguments));\n }", "function reset() {\n stop();\n pauseTimePassed = 0;\n functionsToCallOnReset.forEach(f => f());\n }", "function stop() {\n if (resetSpies != null) {\n resetSpies();\n }\n}", "function resetEverything(){\n resetImages();\n resetPlay();\n resetPause();\n }" ]
[ "0.70361555", "0.6912739", "0.68589693", "0.68545914", "0.6787951", "0.6773155", "0.6755101", "0.66357833", "0.6631631", "0.66117394", "0.6561549", "0.6540128", "0.6502704", "0.65010417", "0.6498189", "0.6484977", "0.64739746", "0.64739746", "0.64739746", "0.6431755", "0.64317274", "0.64130086", "0.64057225", "0.6405134", "0.64019126", "0.6392446", "0.63819796", "0.6380489", "0.6370359", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.63577217", "0.6334099", "0.63299215", "0.63273156", "0.62982744", "0.6297666", "0.62971574", "0.6294712", "0.62944156", "0.6292187", "0.62859416" ]
0.0
-1
a function which renders new plots based on what is passed in
function renderPlotsType1() { new Chart(document.getElementById("line-chart"), { type: 'line', data: { labels: [1500,1600,1700,1750,1800,1850,1900,1950,1999,2050], datasets: [{ data: [86,114,106,106,107,111,133,221,783,2478], label: "Africa", borderColor: "#3e95cd", fill: false } ] }, options: { title: { display: true, text: 'World population per region (in millions)' } } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function render() {\n renderPlots1D();\n renderPlots2D();\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 }", "plot() {\n if (this.plot === 'Cumulative frequency plot' ||\n this.plot === 'Dot plot') {\n this.createPlot();\n }\n }", "function plots(inputObj,options)\n{\n activePlotIndex=0;\n plotArray = []; // Erase past data \n\n options = (typeof(options) == 'undefined') ? {} : options; // account for null case \n\n plotOptions = options;\n var parsed = parse_data_obj(inputObj);\n var objTypes = parsed.type; \n var inputObj = parsed.input; \n prep_plot_data(inputObj,objTypes);\n //handle_plot_bounds(inputObj,objTypes);\n parseOptions();\n packageData(inputObj,objTypes);\n if(typeof(options.noDraw) != 'undefined')\n {\n if(options.noDraw == false)\n {\n create_graph();\n }\n }\n else\n {\n create_graph();\n }\n\n}", "function plot() {\n\n}", "function plot() {\n \n }", "function redrawGraph() {\n // Generate data to pass to the graph.\n function get_dataset(i) {\n var dataSet;\n if (subtypeIndex[1] === null) {\n dataSet = calculateGraphPoints(1, 100, parseFloat(ligandTableCell(subtypeIndex[0] + 1, i).value));\n } else {\n dataSet = calculateGraphPoints(2,\n subtypePercentage[0],parseFloat(ligandTableCell(subtypeIndex[0] + 1, i).value),\n subtypePercentage[1],parseFloat(ligandTableCell(subtypeIndex[1]+1, i).value));\n }\n return dataSet\n }\n\n var data = [];\n for (var i = 0; i < 6; i++) {\n if (activeLigandRow()[i]) {\n var dataSet = get_dataset(i);\n var graph = {\n x: dataSet[0],\n y: dataSet[1],\n mode: 'lines',\n line: {\n color: colorTable[i],\n width: 1\n },\n name: ligandNames[ligandTableCell(0, i).value]\n\n };\n data.push(graph);\n }\n }\n\tplotGraph('myDiv',data, false, {staticPlot: true});\n}", "function plot_show(plot_id) {\n\tif (! (plot_id in plots)) {\n\t\tconsole.log('Broken plot_show');\n\t\treturn;\n\t}\n\tvar dom = document.getElementById(plot_id).getContext(\"2d\");\n\tvar plot = plots[plot_id];\n\tplot['chart'] = new Chart(dom, { type: plot.type, data: plot.data,\n\t\t\t\t\t options: plot.options });\n}", "#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 }", "static FormPlots() {\n netSP.plots.length = 0;\n for (let p = 0; p < netSP.encode.length; p++) {\n netSP.plots[p] = {\n quantities: {\n edgeLength: [],\n angle: [],\n },\n metrics: {\n // 'q90': 0,\n // 'Skewed length': 0,\n // 'Skewed angle': 0,\n // 'IQR': 0,\n 'Outlying vector':0,\n 'Outlying length': 0,\n 'Outlying angle': 0,\n 'Correlation': 0,\n // 'Neg correlation': 0,\n 'Entropy': 0,\n 'Intersection': 0,\n 'Translation': 0,\n 'Homogeneous': 0,\n },\n outliers: {\n length: [],\n angle: [],\n position: [],\n vector: [],\n },\n outliersList: {\n length: [],\n angle: [],\n },\n data: [],\n arrows: [],\n points: [],\n }\n }\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 replot(usedBands=null) {\n\n return (request)=> {\n\n if (request.colorDialogTabs) {\n\n replot3Color(\n request.redPanel, request.greenPanel,\n request.bluePanel,\n request.colorDialogTabs.colorTabs, usedBands);\n }\n else {\n replotStandard(request);\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 plotAccordingToChoices() {\n var currseq = parseInt($(this).parent().parent().parent().attr('id').split('-')[1]);\n var currPlotSeqInArray = 0;\n $filter('filter')($scope.plots, function (item) {\n if (item.seq === currseq) {\n currPlotSeqInArray = $scope.plots.indexOf(item);\n return true;\n }\n return false;\n });\n // Clear existing plot entries\n $scope.plots[currPlotSeqInArray]['plots'] = [];\n\n updatedPlotData = [];\n choiceContainer.find(\"input:checked\").each(function () {\n var key = $(this).attr(\"name\");\n if (key) {\n updatedPlotData.push(\n {\n 'data': $filter('filter')(plotdatumcomplete, {'label': key})[0]['data'],\n 'label': key\n }\n );\n // Update the URL\n $scope.plots[currPlotSeqInArray]['plots'].push(key);\n }\n });\n createPlot(updatedPlotData, function () {});\n $location.path(encodeURIComponent(btoa(JSON.stringify($scope.plots))));\n $scope.$apply();\n }", "function plotAccordingToChoices() {\n var data = [];\n\n choiceContainer.find(\"input:checked\").each(function () {\n var key = $(this).attr(\"name\");\n if (key && datasets[key])\n data.push(datasets[key]);\n });\n\n if (data.length > 0) {\n $.plot(placeholder, data, options);\n }\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 makeCharts() {\n issueChart();\n countChart();\n averageChart();\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 redrawPlots(data, actor) {\n\n d3.select(\"svg\").remove();\n var filteredData = filterByActor(data, actor);\n\n createScatterPlot(filteredData);\n document.getElementById(\"scatterTitle\").innerHTML = \"Selected actor: \" + actor;\n var barValue = document.getElementById(\"search_input\"); //Change input of search bar when clicking an actor in list\n barValue.value = actor;\n\n}", "function plotAll() {\n d3.select(\"#scatter-macro-1 svg\").remove()\n d3.select(\"#scatter-macro-2 svg\").remove()\n d3.select(\"#scatter-micro-1 svg\").remove()\n d3.select(\"#scatter-micro-2 svg\").remove()\n doPlot(\"scatter-macro-1\", voltageArr, \"Voltage\", maxLinearVelocityArr, \"Max. Linear Velocity\");\n doPlot(\"scatter-macro-2\", currentArr, \"Current\", accelerationArr, \"Acceleration\");\n doPlot(\"scatter-micro-1\", voltageArr, \"Voltage\", maxAngularVelocityArr, \"Max. Angular Velocity\");\n doPlot(\"scatter-micro-2\", currentArr, \"Current\", torqueArr, \"Torque\");\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 plot(getthings)\n{\nvar splitdata = [] ; // get the new data values between the limits \nvar name = getthings.name.split(\":/-\"); // split the name attribute from submit button\nvar filename = name[0]; // get the filename\nvar parameters = name[1]; // ge the parameter name \nvar div = name[2]; // get the division attribute\nvar dataindex = name[3] ; // get the index of data\n\n\n// get the first value\nvar values = document.getElementById(div + 'first').value.split(\":/-\");\n\nvar firstpoint = values[0];\nvar firstindex = values[1];\n// get the end value\nvalues = document.getElementById(div + 'end').value.split(\":/-\");\nvar endpoint = values[0];\nvar endindex = values[1];\n\nif(firstpoint > endpoint)\n{\nalert (' STARTPOINT should not be greater than ENDPOINT ');\nreturn false;\n}\n\n\n//get the data between the first and end values\n$.get(filename , function(data) {\n\n // get the selected parameter data\n $.each(data[dataindex][parameters] , function (i , element) {\n\n if(element.name >= firstpoint && element.name <= endpoint) {\n splitdata.push(element);\n\n }\n\n })\n\n if(document.getElementById( div + \"submit\" ).value == \"bar\")\n bargraph(splitdata , parameters , div , div , \"exists\" );\n\nelse\n piechart(splitdata , parameters , div , div , \"exists\" );\n\n\n});\n\n}", "function updatePlots() {\n updateMap();\n updateLineChart();\n }", "connectedCallback() {\n // split elements into those which need to be plotted before the axes\n // are drawn, and those to be plotted after.\n const PLOT_BEFORE_AXES = ['floodfill'];\n let [plot_before, plot_after] = Array.from(this.children).reduce(\n function([before, after], el) {\n //get the tag of each element, and remove leading \"math-plot-\"\n let tag = el.tagName.toLowerCase().substring(TAGNAME.length + 1);\n\n return PLOT_BEFORE_AXES.includes(tag) ?\n [[...before, el], after] :\n [before, [...after, el]];\n },\n [[], []]\n );\n\n plot_before.map(this._plotElement, this);\n\n this.drawAxes();\n\n plot_after.map(this._plotElement, this);\n }", "function updatePlot1(d, i) { // Add interactivity\n\n x.domain([0, 1.2]);\n y.domain([0, 1.2]);\n // Use D3 to select element, change color and size\n d3.select(this)\n .attr(\"fill\", \"crimson\")\n .call(function(d) {\n\n div.transition()\n .duration(200)\n .style(\"opacity\", 1.0);\n div.html(\"Hand #\" + i)\n .style(\"left\", (d3.event.pageX) + \"px\")\n .style(\"top\", (d3.event.pageY - 28) + \"px\");\n });\n d3.selectAll(\".line\")\n .style(\"fill\", \"crimson\");\n d3.selectAll(\".legend1\")\n .transition()\n .duration(200)\n .style(\"fill\", \"crimson\");\n d3.selectAll(\".l1text\")\n .text(i);\n update(i);\n\n}", "function refresh() {\n if(document.querySelector(\"#data\").children.length !== seriesToPlot.length) {\n document.querySelector(\"#data\").innerHTML = \"\"\n for(const series of seriesToPlot) {\n const div = document.createElement(\"div\")\n div.setAttribute(\"data-series\", series.name)\n div.setAttribute(\"class\", \"graphDiv\")\n document.querySelector(\"#data\").appendChild(div)\n div.appendChild(series.canvas)\n\n const closeButton = document.createElement(\"button\")\n closeButton.innerHTML = \"x\"\n closeButton.setAttribute(\"class\", \"closeButton\")\n closeButton.addEventListener(\"click\", () => {\n seriesToPlot = seriesToPlot.filter(currentSeries => currentSeries.name !== series.name)\n refresh()\n })\n\n div.appendChild(closeButton)\n }\n } \n \n for(const series of seriesToPlot) {\n graphDataOnCanvas(dataSeries[series.name], series.canvas)\n }\n}", "updatePlot(){\n\t\tvar _this = this;\n\t\tvar plot_div = this.getElement();\n\n\t\t// spectral data -> list of data\n\t\tvar data = [];\n\t\tfor(var i = 0; i < this.specConfigList.length; i++){\n\t\t\tvar cur_data = this.specConfigList[i].getPlotlyData();\n\t\t\t// if <show> is false, this will return null, so we'll skip it\n\t\t\tif(cur_data != null){\n\t\t\t\tdata.push(cur_data);\n\t\t\t}\n\t\t}\n\n\t\t// vertical lines -> list of plotly traces, just like the spectra\n\t\tfor(var i = 0; i < this.vlList.length; i++){\n\t\t\tvar cur_data = this.vlList[i].getPlotly();\n\t\t\tdata.push(cur_data);\n\t\t}\n\n\t\t// get values for x and y range\n\t\tvar to_xmin = parseFloat(this.plotConfig.valueOf('xmin'));\n\t\tvar to_xmax = parseFloat(this.plotConfig.valueOf('xmax'));\n\t\tvar to_ymin = parseFloat(this.plotConfig.valueOf('ymin'));\n\t\tvar to_ymax = parseFloat(this.plotConfig.valueOf('ymax'));\n\n\t\t// if only one in a pair (xmin vs xmax) is filled in, set other one to current value in plot\n\t\tif(!isNaN(to_xmin) && isNaN(to_xmax)){\n\t\t\tto_xmax = this.getDivXRange()[1];\n\t\t\t// also set the html element so the user knows why the plot is behaving the way it is\n\t\t\tthis.plotConfig.valueOf('xmax', to_xmax.toFixed(1));\n\t\t}\n\t\telse if(isNaN(to_xmin) && !isNaN(to_xmax)){\n\t\t\tto_xmin = this.getDivXRange()[0];\n\t\t\tthis.plotConfig.valueOf('xmin', to_xmin.toFixed(1));\n\t\t}\n\t\tif(!isNaN(to_ymin) && isNaN(to_ymax)){\n\t\t\tto_ymax = this.getDivYRange()[1];\n\t\t\tthis.plotConfig.valueOf('ymax', to_ymax.toFixed(1));\n\t\t}\n\t\telse if(isNaN(to_ymin) && !isNaN(to_ymax)){\n\t\t\tto_ymin = this.getDivYRange()[0];\n\t\t\tthis.plotConfig.valueOf('ymin', to_ymin.toFixed(1));\n\t\t}\n\n\t\t// global variables -> layout\n\t\tvar layout = {\n\t\t\t// margin is arbitrary for now\n\t\t\tmargin: {\n\t\t\t\tl: 70,\n\t\t\t\tr: 40,\n\t\t\t\tt: 60,\n\t\t\t\tb: 80\n\t\t\t},\n\t\t\ttitle: this.plotConfig.valueOf('title'),\n\t\t\ttitlefont: {\n\t\t\t\tsize: 24,\n\t\t\t\tfamily: \"'Helvetica', sans-serif\"\n\t\t\t},\n\t\t\t// x axis dictionary (expand to advanced features later)\n\t\t\txaxis: {\n\t\t\t\ttitle: this.plotConfig.valueOf('xlabel'),\n\t\t\t\ttitlefont: {\n\t\t\t\t\tsize: 20,\n\t\t\t\t\tfamily: \"'Helvetica', sans-serif\"\n\t\t\t\t},\n\t\t\t\tshowgrid: this.plotConfig.valueOf('show_grid'),\n\t\t\t\trange: [to_xmin, to_xmax]\n\t\t\t},\n\t\t\tyaxis: {\n\t\t\t\ttitle: this.plotConfig.valueOf('ylabel'),\n\t\t\t\ttitlefont: {\n\t\t\t\t\tsize: 20,\n\t\t\t\t\tfamily: \"'Helvetica', sans-serif\"\n\t\t\t\t},\n\t\t\t\tshowgrid: this.plotConfig.valueOf('show_grid'),\n\t\t\t\trange: [to_ymin, to_ymax]\n\t\t\t},\n\t\t\tshowlegend: this.plotConfig.valueOf('show_legend'),\n\t\t\tannotations: this.annotationsList,\n\t\t\tshapes: this.shapesList,\n\t\t}\n\n\t\tPlotly.newPlot(plot_div, data, layout, {showLink:false, displaylogo:false, editable:true, modeBarButtonsToRemove: ['sendDataToCloud']});\n\n\t\t// hook in a function to update settings on zoom / pan, or annotation(s) change\n\t\t\n\t\tplot_div.on('plotly_restyle', function(eventdata){\n\t\t\t// an update is going to be a length-two array, with the first item being a dictionary {name: '<name>'} and the second being a list with the index of the spectrum\n\t\t\t// check for name (label) update\n\t\t\tif('name' in eventdata[0]){\n\t\t\t\tlet sc_ind = eventdata[1][0];\n\t\t\t\tlet sc = _this.specConfigList[sc_ind];\n\t\t\t\tlet new_name = eventdata[0]['name'];\n\t\t\t\tsc.fields['label'].setValue(new_name);\n\t\t\t}\n\t\t});\n\n\t\tplot_div.on('plotly_relayout', function(eventdata){\n\n\t\t\t// check if this relayout is happening because of a change to an annotation. if so, select it\n\t\t\tlet anno_text_regex = /annotations\\[.+\\]\\.text/;\n\t\t\tlet vl_pos_regex = /shapes\\[.+\\]\\.x0/;\n\n\n\t\t\tfor(let k in eventdata){\n\t\t\t\t// check for text update to push upstream and get anno id to actually click the thing\n\t\t\t\tif(k.indexOf('annotations[') != -1){\n\t\t\t\t\t// only refresh markup if text was changed\n\t\t\t\t\tif(k.search(anno_text_regex) != -1){\n\t\t\t\t\t\t_this.refreshAnnotationMarkup();\n\t\t\t\t\t\tlet anno_ind = k.split('annotations[')[1].split(']')[0]; // this gets the index of the annotation in the plot-held list\n\t\t\t\t\t\tlet id = _this.getAnnotations()[anno_ind].id;\n\t\t\t\t\t\tlet target_row = $('#anno_row_'+id);\n\t\t\t\t\t\ttarget_row.click();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(k.indexOf('shapes[') != -1){\n\t\t\t\t\tlet shp_ind = k.split('shapes[')[1].split(']')[0];\n\t\t\t\t\tlet shp = _this.getShapes()[shp_ind];\n\t\t\t\t\tlet id = _this.getShapes()[shp_ind].id;\n\n\t\t\t\t\t// make sure the line goes 0 to 1 (calling a relayout within a relayout feels dirty, but ya gotta do what ya gotta do)\n\t\t\t\t\tif(shp.y0 != 0){\n\t\t\t\t\t\tshp.y0 = 0;\n\t\t\t\t\t\tshp.y1 = 1;\n\t\t\t\t\t\tlet update = {}\n\t\t\t\t\t\tupdate['shapes['+shp_ind+'].y0'] = 0;\n\t\t\t\t\t\tupdate['shapes['+shp_ind+'].y1'] = 1;\n\t\t\t\t\t\tPlotly.relayout(_this.getElement(), update);\n\t\t\t\t\t}\n\n\t\t\t\t\t// if the position was changed with a drag, change the name in the config and the row\n\t\t\t\t\tif(k.search(vl_pos_regex) != -1){\n\t\t\t\t\t\t// round down to nearest .1\n\t\t\t\t\t\tlet pos = Math.floor(shp.x0 * 10) / 10.;\n\t\t\t\t\t\tshp.x0 = pos;\n\t\t\t\t\t\tshp.x1 = pos;\n\t\t\t\t\t\t// if the name follows the default form, it should be changed here. Otherwise, leave it\n\t\t\t\t\t\tif(_this.hasDefaultName(shp)){\n\t\t\t\t\t\t\tshp.name = 'Spike ('+pos+')';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t_this.refreshAnnotationMarkup();\n\t\t\t\t\t\tlet target_row = $('#anno_row_'+id);\n\t\t\t\t\t\ttarget_row.click();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// catch relayout events on plot-wide editable fields, like title, xaxis, yaxis, \n\t\t\tif('title' in eventdata){_this.plot_config_target.find('[target=title]').val(eventdata['title']);}\n\t\t\tif('xaxis.title' in eventdata){_this.plot_config_target.find('[target=xlabel]').val(eventdata['xaxis.title']);}\n\t\t\tif('yaxis.title' in eventdata){_this.plot_config_target.find('[target=ylabel]').val(eventdata['yaxis.title']);}\n\n\t\t\tvar nDigits = 2;\n\t\t\t// eventdata is either dragmode, autorange, or x-/y-axis ranges\n\t\t\tvar pc = _this.plotConfig;\n\t\t\tif(eventdata['dragmode']){\n\t\t\t\t// do nothing\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// implied <else if>, because if the last one was true, it returns and never gets here\n\t\t\t// for autorange, reset plotting range in form\n\t\t\tif(eventdata['xaxis.autorange']){\n\t\t\t\tpc.fields['xmin'].element.val('');\n\t\t\t\tpc.fields['xmax'].element.val('');\n\t\t\t}\n\t\t\tif(eventdata['yaxis.autorange']){\n\t\t\t\tpc.fields['ymin'].element.val('');\n\t\t\t\tpc.fields['ymax'].element.val('');\n\t\t\t}\n\t\t\t// this just gives us the whole range, no questions asked! What a great day!\n\t\t\tif(eventdata['xaxis.range[0]']){pc.fields['xmin'].element.val(eventdata['xaxis.range[0]'].toFixed(nDigits));} // yes, the whole thing is the key. no, i don't get it either\n\t\t\tif(eventdata['xaxis.range[1]']){pc.fields['xmax'].element.val(eventdata['xaxis.range[1]'].toFixed(nDigits));}\n\t\t\tif(eventdata['yaxis.range[0]']){pc.fields['ymin'].element.val(eventdata['yaxis.range[0]'].toFixed(nDigits));}\n\t\t\tif(eventdata['yaxis.range[1]']){pc.fields['ymax'].element.val(eventdata['yaxis.range[1]'].toFixed(nDigits));}\n\t\t});\n\n\t\t// hook in a resize function\n\t\t$(window).on('resize',function(){\n\t\t\tPlotly.Plots.resize(plot_div);\n\t\t});\n\t}", "function plot(selection) {\n selection.each(function(dataset) {\n parentId = this.id;\n plot.updateData(dataset);\n \n d3.select(this).selectAll(\"svg\")\n .data([data]).enter()\n .call(createPlot);\n \n plot.updatePlot();\n });\n }", "function makeSubplots(gd, subplots) {\n\t var _plots = gd._fullLayout._plots = {};\n\t var subplot, plotinfo;\n\t\n\t function getAxisFunc(subplot, axLetter) {\n\t return function() {\n\t return Plotly.Axes.getFromId(gd, subplot, axLetter);\n\t };\n\t }\n\t\n\t for(var i = 0; i < subplots.length; i++) {\n\t subplot = subplots[i];\n\t plotinfo = _plots[subplot] = {};\n\t\n\t plotinfo.id = subplot;\n\t\n\t // references to the axis objects controlling this subplot\n\t plotinfo.x = getAxisFunc(subplot, 'x');\n\t plotinfo.y = getAxisFunc(subplot, 'y');\n\t\n\t // TODO investigate why replacing calls to .x and .y\n\t // for .xaxis and .yaxis makes the `pseudo_html`\n\t // test image fail\n\t plotinfo.xaxis = plotinfo.x();\n\t plotinfo.yaxis = plotinfo.y();\n\t }\n\t}", "function plot(sel) {\n sel.each(_plot);\n }", "function plot(sel) {\n sel.each(_plot);\n }", "function clearIt() {\n\tPlotly.newPlot(visDiv, [{\n\t\ty: [],\n\t\ttype: 'scattergl',\n\t\tmode: 'lines',\n\t\tline: { color: '#00f' },\n\t\tname: 'Vis'\n\t}], { title: 'Visual Light' });\n\tPlotly.newPlot(irDiv, [{\n\t\ty: [],\n\t\ttype: 'scattergl',\n\t\tmode: 'lines',\n\t\tline: { color: '#f00' },\n\t\tname: 'IR'\n\t}], { title: 'Infra red Light' });\n\n\tPlotly.newPlot(ps1Div, [{\n\t\ty: [],\n\t\ttype: 'scattergl',\n\t\tmode: 'lines',\n\t\tline: { color: '#f00' },\n\t\tname: 'PS1'\n\t}], { title: 'Proximity 1' });\n\tPlotly.newPlot(ps2Div, [{\n\t\ty: [],\n\t\ttype: 'scattergl',\n\t\tmode: 'lines',\n\t\tline: { color: '#0f0' },\n\t\tname: 'PS2'\n\t}], { title: 'Proximity 2' });\n\tPlotly.newPlot(ps3Div, [{\n\t\ty: [],\n\t\ttype: 'scattergl',\n\t\tmode: 'lines',\n\t\tline: { color: '#00f' },\n\t\tname: 'PS3'\n\t}], { title: 'Proximity 3' });\n}", "plotJourneys() {\n for (let j of this.mapJourneys) {\n //plot ghost Session\n j.plotSessions(this);\n }\n }", "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}", "plot_trials(){\n console.log(\"plot_trials with index = \" + this.curr_condition_index +\n \"round number\" + this.curr_round_num);\n this.plot_trial(this.curr_conditions_constants[this.curr_condition_index], this.curr_round_num);\n }", "function showGraph() {\r\n\tvar size = 50;\r\n\tcontent = '<div style=\"display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; width: ' + (size + 10) * arguments.length + 'px; margin: 0 auto\">';\r\n\tfor (var divChild = 0; divChild < arguments.length; divChild++) {\r\n\t\tcontent += '<div style=\"background: ' + getRandomColor() + '; width: 50px; height: ' + arguments[divChild] * size + 'px\"></div>';\r\n\t}\r\n\tcontent += '</div>';\r\n\treturn content;\r\n}", "function onAddNewPlotFrame() {\n\n if (map == null) {\n alert(mapNotReady);\n return;\n }\n\n if (map.graphics == null) {\n alert(mapNotReady);\n return;\n }\n var plotTemplateCbo = getPlotTemplateComboBox();\n var plotTemplate = plotTemplateCbo[plotTemplateCbo.selectedIndex].value;\n getPlotTemplateComboBox().disabled = true;\n getScaleComboBox().disabled = true;\n\n addPlotFrame(plotTemplate, true);\n\n updatePlotFrameButtons();\n onMovePlotFrame();\n}", "function make_richplot(plot){\n console.log(plot);\n\n $('div.jqplot-point-label', plot).each(function(){\n var elem = $(this);\n var text = elem.text();\n elem.attr('title', text);\n var width = elem.width();\n elem.text('');\n elem.width(width);\n elem.tipsy({gravity: 's', trigger: 'manual'});\n });\n\n plot.bind('jqplotDataHighlight', \n function (ev, seriesIndex, pointIndex, data) {\n var pointLabel = $('div.jqplot-point-label.jqplot-series-' + seriesIndex + '.jqplot-point-' + pointIndex, plot);\n pointLabel.tipsy(\"show\");\n pointLabel.hide();\n\n }\n );\n\n plot.bind('jqplotDataUnhighlight', \n function (ev, seriesIndex, pointIndex, data) {\n var pointLabel = $('div.jqplot-point-label', plot);\n $('div.jqplot-point-label', plot).each(function(){\n $(this).tipsy(\"hide\");\n $(this).show();\n });\n }\n );\n}", "function optionChanged (newID) {\n buildPlots(newID);\n demographicPanel(newID);\n}", "function FunctionPlotter(options) {\n let axisTickCounts,\n functions,\n gridBoolean,\n group,\n hasTransitioned,\n plotArea,\n plotter,\n range,\n width,\n where,\n x,\n y;\n\n plotter = this;\n\n init(options);\n\n return plotter;\n\n /* INITIALIZE */\n function init(options) {\n let curtain;\n\n _required(options);\n _defaults(options);\n\n\n curtain = addCurtain();\n plotter.scales = defineScales();\n plotter.axisTitles = {};\n group = addGroup();\n plotArea = addPlotArea();\n plotter.layers = addLayers();\n plotter.grid = addGrid();\n plotter.axes = addAxes();\n plotter.lines = addLines(functions);\n plotter.hotspot = addHotspot();\n\n plotter.hasTransitioned = false;\n\n // valueCircle = false;\n\n\n }\n\n /* PRIVATE METHODS */\n function _defaults(options) {\n\n axisTickCounts = options.axisTicks ? options.axisTicks : {\"x\":1,\"y\":1};\n functions = options.functions ? options.functions : [];\n plotter.height = options.height ? options.height : 400;\n plotter.width = options.width ? options.width : 800;\n plotter.domain = options.domain ? options.domain : [0,10];\n plotter.range = options.range ? options.range : [0,10];\n plotter.margins = options.margins ? options.margins : defaultMargins();\n //TODO: THIS IS SLOPPY. GRID SHOULD BE CLEARER\n gridBoolean = options.hideGrid ? false : true;\n x = options.x ? options.x : 0;\n y = options.y ? options.y : 0;\n plotter.coordinates = options.coordinates ? options.coordinates : {\"x\":x,\"y\":y};\n plotter.fontFamily = options.fontFamily ? options.fontFamily : \"\";\n\n }\n\n function _required(options) {\n\n hasTransitioned = false;\n where = options.where;\n\n }\n\n\n /* PRIVATE METHODS */\n function addAxes() {\n let axes;\n\n axes = {};\n\n axes.x = addXAxis();\n axes.y = addYAxis();\n\n return axes;\n }\n\n function addCurtain() {\n let clipPath,\n rect;\n\n clipPath = where\n .select(\"defs\")\n .append(\"clipPath\")\n .attr(\"id\",\"plotterClipPath\");\n\n rect = clipPath\n .append(\"rect\")\n .attr(\"x\",-1)\n .attr(\"y\",-1)\n .attr(\"width\",width - plotter.margins.left - plotter.margins.right + 1)\n .attr(\"height\",plotter.height - plotter.margins.top - plotter.margins.bottom + 1);\n\n return clipPath;\n }\n\n function addGroup() {\n let group;\n\n group = explorableGroup({\"where\":options.where})\n .attr(\"transform\",\"translate(\"+plotter.coordinates.x+\",\"+plotter.coordinates.y+\")\");\n\n return group;\n }\n\n function addGrid() {\n let grid;\n\n if(gridBoolean) {\n grid = new FunctionPlotterGrid({\n \"axisTickCounts\":axisTickCounts,\n \"domain\":plotter.domain,\n \"range\":range,\n \"scales\":plotter.scales,\n \"where\":plotter.layers.grid,\n \"tickEvery\":1\n });\n }\n\n return grid;\n }\n\n function addHotspot() {\n let hotspot;\n\n hotspot = group\n .append(\"rect\")\n .attr(\"x\",plotter.margins.left)\n .attr(\"y\",plotter.margins.top)\n .attr(\"width\",plotter.width - plotter.margins.left - plotter.margins.right)\n .attr(\"height\",plotter.height - plotter.margins.top - plotter.margins.bottom)\n .attr(\"fill\",\"rgba(0,0,0,0)\");\n\n return hotspot;\n }\n\n function addPlotArea() {\n let plotGroup;\n\n plotGroup = explorableGroup({\n \"where\":group\n })\n .attr(\"transform\",\"translate(\"+plotter.margins.left+\",\"+plotter.margins.top+\")\");\n\n return plotGroup;\n }\n\n function addLayers() {\n let layers;\n\n layers = {};\n layers.plot = explorableGroup({\"where\":group})\n .attr(\"transform\",\"translate(\"+plotter.margins.left+\",\"+plotter.margins.top+\")\");\n\n layers.grid = explorableGroup({\"where\":layers.plot})\n .attr(\"clip-path\",\"url(#plotterClipPath)\");\n\n layers.axes = explorableGroup({\"where\":layers.plot});\n layers.lines = explorableGroup({\"where\":layers.plot});\n\n\n layers.indicators = explorableGroup({\"where\":group});\n layers.tooltip = explorableGroup({\"where\":group});\n\n return layers;\n }\n\n\n function addLines(functions) {\n let lines;\n\n if(functions.length == 0) {\n lines = [];\n\n return lines;\n }\n\n functions.forEach((aFunction) => {\n let line = new FunctionPlotterLine({\n \"function\":aFunction,\n \"where\":plotter.layers.lines,\n \"domain\":plotter.domain,\n \"scales\":plotter.scales,\n });\n\n lines.push(line);\n });\n\n return lines;\n }\n\n function addXAxis() {\n let axis;\n\n axis = new FunctionPlotterAxis({\n \"axisType\":\"bottom\",\n \"scales\":plotter.scales,\n \"tickCount\":axisTickCounts.x,\n \"where\":plotter.layers.axes\n });\n\n return axis;\n }\n\n function addYAxis() {\n let axis;\n\n axis = new FunctionPlotterAxis({\n \"axisType\":\"left\",\n \"scales\":plotter.scales,\n \"tickCount\":axisTickCounts.y,\n \"where\":plotter.layers.axes\n });\n\n return axis;\n }\n\n function defaultMargins() {\n return {\n \"left\":100,\n \"right\":10,\n \"top\":30,\n \"bottom\":50\n };\n }\n\n function defineScale(inputDomain,outputRange) {\n let scale;\n\n scale = d3.scaleLinear()\n .domain(inputDomain)\n .range(outputRange);\n\n return scale;\n }\n\n function defineScales() {\n let scales;\n\n scales = {};\n scales.x = defineScale(plotter.domain,[0,plotter.width - plotter.margins.right - plotter.margins.left]);\n scales.y = defineScale(plotter.range,[plotter.height - plotter.margins.bottom - plotter.margins.top,0]);\n\n return scales;\n }\n\n\n}", "function renderCharts(nextfields,charttype,results_code_hash) {\r\n\t// Do initial checking/setting of parameters\r\n\tif (nextfields.length < 1) return;\r\n\tif (isSurveyPage == null) isSurveyPage = false;\r\n\tif (charttype == null) charttype = '';\r\n\tif (results_code_hash == null || !isSurveyPage) results_code_hash = '';\r\n\tvar hash = getParameterByName('s');\r\n\tvar record = getParameterByName('record');\r\n\t// Do ajax request\r\n\tvar url = app_path_webroot+'Graphical/plot_gct.php?pid='+pid;\r\n\tif (hash != '') {\r\n\t\t// Show results to survey participant (use passthru mechanism to avoid special authentication issues)\r\n\t\turl = dirname(dirname(app_path_webroot))+'/surveys/index.php?pid='+pid+'&s='+hash+'&__results='+getParameterByName('__results')+'&__passthru='+escape('Graphical/plot_gct.php');\r\n\t} else if (record != '') {\r\n\t\t// Overlay results from one record\r\n\t\tvar event_id = getParameterByName('event_id');\r\n\t\turl += '&record='+record+'&event_id='+event_id;\r\n\t}\r\n\t$.post(url, { fields: nextfields, charttype: charttype, isSurveyPage: (isSurveyPage ? '1' : '0'), results_code_hash: results_code_hash }, function(resp_data){\r\n\t\tvar json_data = jQuery.parseJSON(resp_data);\r\n\t\t// Set variables\r\n\t\tvar field = json_data.field;\r\n\t\tvar form = json_data.form;\r\n\t\tvar nextfields = json_data.nextfields;\r\n\t\tvar raw_data = json_data.data;\r\n\t\tvar minValue = json_data.min;\r\n\t\tvar maxValue = json_data.max;\r\n\t\tvar medianValue = json_data.median;\r\n\t\tvar respondentData = json_data.respondentData;\r\n\t\tvar showChart = json_data.showChart; // Used to hide Bar Charts if lacking diversity\r\n\t\tif (charttype != '') {\r\n\t\t\tvar plottype = charttype;\r\n\t\t} else {\r\n\t\t\tvar plottype = json_data.plottype;\r\n\t\t}\r\n\t\t// If no data was sent OR plot should be hidden due to lack of diversity, then do not display field (would cause error)\r\n\t\tif (!showChart || raw_data.length == 0) {\r\n\t\t\t// Hide the field div\r\n\t\t\t$('#plot-'+field).html( $('#no_show_plot_div').html() );\r\n\t\t\t$('#stats-'+field).remove();\r\n\t\t\t$('#chart-select-'+field).hide();\r\n\t\t\t$('#refresh-link-'+field).hide();\t\t\t\r\n\t\t\t// Perform the next ajax request if more fields still need to be processed\r\n\t\t\tif (nextfields.length > 0) {\r\n\t\t\t\trenderCharts(nextfields,charttype,results_code_hash);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t// Instantiate data object\r\n\t\tvar data = new google.visualization.DataTable();\r\n\t\t// Box Plot\r\n\t\tif (plottype == 'BoxPlot') \r\n\t\t{\r\n\t\t\t// Store record names and event_id's into array to allow navigation to page\r\n\t\t\tvar recordEvent = new Array();\r\n\t\t\t// Set text for the pop-up tooltip\r\n\t\t\tvar tooltipText = (isSurveyPage ? 'Value entered by survey participant /' : 'Click plot point to go to this record /');\r\n\t\t\t// Add data columns\r\n\t\t\tdata.addColumn('number', '');\r\n\t\t\tdata.addColumn('number', 'Value');\r\n\t\t\t// Add data rows\r\n\t\t\tfor (var i = 0; i < raw_data.length; i++) {\r\n\t\t\t\t// Add to chart data\r\n\t\t\t\tdata.addRow([{v: raw_data[i][0], f: raw_data[i][0]+'\\n\\n'}, {v: raw_data[i][1], f: tooltipText}]);\t\t\t\t\r\n\t\t\t\t// Add to recordEvent array\r\n\t\t\t\tif (!isSurveyPage) {\r\n\t\t\t\t\trecordEvent[i] = '&id='+raw_data[i][2]+'&event_id='+raw_data[i][3];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// Add median dot\r\n\t\t\tdata.addColumn('number', 'Median');\r\n\t\t\tdata.addRow([{v: medianValue, f: medianValue+'\\n\\n'}, null, {v: 0.5, f: 'Median value /'}]);\r\n\t\t\t// Add single respondent/record data point\r\n\t\t\tif (respondentData != '') {\r\n\t\t\t\tvar tooltipTextSingleResp1, tooltipTextSingleResp2;\r\n\t\t\t\tif (isSurveyPage) {\r\n\t\t\t\t\ttooltipTextSingleResp1 = tooltipTextSingleResp2 = 'YOUR value';\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttooltipTextSingleResp1 = 'Value for selected record ('+record+')';\r\n\t\t\t\t\ttooltipTextSingleResp2 = 'Click plot point to go to this record';\r\n\t\t\t\t}\r\n\t\t\t\tdata.addColumn('number', tooltipTextSingleResp1);\r\n\t\t\t\tdata.addRow([{v: respondentData*1, f: respondentData+'\\n\\n'}, null, null, {v: 0.5, f: tooltipTextSingleResp2+' /'}]);\r\n\t\t\t\t// Add to recordEvent array\r\n\t\t\t\tif (!isSurveyPage) {\r\n\t\t\t\t\trecordEvent[i+1] = '&id='+record+'&event_id='+event_id;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// Display box plot\r\n\t\t\tvar chart = new google.visualization.ScatterChart(document.getElementById('plot-'+field));\r\n\t\t\tvar chartHeight = 250;\r\n\t\t\tchart.draw(data, {chartArea: {top: 10, left: 30, height: (chartHeight-50)}, width: 650, height: chartHeight, legend: 'none', vAxis: {minValue: 0, maxValue: 1, textStyle: {fontSize: 1} }, hAxis: {minValue: minValue, maxValue: maxValue} });\r\n\t\t\t// Set action to open form in new tab when select a plot point\r\n\t\t\tif (!isSurveyPage) {\t\t\r\n\t\t\t\tgoogle.visualization.events.addListener(chart, 'select', function selectPlotPoint(){\r\n\t\t\t\t\tvar selection = chart.getSelection();\r\n\t\t\t\t\tif (selection.length < 1) return;\r\n\t\t\t\t\tvar message = '';\r\n\t\t\t\t\tfor (var i = 0; i < selection.length; i++) {\r\n\t\t\t\t\t\tvar itemrow = selection[i].row;\r\n\t\t\t\t\t\tif (itemrow != null && recordEvent[itemrow] != null) {\r\n\t\t\t\t\t\t\twindow.open(app_path_webroot+'DataEntry/index.php?pid='+pid+'&page='+form+recordEvent[itemrow]+'&fldfocus='+field+'#'+field+'-tr','_blank');\r\n\t\t\t\t\t\t\treturn;\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}\r\n\t\t} \r\n\t\t// Bar/Pie Chart\r\n\t\telse \r\n\t\t{\r\n\t\t\t// Add data columns\r\n\t\t\tdata.addColumn('string', '');\r\n\t\t\tif (isSurveyPage) {\r\n\t\t\t\tdata.addColumn('number', 'Count from other respondents');\r\n\t\t\t\tdata.addColumn('number', 'Count from YOU');\r\n\t\t\t} else {\r\n\t\t\t\tdata.addColumn('number', 'Count');\r\n\t\t\t\tdata.addColumn('number', 'Count from the selected record');\r\n\t\t\t}\r\n\t\t\t// Add data rows\r\n\t\t\tdata.addRows(raw_data);\r\n\t\t\t// Display bar chart or pie chart\r\n\t\t\tif (plottype == 'PieChart') {\r\n\t\t\t\tvar chart = new google.visualization.PieChart(document.getElementById('plot-'+field));\r\n\t\t\t\tvar chartHeight = 300;\r\n\t\t\t\tchart.draw(data, {chartArea: {top: 10, height: (chartHeight-50)}, width: 600, height: chartHeight, legend: 'none', hAxis: {minValue: minValue, maxValue: maxValue} });\r\n\t\t\t} else if (plottype == 'BarChart') {\r\n\t\t\t\tvar chart = new google.visualization.BarChart(document.getElementById('plot-'+field));\t\t\t\t\t\t\r\n\t\t\t\tvar chartHeight = 80+(raw_data.length*60);\r\n\t\t\t\tchart.draw(data, {colors:['#3366CC','#FF9900'], isStacked: true, chartArea: {top: 10, height: (chartHeight-50)}, width: 600, height: chartHeight, legend: 'none', hAxis: {minValue: minValue, maxValue: maxValue} });\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Perform the next ajax request if more fields still need to be processed\r\n\t\tif (nextfields.length > 0) {\r\n\t\t\trenderCharts(nextfields,charttype,results_code_hash);\r\n\t\t}\r\n\t});\r\n}", "plot(points,c1, c2){\n let plotPoints = [];\n for (let i = 0; i < points.length; i++){\n let somePoint = {\n x : [],\n y : [],\n bias: [],\n name : '',\n legendgroup: '',\n text: [],\n mode: 'markers',\n marker: {\n color: 'rgb(0, 0, 255)',\n opacity: 0.5,\n size: 20,\n line: {\n color: 'rgb(0, 0, 255)',\n width: 2\n }\n }\n }\n if (points[i].label == 1){\n somePoint.x = [points[i].x];\n somePoint.y = [points[i].y];\n somePoint.bias = [points[i].bias];\n somePoint.name = c1;\n somePoint.legendgroup = c1;\n somePoint.text = [`${points[i].x}-${points[i].y}-L(${points[i].label})`];\n plotPoints.push(somePoint);\n } else {\n somePoint.x = [points[i].x];\n somePoint.y = [points[i].y];\n somePoint.bias = [points[i].bias];\n somePoint.name = c2;\n somePoint.legendgroup = c2;\n somePoint.text = [`${points[i].x}-${points[i].y}-L(${points[i].label})`];\n somePoint.marker.color = 'rgb(0, 128, 0)';\n somePoint.marker.line.color = 'rgb(0, 128, 0)';\n plotPoints.push(somePoint);\n }\n }\n return plotPoints;\n }", "function renderGraph(feature_name, data, type, nBin){ \n\n // Initializes the label content for the graphs in a map\n initLabels();\n\n\n if(type == \"CATEGORICAL\"){\n\n // Hide the slider and show bar graph for Categorical features\n hideSlider();\n renderBarGraph(feature_name, data);\n } else if(type == \"NUMERICAL\"){\n\n // Show the slider and show histogram graph for Numerical features\n showSlider();\n renderHistogram(feature_name, data, nBin);\n }\n\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 optionChanged(id) {\r\n buildplot(id);\r\n}", "function addFlotGraphic(idx, item, graphic, graphtype, feedscount, options) {\n graphics.push({\n plot: {},\n placeholder: item,\n graphic: graphic,\n dataset: [],\n options: options,\n index: idx,\n graphtype: graphtype,\n feedscount: feedscount,\n timestart: 1111111111,\n timeend: 1113089736,\n fetched: 0,\n rendered: 0,\n });\n}", "function plotly_update_graphplots(old_plot) {\n \"use strict\";\n // Regressions.\n var new_plot = $.extend([], old_plot);\n for (var i = 0; i < regression_cache.length; i++) {\n if (regression_cache[i]) {\n regression_cache[i].forEach(function(j){\n new_plot.push(j);\n });\n }\n }\n return new_plot;\n}", "function display(error, data1, data2, data3, data4) {\n\n if (error) throw error;\n\n // create a new plot and\n // display it\n var plot = scrollVis();\n d3.select(\"#vis\")\n .datum([data1, data2, data3, data4])\n .call(plot);\n\n // setup scroll functionality\n var scroll = scroller()\n .container(d3.select('#graphic'));\n\n // pass in .step selection as the steps\n scroll(d3.selectAll('.step'));\n\n // setup event handling\n scroll.on('active', function (index) {\n // highlight current step text\n d3.selectAll('.step')\n .style('opacity', function (d, i) {\n return i == index ? 1 : 0.1;\n });\n\n // activate current section\n plot.activate(index);\n });\n\n scroll.on('progress', function (index, progress) {\n plot.update(index, progress);\n });\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 plotSeries() {\n if (series.length < 2)\n return;\n var placeholder = $(\"#placeholder\");\n var p = $.plot(placeholder, [series], options);\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}", "function updatePlotly(newdata, newlayout) {\n var BAR = document.getElementById(\"plot\"); \n Plotly.newPlot(BAR, newdata, newlayout);\n }", "graphics () {\r\n let graphs = [];\r\n for (let i = 0; i < this.props.books.length; i++) {\r\n graphs.push(<GraphicMarket book={this.props.books[i].book} theme={this.props.theme} \r\n activeGraphic={this.props.books[i].book === this.state.currentBookMarket} key={i} onClick={ () => this.selectView(this.props.books[i].book) } /> );\r\n }\r\n return graphs;\r\n }", "function show_graph(arrayOfDataMulti,cat,cus_legends)\n\t{\n\t\t\t$('#mygraph').html('');\n\t\t\t\n\t\t\tif(cat == 1)\n\t\t\t{\n\t\t\t\t\t$('#mygraph').jqBarGraph({\n\t\t\t\t\t\tdata: arrayOfDataMulti,\n\t\t\t\t\t\tcolors: ['#242424','#437346','#97D95C'],\n\t\t\t\t\t\twidth: 600,\n\t\t\t\t\t\tlegendWidth: 200,\n\t\t\t\t\t\tlegend: true,\n\t\t\t\t\t\tlegends: cus_legends,\n\t\t\t\t\t\tbarSpace: 20\n\t\t\t\t\t}); \n\t\t\t}\n\t\t\t\n\t\t\telse if(cat == 2)\n\t\t\t{\n\t\t\t\t\t$('#mygraph').jqBarGraph({\n\t\t\t\t\t\tdata: arrayOfDataMulti,\n\t\t\t\t\t\tcolors: ['#242424','#437346','#97D95C'],\n\t\t\t\t\t\twidth: 600,\n\t\t\t\t\t\tlegendWidth: 200,\n\t\t\t\t\t\tlegend: true,\n\t\t\t\t\t\tlegends: cus_legends,\n\t\t\t\t\t\tbarSpace: 20,\n\t\t\t\t\t\ttype: 'multi'\n\t\t\t\t\t}); \n\t\t\t}\n\t}", "function endFunction(){\n count++;\n if(count==3){\n console.log(\"Start the Manipulation\");\n // console.log(stTotalFemales);\n // console.log(stTotalMales);\n firstPlot();// Function to create JSON for first plot\n secondPlot();// Function to create JSON for second plot\n }\n else{\n console.log(\"Not yet ready to start the Manipulation\");\n }\n}", "function _setDefaultPlot(id) {\n plot.switchPlots(id);\n gui.render(plot.getInfoForGUI());\n }", "function displayChart(resultsData) {\n\n\t$.jqplot._noToImageButton = true;\n\tvar prevYear = resultsData;\n\tvar plot1 = $.jqplot(addRowToTable(), [ prevYear ], {\n\t\tseriesColors : [ \"rgba(78, 135, 194, 0.7)\", \"rgb(211, 235, 59)\" ],\n\t\ttitle : selectedItemName,\n\t\thighlighter : {\n\t\t\tshow : true,\n\t\t\tsizeAdjust : 1,\n\t\t\ttooltipOffset : 9\n\t\t},\n\t\tgrid : {\n\t\t\tbackground : 'rgba(57,57,57,0.0)',\n\t\t\tdrawBorder : false,\n\t\t\tshadow : false,\n\t\t\tgridLineColor : '#666666',\n\t\t\tgridLineWidth : 2\n\t\t},\n\t\tlegend : {\n\t\t\tshow : true,\n\t\t\tplacement : 'inside'\n\t\t},\n\t\tseriesDefaults : {\n\t\t\trendererOptions : {\n\t\t\t\tsmooth : true,\n\t\t\t\tanimation : {\n\t\t\t\t\tshow : true\n\t\t\t\t}\n\t\t\t},\n\t\t\tshowMarker : false\n\t\t},\n\t\tseries : [ {\n\t\t\tfill : true,\n\t\t\tlabel : 'Execiution time'\n\t\t} ],\n\t\taxesDefaults : {\n\t\t\trendererOptions : {\n\t\t\t\tbaselineWidth : 1.5,\n\t\t\t\tbaselineColor : '#444444',\n\t\t\t\tdrawBaseline : false\n\t\t\t}\n\t\t},\n\t\taxes : {\n\t\t\txaxis : {\n\t\t\t\trenderer : $.jqplot.DateAxisRenderer,\n\t\t\t\ttickRenderer : $.jqplot.CanvasAxisTickRenderer,\n\t\t\t\ttickOptions : {\n\t\t\t\t\tformatString : \"%b %e\",\n\t\t\t\t\tangle : -30,\n\t\t\t\t\ttextColor : '#dddddd'\n\t\t\t\t},\n\t\t\t\tmin : 1000,\n\t\t\t\tmax : 29000,\n\t\t\t\ttickInterval : 10,\n\t\t\t\tdrawMajorGridlines : false\n\t\t\t},\n\t\t\tyaxis : {\n\t\t\t\trenderer : $.jqplot.LogAxisRenderer,\n\t\t\t\tpad : 0,\n\t\t\t\trendererOptions : {\n\t\t\t\t\tminorTicks : 1\n\t\t\t\t},\n\t\t\t\ttickOptions : {\n\t\t\t\t\tformatString : \"ms %'d\",\n\t\t\t\t\tshowMark : false\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\n\t$('.jqplot-highlighter-tooltip').addClass('ui-corner-all');\n\n}", "function createPlotter()\n{\n\tvar canvas, ctx;\n\tvar plots = [];\n\tvar plotNames = {};\n\tvar currentPlot, clipped = false;\n\tvar debugBorders = false;\n\tvar padding = typeof arguments[1] !== \"undefined\" ? arguments[1] : new Point(0, 0);\n\t\n\tcanvas = arguments[0];\n\tctx = canvas.getContext(\"2d\");\n\t\t\n\tcanvas.addEventListener(\"mousedown\", function(e){updateMouse(e);}, false);\n\tcanvas.addEventListener(\"mousemove\", function(e){updateMouse(e);}, false);\n\tcanvas.addEventListener(\"mouseup\", function(e){updateMouse(e);}, false);\n\tcanvas.addEventListener(\"touchstart\", function(e){updateTouch(e);}, false);\n\tcanvas.addEventListener(\"touchmove\", function(e){updateTouch(e);}, false);\n\tcanvas.addEventListener(\"touchend\", function(e){updateTouch(e);}, false);\n\tcanvas.addEventListener(\"touchcancel\", function(e){updateTouch(e);}, false);\n\t\n\tfunction pageToPlot(p, plot)\n\t{\n\t\tvar s = plot.settings;\n\t\tvar x = (p.x - canvas.offsetLeft - s.offset.x) / s.pixelPerUnit.x + s.domain.x;\n\t\tvar y = (canvas.height - (p.y - canvas.offsetTop) - (canvas.height - (s.offset.y + s.plotSize.y))) / s.pixelPerUnit.y + s.range.x;\n\t\treturn new Point(x, y);\n\t}\n\t\n\tfunction pointInBounds(p, plot)\n\t{\n\t\tvar s = plot.settings;\n\t\treturn (p.x >= s.domain.x && p.x <= s.domain.y && p.y >= s.range.x && p.y <= s.range.y)\n\t}\n\t\n\tfunction findPlotUnderPoint(p)\n\t{\n\t\tfor (var i = 0; i < plots.length; i++)\n\t\t\tif (pointInBounds(pageToPlot(p, plots[i]), plots[i]))\n\t\t\t\treturn i;\n\t\treturn -1;\n\t}\n\t\n\tfunction updateMouse(e)\n\t{\n\t\tvar plot = findPlotUnderPoint(new Point(e.pageX, e.pageY));\n\t\tif (plot == -1)\n\t\t\treturn;\n\t\tplot = plots[plot];\n\t\t\n\t\tvar p = pageToPlot(new Point(e.pageX, e.pageY), plot);\n\t\tvar type = e.type.replace(\"mouse\", '');\n\t\t\n\t\tif ((type == \"down\" || type == \"move\") && (!(e.buttons & 1) && e.button != 0))\n\t\t\treturn;\n\t\t\n\t\tplot.mouse[type].x = p.x;\n\t\tplot.mouse[type].y = p.y;\n\t\tif (type == \"down\")\n\t\t{\n\t\t\tplot.mouse.isDown = true;\n\t\t\tplot.mouse.isUp = false;\n\t\t}\n\t\telse if (type == \"up\")\n\t\t{\n\t\t\tplot.mouse.isDown = false;\n\t\t\tplot.mouse.isUp = true;\n\t\t}\n\t}\n\t\n\tfunction updateTouch(e)\n\t{\t\n\t\tvar type = e.type.replace(\"touch\",'');\n\t\t\n\t\tfor(var i = 0; i < e.changedTouches.length; i++)\n\t\t{\n\t\t\tvar touchID, event;\n\t\t\t\n\t\t\tswitch(type)\n\t\t\t{\n\t\t\t\tcase \"start\":\n\t\t\t\t\tevent = new MouseEvent(\"mousedown\",\n\t\t\t\t\t{screenX: e.changedTouches[i].screenX, screenY: e.changedTouches[i].screenY,\n\t\t\t\t\tclientX: e.changedTouches[i].clientX, clientY: e.changedTouches[i].clientY});\n\t\t\t\tbreak;\n\t\t\t\tcase \"move\":\n\t\t\t\t\tevent = new MouseEvent(\"mousemove\",\n\t\t\t\t\t{screenX: e.changedTouches[i].screenX, screenY: e.changedTouches[i].screenY,\n\t\t\t\t\tclientX: e.changedTouches[i].clientX, clientY: e.changedTouches[i].clientY});\n\t\t\t\tbreak;\n\t\t\t\tcase \"cancel\":\n\t\t\t\tcase \"end\":\n\t\t\t\t\tevent = new MouseEvent(\"mouseup\",\n\t\t\t\t\t{screenX: e.changedTouches[i].screenX, screenY: e.changedTouches[i].screenY,\n\t\t\t\t\tclientX: e.changedTouches[i].clientX, clientY: e.changedTouches[i].clientY});\n\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcanvas.dispatchEvent(event);\n\t\t}\n\t\t\n\t\tif (e.touches.length > 0)\n\t\t{\n\t\t\tvar plot = findPlotUnderPoint(new Point(e.pageX, e.pageY));\n\t\t\tif (plot != -1)\n\t\t\t{\n\t\t\t\tplots[plot].mouse.isDown = true;\n\t\t\t\tplots[plot].mouse.isUp = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (e.touches.length == 1 && type == \"move\")\n\t\t\te.preventDefault();\n\t}\n\t\n\tfunction refitCanvas()\n\t{\n\t\tif (plots.length == 0)\n\t\t\treturn;\n\t\t\n\t\tif (clipped)\n\t\t{\n\t\t\tctx.restore();\n\t\t\tclipped = false;\n\t\t}\n\t\t\n\t\tvar size = new Point(0, 0);\n\t\tfor (var i = 0; i < plots.length; i++)\n\t\t{\n\t\t\tvar s = plots[i].settings;\n\t\t\tsize.x = Math.max(size.x, s.offset.x + s.plotSize.x + s.labelBleed.x);\n\t\t\tsize.y = Math.max(size.y, s.offset.y + s.plotSize.y + s.labelSize.y);\n\t\t}\t\t\t\n\t\tcanvas.width = size.x + padding.x + 10;\n\t\tcanvas.height = size.y + padding.y + 10;\n\t\t\n\t\tctx.strokeStyle = \"#0000FF\";\n\t\tctx.lineWidth = 2;\n\t\tctx.strokeRect(0, 0, canvas.width, canvas.height);\n\t\t\n\t\tfor (var i = 0; i < plots.length; i++)\n\t\t\tdrawPlot(plots[i]);\n\t}\n\t\n\tfunction drawPlot(plot)\n\t{\n\t\tvar s = plot.settings;\n\t\t\n\t\tctx.translate(s.offset.x, s.offset.y);\n\t\t\n\t\tctx.clearRect(-s.labelSize.x, s.labelBleed.y, s.plotSize.x + s.labelSize.x + s.labelBleed.x, s.plotSize.y + s.labelSize.y - s.labelBleed.y);\n\t\t\n\t\tif (debugBorders)\n\t\t{\n\t\t\tctx.lineWidth = 0.5;\n\t\t\tctx.strokeRect(-s.labelSize.x, s.labelBleed.y, s.plotSize.x + s.labelSize.x + s.labelBleed.x, s.plotSize.y + s.labelSize.y - s.labelBleed.y);\n\t\t}\n\t\t\n\t\tctx.lineWidth = 2;\n\t\t\n\t\t//plot\n\t\tctx.fillStyle = \"#F8F8F8\";\n\t\tctx.fillRect(0, 0, s.plotSize.x, s.plotSize.y);\n\t\tctx.fillStyle = \"#000000\";\n\t\tctx.strokeStyle = \"#E0E0E0\";\n\t\tctx.font = \"16px Helvetica\";\n\t\tctx.textAlign = \"center\";\n\t\tctx.textBaseline = \"top\";\n\t\tctx.beginPath();\n\t\tfor( var i = 0; i <= s.plotSize.x / s.gridSize.x; i++)\n\t\t{\n\t\t\tvar x = i * s.gridSize.x;\n\t\t\tif (s.orientation==\"c\" || s.orientation==\"d\")\n\t\t\t\tx = s.plotSize.x - x;\n\t\t\t\n\t\t\tif (s.drawGrid)\n\t\t\t{\n\t\t\t\tctx.moveTo(x, s.plotSize.y);\n\t\t\t\tctx.lineTo(x, 0);\n\t\t\t}\n\t\t\t\n\t\t\tif (!(i % s.labelFrequency.x) && s.labelFrequency.x > 0)\n\t\t\t{\n\t\t\t\tvar tickLabel = s.domain.x + i * s.unitPerTick.x;\n\t\t\t\tctx.fillText( s.labelPrecision.x == -1 ? tickLabel : tickLabel.toFixed(s.labelPrecision.x), x, s.plotSize.y + 5);\n\t\t\t}\n\t\t}\n\t\tctx.textAlign = \"right\";\n\t\tctx.textBaseline = \"middle\";\n\t\tfor( var i = 0; i <= s.plotSize.y / s.gridSize.y; i++)\n\t\t{\n\t\t\tvar y = i * s.gridSize.y;\n\t\t\tif (!(s.orientation==\"b\" || s.orientation==\"c\"))\n\t\t\t\ty = s.plotSize.y - y;\n\t\t\t\n\t\t\tif (s.drawGrid)\n\t\t\t{\n\t\t\t\tctx.moveTo(0, y);\n\t\t\t\tctx.lineTo(s.plotSize.x, y);\n\t\t\t}\n\t\t\t\n\t\t\tif (!(i % s.labelFrequency.y) && s.labelFrequency.y > 0)\n\t\t\t{\n\t\t\t\tvar tickLabel = s.range.x + i * s.unitPerTick.y;\n\t\t\t\tctx.fillText(s.labelPrecision.y == -1 ? tickLabel : tickLabel.toFixed(s.labelPrecision.y), -5, y);\n\t\t\t}\n\t\t}\n\t\tctx.stroke();\n\t\t\n\t\t//axis\n\t\tctx.strokeStyle = \"#000000\";\n\t\tctx.lineWidth = 1;\n\t\tctx.beginPath();\n\t\tvar axisOffset = new Point(\n\t\t(s.zeroBoundAxis ? Math.max(0, Math.min(s.plotSize.x, ((s.orientation==\"c\"||s.orientation==\"d\") ? s.domain.y : -s.domain.x) * s.pixelPerUnit.x)) : (s.orientation==\"c\"||s.orientation==\"d\") ? s.plotSize.x : 0),\n\t\t(s.zeroBoundAxis ? Math.min(s.plotSize.y, Math.max(0, ((s.orientation==\"b\"||s.orientation==\"c\") ? -s.range.x : s.range.y) * s.pixelPerUnit.y)) : (s.orientation==\"b\"||s.orientation==\"c\") ? 0 : s.plotSize.y));\n\t\tctx.moveTo(axisOffset.x, 0);\n\t\tctx.lineTo(axisOffset.x, s.plotSize.y);\n\t\tctx.moveTo(0, axisOffset.y);\n\t\tctx.lineTo(s.plotSize.x, axisOffset.y);\n\t\tctx.stroke();\n\t\t\n\t\t//x axis label\n\t\tctx.textAlign = \"center\";\n\t\tctx.textBaseline = \"bottom\";\n\t\tctx.font = \"24px Helvetica\";\n\t\tctx.fillText(s.xAxis, s.plotSize.x * 0.5, s.plotSize.y + s.labelSize.y);\n\t\t\n\t\t//y axis label\n\t\tctx.translate(-s.labelSize.x, s.plotSize.y * 0.5);\n\t\tctx.rotate(3 * Math.PI * 0.5);\n\t\tctx.textBaseline = \"top\";\n\t\tctx.fillText(s.yAxis, 0, 0);\n\t\tctx.rotate(-3 * Math.PI * 0.5);\n\t\tctx.translate(s.labelSize.x, -(s.plotSize.y * 0.5));\n\t\t\n\t\t//coordinates\n\t\tif (s.drawCoords) //needs to be redone entirely\n\t\t{\n\t\t\tvar coordOffsetY = Math.max(ctx.measureText(s.domain.x).width, ctx.measureText(s.domain.y).width);\n\t\t\tvar coordOffsetX = coordOffsetY * 2 + ctx.measureText(\"y: \").width;\n\t\t\tctx.textAlign = \"left\";\n\t\t\tctx.textBaseline = \"bottom\";\n\t\t\tctx.fillText(\"x: \" + (isNaN(Math.round(this.mouse.move.x)) ? 0 : Math.round(this.mouse.move.x)), s.plotSize.x - coordOffsetX - 20, s.plotSize.y + s.labelSize.y);\n\t\t\tctx.fillText(\"y: \" + (isNaN(Math.round(this.mouse.move.y)) ? 0 : Math.round(this.mouse.move.y)), s.plotSize.x - coordOffsetY - 10, s.plotSize.y + s.labelSize.y);\n\t\t}\n\t\t\n\t\tctx.translate(-s.offset.x, -s.offset.y);\n\t}\n\t\n\treturn {\n\t\tset drawBorders(value) { debugBorders = value; },\n\t\tget drawBorders() { return debugBorders; },\n\t\tnewPlot: function(settings, name)\n\t\t{\n\t\t\tplot = new Plot(settings, ctx);\n\t\t\tplots.push(plot);\n\t\t\t\n\t\t\tif (typeof name !== \"undefined\")\n\t\t\t\tplotNames[name] = plots.length - 1;\n\t\t\t\n\t\t\trefitCanvas();\n\t\t\tdrawPlot(plot);\n\t\t\t\n\t\t\treturn plots.length - 1;\n\t\t},\n\t\tclearPlot: function(unclip)\n\t\t{\n\t\t\tunclip = typeof unclip !== \"undefined\" ? unclip : false;\n\t\t\t\n\t\t\tif (currentPlot == undefined)\n\t\t\t\treturn;\n\t\t\t\n\t\t\tif (clipped && unclip)\n\t\t\t\tctx.restore();\n\t\t\t\n\t\t\tdrawPlot(currentPlot);\n\t\t\t\n\t\t\tif (clipped)\n\t\t\t{\n\t\t\t\tctx.save();\n\t\t\t\tctx.rect(currentPlot.settings.offset.x + 1, currentPlot.settings.offset.y, currentPlot.settings.plotSize.x - 1, currentPlot.settings.plotSize.y - 1);\n\t\t\t\tctx.clip();\n\t\t\t}\n\t\t},\n\t\teditPlot: function(plot, settings, reCalcLabels, redrawCanvas)\n\t\t{\n\t\t\tif (typeof plot === \"number\" && (plot < 0 || plot > plots.length - 1))\n\t\t\t\treturn;\n\t\t\t\n\t\t\tplot = (typeof plot === \"number\" ? plots[plot] : ((typeof plot === \"string\" || plot instanceof String || plot.constructor == String || Object.prototype.toString.call(plot) == \"[object String]\") ? plots[plotNames[plot]] : plot));\n\t\t\t\n\t\t\tredrawCanvas = typeof redrawCanvas !== \"undefined\" ? redrawCanvas : false;\n\t\t\treCalcLabels = typeof reCalcLabels !== \"undefined\" ? reCalcLabels : false;\n\t\t\t\n\t\t\tif (plot == undefined)\n\t\t\t\treturn;\n\t\t\t\n\t\t\tif (clipped)\n\t\t\t\tctx.restore();\n\t\t\t\n\t\t\tif (redrawCanvas)\n\t\t\t{\n\t\t\t\tctx.clearRect(0,0, canvas.width, canvas.height);\n\t\t\t\tctx.strokeStyle = \"#0000FF\";\n\t\t\t\tctx.lineWidth = 2;\n\t\t\t\tctx.strokeRect(0, 0, canvas.width, canvas.height);\n\t\t\t}\n\t\t\t\n\t\t\tfor (var key in settings)\n\t\t\t\tif (plot.settings.hasOwnProperty(key))\n\t\t\t\t\tplot.settings[key] = settings[key];\n\t\t\t\n\t\t\tif (reCalcLabels)\n\t\t\t\tplot.reCalculateLabels();\n\t\t\t\n\t\t\tdrawPlot(plot);\n\t\t\t\n\t\t\tif (clipped)\n\t\t\t{\n\t\t\t\tctx.save();\n\t\t\t\tctx.rect(currentPlot.settings.offset.x + 1, currentPlot.settings.offset.y, currentPlot.settings.plotSize.x - 1, currentPlot.settings.plotSize.y - 1);\n\t\t\t\tctx.clip();\n\t\t\t}\n\t\t},\n\t\tselectPlot: function(plot, clear, clip)\n\t\t{\n\t\t\tif (typeof plot === \"number\" && (plot < 0 || plot > plots.length - 1))\n\t\t\t\treturn;\n\t\t\t\n\t\t\tclear = typeof clear !== \"undefined\" ? clear : true;\n\t\t\tclip = typeof clip !== \"undefined\" ? clip : true;\n\t\t\tplot = (typeof plot === \"number\" ? plots[plot] : ((typeof plot === \"string\" || plot instanceof String || plot.constructor == String || Object.prototype.toString.call(plot) == \"[object String]\") ? plots[plotNames[plot]] : plot));\n\t\t\t\n\t\t\tif (plot == undefined)\n\t\t\t\treturn;\n\t\t\t\n\t\t\tif (clipped)\n\t\t\t\tctx.restore();\n\t\t\tcurrentPlot = plot;\n\t\t\tif (clear)\n\t\t\t\tdrawPlot(currentPlot);\n\t\t\t\n\t\t\tif (clip)\n\t\t\t{\n\t\t\t\tctx.save();\n\t\t\t\tctx.rect(currentPlot.settings.offset.x + 1, currentPlot.settings.offset.y, currentPlot.settings.plotSize.x - 1, currentPlot.settings.plotSize.y - 1);\n\t\t\t\tctx.clip();\n\t\t\t\tclipped = true;\n\t\t\t}\n\t\t\telse if (clipped)\n\t\t\t\tclipped = false;\n\t\t},\n\t\tget ctx() { return ctx; },\n\t\tget mouse()\n\t\t{\n\t\t\tif (currentPlot == undefined)\n\t\t\t\treturn;\n\t\t\treturn currentPlot.mouse;\n\t\t},\n\t\tget settings()\n\t\t{\n\t\t\tif (currentPlot == undefined)\n\t\t\t\treturn;\n\t\t\treturn currentPlot.settings;\n\t\t},\n\t\tpointOnPlot: function(p, plot)\n\t\t{\n\t\t\tif (typeof plot === \"number\" && (plot >= 0 && plot <= plots.length - 1))\n\t\t\t\tplot = plots[plot];\n\t\t\telse if (typeof plot === \"string\" || plot instanceof String || plot.constructor == String || Object.prototype.toString.call(plot) == \"[object String]\")\n\t\t\t\tplot = plots[plotNames[plot]]\n\t\t\telse\n\t\t\t\tcurrentPlot;\n\t\t\t\n\t\t\treturn pointInBounds(p, currentPlot);\n\t\t},\n\t\tplotToCanvas: function(p)\n\t\t{\n\t\t\tvar s = currentPlot.settings;\n\t\t\tvar x = (((s.orientation==\"c\"||s.orientation==\"d\") ? s.domain.y : 2 * p.x) - p.x - ((s.orientation==\"c\"||s.orientation==\"d\") ? 0 : s.domain.x)) * s.pixelPerUnit.x + s.offset.x;\n\t\t\tvar y = s.plotSize.y - ((((s.orientation==\"b\"||s.orientation==\"c\") ? s.range.y : 2 * p.y) - p.y - ((s.orientation==\"b\"||s.orientation==\"c\") ? 0 : s.range.x)) * s.pixelPerUnit.y) + s.offset.y;\n\t\t\treturn new Point(x, y);\n\t\t},\n\t\tplotPoint: function(p, r, fill)\n\t\t{\n\t\t\tif (currentPlot == undefined)\n\t\t\t\treturn;\n\t\t\t\n\t\t\tr = typeof r !== \"undefined\" ? r : 2;\n\t\t\tfill = typeof fill !== \"undefined\" ? fill : true;\n\t\t\t\n\t\t\tp = this.plotToCanvas(p);\n\t\t\tctx.beginPath();\n\t\t\tctx.arc(p.x, p.y, r, 0, 2 * Math.PI);\n\t\t\tif (fill)\n\t\t\t\tctx.fill();\n\t\t\telse\n\t\t\t\tctx.stroke();\n\t\t},\n\t\tplotLine: function(p1, p2)\n\t\t{\n\t\t\tif (currentPlot == undefined)\n\t\t\t\treturn;\n\t\t\t\n\t\t\tp1 = this.plotToCanvas(p1);\n\t\t\tp2 = this.plotToCanvas(p2);\n\t\t\tapp.ctx.lineCap = \"round\";\n\t\t\tctx.beginPath();\n\t\t\tctx.moveTo(p1.x, p1.y);\n\t\t\tctx.lineTo(p2.x, p2.y);\n\t\t\tctx.stroke();\n\t\t},\n\t\tplotSlope: function(p, slope)\n\t\t{\n\t\t\tif (currentPlot == undefined)\n\t\t\t\treturn;\n\t\t\t\n\t\t\tvar p1 = new Point(currentPlot.settings.domain.x, p.y - slope * (p.x - currentPlot.settings.domain.x));\n\t\t\tif (!pointInBounds(p1, currentPlot))\n\t\t\t{\n\t\t\t\tp1.y = p1.y < currentPlot.settings.range.x ? currentPlot.settings.range.x : currentPlot.settings.range.y;\n\t\t\t\tp1.x = p.x - (p.y - p1.y)/slope;\n\t\t\t}\n\t\t\tvar p2 = new Point(currentPlot.settings.domain.y, p.y - slope * (p.x - currentPlot.settings.domain.y));\n\t\t\tif (!pointInBounds(p2, currentPlot))\n\t\t\t{\n\t\t\t\tp2.y = p2.y < currentPlot.settings.range.x ? currentPlot.settings.range.x : currentPlot.settings.range.y;\n\t\t\t\tp2.x = p.x - (p.y - p2.y)/slope;\n\t\t\t}\n\t\t\tthis.plotLine(p1, p2);\n\t\t\t\n\t\t\treturn new Line(p1, p2, slope, new Point(p.x, p.y));\n\t\t},\n\t\tplotPoly: function(points, closed)\n\t\t{\n\t\t\tvar length = Object.keys(points).length;\n\t\t\tif (currentPlot == undefined || length < 2)\n\t\t\t\treturn;\n\t\t\t\n\t\t\tclosed = typeof closed !== \"undefined\" ? closed : false;\n\t\t\t\n\t\t\tif (typeof points == \"undefined\")\n\t\t\t\treturn;\n\t\t\t\n\t\t\tapp.ctx.lineCap = \"round\";\n\t\t\tctx.beginPath();\n\t\t\tfor (var i = 0; i < length - 1; i++)\n\t\t\t{\n\t\t\t\tvar p = this.plotToCanvas(points[i]);\n\t\t\t\t\n\t\t\t\tif (i != 0)\n\t\t\t\t\tctx.lineTo(p.x, p.y);\n\t\t\t\telse\n\t\t\t\t\tctx.moveTo(p.x, p.y);\n\t\t\t}\n\t\t\tif (closed)\n\t\t\t{\n\t\t\t\tvar p = this.plotToCanvas(points[0]);\n\t\t\t\tctx.lineTo(p.x, p.y);\n\t\t\t}\n\t\t\tctx.stroke();\n\t\t},\n\t\tplotFunction: function(func, xFunc, step, start, end)\n\t\t{\n\t\t\tif (currentPlot == undefined)\n\t\t\t\treturn;\n\t\t\t\n\t\t\txFunc = typeof xFunc !== \"undefined\" ? xFunc : true;\n\t\t\tstep = typeof step !== \"undefined\" ? step : 1;\n\t\t\tstart = typeof start !== \"undefined\" ? start : (xFunc ? currentPlot.settings.domain.x : currentPlot.settings.range.x);\n\t\t\tend = typeof end !== \"undefined\" ? end : (xFunc ? currentPlot.settings.domain.y : currentPlot.settings.range.y);\n\t\t\t\n\t\t\tvar i = start, funcValue;\n\t\t\tvar points = [];\n\t\t\twhile (i < end)\n\t\t\t{\n\t\t\t\tfuncValue = func(i);\n\t\t\t\tif (typeof funcValue !== \"undefined\")\n\t\t\t\t\tpoints.push(new Point(xFunc?i:funcValue, xFunc?funcValue:i));\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.plotPoly(points);\n\t\t\t\t\tpoints = [];\n\t\t\t\t}\n\t\t\t\ti+= step;\n\t\t\t\tif (i > end)\n\t\t\t\t\ti = end;\n\t\t\t}\n\t\t\tif (typeof funcValue !== \"undefined\")\n\t\t\t\tpoints.push(new Point(xFunc?i:funcValue, xFunc?funcValue:i));\n\t\t\tthis.plotPoly(points);\n\t\t},\n\t\tplotText: function(text, point)\n\t\t{\n\t\t\tif (currentPlot == undefined)\n\t\t\t\treturn;\n\t\t\t\n\t\t\tpoint = typeof point !== \"undefined\" ? point : new Point(currentPlot.settings.domain.x + (currentPlot.settings.domain.y - currentPlot.settings.domain.x) * 0.5, currentPlot.settings.range.x + (currentPlot.settings.range.y - currentPlot.settings.range.x) * 0.5);\n\t\t\t\n\t\t\tpoint = this.plotToCanvas(point);\n\t\t\tctx.fillText(text, point.x, point.y);\n\t\t}\n\t}\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 refreshDisplay(){\n env.disp.render() ;\n env.plot.render() ;\n}", "function update() {\n\t\t// plot options\n\t\tvar options = {\n\t\t\tgrid: {clickable: true},\n\t\t\txaxis: {min: -1, max: 1},\n\t\t\tyaxis: {min: -1, max: 1}\n\t\t};\n\n\t\t// Add data points to plot data\n\t\tvar series = [{\n\t\t\tdata: xyData,\n\t\t\tpoints: {show: true},\n\t\t\tcolor: \"blue\"\n\t\t}];\n\n\t\t// add llmse fit line if it exists\n\t\tif (llmseFit) {\n\t\t\tvar fitData = getFitPlotData(llmseFit);\n\t\t\tseries.push({\n\t\t\t\tdata: fitData,\n\t\t\t\tlines: {show: true},\n\t\t\t\tcolor: \"red\",\n\t\t\t\tlabel: \"LMSE fit\"\n\t\t\t});\n\t\t}\n\n\t\t// add descent fit line if it exists\n\t\tif (descent.getNumObservations() > 0) {\n\t\t\tvar fitData = getFitPlotData(descent.getTheta());\n\t\t\tseries.push({\n\t\t\t\tdata: fitData,\n\t\t\t\tlines: {show: true},\n\t\t\t\tcolor: \"orange\",\n\t\t\t\tlabel: \"model fit\"\n\t\t\t});\n\t\t}\n\n\t\tthePlot = plot(series, options);\n\t\thuds.forEach(function(hud){hud.update()});\n\t\treturn thePlot;\n\t}", "function GeneralPlot(Settings){\n\t// The settings has the following format:\n\t// .InterfaceID = the ID of the container to put the graph into. Should be a unique ID on the page. Required\n\t// .xAxisLabel\n\t// .yAxisLabel\n\t// .Data = the data object associated with the graph. Required if you want to use the download button to call .Data.Download()\n\t// .ObjectID = the name of this GeneralPlot in global scope. Required\n\n\t// Check that there are any ID names that are taken\n\t//console.error(\"Using '\"+Settings.InterfaceID+\"' as an ID for this plot creates a parameter '\" + PrexistingID + \"' that already exists.\";\n\t\n\t// Store information associated with this plot\n\t\n\t// InterfaceID\n\tif (typeof(Settings.InterfaceID)!='undefined'){\n\t\tthis.InterfaceID=Settings.InterfaceID;\n\t}\n\telse {\n\t\tthrow \"In order to use the GeneralPlot function, you must set the Settings.InterfaceID value to the name of the div element you wish to place the plot into.\";\n\t}\n\tthis.PlotPlaceholder=\"#\"+Settings.InterfaceID+\"_placeholder\";\n\t\n\t// Object ID\n\tif (typeof(Settings.ObjectID)!='undefined'){\n\t\tthis.ObjectID=Settings.ObjectID;\n\t}\n\telse {\n\t\tthrow \"In order to use the GeneralPlot function, you must set the Settings.ObjectID value to the string of the name of the variable that represents this object, such that HTML can be constructed around this object.\";\n\t}\n\t\t\t\n\tthis.PlotFunction=Settings.PlotFunction;// should have the format function(PlotPlaceholder, PlotData){}\n\t// e.g. \n\t// Settings.PlotFunction=function(PlotPlaceholder, PlotData){\n\t// \t var OriginalData=PlotData.Plot[1]; // note in this case, since the OriginalData and OptimisedResults have the same format as PlotData.Plot (.X .Y .Upper .Lower) we can simply use this format\n\t// \t var OptimisedResults=PlotData.Plot[2];\n\t// return OptimisationPlot(PlotPlaceholder, OriginalData, OptimisedResults);\n\t// }\n\tthis.PlotData=Settings.PlotData;// A structure that can contain anything that is needed to graph\n\t// note: PlotData contains an array of Plot[] that each contain:\n\t// .X (or .Category) .Y .Upper .Lower .ObjectID\n\t\n\t// PlotData contains\n\t// .XMin .XMax .YMin .YMax\n\t// These can be edited by the options interface\n\t\n\t// The .Data element can be used for selecting new graphing options in the graphing panel, and to allow data to be downloaded\n\tvar DownloadButtonHTML=\"\";//by default blank if the download data function does not exist\n\tif (typeof(Settings.DataSource)!='undefined'){\n\t\tthis.DataSource=Settings.DataSource;\n\t\t\n\t\t// If the .DataSource hads a function called \"Download\", create a button that allows the download of Data\n\t\tif (typeof(this.DataSource.Download)=='function'){\n\t\t\tDownloadButtonHTML=\" <div class='downloadbutton' title='Download data' onclick='\"+this.ObjectID+\".Download();'>&#x21E9;</div>\\n\";\n\t\t}\n\t}\n\n\t\n\t// Options window\n\t// The Options window initially only displays min/max \n\tvar OptionsPanelHTML=\"\";\n\tthis.DisplayOptionsPanel=false; // the default is to not display it unless the option is selected\n\tif (typeof(Settings.DisplayOptionsPanel)!='undefined'){\n\t\tthis.DisplayOptionsPanel=Settings.DisplayOptionsPanel;// This is the first point at which displaying the options panel becomes possible\n\t}\n\t\n\t// This is where the set up of the Options parameter selection occurs\n\tif (typeof(Settings.Options)!='undefined'){\n\t\tthis.DisplayOptionsPanel=true;\n\t\tthis.Options=Settings.Options;\n\t\t\n\t\t// this.Options will contain the following elements\n\t\t// PossibleXValues\n\t\t// for each x value, the possible y values \n\t\t// PossibleYValues\n\t\t// PossibleYValuesUncertainties\n\t\t\n\t\t// Future elements\n\t\t// Drop down: PlotStyle\n\t\t// PlotFunction (on selection \n\t\t// Drop down: X value, .ObjectID .Values\n\t\t// Drop down: Plot 1\n\t\t// Drop down: Y value\n\t\t// Drop down: Display uncertainty (none), \n\t\t// Lower un\n\t\t// Can only plot this if the X value name exists in the parameter \n\t\t\n\t\t\n\t\t// Need to work out if we are going to force coupling of values or not, I say yes\n\t\t\n\t\t// The close button causes the graph to update with the new settings.\n\t\t// Visibility initial set to false\n\t\t\n\t\tvar PlotVariableSelectionHTML=\"\";\n\t\t\n\t}\n\t\n\t// Display plot title\n\tthis.Title=\"\";\n\tif (typeof(Settings.Title)!='undefined'){\n\t\tthis.Title=Settings.Title;\n\t}\n\t\n\t// Set up axis labels\n\tthis.XLabel=\"\";\n\tif (typeof(Settings.XLabel)!='undefined'){\n\t\tthis.XLabel=Settings.XLabel;\n\t}\n\tthis.YLabel=\"\";\n\tif (typeof(Settings.YLabel)!='undefined'){\n\t\tthis.YLabel=Settings.YLabel;\n\t}\n\t\t\t\n\t// Build HTML\n\tthis.InnerHTMLForPlot=\"\";\n\tthis.InnerHTMLForPlot+=\" <div class='fullscreenbox' id='\"+this.InterfaceID+\"_fullscreenbox' >\\n\";\n\tthis.InnerHTMLForPlot+=\" <div class='plot_title' >\"+this.Title+\"</div>\\n\";\n\tthis.InnerHTMLForPlot+=\" <div class='saveimagebutton' title='Save image' onclick='\"+this.ObjectID+\".SaveImage();'>&#x2357</div>\\n\";\n\tthis.InnerHTMLForPlot+=DownloadButtonHTML;\n\tthis.InnerHTMLForPlot+=\" <div class='fullscreenbutton' title='Fullscreen' id='\"+this.ObjectID+\"_fullscreenbutton' onclick=\\\"ToggleFullScreen('\"+this.InterfaceID+\"_fullscreenbox');\\\">&#10063</div>\\n\";\n\tthis.InnerHTMLForPlot+=\" <div class='plot_positioner'>\\n\";\n\tthis.InnerHTMLForPlot+=\" <div id='\"+this.InterfaceID+\"_placeholder' class='plot_placeholder'></div>\\n\";\n\tthis.InnerHTMLForPlot+=\" </div>\\n\";\n\tthis.InnerHTMLForPlot+=\" <div class='xlabel'>\"+this.XLabel+\"</div>\\n\";\n\tthis.InnerHTMLForPlot+=\" <div class='ylabel'><div class='rotate'>\"+this.YLabel+\"</div></div>\\n\";\n\tthis.InnerHTMLForPlot+=\" </div>\\n\";\n\t\n\n}", "function plot_destroy(plot_id) {\n\tif (! plot_is_showed(plot_id)) {\n\t\tconsole.log('Broken plot_destroy');\n\t\treturn;\n\t}\n\tplots[plot_id]['chart'].destroy();\n\tdelete plots[plot_id]['chart'];\n}", "function plot(func, atts) {\n if (atts==null) {\n return addCurve(board, func, {strokewidth:2});\n } else {\n return addCurve(board, func, atts);\n }\n }", "render() {\n\t\t\t\trendered = true\n\n\t\t\t\tif (data.location != 'blank'){\n\n\t\t\t\t\t// add div for chart\n\t\t\t\t\tconst $container = $sel.append('div')\n\t\t\t\t\t\t.attr('class', 'container')\n\t\t\t\t\t\t.style('height', `${containerHeight}px`)\n\n\t\t\t\t\t// add containers for imports and exports\n\t\t\t\t\tconst $imports = $container.append('div')\n\t\t\t\t\t\t.attr('class', 'container-imports')\n\n\t\t\t\t\tconst $exports = $container.append('div')\n\t\t\t\t\t\t.attr('class', 'container-exports')\n\n\t\t\t\t\t// add state name\n\t\t\t\t\tconst $nameDiv = $sel.append('div').attr('class', 'name-div')\n\t\t\t\t\t$nameDiv.append('span').text(data.abbreviation).attr('class', 'name name-upper')\n\n\t\t\t\t\taddDogBlocks({$imports, $exports, factor})\n\n\t\t\t\t\t// if the data exists for that state, add dogs\n\t\t\t\t\t// if (data.count){\n \t\t\t// \t\t$imports.selectAll('.import dog')\n \t\t\t// \t\t\t.data(d3.range(data.count.imported / factor))\n \t\t\t// \t\t\t.join(enter => {\n \t\t\t// \t\t\t\tenter.append('div')\n \t\t\t// \t\t\t\t\t.attr('class', 'import')\n \t\t\t// \t\t\t})\n\t\t\t\t\t//\n\t\t\t\t\t// \t$exports.selectAll('.export dog')\n\t\t\t\t\t// \t\t.data(d3.range(data.count.exported / factor))\n\t\t\t\t\t// \t\t.join(enter => {\n\t\t\t\t\t// \t\t\tenter.append('div')\n\t\t\t\t\t// \t\t\t\t.attr('class', 'export')\n\t\t\t\t\t// \t\t})\n\t\t\t\t\t// }\n\n\n\t\t\t\t}\n\n\t\t\t\treturn Chart;\n\t\t\t}", "renderChartType(){\n switch(this.props.chartType){\n case \"Bar\": return this.barChart()\n break;\n case \"Line\": return this.lineChart()\n break;\n case \"Area\": return this.areaChart()\n break;\n case \"Pie\": return this.pieChart()\n break;\n case \"Scatter\": return this.scatterChart()\n break;\n default: return this.barChart()\n \n }\n}", "function optionChanged (sample) {\ndemographic_panel(sample);\ncreate_charts(sample);\n}", "function plot() {\n\t$('#gen-label').text(`Generation ${genPlot}`); \n\tPlotly.newPlot('self-score-data', selfScoreData[genPlot], layout);\n\tPlotly.newPlot('rstp', rstpData[genPlot], {title: 'RSTP'});\n\tconsole.log('rstpData:');\n\tconsole.log(rstpData);\n}", "function renderChart() {\n let datasets = [];\n\n if (funcionPoints.length > 0) {\n datasets.push({\n label: funcion,\n data: funcionPoints,\n borderColor: \"purple\",\n borderWidth: 2,\n fill: false,\n showLine: true,\n pointBackgroundColor: \"purple\",\n radius: 0,\n });\n } else {\n alert(\"No hay puntos para la funcion.\");\n }\n\n if (areaPoints.length > 0) {\n datasets.push({\n label: \"Area\",\n data: areaPoints,\n borderColor: \"blue\",\n borderWidth: 2,\n fill: true,\n showLine: true,\n pointBackgroundColor: \"blue\",\n tension: 0,\n radius: 0,\n });\n } else {\n alert(\"No hay puntos para el area.\");\n }\n\n if (insidePoints.length > 0) {\n datasets.push({\n label: \"Punto aleatorio por debajo de la función\",\n data: insidePoints,\n borderColor: \"green\",\n borderWidth: 2,\n fill: false,\n showLine: false,\n pointBackgroundColor: \"green\",\n });\n } else {\n alert(\"No hay puntos aleatorios.\");\n }\n\n if (outsidePoints.length > 0) {\n datasets.push({\n label: \"Punto aleatorio por arriba de la función\",\n data: outsidePoints,\n borderColor: \"red\",\n borderWidth: 2,\n fill: false,\n showLine: false,\n pointBackgroundColor: \"red\",\n });\n } else {\n alert(\"No hay puntos aleatorios.\");\n }\n\n data = { datasets };\n\n if (chart) {\n chart.data = data;\n chart.update();\n }\n }", "function plot_refresh(plot_id) {\n\tif (! plot_is_showed(plot_id)) {\n\t\tconsole.log('Broken plot_refresh');\n\t\treturn;\n\t}\n\tplots[plot_id]['chart'].update();\n}", "render_animation( caller )\n { // display(): Draw the selected group of axes arrows.\n if( this.groups[ this.selected_basis_id ] )\n for( let a of this.groups[ this.selected_basis_id ] )\n this.shapes.axes.draw( caller, this.uniforms, a, this.material );\n }", "function optionChanged(sample){\r\n \r\n buildplot(sample);\r\n \r\n \r\n }", "function initPlot() {\n var Us = calculateUs();\n if (deltaHapproach==\"briggs\"){\n var hprime = calculateSTdownwash();\n }\n else{\n var hprime = h;\n }\n //var deltaH = calculateDeltaH(Us);\n //var H = h + deltaH;\n\n make_plot( Us, hprime);\n \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}", "function show_plot(plot_id, control_data) {\n\tif (! (plot_id in plots)) {\n\t\tconsole.log('Broken show_plot');\n\t\treturn false;\n\t}\n\tvar plot = plots[plot_id];\n\tfor (var i = 0; i < plot.triggers_show_started.length; ++i)\n\t\tif (! plot.triggers_show_started[i](plot_id, control_data))\n\t\t\treturn false;\n\n\tif (plot_is_showed(plot_id))\n\t\tplot_destroy(plot_id);\n\tplot_clear_data(plot_id);\n\tplot_set_title(plot_id, plot.get_title(plot_id, control_data));\n\n\tvar x_axes = plot.get_x_values(plot_id, control_data);\n\tfor (var i = 0; i < plot.parameters_to_show.length; ++i) {\n\t\tparam_name = plot.parameters_to_show[i];\n\t\tconf = plot.params_config[param_name];\n\t\tvar dataset = {};\n\t\tvar values = [];\n\t\tfor (var j = 0; j < x_axes.length; ++j) {\n\t\t\tvar val = conf.get_value(param_name, x_axes[j]);\n\t\t\tif (val == null)\n\t\t\t\tcontinue;\n\t\t\tif (val != val)\n\t\t\t\tvalues.push(NaN);\n\t\t\telse\n\t\t\t\tvalues.push(val);\n\t\t}\n\t\tdataset.data = values;\n\t\tif (! ('plot_label' in conf))\n\t\t\tdataset.label = conf.title;\n\t\telse\n\t\t\tdataset.label = conf.plot_label;\n\t\tif ('color' in conf)\n\t\t\tdataset.color = conf.color;\n\t\tif ('plot_type' in conf)\n\t\t\tdataset.type = conf.plot_type;\n\t\tif ('border_dash' in conf)\n\t\t\tdataset.border_dash = conf.border_dash;\n\t\tif ('no_points' in conf && conf.no_points)\n\t\t\tdataset.no_points = conf.no_points;\n\n\t\tvar len = plot.triggers_dataset_created.length;\n\t\tfor (var j = 0; j < len; ++j) {\n\t\t\tvar tr = plot.triggers_dataset_created[j];\n\t\t\tif (! tr(param_name, dataset))\n\t\t\t\tbreak;\n\t\t}\n\t\tplot_add_data(plot_id, dataset);\n\t}\n\tplot_show(plot_id);\n\n\tfor (var i = 0; i < plot.triggers_show_finished.length; ++i) {\n\t\tvar tr = plot.triggers_show_finished[i];\n\t\tif (! tr(plot_id, control_data))\n\t\t\treturn false;\n\t}\n\treturn true;\n}", "plot() {\n return \"Cute alien takes over the earth\";\n }", "function singledisplay(){\n\n split_window(\"#Vergleich2\", \"s\");\n\n if(graphs.length == 2){\n draw(parent1, child1, \"s_g1\", link1);\n draw(parent2, child2, \"s_g2\", link2);\n }\n\n if(graphs.length >=3){\n draw(parent1, child1, \"s_g1\", link1);\n draw(parent2, child2, \"s_g2\", link2);\n draw(parent3, child3, \"s_g3\", link3);\n if(graphs.length == 4){\n draw(parent4, child4, \"s_g4\", link4);}\n }\n}", "function plotGraph() {\n if (houses.data.length > 0) {\n for (let i = 0; i < houses.data.length; i++) {\n xs[i] = map(houses.data[i].inputs[0], 0, zoom, 0, wnx);\n ys[i] = map(houses.data[i].inputs[1], 0, zoom, wny, 200);\n cs[i] = houses.data[i].inputs[8];\n ps[i] = houses.data[i].target[0];\n }\n }\n}", "function loadStreamPlot( object_id, stream_id ){\n // Create plot container\n var streamPlot = $(\n '<div class=\"plot-container\" id=\"plot-'+object_id+'-'+stream_id+'\">'+\n '</div>'\n );\n // Load Highcharts\n streamPlot.highcharts({\n chart: {\n type: 'spline'\n },\n title: {\n text: 'Plot Title'\n },\n subtitle: {\n text: 'Plot Subtitle'\n },\n xAxis: {\n type: 'datetime',\n dateTimeLabelFormats: { // don't display the dummy year\n month: '%e. %b',\n year: '%b'\n },\n title: {\n text: 'Date'\n }\n },\n yAxis: {\n title: {\n text: 'Y-Label'\n }\n },\n tooltip: {\n headerFormat: '<b>{series.name}</b><br>',\n pointFormat: '{point.x:%e. %b}: {point.y:.2f} m'\n },\n plotOptions: {\n spline: {\n marker: {\n enabled: true\n }\n }\n }\n });\n\n // Add to page\n $('div#content-Plots div.content-left').append( streamPlot );\n\n // Hide plots that are not active\n if ( !active ) {\n streamPlot.hide();\n }else{\n reloadPlotAndExport( object_id, stream_id );\n }\n\n\n\n}", "function plots(id) {\r\n d3.json(\"data/cardata.json\").then((data)=> {\r\n console.log(data)\r\n var city_mpg = data.cars.map(data => data.city_mpg)[id]\r\n console.log(`City MPG: ${city_mpg}`);\r\n var highway_mpg = data.cars.map(data => data.highway_mpg)[id]\r\n console.log(`Highway MPG: ${highway_mpg}`);\r\n\r\n\r\n\r\n //bar chart//\r\n var trace= {\r\n x: ['City MPG','Highway MPG'],\r\n y: [city_mpg,highway_mpg],\r\n name: 'Chosen',\r\n marker: {\r\n color: 'skyBlue'\r\n },\r\n type:\"bar\",\r\n orientation: \"v\",\r\n };\r\n var trace2 = {\r\n x:['City MPG','Highway MPG'],\r\n y:[19.876,26.325],\r\n name: \"Average\",\r\n type: 'bar'\r\n };\r\n var data = [trace,trace2];\r\n var layout = {barmode: 'group'};\r\n Plotly.newPlot(\"bar\", data,layout);\r\n});\r\n\r\n\r\n d3.json(\"data/cardata2.json\").then((data)=>{\r\n var engine_hp = data.cars.map(data=> data.engine_hp)[id]\r\n\r\n var trace3 = {\r\n x: [\"Engine Horsepower\"],\r\n y: [engine_hp],\r\n name: \"Horsepower\",\r\n type: \"bar\"\r\n };\r\n\r\n\r\n var trace4 = {\r\n x: [\"Engine Hrosepower\"],\r\n y: [249.38],\r\n name: \"Average Horsepower\",\r\n type: \"bar\"\r\n };\r\n\r\n var data = [trace3,trace4];\r\n\r\n var layout = {\r\n barmode: 'group'};\r\n\r\n var Average_MPG = {\r\n x: [\"1990\",\r\n\"1991\",\r\n\"1992\",\r\n\"1993\",\r\n\"1994\",\r\n\"1995\",\r\n\"1996\",\r\n\"1997\",\r\n\"1998\",\r\n\"1999\",\r\n\"2000\",\r\n\"2001\",\r\n\"2002\",\r\n\"2003\",\r\n\"2004\",\r\n\"2005\",\r\n\"2006\",\r\n\"2007\",\r\n\"2008\",\r\n\"2009\",\r\n\"2010\",\r\n\"2011\",\r\n\"2012\",\r\n\"2013\",\r\n\"2014\",\r\n\"2015\",\r\n\"2016\",\r\n\"2017\"],\r\n y: [23, 22, 24, 24, 23, 23, 23, 22, 21, 22 ,24, 23, 22, 22, 23, 23, 21, 22, 23, 24, 25, 26, 27, 28, 29, 29, 28],\r\n type: \"line\"\r\n};\r\nvar data2 = [Average_MPG];\r\nvar layout2 = {\r\n title: \"Avg MPG\",\r\n xaxis: {\r\n title: 'Years',\r\n showgrid: false,\r\n zeroline: false,\r\n autotick: false,\r\n ticks: 'outside',\r\n tick0: 0,\r\n dtick: 1,\r\n ticklen: 5,\r\n tickwidth: 1,\r\n tickcolor: '#000'\r\n },\r\n yaxis: {\r\n title: 'MPG',\r\n showline: false,\r\n autotick: false,\r\n ticks: 'outside',\r\n tick0: 0,\r\n dtick: 1,\r\n ticklen: 5,\r\n tickwidth: 1,\r\n tickcolor: '#000'\r\n },\r\n shapes:[{\r\n type: 'line',\r\n x0: 1990,\r\n y0: 26.6,\r\n x1: 2017,\r\n y1: 26.6,\r\n opacity: 0.7,\r\n line: {\r\n color: 'red',\r\n width: 2\r\n }\r\n }],\r\n};\r\n\r\n Plotly.newPlot(\"plot\", data, layout);\r\n Plotly.newPlot(\"plot2\", data2, layout2);\r\n});\r\n}", "function drawData() {\n var calcdata = gd.calcdata,\n i,\n rangesliderContainers = fullLayout._infolayer.selectAll('g.rangeslider-container');\n\n // in case of traces that were heatmaps or contour maps\n // previously, remove them and their colorbars explicitly\n for(i = 0; i < calcdata.length; i++) {\n var trace = calcdata[i][0].trace,\n isVisible = (trace.visible === true),\n uid = trace.uid;\n\n if(!isVisible || !Registry.traceIs(trace, '2dMap')) {\n var query = (\n '.hm' + uid +\n ',.contour' + uid +\n ',#clip' + uid\n );\n\n fullLayout._paper\n .selectAll(query)\n .remove();\n\n rangesliderContainers\n .selectAll(query)\n .remove();\n }\n\n if(!isVisible || !trace._module.colorbar) {\n fullLayout._infolayer.selectAll('.cb' + uid).remove();\n }\n }\n\n // loop over the base plot modules present on graph\n var basePlotModules = fullLayout._basePlotModules;\n for(i = 0; i < basePlotModules.length; i++) {\n basePlotModules[i].plot(gd);\n }\n\n // keep reference to shape layers in subplots\n var layerSubplot = fullLayout._paper.selectAll('.layer-subplot');\n fullLayout._shapeSubplotLayers = layerSubplot.selectAll('.shapelayer');\n\n // styling separate from drawing\n Plots.style(gd);\n\n // show annotations and shapes\n Registry.getComponentMethod('shapes', 'draw')(gd);\n Registry.getComponentMethod('annotations', 'draw')(gd);\n\n // source links\n Plots.addLinks(gd);\n\n // Mark the first render as complete\n fullLayout._replotting = false;\n\n return Plots.previousPromises(gd);\n }", "function drawData() {\n var calcdata = gd.calcdata,\n i,\n rangesliderContainers = fullLayout._infolayer.selectAll('g.rangeslider-container');\n\n // in case of traces that were heatmaps or contour maps\n // previously, remove them and their colorbars explicitly\n for(i = 0; i < calcdata.length; i++) {\n var trace = calcdata[i][0].trace,\n isVisible = (trace.visible === true),\n uid = trace.uid;\n\n if(!isVisible || !Registry.traceIs(trace, '2dMap')) {\n var query = (\n '.hm' + uid +\n ',.contour' + uid +\n ',#clip' + uid\n );\n\n fullLayout._paper\n .selectAll(query)\n .remove();\n\n rangesliderContainers\n .selectAll(query)\n .remove();\n }\n\n if(!isVisible || !trace._module.colorbar) {\n fullLayout._infolayer.selectAll('.cb' + uid).remove();\n }\n }\n\n // loop over the base plot modules present on graph\n var basePlotModules = fullLayout._basePlotModules;\n for(i = 0; i < basePlotModules.length; i++) {\n basePlotModules[i].plot(gd);\n }\n\n // keep reference to shape layers in subplots\n var layerSubplot = fullLayout._paper.selectAll('.layer-subplot');\n fullLayout._shapeSubplotLayers = layerSubplot.selectAll('.shapelayer');\n\n // styling separate from drawing\n Plots.style(gd);\n\n // show annotations and shapes\n Registry.getComponentMethod('shapes', 'draw')(gd);\n Registry.getComponentMethod('annotations', 'draw')(gd);\n\n // source links\n Plots.addLinks(gd);\n\n // Mark the first render as complete\n fullLayout._replotting = false;\n\n return Plots.previousPromises(gd);\n }", "renderMultGraph() {\n let send_data = [];\n for (let i = 0; i < this.props.data.length; i++) {\n if (this.state.clicked[i.toString()]) {\n send_data.push(this.props.data[i])\n }\n }\n fetch(\"/render-graph\", {\n method: \"POST\",\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({'data': send_data})\n }).then((res) => {\n res\n .json()\n .then((j) => {\n //$(\"#bokeh-plot\").html(j['div']);\n this.setState({bokeh_plot_id: j['id']})\n $(\"#for-script\").html(j['script'])\n })\n })\n }", "function hidePlot() {\r\n $(\"#plot\").hide();\r\n}", "plot(){\n /* plot the X and Y axis of the graph */\n super.plotXAxis();\n super.plotYAxis();\n\n /* (re)draw the points, grouped in a single graphics element */\n let canvas = d3.select('svg#canvas_bioActivity > g#graph');\n canvas.selectAll('#points').remove();\n canvas.append('g')\n .attr('id', 'points')\n .attr('transform', 'translate('+this._margin.left+', 0)')\n ;\n /* Each data point will be d3 symbol (represented using svg paths) */\n let pts = d3.select('#points').selectAll('g')\n .data(this._data)\n /* each point belongs to the 'data-point' class its positioned in the graph\n * according to the associated (x,y) coordinates and its drawn using its\n * color and shape */\n let point = pts.enter().append('path')\n .attr('class', 'data-point')\n .attr('transform', d => 'translate('+d.x+' '+d.y+')')\n .attr('fill', d => d.color )\n .attr('d', function(d){\n let s = ['Circle','Cross','Diamond','Square','Star','Triangle','Wye']\n let symbol = d3.symbol()\n .size(50)\n .type(d3.symbols[s.indexOf(d.shape)])\n ;\n return symbol();\n })\n ;\n /* each point will also have an associated svg title (tooltip) */\n point.append('svg:title')\n .text((d) => {\n return 'Organism: '+d['Organism Name']+\n '\\nGene: '+d['Gene Symbol']+\n '\\nConcentation: '+d['Activity Concentration']+'nM';\n })\n ;\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 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 addPlotFrame(plotTemplate, increment) {\n\n if (map == null) {\n alert(mapNotReady);\n return;\n }\n\n if (map.graphics == null) {\n alert(mapNotReady);\n return;\n }\n\n if (plotTemplate == \"\") {\n clearPlots();\n return;\n }\n\n\n\n var plotWidthMeters;\n var plotHeightMeters;\n\n // read plot definitions from array submitted by server\n for (var i in templateDimension) {\n var tInfo = templateDimension[i].split(\"|\");\n if (tInfo[0] == plotTemplate) {\n var plotWidthCentimeter = tInfo[1];\n plotWidthMeters = convertCentimetersToMeters(plotWidthCentimeter);\n var plotHeightCentimeter = tInfo[2];\n plotHeightMeters = convertCentimetersToMeters(plotHeightCentimeter);\n\n var polygonLimit = tInfo[3];\n var polygonCount = getDatashopPolyCount();\n if (polygonCount < polygonLimit) {\n polygonCenter = null;\n } else {\n showMessage(\"Your limit of plots has been reached.\");\n isMaxPolygon = true;\n return;\n }\n }\n }\n //get the center point of the map\n var mapDiv = document.getElementById(divMapId);\n var cenPixel = getDivCenter(mapDiv);\n var mapCenter = map.toMap(cenPixel);\n\n //get the polygon offset distances from the center point\n var offX = (plotWidthMeters) / 2;\n var offY = (plotHeightMeters) / 2;\n\n var polygonMap = new esri.geometry.Polygon();\n polygonMap.spatialReference = map.spatialReference;\n\n var anchorX = mapCenter.x - offX;\n var anchorY = mapCenter.y - offY;\n polygonMap.addRing([[anchorX, anchorY], [mapCenter.x - offX, mapCenter.y + offY], [mapCenter.x + offX, mapCenter.y + offY], [mapCenter.x + offX, mapCenter.y - offY], [mapCenter.x - offX, mapCenter.y - offY]]);\n\n var datashopPolygon = new DatashopPolygon(polygonMap);\n datashopPolygon.plotTemplate = plotTemplate;\n\n if (increment == true && getDatashopPolyCount() > 0) {\n frameNumber++;\n }\n\n datashopPolygon.id = frameNumber;\n\n datashopPolygon.centerAt(polygonCenter);\n\n //scale the polygon\n datashopPolygon.scale(plotScale);\n\n //rotate the polygon\n datashopPolygon.rotate(polygonAngle, datashopPolygon.getCenterPoint());\n\n // create text symbol\n var textSymbol = new esri.symbol.TextSymbol(datashopPolygon.id);\n textSymbol.setColor(new dojo.Color([0, 255, 0]));\n textSymbol.setAlign(esri.symbol.TextSymbol.ALIGN_MIDDLE);\n textSymbol.setFont(simpleTextFont);\n\n // create a text graphic for this datashop polygon\n datashopPolygon.textGraphic = new esri.Graphic(new esri.geometry.Point(0, 0, map.spatialReference), textSymbol);\n\n if (polygonGraphic != null && getDatashopPolyCount() > 0) {\n setDefaultSymbology(polygonGraphic);\n }\n polygonGraphic = new esri.Graphic(datashopPolygon, simpleFillSymbol);\n map.graphics.add(polygonGraphic);\n\n setActiveSymbology(polygonGraphic);\n\n // update the position of the text\n updateActivePolygonText(datashopPolygon);\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 plotChart(uberPrice,lyftPrice, uberPool, uberX, uberXL, black,\n\t\t\t\t\tlyft_line, lyft, lyft_plus, lyft_lux) {\n\tconsole.log(\"--jiayi----------\")\n\tconsole.log(uberPool, uberX, uberXL, black,\n\t\t\t\t\tlyft_line, lyft, lyft_plus, lyft_lux)\n\tdocument.getElementById('uberPool').value = uberPool;\n document.getElementById('uberX').value = uberX;\n document.getElementById('uberXL').value = uberXL;\n document.getElementById('black').value = black;\n document.getElementById('uberlower').value = Math.min(uberPool, uberX, uberXL, black);\n\n document.getElementById('lyft_line').value = lyft_line;\n document.getElementById('lyft').value = lyft;\n document.getElementById('lyft_plus').value = lyft_plus;\n document.getElementById('lyft_lux').value = lyft_lux;\n document.getElementById('lyftlower').value = Math.min(lyft_line, lyft, lyft_plus, lyft_lux);\n\n// $('#tripmap').show();\n//\t$('#rateChart').show();\n}", "render(){\n const renderLineChart = this.state.plottedData ? createNewLine(this.state.plotData) : createNewLine(this.state.currData)\n // before wwe render; we gott amake sure plotData is in correct format\n\n\n return (\n <div>\n {\n renderLineChart\n }\n </div>\n )\n }", "function setNewPosition() {\n\n // kill old charts\n agreePollChartClass.destroy();\n indexCsiChartPersentClass.destroy();\n managerChartClass.destroy();\n alertStatisticChartClass.destroy();\n var chartArr = [\n $('#agree-poll-chart-canvas'),\n // $('#alert-statistic-chart-canvas')\n ];\n\n chartArr.forEach(function (item) {\n var id = $(item).attr('id');\n var parent = $(item).parent();\n $(item).remove();\n $(parent).append('<canvas id=\"' + id + '\"><canvas>');\n });\n\n // set width and height\n setSize();\n\n // generate chart\n generateCharts();\n\n\n agreePollChartClass.update();\n indexCsiChartPersentClass.update();\n managerChartClass.update();\n alertStatisticChartClass.update();\n} // set new width and height for charts", "function update_scatter_plot() {\n if (selected_indices_set.size > 0) {\n // clear all traces\n traces_for_modified_plot = [];\n edges_plotted = false;\n reset_data_dict_per_category(dict_per_category);\n let plot_layout_orig = get_plot_layout_orig();\n // add edges\n if (toggle_point_edges_button.is(':checked')) {\n trace_for_edges_template[\"x\"] = [];\n trace_for_edges_template[\"y\"] = [];\n // trace_for_edges_template[\"marker\"][\"line\"][\"width\"] = [];\n for (let term_name of selected_indices_set) {\n edges = term_2_edges_dict_json[term_name];\n category_name = term_2_category_dict[term_name];\n dict_of_category = dict_per_category[category_name];\n index_position = term_2_positionInArr_dict[term_name];\n try {\n dict_of_category[\"opacity\"][index_position] = opacity_highlight;\n } catch {\n console.log(\"type error for \", term_name, category_name, index_position);\n }\n // if edges exists\n if (typeof edges !== \"undefined\") {\n trace_for_edges_template[\"x\"] = trace_for_edges_template[\"x\"].concat(edges[\"X_points\"]);\n trace_for_edges_template[\"y\"] = trace_for_edges_template[\"y\"].concat(edges[\"Y_points\"]);\n // trace_for_edges_template[\"marker\"][\"line\"][\"width\"] = trace_for_edges_template[\"marker\"][\"line\"][\"width\"].concat(edges[\"Weights\"]);\n let i=0;\n while (edges[\"Nodes\"].length > i) {\n edge_name = edges[\"Nodes\"][i];\n index_position = term_2_positionInArr_dict[edge_name];\n dict_of_category[\"opacity\"][index_position] = opacity_highlight;\n i++;\n }\n\n } else {\n // pass if no edges\n }\n }\n\n if (trace_for_edges_template[\"x\"].length > 0) {\n edges_plotted = true;\n traces_for_modified_plot.push(trace_for_edges_template)\n } else {\n // edges ON but empty (no edges available)\n }\n\n } else {\n // edges OFF, pass\n // reset to default values\n for (let category_name in dict_per_category) {\n dict_of_category = dict_per_category[category_name];\n num_vals = dict_of_category[\"logFDR\"].length;\n dict_of_category[\"opacity\"] = Array(num_vals).fill(opacity_default);\n }\n }\n\n if (toggle_point_labels_button.is(':checked')) {\n // plot_layout_orig[\"xaxis\"][\"range\"] = x_range_with_labels;\n // plot_layout_orig[\"yaxis\"][\"range\"] = y_range_with_labels;\n for (let term_name of selected_indices_set) {\n category_name = term_2_category_dict[term_name];\n dict_of_category = dict_per_category[category_name];\n num_vals = dict_of_category[\"logFDR\"].length;\n index_position = term_2_positionInArr_dict[term_name];\n dict_of_category[\"text_label\"][index_position] = term_name;\n dict_of_category[\"marker_line_color\"][index_position] = marker_line_color_highlight;\n dict_of_category[\"marker_line_width\"][index_position] = marker_line_width_highlight;\n dict_of_category[\"opacity\"][index_position] = opacity_highlight;\n }\n } else {\n // reset labels, but highlight with less opacity and line around point\n for (let term_name of selected_indices_set) {\n category_name = term_2_category_dict[term_name];\n dict_of_category = dict_per_category[category_name];\n index_position = term_2_positionInArr_dict[term_name];\n dict_of_category[\"marker_line_color\"][index_position] = marker_line_color_highlight;\n dict_of_category[\"marker_line_width\"][index_position] = marker_line_width_highlight;\n dict_of_category[\"opacity\"][index_position] = opacity_highlight;\n }\n // plot_layout_orig[\"xaxis\"][\"range\"] = [];\n // plot_layout_orig[\"yaxis\"][\"range\"] = [];\n }\n\n for (let category_name in dict_per_category) {\n dict_of_category = dict_per_category[category_name];\n trace_temp = get_individual_trace(category_name, dict_of_category)\n traces_for_modified_plot.push(trace_temp);\n }\n Plotly.newPlot('plotly_scatter_plot', traces_for_modified_plot, plot_layout_orig, plot_config);\n } else {\n redraw_original_plot();\n }\n // let myPlot = document.getElementById(\"plotly_scatter_plot\");\n }", "renderChartType(dataset){\n\n if(this.state.chartType == \"line\"){\n return(\n <Line\n data={dataset}\n\n />\n );\n }\n else if(this.state.chartType == \"bar\"){\n return(\n <Bar\n data={dataset}\n\n />\n );\n }\n else if(this.state.chartType == \"polar\"){\n return(\n <Polar\n data={dataset}\n\n />\n );\n }\n else if(this.state.chartType == \"radar\"){\n return(\n <Radar\n data={dataset}\n\n />\n );\n }\n else if(this.state.chartType == \"doughnut\"){\n return(\n <Doughnut\n data={dataset}\n\n />\n );\n }\n else if(this.state.chartType == \"scatter\"){\n return(\n <Scatter\n data={dataset}\n\n />\n );\n }\n else if(this.state.chartType == \"bubble\"){\n return(\n <Bubble\n data={dataset}\n\n />\n );\n }\n else if(this.state.chartType == \"pie\"){\n return(\n <Pie\n data={dataset}\n\n />\n );\n }\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 showFigure() {\n\t\t\t\tdocument.getElementById(\"figures\").style.display = \"block\";\n\t\t\t\tchangeColor();\n\t\t\t\tchangeSize();\n\t\t\t\tchangeShape();\n\t\t\t\tchangePosition();\n\t\t\t\tfigureTime = (new Date());\n\t\t\t\t\n\t\t\t}", "function createPlot(target, data, options){\n return $.jqplot (target, data, options);\n}", "function simplePlot(status) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Functie genaamd \"simplePlot\" zorgt ervoor dat de simpePlot wel of niet getoond worden waar het hoort.\n\t\t\t\tvar simplePlot = document.querySelectorAll(\".simplePlot\"); \t\t\t\t\t\t// Pak alle elementen met de class simplePlot en zet deze in variabele\n\n\t\t\t\tfor (i = 0; i < simplePlot.length; i++) {\t\t\t\t\t\t\t\t\t\t// For loop gaat alle .simplePlot in de index.html langs\n\t\t\t\t\tif(status === \"add\") {\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Als het getoond moet worden moet de parameter 'status' gelijk zijn aan 'add'\n\t\t\t\t\t\tsimplePlot[i].classList.add(\"active\");\t\t\t\t\t\t\t\t\t// Geef ze CSS class active mee\n\t\t\t\t\t}\n\t\t\t\t\telse if(status === \"remove\") {\t\t\t\t\t\t\t\t\t\t\t\t// Als het niet getoond moet worden moet de parameter 'status' gelijk zijn aan 'remove'\n\t\t\t\t\t\tsimplePlot[i].classList.remove(\"active\");\t\t\t\t\t\t\t\t// Verwijder de CSS class active\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "getMutationPlots() {\n const plots = super.getMutationPlots();\n return plots.filter((idx) => {\n const plot = App.game.farming.plotList[idx];\n return this.plotFitRequirements(plot, idx);\n });\n }", "function nautilus_plot(div, index, mat, options) {\n\n // div : id of the div to plot, '#div_name'\n // index : id of the element to focus on, 'element_id'\n // mat : matrix of values, basically list of arrays with this similar structure as:\n // [{{index: 'a'}, {values: {b: 5}, {c: 3}, ...}}, {}, ...]\n // options : collection of parameters for configuration\n\n // initial options\n var cfg = {\n width: Math.min(1600, window.innerWidth - 20),\n height: Math.min(900, window.innerHeight - 10),\n margin: {top: 50, left: 50, right: 50, bottom: 50},\n inner_circle_radius: 20,\n outer_circle_radius: 2,\n ray_stroke_width: 2,\n center_position_x: 1/2,\n center_position_y: 1/2,\n center_title_height: 34,\n number_max_to_show: 30,\n select_scale: 10,\n number_format: '.2f',\n chart_color: 'black',\n text_color_blank: 'rgba(0, 0, 0, 0)',\n text_color: 'rgba(0, 0, 0, 1)',\n select_color: 'rgba(230, 0, 0, 1)',\n right_table_index: '#legend_container',\n right_table_cols: ['value', 'index'],\n left_table_index: '#control_container',\n tooltip_offset_x: 0,\n tooltip_offset_y: 550\n };\n\n // put all of the options into a variable called cfg\n\tif('undefined' !== typeof options){\n\t for(var p in options){\n\t\tif('undefined' !== typeof options[p]){ cfg[p] = options[p]; }\n\t }\n\t}\n\n\t// svg\n\tvar svg = d3.select(div).append('svg')\n .attr('width', cfg.width)\n .attr('height', cfg.height);\n\n // div for tooltip\n var tooltip_div = d3.select(div).append('div')\n .attr('class', 'tooltip')\n .style('opacity', 0);\n\n // select data\n var data = get_data(mat, index, cfg, cfg.number_max_to_show);\n\n // color\n var max_value = get_max_value(mat, 'value')\n var color = d3.scaleSequential(d3.interpolateRdYlGn)\n .domain([max_value, 0]);\n\n // center\n var center = svg.append('g')\n .datum(index)\n .attr('class', 'center')\n .on('mouseover', function(d) {\n tooltip_div.transition()\n .duration(0)\n .style('opacity', 1);\n tooltip_div.html('<b>' + d3.selectAll('.center').datum() + '</b> ')\n .style('left', cfg.tooltip_offset_x + 'px')\n .style('top', cfg.tooltip_offset_y + 'px');\n d3.select(this).style('cursor', 'pointer');})\n .on('mouseout', function(d) {\n tooltip_div.transition()\n .duration(500)\n .style('opacity', 0);\n d3.select(this).style('cursor', 'default');})\n .on('click', function(d) {\n console.log(d);\n retract(cfg);});\n // center circle\n center.append('circle')\n .attr('cx', cfg.width * cfg.center_position_x)\n .attr('cy', cfg.height * cfg.center_position_y)\n .attr('r', cfg.inner_circle_radius);\n // center title\n center.append('text')\n .attr('x', cfg.width * cfg.center_position_x)\n .attr('y', cfg.center_title_height)\n .style('font-size', function(d) {return cfg.center_title_height + 'px';})\n .style('fill', cfg.text_color)\n .style(\"text-anchor\", \"middle\")\n .text(function(d) { return d;});\n // shell\n var ray = svg.selectAll('.ray')\n .data(data)\n .enter().append('g')\n .attr('class', 'ray');\n // shell rays links\n ray.append('line')\n .attr('x1', function(d) { return d.x1_start;})\n .attr('x2', function(d) { return d.x1_start;})\n .attr('y1', function(d) { return d.y1_start;})\n .attr('y2', function(d) { return d.y1_start;})\n .style('stroke-width', cfg.ray_stroke_width)\n .style('stroke', function(d) { return color(d.value); })\n .on('mouseover', on_mouseover)\n .on('mousemove', on_mousemove)\n .on('mouseout', on_mouseout)\n .on('click', function(d) {\n console.log(d);\n var number_max_to_show = d3.select('#input_box')\n .property('value');\n redraw(mat, d.index, cfg, number_max_to_show);\n });\n // shell ray circles\n ray.append('circle')\n .attr('cx', function(d) { return d.x1_start;})\n .attr('cy', function(d) { return d.y1_start;})\n .attr('r', 0)\n .style('fill', cfg.chart_color)\n .on('mouseover', on_mouseover)\n .on('mousemove', on_mousemove)\n .on('mouseout', on_mouseout)\n .on('click', function(d) {\n console.log(d);\n var number_max_to_show = d3.select('#input_box')\n .property('value');\n redraw(mat, d.index, cfg, number_max_to_show);\n });\n\n // simulation\n ray.selectAll('line').transition('starting')\n .duration(2000)\n .attr('x1', function(d) { return d.x1;})\n .attr('y1', function(d) { return d.y1;})\n .attr('x2', function(d) { return d.x2;})\n .attr('y2', function(d) { return d.y2;})\n ray.selectAll('circle').transition('starting')\n .duration(2000)\n .attr('cx', function(d) { return d.x2;})\n .attr('cy', function(d) { return d.y2;})\n .attr('r', cfg.outer_circle_radius);\n\n // left table - controls\n var left_table_control = create_control(cfg.left_table_index, mat, cfg, index);\n // left table - explanations\n var left_table_explanation = create_explanation(cfg.left_table_index);\n\n // right table - legend\n var right_table = tabulate(cfg.right_table_index, data, cfg.right_table_cols, cfg.number_format, cfg.width);\n\n //\n // local functions\n //\n\n function get_value(data, value) {\n return data.map(d => d.value)\n }\n\n function get_max_value(data, value) {\n var index_name = Object.keys(data);\n var arr_max = [];\n for (k = 0; k < index_name.length; ++k) {\n\n var arr = data[index_name[k]];\n var arr_value = get_value(arr, value)\n arr_max.push(Math.max(...arr_value))\n\n };\n return Math.max(...arr_max);\n }\n\n // mouse\n function on_mouseover(element) {\n\n d3.select('svg').selectAll('line')\n .select( function(d) { return d===element?this:null;})\n .style('stroke', cfg.select_color)\n d3.select('svg').selectAll('circle')\n .select( function(d) { return d===element?this:null;})\n .style('fill', cfg.select_color)\n .attr(\"r\", function(d) { return cfg.outer_circle_radius * cfg.select_scale; });\n d3.select(cfg.right_table_index).select('table').select('tbody').selectAll('tr')\n .select( function(d) { return d===element?this:null;})\n .style('color', cfg.select_color);\n\n tooltip_div.transition()\n .duration(0)\n .style('opacity', 1);\n tooltip_div.html(d3.selectAll('.center').datum() + ' --| <b>' + d3.format(cfg.number_format)(element.value) + '</b> |-- ' + element.index)\n .style('left', cfg.tooltip_offset_x + 'px')\n .style('top', cfg.tooltip_offset_y + 'px');\n\n d3.select(this).style('cursor', 'pointer');\n };\n function on_mousemove(element) {\n\n d3.select('svg').selectAll('line')\n .select( function(d) { return d===element?this:null;})\n .style('stroke', cfg.select_color)\n d3.select('svg').selectAll('circle')\n .select( function(d) { return d===element?this:null;})\n .style('fill', cfg.select_color)\n d3.select(cfg.right_table_index).select('table').select('tbody').selectAll('tr')\n .select( function(d) { return d===element?this:null;})\n .style('color', cfg.select_color);\n\n d3.select(this).style('cursor', 'pointer');\n };\n function on_mouseout(element) {\n\n d3.select('svg').selectAll('line')\n .select( function(d) { return d===element?this:null;})\n .transition('hide')\n .duration(200)\n .style('stroke', function(d) { return color(d.value); })\n d3.select('svg').selectAll('circle')\n .select( function(d) { return d===element?this:null;})\n .transition('hide')\n .duration(200)\n .style('fill', cfg.chart_color)\n .attr(\"r\", function(d) { return cfg.outer_circle_radius; });\n d3.select(cfg.right_table_index).select('table').select('tbody').selectAll('tr')\n .select( function(d) { return d===element?this:null;})\n .transition('hide')\n .duration(200)\n .style('color', cfg.text_color);\n\n tooltip_div.transition()\n .duration(500)\n .style('opacity', 0);\n\n d3.select(this).style('cursor', 'default');\n };\n\n // Thanks to http://bl.ocks.org/phil-pedruco/7557092 for the table code\n function tabulate(id, data, columns, number_format = '.2f', table_width) {\n\n var table = d3.select(id)\n .append('table')\n .attr('width', table_width),\n thead = table.append('thead'),\n tbody = table.append('tbody'),\n format = d3.format(number_format);\n\n // append the header row\n thead.append('tr')\n .selectAll('th')\n .data(columns)\n .enter()\n .append('th')\n .text(function(column) { return column;});\n\n // create a row for each object in the data\n var rows = tbody.selectAll('tr')\n .data(data)\n .enter()\n .append('tr')\n .on('click', function (d) {\n console.log(d);\n var number_max_to_show = d3.select('#input_box')\n .property('value');\n redraw(mat, d.index, cfg, number_max_to_show);\n })\n .on('mouseover', on_mouseover)\n .on('mousemove', on_mousemove)\n .on('mouseout', on_mouseout);\n\n // create a cell in each row for each column\n var cells = rows.selectAll('td')\n .data(function(row) {\n return columns.map(function(column) {\n return {column: column, value: row[column]};\n });\n })\n .enter()\n .append('td')\n .html(function(d) {\n if (isNaN(d.value)) {\n return d.value;\n } else {\n return '<b>' + format(d.value) + '</b>';\n };\n });\n\n return table;\n };\n\n // get data\n function get_data(mat, index, cfg, n) {\n // select data\n var data = mat[index];\n // sort by value\n data.sort(function (a, b) {\n return a.value - b.value;\n });\n // filter number max\n var data = get_first_n(data, n);\n\n // scales\n var max_value = data[data.length - 1].value;\n var scale = d3.scaleLinear()\n .domain([0, max_value])\n .range([0, (cfg.height / 2) - 2 * cfg.outer_circle_radius - cfg.inner_circle_radius - cfg.margin.top]);\n // add x and y position for nodes, depending on inner circle radius\n for (i = 0; i < data.length; ++i) {\n angle = (i / data.length) * 2 * Math.PI // 2*PI for complete circle\n starting_angle = angle - Math.PI / 2\n data[i]['x1_start'] = (cfg.inner_circle_radius) * Math.cos(starting_angle) + (cfg.width * cfg.center_position_x)\n data[i]['y1_start'] = (cfg.inner_circle_radius) * Math.sin(starting_angle) + (cfg.height * cfg.center_position_y)\n data[i]['x1'] = (cfg.inner_circle_radius) * Math.cos(angle) + (cfg.width * cfg.center_position_x)\n data[i]['y1'] = (cfg.inner_circle_radius) * Math.sin(angle) + (cfg.height * cfg.center_position_y)\n data[i]['x2'] = (scale(data[i].value) + cfg.inner_circle_radius) * Math.cos(angle) + (cfg.width * cfg.center_position_x)\n data[i]['y2'] = (scale(data[i].value) + cfg.inner_circle_radius) * Math.sin(angle) + (cfg.height * cfg.center_position_y)\n }\n return data;\n };\n\n // get first n data\n function get_first_n(obj, n) {\n return Object.keys(obj) // get the keys out\n .slice(0, n) // get the first N\n .reduce(function(memo, current) { // generate a new object out of them\n memo[current] = obj[current]\n return memo;\n }, [])\n };\n\n // redraw chart and table\n function redraw(mat, index, cfg, n) {\n\n var format = d3.format(cfg.number_format),\n new_data = get_data(mat, index, cfg, n),\n right_table = d3.select(cfg.right_table_index).select('tbody').selectAll('tr')\n .data(new_data),\n svg = d3.selectAll('svg'),\n new_center = svg.selectAll('.center')\n .datum(index),\n new_ray = svg.selectAll('.ray')\n .data(new_data);\n\n // enter\n var new_ray_enter = new_ray.enter().append('g')\n .attr('class', 'ray');\n new_ray_enter.append('line')\n .attr('x1', function(d) { return d.x1_start;})\n .attr('x2', function(d) { return d.x1_start;})\n .attr('y1', function(d) { return d.y1_start;})\n .attr('y2', function(d) { return d.y1_start;})\n .style(\"stroke-width\", cfg.ray_stroke_width)\n .style(\"stroke\", function(d) { return color(d.value); })\n .on('mouseover', on_mouseover)\n .on('mousemove', on_mousemove)\n .on('mouseout', on_mouseout)\n .on('click', function(d) {\n console.log(d);\n var number_max_to_show = d3.select('#input_box')\n .property('value');\n redraw(mat, d.index, cfg, number_max_to_show);\n });\n new_ray_enter.append('circle')\n .attr('cx', function(d) { return d.x1_start;})\n .attr('cy', function(d) { return d.y1_start;})\n .attr('r', 0)\n .style('fill', cfg.chart_color)\n .on('mouseover', on_mouseover)\n .on('mousemove', on_mousemove)\n .on('mouseout', on_mouseout)\n .on('click', function(d) {\n console.log(d);\n var number_max_to_show = d3.select('#input_box')\n .property('value');\n redraw(mat, d.index, cfg, number_max_to_show);\n });\n var right_table_enter = right_table.enter().append('tr')\n .on('click', function (d) {\n console.log(d);\n var number_max_to_show = d3.select('#input_box')\n .property('value');\n redraw(mat, d.index, cfg, number_max_to_show);\n })\n .on('mouseover', on_mouseover)\n .on('mousemove', on_mousemove)\n .on('mouseout', on_mouseout);\n\n var new_cell = right_table_enter.selectAll('td')\n .data(function(row) {\n return cfg.right_table_cols.map(function(column) {\n return {column: column, value: row[column]};\n });\n })\n .enter()\n .append('td')\n .style('opacity', 0)\n .html(function(d) {\n if (isNaN(d.value)) {\n return d.value;\n } else {\n return '<b>' + format(d.value) + '</b>';\n };\n });\n\n // exit\n new_ray.exit().selectAll('line').transition('ending')\n .duration(1000)\n .attr('x1', function(d) { return d.x1_start;})\n .attr('x2', function(d) { return d.x1_start;})\n .attr('y1', function(d) { return d.y1_start;})\n .attr('y2', function(d) { return d.y1_start;});\n new_ray.exit().selectAll('circle').transition('ending')\n .duration(1000)\n .attr('cx', function(d) { return d.x1_start;})\n .attr('cy', function(d) { return d.y1_start;})\n .attr('r', 0);\n new_ray.exit().transition().duration(1000).remove();\n right_table.exit().transition('ending')\n .duration(1000)\n .style('opacity', 0)\n .remove();\n\n // update\n new_center.select('text').transition('ending')\n .duration(1000)\n .style('opacity', 0)\n .transition('redrawing')\n .duration(2000)\n .text(function(d) {return d;})\n .style('opacity', 1);\n var new_ray = svg.selectAll('.ray'); // reselect to update all\n new_ray.select('line').transition('ending')\n .duration(1000)\n .attr('x1', function(d) { return d.x1_start;})\n .attr('x2', function(d) { return d.x1_start;})\n .attr('y1', function(d) { return d.y1_start;})\n .attr('y2', function(d) { return d.y1_start;})\n .transition('redrawing')\n .duration(2000)\n .attr('x1', function(d) { return d.x1;})\n .attr('y1', function(d) { return d.y1;})\n .attr('x2', function(d) { return d.x2;})\n .attr('y2', function(d) { return d.y2;})\n .style('stroke', function(d) { return color(d.value); });\n new_ray.select('circle').transition('ending')\n .duration(1000)\n .attr('cx', function(d) { return d.x1_start;})\n .attr('cy', function(d) { return d.y1_start;})\n .attr('r', 0)\n .transition('redrawing')\n .duration(2000)\n .attr('cx', function(d) { return d.x2;})\n .attr('cy', function(d) { return d.y2;})\n .attr('r', cfg.outer_circle_radius);\n\n var right_table = d3.select(cfg.right_table_index).select('tbody').selectAll('tr');\n right_table.selectAll('td')\n .data(function(row) {\n return cfg.right_table_cols.map(function(column) {\n return {column: column, value: row[column]};\n });\n })\n .transition('ending')\n .duration(1000)\n .style('opacity', 0)\n .on('end', function() {\n d3.select(this)\n .html(function(d) {\n if (isNaN(d.value)) {\n return d.value;\n } else {\n return '<b>' + format(d.value) + '</b>';\n };\n })\n .transition('redrawing')\n .duration(2000)\n .style('opacity', 1);\n });\n d3.select('#dropdown_menu')\n .property('value', index)\n };\n\n // retract\n var retracted = false;\n function retract(cfg) {\n\n var svg = d3.selectAll('svg');\n var ray = svg.selectAll('.ray');\n\n if (retracted) {\n // open\n ray.select('line').transition('redrawing')\n .duration(2000)\n .attr('x1', function(d) { return d.x1;})\n .attr('y1', function(d) { return d.y1;})\n .attr('x2', function(d) { return d.x2;})\n .attr('y2', function(d) { return d.y2;});\n ray.select('circle').transition('redrawing')\n .duration(2000)\n .attr('cx', function(d) { return d.x2;})\n .attr('cy', function(d) { return d.y2;})\n .attr('r', cfg.outer_circle_radius);\n retracted = false;\n } else {\n // retract\n ray.select('line').transition('ending')\n .duration(1000)\n .attr('x1', function(d) { return d.x1_start;})\n .attr('x2', function(d) { return d.x1_start;})\n .attr('y1', function(d) { return d.y1_start;})\n .attr('y2', function(d) { return d.y1_start;});\n ray.select('circle').transition('ending')\n .duration(1000)\n .attr('cx', function(d) { return d.x1_start;})\n .attr('cy', function(d) { return d.y1_start;})\n .attr('r', 0);\n retracted = true;\n }\n };\n\n function create_explanation(div) {\n\n var explanation_div = d3.select(div).append('div')\n .attr('class', 'explanation_div');\n\n explanation_div\n .attr('id', 'explanation')\n .html('This circular chart represents a distance matrix from a single element perspective.' +\n 'The weights linking the chosen element and its <i>N</i> closest neighbours are sorted from ' +\n 'smallest to largest distances, and are then dispatched in a circle around the center, thus ' +\n 'forming naturally a nautilus shell shape. <br><br>' +\n 'To explore the landscape further:<br>' + '<ul type=\"square\">' +\n '<li>Click on any neighbour nodes to focus it. </li>' +\n '<li>Navigate using drop down menu to focus on a specific element. </li>' +\n '<li>Change the number <i>N</i> to increase or decrease the maximum number of closest neighbours represented on the chart.</li></ul>')\n }\n\n function create_control(div, data, cfg, index) {\n\n var control_div = d3.select(div).append('div');\n\n var values = Object.keys(data).sort()\n\n // drop down\n control_div\n .append('div')\n .attr('class', 'control_div')\n .append('select')\n .attr('id', 'dropdown_menu')\n .on('mouseover', function() { d3.select(this).style('cursor', 'pointer');})\n .on('mousemove', function() { d3.select(this).style('cursor', 'pointer');})\n .on('mouseout', function() { d3.select(this).style('cursor', 'default');})\n .selectAll('option')\n .data(values)\n .enter()\n .append('option')\n .attr('value', function(d) {\n return d;\n })\n .text(function(d) {\n return d;\n });\n d3.select('#dropdown_menu')\n .property('value', index);\n // input box\n control_div\n .append('div')\n .attr('class', 'control_div')\n .append('input')\n .attr('id', 'input_box')\n .attr('type', 'number')\n .attr('value', cfg.number_max_to_show)\n .attr('min', 1)\n .attr('max', values.length);\n // redraw\n control_div\n .on('change', function() {\n var selected_value = d3.select(this)\n .select('select')\n .property('value');\n var number_max_to_show = d3.select('#input_box')\n .property('value');\n console.log(selected_value);\n console.log(number_max_to_show);\n redraw(mat, selected_value, cfg, number_max_to_show);\n });\n };\n}", "renderGlobalScale() {\n\n // Initialising local variables\n var barHeight = this.parent.opt.barHeight;\n var labelWidth = this.parent.opt.labelWidth;\n var plotContainerId = this.parent.plotContainer;\n var offset = this.parent.opt.headerOffset;\n var data = this.parent.data;\n var self = this; // Saving this object in self for property method calling withing functions \n var optionsHeight = $(`#bar_expression_viewer_options`).height();\n\n opt.width = $(document).width() - labelWidth;\n opt.height = window.innerHeight;\n opt.side = opt.width;\n\n\n // Remove footer\n $(`#${this.parent.chartSVGidFoot}`).css('display', 'none');\n\n // Fix the position of the div conatainer of the ternary plot\n plotContainer = d3.select('#' + this.selector);\n\n // Set the svg height and width\t\n svg = plotContainer.append('g')\n .attr('id', 'ternaryPlotSVG')\n .attr(\"width\", $(document).width())\n .attr(\"height\", $('#' + this.selector).height())\n .attr(`transform`, `translate(${labelWidth},${-20})`)\n .style('font-family', this.parent.opt.fontFamily);\n\n\n if (typeof data.expression_bias !== 'undefined') {\n this._drawBlockDivisions();\n }\n\n // Adding a group for the ternary plot structure\n ternaryPlotGroup = svg.append('g')\n .attr('id', 'ternaryPlotGroup');\n\n // Add a sub group for the axes\n axes = ternaryPlotGroup.append('g');\n\n\n // Deciding the sizing of the ternary plot \n this._calculateplotSize();\n\n\n // Setting the position of the corners\n corners = [\n [opt.margin.left, h + opt.margin.top],\n [w + opt.margin.left, h + opt.margin.top],\n [(w / 2) + opt.margin.left, opt.margin.top]\n ]; //c\n\n\n // Loading the corner titles\n if (data.tern_order) {\n opt.axis_labels = data.tern_order;\n }\n // Render corner labels\n this._drawCornerLabels();\n\n // Render axis & axis titles \n opt.axis_ticks.forEach(function (v) {\n\n // Getting the 4 coordinates to draw the lines \n var coordsArr = self._getFourCoords(v);\n\n // Draw the axis \n self._drawAxis(coordsArr[0], coordsArr[1], opt.ternColors.left);\n self._drawAxis(coordsArr[1], coordsArr[2], opt.ternColors.right);\n self._drawAxis(coordsArr[2], coordsArr[3], opt.ternColors.bottom);\n\n // Tick labels\n self._drawTicks(coordsArr[0], 60, 'end', -opt.tickLabelMargin, v, opt.ternColors.left);\n self._drawTicks(coordsArr[1], -60, 'end', -opt.tickLabelMargin, 100 - v, opt.ternColors.right);\n self._drawTicks(coordsArr[2], 0, 'start', opt.tickLabelMargin, v, opt.ternColors.bottom);\n\n });\n\n // Render Arrows\n var rightArrowDistance = w / 2 + opt.margin.right / 2;\n var leftArrowDistance = w / 2 + opt.margin.left / 2;\n var bottomArrowDistance = h / 2 + opt.margin.bottom;\n this._drawLeftArrows(30, 30, opt.ternColors.left, leftArrowDistance);\n this._drawRightArrows(30, 30, opt.ternColors.bottom, rightArrowDistance);\n this._drawBottomArrows(90, 30, opt.ternColors.right, bottomArrowDistance);\n\n // Adjust Height \n this._adustTernaryHeight();\n\n this._responseToScroll();\n\n }" ]
[ "0.66134816", "0.6451069", "0.63773733", "0.6355556", "0.6141025", "0.6090245", "0.60574174", "0.597779", "0.59466326", "0.5943686", "0.5914411", "0.59092647", "0.5820933", "0.5788699", "0.5763124", "0.5726114", "0.5703022", "0.56849223", "0.56828284", "0.56503814", "0.56307125", "0.5583058", "0.5578429", "0.5564335", "0.55513316", "0.55203384", "0.5519004", "0.55052525", "0.5483394", "0.5476586", "0.5476586", "0.5465136", "0.54549766", "0.54540384", "0.5451908", "0.54469734", "0.54409266", "0.54403895", "0.54334277", "0.54127353", "0.5408509", "0.5407097", "0.5406883", "0.54006493", "0.5398468", "0.5394324", "0.53799284", "0.5368557", "0.5364605", "0.53623843", "0.5361237", "0.5360621", "0.53574145", "0.5349552", "0.53484946", "0.53457814", "0.5337891", "0.5334509", "0.5334187", "0.5330782", "0.53234303", "0.53210926", "0.53137004", "0.53098696", "0.53009504", "0.5297739", "0.5296379", "0.5295376", "0.529", "0.5289483", "0.52783835", "0.5272722", "0.52721816", "0.526655", "0.52504593", "0.52493876", "0.5248117", "0.5246671", "0.52436566", "0.5235845", "0.52339655", "0.52339655", "0.5232375", "0.5224409", "0.5224166", "0.52222204", "0.52220225", "0.5219506", "0.52136093", "0.52011704", "0.51843673", "0.51635236", "0.5149516", "0.5148072", "0.51444376", "0.5140368", "0.5138487", "0.5137847", "0.51376504", "0.51349646", "0.51347464" ]
0.0
-1
a function which renders the dow/gold monthly change for a period of years divID is the id placeholder in the html div a function to render monthly deaths in some pandemics arguments are the id of the div and the data passed in
function renderDeathsMonthly(divId, data){ /** * {'_id': ObjectId('5ed5be86f621c1b0029d96b3'), 'Month': '2020/4', 'US_Deaths_per_100k': 21.6, 'dow_gold_change_next_month': 0.37} */ //chartData = myFunc({data}) console.log(data) Months = [] Deaths = [] data.forEach(e => { Months.push(e.Month) Deaths.push(e.US_Deaths_per_100k) }); let trace2 = { x: Months, y: Deaths, mode: 'lines+markers', type: 'scatter' }; let plotData2 = [trace2]; Plotly.newPlot(divId, plotData2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ExpenseDate(purchaseData){\n\nvar expenseDate = new Date(purchaseData.date); //store the date prop in a new Date object because otherwise the call to the getFullYear method won't work and will crash the page\n\n// toLocaleString() is a built-in function that allows date objects to be parsed and output in a readable format \n//documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString\nconst month = expenseDate.toLocaleString('en-US', {month: 'long'}); //the function takes in a language and format as arguments, and returns the month in the desired format\nconst day = expenseDate.toLocaleString('en-US', {day: '2-digit'});//second verse same as the first\nconst year = expenseDate.getFullYear(); //this function is pretty self-explaanatory, it returns the year contained in the provided date object\n//this code could be run in the divs but it's better practice to run the logic outside, store it in a variable, and then pass it into the divs\n\n\nreturn(\n <div className=\"expense-date\">\n\n <div className=\"expense-date__month\">{month}</div>{/*displays the month*/}\n <div className=\"expense-date__day\">{day}</div>{/*displays the day*/}\n <div className=\"expense-date__year\">{year}</div>{/*displays the year*/}\n\n </div>\n)\n}", "function datem(a)\n {\n month=a+month;\n \n if(month == \"0\")\n {\n \n month=12;\n document.getElementById(\"txt\").innerHTML=month;\n document.getElementById(\"month12\").innerHTML=\"December\";\n year=year-1;\n document.getElementById(\"year12\").innerHTML=year;\n }\n else if(month==\"13\")\n {\n \n month=1;\n document.getElementById(\"txt\").innerHTML=month;\n document.getElementById(\"month12\").innerHTML=\"January\";\n year=year+1;\n document.getElementById(\"year12\").innerHTML=year;\n \n }\n \n \n if(month==\"1\")\n {\n document.getElementById(\"month12\").innerHTML=\"January\";\n daychange();\n }\n \n else if(month==\"2\")\n {\n document.getElementById(\"month12\").innerHTML=\"February\";\n daychange();\n }\n else if(month==\"3\")\n {\n document.getElementById(\"month12\").innerHTML=\"March\";\n daychange();\n }\n \n else if(month==\"4\")\n {\n document.getElementById(\"month12\").innerHTML=\"April\";\n daychange();\n }\n else if(month==\"5\")\n {\n document.getElementById(\"month12\").innerHTML=\"May\";\n daychange();\n }\n else if(month==\"6\")\n {\n document.getElementById(\"month12\").innerHTML=\"June\";\n daychange();\n }\n else if(month==\"7\")\n {\n document.getElementById(\"month12\").innerHTML=\"July\";\n daychange();\n }\n else if(month==\"8\")\n {\n document.getElementById(\"month12\").innerHTML=\"August\";\n daychange();\n }\n else if(month==\"9\")\n {\n document.getElementById(\"month12\").innerHTML=\"September\";\n daychange();\n }\n else if(month==\"10\")\n {\n document.getElementById(\"month12\").innerHTML=\"October\";\n daychange();\n }\n else if(month==\"11\")\n {\n document.getElementById(\"month12\").innerHTML=\"November\";\n daychange();\n }\n else if(month==\"12\")\n {\n document.getElementById(\"month12\").innerHTML=\"December\";\n daychange();\n }\n \n \n }", "function renderDate() {\n // The class name \"content\" does not have any relevance for our js file, and is only used for creating overview of the div section.\n\n dt.setDate(1);\n// set.Date is a javascript function we use so the date is equal to the weekday. We use the parameter (1) because (0) is equal to the first day of the last month, and we want to get the first day of this month.\n// (\"JavaScript setDate\" s.d)\n var day = dt.getDay();\n\n // this is consoled log, so we can see how many dates from last month we have.\n console.log(dt.getDay());\n\n var endDate = new Date(\n dt.getFullYear(),\n dt.getMonth()+1,0\n ).getDate();\n\n // Test, where we should get the last day of the month. That happens because we in getMonth use +1 besides the parameter, and furthermore use 0 which represents the last day of the last month.\n // This object constructor will also be relevant in a later for loop.\n console.log(endDate);\n\n var prevDate = new Date(\n dt.getFullYear(),\n dt.getMonth(),0).getDate();\n// This variable refers to the HTML arrow symbol and the function executes with an onClick. We use date:0; because that is the last month\n var today = new Date();\n console.log(today);\n // This console log consoles the date of today via a javascript method\n // We declare this variable because we want to use it in or for loop, that via HTML should print all the dates of the month.\n console.log(prevDate);\n // Here we test that the prevDate we just created is the last day of the last month.\n\n// But firstly an array of all the months.\n var months = [\"January\",\"February\",\"March\",\"April\",\"May\", \"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"];\n\n// We here use a object constructor function, which prints the date to our paragraph in html.\n// \"\"JaveScript | date.toDateString\" s.d)/\n document.getElementById(\"date_str\").innerHTML = 1 + \"/\" + (dt.getMonth() + 1) + \"/\" + dt.getFullYear();\n\n// We use our dt variable new date to get the month.\n document.getElementById(\"month\").innerHTML = months[dt.getMonth()];\n\n cells = \"\";\n\n for(x = day; x > 0; x--){\n cells += \"<div class='prev_date'>\" + (prevDate - x + 1) + \"</div>\";\n }\n\n// This for loop connects with our div class \"'prev_date\" it starts out by saying our previous date, which is the last day of the last month=30. Then it says - x = the days that is represented from last month. It then plus with 1 so we get 29, and the loop repeats.\n\n// This for loop is for all the days of the relevant month. We again use a for loop, ad break out of the loop when i is less than our equal to the last day of the month\n\n for (i = 1; i <= endDate; i++){\n if(i == today.getDate() && dt.getMonth() == today.getMonth()){\n //var newDate = \"day\" + i;\n cells += \"<div class='day' id ='\" + i + \"' value ='\" + i + \"'>\" + i + \"</div>\";\n\n } else{\n\n cells += \"<div class='day' id ='\" + i + \"' value ='\" + i + \"'>\" + i + \"</div>\";\n\n// If the date is not equal to today's date, we use the conditional else statement, until we hit todays date. Then the if statement will be used. The break happens at the endDate\n\n }\n }\n\n // Here we use innerHTML to print the cells we have declared above, in the user interface.\n document.getElementsByClassName(\"days\")[0].innerHTML = cells;\n one++;\n console.log( \"første tæller\" + one)\n // add onclick functions to every day with addDateChecker();\n addDateChecker();\n}", "function Calander (div, minYear ,minMonth,minDate,maxYear,maxMonth,maxDate,target = \"\",acceptNull=false) {\n this.minYear = minYear;\n\tthis.minMonth = minMonth; //(0-11)\n\tthis.minDate = minDate;\n\tthis.maxYear = maxYear;\n\tthis.maxMonth = maxMonth;\n\tthis.maxDate = maxDate;\n\tthis.target = document.getElementById(target);\n\tthis.div = div;\n\tthis.acceptNull = acceptNull;\n\tthis.dx = new Date();\n\tthis.dxNow = new Date();\n\tthis.cells = document.getElementById(div).getElementsByClassName(\"dateCell\");\n\tcontrol = document.getElementById(div);\n\tvar tableCells=\"\";\n\t\tfor (i = 0; i< 5;i++){\n\t\t\ttableCells = tableCells + '<tr>';\n\t\t\tfor(j = 0; j <7;j++){\n\t\t\t\ttableCells = tableCells + '<td class=\"dateCell\" onClick=\"'+div+'.monthCellClick(this);\"></td>'\n\t\t\t}\n\t\t\ttableCells = tableCells + '</tr>';\n\t\t}\n\t\tcontrol.innerHTML='<table width=\"100%\">'+\n\t\t\t'<tr><td align=\"left\" width=\"25px\"><input type=\"button\" class=\"prevYear monthViewControl\" value=\"<\" onClick=\"'+div+'.lowerYear();\"></td><td align=\"center\" width=\"150px\"><label class=\"yearLabel\">2016</label></td><td align=\"right\" width=\"25px\"><input type=\"button\" class=\"nextYear monthViewControl\" value=\">\" onClick=\"'+div+'.higherYear();\"></td></tr>'+\n\t\t\t'<tr><td align=\"left\" width=\"25px\"><input type=\"button\" class=\"prevMonth monthViewControl\" value=\"<\" onClick=\"'+div+'.lowerMonth();\"></td><td align=\"center\" width=\"150px\"><label class=\"monthLabel\">August</label></td><td align=\"right\" width=\"25px\"><input type=\"button\" class=\"nextMonth monthViewControl\" value=\">\" onClick=\"'+div+'.higherMonth();\"></td></tr>'+\n\t\t\t'<tr><td colspan=\"3\"><table class=\"dates\" width=\"100%\">'+\n\t\t\t'<tr><th>S</th> <th>M</th> <th>T</th> <th>W</th> <th>T</th> <th>F</th> <th>S</th></tr>'+\n\t\t\ttableCells + '</table></td></tr>'+\n\t\t'</table>';\n\tcontrol.setAttribute(\"class\",\"monthView\");\n\tcontrol.setAttribute(\"style\",\"display:none;\");\n\tcontrol.setAttribute(\"tabindex\",\"0\");\n\tthis.target.setAttribute(\"class\",\"monthViewTarget\");\n\tthis.target.setAttribute(\"readonly\",\"readonly\");\n\t//control.setAttribute(\"onblur\",div+\".showCalander(false);\");\n\tthis.checkLeap = function(){\n\t\tif(this.dx.getFullYear()%4 ==0){\n\t\t\tif(this.dx.getFullYear()%400 ==0)\n\t\t\t\treturn 29;\n\t\t\telse if(this.dx.getFullYear()%100 == 0)\n\t\t\t\treturn 28;\n\t\t\telse\n\t\t\t\treturn 29;\n\t\t}\n\t\telse return 28;\n\t};\n\tthis.me = document.getElementById(this.div);\n\tthis.showCalander = function(vis){\n\t\tif(vis){\n\t\t\tthis.me.style.display=\"block\";\n\t\t\tif (acceptNull) this.target.value=\"\";\n\t\t}\n\t\telse{\n\t\t\tthis.me.style.display=\"none\";\n\t\t}\n\t}\n\t\n\tthis.toggle = function(){\n\t\tif(this.me.style.display==\"none\")this.showCalander(true);\n\t\telse is.showCalander(false);\n\t}\n\t\n\tthis.drawDates = function(){\n\t\tnod[1] = this.checkLeap();\n\t\tvar startX = this.dx.getDay()\n\t\tvar markToday = (this.dx.getMonth() == this.dxNow.getMonth()) && (this.dx.getFullYear() == this.dxNow.getFullYear());\n\t\tvar markMin = (this.dx.getMonth() == minMonth) && (this.dx.getFullYear() == minYear);\n\t\tvar markMax = (this.dx.getMonth() == maxMonth) && (this.dx.getFullYear() == maxYear);\n\t\tfor(i = 0 ; i< this.cells.length; i++){\n\t\t\tthis.cells[i].innerHTML= \"&nbsp;\";\n\t\t\tthis.cells[i].setAttribute(\"class\",\"disabledCell dateCell\");\n\t\t}\n\t\tif(nod[this.dx.getMonth()] + startX+1 > 35){\n\t\t\tfor(i = startX ; i< 35; i++){\n\t\t\t\tthis.cells[i].innerHTML= i-startX+1;\n\t\t\t\tthis.cells[i].setAttribute(\"class\",\"dateCell\");\n\t\t\t\tif(markToday && (this.cells[i].innerHTML == this.dxNow.getDate()))\n\t\t\t\t\tthis.cells[i].setAttribute(\"class\",\"dateCell today\");\n\t\t\t\tif(markMin && (this.cells[i].innerHTML < this.minDate))\n\t\t\t\t\tthis.cells[i].setAttribute(\"class\",\"dateCell disabledCell\");\n\t\t\t\tif(markMax && (this.cells[i].innerHTML > this.maxDate))\n\t\t\t\t\tthis.cells[i].setAttribute(\"class\",\"dateCell disabledCell\");\n\t\t\t}\n\t\t\tfor(i = 0 ; i< nod[this.dx.getMonth()] + startX - 35; i++){\n\t\t\t\tthis.cells[i].innerHTML=nod[this.dx.getMonth()]-((nod[this.dx.getMonth()] + startX - 35)-i)+1;\n\t\t\t\tthis.cells[i].setAttribute(\"class\",\"dateCell\");\n\t\t\t\tif(markToday && (this.cells[i].innerHTML == this.dxNow.getDate()))\n\t\t\t\t\tthis.cells[i].setAttribute(\"class\",\"dateCell today\");\n\t\t\t\tif(markMin && (this.cells[i].innerHTML <this.minDate))\n\t\t\t\t\tthis.cells[i].setAttribute(\"class\",\"dateCell disabledCell\");\n\t\t\t\tif(markMax && (this.cells[i].innerHTML > this.maxDate))\n\t\t\t\t\tthis.cells[i].setAttribute(\"class\",\"dateCell disabledCell\");\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tfor(i = startX ; i< nod[this.dx.getMonth()] + startX; i++){\n\t\t\t\tthis.cells[i].innerHTML= i-startX+1;\n\t\t\t\tthis.cells[i].setAttribute(\"class\",\"dateCell\");\n\t\t\t\tif(markToday && (this.cells[i].innerHTML == this.dxNow.getDate()))\n\t\t\t\t\tthis.cells[i].setAttribute(\"class\",\"dateCell today\");\n\t\t\t\tif(markMin && (this.cells[i].innerHTML < this.minDate))\n\t\t\t\t\tthis.cells[i].setAttribute(\"class\",\"dateCell disabledCell\");\n\t\t\t\tif(markMax && (this.cells[i].innerHTML > this.maxDate))\n\t\t\t\t\tthis.cells[i].setAttribute(\"class\",\"dateCell disabledCell\");\n\t\t\t}\n\t\t}\t\n\t\tdocument.getElementById(this.div).getElementsByClassName(\"monthLabel\")[0].innerHTML=months[this.dx.getMonth()];\n\t\tdocument.getElementById(this.div).getElementsByClassName(\"yearLabel\")[0].innerHTML=this.dx.getFullYear();\n\t};\n\t\n\tthis.lowerMonth = function(){\n\t\tif(this.dx.getFullYear() == this.minYear){\n\t\t\tif(this.minMonth != this.dx.getMonth()){ //next click will be the min Month\n\t\t\t\tthis.dx.setMonth(this.dx.getMonth()-1);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\tthis.dx.setMonth(this.dx.getMonth()-1);\n\t\tthis.drawDates();\n\t};\n\t\n\tthis.lowerMonth = function (){\n\t\tif(this.dx.getFullYear() == this.minYear){\n\t\t\tif(this.minMonth != this.dx.getMonth()){ //next click will be the min Month\n\t\t\t\tthis.dx.setMonth(this.dx.getMonth()-1);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\tthis.dx.setMonth(this.dx.getMonth()-1);\n\t\tthis.drawDates();\n\t};\n\t\n\tthis.higherMonth = function (){\n\t\tif(this.dx.getFullYear() == this.maxYear){\n\t\t\tif(this.maxMonth != this.dx.getMonth()){ //next click will be the min Month\n\t\t\t\tthis.dx.setMonth(this.dx.getMonth()+1);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\tthis.dx.setMonth(this.dx.getMonth()+1);\n\t\tthis.drawDates();\n\t};\n\t\n\n\tthis.lowerYear = function (){\n\t\tif(this.minYear == this.dx.getFullYear()-1){ //next click will be the min year\n\t\t\tthis.dx.setFullYear(this.dx.getFullYear()-1);\n\t\t\twhile(this.dx.getMonth() < this.minMonth){\n\t\t\t\tthis.dx.setMonth(this.dx.getMonth()+1);\n\t\t\t}\n\t\t}\n\t\telse if(this.minYear < this.dx.getFullYear()){\n\t\t\tthis.dx.setFullYear(this.dx.getFullYear()-1);\n\t\t}\n\t\tthis.drawDates();\n\t}\n\tthis.higherYear = function (){\n\t\tif(this.maxYear == this.dx.getFullYear()+1){ //next click will be the max year\n\t\t\tthis.dx.setFullYear(this.dx.getFullYear()+1);\n\t\t\twhile(this.dx.getMonth() > this.maxMonth)\n\t\t\t\tthis.dx.setMonth(this.dx.getMonth()-1);\n\t\t}\n\t\telse if(this.maxYear > this.dx.getFullYear()){\n\t\t\tthis.dx.setFullYear(this.dx.getFullYear()+1);\n\t\t}\n\t\tthis.drawDates();\n\t}\n\n\tthis.monthCellClick = function (elem){\n\t\tif (!elem.classList.contains(\"disabledCell\")){\n\t\t\tif (this.target == \"\")\n\t\t\t\talert(this.dx.getFullYear() + \"-\" + this.dx.getMonth() + \"-\" + elem.innerHTML);\n\t\t\telse {\n\t\t\t\tthis.target\n\t\t\t\tthis.target.value = this.dx.getFullYear() + \"-\" + (this.dx.getMonth() +1< 10 ? \"0\"\n\t\t\t\t+(this.dx.getMonth()+1) : (this.dx.getMonth()+1)) + \"-\" + (elem.innerHTML < 10 ? \"0\" + elem.innerHTML : elem.innerHTML);\n\t\t\t}\n\t\t\tthis.showCalander(false);\n\t\t}\t\n\t}\n\tthis.drawDates();\n}", "_renderCalendarMonth() {\n let i = 0;\n let calendarWrapper = document.getElementById('calendarWrapper');\n let calendarMonth = document.getElementById('calendarMonth');\n let iteratingDate =1;\n this.numberOfDaysInMonth = this.daysInMonth(this.monthIndex,this.year);\n // Set date to the 1st of current month\n this.startOfMonthDate = new Date(this.year,this.monthIndex,1);\n this.dayAtStartOfMonth = this.startOfMonthDate.getDay();\n calendarWrapper.innerHTML = '';\n // Changes month and year displayed\n calendarMonth.innerHTML = '';\n calendarMonth.innerHTML += `${this.month} ${this.year}`; \n var myRequest = new Request('../months.json');\n fetch(myRequest)\n .then(function(response) {return response.json();})\n .then(function(months) {\n let colour = 'light-grey';\n let colourTwo = \"\";\n let text = \"\";\n for (var i=1; i<=42;i++ ){\n if (i>=dayArray[calendar.dayAtStartOfMonth] && iteratingDate<=calendar.numberOfDaysInMonth){\n if (`${iteratingDate}` in months[`${calendar.year}`][calendar.monthIndex]){\n colour = months[`${calendar.year}`][calendar.monthIndex][`${iteratingDate}`].colour;\n if (`text` in months[`${calendar.year}`][calendar.monthIndex][`${iteratingDate}`]){\n text = months[`${calendar.year}`][calendar.monthIndex][`${iteratingDate}`].text;\n }\n if (`colourTwo` in months[`${calendar.year}`][calendar.monthIndex][`${iteratingDate}`]){\n colourTwo = months[`${calendar.year}`][calendar.monthIndex][`${iteratingDate}`].colourTwo;\n } \n }\n if (colourTwo !== \"\"){\n calendarWrapper.innerHTML +=`<div><div class=\"grid-two-col\"><div class=\"${colour}\"></div><div class= \"${colourTwo}\"><p class=\"calendar-number\">${iteratingDate}</p></div></div><p class=\"calendar-text\">${text}</p></div>`;\n colourTwo = \"\"; \n } else {\n calendarWrapper.innerHTML +=`<div><div class=\"grid-two-col\"><div class=\"${colour}\"></div><div class= \"${colour}\"><p class=\"calendar-number\">${iteratingDate}</p></div></div><p class=\"calendar-text\">${text}</p></div>`;\n }\n iteratingDate++;\n text=\"\";\n } else {\n calendarWrapper.innerHTML += `<div><p class=\"calendar-text\"></p></div>`;\n }\n } \n });\n }", "function getMonthData() {\n /*\n const xhr = new XMLHttpRequest();\n xhr.open('GET', '../../LiamOrrill_components/data.json');\n xhr.responseType = 'json';\n xhr.onload = function(e) {\n if (this.status == 200) {\n console.log('response', this.response); // JSON response\n }\n };\n xhr.send();*/\n var xmlhttp;\n var monthData;\n if (window.XMLHttpRequest)\n xmlhttp = new XMLHttpRequest();\n else\n xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\n xmlhttp.onreadystatechange = function () {\n if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\n console.log('response', this.response); // JSON response\n monthData = JSON.parse(xmlhttp.responseText);\n document.getElementById(\"Demo\").innerHTML = monthData[0].end;\n /*var dateNumber = monthData[0].Start;\n dateNumber = dateNumber.slice(8,10);\n if(dateNumber < 10){\n dateNumber = dateNumber.slice(1);\n }*/\n document.getElementById(\"Demo\").innerHTML = dateNumber;\n\n for (var weekIndex = 0; weekIndex < monthData.length; weekIndex++) {\n\n var dateNumber = monthData[weekIndex].Start;\n dateNumber = dateNumber.slice(8, 10);\n if (dateNumber < 10) {\n dateNumber = dateNumber.slice(1);\n }\n //for(var dayIndex = 0; dayIndex < 7; dayIndex++)\n if (monthData[weekIndex].Role == \"primary\" && dateNumber > 2 && dateNumber < 10 /*&& document.getElementById(\"\") == dateNumber*/) {\n document.getElementById(\"0-0-1\").innerHTML = monthData[weekIndex].working_id;\n document.getElementById(\"1-0-0\").innerHTML = monthData[weekIndex].working_id;\n }\n if (monthData[weekIndex].Role == \"Secondary\" && dateNumber > 2 && dateNumber < 10) {\n document.getElementById(\"0-1-1\").innerHTML = monthData[weekIndex].working_id;\n document.getElementById(\"1-1-0\").innerHTML = monthData[weekIndex].working_id;\n\n }\n if (monthData[weekIndex].Role == \"manager\" && dateNumber > 2 && dateNumber < 10) {\n document.getElementById(\"0-2-1\").innerHTML = monthData[weekIndex].working_id;\n document.getElementById(\"1-2-0\").innerHTML = monthData[weekIndex].working_id;\n }\n\n\n if (monthData[weekIndex].Role == \"primary\" && dateNumber > 2 && dateNumber < 10 /*&& document.getElementById(\"\") == dateNumber*/) {\n document.getElementById(\"1-0-1\").innerHTML = monthData[weekIndex].working_id;\n document.getElementById(\"1-0-0\").innerHTML = monthData[weekIndex].working_id;\n }\n if (monthData[weekIndex].Role == \"Secondary\" && dateNumber > 2 && dateNumber < 10) {\n document.getElementById(\"0-1-1\").innerHTML = monthData[weekIndex].working_id;\n document.getElementById(\"1-1-0\").innerHTML = monthData[weekIndex].working_id;\n\n }\n if (monthData[weekIndex].Role == \"manager\" && dateNumber > 2 && dateNumber < 10) {\n document.getElementById(\"0-2-1\").innerHTML = monthData[weekIndex].working_id;\n document.getElementById(\"1-2-0\").innerHTML = monthData[weekIndex].working_id;\n }\n //document.getElementById(\"Demo\").innerHTML = year;\n\n\n\n\n\n document.getElementById(\"Demo\").innerHTML = \"loop\" + weekIndex;\n //document.getElementById(\"Demo\").innerHTML = year;\n\n\n\n\n\n }\n }\n }\n\n xmlhttp.open('GET', \"../../LiamOrrill_components/data.json\", true);\n xmlhttp.send();\n updateRoster(monthData);\n}", "function display_days(days_of_month, date) {\n //ciclo for per stampare i giorni del mese e data-day\n for (var i = 1; i <= days_of_month; i++) {\n // console.log(i + ' ' + text_month + ' ' + year);\n //uso template per appendere giorno corrente in html e data-day ad ogni giorno\n var context = {\n 'day': i,\n 'date': date.format('YYYY-MM-DD')\n };\n var html_finale = template_function(context);\n $('#calendario').append(html_finale);\n //aggiungo un giorno all'oggetto moment che ho clonato\n date.add(1, 'days');\n }\n }", "function displayDates(month, year) {\n datesRegion.innerHTML = `\n <div class=\"row\" id=\"days\">\n <span class=\"day\">SUN</span>\n <span class=\"day\">MON</span>\n <span class=\"day\">TUES</span>\n <span class=\"day\">WED</span>\n <span class=\"day\">THURS</span>\n <span class=\"day\">FRI</span>\n <span class=\"day\">SAT</span>\n </div>\n `\n let n = numberOfDays[month];\n if(year%4==0 && year%100!=0 && month==1)\n n=29;\n let firstDay = `${monthList[month]} 1 ${year}`;\n let dateStart = new Date(firstDay);\n let counter = 1;\n let monthStart = dateStart.getDay();\n let output = '<div class=\"row date-row\">';\n for(let i=0; i<monthStart; i++)\n {\n output+=`\n <span class=\"date\"></span>\n `\n }\n for(let i=0; i<7-monthStart; i++)\n {\n output+=`\n <span class=\"date date-val\">${counter}</span>\n `\n counter++;\n }\n for(let i=0;;i++)\n {\n if(counter==n+1)\n break;\n else {\n if(i%7==0) {\n output+=\n `\n </div><div class=\"row date-row\">\n `\n }\n }\n output+= `<span class=\"date date-val\">${counter}</span>`;\n counter++;\n }\n let extra = 7-((n-(7-monthStart))%7);\n if(extra!=7) {\n while(extra--) {\n output+=`\n <span class=\"date\"></span>\n `\n }\n }\n datesRegion.innerHTML+= output;\n addSelectableProperty();\n}", "function change_year(e){\n year=parseInt(e.target.id);\n initializing_description();\n document.getElementById('pileups').innerHTML=text;\n document.getElementById('YEAR').innerHTML=year.toString();\n document.getElementById('publications').innerHTML='# publications : '.concat(data_json['publications'][year.toString()].toString());\n document.getElementById('tanom_land').innerHTML='temperature anomaly land : '.concat(temp_anom_land['data'][year.toString()]);\n document.getElementById('tanom_ocean').innerHTML='temperature anomaly ocean : '.concat(temp_anom_ocean['data'][year.toString()]);\n document.getElementById('forest_coverage').innerHTML='forest coverage : '.concat((forest_coverage[year-min_year].toPrecision(3)).toString());\n for(var i=0;i<global_surface_ice.length;i++){\n\tif(global_surface_ice[i]['y']==year) document.getElementById('ice surface (million of km2)').innerHTML='ice surface : '.concat((global_surface_ice[i]['surface'].toPrecision(3)).toString(),' million of km2');\n }\n list_pileups_year();\n list_pairwize_year();\n change();\n}", "function renderMonth(data) {\n document.getElementById('squares').innerHTML = '';\n\n for (let i = 0; i < data.length; i++) {\n let days = document.createElement('div');\n day = '<span class=\"day\">' + data[i][1] + '</span><br />'\n amount = '<span class=\"amount\">' + data[i][2] + '</span>'\n days.innerHTML = day + amount;\n days.className = 'days';\n\n if (data[i][2] > 116000) {\n days.style.backgroundColor = '#D22224';\n }\n else if (data[i][2] > 112000) {\n days.style.backgroundColor = '#EE3033';\n }\n else if (data[i][2] > 108000) {\n days.style.backgroundColor = '#FF4337';\n }\n else if (data[i][2] > 104000) {\n days.style.backgroundColor = '#FD6930';\n }\n else if (data[i][2] > 100000) {\n days.style.backgroundColor = '#FF8744';\n }\n else if (data[i][2] > 96000) {\n days.style.backgroundColor = '#FFA443';\n }\n else if (data[i][2] > 92000) {\n days.style.backgroundColor = '#FFBF43';\n }\n else if (data[i][2] > 88000) {\n days.style.backgroundColor = '#FFD84A';\n }\n else if (data[i][2] > 84000) {\n days.style.backgroundColor = '#FFE58C';\n }\n else {\n days.style.backgroundColor = '#FFECAA';\n }\n\n document.getElementById('squares').appendChild(days);\n }\n}", "updateEvents() {\n\n // find all day squares\n var daySquares = C('day-square');\n\n // find all events happening this month in this.events\n var monthEvents = this.events[`${this.year}`][this.month];\n\n // find all of the keys in monthEvents (string values for all dates with events)\n var monthKeys = Object.keys(monthEvents);\n\n // hides all of the exclamation icons\n for (var i = 0; i < daySquares.length; i++) {\n daySquares[i].children[1].children[0].classList.add('hidden');\n }\n\n // loops through each key/date\n monthKeys.forEach( key => {\n\n // get all classes happening on this date\n var classes = Object.keys(monthEvents[`${key}`]);\n\n // parse the date into an int\n var date = parseInt(monthKeys);\n\n // opens the .day-assignment-content of the dateSquare for the day\n var dayContent = daySquares[this.monthInfo.firstDayOfWeek + date - 1].children[1];\n\n // declares a variable to hold HTML\n var contents = '';\n \n // shows the exclamation icon for the date\n dayContent.children[0].classList.remove('hidden');\n\n // loops through each event and appends relevant data to contents\n classes.forEach( cl => {\n \n contents += `<h4>${cl}</h4>`;\n\n var assignments = monthEvents[`${key}`][`${cl}`];\n\n var assignmentsList = '';\n\n assignments.forEach( a => {\n\n contents += `<li><p>${a[\"assignment-name\"]} Due ${new Date(a[\"due-date\"]).toLocaleString()}</p></li>`;\n\n });\n\n if (assignmentsList.length != 0)\n contents += `<ul>${assignmentsList}</ul>`;\n\n });\n\n // adds contents to the html of dayContent\n dayContent.children[1].innerHTML = contents;\n\n });\n \n }", "function renderMonth(data) {\n document.getElementById('squares').innerHTML = '';\n\n for (let i = 0; i < data.length; i++) {\n let days = document.createElement('div');\n day = '<span class=\"day\">' + data[i][1] + '</span><br />'\n amount = '<span class=\"amount\">' + data[i][2] + '</span>'\n days.innerHTML = day + amount;\n days.className = 'days';\n\n if (data[i][2] < 10500) {\n days.style.backgroundColor = '#FFECAA';\n }\n else if (data[i][2] < 11000) {\n days.style.backgroundColor = '#FFE58C';\n }\n else if (data[i][2] < 11500) {\n days.style.backgroundColor = '#FFD84A';\n }\n else if (data[i][2] < 12000) {\n days.style.backgroundColor = '#FFBF43';\n }\n else if (data[i][2] < 12500) {\n days.style.backgroundColor = '#FFA443';\n }\n else if (data[i][2] < 13000) {\n days.style.backgroundColor = '#FF8744';\n }\n else if (data[i][2] < 13500) {\n days.style.backgroundColor = '#FD6930';\n }\n else if (data[i][2] < 14000) {\n days.style.backgroundColor = '#FF4337';\n }\n else if (data[i][2] < 14500) {\n days.style.backgroundColor = '#EE3033';\n }\n else {\n days.style.backgroundColor = '#D22224';\n }\n document.getElementById('squares').appendChild(days);\n }\n}", "function makeHTMLd(deaths, year){\n htmlStr=\"\";\n htmlStr+=\"<div class= 'Numbers'>\";\n htmlStr+= \"<h4>\" + \"Death Toll: \" + deaths +\"</h4>\" ;\n htmlStr+= \"</div>\";\n $('#Numbers').html(htmlStr);\n}", "function change_calendar(calendar_year, calendar_month, dst) {\n var divElem = document.getElementById(\"calendar_div_\" + dst);\n divElem.innerHTML = get_specified_calendar(calendar_year, calendar_month, dst);\n}", "function huanghtml(obj){\r\n\r\n\r\nvar xhtml =\"\";\r\nxhtml+=' <img id=\"tc\" border=\"0\" onfocus=this.blur() onClick=\"show(this)\" src=\"images/more.png\" >';\r\nxhtml+=' <div id=\"xians\" style=\"left:2px;top:300px;position:absolute;border: 1px solid #dddddd;';\r\nxhtml+=' width:200px;background-color:#E1EAFA; z-';\r\nxhtml+=' index:999999;display:none;\"><table id=\"date\" style=\"background-color:#EDF2F6;\"> ';\r\nxhtml+=' <tr >';\r\nxhtml+=' <td colspan=\"4\" style=\"text-align:center;\" class=\"top\">';\r\nxhtml+=' <span class=\"span\"><a id=\"del\" href=\"javascript:DelYear()\" onfocus=this.blur()> ';\r\nxhtml+='<img src=\"images/left.gif\" border=\"0\"></a>&nbsp;&nbsp;&nbsp;';\r\n//xhtml+=' <input readonly=\"readonly\"id=\"year\" value=\"2014\" height=\"3\" size=\"5\" maxlength=\"4\" style=\"border:1px solid #cccccc;padding-left:2px;\">';\r\nxhtml+=getSelect(nyear);\r\nxhtml+='&nbsp;&nbsp;&nbsp;<a href=\"javascript:AddYear()\" onfocus=this.blur() id=\"add\" >';\r\nxhtml+='<img border=\"0\" src=\"images/right0.gif\"></a><a href=\"javascript:hide()\" onfocus=this.blur() class=\"aright\"><img src=\"images/delete.gif\" border=\"0\" ></a></span> ';\r\n//xhtml+=' ';\t\r\nxhtml+=' </td></tr><tr style=\"border=\"1px solid red\"><td ';\r\nxhtml+=' class=\"td\" id=\"month1\" ><a onclick=\"ChangeMonth(this,1)\" href=\"#\">一月</a></td><td \" ';\r\nxhtml+=' class=\"td\" id=\"month2\"><a onclick=\"ChangeMonth(this,2)\" href=\"#\">二月</a></td><td class=\"td\" id=\"month3\"><a onclick=\"ChangeMonth(this,3)\" href=\"#\">三月</a></td><td ';\r\nxhtml+=' class=\"td\" id=\"month4\"><a onclick=\"ChangeMonth(this,4)\" href=\"#\">四月</a></td></tr><tr><td ';\r\nxhtml+=' class=\"td\" id=\"month5\"><a onclick=\"ChangeMonth(this,5)\" href=\"#\">五月</a></td><td ';\r\nxhtml+=' class=\"td\" id=\"month6\"><a onclick=\"ChangeMonth(this,6)\" href=\"#\">六月</a></td><td class=\"td\" id=\"month7\"><a onclick=\"ChangeMonth(this,7)\" href=\"#\">七月</a></td><td ';\r\nxhtml+=' class=\"td\" id=\"month8\"><a onclick=\"ChangeMonth(this,8)\" href=\"#\">八月</a></td></tr><tr><td ';\r\nxhtml+=' class=\"td\" id=\"month9\"><a onclick=\"ChangeMonth(this,9)\" href=\"#\">九月</a></td><td ';\r\nxhtml+=' class=\"td\" id=\"month10\"><a onclick=\"ChangeMonth(this,10)\" href=\"#\">十月</a></td><td class=\"td\" id=\"month11\"><a onclick=\"ChangeMonth(this,11)\" href=\"#\">十一月</a></td><td ';\r\nxhtml+=' class=\"td\" id=\"month12\"><a onclick=\"ChangeMonth(this,12)\" href=\"#\">十二月</a></td><td><input type=\"text\" id=\"getvalue\" ';\r\nxhtml+=' style=\"display:none;\" /></td></tr></table> ';\r\n//xhtml+=' <button class=\"button\" onclick=\"nowDate()\">当前年月</button>';\r\nxhtml+=' </div>';\r\n\r\ndocument.getElementById(obj).innerHTML= xhtml;\r\nfiltermonth(document.getElementById(\"year\").value);\r\n}", "function display_month(data_moment){\n //svuoto il calendario\n $('#calendario').empty();\n\n //clono l'oggetto moment per usarlo per il data-day\n var date = data_moment.clone();\n\n //numero giorni del mese da visualizzare\n var days_of_month = date.daysInMonth();\n //mese testuale\n var text_month = date.format('MMMM');\n text_month = text_month.charAt(0).toUpperCase() + text_month.slice(1);\n //giorno della settimana in numero\n var day_of_week = date.day();\n //mese in numero\n var month = date.month();\n //anno in numero\n var year = date.year();\n\n //popolo dinaminamente il mese che appare come titolo\n $('#current_month').text(text_month);\n\n //devo stampare dei li vuoti per i giorni mancanti dall'inizio\n display_empty_block(day_of_week);\n //devo stampare i giorni\n display_days(days_of_month, date);\n //richiamo funzione per stampare le festività\n display_holiday(start_moment);\n }", "function displayChart(x, i, interest, prin_pay,MP,dif){\n // makes sure the right month is displayed\n i+=1;\n var chart_info = $(\"#schedual\");\n if(i%12 === 0){\n // does the same thing as when i is not equal to year execpt instead of appending\n // the Month it appends the year.\n year += 12;\n chart_info.append(\"<tr class = 'summery-sheet'><td id =\"+('one'+i)+\"> Year: \" + i/12 + \"</td><td id = \"+('two'+i)+\"> Monthly payment: \"+'$'+MP+\"</td><td id = \"+('three'+i)+\"> Payment in interest: \"+'$'+interest+\"</td><td id = \"+('four'+i)+\"> Payment in principle: \"+'$'+prin_pay+\"</td><td id = \"+('five'+i)+\"> Principle not paid: \"+\"$\"+dif+\"</td></tr>\");\n }\n else{\n // appends each row from table[][] onto the DOM\n chart_info.append(\"<tr class = 'summery-sheet'><td id =\"+('one'+i)+\"> Month: \" + i + \"</td><td id = \"+('two'+i)+\"> Monthly payment: \"+'$'+MP+\"</td><td id = \"+('three'+i)+\"> Payment in interest: \"+'$'+interest+\"</td><td id = \"+('four'+i)+\"> Payment in principle: \"+'$'+prin_pay+\"</td><td id = \"+('five'+i)+\"> Principle not paid: \"+'$'+dif+\"</td></tr>S\");\n }\n \n}", "function render() { \n\n $body.append(templates['container']({'id':_uid}))\n $j('#' + _uid).append(templates['heading-no-links']({'title':'Countdown Promotion'}));\n $j('#' + _uid).append(templates['countdown-promo']({'id':_uid}));\n \n chtLeaderboard = new CHART.CountdownLeaderboard(_uid + '-charts-promo-leaderboard', _models.promo.getData('all'), _models.promo.getTargetSeries(20000));\n tblLeaderboard = new TABLE.CountdownLeaderboard(_uid + '-tables-promo-leaderboard', _models.promo.groupByOwner('all', 20000), _models.promo.getTotal('all', 180000)); \n chtLastWeek = new CHART.CountdownLeaderboard(_uid + '-charts-promo-lastweek', _models.promo.getData('lastweek'), _models.promo.getTargetSeries(1540));\n tblLastWeek = new TABLE.CountdownLeaderboard(_uid + '-tables-promo-lastweek', _models.promo.groupByOwner('lastweek', 1540), _models.promo.getTotal('lastweek', 13860)); \n chtWeeklySales = new CHART.CountdownWeeklySales(_uid + '-charts-promo-weeklysales', _models.promo.getData('all'));\n\n }", "function showDate() {\n\n let tempCalendarDate = new Date(theYear, theMonth, 1);\n let tempYear = tempCalendarDate.getFullYear();\n let tempDate = tempCalendarDate.getDate();\n let tempDay = tempCalendarDate.getDay();\n let tempMonth = tempCalendarDate.getMonth();\n\n dayDiv.innerHTML = \"<!--innerHTML-->\"\n\n\n loopWeekDady: for (let i = 0; i < 6; i++) {\n\n\n // make there is enough rows for showing weeks.\n // porvide an extra row when the month span 6 weeks\n if (i == 5) {\n document.getElementById(\"id-dates\").style.height = \"270px\";\n document.getElementById(\"calendar\").style.height = \"405px\";\n\n\n\n\n } else {\n document.getElementById(\"id-dates\").style.height = \"225px\";\n document.getElementById(\"calendar\").style.height = \"360px\";\n }\n\n\n\n loopDate: for (let j = 0; j < 7; j++) {\n\n\n let tempId = \"\" + tempYear + \"y\" + tempMonth + \"m\" + tempDate + \"d\";\n\n\n if (tempDay == j) {\n dayDiv.innerHTML = dayDiv.innerHTML + \"<div \" + \"id=\" + tempId + \" class= \\\"small-box\\\" \" + \" onclick=\\\"chooseDate('\" + tempId + \"')\\\"\" + \" data-value=\" + \"\\\"\" + tempDate + \"\\\" \" + \">\" + \"<p>\" + tempDate + \"</p\" +\n \" class= \\\"date\\\" \" + \">\" + \"</div>\";\n\n tempCalendarDate.setDate(tempDate + 1);\n tempDay = tempCalendarDate.getDay();\n tempDate = tempCalendarDate.getDate();\n\n } else {\n dayDiv.innerHTML = dayDiv.innerHTML + \"<div class= \\\"small-box\\\" >\" + \"<p>\" + \" \" + \"</p>\" + \"</div>\";\n }\n if (tempMonth != tempCalendarDate.getMonth()) {\n tempMonth = tempCalendarDate.getMonth();\n break loopWeekDady;\n }\n\n }\n\n }\n\n document.getElementById(theDateId).style.fontWeight = 700;\n}", "function getDateInfo(id){\n\tvar day; var date; var month; var year; var ixx; var idOut;\n\tvar sc1 = \"square-\";\n\tvar sc2 = \"-date\";\n\tfor (var i=0;i<42;i++) {\n\t\t//see if the month is over aka goes from high to low\n\t\tvar ix = i-1;\n\t\tvar strX = sc1+ix+sc2;\n\t\tvar str = sc1+i+sc2;\n\t\tvar pullDateNum = document.getElementById(str).innerHTML;\n\t\tif (ix>14) {\n\t\t\tvar pullDateNumPrev = document.getElementById(strX).innerHTML;\n\t\t}\n\t\tif ((pullDateNum<pullDateNumPrev)){\n\t\t\tixx= i;\n\t\t}\n\t\t\n\t\tif (i==id) {\n\t\t\tidOut = id;\n\t\t\tdate = pullDateNum;\n\t\t\t\n\t\t\tif ((pullDateNum>7) && (id<7)) {\n\t\t\t\t//date selected is previous month.\n\t\t\t\t//console.log(\"datemonthint: \"+dateMonthInt);\n\t\t\t\tmonth = dateMonthInt-1;\n\t\t\t\t//console.log(\"wat: \"+month);\n\t\t\t\tif (month==(-1)) {\n\t\t\t\t\tyear = dateYear-1;\n\t\t\t\t\tmonth = 11;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tyear = dateYear;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (id>=ixx) {\n\t\t\t\t//date selected is next month.\n\t\t\t\tmonth = dateMonthInt+1;\t\n\t\t\t\tif (month==12) {\n\t\t\t\t\tyear = dateYear+1;\n\t\t\t\t\tmonth = 0;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tyear = dateYear;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//date selected is current month\n\t\t\t\tmonth = dateMonthInt;\t\t\t\t\n\t\t\t\tyear = dateYear;\n\t\t\t}\n\t\t\tday = ((id)%7);\n\t\t\tvar data = [day, month, date, year, idOut];\n\t\t\tvar preppedData = prepareDate(data);\n\t\t\t$.post(\"home.php\", {selectedDate: preppedData});\n\t\t\treturn data;\n\t\t\t\n\t\t\tbreak;\n\t\t\t\n\t\t\t//console.log(\"Date: never get here!!\"+date);\n\t\t\t//console.log(\"Month: \"+month);\n\t\t\t//console.log(\"Year: \"+year);\n\t\t\t//console.log(\"------\");\t\t\n\t\t}\n\t}\n\t\n}", "function DrawSeasonCalendar() {\n let ourDate = BackendHelper.Filter.CalendarDate;\n let firstDayOfMonthDate = new C_YMD(ourDate.Year, ourDate.Month, 1);\n let firstDayOfMonthDayOfWeek = firstDayOfMonthDate.DayOfWeek();\n\n CalendarModalDate = ourDate;\n $('#vitasa_modal_calendar_date')[0].innerText = MonthNames[ourDate.Month - 1] + \" - \" + ourDate.Year.toString();\n //$('#vitasa_cal_date')[0].innerText = MonthNames[OurDate.Month - 1] + \" - \" + OurDate.Year.toString();\n\n for(let x = 0; x !== 7; x++) {\n for(let y = 0; y !== 7; y++) {\n let calSelector = \"#vitasa_cal_\" + x.toString() + y.toString();\n let calCel = $(calSelector)[0];\n let dn = x * 7 + (y - firstDayOfMonthDayOfWeek + 1);\n\n if (x === 0) {\n if (y < firstDayOfMonthDayOfWeek) {\n calCel.bgColor = CalendarColor_Site_NotADate;\n calCel.innerText = \"\";\n }\n else {\n //let thisdate = new C_YMD(ourDate.Year, ourDate.Month, dn);\n calCel.bgColor = CalendarColor_Site_SiteClosed;\n calCel.innerText = dn.toString();\n }\n }\n else {\n let date = new C_YMD(ourDate.Year, ourDate.Month, dn);\n let daysInMonth = date.DaysInMonth();\n\n if (date.Day <= daysInMonth) {\n calCel.bgColor = CalendarColor_Site_SiteClosed;\n calCel.innerText = dn.toString();\n }\n else {\n calCel.bgColor = CalendarColor_Site_NotADate;\n calCel.innerText = \"\";\n }\n }\n }\n }\n}", "function updateDisplay() {\n // get the current time in milliseconds\n const now = new Date().getTime();\n\n // get total seconds from milliseconds\n let elapsed = Math.floor((now - epoch) / 1000);\n\n const years = Math.floor(elapsed / (365 * 24 * 60 * 60));\n elapsed = elapsed - years * (365 * 24 * 60 * 60);\n\n // hide years if there haven't been any that have elapsed\n if (years === 0)\n {\n yearsSection.style.display = \"none\";\n }\n\n // calculate months\n const months = Math.floor(elapsed / (30 * 24 * 60 * 60));\n elapsed = elapsed - months * (30 * 24 * 60 * 60);\n\n // hide months if there haven't been any that have elapsed\n if (months === 0 && years === 0)\n {\n monthsSection.style.display = \"none\";\n }\n\n // calculate days\n const days = Math.floor(elapsed / (24 * 60 * 60));\n elapsed = elapsed - days * (24 * 60 * 60);\n\n // hide days if there haven't been any that have elapsed\n if (days === 0 && months === 0)\n {\n daysSection.style.display = \"none\";\n }\n\n // calculate hours\n const hours = Math.floor(elapsed / (60 * 60)); \n elapsed = elapsed - hours * (60 * 60);\n\n // hide hours if there haven't been any that have elapsed\n if (hours === 0 && days === 0)\n {\n hoursSection.style.display = \"none\";\n }\n\n // calculate minutes\n const minutes = Math.floor(elapsed / 60);\n\n // hide minutes if there haven't been any that have elapsed\n if (minutes === 0 && hours === 0)\n {\n minutesSection.style.display = \"none\";\n }\n\n // calculate seconds\n const seconds = elapsed - minutes * 60;\n\n // update progress bar values\n yearsBar.value = years;\n monthsBar.value = months;\n daysBar.value = days;\n hoursBar.value = hours;\n minutesBar.value = minutes;\n secondsBar.value = seconds;\n\n // update time readouts\n yearsDisplay.innerText = `${years} ${years == 1 ? \"year\" : \"years\"}`;\n monthsDisplay.innerText = `${months} ${months == 1 ? \"month\" : \"months\"}`;\n daysDisplay.innerText = `${days} ${days == 1 ? \"day\" : \"days\"}`;\n hoursDisplay.innerText = `${hours} ${hours == 1 ? \"hour\" : \"hours\"}`;\n minutesDisplay.innerText = `${minutes} ${minutes == 1 ? \"minute\" : \"minutes\"}`;\n secondsDisplay.innerText = `${seconds} ${seconds == 1 ? \"second\" : \"seconds\"}`;\n\n // calculate last and next milestones\n let lastMilestone = \"\", nextMilestone = \"\";\n if (days === 0)\n {\n lastMilestone = \"N/A\";\n nextMilestone = \"1 day\";\n }\n else\n {\n // get last multiple of 5 days, or last month\n const last = Math.floor(days / 5) * 5;\n\n // if the last milestone was a month milestone\n if (last % 30 === 0 && last !== 0)\n {\n lastMilestone = `${last / 30} ${last / 30 == 1 ? \"month\" : \"months\"}`;\n }\n else\n {\n // get the one day milestone\n if (last === 0 && days < 5)\n {\n lastMilestone = `1 day`;\n }\n else\n {\n lastMilestone = `${last} days`;\n }\n }\n\n // get next multiple of 5 days, or next month\n const next = Math.ceil(days / 5) * 5;\n if (next % 30 === 0)\n {\n nextMilestone = `${next / 30} ${next / 30 == 1 ? \"month\" : \"months\"}`;\n }\n // if currently on a milestone, add five days to get next milestone\n else if (days % 5 === 0)\n {\n nextMilestone = `${next + 5} days`;\n }\n else\n {\n nextMilestone = `${next} days`;\n }\n }\n\n // update milestone displays\n lastMilestoneEl.innerHTML = lastMilestone;\n nextMilestoneEl.innerHTML = nextMilestone;\n}", "monthWiseRendering(obj) {\n let tmpArr = [];\n tmpArr.push(<div class=\"outcome-cells col-sm-12\">\n <div class=\"outcome-cell col-sm-1\">\n <div class=\"\">{obj.year}</div>\n </div>\n </div>);\n return tmpArr;\n }", "function loadCaption(data) {\n document.getElementById('cumm-conf-date').innerText=data.statewise[0].lastupdatedtime;\n document.getElementById('cumm-conf-value').innerText=data.statewise[0].confirmed+' cases';\n document.getElementById('cumm-dead-date').innerText=data.statewise[0].lastupdatedtime;\n document.getElementById('cumm-dead-value').innerText=data.statewise[0].deaths+' deaths';\n document.getElementById('cumm-recov-date').innerText=data.statewise[0].lastupdatedtime;\n document.getElementById('cumm-recov-value').innerText=data.statewise[0].recovered+' recovered';\n document.getElementById('cumm-active-date').innerText=data.statewise[0].lastupdatedtime;\n document.getElementById('cumm-active-value').innerText=data.statewise[0].active+' active';\n\n document.getElementById('daily-conf-date').innerText=data.cases_time_series[data.cases_time_series.length - 1].date;\n document.getElementById('daily-conf-value').innerText=data.cases_time_series[data.cases_time_series.length - 1].dailyconfirmed + ' cases';\n document.getElementById('daily-dead-date').innerText=data.cases_time_series[data.cases_time_series.length - 1].date;\n document.getElementById('daily-dead-value').innerText=data.cases_time_series[data.cases_time_series.length - 1].dailydeceased + ' deaths';\n document.getElementById('daily-recov-date').innerText=data.cases_time_series[data.cases_time_series.length - 1].date;\n document.getElementById('daily-recov-value').innerText=data.cases_time_series[data.cases_time_series.length - 1].dailyrecovered + ' recovered';\n document.getElementById('daily-active-date').innerText=data.cases_time_series[data.cases_time_series.length - 1].date;\n document.getElementById('daily-active-value').innerText=parseInt(data.cases_time_series[data.cases_time_series.length - 1].dailyconfirmed) - parseInt(data.cases_time_series[data.cases_time_series.length - 1].dailydeceased) - parseInt(data.cases_time_series[data.cases_time_series.length - 1].dailyrecovered);\n \n \n}", "function htmlDays(data) {\r\n\r\n //Handelbars\r\n var source = $(\"#template\").html();\r\n var template = Handlebars.compile(source);\r\n\r\n // Ciclo tutti i giorni di un mese e li stampo\r\n var counter = 0;\r\n while (counter < date.daysInMonth()) {\r\n //console.log(\"Giorno corrente del mese \" + date.date());\r\n //console.log(\"Numero di giorni del mese \" + date.daysInMonth())\r\n //oggetto contenete le chiavi che Hndelbars stampera`\r\n //Formatto i formati delle date nel modo in cui desidero stamparli\r\n var dayFormat = date.format(\"DD\");\r\n var monthFormat = date.format(\"MMMM\");\r\n //Sommo 1 al totale dei mesi che altrimenti partirebbe da 0\r\n var monthFormatAttribute = (parseInt(date.format(\"mm\")) + 1);\r\n //Se il numero che rappresenta i mesi e` inferiore a 0 gli aggiungo uno \"0\" davanti tramite la funzione addZero\r\n var monthAttribute = addZero(monthFormatAttribute);\r\n var yearFormat = date.format(\"YYYY\");\r\n //Formatto la data da inserire nell'attributo data-list\r\n var dateAttribute = yearFormat + \"-\" + monthAttribute + \"-\" + dayFormat;\r\n //oggetto contenete le chiavi che Hndelbars stampera`\r\n //console.log(dateAttribute)\r\n var context = {\r\n date: dateAttribute,\r\n year: yearFormat,\r\n month: monthFormat,\r\n day: dayFormat\r\n };\r\n\r\n //Appendo html compilato con giorno mese e anno al tag ul\r\n var html = template(context);\r\n $(\"#month\").append(html)\r\n\r\n date.add(1, \"days\");\r\n counter++\r\n }\r\n}", "function initialize()\n{\n curr_month; \n document.getElementById('curr_month').innerHTML = months[curr_month]+\", \"+curr_year;\n // display_cal(); \n}", "function datenya(a){a(\".datex .time\").each(function(){var d=a(this).attr(\"title\");var b=[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"];if(d!=\"\"){var g=d.substring(0,10),h=g.substring(0,4),f=g.substring(5,7),e=g.substring(8,10),c=b[parseInt(f,10)-1]}a(this).html('<strong>'+e+'</strong><span>'+c+'</span><span>'+h+'</span>')})}", "function updateDiv1(){\r\n var num= dividerType(lastClicked1.id);\r\n if(num!=3){ //if filmes nao individuais\r\n if(lastClicked1.retNumber() == 1) {\r\n title1.innerHTML = lastClicked1.retNumber() + '<span> movie</span>';\r\n } else {\r\n title1.innerHTML = lastClicked1.retNumber() + '<span> movies</span>';\r\n }\r\n } else {\r\n title1.innerHTML= lastClicked1.d.titles;\r\n }\r\n\r\n document.querySelector(\"#subExtra1\").style.display = \"none\";\r\n document.querySelector(\"#dinExtra1\").style.display = \"none\";\r\n if(genderOn){\r\n document.querySelector(\"#dinAct1\").innerHTML= \" actors\";\r\n document.querySelector(\"#dinCrew1\").innerHTML= \" actresses\";\r\n crew1.innerHTML = (dividZeros(lastClicked1.retFemale())) ;\r\n cast1.innerHTML = (dividZeros(lastClicked1.retMale())) ;\r\n\r\n crew1.style.color = colors['female'];\r\n cast1.style.color = colors['male'];\r\n document.querySelector(\"#subExtra1\").style.display = \"inline-block\";\r\n document.querySelector(\"#dinExtra1\").style.display = \"inline-block\";\r\n document.querySelector(\"#subExtra1\").style.color = colors['unknown'];\r\n document.querySelector(\"#subExtra1\").innerHTML = (dividZeros(lastClicked1.retUnknown())) ;\r\n document.querySelector(\"#dinExtra1\").innerText= \" unknows\";\r\n\r\n }\r\n if(rolesOn){\r\n document.querySelector(\"#dinAct1\").innerHTML= \" actors\";\r\n document.querySelector(\"#dinCrew1\").innerHTML= \" crew members\";\r\n crew1.innerHTML = dividZeros(lastClicked1.retCrew());\r\n cast1.innerHTML = dividZeros(lastClicked1.retCast());\r\n\r\n crew1.style.color = colors['crew'];\r\n cast1.style.color = colors['cast'];\r\n }\r\n if(budgetOn){\r\n document.querySelector(\"#dinBud1\").innerHTML= \" dollars\";\r\n document.querySelector(\"#dinRev1\").innerHTML= \" dollars\";\r\n budget1.innerHTML = dividZeros(lastClicked1.retBudget());\r\n revenue1.innerHTML = dividZeros(lastClicked1.retRevenue());\r\n\r\n document.querySelector(\"#Rev1\").innerHTML= \"Revenue \";\r\n document.querySelector(\"#Bud1\").innerHTML= \"Budget \";\r\n\r\n }else{\r\n document.querySelector(\"#dinBud1\").innerHTML= \" dollars\";\r\n document.querySelector(\"#dinRev1\").innerHTML= \"\";\r\n document.querySelector(\"#Rev1\").innerHTML= \" \";\r\n document.querySelector(\"#Bud1\").innerHTML= \"Profit \";\r\n\r\n if(lastClicked1.retRevenue() - lastClicked1.retBudget() > 0) {\r\n budget1.style.color = colors['revenue'];\r\n } else {\r\n budget1.style.color = colors['budget'];\r\n }\r\n\r\n budget1.innerHTML = (dividZeros(lastClicked1.retRevenue() - lastClicked1.retBudget()) );\r\n revenue1.innerHTML =\"\";\r\n }\r\n if(genderOn || rolesOn) {\r\n people1.innerHTML = dividZeros(lastClicked1.retCrew() + lastClicked1.retCast()) + '<span> people</span>';;\r\n }\r\n}", "function setHTML(id, days, hours, mins, secs) {\n document.getElementById(\"getDays\" + id).innerHTML = days;\n document.getElementById(\"getHr\" + id).innerHTML = hours;\n document.getElementById(\"getMin\" + id).innerHTML = mins;\n document.getElementById(\"getSec\" + id).innerHTML = secs;\n}", "function changeDateCallBack(data,div){\n\treplaceExistingResult(data, div);\t\n\tchangeActivityDate();\n\tbindCallPopup();\n\tchangePrice();\n\t\n\t//bind detail view close button function\n\t$(\"#detailViewCloseButton\").unbind('click');\n\t$(\"#detailViewCloseButton\").bind(\"click\", function() {\n\t\t$.unblockUI();\t\t\t\n\t\t$(\"#detailItem\").html(\"\");\n\t});\n\t\n\t//bind detail view close function(clicking outer space)\n\t$(\".blockOverlay\").unbind('click');\n\t$(\".blockOverlay\").bind(\"click\", function() {\n\t\t$.unblockUI();\t\t\t\n\t\t$(\"#detailItem\").html(\"\");\n\t});\n\t\n\t//bind change activity date/time button function\n\t$(\"div[id^='addActivityBtn-']\").unbind('click');\n\t$(\"div[id^='addActivityBtn-']\").bind(\"click\", function() {\n\t\tIS_FILTER_ALREADY_APPLIED=false;\n\t\tIS_SORT_ALREADY_APPLIED=false;\n\t\tselectAlternativeItem($(this),'activity'); //select alternatative activity\n\t});\n\t\n\trenderImages();\n\t $(\".blockPage\").removeAttr(\"style\");\n\t $(\".blockPage\").attr(\"style\",updateBlockUIStyle(\"activityPopUp\"));\n}", "function rechner () { \r\n\tvar datum = new Date();\r\n\tvar tag = zweiStellen(datum.getDate());\r\n\tvar monat = zweiStellen(datum.getMonth() + 1);\r\n\tvar jahr = datum.getFullYear();\t\r\n\tvar aktuell = tag + \".\" + monat + \".\" + jahr;\r\n \tvar datumEntwurf = new Date(2015,2,18);\r\n\tvar tagEnt = zweiStellen(datumEntwurf.getDate());\r\n\tvar monatEnt = zweiStellen(datumEntwurf.getMonth() + 1);\r\n\tvar jahrEnt = datumEntwurf.getFullYear();\r\n\tvar entwurf = tagEnt + \".\" + monatEnt + \".\" + jahrEnt;\r\n\tvar diff = parseInt((datumEntwurf - datum) / 1000);\r\n\tvar days = parseInt(diff / (60 * 60 * 24));\t\t\r\n\t\tdiff -= (days * 60 * 60 * 24);\r\n days *= -1;\r\n days = zweiStellen(days);\r\n\tvar hours = parseInt(diff / (60 * 60));\r\n\t\tdiff -= (hours * (60 * 60));\r\n hours *= -1;\r\n\tvar minutes = parseInt(diff / 60);\r\n\t\tdiff -= (minutes * 60);\r\n minutes *= -1;\r\n\tvar seconds = parseInt(diff);\r\n\t\tdiff -= (seconds);\r\n seconds *= -1;\r\n\tsetTimeout(500);\r\n\t\tdocument.getElementById(\"zeit\").innerHTML = \"<p class='heute'>\" +\"Heute ist der : </br>\" + aktuell + \"</br>\" + \"</p>\" + \"<p class='zaehler'>\"\r\n\t\t+\"Die Site wurde am \" + \"</br>\" + tagEnt + \".\" + monatEnt + \".\" + jahrEnt + \"</br>\" + \" erstellt </br>\" + \"das ist jetzt genau </br>\"\r\n\t\t+ days + \" Tage</br>\" + hours + \" Stunden</br>\" + minutes + \" Minuten</br>\" + seconds + \" Sekunden\" + \"</p>\";\r\n\t}", "function cal_prev()\n{\n if(curr_month === 0 )\n {\n curr_month = 11;\n curr_year = curr_year - 1;\n document.getElementById('curr_month').innerHTML = months[curr_month]+\", \"+curr_year;\n }\n else if(curr_month > 0 )\n {\n curr_month = curr_month -1 ;\n document.getElementById('curr_month').innerHTML = months[curr_month]+\", \"+curr_year;\n //display_cal();\n }\n}", "function renderDate() {\n dateDiv.text(todaysDate)\n}", "function runDate() {\n\t\tvar el = document.getElementsByClassName(\"date-span\");\n\t\t// var dateString = get_Date();\n\t\tvar dateString = getSmallDate();\n\t\tfor(var i in el) {\n\t\t\tel[i].innerHTML = \" \" + dateString;\n\t\t}\n\t}", "function get_days_of_month()\r\n{\r\n var year = document.getElementById(\"year\").value;\r\n var month = document.getElementById(\"month\").value;\r\n var response = ajax_call_server( \"calculate-days.html\",\r\n \"?y=\"+year+\"&m=\"+month);\r\n eval(response);\r\n}", "function cal_next()\n{\n if(curr_month < 11 )\n {\n curr_month = curr_month + 1;\n document.getElementById('curr_month').innerHTML = months[curr_month]+\", \"+curr_year;\n }\n else if(curr_month === 11)\n {\n curr_month = 0;\n curr_year = curr_year + 1;\n document.getElementById('curr_month').innerHTML = months[curr_month]+\", \"+curr_year;\n }\n // display_cal();\n}", "function showDueDate() {\r\n showDueChecked += 1;\r\n for (let i = 0; i < data.length; i++) {\r\n var currentinnerrect = document.getElementById(data[i].opID + \"innerrect\");\r\n if (showDueChecked > 0 && showDueChecked % 2 == 0) {\r\n currentinnerrect.style.opacity = 0.0;\r\n }\r\n else currentinnerrect.style.opacity = 1.0;\r\n }\r\n}", "function display() {\n var thisDay = today.getDay();// lấy thứ theo số thứ tự của mảng 0-6, lưu giá trị hiển thị\n var thisMonth = today.getMonth();// lấy tháng theo index 0-11, lưu giá trị hiển thị\n var thisYear = today.getFullYear();// lấy năm đủ 4 chữ số, lưu giá trị hiển thị\n var thisDate = today.getDate();// lấy ra ngày 1-31, lưu giá trị hiển thị\n var nowDate = now.getDate();// lay ngay\n console.log(nowDate);\n var nowMonth = now.getMonth();// lay thang\n var nowYear = now.getFullYear();// lay nam\n var text = \"\";\n\n if (nowYear % 4 == 0) month_day[1]=29;\n console.log(nowYear);\n var first_date = new Date(thisYear, thisMonth, 1);// trả về kết quả đầy đủ h, ngày 1 tháng năm ở thời điểm được trỏ tới\n var first_day = first_date.getDay();// trả về thứ của ngày mùng 1 = so\n console.log(first_day);\n title = month_name[thisMonth] + ' ' + thisYear;\n document.getElementById('title').innerHTML = title;\n text += '<table border = 2 style=\"height: 300px;width: 440px;\">';\n text += '<tr><td style=\"color: orangered;\">' + \"Sunday\" + '</td><td style=\"color: orangered;\">' + \"Monday\" + '</td><td style=\"color: orangered;\">' + \"Tuesday\" + '</td><td style=\"color: orangered;\">' + \"Wednesday\" + '</td><td style=\"color: orangered;\">' + \"Thursday\" + '</td><td style=\"color: orangered;\">' + \"Friday\" + '</td><td style=\"color: orangered;\">' + \"Saturday\" + '</td></tr>';\n text+='<tr>';\n for (i = 0; i < first_day; i++) {\n console.log(i);\n console.log(first_day);\n text += \"<td> </td>\";\n }\n date = 1;\n while (date <= month_day[nowMonth]){\n for (j = first_day; j < 7; j++) {\n if ( date <= month_day[thisMonth]){\n if (nowDate == date && nowMonth == thisMonth && nowYear == thisYear){\n text +='<td id = \"nowDate\"><b style=\"color: orangered;\">' + date + '</b></td>';\n }else {\n text +='<td class = \"date\">' + date + '</td>';\n }\n } else {\n text += \"&nbsp\";\n }\n date++;\n }\n text += '</tr>';\n first_day = 0;\n }\n text += '</table>';\n document.getElementById(\"display\").innerHTML = text;\n}", "function myDateFunction(id) {\n $(\"#date-popover\").hide();\n var date = $(\"#\" + id).data(\"date\");\n var hasEvent = $(\"#\" + id).data(\"hasEvent\");\n $(\"#dateArea\").html('<strong>Date :</strong> '+ date);\n parser(\"SCADA/\"+date)\n return true;\n}", "function displayOclinics () {\n\n var d = new Date();\n\tvar month = d.getMonth();\n\tvar date = d.getDate();\n var may = Object.keys(Oclinicsmay);\n var june = Object.keys(Oclinicsjune);\n for (var i = 0; i < (may.length + june.length); i++) {\n $(\"#oevents\" + i).html('');\n }\n // see if there are any Officials Clinics in May and display them ---------\n if (may.length > 0) {\n\n for (var i = 0; i < may.length; i++) {\n $(\"#oevents\" + i).html(\"<div class='month1'>May \" + may[i] + \":</div><div class='officialsclinics'>\" + Oclinicsmay[may[i]]+ \"</div>\");\n }\n counter = (may.length - 1); // adjust ids used for May clinics\n }\n // Display Officials Clinics in June ----------------------------\n for (var i = 0; i < june.length; i++) {\n counter ++;\n $(\"#oevents\" + counter).html(\"<div class='month1'>June \" + june[i] + \":</div><div class='officialsclinics'>\" + Oclinicsjune[june[i]]+ \"</div>\");\n }\n //delete unused cells ---------------------------------------------\n\n if (counter+1 <= 5) {\n\n for (var i = counter+1; i < 9; i++) {\n $(\"#oclinics\" + i).css('display', 'none');\n }\n }\n // add strike through when date passes\n var z = findEvent(date, june);\n if ((month === 4 && date > parseInt(may[may.length-1])) || month > 4) {\n for (var i = 0; i < may.length; i++) {\n $(\"#oevents\" + i).html(\"<s><div class='month1'>May \" + may[i] + \":</div><div class='officialsclinics'>\" + Oclinicsmay[may[i]]+ \"</div></s>\");\n }\n }\n if (month === 5 ) {\n counter = (may.length - 1);\n for (var i = 0; i < z; i++) {\n counter ++;\n $(\"#oevents\" + counter).html(\"<s><div class='month1'>June \" + june[i] + \":</div><div class='officialsclinics'>\" + Oclinicsjune[june[i]]+ \"</div></s>\");\n }\n }\n if (month === 5 && date > parseInt(june[june.length-1]) || month > 5) {\n counter = (may.length - 1);\n for (var i = 0; i <= june.length; i++) {\n counter ++;\n $(\"#oevents\" + counter).html(\"<s><div class='month1'>June \" + june[i] + \":</div><div class='officialsclinics'>\" + Oclinicsjune[june[i]]+ \"</div></s>\");\n }\n }\n}", "function UpdateCalendar(args, context)\n{\n var cal = $('calendarContainer');\n cal.innerHTML = args;\n months[context] = args;\n}", "function printMonth(baseDate){\n$(\".month\").text(baseDate.format(\"MMMM YYYY\"));\n$(\".month\").attr(\"data-this-month\", baseDate.format(\"YYYY-MM-DD\"))\n //Quantita di giorni compresi in un mese.\n var daysInMonth = baseDate.daysInMonth();\n\n var source = $(\"#day-template\").html();\n var template = Handlebars.compile(source);\n\n //Ciclo FOR per stampare tutti giorni del mese.\n for(var i = 1; i <= daysInMonth; i++){\n var currentDay = moment({\n name: \"\",\n date: i,\n month: baseDate.month(),\n year: baseDate.year(),\n });\n var context = {\n // Giorno da stampare.\n date: currentDay.format(\"dd D\"),\n // Attributo da stampare (nello stesso formato API dei giorni festivi.)\n day_attr: currentDay.format(\"YYYY-MM-DD\")\n };\n var html = template(context);\n $('.wrapper-days').append(html);\n }\n }", "function renderMatch3(doc, id) {\n //MAIN DIV\n let display_content_per_date = document.createElement('div');\n display_content_per_date.className = 'display-content-per-date';\n display_content_per_date.id = doc.date + ' ' + doc.time;\n\n //DATE AND UL\n let date = document.createElement('h4');\n let display_list = document.createElement('ul');\n\n date.className = 'display-date';\n display_list.className = 'display-list';\n let date_text = doc.date;\n let date_split = date_text.split(' ');\n let full_day = objectOfDays[date_split[0]];\n let date_final = date_split.splice(1, 2);\n let date_join = date_final.join(' ');\n date.innerHTML = full_day + ' ' + date_join + ', ' + doc.time + ' WIB';\n display_list.id = full_day + ' ' + date_join + ', ' + doc.time + ' WIB';\n\n //LI\n let display_item = document.createElement('li');\n display_item.className = 'display-item';\n\n //SPORT'S ICON\n let display_color_identifier = document.createElement('div');\n let icon = document.createElement('img');\n display_color_identifier.className = 'display-color-identifier';\n\n if (doc.sport == 'basketball') {\n icon.src = './images/basketball2.svg';\n display_item.id = 'display-basketball';\n } else if (doc.sport == 'soccer') {\n icon.src = './images/soccer2.svg';\n display_item.id = 'display-soccer';\n } else if (doc.sport == 'badminton') {\n icon.src = './images/badminton2.svg';\n display_item.id = 'display-badminton';\n } else if (doc.sport == 'volleyball') {\n icon.src = './images/volleyball2.svg';\n display_item.id = 'display-volleyball';\n }\n\n //EVENT NAME, AMOUNT OF PLAYERS, GENDER\n let display_text = document.createElement('div');\n let display_title = document.createElement('h2');\n let display_amount = document.createElement('div');\n let img = document.createElement('img');\n let p = document.createElement('p');\n let display_peoplepref2 = document.createElement('p');\n\n display_text.className = 'display-text';\n display_title.className = 'display-title';\n display_amount.className = 'display-amount';\n\n img.src = './images/group.svg';\n display_title.innerHTML = doc.event_name;\n p.innerHTML = `${doc.matches_join.length + 1} / ${parseInt(doc.limit)}`;\n\n //DISPLAY BAR\n let display_bar = document.createElement('div');\n display_bar.className = 'display-bar';\n\n //DISPLAY LOCATION\n let display_location = document.createElement('div');\n let display_place = document.createElement('p');\n let display_address = document.createElement('p');\n\n display_location.className = 'display-location';\n display_place.className = 'display-place';\n display_place.style.textOverflow = 'ellipsis';\n display_address.className = 'display-address';\n\n display_place.innerHTML = doc.location;\n display_address.innerHTML = doc.address;\n\n //GENDER ICON\n let display_peoplepref = document.createElement('div');\n let display_sex_icon = document.createElement('div');\n let img_gender = document.createElement('img');\n let display_sex_text = document.createElement('p');\n\n display_sex_icon.className = 'display-sex-icon';\n display_sex_text.className = 'display-sex-text';\n\n //BUTTON\n let button = document.createElement('button');\n let button_p = document.createElement('p');\n let button_image = document.createElement('img');\n\n button_p.className = 'button_p';\n button_image.className = 'button_image';\n\n //CLASS BUTTON TERGANTUNG ACTION\n button.setAttribute('type', 'submit');\n\n //SET ID FIREBASE KE LI\n display_item.setAttribute('data-id', id);\n\n if (doc.sex == 'male') {\n display_peoplepref2.className = 'display-peoplepref2 display-male2';\n display_peoplepref2.innerHTML = 'male only';\n img_gender.src = './images/male.svg';\n img_gender.alt = 'malesign';\n display_peoplepref.className = 'display-peoplepref display-male';\n display_sex_text.innerHTML = 'male only';\n } else if (doc.sex == 'female') {\n display_peoplepref2.className = 'display-peoplepref2 display-female2';\n display_peoplepref2.innerHTML = 'female only';\n img_gender.src = './images/female.svg';\n img_gender.alt = 'femalesign';\n display_peoplepref.className = 'display-peoplepref display-female';\n display_sex_text.innerHTML = 'female only';\n } else if (doc.sex == 'anyone') {\n display_peoplepref2.className = 'display-peoplepref2 display-anysex2';\n display_peoplepref2.innerHTML = 'anyone can join';\n img_gender.src = './images/anysex.svg';\n img_gender.alt = 'unisex';\n display_peoplepref.className = 'display-peoplepref display-anysex';\n display_sex_text.innerHTML = 'anyone';\n }\n\n // DETERMINE THE BUTTON TYPE\n\n let doc_pending_data = doc.pending;\n let pending_list_data = [];\n\n doc_pending_data.forEach((data_pending) => {\n let split_data = data_pending.split('~~');\n split_data.forEach((data) => {\n pending_list_data.push(data);\n });\n });\n\n if (doc.owner == firebase_room_id) {\n //owner\n button.className = 'display-delete';\n button_p.innerHTML = 'Delete';\n button_image.src = './images/Trash.svg';\n } else if (doc.matches_join.includes(firebase_room_id)) {\n //leave\n button.className = 'display-leave';\n button_p.innerHTML = 'Leave';\n button_image.src = './images/Leave.svg';\n } else if (pending_list_data.includes(firebase_room_id)) {\n //withdraw\n button.className = 'display-withdraw';\n button_p.innerHTML = 'Withdraw';\n button_image.src = './images/withdraw.svg';\n } else {\n //request\n button.className = 'display-request';\n button_p.innerHTML = 'Request';\n button_image.src = './images/Right arrow.svg';\n }\n\n //display-color-identifier\n display_color_identifier.appendChild(icon);\n display_item.appendChild(display_color_identifier);\n\n //display-text\n display_amount.appendChild(img);\n display_amount.appendChild(p);\n display_text.appendChild(display_title);\n display_text.appendChild(display_amount);\n display_text.appendChild(display_peoplepref2);\n\n //display-location\n display_location.appendChild(display_place);\n display_location.appendChild(display_address);\n\n //display-peoplepref\n display_sex_icon.appendChild(img_gender);\n display_peoplepref.appendChild(display_sex_icon);\n display_peoplepref.appendChild(display_sex_text);\n\n //display button\n button.appendChild(button_p);\n button.appendChild(button_image);\n\n //APPEND TO DISPLAY-ITEM\n display_item.appendChild(display_color_identifier);\n display_item.appendChild(display_text);\n display_item.appendChild(display_bar);\n display_item.appendChild(display_location);\n display_item.appendChild(display_peoplepref);\n display_item.appendChild(button);\n\n //CHECK IF THERE IS DUPLICATE\n let ul_id = full_day + ' ' + date_join + ', ' + doc.time + ' WIB';\n var find_duplicate = document.getElementById(ul_id);\n if (find_duplicate) {\n //APPEND TO EXISTING UL\n find_duplicate.appendChild(display_item);\n } else {\n //APPEND TO MAIN DIV\n display_list.appendChild(display_item);\n display_content_per_date.appendChild(date);\n display_content_per_date.appendChild(display_list);\n display_container.appendChild(display_content_per_date);\n }\n\n /*\n // DISPLAY APPLICATION FOR REQUEST AND DELETE\n */\n\n let modalApplication = document.querySelectorAll('.display-request');\n for (var i = 0; i < modalApplication.length; i++) {\n modalApplication[i].addEventListener('click', function () {\n this.id = 'selected_button';\n document.querySelector('.modal-application').style.display = 'flex';\n });\n }\n\n let buttons_leave = document.querySelectorAll('.display-leave');\n buttons_leave.forEach((but) => {\n but.addEventListener('click', () => {\n let button_parent_data_id = but.parentNode.getAttribute('data-id');\n\n db.collection('match')\n .doc(button_parent_data_id)\n .update({\n matches_join:\n firebase.firestore.FieldValue.arrayRemove(firebase_room_id),\n });\n\n but.className = 'display-request';\n but.querySelector('.button_p').innerHTML = 'Request';\n but.querySelector('.button_image').src = './images/Right arrow.svg';\n });\n });\n\n let button_withdraw = document.querySelectorAll('.display-withdraw');\n button_withdraw.forEach((but) => {\n but.addEventListener('click', () => {\n let button_parent_data_id = but.parentNode.getAttribute('data-id');\n\n db.collection('match')\n .doc(button_parent_data_id)\n .get()\n .then(function (doc) {\n let doc_pending = doc.data().pending;\n let data_want_delete = '';\n\n doc_pending.forEach((data) => {\n var regex = new RegExp(firebase_room_id, 'g');\n let match = data.match(regex);\n if (match) {\n data_want_delete = match.input;\n }\n });\n\n db.collection('match')\n .doc(button_parent_data_id)\n .update({\n pending:\n firebase.firestore.FieldValue.arrayRemove(data_want_delete),\n });\n });\n\n but.className = 'display-request';\n but.querySelector('.button_p').innerHTML = 'Request';\n but.querySelector('.button_image').src = './images/Right arrow.svg';\n });\n });\n\n let modalReason = document.querySelectorAll('.display-delete');\n for (var i = 0; i < modalReason.length; i++) {\n modalReason[i].addEventListener('click', function () {\n this.id = 'selected_button';\n document.querySelector('.modal-reason').style.display = 'flex';\n });\n }\n\n sortDiv();\n}", "function processDate() {\r\n\tvar dateArray = dateSelection.split(\"-\");\r\n\tvar correctMonth = parseInt(dateArray[1]);\r\n\t//create the Date() object for given date with fixed info\r\n\tvar givenDate = new Date(dateArray[0], (correctMonth - 1), dateArray[2]);\r\n\t\r\n\t//process the dates to see their difference in terms of days\r\n\tvar timeElapseDay = (((currentDate - givenDate) / 1000) / 86400);\r\n\t\r\n\t//variable for remainder of days after whole years (average year length computed)\r\n\tvar yearsRemainder = (timeElapseDay % 365.2425);\r\n\t\r\n\t//final variables to present, number of days total\r\n\tvar yearsDisplay = Math.floor(timeElapseDay / 365.2425);\r\n\tvar monthsDisplay = Math.floor((timeElapseDay % 365.2425) / 30.44);\r\n\tvar daysDisplay = Math.floor(yearsRemainder % 30.44);\r\n\tvar exactDays = Math.round(timeElapseDay);\r\n\tvar daysFormatted = exactDays.toLocaleString();\r\n\t\r\n\t//update the empty p element with result\r\n\tdocument.getElementById(\"timeResultPara\").innerHTML = \r\n\t\t\"<br>Years: \"+yearsDisplay+\"<br><br>Months: \"+\r\n\t\tmonthsDisplay+\"<br><br>Days: \"+daysDisplay + \"<br><br>Total Number of Days: \"+daysFormatted;\r\n}", "function renderEvent () {\n const daysContainer = document.querySelectorAll(\".current-month-day\");\n const currentMonth = date.getMonth() + 1;\n const currentYear = date.getFullYear();\n //* Calendar days divs pass by\n for (let div of daysContainer) {\n const dayNumber = div.firstChild.innerHTML;\n //* checking that day has events\n if (!!eventsByDate[`${currentYear}-${currentMonth}-${dayNumber}`]) {\n //* Looping thru events in array\n for (let eventObjectId of eventsByDate[`${currentYear}-${currentMonth}-${dayNumber}`]){\n //* Access to event data\n const eventTitle = eventsById[eventObjectId].title;\n const eventType = eventsById[eventObjectId].eventType;\n //* Create of the event element\n let newEvent = document.createElement(\"div\");\n newEvent.classList.add(\"event-in-calendar\");\n newEvent.innerHTML = eventTitle;\n newEvent.setAttribute(\"divEventId\", eventObjectId);\n //* choosing event color depending of event type\n switch (eventType) {\n case 'Study':\n newEvent.classList.add(\"blue-event\");\n break;\n case 'Meeting':\n newEvent.classList.add(\"green-event\");\n break;\n case 'Personal':\n newEvent.classList.add(\"orange-event\");\n break;\n default:\n break;\n }\n newEvent.addEventListener('click', eventModal);\n //* Insert element in DOM\n div.firstChild.insertAdjacentElement('afterend',newEvent);\n }\n }\n }\n}", "function deaths(year) {\n // the URL to the UNHCR data \n var url = \"http://data.unhcr.org/api/stats/mediterranean/deaths.json\";\n //Adding the 'year' parameter to the search query\n url += '?' + $.param({\n 'year': year,\n \n });\n //Make the ajax call\n $.ajax({\n url: url,\n type: 'GET',\n dataType: 'json',\n\n error: function(error){\n console.log(error);\n },\n success: function(data){\n /* Get the value of the first property of the object returned(number of deaths)\n Then Call the function makeHTMLd to add the death toll to the screen \n */\n deathsNum= data[0].value;\n console.log(\"deaths:\", deathsNum);\n makeHTMLd(deathsNum, year);\n \n }\n });\n\n}", "function renderMonthsCounts(data, appendToElement){\n data = $(data).hide();\n $(appendToElement).append(data);\n $(data).slideDown();\n}", "function crP(){\n daysP.id = 'daysPid';\n document.getElementById('daysDiv').appendChild(daysP);\n daysP.innerHTML = `<span style='color:white;font-size:3.5em;'>${days}</span><span style='color:green;font-size:2.5em;'><br>DAYS</span>`; \n }", "function upLayout(){\n const monthHTML = document.querySelector('.month');\n const yearHTML = document.querySelector('.year');\n let monthString = '';\n if(month === 0){\n monthString = 'January';\n }else if(month === 1){\n monthString = 'February';\n }else if(month === 2){\n monthString = 'March';\n }else if(month === 3){\n monthString = 'April';\n }else if(month === 4){\n monthString = 'May';\n }else if(month === 5){\n monthString = 'June';\n }else if(month === 6){\n monthString = 'July';\n }else if(month === 7){\n monthString = 'August';\n }else if(month === 8){\n monthString = 'September';\n }else if(month === 9){\n monthString = 'October';\n }else if(month === 10){\n monthString = 'November';\n }else if(month === 11){\n monthString = 'December';\n }else{\n console.log('NOTWORKING');\n monthString = 'default';\n }\n monthHTML.innerHTML = monthString;\n yearHTML.innerHTML = year;\n }", "_handleMonths(date, monthsContainer) {\n const that = this;\n let months;\n\n if (!date) {\n date = that._viewDates && that._viewDates.length > 0 ? that._viewDates[0] : new Date();\n }\n\n date = new Date(Math.min(Math.max(that.min.getTime(), date.getTime()), that.max.getTime()));\n\n if (!monthsContainer) {\n monthsContainer = that.$.monthsContainer;\n }\n\n function initializeMonths(monthsContainer) {\n let nextMonth,\n count = monthsContainer.children.length,\n fragment = document.createDocumentFragment();\n\n for (count; count < that.months; count++) {\n nextMonth = that.$.month.cloneNode(false);\n nextMonth.innerHTML = that.$.month.innerHTML;\n fragment.appendChild(nextMonth);\n }\n\n return fragment;\n }\n\n function populateMonths(monthsContainer) {\n let months = monthsContainer.children;\n\n for (let i = 0; i < months.length; i++) {\n that._setMonth(date, months[i]);\n date.setMonth(date.getMonth() + 1);\n }\n\n that._setWeeksVisibility(monthsContainer);\n\n //Update the Header elements\n that._refreshHeaderElements();\n that._refreshHeaderTitle();\n\n if (that.tooltip) {\n that.$.tooltip.close();\n }\n\n if (that.$.body === document.activeElement) {\n that._focusCell();\n }\n }\n\n that._selectedCells = [];\n\n if (that.hasAnimation) {\n months = that.$.nextMonthsContainer.children;\n\n if (months.length > 0 && months[0].value instanceof Date) {\n that.$.nextMonthsContainer.innerHTML = '';\n }\n\n // FF v57/EDGE bug fix using that.$.monthsContainer.childElementCount. Scoping problem with FF and EDGE.\n while (that.$.nextMonthsContainer.childElementCount < that.months) {\n //if (months.length < that.months) {\n that.$.nextMonthsContainer.appendChild(initializeMonths(that.$.nextMonthsContainer));\n }\n\n // FF v57/EDGE bug fix using that.$.monthsContainer.childElementCount. Scoping problem with FF and EDGE.\n while (that.$.nextMonthsContainer.childElementCount > that.months) {\n //while (months.length > that.months) {\n that.$.nextMonthsContainer.removeChild(months[that.$.nextMonthsContainer.childElementCount - 1]);\n }\n\n if (arguments[1] === that.$.nextMonthsContainer) {\n populateMonths(that.$.nextMonthsContainer);\n return;\n }\n }\n\n months = that.$.monthsContainer.children;\n\n if (months.length > that.months) {\n // FF v57/EDGE bug fix using that.$.monthsContainer.childElementCount. Scoping problem with FF and EDGE.\n while (that.$.monthsContainer.childElementCount > that.months) {\n that.$.monthsContainer.removeChild(months[that.$.monthsContainer.childElementCount - 1]);\n that._viewDates.pop();\n }\n\n populateMonths(that.$.monthsContainer);\n return;\n }\n\n if (that.$.monthsContainer.children.length === that.months) {\n populateMonths(that.$.monthsContainer);\n return;\n }\n\n that._viewDates = [];\n that.$.monthsContainer.appendChild(initializeMonths(that.$.monthsContainer));\n populateMonths(that.$.monthsContainer);\n }", "function renderDaysOfMonth(month, year) {\n $('#currentMonth').text(d3CalendarGlobals.monthToDisplayAsText() + ' ' + d3CalendarGlobals.yearToDisplay());\n // We get the days for the month we need to display based on the number of times the user has pressed\n // the forward or backward button.\n var daysInMonthToDisplay = d3CalendarGlobals.daysInMonth();\n var cellPositions = d3CalendarGlobals.gridCellPositions;\n\n // All text elements representing the dates in the month are grouped together in the \"datesGroup\" element by the initalizing\n // function below. The initializing function is also responsible for drawing the rectangles that make up the grid.\n d3CalendarGlobals.datesGroup \n .selectAll(\"text\")\n .data(daysInMonthToDisplay)\n .attr(\"x\", function (d,i) { return cellPositions[i][0]; })\n .attr(\"y\", function (d,i) { return cellPositions[i][1]; })\n .attr(\"dx\", 20) // right padding\n .attr(\"dy\", 20) // vertical alignment : middle\n .attr(\"transform\", \"translate(\" + d3CalendarGlobals.gridXTranslation + \",\" + d3CalendarGlobals.gridYTranslation + \")\")\n .text(function (d) { return d[0]; }); // Render text for the day of the week\n\n d3CalendarGlobals.calendar\n .selectAll(\"rect\")\n .data(daysInMonthToDisplay)\n // Here we change the color depending on whether the day is in the current month, the previous month or the next month.\n // The function that generates the dates for any given month will also specify the colors for days that are not part of the\n // current month. We just have to use it to fill the rectangle\n .style(\"fill\", function (d) { return d[1]; }); \n\n }", "function changeTimeSlide(){\n document.getElementById('labelTimeDiv_id').innerHTML=getNewTimeDisplay(slideCurrent)\n document.getElementById('labelTimeDivLast_id').innerHTML=\"/\" + getNewTimeDisplay(slideFinal) \n}", "function datenya(a){a(\".datex .time\").each(function(){var d=a(this).attr(\"title\");var b=[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"];if(d!=\"\"){var g=d.substring(0,10),h=g.substring(0,4),f=g.substring(5,7),e=g.substring(8,10),c=b[parseInt(f,10)-1]}a(this).html(c+\" \"+e+\", \"+h)})}", "function damage_dates() {\n \n var c_scheme = ['#EF5350', '#EF5350'];\n \n // Select #main div, add #money and then .section .title\n d3.select('#main')\n .append('div')\n .attr('id', 'damage-dates')\n .append('div')\n .attr('class', 'section title')\n .html('Skills and Damage by Days of the Week');\n \n $.get('/damage_dates', function(d) {\n \n var max = 0;\n \n for (var i = 0; i < d.length; i++) {\n if (max < d[i].inflicted_highest) max = d[i].inflicted_highest;\n if (max < d[i].received_highest) max = d[i].received_highest;\n }\n \n // set scale to highest value\n var scale = d3.scaleLinear()\n .domain([0, data_radius(max)])\n .range([0, 25]);\n \n for (var i = 0; i < d.length; i++) {\n \n // set player id\n var id = String('.p' + (i + 1));\n \n // Player Name\n d3.select('#damage-dates')\n .append('div')\n .attr('class', id.replace('.', ''))\n .append('div')\n .attr('class', 'player-name')\n .html('Player ' + (i + 1));\n \n \n var div = d3.select(\"body\").append(\"div\")\t\n .attr(\"class\", \"tooltip\")\t\t\t\t\n .style(\"opacity\", 0);\n \n // ========\n // inflicts\n // ========\n d3.select('#damage-dates ' + id)\n .append('div')\n .attr('class', 'graph-descriptor circle')\n .html('Damage Inflicted');\n \n // Circles \n d3.select('#damage-dates ' + id)\n .append('svg')\n .attr(\"width\", 960)\n .attr(\"height\", 50)\n .selectAll(\"circle\")\n .data(d[i].inflicts)\n .enter()\n .append(\"circle\")\n .attr(\"cx\", function(d, i) { return (137.143 * i) + 68.572; })\n .attr(\"cy\", 25)\n .attr(\"r\", 0)\n .attr('title', function (d) { return delimit(d) + ' damage' })\n .attr('hover-color', c_scheme[0]) \n .style(\"fill\", c_scheme[0])\n .on('mouseover', mouse_over)\t\t\t\t\t\n .on('mouseout', mouse_out) \n .transition()\n .duration(500)\n .delay(function (d, i) { return i * 50 })\n .attr(\"r\", function (d) { return scale(data_radius(d)); });\n \n // Days of the week\n d3.select('#damage-dates ' + id)\n .append('div')\n .attr('class', 'week inflicts')\n .selectAll('div')\n .data(days)\n .enter()\n .append('div')\n .attr('class', 'day-of-week inflicts')\n .style('float', 'left')\n .style('text-align', 'center')\n .style('width', 137.143 + 'px')\n .html(function(d) { return d });\n \n // report\n d3.select('#damage-dates ' + id)\n .append('div')\n .attr('class', 'report')\n .html(player_names[i] + ' has inflicted a total of ' + delimit(d[i].inflicted_total) + ' damage, and inflicts the most on ' + days[d[i].day_inflicted_most] + '.');\n \n // ========\n // Received\n // ========\n d3.select('#damage-dates ' + id)\n .append('div')\n .attr('class', 'graph-descriptor circle')\n .html('Damage Received');\n \n // Circles \n d3.select('#damage-dates ' + id)\n .append('svg')\n .attr(\"width\", 960)\n .attr(\"height\", 50)\n .selectAll(\"circle\")\n .data(d[i].receives)\n .enter()\n .append(\"circle\")\n .attr('title', function (d) { return delimit(d) + ' damage' })\n .attr(\"cx\", function(d, i) { return (137.143 * i) + 68.572; })\n .attr(\"cy\", 25)\n .attr(\"r\", 0)\n .attr('hover-color', c_scheme[0]) \n .style(\"fill\", c_scheme[0])\n .on('mouseover', mouse_over)\t\t\t\t\t\n .on('mouseout', mouse_out) \n .transition()\n .duration(500)\n .delay(function (d, i) { return i * 50 })\n .attr(\"r\", function (d) { return scale(data_radius(d)); });\n \n // Days of the week\n d3.select('#damage-dates ' + id)\n .append('div')\n .attr('class', 'week receives')\n .selectAll('div')\n .data(days)\n .enter()\n .append('div')\n .attr('class', 'day-of-week receives')\n .style('float', 'left')\n // .style('border-left', '1px solid gray')\n // .style('border-right', '1px solid gray') \n .style('text-align', 'center')\n .style('width', 137.143 + 'px')\n .html(function(d) { return d }); \n\n // report\n d3.select('#damage-dates ' + id)\n .append('div')\n .attr('class', 'report')\n .html(player_names[i] + ' has received a total of ' + delimit(d[i].received_total) + ' damage, and receives the most on ' + days[d[i].day_received_most] + '.');\n\n \n } // end for loop\n \n d3.select('#damage-dates')\n .append('div')\n .attr('class', 'spacer');\n \n circletips();\n });\n}", "function initialise(){\n\r\n\t/* Calculate the start month (current - 1)*/\r\n\tintMonthOffset = (12 - intMonth);\r\n\tvar intPreviousMonth = 99;\n\t\r\n\t/*Build the current date object*/\r\n\tdatCurrentDate.setDate(1);\r\n\tdatCurrentDate.setMonth(intMonth);\r\n\tdatCurrentDate.setFullYear(intYear);\r\n\t/* Build the end date one year on */\r\n\tendDate.setDate(1);\r\n\tendDate.setMonth(intMonth);\r\n\tendDate.setFullYear(datCurrentDate.getFullYear()+1);\r\n\tendDate.setDate(1);\r\n\tdocument.getElementById(\"yearDisplay\").innerHTML = \"\";\r\n\t/* Loop through the display 12 months and draw the plan */\r\n\twhile (datCurrentDate< endDate)\r\n\t\t{\n\t\t\r\n\t\t/*Test for new month */\r\n\t\tif (datCurrentDate.getMonth() != intPreviousMonth)\r\n\t\t\t{\r\n\t\t\t/* Clear all previous cell data */\r\n\t\t\tfor (var x = 1; x<=42; x++)\r\n\t\t\t\t{\r\n\t\t\t\tclrElid = \"month\" + (( datCurrentDate.getMonth() + intMonthOffset ) % 12) + \"date\" + x;\r\n\t\t\t\tdocument.getElementById(clrElid).innerHTML = \"\";\r\n\t\t\t\tdocument.getElementById(clrElid).className = \"dateExtra\";\r\n\t\t\t\t}\r\n\t\t\t/* Create the month jump controls and its title */\r\n\t\t\telid = \"monthHeader\" + (( datCurrentDate.getMonth() + intMonthOffset) % 12);\r\n\t\t\tdocument.getElementById(elid).onclick = function(){\tjumpMonthHead(this);\t};\r\n\t\t\tdocument.getElementById(elid).innerHTML = myMonths[datCurrentDate.getMonth()] + \" \" +datCurrentDate.getFullYear();\r\n\t\t\tintPreviousMonth = datCurrentDate.getMonth();\r\n\t\t\tintDayOffset = datCurrentDate.getDay() + 6;\r\n\t\t\t//alert(intDayOffset);\r\n\t\t\t}\r\n\t\t/* Draw the weekdays for the first seven days */\r\n\t\tif (datCurrentDate.getDate() < 8)\r\n\t\t\t{\r\n\t\t\tstrDateId = \"month\" + (( datCurrentDate.getMonth() + intMonthOffset ) % 12) + \"day\" + (( datCurrentDate.getDate() + intDayOffset) % 7);\r\n\t\t\tdocument.getElementById(strDateId).innerHTML = myShortDays[datCurrentDate.getDay()];\r\n\t\t\t//document.getElementById(strDateId).innerHTML = datCurrentDate.getDay();\r\n\t\t\t}\r\n\t\tstrDayId = \"month\" + (( datCurrentDate.getMonth() + intMonthOffset ) % 12) + \"date\" + ( datCurrentDate.getDate() + (intDayOffset %7));\r\n\t\tdocument.getElementById(strDayId).innerHTML = datCurrentDate.getDate();\r\n\t\tdocument.getElementById(strDayId).title = \"\";\r\n\t\tdocument.getElementById(strDayId).className = \"dateShow\";\r\n\t\tdocument.getElementById(strDayId).onclick = function(){\tjumpMonth(this);\t};\r\n\t\tdatCurrentDate.setDate(datCurrentDate.getDate()+1);\r\n\t\t}\r\n\tif (intYear == endDate.getFullYear())\r\n\t\t{\r\n\t\tdocument.getElementById(\"yearDisplay\").innerHTML = intYear;\r\n\t\tdocument.getElementById(\"imgLeft\").title = \"Go back to \" + intYear -1;\r\n\t\tdocument.getElementById(\"imgRight\").title = \"Go forward to \" + intYear+1;\r\n\t\t}\r\n\telse\r\n\t\t{\r\n\t\tdocument.getElementById(\"yearDisplay\").innerHTML = intYear + \"/\" + endDate.getFullYear();\r\n\t\tdocument.getElementById(\"imgLeft\").title = \"Go back to \" + (intYear * 1 -1) + \"/\" + (endDate.getFullYear() *1 -1);\r\n\t\tdocument.getElementById(\"imgRight\").title = \"Go forward to \" + (intYear * 1 + 1) + \"/\" + (endDate.getFullYear() * 1 +1);\r\n\t\t}\r\n\t//listReminders();\r\n\t\r\n\t\r\n\t}", "function renderDaily(data) {\n refs.dailyList.innerHTML = '';\n const templateItem = dailyTpl(data);\n refs.dailyList.insertAdjacentHTML('beforeend', templateItem);\n const roundPopArr = refs.dailyList.querySelectorAll('.daily-pop');\n roundPopArr.forEach(item => (item.textContent = roundPop(item) + '%'));\n const unixToDayArr = refs.dailyList.querySelectorAll('.daily-dt');\n unixToDayArr.forEach(item => (item.textContent = convertTimeToDay(item)));\n const roundTempArr = refs.dailyList.querySelectorAll('.daily-temp');\n roundTempArr.forEach(item => (item.textContent = roundTemp(item) + '°'));\n}", "function displayUpcomming () {\n\t $(\"#upevents\").html('');\n \tvar d = new Date();\n\tvar month = d.getMonth();\n\tvar date = d.getDate();\n\tvar may = Object.keys(May);\n\tvar june = Object.keys(June);\n\tvar july = Object.keys(July);\n\tvar aug = Object.keys(August);\n //date = 7; // for testing ----------------------\n\tdisplayPractice();\n\tif (month === 4 && date > 8) {\n\t\tvar z = findEvent(date, may);\n if ((z + 4) > (may.length)) {\n \t\tvar y = 4 - (may.length - z);\n \t\tfor (var i = z; i < may.length; i++){\n \t\t\t$(\"#upevents\").append(\"<div class='month'>May \" + may[i] + \":</div><div>\" + May[may[i]]+ \"</div>\");\n \t\t}\n for (var i = 0; i < y; i++){\n \t\t\t$(\"#upevents\").append(\"<div class='month'>June \" + june[i] + \":</div><div> \"+ June[june[i]]+\"</div>\");\n \t\t}\n }else {\n for (var i = z; i < z+4; i++){\n $(\"#upevents\").append(\"<div class='month'>May \" + may[i] + \":</div><div> \"+ May[may[i]] + \"</div>\");\n }\n }\n\n\t} else if(month === 5 && date <= parseInt(june[june.length-1])) {\n\t\t\tz = findEvent(date, june);\n\t\t\tif ((z + 4) > (june.length)) {\n\t\t\t\tvar y = 4 - (june.length - z);\n\t\t\t\tfor (var i = z; i < june.length; i++){\n\t\t\t\t\t$(\"#upevents\").append(\"<div class='month'>June \" + june[i] + \":</div><div> \"+ June[june[i]] + \"</div>\");\n\t\t\t\t}\n\t\t\t\tfor (var i = 0; i < y; i++){\n\t\t\t\t\t$(\"#upevents\").append(\"<div class='month'>July \" + july[i] + \":</div><div> \"+ July[july[i]] + \"</div>\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (var i = z; i < z+4; i++){\n\t\t\t\t\t$(\"#upevents\").append(\"<div class='month'>June \" + june[i] + \":</div><div> \"+ June[june[i]] + \"</div>\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else if(month === 5 && date > parseInt(june[june.length-1])) {\n\t\t\tfor (var i = 0; i < 4; i++){\n\t\t\t\t$(\"#upevents\").append(\"<div class='month'>July \" + july[i] + \":</div><div> \"+ July[july[i]] + \"</div>\");\n\t\t\t}\n\t\t}else if (month === 6 && date <= parseInt(july[july.length-1])) {\n\t\t\t\tz = findEvent(date, july);\n\t\t\t\tif ((z + 4) > (july.length)) {\n if (aug.length > 3) {\n y = 4 - (july.length - z);\n } else {\n y = aug.length;\n }\n\t\t\t\t\tfor (var i = z; i < july.length; i++){\n\t\t\t\t\t\t$(\"#upevents\").append(\"<div class='month'>July \" + july[i] + \":</div><div> \"+ July[july[i]] + \"</div>\");\n\t\t\t\t\t}\n\t\t\t\t\tfor (var i = 0; i < y; i++){\n\t\t\t\t\t\t$(\"#upevents\").append(\"<div class='month'>August \" + aug[i] + \":</div><div> \"+ August[aug[i]] + \"</div>\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tfor (var i = z; i < z+4; i++){\n\t\t\t\t\t\t$(\"#upevents\").append(\"<div class='month'>July \" + july[i] + \":</div><div> \"+ July[july[i]] + \"</div>\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t} else if(month === 6 && date > parseInt(july[july.length-1])) {\n\n\t\tfor (var i = 0; i < aug.length; i++){\n\t\t\t$(\"#upevents\").append(\"<div class='month'>August \" + aug[i] + \":</div><div> \"+ August[aug[i]] + \"</div>\");\n\t\t}\n\t}else if ( month === 7 && date <= parseInt(aug[aug.length-1])) {\n\t\t\tz = findEvent(date, aug);\n\t\t\tfor (var i = z; i < aug.length; i++){\n\t\t\t\t$(\"#upevents\").append(\"<span class='month'>August \" + aug[i] + \":</span><br> \"+ August[aug[i]] + \"<br>\");\n\t\t\t}\n\t} else if (isNaN(parseInt(aug[aug.length-1]))) {\n\t\t$(\"#upevents\").html(\"<div>Thanks for a Great Season!<br>No Upcomming Events<br>until Next Year!</div>\");\n }else if (month == 7 && date > parseInt(aug[aug.length-1]) || month > 7){\n $(\"#upevents\").html(\"<div>Thanks for a Great Season!<br>No Upcomming Events<br>until Next Year!</div>\");\n }else {\n\t\t$(\"#upevents\").html(\"<button class='mynav' data-nav='tryouts'>Summer 2020 Information &<br/>Tryout Dates TBA\") //<br/><span class='mybold1'>Click Here for More Information</span></button><hr/>\");\n\t}\n}//end of upcomming events function", "function updateMonthly() {\n let payment = document.getElementById(\"monthly-payment\");\n payment.textContent = calculateMonthlyPayment(UIValues);\n}", "function loanDatesPanel_Set(loan) {\n $(\"#CounselingCompletedDate_helm\").text(helm.formatText(loan.CounselingCompletedDateFormatted));\n $(\"#ApplicationDate_helm\").text(helm.formatText(loan.ApplicationDateFormatted));\n $(\"#FhaCaseNoDate_helm\").text(helm.formatText(loan.FhaCaseNoDateFormatted));\n $(\"#EstClosingDate_helm\").text(helm.formatText(loan.EstClosingDateFormatted));\n $(\"#ClosingDate_helm\").text(helm.formatText(loan.ClosingDateFormatted));\n $(\"#FundingDate_helm\").text(helm.formatText(loan.FundingDateFormatted));\n $(\"#GfeLastDisclosedDate_helm\").text(helm.formatText(loan.GfeLastDisclosedDateFormatted));\n\n $(\"#SubmittedProcessingDate_helm\").text(helm.formatText(loan.SubmittedProcessingDateFormatted));\n $(\"#SubmittedUwDate_helm\").text(helm.formatText(loan.SubmittedUwDateFormatted));\n $(\"#ClearedToCloseDate_helm\").text(helm.formatText(loan.ClearedToCloseDateFormatted));\n $(\"#ServicingBoardedDate_helm\").text(helm.formatText(loan.ServicingBoardedDateFormatted));\n $(\"#MicDate_helm\").text(helm.formatText(loan.MicDateFormatted));\n $(\"#AppraisalExpDate_helm\").text(helm.formatText(loan.AppraisalExpDateFormatted));\n\n }", "renderMonthYear() {\n this.elements.month.textContent = `${this.data.monthList[this.data.dates.current.getMonth()]} ${this.data.dates.current.getFullYear()}`;\n }", "function injectDateToHTML(date) {\n const h2Elems = Array.from(\n document.querySelectorAll('.repository-content .BorderGrid-cell > h2')\n );\n\n const aboutElementContainer = h2Elems.find(\n (elem) => elem.textContent === 'About'\n ).parentElement;\n\n const dateHTML = `\n <div id=\"gdc\" class=\"mt-3\">\n <a class=\"muted-link\" href=\"#\">\n <svg height=\"16\" class=\"octicon octicon-calendar mr-2\" mr=\"2\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" aria-hidden=\"true\"><path fill-rule=\"evenodd\" d=\"M13 2h-1v1.5c0 .28-.22.5-.5.5h-2c-.28 0-.5-.22-.5-.5V2H6v1.5c0 .28-.22.5-.5.5h-2c-.28 0-.5-.22-.5-.5V2H2c-.55 0-1 .45-1 1v11c0 .55.45 1 1 1h11c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1zm0 12H2V5h11v9zM5 3H4V1h1v2zm6 0h-1V1h1v2zM6 7H5V6h1v1zm2 0H7V6h1v1zm2 0H9V6h1v1zm2 0h-1V6h1v1zM4 9H3V8h1v1zm2 0H5V8h1v1zm2 0H7V8h1v1zm2 0H9V8h1v1zm2 0h-1V8h1v1zm-8 2H3v-1h1v1zm2 0H5v-1h1v1zm2 0H7v-1h1v1zm2 0H9v-1h1v1zm2 0h-1v-1h1v1zm-8 2H3v-1h1v1zm2 0H5v-1h1v1zm2 0H7v-1h1v1zm2 0H9v-1h1v1z\"></path></svg>\n ${date}\n </a> \n </div>\n `;\n\n aboutElementContainer.insertAdjacentHTML('beforeend', dateHTML);\n}", "function displayDates() {\n //Display right year\n var year = x.getFullYear();\n document.getElementById(\"thisYear\").innerText = year;\n //Display right month\n const months = {\n 0: \"January\", 1: \"February\", 2: \"March\", 3: \"April\", 4: \"May\", 5: \"June\", 6: \"July\",\n 7: \"August\", 8: \"September\", 9: \"October\", 10: \"November\", 11: \"December\"\n };\n var idmonth = document.getElementById(\"month\");\n var month = x.getMonth();\n idmonth.innerText = months[month];\n idmonth.style.fontSize = \"20px\";\n idmonth.style.letterSpacing = \"3px\";\n idmonth.style.textTransform = \"uppercase\";\n //Create days for display\n const dNumb = [];\n var ul = document.getElementById(\"days\");\n var lom = { 0: 31, 1: 28, 2: 31, 3: 30, 4: 31, 5: 30, 6: 31, 7: 31, 8: 30, 9: 31, 10: 30, 11: 31 };\n var ulSize = ul.getElementsByTagName(\"li\").length;\n var leapYear = getLeapYear(year);\n if (leapYear == true) {\n lom[1] = 29;\n }\n //Add days to calendar\n if (ulSize != 0) {\n ul.innerHTML = '';\n }\n var dim = lom[month];\n const rightDate = new Date(year, month, 1);\n for (let i = 1; i <= dim; i++) {\n dNumb.push(i);\n }\n if (rightDate.getDay() != 1) {\n if (rightDate.getDay() == 0) {\n for (var i = 0; i < 6; i++) {\n dNumb.unshift(\"\");\n }\n } else {\n for (var i = 0; i < (rightDate.getDay() - 1); i++) {\n dNumb.unshift(\"\");\n }\n }\n }\n for (let i = 0; i < dNumb.length; i++) {\n var li = document.createElement(\"li\");\n var btn = document.createElement(\"button\");\n btn.innerHTML = dNumb[i];\n btn.onclick = nextView;\n li.appendChild(btn);\n ul.appendChild(li);\n }\n //Display today\n const dayslist = ul.getElementsByTagName('li');\n for (var i = 0; i <= dayslist.length; i++) {\n if (dayslist[i].innerText == (x.getDate())) {\n dayslist[i].style.backgroundColor = \"#1abc9cd6\";\n }\n }\n}", "function showCalendar(month, year, event) {\n\n let today = new Date();\n let firstDay = new Date(year, month).getDay();\n let totalDays = 32 - new Date(year, month, 32).getDate();\n // Calendar container with monthly numbers of days\n let calendarCont = document.querySelector('.month-num');\n // 'month - year' in selection of previous and nest \n let monthYear = document.querySelector('.month-year');\n let viewedMonth = monthsArr[month]; // test\n console.log(viewedMonth);\n monthYear.innerHTML = `${monthsArr[month]} ${year}`;\n calendarCont.innerHTML = \"\";\n // scheduled events for a specific month of the year\n let theseEvents = event.filter(even => even.date.getFullYear() == year && even.date.getMonth() == month);\n console.log(theseEvents); // test\n\n let date = 1;\n\n for (let i = 0; i < 6; i++) {\n let week = document.createElement('div');\n week.classList.add('weeks');\n\n for (let j = 0; j < 7; j++) {\n\n if (i == 0 && j < firstDay) {\n let emptyCell = document.createElement('div');\n emptyCell.classList.add('empty');\n week.appendChild(emptyCell);\n\n } else if (date <= totalDays) {\n let numCell = document.createElement('div');\n numCell.classList.add('num');\n\n if (date == today.getDate() && month == today.getMonth() && year == today.getFullYear()) {\n numCell.classList.add('today');\n };\n\n let numCellEvent = \"\";\n\n let w = window.innerWidth;\n let eventPlan = document.querySelector('.event-plan');\n let leftSideBlue = document.querySelector('.blue');\n let rightSideRed = document.querySelector('.red');\n\n if (theseEvents.length) {\n let todayEvent = theseEvents.filter(eve => eve.date.getDate() == date);\n console.log(todayEvent); // test\n\n if (todayEvent.length && w > 992) {\n numCell.classList.add('event');\n\n todayEvent.forEach(ev => {\n numCellEvent += `<div class=\"eve\" style=\"border-left:4px solid ${ev.bgColor}\"><div>${ev.title}</div><div>${ev.time}</div><div>${ev.day}</div></div><span style=\"color:white !important\">${date}</span>`;\n numCell.style.backgroundColor = ev.bgColor;\n numCell.style.color = ev.color;\n });\n };\n\n // extra for tablet and mobile start \n\n if (todayEvent.length && w < 993) {\n numCell.classList.remove('event');\n\n todayEvent.forEach(ev => {\n console.log(todayEvent); // test\n if (ev.date.getMonth() == monthsArr.indexOf(viewedMonth)) {\n console.log(monthsArr.indexOf(viewedMonth)); // test 4 i ne se menuva, juni vo 5\n eventPlan.style.display = 'block';\n console.log(ev.date.getMonth()); // test 4\n\n if (ev.bgColor == 'blue') {\n leftSideBlue.innerHTML += `<div class=\"left-event\">\n <p class=\"date\">${ev.date.getDate()}/${ev.date.getMonth()}/${ev.date.getFullYear()}</p>\n <h5 class=\"title\">${ev.title}</h5>\n <p class=\"hours\">${ev.time}ч</p>\n </div>`;\n numCell.style.backgroundColor = ev.bgColor;\n numCell.style.color = ev.color;\n }\n\n if (ev.bgColor == 'red') {\n rightSideRed.innerHTML += `<div class=\"right-event\">\n <p class=\"date\">${ev.date.getDate()}/${ev.date.getMonth()}/${ev.date.getFullYear()}</p>\n <h5 class=\"title\">${ev.title}</h5>\n <p class=\"hours\">${ev.time}ч</p>\n </div>`;\n numCell.style.backgroundColor = ev.bgColor;\n numCell.style.color = ev.color;\n }\n\n if (ev.bgColor == 'orange') {\n leftSideBlue.innerHTML += `<div class=\"left-event-orange\">\n <p class=\"date\">${ev.date.getDate()}/${ev.date.getMonth()}/${ev.date.getFullYear()}</p>\n <h5 class=\"title\">${ev.title}</h5>\n <p class=\"hours\">${ev.time}ч</p>\n </div>`;\n numCell.style.backgroundColor = ev.bgColor;\n numCell.style.color = ev.color;\n }\n\n }\n\n });\n\n };\n\n } else if (!theseEvents.length) { // ova raboti \n leftSideBlue.innerHTML = '';\n rightSideRed.innerHTML = '';\n eventPlan.style.display = 'none';\n };\n // extra for tablet and mobile ends here\n\n numCell.innerHTML = (numCellEvent == \"\") ?\n `<span>${date}</span>` : numCellEvent;\n\n week.appendChild(numCell);\n\n date++;\n\n } else if (date > totalDays) {\n let emptyCell = document.createElement('div');\n emptyCell.classList.add('empty');\n week.appendChild(emptyCell);\n };\n\n };\n\n calendarCont.appendChild(week);\n };\n\n}", "function updateUI(data) {\n\tdocument.getElementById('date').innerHTML = 'Date : ' + data['date'];\n\tdocument.getElementById('temp').innerHTML = 'Temprature : ' + data['temp'];\n\tdocument.getElementById('content').innerHTML = 'Feelings : ' + data['content'];\n}", "function Calendar(div_id, get_data) {\n // div_id (string) is the ID of the element in which the calendar will\n // be displayed\n // clickCallback (string) is the name of a JavaScript function that will be\n // called with the parameters (year, month, day) when a day in the\n // calendar is clicked\n this.div_id = div_id;\n this.putDataCallback = get_data;\n this.today = new Date();\n this.currentMonth = this.today.getMonth() + 1;\n this.currentYear = this.today.getFullYear();\n}", "function handleReportDOMUpdate(data){\n\n const updateDOMStructure = `\n <div class=\"report\" id =\"entryHolder\">\n <div class=\"left-side\">\n <h3>weather report</h3>\n <ul class=\"report-item\">\n <li>city: <span>${data.city}</span></li>\n <li>weather state: <span>${data.weatherState}</span></li>\n <li id=\"temp\">temperatrue: <span>${data.temp}&deg;C</span></li>\n <li id=\"content\">your feeling: <span>${data.userFeel}</span></li>\n </ul>\n </div>\n <div class=\"right-side\">\n <img src=\"http://openweathermap.org/img/w/${data.weatherIcon}.png\" alt=\"weather icon\">\n </div>\n <span id=\"date\">${data.currentTime}</span>\n</div>\n `\n document.getElementById('createArea').innerHTML = updateDOMStructure;\n}", "timeDisplay(time) {\n let x = null\n switch((time)) {\n case \"metricGoalsMonths\":\n x = (\n <div>\n <h2 id='month'> Month <span class=\"required\">*</span></h2>\n <select\n onChange={(e) => this.updateSelectForm(e)}>\n {/* <option value=\"January\">January</option>\n <option value=\"February\">February</option>\n <option value=\"March\">March</option>\n <option value=\"April\">April</option>\n <option value=\"May\">May</option>\n <option value=\"June\">June</option>\n <option value=\"July\">July</option>\n <option value=\"August\">August</option>\n <option value=\"September\">September</option>\n <option value=\"October\">October</option>\n <option value=\"November\">November</option>\n <option value=\"December\">December</option> */}\n <option value={1}>January</option>\n <option value={2}>February</option>\n <option value={3}>March</option>\n <option value={4}>April</option>\n <option value={5}>May</option>\n <option value={6}>June</option>\n <option value={7}>July</option>\n <option value={8}>August</option>\n <option value={9}>September</option>\n <option value={10}>October</option>\n <option value={11}>November</option>\n <option value={12}>December</option>\n </select>\n </div>)\n break;\n case \"metricGoalsQuarters\":\n x = (\n <div>\n <h2 id='quarter'> Quarter <span class=\"required\">*</span></h2>\n <select\n onChange={(e) => this.updateSelectForm(e)}>\n <option selected=\"selected\">None</option>\n <option value=\"1\">Quarter 1</option>\n <option value=\"2\">Quarter 2</option>\n <option value=\"3\">Quarter 3</option>\n <option value=\"4\">Quarter 4</option> \n </select>\n </div>\n )\n break;\n case \"metricGoalsAnnuals\":\n x = (\n <div>\n No Action Needed\n </div>\n )\n break;\n }\n return x\n }", "function conteggioMesi(month){\n\n //imposto una variabile per calcolare i giorni del mese del mese che imposto\n var giorniMese = moment(\"2018-\" + month, \"YYYY-MM\").daysInMonth();\n \n \n //apro un ciclo for sulla lunghezza del mese che ho selezionato nella mia variabile\n for (i = 1; i <= giorniMese; i++) {\n //variabile che valorizza la data\n var currentDate = moment('2018-' + month + '-' + i , 'YYYY-MM-D').format('YYYY-MM-DD');\n\n //creo la variabile che mi stamperà in pagina l'output\n var currentDay = moment(currentDate).format(\"dddd DD MMMM\");\n //stampo in pagina\n $(\".mese\").append('<div data-date=\"' + currentDate + '\">' + currentDay + '</div>');\n }\n }", "function get_specified_calendar(calendar_year, calendar_month, dst) {\n while (calendar_month < 0) {\n calendar_month += 12;\n calendar_year--;\n }\n while (calendar_month > 11) {\n calendar_month -= 12;\n calendar_year++;\n }\n if (calendar_year < 1975) {\n calendar_year = 1975;\n }\n if (calendar_year > 2020) {\n calendar_year = 2020;\n }\n\n var buf;\n var date = new Date(calendar_year, calendar_month, 1);\n var month = date.getMonth();\n var year = date.getFullYear();\n var day = date.getDay();\n\n var td = new Date();\n var today = td.getDate();\n var today_month = td.getMonth();\n var today_year = td.getFullYear();\n\n if (day == 0)\n day = 7;\n var days;\n\n buf = \"<div id=\\\"calendar_div_\" + dst + \"\\\">\";\n buf += \"<table class=\\\"tt_calendar\\\" width=\\\"170\\\" border=\\\"0\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\">\";\n buf += \"<tr>\";\n buf += \"<td bgcolor=\\\"#000000\\\">\";\n buf += \" <table width=\\\"100%\\\" border=\\\"0\\\" cellpadding=\\\"0\\\" cellspacing=\\\"0\\\" bgcolor=\\\"#999999\\\">\";\n buf += \" <tr>\";\n buf += \" <td height=\\\"17\\\"><a href=\\\"left\\\" onclick=\\\"change_calendar(\" + calendar_year + \",\" + (calendar_month - 1) + \",'\" + dst + \"'); return false;\\\"><img src=\\\"img/arrow-left.gif\\\" width=\\\"10\\\" height=\\\"10\\\" hspace=\\\"3\\\" border=\\\"0\\\"/></a></td>\";\n buf += \" <td align=\\\"center\\\"><b><font color=\\\"#FFFFFF\\\" class=\\\"small10\\\">\" + get_month_name(calendar_month) + \", \" + calendar_year + \"</font></b></td>\";\n buf += \" <td align=\\\"right\\\"><a href=\\\"right\\\" onclick=\\\"change_calendar(\" + calendar_year + \",\" + (calendar_month + 1) + \",'\" + dst + \"'); return false;\\\"><img src=\\\"img/arrow-right.gif\\\" width=\\\"10\\\" height=\\\"10\\\" hspace=\\\"3\\\" border=\\\"0\\\"/></a></td>\";\n buf += \" </tr>\";\n buf += \" </table>\";\n buf += \" <table width=\\\"100%\\\" border=\\\"0\\\" cellpadding=\\\"0\\\" cellspacing=\\\"0\\\" bgcolor=\\\"#FFFFFF\\\">\";\n buf += \" <tr align=\\\"right\\\" bgcolor=\\\"#EEEEEE\\\">\";\n buf += \" <td width=\\\"20\\\" height=\\\"14\\\"><font color=\\\"#006699\\\" class=\\\"small8\\\">\" + get_day_name(0) + \"</font></td>\";\n buf += \" <td width=\\\"20\\\"><font color=\\\"#006699\\\" class=\\\"small8\\\">\" + get_day_name(1) + \"</font></td>\";\n buf += \" <td width=\\\"20\\\"><font color=\\\"#006699\\\" class=\\\"small8\\\">\" + get_day_name(2) + \"</font></td>\";\n buf += \" <td width=\\\"20\\\"><font color=\\\"#006699\\\" class=\\\"small8\\\">\" + get_day_name(3) + \"</font></td>\";\n buf += \" <td width=\\\"20\\\"><font color=\\\"#006699\\\" class=\\\"small8\\\">\" + get_day_name(4) + \"</font></td>\";\n buf += \" <td width=\\\"20\\\"><font color=\\\"#006699\\\" class=\\\"small8\\\">\" + get_day_name(5) + \"</font></td>\";\n buf += \" <td width=\\\"20\\\"><font color=\\\"#006699\\\" class=\\\"small8\\\">\" + get_day_name(6) + \"</font></td>\";\n buf += \" </tr>\";\n\n switch (month) {\n case 0:\n case 2:\n case 4:\n case 6:\n case 7:\n case 9:\n case 11:\n days = 31;\n break;\n case 1:\n days = (year % 4 == 0) ? 29 : 28;\n break;\n case 3:\n case 5:\n case 8:\n case 10:\n days = 30;\n break;\n default:\n days = 0;\n abort(\"Incorrect month!\");\n }\n\n var td_buf = \"\";\n for (var i = 2 - day; i <= days; i++) {\n buf += \"<tr>\";\n for (; (i + day - 1) % 7 > 0; i++) {\n td_buf = (i == today && calendar_month == today_month && calendar_year == today_year) ? \" class=\\\"bg_active\\\"\" : \"\";\n buf += (i <= 0 || i > days) ? \"<td align=\\\"right\\\"><font color=\\\"#FF0000\\\" class=\\\"small10\\\">&#160;</font></td>\" : \"<td align=\\\"right\\\"\" + td_buf + \"><a href=\\\"javascript:void(0);\\\" onclick=\\\"EditCalendar(\" + calendar_year + \",\" + calendar_month + \",\" + i + \",'\" + dst + \"'); return false;\\\"><font color=\\\"#000000\\\" class=\\\"small10\\\">\" + i + \"</font></a></td>\";\n }\n td_buf = (i == today && calendar_month == today_month && calendar_year == today_year) ? \" class=\\\"bg_active\\\"\" : \"\"; //\"\n if (i > 0 && i <= days)\n buf += \"<td align=\\\"right\\\"\" + td_buf + \"><a href=\\\"javascript:void(0);\\\" onclick=\\\"EditCalendar(\" + calendar_year + \",\" + calendar_month + \",\" + i + \",'\" + dst + \"'); return false;\\\"><font color=\\\"#FF0000\\\" class=\\\"small10\\\">\" + i + \"</font></a></td>\"; //\"\n buf += \"</tr>\";\n }\n\n buf += \" </table>\";\n buf += \"</td>\";\n buf += \"</tr>\";\n buf += \"</table>\";\n buf += \"</div>\";\n\n return buf;\n}", "function changeStockTicker (date) { \nstockTickerHTML = \"\"\n checkStockDelta(dowArray)\n checkStockDelta(SP500Array)\n checkStockDelta(NASDAQArray)\n checkStockDelta(oilArray)\n checkStockDelta(goldArray)\n // console.log(stockTickerHTML)\n ticker.innerHTML = `<div class=\"ticker__item__up\">${moment(date).format('dddd MMMM Do YYYY')}</div>` + stockTickerHTML\n}", "function updateViz(val){\r\n d3.select('#month').html(listMonths[val-1]);\r\n drawMap(currentMonth, currentYear); \r\n }", "function idleRefresh () {\r\n\tif (currency_data.hasOwnProperty('today') &&\r\n\t\t\tcurrency_data.hasOwnProperty('tomorrow'))\r\n\t{\r\n\t\twnd[0].label = 'Курсы валют от ЦБ';\r\n\t\twnd[1].label = 'Сегодня:';\r\n\t\twnd[2].label = currency_data.tomorrow.date + ' :';\r\n\r\n\t\tvar diff = parseFloat(currency_data.tomorrow.usd.replace(',', '.')) -\r\n\t\t\tparseFloat(currency_data.today.usd.replace(',', '.'));\r\n\r\n\t\twnd[4].label = currency_data.today.usd;\r\n\t\twnd[5].label = diff.toFixed(4);\r\n\t\twnd[6].label = currency_data.tomorrow.usd;\r\n\r\n\t\tdiff = parseFloat(currency_data.tomorrow.eur.replace(',', '.')) -\r\n\t\t\tparseFloat(currency_data.today.eur.replace(',', '.'));\r\n\r\n\t\twnd[8].label = currency_data.today.eur;\r\n\t\twnd[9].label = diff.toFixed(4);\r\n\t\twnd[10].label = currency_data.tomorrow.eur;\r\n\t}\r\n}", "static countdown() {\n jQuery('.js-countdown').countdown((new Date().getFullYear() + 2) + '/02/01', (e) => {\n jQuery(e.currentTarget).html(e.strftime('<div class=\"row items-push push text-center\">'\n + '<div class=\"col-6 col-md-3\"><div class=\"font-size-h1 font-w700 text-white\">%-D</div><div class=\"font-size-sm font-w700 text-muted\">DAYS</div></div>'\n + '<div class=\"col-6 col-md-3\"><div class=\"font-size-h1 font-w700 text-white\">%H</div><div class=\"font-size-sm font-w700 text-muted\">HOURS</div></div>'\n + '<div class=\"col-6 col-md-3\"><div class=\"font-size-h1 font-w700 text-white\">%M</div><div class=\"font-size-sm font-w700 text-muted\">MINUTES</div></div>'\n + '<div class=\"col-6 col-md-3\"><div class=\"font-size-h1 font-w700 text-white\">%S</div><div class=\"font-size-sm font-w700 text-muted\">SECONDS</div></div>'\n + '</div>'\n ));\n });\n }", "function onChange (){\n document.querySelector(\".birthdate\").innerHTML = '<input placeholder=\"Select date\" type=\"date\" id=\"input-birthdate\" min=\"1900-01-01\" max=\"2005-12-31\" class=\"form-control\">';\n inputBirthDate = document.getElementById('input-birthdate');\n inputBirthDate.addEventListener('change', function(e){\n e.preventDefault();\n const months = {\n 0: 'January',\n 1: 'February',\n 2: 'March',\n 3: 'April',\n 4: 'May',\n 5: 'June',\n 6: 'July',\n 7: 'August',\n 8: 'September',\n 9: 'October',\n 10: 'November',\n 11: 'December'\n }\n var firstPartInnerHTML = '<input placeholder=\"';\n firstPartInnerHTML += getDateFromOld(inputBirthDate.value);\n firstPartInnerHTML += '\" type=\"text\" readonly id=\"input-birthdate\" class=\"form-control\">'\n firstPartInnerHTML += '<div class=\"change-button\"> <button class=\"btn changeBirthDate\" onclick=\"onChange()\" id=\"change\">Change Birth Date</button></div>'\n document.querySelector(\".birthdate\").innerHTML = firstPartInnerHTML;\n })\n \n}", "function displayDate() {\n var currentDay = new Date();\n var month;\n var date = currentDay.getDate();\n var year = currentDay.getFullYear();\n \n switch (currentDay.getMonth()) {\n case 0:\n month = \"January\";\n break;\n case 1:\n month = \"February\";\n break;\n case 2:\n month = \"March\";\n break;\n case 3:\n month = \"April\";\n break;\n case 4:\n month = \"May\";\n break;\n case 5:\n month = \"June\";\n break;\n case 6:\n month = \"July\";\n break;\n case 7:\n month = \"August\";\n break;\n case 8:\n month = \"September\";\n break;\n case 9:\n month = \"October\";\n break;\n case 10:\n month = \"November\";\n break;\n case 11:\n month = \"December\";\n break;\n }\n var dateDiv = document.getElementById('date');\n dateDiv.innerText = month + \" \" + date + \", \" + year;\n }", "function showMonthOfTime() {\n let start = document.getElementById('input1').value;\n let end = document.getElementById('input2').value;\n let result = document.getElementById('result');\n\n result.innerHTML = ` The month of ${diffYear(start, end)}`;\n result.style.textAlign = 'center';\n\n\n\n}", "numberCalendar() {\n \n // update this.monthInfo\n this.monthInfo.firstDayOfWeek = new Date (this.year, this.month, 1).getDay();\n this.monthInfo.daysLast = new Date (this.year, this.month, 0).getDate();\n this.monthInfo.daysThis = new Date (this.year + parseInt((this.month + 1) / 12), (this.month + 1), 0).getDate();\n \n // declare variable that will hold the day info\n var dateToDisplay;\n\n // get all of the day squares\n var daySquares = C('day-square');\n\n // loop through all of the day squares\n for (var i = 0; i < 42; i++) {\n\n // calculate the day with respect to the first of the month\n // not adjusted for month lengths (i.e. last month's dates are negative,\n // next month's dates start at [last day of this month] + 1)\n dateToDisplay = daySquares[i].children[0].innerHTML = i - this.monthInfo.firstDayOfWeek + 1;\n\n // adjust the date and day square if it is part of the previous month\n if (dateToDisplay <= 0) {\n dateToDisplay += this.monthInfo.daysLast;\n daySquares[i].classList.add('not-month');\n }\n \n // adjust the date and day square if it is part of the next month\n else if (dateToDisplay > this.monthInfo.daysThis) {\n dateToDisplay -= this.monthInfo.daysThis;\n daySquares[i].classList.add('not-month');\n }\n \n // make all other days have regular formatting\n else {\n daySquares[i].classList.remove('not-month');\n }\n\n // set dateToDisplay to be in the <p> tag of the proper daySquare\n daySquares[i].children[0].innerHTML = dateToDisplay;\n\n }\n\n // if the last week of the calendar is not needed, hide it\n if (O('last-sunday').classList.contains('not-month')) {\n O('last-week').classList.add('hidden');\n }\n\n // if the last week of the calendar is needed, show it\n else {\n O('last-week').classList.remove('hidden');\n }\n\n }", "function dates(){\n date1.innerHTML =moment().add(1, 'days').format('L');\n date2.innerHTML =moment().add(2, 'days').format('L');\n date3.innerHTML =moment().add(3, 'days').format('L');\n date4.innerHTML =moment().add(4, 'days').format('L');\n date5.innerHTML =moment().add(5, 'days').format('L');\n}", "function showDeadline(deadline) {\n //get elems from page\n const day = document.querySelector('[data-date=\"day\"]'),\n dateOfMonth = document.querySelector('[data-date=\"date\"]'),\n month = document.querySelector('[data-date=\"month\"]'),\n year = document.querySelector('[data-date=\"year\"]'),\n hours = document.querySelector('[data-date=\"hours\"]'),\n minutes = document.querySelector('[data-date=\"minutes\"]');\n\n \n //form date from deadline\n const date = new Date(deadline);\n //get needed values from date\n const deadlineDay = date.toLocaleString(\"en-en\", { weekday: \"long\" }), // alternative old method - days[date.getDay()] from const days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];\n deadlineDate = date.getDate(),\n deadlineMonth = date.toLocaleString(\"en-en\", { month: \"long\" }),\n deadlineYear = date.getFullYear(),\n deadlineHours = date.getHours(),\n deadlineMinutes = date.getMinutes();\n\n //put this values in html\n day.textContent = deadlineDay;\n dateOfMonth.textContent = deadlineDate;\n month.textContent = deadlineMonth;\n year.textContent = deadlineYear;\n hours.textContent = deadlineHours;\n minutes.textContent = deadlineMinutes;\n\n }", "function update2() {\n if (!(year in data)) return;\n title.text(year);\n tempYears.transition()\n .duration(750)\n .attr(\"transform\", \"translate(\" + (tGraphx(year1) - tGraphx(year)) + \",0)\");\n\n tempYear.selectAll(\"rect\")\n .data(function(tempYear) { return data[year][tempYear] || [-800, -800]; })\n .transition()\n .duration(750)\n .attr(\"y\", tGraphy)\n \n .attr(\"year\",function(d){return glob2=year;})\n\n .attr(\"sum\", function(value) {value3.push(value);})//new\n\n .attr(\"height\", function(value) { return height1 - tGraphy(value); });\n var tem= 2014-glob2;\n var tempor=value3.length;\n var newtem= 2014-glob2;\n if(tem >12){newtem=tem*2-tem;}\n \n if(tem<=12){\n while(value3.length!=12)\n {\n while(value3.length>tempor-newtem)\n {\n value3.pop();\n }\n value3.shift();\n }\n }\n\n if(tem>12){\n while(value3.length!=12)\n {\n while(value3.length>tempor-newtem+(12-tem))\n {\n value3.pop();\n }\n value3.shift();\n }\n }\n\n }", "function update2() {\n if (!(year in data)) return;\n title.text(year);\n// var value3=[];\n tempYears.transition()\n .duration(750)\n .attr(\"transform\", \"translate(\" + (tGraphx(year1) - tGraphx(year)) + \",0)\");\n\n tempYear.selectAll(\"rect\")\n .data(function(tempYear) { return data[year][tempYear] || [-800, -800]; })\n .transition()\n .duration(750)\n .attr(\"y\", tGraphy)\n \n .attr(\"year\",function(d){return glob2=year;})\n\n .attr(\"sum\", function(value) {value3.push(value);})//new where temps are stored\n\n .attr(\"height\", function(value) { return height1 - tGraphy(value); });\n var tem= 2014-glob2;\n var tempor=value3.length;\n var newtem= 2014-glob2;\n if(tem >12){newtem=tem*2-tem;}\n \n if(tem<=12){\n while(value3.length!=12)\n {\n while(value3.length>tempor-newtem)\n {\n value3.pop();\n }\n value3.shift();\n }\n }\n\n if(tem>12)\n {\n while(value3.length!=12)\n {\n while(value3.length>tempor-newtem+(12-tem))\n {\n value3.pop();\n }\n value3.shift();\n }\n }\n\n }", "function load(){\n $(\"#cal\").empty();\n var curMonth = toMonth.month;\n var curYear = toMonth.year;\n globalMonth=toMonth;\n var weeksinMonth=toMonth.getWeeks();\n var str=\"\";\n str=str.concat(\"<table align='center' border=1 cellpadding=2> <tr> <th class='cell'>Sun <th class='cell'>Mon <th class='cell'>Tue <th class='cell'>Wed <th class='cell'>Thu <th class='cell'>Fri <th class='cell'>Sat</tr>\");\n for(var i=0;i<weeksinMonth.length;i++){\n str=str.concat(\"<tr>\");\n var daysinWeek= weeksinMonth[i].getDates();\n for(var j=0;j<7;j++){\n var theDay= daysinWeek[j].getDate();\n var theMonth= daysinWeek[j].getMonth();\n if (theMonth == curMonth){\n var preDivElem = \"<td class='cell' id='\";\n var postDivElem = \"'>\"; \n var newDivElem = preDivElem+theDay.toString()+postDivElem;\n str=str.concat(newDivElem.concat(theDay));\n }\n else{\n str=str.concat(\"<td class='oldcell'>\".concat(theDay));\n }\n }\n str=str.concat(\"</tr>\");\n}\nstr=str.concat(\"</table>\");\nif($(\"#loggedUser\").attr(\"data-tog\") == \"1\") {\n var pre = \"\";\n var newCurMonth = parseInt(curMonth)+1;\n if (curMonth < 10){\n pre = \"0\"; \n}\nvar queryMonth = curYear+\"-\"+pre+newCurMonth.toString();\nvar pdata = {\n queryMonth : queryMonth\n};\n/*Using jquery ajax call. filtering json data using inbuilt type:'json' method so that no parse in needed*/\n$.ajax({type:'POST', url: 'fetchEvents_ajax.php', data: pdata, dataType: 'json', success: function(response) { \n for (var i = 0; i < response.length; ++i) \n {\n var resp = response[i];\n if (usrname == resp.host){\n $(\"#\"+resp.day).append('<li class=\"event '+resp.eventTag+'\" data-eventID=\"'+resp.eventID+'\" data-time=\"'+resp.time+'\" data-desc=\"'+resp.desc+'\">'+resp.title+'</li>');\n }\n else{\n $(\"#\"+resp.day).append('<li class=\"invitedEvent '+resp.eventTag+'\" data-eventID=\"'+resp.eventID+'\" data-time=\"'+resp.time+'\" data-host=\"'+resp.host+'\" data-owner=\"'+resp.owner+'\" data-desc=\"'+resp.desc+'\">'+resp.title+'</li>');\n }\n}\n}});\n}\ndocument.getElementById(\"cal\").innerHTML = str;\ndocument.getElementById(\"date\").innerHTML = monthList[curMonth] + \", \" + curYear;\n}", "function money_dates() {\n \n var c_scheme = ['#00897B', '#00897B'];\n \n // Select #main div, add #money and then .section .title\n d3.select('#main')\n .append('div')\n .attr('id', 'money-dates')\n .append('div')\n .attr('class', 'section title')\n .html('In-Game Money Transactions by Days of the Week');\n \n $.get('/money_dates', function(d) {\n \n var max = 0;\n \n for (var i = 0; i < d.length; i++) {\n if (max < d[i].earned_highest) max = d[i].earned_highest;\n if (max < d[i].spent_highest) max = d[i].spent_highest;\n }\n \n // set scale to highest value\n var scale = d3.scaleLinear()\n .domain([0, data_radius(max)])\n .range([0, 25]);\n \n for (var i = 0; i < d.length; i++) {\n \n // set player id\n var id = String('.p' + (i + 1));\n \n // Player Name\n d3.select('#money-dates')\n .append('div')\n .attr('class', id.replace('.', ''))\n .append('div')\n .attr('class', 'player-name')\n .html('Player ' + (i + 1));\n \n \n var div = d3.select(\"body\").append(\"div\")\t\n .attr(\"class\", \"tooltip\")\t\t\t\t\n .style(\"opacity\", 0);\n \n // ========\n // Earnings\n // ========\n d3.select('#money-dates ' + id)\n .append('div')\n .attr('class', 'graph-descriptor circle')\n .html('Earnings');\n \n // Circles \n d3.select('#money-dates ' + id)\n .append('svg')\n .attr(\"width\", 960)\n .attr(\"height\", 50)\n .selectAll(\"circle\")\n .data(d[i].earnings)\n .enter()\n .append(\"circle\")\n .attr(\"cx\", function(d, i) { return (137.143 * i) + 68.572; })\n .attr(\"cy\", 25)\n .attr(\"r\", 0)\n .attr('title', function (d) { return delimit(d) + ' Kinah' })\n .attr('hover-color', c_scheme[0]) \n .style(\"fill\", c_scheme[0])\n .on('mouseover', mouse_over)\t\t\t\t\t\n .on('mouseout', mouse_out) \n .transition()\n .duration(500)\n .delay(function (d, i) { return i * 50 })\n .attr(\"r\", function (d) { return scale(data_radius(d)); });\n \n // Days of the week\n d3.select('#money-dates ' + id)\n .append('div')\n .attr('class', 'week earnings')\n .selectAll('div')\n .data(days)\n .enter()\n .append('div')\n .attr('class', 'day-of-week earnings')\n .style('float', 'left')\n .style('text-align', 'center')\n .style('width', 137.143 + 'px')\n .html(function(d) { return d });\n \n // report\n d3.select('#money-dates ' + id)\n .append('div')\n .attr('class', 'report')\n .html(player_names[i] + ' has earned a total of ' + delimit(d[i].earned_total) + ' Kinah, and earns the most on ' + days[d[i].day_earned_most] + '.');\n \n // .html(\n // 'Total earnings: ' + delimit(d[i].earned_total) + ' Kinah / ' + rmt(d[i].earned_total)\n // + '<br />' +\n // 'Earns most on: ' + days[d[i].day_earned_most] + ', ' + delimit(d[i].earned_highest) + ' Kinah / ' + rmt(d[i].earned_highest) \n // + '<br />' +\n // 'Number of transactions: ' + delimit(d[i].earned_total_transactions)\n // ); \n \n // ========\n // spendings\n // ========\n d3.select('#money-dates ' + id)\n .append('div')\n .attr('class', 'graph-descriptor circle')\n .html('Spendings');\n \n // Circles \n d3.select('#money-dates ' + id)\n .append('svg')\n .attr(\"width\", 960)\n .attr(\"height\", 50)\n .selectAll(\"circle\")\n .data(d[i].spendings)\n .enter()\n .append(\"circle\")\n .attr('title', function (d) { return delimit(d) + ' Kinah' })\n .attr(\"cx\", function(d, i) { return (137.143 * i) + 68.572; })\n .attr(\"cy\", 25)\n .attr(\"r\", 0)\n .attr('hover-color', c_scheme[0]) \n .style(\"fill\", c_scheme[0])\n .on('mouseover', mouse_over)\t\t\t\t\t\n .on('mouseout', mouse_out) \n .transition()\n .duration(500)\n .delay(function (d, i) { return i * 50 })\n .attr(\"r\", function (d) { return scale(data_radius(d)); });\n \n // Days of the week\n d3.select('#money-dates ' + id)\n .append('div')\n .attr('class', 'week spendings')\n .selectAll('div')\n .data(days)\n .enter()\n .append('div')\n .attr('class', 'day-of-week spendings')\n .style('float', 'left')\n // .style('border-left', '1px solid gray')\n // .style('border-right', '1px solid gray') \n .style('text-align', 'center')\n .style('width', 137.143 + 'px')\n .html(function(d) { return d }); \n\n // report\n d3.select('#money-dates ' + id)\n .append('div')\n .attr('class', 'report')\n .html(player_names[i] + ' has spent a total of ' + delimit(d[i].spent_total) + ' Kinah, and spends the most on ' + days[d[i].day_spent_most] + '.');\n\n \n } // end for loop\n\n d3.select('#money-dates')\n .append('div')\n .attr('class', 'spacer');\n\n circletips();\n });\n\n}", "function GetDag()\n{\n\t//vraag datum en van de datum de dag op.\n\tvar datum = new Date();\n var dag = datum.getDay();\n\t\n\t//dag word getoond als 1 tot en met 7 == maandag tot en met zondag\n\tswitch(dag) {\n\t\tcase 1:\n\t\t\tdocument.getElementById(\"dagVandaag\").innerHTML = \"Maandag: Gesloten\";\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tdocument.getElementById(\"dagVandaag\").innerHTML = \"Dinsdag: 09:00 tot 18:00\";\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tdocument.getElementById(\"dagVandaag\").innerHTML = \"Woensdag: 09:00 tot 18:00\";\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tdocument.getElementById(\"dagVandaag\").innerHTML = \"Donderdag: 09:00 tot 18:00\";\n\t\t\tbreak;\n\t\tcase 5:\n\t\t\tdocument.getElementById(\"dagVandaag\").innerHTML = \"Vrijdag: 09:00 tot 21:00\";\n\t\t\tbreak;\n\t\tcase 6:\n\t\t\tdocument.getElementById(\"dagVandaag\").innerHTML = \"Zaterdag: 09:00 tot 21:00\";\n\t\t\tbreak;\n\t\tcase 0:\n\t\t\tdocument.getElementById(\"dagVandaag\").innerHTML = \"Zondag: Gesloten\";\n\t\t\tbreak;\n\t}\n\t\n\t\n}", "function calendar(year) {\n console.log(\"creating calendar\")\n for (var monthCount = 0; monthCount < 13; monthCount++) {\n var newList = $(\"<ul>\");\n newList.addClass(\"main\");\n for (var dayCount = 0; dayCount < 32; dayCount++) {\n\n if (dayCount===0 && monthCount===0) {\n var newListItem = $(\"<li>\")\n newListItem.addClass(\"cEmpty\")\n // newListItem.addClass(\"cLabel\");\n newList.append(newListItem)\n }\n else if (monthCount ===0)\n {\n var newListItem = $(\"<li>\");\n newListItem.addClass(\"cEmpty\");\n var labelDiv = $(\"<div>\")\n labelDiv.addClass(\"cLabel\");\n labelDiv.text(dayCount);\n newListItem.append(labelDiv);\n newList.append(newListItem);\n\n } else if (dayCount ===0) {\n var monthName = moment(monthCount, \"M\").format(\"MMM\")\n var newListItem = $(\"<li>\");\n newListItem.addClass(\"cEmpty\");\n var labelDiv = $(\"<div>\");\n labelDiv.addClass(\"cLabel\");\n labelDiv.text(monthName.substring(0,1));\n newListItem.append(labelDiv);\n newList.append(newListItem)\n } else {\n\n var newListItem = $(\"<li>\")\n\n var dateDiv = $(\"<div>\")\n var date = String(monthCount) + \"/\" + String(dayCount) + \"/\" + year\n var dateFormat = \"M/D/YYYY\"\n var convertedDate = moment(date, dateFormat)\n var dayOfTheWeek = convertedDate.format(\"d\") // sunday =0\n\n\n\n if (!convertedDate.isValid()) {\n newListItem.addClass(\"cEmpty\")\n } else {\n dateDiv.addClass(\"cDate\")\n dateDiv.addClass(date)\n dateDiv.text(convertedDate.format(\"MM/DD/YY\"));\n newListItem.append(dateDiv)\n\n var location = $(\"<div>\")\n location.addClass(\"cLocation\")\n location.text(\"Gary, IN\")\n newListItem.append(location)\n\n var mood = Math.floor(Math.random() * (9 - 1)) + 1\n newListItem.addClass(\"type-\" + mood)\n newListItem.addClass(\"cat-\" + dayOfTheWeek)\n }\n\n\n\n newList.append(newListItem)\n }\n }\n $(\".wrapper\").append(newList)\n }\n }", "function displayPractice() {\n\tvar d = new Date();\n\tvar day = d.getDay();\n\tvar month = d.getMonth();\n\tvar date = d.getDate();\n // in case of pool closing set day = 8 practice canceled for repairs; day=9 practice canceled for meet -------------------------------------------------\n //if (month == 6 && date == lastPractice) {day = 7};\n if (RVCCclosed === true) {day = 8};\n\n\tif (month === 4 && date < firstPractice) {\n\t\t$(\"#todayschedule\").html(\"Summer Team Practice<br>BEGINS MAY \" + firstPractice + \"!\");\n $(\"#todayschedule2\").html(\"Summer Team Practice<br>BEGINS MAY \" + firstPractice + \"!\");\n\t} else if((month === lastmonthPractice && date > lastPractice) || (month > lastmonthPractice) ) {\n\t\t\t\t$(\"#todayschedule\").html(\"Thank you for a Great Season!<br>See You next Summer <i style='color:#fd7d14' class='fas fa-smile-wink'></i>\");\n $(\"#todayschedule2\").html(\"Thank you for a Great Season!<br>See You next Summer <i style='color:#fd7d14' class='fas fa-smile-wink'></i>\");\n\t}else if ((month === 4 && date >= firstPractice) || (month === 5 && date < changeDate)) {\n\t\tswitch (day) {\n\t\t\tdefault:\n\t\t\t\t$(\"#todayschedule\").html(\"No Summer Team Practice Today!\");\n $(\"#todayschedule2\").html(\"No Summer Team Practice Today!\");\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$(\"#todayschedule\").html(\"9 & Unders: 5:00 - 6:10 PM<br />\");\n\t\t\t\t$(\"#todayschedule\").append(\"10 & Up: 6:05 - 7:15 PM<br />\");\n\t\t\t\t//$(\"#todayschedule\").append(\"14 & Over: 7:10 - 8:20 PM\");\n $(\"#todayschedule2\").html(\"9 & Unders: 5:00 - 6:10 PM<br />\");\n $(\"#todayschedule2\").append(\"10 & Up: 6:05 - 7:15 PM<br />\");\n\t\t\t\t//$(\"#todayschedule2\").append(\"14 & Over: 7:10 - 8:20 PM\");\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\t$(\"#todayschedule\").html(\"9 & Unders: 5:00 - 6:10 PM<br />\");\n\t\t\t\t$(\"#todayschedule\").append(\"10 & Up: 6:05 - 7:15 PM<br />\");\n\t\t\t\t//$(\"#todayschedule\").append(\"14 & Over: 7:10 - 8:20 PM\");\n $(\"#todayschedule2\").html(\"9 & Unders: 5:00 - 6:10 PM<br />\");\n\t\t\t\t$(\"#todayschedule2\").append(\"10 & Up: 6:05 - 7:15 PM<br />\");\n\t\t\t\t//$(\"#todayschedule2\").append(\"14 & Over: 7:10 - 8:20 PM\");\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\t$(\"#todayschedule\").html(\"9 & Unders: 5:00 - 6:10 PM<br />\");\n\t\t\t\t$(\"#todayschedule\").append(\"10 & Up: 6:05 - 7:15 PM<br />\");\n\t\t\t\t//$(\"#todayschedule\").append(\"14 & Over: 7:10 - 8:20 PM\");\n $(\"#todayschedule2\").html(\"9 & Unders: 5:00 - 6:10 PM<br />\");\n\t\t\t\t$(\"#todayschedule2\").append(\"10 & Up: 6:05 - 7:15 PM<br />\");\n\t\t\t\t//$(\"#todayschedule2\").append(\"14 & Over: 7:10 - 8:20 PM\");\n break;\n case 8:\n $(\"#todayschedule\").html(\"The RVCC Pool is CLOSED<br />\");\n $(\"#todayschedule\").append(\"No Practice Today\");\n $(\"#todayschedule2\").html(\"The RVCC Pool is CLOSED<br />\");\n\t\t\t\t$(\"#todayschedule2\").append(\"No Practice Today\");\n break;\n case 9:\n $(\"#todayschedule\").html(\"Practice Canceled today<br />\");\n $(\"#todayschedule\").append(\"due to Swim Meet\");\n $(\"#todayschedule2\").html(\"Practice Canceled today<br />\");\n \t\t$(\"#todayschedule2\").append(\"due to Swim Meet\");\n break;\n\n\t\t}\n } else if (month === lastmonthPractice && date == lastPractice) {\n switch (day) {\n default:\n $(\"#todayschedule\").html(\"All Ages: 6:00 - 7:15 PM<br />LAST PRATICE!!<br />See you next Summer <i style='color:#fd7d14' class='fas fa-smile-wink'></i>\");\n $(\"#todayschedule2\").html(\"All Ages: 6:00 - 7:15 PM<br />LAST PRATICE!!<br />See you next Summer <i style='color:#fd7d14' class='fas fa-smile-wink'></i>\");\n break;\n }\n\t} else if ( month === 5 && date >= changeDate || month === 6 || month === 7 && date <= lastPractice) {\n\t\t\tswitch (day) {\n\t\t\tdefault:\n\t\t\t\t$(\"#todayschedule\").html(\"No Summer Team Practice Today!\");\n $(\"#todayschedule2\").html(\"No Summer Team Practice Today!\");\n\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\t$(\"#todayschedule\").html(\"10 & Unders: 6:00 - 7:15 PM<br />\");\n\t\t\t\t\t$(\"#todayschedule\").append(\"11 & Overs: 6:45 - 8:00 PM\");\n $(\"#todayschedule2\").html(\"10 & Unders: 6:00 - 7:15 PM<br />\");\n\t\t\t\t\t$(\"#todayschedule2\").append(\"11 & Overs: 6:45 - 8:00 PM\");\n\t\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$(\"#todayschedule\").html(\"10 & Unders: 6:00 - 7:15 PM<br />\");\n\t\t\t\t$(\"#todayschedule\").append(\"11 & Overs: 6:45 - 8:00 PM\");\n $(\"#todayschedule2\").html(\"10 & Unders: 6:00 - 7:15 PM<br />\");\n\t\t\t\t$(\"#todayschedule2\").append(\"11 & Overs: 6:45 - 8:00 PM\");\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\t$(\"#todayschedule\").html(\"10 & Unders: 6:00 - 7:15 PM<br />\");\n\t\t\t\t$(\"#todayschedule\").append(\"11 & Overs: 6:45 - 8:00 PM\");\n $(\"#todayschedule2\").html(\"10 & Unders: 6:00 - 7:15 PM<br />\");\n\t\t\t\t$(\"#todayschedule2\").append(\"11 & Overs: 6:45 - 8:00 PM\");\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\t$(\"#todayschedule\").html(\"10 & Unders: 6:00 - 7:15 PM<br />\");\n\t\t\t\t$(\"#todayschedule\").append(\"11 & Overs: 6:45 - 8:00 PM\");\n $(\"#todayschedule2\").html(\"10 & Unders: 6:00 - 7:15 PM<br />\");\n\t\t\t\t$(\"#todayschedule2\").append(\"11 & Overs: 6:45 - 8:00 PM\");\n break;\n case 7:\n $(\"#todayschedule\").html(\"Only Conference Qualifiers: 5:00 - 6:00 PM<br />\");\n $(\"#todayschedule2\").html(\"Only Conference Qualifiers: 5:00 - 6:00 PM<br />\");\n break;\n case 8:\n $(\"#todayschedule\").html(\"RVCC Closed for Repairs<br />\");\n $(\"#todayschedule\").append(\"No Practice Today\");\n $(\"#todayschedule2\").html(\"RVCC Closed for Repairs<br />\");\n\t\t\t\t$(\"#todayschedule2\").append(\"No Practice Today\");\n break;\n case 9:\n $(\"#todayschedule\").html(\"Practice Canceled today<br />\");\n $(\"#todayschedule\").append(\"due to Swim Meet\");\n $(\"#todayschedule2\").html(\"Practice Canceled today<br />\");\n \t\t\t$(\"#todayschedule2\").append(\"due to Swim Meet\");\n\n\t\t}\n\t} else if (month >= 0 && month < 4) {\n\t\t$(\"#todayschedule\").html(\"Summer Team Practice<br>Begins in May, 2019<br/>Check back after April 15 for more details.<br/>Hope to see you there!\");\n $(\"#todayschedule2\").html(\"Summer Team Practice<br>Begins in May, 2019<br/>Check back after April 15 for more details.<br/>Hope to see you there!\");\n\t} else {\n $(\"#todayschedule\").html(\"No Summer Team Practice Today!\");\n $(\"#todayschedule2\").html(\"No Summer Team Practice Today!\");\n }\n}", "function generateMonth(month, year) {\r\n var div = document.createElement(\"div\");\r\n div.className = \"month\";\r\n\r\n // month name\r\n div.innerText = monthNames[month];\r\n\r\n var table = document.createElement(\"table\");\r\n\r\n // days header\r\n var row = document.createElement(\"tr\");\r\n for (var j = 0; j < 7; j++) {\r\n var td = document.createElement(\"td\");\r\n td.innerText = dayNames[j];\r\n td.className = \"header\";\r\n row.appendChild(td);\r\n }\r\n table.appendChild(row);\r\n\r\n // days\r\n row = document.createElement(\"tr\");\r\n\r\n // amount of months in day\r\n var days = monthDays[month] + (month === 1 ? leapYear(year) : 0);\r\n\r\n // day of the week to start at\r\n var startDate = new Date(`${monthNames[month]} 1, ${year} 00:00:01`);\r\n var startDateIndex = startDate.getDay();\r\n\r\n // generate cells with date numbers\r\n for (var j = 0; j < days; j++) {\r\n // day of the week\r\n var dayIndex = (startDateIndex + j) % 7;\r\n\r\n // blank cells at start\r\n if (j === 0) {\r\n addCells(dayIndex, row);\r\n }\r\n\r\n // make a new row when needed\r\n if (j > 0 && dayIndex === 0) {\r\n table.appendChild(row);\r\n row = document.createElement(\"tr\");\r\n }\r\n\r\n // make cell\r\n var td = document.createElement(\"td\");\r\n td.innerText = j + 1;\r\n td.id = `${year}.${month}.${j + 1}`;\r\n td.className = \"day\";\r\n td.onclick = function () {\r\n if (selectedColor === \"#ffffff\") {\r\n if (this.childElementCount === 0) {\r\n addMessage(this, \"\");\r\n }\r\n } else {\r\n if (selectedIndex === 0) {\r\n this.style.backgroundColor = selectedColor;\r\n delete calendarData[currentYear].colors[this.id];\r\n if (this.childElementCount === 2) {\r\n this.removeChild(this.lastElementChild);\r\n this.removeChild(this.lastElementChild);\r\n delete calendarData[currentYear].text[this.id];\r\n }\r\n } else if (selectedIndex > 0) {\r\n this.style.backgroundColor = selectedColor;\r\n calendarData[currentYear].colors[this.id] = selectedIndex;\r\n }\r\n }\r\n };\r\n row.appendChild(td);\r\n\r\n // blank cells at end and append last row\r\n if (j + 1 === days) {\r\n addCells(6 - dayIndex, row);\r\n table.appendChild(row);\r\n }\r\n }\r\n\r\n div.appendChild(table);\r\n\r\n return div;\r\n}", "function countdownRemain(seconds) {\n const minutes = Math.floor(seconds / 60);\n const hours = Math.floor(minutes / 60);\n const days = Math.floor(hours / 24);\n const remainingSeconds = Math.floor(seconds % 60);\n const remainingMinutes = Math.floor(minutes % 60);\n const remaininghours = Math.floor(hours % 24);\n\n const remainDisplay = `${hours < 10 ? '0' : ''}${hours} : ${remainingMinutes < 10 ? '0' : ''}${remainingMinutes} : ${remainingSeconds < 10 ? '0' : ''}${remainingSeconds}`;\n document.title = remainDisplay;\n displayCountdownRemain.innerHTML = '<div id=\"days\"><h2>' + `${days < 10 ? '0' : ''}${days} ` + '</h2><span>Days</span> </div><div><h2>' + `${remaininghours < 10 ? '0' : ''}${remaininghours} ` + '</h2><span>Hours</span> </div><div><h2>' + `${remainingMinutes < 10 ? '0' : ''}${remainingMinutes}` + '</h2><span>Minutes</span></div><div><h2>' + `${remainingSeconds < 10 ? '0' : ''}${remainingSeconds}` + '</h2><span>Second</span></div>';\n\n\n if (hours < 24) {\n var daysss = document.getElementById('days');\n daysss.style.display = \"none\";\n fill.style.width = \"100%\"; // i don't know how\n }\n\n}", "function ChangeDate(sens) { \n if(sens === 2){//mois précédent\n monthIndex = monthIndex - 1;\n\n if(monthIndex < 0){\n monthIndex = 11;\n dataCalendar.year = dataCalendar.year - 1;\n } \n }\n\n if(sens === 1){//mois d'après\n monthIndex = monthIndex + 1;\n\n if(monthIndex >= 12){\n monthIndex = 0;\n dataCalendar.year = dataCalendar.year + 1;\n } \n \n }\n dataCalendar.monthNames = monthNames[monthIndex]; \n ResetCalendar(); \n InitCalendar();\n}", "function generateMonth(){\n //let monthsArr = ['January','Febuary','March','April','May','June','July','August','September','October','November','December'];\n let monthsArr = ['Enero','Febrero','Marzo','Abril','Mayo','Junio','Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'];\n var weeks = currentMonth.getWeeks();\n document.getElementById('monthAndYear').innerHTML = monthsArr[currentMonth.month]+' '+currentMonth.year;\n document.getElementById('calendarTable').innerHTML=\"<thead><tr><th>Domingo</th><th>Lunes</th><th>Martes</th><th>Miércoles</th><th>Jueves</th><th>Viernes</th><th>Sabado</th></tr></thead>\";\n \n $.get(\"datos/datos.php\", { yyyy:currentMonth.year,mm:currentMonth.month })\n .done(function (datos) {\n data=datos.feriados \n let i = 1;\n for(var w in weeks){\n var days = weeks[w].getDates();\n let tableRow = document.createElement(\"tr\");\n tableRow.setAttribute('id','row'+i);\n i+=1;\n let week = document.getElementById('calendarTable').appendChild(tableRow);\n let nextMonthDays = document.createElement(\"th\");\n for(var d in days){\n if(currentMonth.month == days[d].getMonth()){\n dayId = days[d].getDate()+'';\n vActual=today.getFullYear()*10000+(today.getMonth()+1)*100+today.getDate()\n vDiaMes=currentMonth.year*10000+(currentMonth.month+1)*100+parseInt(dayId)\n debugger\n\n vFeriado=feriado(dayId,data)\n vTurnos=conTurno(dayId,datos.turnos)\n if (vDiaMes>vActual){\n if (days[d].getDay()==0 || days[d].getDay()==6){\n if (vFeriado.length>0){ \n day = week.innerHTML+='<th class=\"day2\" style=\"background-color: green;color:white;\" id=\"'+dayId+'\">'+ days[d].getDate()+'<hr />'+vFeriado+'</th>'; \n } else { \n day = week.innerHTML+='<th class=\"day2\" id=\"'+dayId+'\">'+ days[d].getDate() +'</th>'; \n }\n\n } else {\n if (vFeriado.length>0){ \n day = week.innerHTML+='<th class=\"day\" style=\"background-color: green;color:white;\" id=\"'+dayId+'\">'+ days[d].getDate()+'<hr />'+vFeriado+'</th>'; \n } else {\n if (vTurnos>0){\n day = week.innerHTML+='<th class=\"day\" id=\"'+dayId+'\">'+ days[d].getDate() + '<br /> ('+vTurnos+' turnos.)</th>'; \n } else {\n day = week.innerHTML+='<th class=\"day\" id=\"'+dayId+'\">'+ days[d].getDate() + '</th>'; \n }\n \n } \n } \n \n } else {\n if (vFeriado.length>0){ \n day = week.innerHTML+='<th class=\"day1\" style=\"background-color: green;color:white;\" id=\"'+dayId+'\">'+ days[d].getDate()+'<hr />'+vFeriado+'</th>'; \n } else { \n day = week.innerHTML+='<th class=\"day1\" id=\"'+dayId+'\">'+ days[d].getDate()+'</th>'; \n }\n }\n \n } \n else{\n day = week.innerHTML+='<th class=\"otherDay\">'+ monthsArr[days[d].getMonth()]+' '+days[d].getDate()+'</th>';\n }\n }\n }\n var r1=document.getElementsByClassName(\"day\")\n for (var j = 0; j < r1.length; j++) {\n \n r1[j].addEventListener(\"click\", function(){\n\n /*if (this.getAttribute('style')!==\"background-color:red\"){\n this.setAttribute('style','background-color:red') \n } else {\n this.setAttribute('style','background-color: green')\n }*/\n var vFecha = (currentMonth.month+1).toString()+'-'+this.id.toString()+'-'+currentMonth.year.toString()\n diaElegido=vFecha\n \n document.getElementById('eventPopUp').hidden = false;\n document.getElementById('editEvent').hidden = false;\n \n });\n }\n\n }); \n \n}", "function calanderBuild(calanderElement,startElement,endElement,object){\ncalanderElement.empty();\nvar end = assumptions.completeReturns[0].length - 1;\ncalander.months=['Jan','Feb','Mar', 'Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];\n\n\nstartYear=moment(assumptions.completeReturns[0][end]).format(\"YYYY\")/1;\nendYear=moment(assumptions.completeReturns[0][0]).format(\"YYYY\")/1;\n\n\ndropdown=\"<select class='calanderDropDown'>\"\n\nfor(i=startYear;i<=endYear;i++){\ndropdown +=\"<option>\"+i+\"</option>\"\n\n}\ndropdown +=\"</select>\"\nvar calanderTable = \"<table class='calander'><th colspan='4'>\"+dropdown+\"</th><tr><td id='Jan'>Jan</td><td id='Feb'>Feb</td><td id='Mar'>Mar</td><td id='Apr'>Apr</td></tr><tr><td id='May'>May</td><td id='Jun'>Jun</td><td id='Jul'>Jul</td><td id='Aug'>Aug</td></tr><tr><td id='Sep'>Sep</td><td id='Oct'>Oct</td><td id='Nov'>Nov</td><td id='Dec'>Dec</td></tr></table>\"\n\n\ncalanderElement.append(calanderTable);\ncalanderElement.css('display','none');\n$('.calander').draggable();\n\n//build calander applicable to start date\nstartElement.bind( \"click\", function() {\n\ncalander.start=true;\ncalanderElement.css('display','block');\nyear=moment(this.text).format(\"YYYY\");\nfor(i=0;i<calander.months.length;i++){\n$('#' + calander.months[i]).removeClass('inactiveMonth');\n$('#' + calander.months[i]).addClass('activeMonth');\n}\n\n\n$('.calanderDropDown').val(year);\nlastYear=moment(assumptions.completeReturns[0][0]).format(\"YYYY\");\nfirstYear=moment(assumptions.completeReturns[0][assumptions.completeReturns[0].length-1]).format(\"YYYY\");\nlastMonth=moment(assumptions.completeReturns[0][0]).format(\"M\");\nfirstMonth=moment(assumptions.completeReturns[0][assumptions.completeReturns[0].length-1]).format(\"M\");\n\nstartMonthsGrey=[];\nendMonthsGrey=[];\nfor(i=0;i<12;i++){\nif(firstMonth/1>i+1){\nstartMonthsGrey[i]=calander.months[i];\n}\n}\nfor(i=12;i>0;i--){\nif(i>lastMonth/1){\nendMonthsGrey[12-i]=calander.months[i-1];\n}\n}\n\nif(year==firstYear){\nfor(i=0;i<startMonthsGrey.length;i++){\n$('#' + startMonthsGrey[i]).addClass('inactiveMonth');\n$('#' + startMonthsGrey[i]).removeClass('activeMonth');\n}\n}\nif(year==lastYear){\nfor(i=0;i<endMonthsGrey.length;i++){\n$('#' + endMonthsGrey[i]).addClass('inactiveMonth');\n$('#' + endMonthsGrey[i]).removeClass('activeMonth');\n}\n}\n\n\n\n//set up months per year choice chosen, once month is chosen magic will actually happen\n$('.calanderDropDown').bind(\"change\",function(){\nfor(i=0;i<calander.months.length;i++){\n$('#' + calander.months[i]).removeClass('inactiveMonth');\n$('#' + calander.months[i]).addClass('activeMonth');\n}\n\nif($('.calanderDropDown').val()==firstYear){\nfor(i=0;i<startMonthsGrey.length;i++){\n$('#' + startMonthsGrey[i]).addClass('inactiveMonth');\n$('#' + startMonthsGrey[i]).removeClass('activeMonth');\n}\n}\nelse if($('.calanderDropDown').val()==lastYear){\nfor(i=0;i<endMonthsGrey.length;i++){\n$('#' + endMonthsGrey[i]).addClass('inactiveMonth');\n$('#' + endMonthsGrey[i]).removeClass('activeMonth');\n}\n}\nelse{}\n})\n\n});\n\n\n//build calander applicable to end date\nendElement.bind( \"click\", function() {\ncalander.start=false;\ncalanderElement.css('display','block');\nyear=moment(this.text).format(\"YYYY\");\nfor(i=0;i<calander.months.length;i++){\n$('#' + calander.months[i]).removeClass('inactiveMonth');\n$('#' + calander.months[i]).addClass('activeMonth');\n}\n\n\n$('.calanderDropDown').val(year);\nlastYear=moment(assumptions.completeReturns[0][0]).format(\"YYYY\");\nfirstYear=moment(assumptions.completeReturns[0][assumptions.completeReturns[0].length-1]).format(\"YYYY\");\nlastMonth=moment(assumptions.completeReturns[0][0]).format(\"M\");\nfirstMonth=moment(assumptions.completeReturns[0][assumptions.completeReturns[0].length-1]).format(\"M\");\n\nstartMonthsGrey=[];\nendMonthsGrey=[];\nfor(i=0;i<12;i++){\nif(firstMonth/1>i+1){\nstartMonthsGrey[i]=calander.months[i];\n}\n}\nfor(i=12;i>0;i--){\nif(i>lastMonth/1){\nendMonthsGrey[12-i]=calander.months[i-1];\n}\n}\n\nif(year==firstYear){\nfor(i=0;i<startMonthsGrey.length;i++){\n$('#' + startMonthsGrey[i]).addClass('inactiveMonth');\n$('#' + startMonthsGrey[i]).removeClass('activeMonth');\n}\n}\nif(year==lastYear){\nfor(i=0;i<endMonthsGrey.length;i++){\n$('#' + endMonthsGrey[i]).addClass('inactiveMonth');\n$('#' + endMonthsGrey[i]).removeClass('activeMonth');\n}\n}\n\n\n$('.calanderDropDown').bind(\"change\",function(){\nfor(i=0;i<calander.months.length;i++){\n$('#' + calander.months[i]).removeClass('inactiveMonth');\n$('#' + calander.months[i]).addClass('activeMonth');\n}\n\nif($('.calanderDropDown').val()==firstYear){\nfor(i=0;i<startMonthsGrey.length;i++){\n$('#' + startMonthsGrey[i]).addClass('inactiveMonth');\n$('#' + startMonthsGrey[i]).removeClass('activeMonth');\n}\n}\nelse if($('.calanderDropDown').val()==lastYear){\nfor(i=0;i<endMonthsGrey.length;i++){\n\n$('#' + endMonthsGrey[i]).addClass('inactiveMonth');\n$('#' + endMonthsGrey[i]).removeClass('activeMonth');\n}\n}\nelse{}\n})\n\n\n});\n//when month is chosen sets date and recalculates using assumptions.js function customReturn()\n$('.calander td').click(function(){\nmonth = this.innerText;\nyear = $('.calanderDropDown').val();\ncompleteReturnsPosition=\"\";\ndate=\"\";\nnewReturnArray=[];\n\n\nstart=\"\";\nend=\"\";\n\nif(this.className==\"activeMonth\"){\nfor(i=0;i<assumptions.completeReturns[0].length;i++){\nif(month == moment(assumptions.completeReturns[0][i]).format('MMM') && year == moment(assumptions.completeReturns[0][i]).format('YYYY')){\ncompleteReturnsPosition = i;\ndate = assumptions.completeReturns[0][i];\n};\n/* console.log(moment(assumptions.completeReturns[0][i]).format('MMM')) */\n}\n\n/* if(calander.start){\nif(completeReturnsPosition == assumptions.completeReturns[0].length-1){}\nelse{\ncalander.startDate=assumptions.completeReturns[0][completeReturnsPosition];\n\n}\n}\nelse{\nif(completeReturnsPosition == 0){}\nelse{\ncalander.endDate=assumptions.completeReturns[0][completeReturnsPosition];\n\n}\n\n} */\nif(calander.start){\ncalander.startDate = date;\n}\nelse{calander.endDate = date}\nfor(i=0;i<assumptions.completeReturns[0].length;i++){\nif(assumptions.completeReturns[0][i]==calander.startDate){\nstart = i;\n}\nif(assumptions.completeReturns[0][i]==calander.endDate){\nend = i;\n}\n\n}\n//if start date is greater than end date it does nothing\nif(start <= end){}\nelse{\nfor(i=0;i<assumptions.completeReturns.length;i++){\nnewReturnArray.push(assumptions.completeReturns[i].slice(end,start+1))\n}\n\n//found in assumptions.js\npresentAssumptions(newReturnArray);\n\n}\n\n\n}\n\n})\n\n}", "function generateDoughnuts() {\n var doughnuts = document.getElementById('doughnuts');\n monthsIds.forEach((value, index) =>\n {\n var canvas = document.createElement('CANVAS');\n canvas.setAttribute('id', value);\n canvas.setAttribute('class', 'col-2 p-0');\n canvas.setAttribute('height', 200);\n doughnuts.appendChild(canvas);\n var ctx = canvas.getContext('2d');\n// eval(value+'='+'new Chart(ctx, generateConfig(months[index], [10, 80, 10]));');\n new Chart(ctx, generateConfig(months[index], [10, 80, 10]));\n });\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 show_today(){\n period=1;\n draw_building_chart(period,variable);\n}", "function updateClock(id) {\r\n var now = new Date();\r\n var dname = now.getDay(),\r\n mo = now.getMonth(),\r\n dnum = now.getDate(),\r\n yr = now.getFullYear(),\r\n hou = now.getHours(),\r\n min = now.getMinutes(),\r\n sec = now.getSeconds(),\r\n pe = \"AM\";\r\n\r\n Number.prototype.pad = function (digits) {\r\n for (var n = this.toString(); n.lenght < digits; n = 0 + n);\r\n return n;\r\n };\r\n\r\n var months = [\r\n \"January\",\r\n \"February\",\r\n \"March\",\r\n \"April\",\r\n \"May\",\r\n \"June\",\r\n \"July\",\r\n \"August\",\r\n \"Septempber\",\r\n \"October\",\r\n \"November\",\r\n \"December\",\r\n ];\r\n var week = [\r\n \"Sunday\",\r\n \"Monday\",\r\n \"Tuesday\",\r\n \"Wednesday\",\r\n \"Thursday\",\r\n \"Friday\",\r\n \"Saturday\",\r\n ];\r\n var ids = [\r\n \"dayname\",\r\n \"month\",\r\n \"daynum\",\r\n \"year\",\r\n \"hour\",\r\n \"minutes\",\r\n \"seconds\",\r\n \"perdiod\",\r\n ];\r\n var values = [\r\n week[dname],\r\n months[mo],\r\n dnum.pad(2),\r\n yr.pad(2),\r\n hou.pad(2),\r\n min.pad(2),\r\n sec.pad(2),\r\n pe,\r\n ];\r\n for (var i = 0; i < ids.length; i++) {\r\n console.log(ids[i]);\r\n document.getElementById(ids[i]).firstChild.nodeValue = values[i];\r\n }\r\n}", "function addMonths( month, year, howMany ) {\n\t\t\t\t\n\t\t\t\tvar html = \"\",\n\t\t\t\t\ty = year;\n\t\t\t\t\n\t\t\t\tfor( mo = month; mo < month+howMany; mo++ ) {\n\t\t\t\t\t\n\t\t\t\t\t// for each month we loops through, we need\n\t\t\t\t\t// to make sure it isn't past December. if it is,\n\t\t\t\t\t// we take away 12 , and add a year so that it equates to the right\n\t\t\t\t\t// month at the beginning of the next year\n\t\t\t\t\tvar m = mo;\n\t\t\t\t\tif (mo > 11) { var m = mo-12; y = year+1; }\n\t\t\t\t\t\n\t\t\t\t\t// get the current month's name to show in the side.\n\t\t\t\t\tvar monthname = mommy.options.months[ new Date(y,m,1).getMonth() ];\n\t\t\t\t\t\n\t\t\t\t\t// get the year number to show in the side. but we dont want\n\t\t\t\t\t// to show this year's number as that's implied.\n\t\t\t\t\tvar yearname = ( Date.today().getFullYear() != y ) ? y : \"\";\n\t\t\t\t\t\n\t\t\t\t\t// get the number of days in the currently looped month\n\t\t\t\t\tvar daysInMonth = Date.getDaysInMonth(y,m);\n\t\t\t\t\t\n\t\t\t\t\t// find out the first day of month(m) and call it offset\n\t\t\t\t\tvar offset = new Date(y,m,1).getDay();\n\t\t\t\t\tif (offset == 0) { offset=7; }\n\t\t\t\t\t\n\t\t\t\t\tfor( d = 1; d <= daysInMonth; d++ ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// set some variables for styling the calendar\n\t\t\t\t\t\tvar filler = ( d == 1 && offset > 1 ) ? \"ui-gdatepicker-divider-left\" : \"\";\n\t\t\t\t\t\tvar divider = ( d <= 7 ) ? \"ui-gdatepicker-divider-top\" : \"\";\n\t\t\t\t\t\tvar previous = ( mo == month ) ? \"ui-gdatepicker-previous-month\" : \"\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\thtml += \"<span class=\\\"ui-gdatepicker-day \" +filler+\" \"+divider+\" \"+previous+\" gdpd-\"+d+\" gdpm-\"+m+\" gdpy-\"+y+\"\\\" data-day=\\\"\"+d+\"\\\" data-year=\\\"\"+y+\"\\\" data-month=\\\"\"+m+\"\\\">\";\n\t\t\t\t\t\thtml += d;\n\t\t\t\t\t\thtml += \"</span>\";\n\t\t\t\t\t\t\n\t\t\t\t\t\t// at the end of each week, either show the month and year, or just start a new row.\n\t\t\t\t\t\tif( (offset+(d-1))%7 == 0 ) {\n\t\t\t\t\t\t\tif( (offset+(d-1)) < 8 ) {\n\t\t\t\t\t\t\t\thtml += \"<span class=\\\"ui-gdatepicker-monthname ui-gdatepicker-divider-top ui-gdatepicker-newline\\\" data-year=\\\"\"+y+\"\\\" data-month=\\\"\"+m+\"\\\">\"+monthname+\" \"+yearname+\"</span><br>\";\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\thtml += \"<span class=\\\"ui-gdatepicker-newline\\\"></span><br>\";\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}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn html;\t\n\t\t\t\t\n\t\t\t}", "render(data) {\n if (!data.total['Total']) { // No data available for this month\n this.domNoData();\n return;\n };\n\n this.createElFrom(data.total, this.domEl.total);\n this.createElFrom(data.gender, this.domEl.gender, 'Gender');\n this.createElFrom(data.ageRange, this.domEl.ageRange, 'Age range');\n this.createElFrom(data.involvedPerson, this.domEl.involvedPerson, 'Involved a person');\n this.createElFrom(data.objectSearch, this.domEl.objectSearch, 'Stop and search reason');\n this.createElFrom(data.outcome, this.domEl.outcome, 'Outcome of the stop');\n console.log(data);\n\n return this;\n }", "function buildLabrBudgetExpBlock(result,projectDivId,menuLocationType,menuLocationId,radioType){\r\n\tvar str='';\r\n\tstr+='<div class=\"col-md-12 table-responsive\">';\r\n\t\t\tstr+='<table class=\"table table-striped table-bordered\">';\r\n\t\t\t\tstr+='<tbody>';\r\n\t\t\t\t\t str+='<tr>';\r\n\t\t\t\t\t\t str+='<td></td>';\r\n\t\t\t\t\t\t for(var i in result){\r\n\t\t\t\t\t\t\t str+='<td>'+result[i].name+'</td>';\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t str+='</tr>';\r\n\t\t\t\t\t str+=' <tr>';\r\n\t\t\t\t\t\tstr+=' <td><b>As&nbsp;On&nbsp;Nov&nbsp;30th</b></td>';\r\n\t\t\t\t\t\tfor(var i in result){\r\n\t\t\t\t\t\t\tstr+='<td>'+result[i].orderNo+'</td>';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\tstr+='</tr>';\r\n\t\t\t\t\tstr+=' <tr>';\r\n\t\t\t\t\t\tstr+=' <td><b>As&nbsp;Of&nbsp;Today</b></td>';//As Of Now\r\n\t\t\t\t\t\tfor(var i in result){\r\n\t\t\t\t\t\t\tif(result[i].count != null && result[i].count != 0){\r\n\t\t\t\t\t\t\t\tstr+='<td class=\"cuntCls\" style=\"cursor:pointer;\" attr_range=\"'+result[i].name+'\" attr_location_type=\"'+menuLocationType+'\" attr_loaction_id=\"'+menuLocationId+'\" attr_radioType=\"'+radioType+'\" nowrap>'+result[i].count+'&nbsp;';\r\n\t\t\t\t\t\t\t\tif(result[i].name != null && (result[i].name == \"0\" || result[i].name == \"Below 1\" || result[i].name == \"1-5\" || result[i].name == \"5-10\" || result[i].name == \"10-20\")){\r\n\t\t\t\t\t\t\t\t\tif(result[i].assetType == \"Decrement\"){\r\n\t\t\t\t\t\t\t\t\t\tstr+='<span>(&nbsp;'+parseFloat(result[i].todayPerc).toFixed(2)+'&nbsp;%&nbsp;<i class=\"fa fa-arrow-down text-success\" aria-hidden=\"true\"></i></span>&nbsp;)';\r\n\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\tstr+='<span>(&nbsp;'+parseFloat(result[i].todayPerc).toFixed(2)+'&nbsp;%&nbsp;<i class=\"fa fa-arrow-up text-danger\" aria-hidden=\"true\"></i></span>&nbsp;)';\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\tif(result[i].assetType == \"Increment\"){\r\n\t\t\t\t\t\t\t\t\t\tstr+='<span>(&nbsp;'+parseFloat(result[i].todayPerc).toFixed(2)+'&nbsp;%&nbsp;<i class=\"fa fa-arrow-up text-success\" aria-hidden=\"true\"></i></span>&nbsp;)';\r\n\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\tstr+='<span>(&nbsp;'+parseFloat(result[i].todayPerc).toFixed(2)+'&nbsp;%&nbsp;<i class=\"fa fa-arrow-down text-danger\" aria-hidden=\"true\"></i></span>&nbsp;)';\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tstr+='</td>';\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tstr+='<td attr_range=\"'+result[i].name+'\" attr_location_type=\"'+menuLocationType+'\" attr_loaction_id=\"'+menuLocationId+'\" nowrap>'+result[i].count+'</td>';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\tstr+='</tr>';\r\n\t\t\t\t\t/*str+=' <tr style=\"color:red\">';\r\n\t\t\t\t\t\tstr+=' <td>Changed</td>';\r\n\t\t\t\t\t\tfor(var i in result){\r\n\t\t\t\t\t\t\tstr+='<td>'+result[i].diffCount+'</td>';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\tstr+='</tr>';*/\r\n\t\t\t\tstr+='</tbody>';\r\n\t\t\tstr+='</table>';\r\n\t\tstr+='</div>';\r\n\t\t\r\n\t\tstr+='<div class=\"col-md-12 table-responsive m_top20\">';\r\n\t\t\tstr+='<h4><b>BELOW 20L EXPENDITURE PANCHAYATS CHANGED STATUS SUMMARY FROM NOV-30th TO TODAY</b></h4>';\r\n\t\t\tstr+='<table class=\"table table-striped table-bordered table_labour_css m_top10\">';\r\n\t\t\t\tstr+='<thead>';\r\n\t\t\t\t\tstr+='<tr>';\r\n\t\t\t\t\tstr+='<th>Expenditure Ranges (In Lakhs)</th>';\r\n\t\t\t\t\tstr+='<th>As On Nov 30th</th>';\r\n\t\t\t\t\tstr+='<th>As Of Today</th>';\r\n\t\t\t\t\tstr+='<th>Changed</th>';\r\n\t\t\t\t\t//str+='<th>Changed Status</th>';\r\n\t\t\t\t\t//str+='</tr>';\r\n\t\t\t\t\t//str+='<tr>';\r\n\t\t\t\t\tstr+='<th>0</th>';\r\n\t\t\t\t\tstr+='<th>Below 1</th>';\r\n\t\t\t\t\tstr+='<th>1-5</th>';\r\n\t\t\t\t\tstr+='<th>5-10</th>';\r\n\t\t\t\t\tstr+='<th>10-20</th>';\r\n\t\t\t\t\tstr+='<th>Above 20</th>';\r\n\t\t\t\t\tstr+='</tr>';\r\n\t\t\t\tstr+='</thead>';\r\n\t\t\t\tstr+='<tbody>';\r\n\t\t\t\t\tif(result[0].subList != null && result[0].subList.length > 0){\r\n\t\t\t\t\t\tfor(var i in result[0].subList){\r\n\t\t\t\t\t\t\tstr+='<tr>';\r\n\t\t\t\t\t\t\t\tstr+='<td>'+result[0].subList[i].name+'</td>';\r\n\t\t\t\t\t\t\t\tstr+='<td>'+result[0].subList[i].orderNo+'</td>';\r\n\t\t\t\t\t\t\t\tstr+='<td>'+result[0].subList[i].count+'</td>';\r\n\t\t\t\t\t\t\t\tstr+='<td>'+result[0].subList[i].changedCount+'</td>';\r\n\t\t\t\t\t\t\t\t/*if(i == 0){\r\n\t\t\t\t\t\t\t\t\tstr+='<td style=\"color:red;\">'+result[0].subList[i].zeroCount+'</td>';\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\tstr+='<td>'+result[0].subList[i].zeroCount+'</td>';\r\n\t\t\t\t\t\t\t\tif(i == 1)\r\n\t\t\t\t\t\t\t\t\tstr+='<td style=\"color:red;\">'+result[0].subList[i].belowOneCount+'</td>';\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\tstr+='<td>'+result[0].subList[i].belowOneCount+'</td>';\r\n\t\t\t\t\t\t\t\tif(i == 2)\r\n\t\t\t\t\t\t\t\t\tstr+='<td style=\"color:red;\">'+result[0].subList[i].oneToFiveCount+'</td>';\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\tstr+='<td>'+result[0].subList[i].oneToFiveCount+'</td>';\r\n\t\t\t\t\t\t\t\tif(i == 3)\r\n\t\t\t\t\t\t\t\t\tstr+='<td style=\"color:red;\">'+result[0].subList[i].fiveToTenCount+'</td>';\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\tstr+='<td>'+result[0].subList[i].fiveToTenCount+'</td>';\r\n\t\t\t\t\t\t\t\tif(i == 4)\r\n\t\t\t\t\t\t\t\t\tstr+='<td style=\"color:red;\">'+result[0].subList[i].tenToTwentyCount+'</td>';\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\tstr+='<td>'+result[0].subList[i].tenToTwentyCount+'</td>';*/\r\n\t\t\t\t\t\t\t\tstr+='<td>'+result[0].subList[i].zeroCount+'</td>';\r\n\t\t\t\t\t\t\t\tstr+='<td>'+result[0].subList[i].belowOneCount+'</td>';\r\n\t\t\t\t\t\t\t\tstr+='<td>'+result[0].subList[i].oneToFiveCount+'</td>';\r\n\t\t\t\t\t\t\t\tstr+='<td>'+result[0].subList[i].fiveToTenCount+'</td>';\r\n\t\t\t\t\t\t\t\tstr+='<td>'+result[0].subList[i].tenToTwentyCount+'</td>';\r\n\t\t\t\t\t\t\t\tstr+='<td>'+result[0].subList[i].diffCount+'</td>';\r\n\t\t\t\t\t\t\tstr+='</tr>';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t/*str+='<tr style=\"background-color:#C0C0C0;\">';\r\n\t\t\t\t\t\t\tstr+='<td colspan=\"2\" class=\"text-center\"><b>As Of Now</b></td>'\r\n\t\t\t\t\t\t\tfor(var i in result[0].subList){\r\n\t\t\t\t\t\t\t\tstr+='<td>'+result[0].subList[i].count+'</td>';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tstr+='<td>'+totalChangedCount+'</td>';\r\n\t\t\t\t\t\tstr+='</tr>';*/\r\n\t\t\t\t\t}\r\n\t\t\t\tstr+='</tbody>';\r\n\t\t\tstr+='</table>';\r\n\t\tstr+='</div>';\r\n\t$(\"#projectExp\"+projectDivId.replace(/([`~!@#$%^&*()_|+\\-=?;:'\",.<>\\{\\}\\[\\]\\\\\\/ ])+/g, '')).html(str);\r\n}", "function monthdisplay(){\n\tvar td0 = getElementsByClassName(document, \"table\", \"wp-calendar\");\n\tfor(j=0;j<td0.length;j++){\n\t\tvar td1 = td0[j].getElementsByTagName('td');\n\t\tfor(i=0;i<td1.length;i++){\n\t\t\tvar listevent = td1[i].getElementsByTagName('li');\n\t\t\tif(listevent.length != 0){\n\t\t\t\tif (listevent.length > 4){\n\t\t\t\t\tvar how_many_more = listevent.length - 4;\n\t\t\t\t\tfor( var d=4; d<listevent.length; d++){\n\t\t\t\t\t\tlistevent[d].style.display = 'none';\n\t\t\t\t\t}\n\t\t\t\t\tcreateButton(\"+\"+how_many_more+\" more\", td1[i], showMoreEvents, \"more_event\");\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tcreateButton(\"full view\", td1[i], showMoreEvents, \"more_event\");\n\t\t\t\t}\n\t\t\t\tfor (k=0;k<listevent.length;k++){\n\t\t\t\tvar listText = listevent[k].getElementsByTagName('a');\n\t\t\t\t\tfor(x=0; x<listText.length; x++){\n\t\t\t\t\t truncate(listText[x], '12');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "function month_click(event) {\r\n\t$(\".events-container\").hide(250);\r\n\t$(\"#dialog\").hide(250);\r\n\tvar date = event.data.date; // obtiene la fecha del ultimo dia del mes anterior\r\n\tvar mesAc = event.data.mes;// obtiene el mes actual, regresa un num\r\n\tvar new_month = $(\".month\").index(this); // regresa el nuemero del mes seleccionado\r\n\tvar ahioSel = date.getFullYear();\r\n\tvar ahioAc= event.data.anio;\r\n\tif (mesAc==11 && ahioSel!==ahioAc){\r\n\t\tif(new_month==0 || new_month==1){\r\n\t\t\t$(\".active-month\").removeClass(\"active-month\"); //remueve las clases\r\n\t\t\t$(this).addClass(\"active-month\"); // agrega una clase \r\n\t\t\tdate.setMonth(new_month); // se le asigna al dato al mes nuevo\r\n\t\t\tinit_calendar(date); //inicia el calendario con la fecha propor\r\n\t\t}else{\r\n\t\t\twindow.alert(\"Mes no disponible\");\r\n\r\n\t\t}\r\n\t} else if (new_month >= mesAc && new_month<= (mesAc + 2) && ahioSel==ahioAc) {\r\n\t\t$(\".active-month\").removeClass(\"active-month\"); //remueve las clases\r\n\t\t$(this).addClass(\"active-month\"); // agrega una clase \r\n\t\tdate.setMonth(new_month); // se le asigna al dato al mes nuevo\r\n\t\tinit_calendar(date); //inicia el calendario con la fecha propor\r\n\t}\r\n\telse {\r\n\t\twindow.alert(\"Mes no disponible\");\r\n\t} \r\n}", "function demoAge() {\n renderDemoAge('#age-div', 480);\n}" ]
[ "0.61723626", "0.6149685", "0.6113361", "0.60393757", "0.60284746", "0.5987015", "0.5982454", "0.593505", "0.59121376", "0.584268", "0.5837797", "0.5827893", "0.5802713", "0.5801966", "0.57819754", "0.57818586", "0.577283", "0.57640415", "0.5739269", "0.57343", "0.5726877", "0.57253087", "0.5719525", "0.57179487", "0.57168686", "0.56800467", "0.56647843", "0.5663733", "0.5636675", "0.5629359", "0.5624581", "0.5614353", "0.56080806", "0.56031674", "0.5592518", "0.5576442", "0.55701876", "0.5567711", "0.55660385", "0.5554013", "0.5552441", "0.5549249", "0.55445254", "0.55304486", "0.55272156", "0.5522192", "0.55159056", "0.5511056", "0.5504792", "0.5504562", "0.55035126", "0.55020833", "0.54924464", "0.5471883", "0.545293", "0.54497516", "0.5448043", "0.5444258", "0.5440351", "0.5430375", "0.54235744", "0.54230744", "0.54099274", "0.5404593", "0.5404309", "0.53978026", "0.53879625", "0.53764033", "0.53721577", "0.5371876", "0.53621", "0.5354765", "0.5354444", "0.5347451", "0.5343778", "0.53433555", "0.53362", "0.53345335", "0.53333443", "0.5325128", "0.53204733", "0.5319716", "0.5319048", "0.5305579", "0.53052205", "0.5300583", "0.52996004", "0.5299528", "0.5297512", "0.52892506", "0.52877766", "0.52875996", "0.52853507", "0.52699417", "0.52641517", "0.5260452", "0.52542645", "0.52519435", "0.52479744", "0.5239582", "0.5235428" ]
0.0
-1
TODO clear old items
renderInvitationList() { return ( <List> { this.props.invitations.map(invitation => <InvitationListItem key={invitation.id} joinChannel={this.props.joinChannel} deleteReceivedInvitation={this.props.deleteReceivedInvitation} {...invitation} />) } </List> ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clear() {\n this._items = {};\n }", "clear() {\n\t\t\tthis.items = []\n\t\t\tthis.saveToLocalStorage();\n\t\t}", "reset() {\n this._items = [];\n }", "refreshItems() {\n var self = this;\n self.lastQuery = null;\n\n if (self.isSetup) {\n self.addItems(self.items);\n }\n\n self.updateOriginalInput();\n self.refreshState();\n }", "reset() {\n\t\tthis.items.length = 0;\n\t}", "clear() {\n while (this.items.length) {\n this.items.pop();\n }\n }", "function resetListOfTrackedItems() {\n var itemList = [];\n DataCollectorService.storeLocal(\"usage_item_list\", itemList);\n }", "removeAllWordItems () {\n this.items = {}\n }", "removeAllWordItems () {\n this.items = {}\n }", "function removeItems() {\n service.books = [];\n service.assets = [];\n service.currentBook = {};\n return false;\n }", "_renderItems() {\n this.views.forEach(function(view) {\n view.remove();\n });\n this.views = [];\n this.$listBody.empty();\n\n this.model.collection.each(item => {\n this._addItem(item, item.collection, {\n animate: false,\n });\n });\n }", "deleteAllItem() {\n this.items = [];\n }", "function clear(){\n storageService.clear();\n model.createdPlans = storageService.items;\n }", "dequeueCustomised() {\r\n for(let i=0; i<this.items.length; i++){\r\n this.items[i]= this.items[this.items.length+1];\r\n }\r\n this.items.length= this.items.length-1;\r\n }", "reset() {\n this.items = [];\n }", "function clear() {\n clearContainer();\n items.length = 0;\n }", "clear(){\n this.items = [];\n }", "clearSilent() {\n let me = this;\n\n me._items.splice(0, me.getCount());\n me.map.clear();\n }", "function update(){\n //remove what's there\n Object.keys(itemEls).forEach(function(uuid){\n itemEls[uuid].forEach(function(node){\n if(node.parentNode) node.parentNode.removeChild(node);\n });\n });\n //add in the new order\n list.forEach(function(item){\n itemEls[item.id].forEach(function(node){\n openMarker.parentNode.insertBefore(node, closeMarker);\n });\n })\n }", "removeAll(id) {\n const newItems = { ...this.items };\n delete newItems[id];\n this.items = newItems;\n }", "function redoItems() {\n for (var i = 0; i < listComponent.selectedComplete.length; i++) {\n var itemJson = JSON.parse(listComponent.selectedComplete[i].dataset.item);\n\n // Find completed item that matches\n for (var j = 0; j < listComponent.completed.length; j++) {\n if (listComponent.completed[j].content == itemJson.content\n && listComponent.completed[j].timeCreated == itemJson.timeCreated) {\n\n var item = listComponent.completed[j];\n listComponent.unCompleted.push(item);\n listComponent.completed.splice(j, 1);\n break;\n }\n }\n }\n listComponent.updateController();\n }", "async resetItemsHandler() {\n const items = await this.getItemsFromAPI();\n this.localItemsBackup = items;\n this.setState({items});\n }", "clear() {\n this._list.clear();\n }", "clearCache(){this._cache=new ItemCache(this);Array.from(this.$.items.children).forEach(row=>{Array.from(row.children).forEach(cell=>{// Force data system to pick up subproperty changes\ncell._instance&&cell._instance._setPendingProperty(\"item\",{},!1)})});this._cache.size=this.size||0;this._cache.updateSize();this._hasData=!1;this._assignModels();if(!this._effectiveSize){this._loadPage(0,this._cache)}}", "function deduplicteMediaItems() {\n\n}", "clearReleasedItems(cb) {\n this.session.delete({ url: this.url + '/api/filter/gated/released' }, cb);\n }", "function updateItems() {\n hn.newest(function(err, items) {\n _.each(items, function(item) {\n redis.del(config.redis.prev + item.id);\n redis.del(config.redis.prev + item.id + ':info');\n redis.exists(config.redis.prev + item.id, function(err, exists) {\n\n if(err)\n return console.error(err);\n\n if(!exists)\n request(item.url, function(err, res, body) {\n console.log(item);\n redis.set(config.redis.prev + item.id.toString(), body, function (err) {\n if(err)\n return console.error(err);\n console.log(item.id + ' : ' + item.title + ' : Cached');\n });\n redis.set(config.redis.prev + item.id.toString() + ':info', JSON.stringify(item), function (err) {\n if(err) console.error(err);\n });\n });\n });\n });\n });\n}", "clearAll()\r\n { \r\n this.selectedItems=[];\r\n this.display = null;\r\n this.value = null;\r\n this.results = null;\r\n this.error = null;\r\n this.icon = false;\r\n this.Focusinputbox = false;\r\n this.source.forEach(function (item) {\r\n item.invisible = false;\r\n });\r\n\r\n this.$emit(\"clear\");\r\n \r\n }", "clearItems() {\n const that = this;\n\n that.$.itemsInnerContainer.innerHTML = '';\n that.clearSelection();\n that._items = [];\n that.$placeholder.removeClass('jqx-hidden');\n }", "undoTransaction() {\n // this.list.items = this.oldList.items;\n let i = 0;\n for (i = 0; i < this.list.items.length; i++) {\n this.list.items[i] = this.oldList[i];\n }\n // load the old list\n // console.log(this.list.items);\n }", "clearItems() {\n\t\t\tthis.data = [];\n\t\t\tthis.groups = new Map();\n\t\t\tthis.minv = Number.MAX_VALUE;\n\t\t\tthis.maxv = Number.MIN_VALUE;\n\t\t\tthis.maxt = 0;\n\t\t\tthis.maxn = \"\";\n\t\t\tthis.maxg = \"\";\n\t\t}", "function listCacheClear(){\nthis.__data__=[];\nthis.size=0;\n}", "function restoreEditItems(){\r\n\t\t $currentArticle.find(\".ownedImgs\").append($(\".bg .cl\").find(\"li\")).parent()\r\n\t\t .find(\".ownedMusics\").append($(\".music .cl\").find(\"li\"));\r\n\t}", "function clearInitData(){\n\t\t\n\t\tvar objItems = g_objWrapper.children().remove();\n\t}", "resetList() {\n let originalList = this.state.products;\n originalList.forEach((product) => {\n if (!product.addedCount) {\n product.inventory = product.inventory;\n\n } else if (product.addedCount && product.inventory === 0) {\n product.inventory = product.addedCount;\n delete product.addedCount;\n delete product.remaningCount;\n\n } else {\n product.inventory = product.addedCount + product.remaningCount;\n delete product.addedCount;\n delete product.remaningCount;\n }\n });\n\n this.setState({\n products: originalList\n });\n }", "function cleanUpListItems() {\n $(\"#newsroom_listview_news\").empty();\n $(\"#activities_listview_news\").empty();\n $(\"#video_listview_comments\").empty();\n $(\"#hsbc_listview_videos\").empty();\n $(\"#talentShow_listview_news\").empty();\n }", "function clearDataList() {\n\t\t\tlastItemDataRefId = 0;\n\t\t\tdataArray = [];\n\t\t}", "deleteSavedItems() {\n\n }", "function listCacheClear(){this.__data__=[];this.size=0;}", "function listCacheClear(){this.__data__=[];this.size=0;}", "function listCacheClear(){this.__data__=[];this.size=0;}", "function listCacheClear(){this.__data__=[];this.size=0;}", "function listCacheClear(){this.__data__=[];this.size=0;}", "function listCacheClear(){this.__data__=[];this.size=0;}", "function listCacheClear(){this.__data__=[];this.size=0;}", "function listCacheClear(){this.__data__=[];this.size=0;}", "function listCacheClear(){this.__data__=[];this.size=0;}", "function listCacheClear(){this.__data__=[];this.size=0;}", "function unArchiveItems() {\n ListService.unArchiveItems();\n }", "processItems() {}", "function listCacheClear(){this.__data__=[];}", "function listCacheClear(){this.__data__=[];}", "function listCacheClear(){this.__data__=[];}", "function listCacheClear(){this.__data__=[];}", "clear() {\n this.stack = this.initialItem ? [this.initialItem] : [{ index: 0, state: [] }];\n this.position = 0;\n this.onUpdate();\n }", "resetItems() {\n window.localStorage.clear();\n this.setState({\n items: []\n });\n }", "function refreshPlayerItems() {\n /* clear current items */\n\n var objs = ObjPool.objects;\n var garbbage = [];\n for (var i = 0; i < objs.length; ++i) {\n var o = objs[i];\n if (o.parent == Global.CANVAS.ITEM_CANVAS) {\n garbbage.push(o);\n }\n }\n for (var i = 0; i < garbbage.length; ++i) {\n garbbage[i].Destroy();\n }\n\n while (Global.CANVAS.ITEM_CANVAS.numChildren > 0) {\n Global.CANVAS.ITEM_CANVAS.removeChildAt(0);\n }\n\n var player = Global.PLAYER;\n var x_offset = 20, y_offset = -24;\n for (var i = 0; i < player.items.length; i++) {\n if (i % 5 == 0) {\n x_offset = 20;\n y_offset += 24;\n }\n var item = player.items[i];\n var obj = createBMPObj(32, 32, item.bmp_type, item.type, 0, 0.6 * Global.MAP_SCALE, Global.CANVAS.ITEM_CANVAS);\n obj.shape.x = x_offset;\n obj.shape.y = y_offset;\n if (item.hasOwnProperty(\"onClicked\")) {\n obj.onClicked = item.onClicked;\n }\n x_offset += 24;\n\n }\n}", "destroy() {\n this.removeAll();\n this.items = null;\n this._name = null;\n }", "clear () {\n this._collections = {}\n this._collectionsIndex = {}\n }", "function listCacheClear(){this.__data__=[];this.size=0}", "function listCacheClear(){this.__data__=[];this.size=0}", "function removeItems() {\n\n // uncompleted items\n for (var i = 0; i < listComponent.selected.length; i++) {\n var itemJson = JSON.parse(listComponent.selected[i].dataset.item);\n\n // Find uncompleted item that matches\n for (var j = 0; j < listComponent.unCompleted.length; j++) {\n if (listComponent.unCompleted[j].content == itemJson.content\n && listComponent.unCompleted[j].timeCreated == itemJson.timeCreated) {\n\n listComponent.unCompleted.splice(j, 1);\n break;\n }\n }\n }\n // completed items\n for (var i = 0; i < listComponent.selectedComplete.length; i++) {\n var itemJson = JSON.parse(listComponent.selectedComplete[i].dataset.item);\n\n // Find completed item that matches\n for (var j = 0; j < listComponent.completed.length; j++) {\n if (listComponent.completed[j].content == itemJson.content\n && listComponent.completed[j].timeCreated == itemJson.timeCreated) {\n\n listComponent.completed.splice(j, 1);\n break;\n }\n }\n }\n listComponent.updateController();\n }", "function clean()\t{\n\tmyName = null;\n\tmyType = null;\n\tmyMin = null;\n\tmyMax = null;\n\twhile (items.length > 0)\t{\n\t\tthis.patcher.remove(items.shift());\n\t}\n}", "function clearBag(){\n\tdocument.getElementById('wrapItems').innerHTML = null;\n\tbag = [];\n\tlocalStorage.clear();\n\tupdateBag();\n}", "updateItems(op,item){var response=!1;if(\"push\"==op){this.push(\"items\",item);response=!0}else if(\"pop\"==op){response=this.pop(\"items\")}else if(\"splice\"==op){this.splice(\"items\",this.items.length,0,item);response=!0}// force active to reprocess\nconst active=this.active;this.set(\"active\",0);this.set(\"active\",active);this.notifyPath(\"active\");return response}", "empty() {\n this.items = []\n }", "function clearOrderList(){\n order_item_id = [];\n order_quantity = [];\n}", "function clearAllListItems(){\n $('#todo li').remove();\n\n // reset count to 0 since we removed all of the list items\n count = 0;\n\n // update the new count in the DOM\n $('.count').html(count);\n }", "clearGatedItems(cb) {\n this.session.delete({ url: this.url + '/api/filter/gated' }, cb);\n }", "clear() {\n this._cache = [];\n this._updated = false;\n }", "function wipe() {\n removeAllEventsFromDisplay();\n cosmo.view.cal.itemRegistry = new cosmo.util.hash.Hash();\n }", "deleteList() {\n this.items = [];\n }", "allItems() {\n return this.filterDuplicates(this.cachedItems.concat(this.items));\n }", "allItems() {\n return this.filterDuplicates(this.cachedItems.concat(this.items));\n }", "function clear() {\n\tdelete this.dataStore;\n\tthis.dataStore = [];\n\tthis.listSize = this.pos = 0;\n}", "clear() {\n this._storageService.remove(this._name);\n this._data = [];\n console.log(`ListService. Clearing ${this._name} data.`);\n console.log(this._data);\n }", "function clearCache() {\n\tvar vals = Store.listItems();\n window.console.log(\"Total stored: \" + vals.length + \" keys\");\n for (var i = 0; i < vals.length; i++) {\n window.console.log(\"Deleting \" + vals[i]);\n Store.deleteItem(vals[i]);\n\t}\n}", "function clearItems() {\n\n while (list.hasChildNodes()) {\n list.removeChild(list.firstChild);\n }\n}", "clear() {\n this.splice(0, this.getCount());\n }", "constructor() {\n\t\tthis.clear();\n\t}", "destroy() {\n let me = this;\n\n me._items.splice(0, me._items.length);\n me.map.clear();\n\n super.destroy();\n }", "constructor() {\n\t\tthis.items = [];\n\t}", "function _itemHandler() {\n\t _tracks = [];\n\t _tracksById = {};\n\t _unknownCount = 0;\n\t }", "redefine() {\n // go threw all added items\n for (var i = 0; i < this.__items.length; i++) {\n var item = this.__items[i].item;\n // set the new init value for the item\n this.__items[i].init = item.getValue();\n }\n }", "refresh() {\n this.item.refresh();\n }", "function clearItems() {\n $lastPromise = $$\n .deleteCartItems()\n .then(onSyncd);\n\n return _this_;\n }", "clearItemsList() {\n let itemsListDiv = document.getElementById(\"todo-list-items-div\");\n // BUT FIRST WE MUST CLEAR THE WORKSPACE OF ALL CARDS BUT THE FIRST, WHICH IS THE ITEMS TABLE HEADER\n let parent = itemsListDiv;\n while (parent.firstChild) {\n parent.removeChild(parent.firstChild);\n }\n }", "clearItemsList() {\n let itemsListDiv = document.getElementById(\"todo-list-items-div\");\n // BUT FIRST WE MUST CLEAR THE WORKSPACE OF ALL CARDS BUT THE FIRST, WHICH IS THE ITEMS TABLE HEADER\n let parent = itemsListDiv;\n while (parent.firstChild) {\n parent.removeChild(parent.firstChild);\n }\n }", "clearActiveItems() {\n removeClasses(this.activeItems, 'active');\n this.activeItems = [];\n }", "clear() {\n componentList.clear();\n typeList.clear();\n }", "function refreshData(){\n $('#abHeader').nextAll().remove(); // clears table rows\n $('#abErrorsLog ul').empty(); // clears errors log\n refreshCycle = 0; // reset refresh cycle control\n itemIds = [];\n itemSince = null;\n loadData();\n }", "function ClearItems() {\r\n items = []; // clear the array\r\n shoppingListItems.innerHTML = ''; // clear the list\r\n} // ClearItems()", "function clearData () {\n getSetUpList().forEach(function (entry) {\n if (entry.list) {\n entry.factory.initList(entry.id);\n } else {\n entry.factory.initObj(entry.id);\n }\n });\n }", "constructor () {\n\t\tthis.items = [];\n\t}", "function removeListItem(name)\r\n{\r\n\tfor( var index in allItems) {\r\n\t\tif (name == allItems[index].name) {\r\n\t\t\tallItems.splice(index, 1);\r\n\t\t\tlocalStorage.setObject(\"goods\", allItems);\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n}", "function removeAllProducts() {\n cart = {};\n saveCart();\n showCart();\n}", "function listCacheClear() {\n\t\t this.__data__ = [];\n\t\t this.size = 0;\n\t\t }", "function listCacheClear() {\n\t\t this.__data__ = [];\n\t\t this.size = 0;\n\t\t }", "_storeItems() {\n const that = this,\n items = that.enableShadowDOM && that.shadowRoot ? that.shadowRoot.querySelectorAll('jqx-accordion-item') : that.getElementsByTagName('jqx-accordion-item');\n\n that._items = Array.from(items);\n\n if (that._items.length === 0) {\n that.$container.addClass('jqx-empty');\n return;\n }\n\n that.$container.removeClass('jqx-empty');\n\n const heights = that._getItemsHeights();\n\n for (let i = 0; i < that._items.length; i++) {\n that._updateExpanedContentLocalHeight(that._items[i], heights[i]);\n }\n }", "_rebuildMenu() {\n\n this.refreshMenuObjects = {};\n\n this.disconnectSignals(false, true);\n\n let oldItems = this.menu._getMenuItems();\n for (let item in oldItems){\n oldItems[item].destroy();\n }\n }", "function clear() {\n delete this.dataStore;\n this.dataStore = [];\n this.listSize = this.pos = 0;\n}" ]
[ "0.7485217", "0.73743623", "0.73567146", "0.7294889", "0.7196015", "0.7069311", "0.6989159", "0.67940485", "0.67940485", "0.6764755", "0.675427", "0.6753755", "0.67269295", "0.67134917", "0.6705442", "0.66676176", "0.66573215", "0.66570777", "0.6637358", "0.663179", "0.66301304", "0.6609242", "0.65873694", "0.65638644", "0.65407985", "0.6504021", "0.6491084", "0.64813524", "0.6471105", "0.6451176", "0.64491725", "0.6441881", "0.64354277", "0.6433396", "0.6424744", "0.6422282", "0.6421942", "0.64205956", "0.6408325", "0.6408325", "0.6408325", "0.6408325", "0.6408325", "0.6408325", "0.6408325", "0.6408325", "0.6408325", "0.6408325", "0.64012724", "0.63957727", "0.6392892", "0.6392892", "0.6392892", "0.6392892", "0.63926816", "0.6389984", "0.6385966", "0.63797873", "0.63780296", "0.6375312", "0.6375312", "0.6349068", "0.6347047", "0.6345937", "0.63295203", "0.6317841", "0.6303488", "0.63004935", "0.62936705", "0.6287261", "0.62764657", "0.62764496", "0.6271616", "0.6271616", "0.6238689", "0.6230974", "0.6223448", "0.6204178", "0.62014323", "0.6201311", "0.61985725", "0.6194953", "0.61906534", "0.6189458", "0.61893076", "0.61884034", "0.61871535", "0.61871535", "0.6176502", "0.6169463", "0.61639947", "0.61471415", "0.61453104", "0.6141325", "0.61384684", "0.61343795", "0.6124042", "0.6124042", "0.61202365", "0.61191404", "0.61126304" ]
0.0
-1
Resize the JS9 window
function resizeJS9() { let wWidth = window.innerWidth / 1.2; let wHeight = window.innerHeight - 125; $('#JS9-canvas').css('margin-left', (window.innerWidth-wWidth)/2+'px'); $('.JS9Menubar').attr('data-width', wWidth); $('.JS9Toolbar').attr('data-width', wWidth); $('.JS9Toolbar').attr('data-height', '30px'); $('.JS9').attr('data-width', wWidth); $('.JS9').attr('data-height', wHeight); $('.JS9Colorbar').attr('data-width', wWidth); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resize() {\n\twindowWidth = window.innerWidth;\n\twindowHeight = window.innerHeight;\n renderer.setSize(window.innerWidth,window.innerHeight);\n}", "function resize() {\n\twindowWidth = window.innerWidth;\n\twindowHeight = window.innerHeight;\n renderer.setSize(window.innerWidth,window.innerHeight);\n}", "function resizeWindow() {\n setWindowWidth(window.innerWidth);\n }", "function resizeGameWindow()\n{\n Game.engine.scale.setGameSize($( window ).width(), $( window ).height()*0.8);\n}", "resizeGameWindow() {\n // utworzenie stałych z destrukturyzacji obiektu, tj. wyciągnięcie z window.innerWidth/window.innerHeigth zmiennych bezpośrednio do innerWidth (pod nazwą width) i innerHeigth(pod nazwą height)\n const { innerWidth: width, innerHeight: height } = window;\n const scale = Math.min(width / CANVAS_WIDTH, height / CANVAS_HEIGHT);\n\n //ustawienie aktualnej skali do wartości skali\n document.documentElement.style.setProperty(SCALE_PROPERTY, scale);\n }", "function windowResize() {\n dbC = getDBC();\n winSize = {x:(dbC[0])? dbC[0]:window.innerWidth, y:(dbC[1])? dbC[1]:window.innerHeight}\n}", "resize(windowRect) {}", "resizeWindow() {\n\n let evt;\n /* if (Event.prototype.initUIEvent) {\n evt = window.document.createEvent('UIEvents');\n evt.initUIEvent('resize', true, false, window, 0);\n }\n else {\n evt = new UIEvent('resize');\n }*/\n evt = document.createEvent(\"Event\");\n evt.initEvent(\"resize\", true, false);\n window.dispatchEvent(evt);\n }", "resize(windowRect) {\n }", "function changeResize() {\n setWidth(window.innerWidth);\n }", "function resizeWindow() {\n console.log('You Change the size of the Window!');\n}", "static async resizeWindow(width = -1, height = -1) {\n class Size {\n width;\n height;\n }\n\n const windowSize = await this.executeScript(() => ({\n width: window.screen.availWidth,\n height: window.screen.availHeight,\n }));\n\n const result = windowSize;\n if (width !== -1) {\n result.width = width;\n }\n\n if (height !== -1) {\n result.height = height;\n }\n\n return this.setWindowSize(result.width, result.height);\n }", "function windowResize() {\n resiveCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n\n getWrapperWidth();\n resizeCanvas(wrapperWide, wrapperWide);\n\n widthVar = (width - 40) / 100;\n drawArea = (width - 40);\n\n switchBox();\n}", "function windowResized() {\n b=0;\n plasticIf();\n c=(800+b);\n console.log(c, \"windowresized\");\n resizeCanvas(1200, c);\n}", "function resizeWindow() {\n let canvas = document.getElementById(renderSettings.viewPort.canvasId);\n\n setUpViewport(gl, canvas, ctx.uProjectionMatId, window.innerWidth, window.innerHeight, renderSettings.viewPort.fovy,\n renderSettings.viewPort.near, renderSettings.viewPort.far);\n}", "function onWindowResize() {\n updateSizes();\n }", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight)\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight)\n}", "function windowResized() {\n\tresizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n\tresizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\r\n resizeCanvas(windowWidth, windowHeight)\r\n}", "function windowResized() {\r\n resizeCanvas(windowWidth, windowHeight);\r\n}", "function windowResized() {\r\n resizeCanvas(windowWidth, windowHeight);\r\n}", "function windowResized() {\n resizeCanvas(width, height);\n}", "function resizeWindow() {\n let canvas = document.getElementById(renderSettings.viewPort.canvasId);\n setUpViewport(gl, canvas, ctx.uProjectionMatId, window.innerWidth, window.innerHeight, renderSettings.viewPort.fovy,\n renderSettings.viewPort.near, renderSettings.viewPort.far);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized () {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized () {\n\tresizeCanvas(windowWidth, windowHeight);\n }", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n resize();\n redraw();\n}", "function resize() {\n let width;\n if ($('.mainArea')[0].offsetWidth > 490) width = $('.mainArea')[0].offsetWidth;\n else width = 490;\n ipcRenderer.send('resize', $('.mainArea')[0].offsetHeight, width);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight, false);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight, false);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight, false);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight, false);\n}", "function windowResized() {\r\n resizeCanvas(windowWidth, windowHeight, false);\r\n}", "_resize() {\n this._onChangeViewport({\n width: window.innerWidth,\n height: window.innerHeight\n });\n }", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}//end windowResized", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight - 50);\n}", "function windowResized() {\n\twindowW = window.innerWidth;\n\twindowH = window.innerHeight;\n resizeCanvas(window.innerWidth, window.innerHeight);\n}", "function windowResized() {\n resizeCanvas(canvasWidth, canvasHeight);\n}", "function windowResized() {\n resizeCanvas(canvasX, canvasY);\n}", "function windowResized() {\n\tresizeCanvas(innerWidth, innerHeight);\n}", "function windowResized(){\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized(){\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n widthElement = document.getElementById('game-holder').getBoundingClientRect().width;\n resizeCanvas(widthElement, widthElement);\n}", "function windowResized() {\n setup();\n}", "function windowResized() {\n // We can use the resizeCanvas() function to resize our canvas to the new window dimensions\n resizeCanvas(windowWidth,windowHeight);\n}", "function windowResized() {\n console.log('resized');\n resizeCanvas(windowWidth, windowHeight);\n}", "function windowResized() {\n\tlet container = document.getElementById(containerID);\n\tif (!container) {\n\t\treturn;\n\t}\n\tresizeCanvas(Math.floor(container.clientWidth), Math.floor(container.clientHeight));\n}", "function windowResized(){\n if(windowWidth > 800){\n resizeCanvas(windowWidth,windowHeight);\n }\n}", "function windowResized () {\n resizeCanvas(windowWidth, windowHeight);\n resize=1;\n}", "function resizeWindow() {\n window.setTimeout(function() {\n chrome.tabs.getCurrent(function (tab) {\n var newHeight = Math.min(document.body.offsetHeight + 140, 700);\n chrome.windows.update(tab.windowId, {\n height: newHeight,\n width: 520\n });\n });\n }, 150);\n}", "function windowResized() {\n // retrieve the new client width\n clientWidth = Math.max(200, window.innerWidth - 200);\n aspRatio = 1;\n clientHeight = clientWidth * aspRatio;\n \n // resize the canvas and plot, reposition the GUI \n resizeCanvas(clientWidth, clientHeight);\n examplePlot.GPLOT.setOuterDim(clientWidth, clientHeight);\n examplePlot.GPLOT.setPos(0, 0);\n gui.prototype.setPosition(clientWidth, examplePlot.GPLOT.mar[2]);\n}", "function resize() {\n\t\tself.wz.height($(window).height()-self.delta);\n\t\tself.rte.updateHeight();\n\t}", "function resizeJS9InDiv() {\n let wWidth = $('#JS9-canvas').width();\n let wHeight = window.innerHeight - 200;\n $('.JS9Menubar').attr('data-width', wWidth);\n $('.JS9Toolbar').attr('data-width', wWidth);\n $('.JS9Toolbar').attr('data-height', '30px');\n $('.JS9').attr('data-width', wWidth);\n $('.JS9').attr('data-height', wHeight);\n $('.JS9Colorbar').attr('data-width', wWidth);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight, false);\n init();\n}", "function windowResized(){\n canvas.resize(windowWidth, windowHeight - canvasadjust);\n}", "function resizeAction() {\n APPmessageWindowResize();\n}", "function windowResized()\n{\n zinjs.info.width = $(window).width();\n zinjs.info.height = $(window).height();\n if (zinjs.info.zoomArea) {\n zinjs.info.zoomArea.zoomIn();\n }\n}", "function windowResized() {\n resizeCanvas(innerWidth, innerHeight);\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n addModelButton.position(windowWidth - 150, 30);\n}", "function handleResize() {\n setWindowWidth(window.innerWidth);\n }", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n scaleMaximums();\n}" ]
[ "0.7795323", "0.7795323", "0.7631124", "0.74740404", "0.74190325", "0.7363547", "0.7343962", "0.73046345", "0.7256016", "0.72354543", "0.7213926", "0.7203825", "0.7202177", "0.7186704", "0.71828043", "0.7175263", "0.71735", "0.71721643", "0.71721643", "0.7162295", "0.7162295", "0.7162095", "0.7161462", "0.7161462", "0.7153093", "0.7150473", "0.7147932", "0.7147932", "0.7147932", "0.7147932", "0.7147932", "0.7147932", "0.7147932", "0.7147932", "0.7147932", "0.7147932", "0.7147932", "0.7147932", "0.7147932", "0.7147932", "0.7147932", "0.7147932", "0.7147932", "0.7147932", "0.7147932", "0.7147932", "0.7147932", "0.7147932", "0.7147932", "0.7147932", "0.7147932", "0.7147932", "0.7147932", "0.71398497", "0.71291596", "0.71194375", "0.71194375", "0.71194375", "0.71194375", "0.71194375", "0.71194375", "0.71194375", "0.71194375", "0.71194375", "0.71194375", "0.7116864", "0.7108807", "0.7104468", "0.7104468", "0.7104468", "0.7104468", "0.7098955", "0.70961595", "0.7085328", "0.70853066", "0.70836204", "0.707565", "0.70711917", "0.70660126", "0.70569575", "0.70569575", "0.70554745", "0.7045087", "0.7044265", "0.7037724", "0.7031844", "0.702197", "0.7021941", "0.7017238", "0.70158565", "0.7008404", "0.7005327", "0.7002654", "0.6997328", "0.6994282", "0.6990227", "0.6981856", "0.69724095", "0.69566804", "0.6950155" ]
0.7360884
6
Resize JS9 in a div (id must be JS9canvas)
function resizeJS9InDiv() { let wWidth = $('#JS9-canvas').width(); let wHeight = window.innerHeight - 200; $('.JS9Menubar').attr('data-width', wWidth); $('.JS9Toolbar').attr('data-width', wWidth); $('.JS9Toolbar').attr('data-height', '30px'); $('.JS9').attr('data-width', wWidth); $('.JS9').attr('data-height', wHeight); $('.JS9Colorbar').attr('data-width', wWidth); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resizeJS9() {\n let wWidth = window.innerWidth / 1.2;\n let wHeight = window.innerHeight - 125;\n $('#JS9-canvas').css('margin-left', (window.innerWidth-wWidth)/2+'px');\n $('.JS9Menubar').attr('data-width', wWidth);\n $('.JS9Toolbar').attr('data-width', wWidth);\n $('.JS9Toolbar').attr('data-height', '30px');\n $('.JS9').attr('data-width', wWidth);\n $('.JS9').attr('data-height', wHeight);\n $('.JS9Colorbar').attr('data-width', wWidth);\n}", "function resizeVideoJS(){\n\t\tvar width = document.getElementById(id).parentElement.offsetWidth;\n myPlayer.width(width).height( width * aspectRatio );\n }", "function resizeVideoJS(){\n var width = document.getElementById(myPlayer.el().id).parentElement.offsetWidth;\n var aspectRatio=8/12;\n myPlayer.width(width).height( width * aspectRatio);\n }", "function resize(){\n let style_height = +getComputedStyle(canvas).getPropertyValue(\"height\").slice(0, -2); \n let style_width = +getComputedStyle(canvas).getPropertyValue(\"width\").slice(0, -2); \n\n canvas.setAttribute('height', style_height * dpi); \n canvas.setAttribute('width', style_width * dpi); \n}", "_resizeCanvas(htmlId) {\n let canvas = $(`#${htmlId}-canvas`);\n let w = canvas.parent().width();\n let h = canvas.parent().height();\n canvas.attr(\"width\", w);\n canvas.attr(\"height\", h);\n RGraph.Clear(canvas[0]);\n RGraph.Redraw();\n }", "_resizeCanvas(htmlId) {\n let canvas = $(`#${htmlId}-canvas`);\n let w = canvas.parent().width();\n let h = canvas.parent().height();\n canvas.attr(\"width\", w);\n canvas.attr(\"height\", h);\n RGraph.Clear(canvas[0]);\n RGraph.Redraw();\n }", "scale(size) {\n document.getElementById(\"guiArea\").style.width = size + \"px\";\n }", "function resizeVideoJS() {\n var width = document.getElementById(myPlayer.id()).parentElement.offsetWidth;\n myPlayer.width(width).height(width * aspectRatio);\n }", "function resizeVideoJS(){\n // Get the parent element's actual width\n var width = document.getElementById(myPlayer.id).parentElement.offsetWidth;\n // Set width to fill parent element, Set height\n\tif($(document).width() < 780)\n\t\tmyPlayer.width(width).height( width * aspectRatio );\n\telse\n myPlayer.width(width).height( $(window).height() );\n }", "function resize() {\n let parStyle = window.getComputedStyle(canvas.elt.parentNode),\n cWidth = parseInt(parStyle.width),\n cHeight = parseInt(parStyle.height);\n\n cHeight -= parseInt(parStyle.paddingTop) + parseInt(parStyle.paddingBottom);\n cWidth -= parseInt(parStyle.paddingLeft) + parseInt(parStyle.paddingRight);\n resizeCanvas(cWidth, cHeight, true);\n}", "canvasResize()\n {\n View.canvas.setAttribute(\"width\", this.floatToInt(window.innerWidth*0.95));\n View.canvas.setAttribute(\"height\",this.floatToInt(window.innerHeight*0.95));\n\n //update objects with the new size\n this.updateCharacterDim();\n this.updateVirusDim();\n this.updateSyringesDim();\n this.background.resize();\n\n }", "function resize16x9(element) {\r\n\r\n \t$(\"#\"+element).each(function() {\r\n \t\tw = $(this).width();\r\n \t\th = Math.round((w/16)*9);\r\n \t\t$(this).height(h);\r\n \t});\r\n }", "function resizeIt(magnification)\r\n\r\n{var new_layout_width=(original_size.w*magnification)+layout_width_offset;\r\n layout.style.width=new_layout_width.toString()+\"px\";\r\n embed_tag.setAttribute(\"width\",original_size.w*magnification);\r\n\r\n embed_tag.setAttribute(\"height\",original_size.h*magnification);\r\n\r\n}", "function resizeCanvas() {\n let parent = canv.parentNode;\n if (parent == document.body) {\n parent = window;\n canv.style.width = parent.innerWidth + \"px\";\n\n canv.width = parent.innerWidth;\n canv.height = parent.innerHeight;\n }\n else {\n //Take the canvas out of the parent div sive calculation momentarily\n can.style.height = \"0px\";\n can.style.width = \"0px\";\n can.width = 0\n can.height = 0;\n //Then on the next tick put it back in.\n setTimeout(function () {\n let width = parent.clientWidth;\n let height = parent.clientHeight;\n can.style.width = width + \"px\";\n can.style.height = height + \"px\";\n can.width = width;\n can.height = height;\n //console.log(`${parent.clientWidth}-${parent.innerWidth}-${parent.offsetWidth}`)\n console.log(`${can.style.height} ${can.height}`)\n }, 0);\n\n }\n }", "function resize(){\n rect = Canvas.getBoundingClientRect()\n ratio = S/rect.height\n Canvas.width = S\n Canvas.height = S\n\n for (let i=0; i<Class('image').length; i++){\n let c = Class('image')[i]\n c.width = S\n c.height = S\n }\n}", "function resizeCanvas(){\n\tlet container = document.getElementById(\"canvasContainer\");\n\t\n\tcanvas.width = $(container).width();\n\tcanvas.height = $(container).height();\n\t\n\tredraw();\n}", "function resize() {\n let width;\n if ($('.mainArea')[0].offsetWidth > 490) width = $('.mainArea')[0].offsetWidth;\n else width = 490;\n ipcRenderer.send('resize', $('.mainArea')[0].offsetHeight, width);\n}", "function resize_canvas() {\n\t\t\tcanvas_elem.width = window.innerWidth / 2;\n\t\t\tcanvas_elem.height = window.innerWidth / 2;\n\n\t\t\tupdate_needed = true;\n\t\t}", "function change_container() {\n var c = document.getElementById('jsmind_container');\n c.style.width = '800px';\n c.style.height = '500px';\n}", "function resizeCanvas() {\n //low level\n c.width = window.innerWidth;\n c.height = window.innerHeight;\n //update wrapper\n st.canvas.width = c.width;\n st.canvas.height = c.height;\n //update objects and redraw\n updateObjects();\n}", "function resize(width, height) {\n var ratio = config.width/config.height;\n var x = 0;\n var y = 0;\n var w = 0;\n var h = 0;\n if (width / height >= ratio) {\n w = height * ratio;\n x = (width - w)/2;\n h = height;\n } else {\n w = width;\n h = width / ratio;\n y = (height - h)/2;\n }\n renderer.view.style.width = w + 'px';\n renderer.view.style.height = h + 'px';\n renderer.view.style.left = x + 'px';\n renderer.view.style.top = y + 'px';\n renderer.view.style.position = \"relative\";\n}", "function resize(width, height) {\n var ratio = config.width/config.height;\n var x = 0;\n var y = 0;\n var w = 0;\n var h = 0;\n if (width / height >= ratio) {\n w = height * ratio;\n x = (width - w)/2;\n h = height;\n } else {\n w = width;\n h = width / ratio;\n y = (height - h)/2;\n }\n renderer.view.style.width = w + 'px';\n renderer.view.style.height = h + 'px';\n renderer.view.style.left = x + 'px';\n renderer.view.style.top = y + 'px';\n renderer.view.style.position = \"relative\";\n}", "function resizeBoardDOM(width,height) {\n $(\"#board\").attr(\"width\",width);\n $(\"#board\").attr(\"height\",height);\n}", "function fixCanvas(){\n CANVAS.width=400\n CANVAS.height=225\n CANVAS.style.width = \"400px\"\n CANVAS.style.height = \"225px\"\n}", "resize(w, h) {\n\n let c = this.canvas;\n let x, y;\n let width, height;\n\n // Find the best multiplier for\n // square pixels\n let mul = Math.min(\n (w / c.width) | 0, \n (h / c.height) | 0);\n \n // Compute properties\n width = c.width * mul;\n height = c.height * mul;\n x = w/2 - width/2;\n y = h/2 - height/2;\n \n // Set style properties\n let top = String(y | 0) + \"px\";\n let left = String(x | 0) + \"px\";\n\n c.style.height = String(height | 0) + \"px\";\n c.style.width = String(width | 0) + \"px\";\n c.style.top = top;\n c.style.left = left;\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 resizeCanvas() {\n let width = $('#diagram').width();\n $('#myCanvas')[0].attributes[1].nodeValue = width;\n $('#myCanvas')[0].attributes[2].nodeValue = width / 2;\n}", "function xResizeTo(e,w,h)\r\n{\r\n xWidth(e,w);\r\n xHeight(e,h);\r\n}", "function resize(width, height) {\n JFCustomWidget.requestFrameResize({\n width: width,\n height: height,\n })\n}", "function displayResize(evt) {\n var available_height = window.innerHeight - 100,\n available_width = window.innerWidth;\n var tmp_square_height = available_height >> 3,\n tmp_square_width = available_width / 11.5;\n var tmp = tmp_square_height > tmp_square_width ?\n tmp_square_width : tmp_square_height;\n var tmp_square = tmp < 30 ? 30 : tmp;\n game.render_elements(tmp_square, tmp_square);\n var pieces = game.elements.pieces;\n for (var y = 9; y > 1; y--){\n for(var x = 1; x < 9; x++){\n var i = y * 10 + x;\n pieces[i].height = tmp_square;\n pieces[i].width = tmp_square;\n }\n }\n}", "function resizeBoardDOM(width, height) {\n $(\"#board\").attr(\"width\", width);\n $(\"#board\").attr(\"height\", height);\n}", "function resize() {\n\t\t\tcanvas.width = container.offsetWidth;\n\t\t\tcanvas.height = container.offsetHeight;\n\t\t}", "changeSizeRond(val) {\r\n this.cercle.style.width = val + \"px\";\r\n this.cercle.style.height = val + \"px\";\r\n}", "function doResize()\n{\n\tcanvas.width = window.innerWidth;\n\tcanvas.height = window.innerHeight;\n}", "function resize() {\n var canvas = document.querySelector(\"canvas\");\n var parent = document.getElementById('wheel_game');\n var windowWidth = parent.offsetWidth;\n var windowHeight = parent.offsetHeight;\n var windowRatio = windowWidth / windowHeight;\n var gameRatio = game.config.width / game.config.height;\n if (windowRatio < gameRatio) {\n canvas.style.width = windowWidth + \"px\";\n canvas.style.height = (windowWidth / gameRatio) + \"px\";\n } else {\n canvas.style.width = (windowHeight * gameRatio) + \"px\";\n canvas.style.height = windowHeight + \"px\";\n }\n}", "function sizeCanvas($obj) {\n CW = $obj.width();\n CH = $obj.height();\n CScale = CW / scaleFactor;\n canvas.width = CW;\n canvas.height = CH;\n}", "function resize() {\n\tvar height = window.innerHeight;\n\n\tvar ratio = canvas.width/canvas.height;\n\tvar width = height * ratio;\n\n\tcanvas.style.width = width+'px';\n\tcanvas.style.height = height+'px';\n}", "function resizeDiv(id, width, height)\n{\n\tdocument.getElementById(id).style.width = width;\n\tdocument.getElementById(id).style.height = height;\n}", "_setSize() {\n this.colorPickerCanvas.style.width = '100%';\n this.colorPickerCanvas.style.height = '100%';\n\n this.colorPickerCanvas.width = 289 * this.pixelRatio;\n this.colorPickerCanvas.height = 289 * this.pixelRatio;\n }", "function resize() {}", "resize () {\n document.body.style.overflow = 'hidden'\n\n const maxMulti = 20\n // overflow pixels\n const padding = 1\n const w = 320\n const h = 180\n const availW = window.innerWidth\n const availH = window.innerHeight\n // - 20 for padding\n const maxW = Math.floor(availW / (w - padding))\n const maxH = Math.floor(availH / (h - padding))\n let multi = maxW < maxH ? maxW : maxH\n\n if (multi > maxMulti) multi = maxMulti\n\n const canvas = document.getElementsByTagName('canvas')[0]\n canvas.style.width = `${multi * w}px`\n canvas.style.height = `${multi * h}px`\n }", "function change_container(){\n\tvar c = document.getElementById('jsmind_container');\n\tc.setAttribute(\"style\",\"display:block;width:100vw;height:100vh\");\n\tresize_jsmind();\n}", "function tpResize(w, h, id) {\r\n var $player = $(\"#live_site_player_flash\");\r\n\r\n localStorage.setItem(\"twitchtv_plus_vid_w\", w + \"px\");\r\n localStorage.setItem(\"twitchtv_plus_vid_h\", h + \"px\");\r\n localStorage.setItem(\"twitchtv_plus_res_selected\", id);\r\n\r\n if (0 == $player.length) {\r\n alert(\"Unable to get the Twitch.TV player object\");\r\n return;\r\n }\r\n\r\n $player.css({width: w + \"px\", height: h + \"px\"});\r\n }", "function brd(x) {\n x.style.height=\"240px\";\n x.style.width = \"300px\";\n}", "function ResizeElement() {\n $(\"#divTestAreaB\").width(150).height(50);\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 cambiarPorte(wi, hi){\n\tget('wcr_imagen').style.width = wi+'px';\n\tget('wcr_imagen').style.height = hi+'px';\n\tget('wcr_imagen').style.maxWidth = wi+'px';\n\tget('wcr_imagen').style.maxHeight = hi+'px';\n}", "function reescalaCanvas(){\n canvas.style.width = widthCanvasAmpliado + 'px';\n canvas.style.height = heightCanvasAmpliado + 'px';\n}", "_resizeHandler() {\n const that = this;\n\n that.$.container.style.width = that.$.container.style.height = Math.min(that.offsetWidth, that.offsetHeight) + 'px';\n }", "function setMapSize() {\n detail = +document.getElementById(\"detail\").value;\n ctx.canvas.width = document.getElementById(\"width_slider\").value;\n ctx.canvas.height = document.getElementById(\"height_slider\").value;\n}", "function tamaño_normal(){\n reducir.style.width = \"1280px\";\n reducir.style.height = \"720px\";\n\n }", "function enlarge()\r\n\t{\r\n\t\t//var portwidth = (gl.viewportWidth-2) * 2 + 2;\r\n\t\t//gl.viewportWidth = portwidth;\r\n\t\tvar canvas = document.getElementById(\"lesson01-canvas\");\r\n\t\tvar cwidth = canvas.width;\r\n\t\tvar cheigth = canvas.heigth;\r\n\t\tcanvas.width = (cwidth-2)*2 + 2;\r\n\t\tdrawScene();\r\n\t}", "function resize() {\n // Div containing the generated canvas of the game\n let div = document.getElementById(\"phaser\");\n // The generated game canvas\n let canvas = document.querySelector(\"canvas\");\n // Grabbing the values of the window height and width\n let windowWidth = window.innerWidth-20;\n let windowHeight = window.innerHeight-150;\n // Calculating the window ratio to adapt the frame\n let windowRatio = windowWidth / windowHeight;\n // Calculating the game ratio to adapt it to the window\n let gameRatio = game.config.width / game.config.height;\n // Adapting the sizes with the ratios\n if(windowRatio < gameRatio){\n canvas.style.width = windowWidth + \"px\";\n canvas.style.height = (windowWidth / gameRatio) + \"px\";\n div.style.width = windowWidth + \"px\";\n div.style.height = (windowWidth / gameRatio) + \"px\";\n }\n else{\n canvas.style.width = (windowHeight * gameRatio) + \"px\";\n canvas.style.height = windowHeight + \"px\";\n div.style.width = (windowHeight * gameRatio) + \"px\";\n div.style.height = windowHeight + \"px\";\n }\n }", "function resizeCanvas() {\n var canvasNode = document.getElementById('canvas');\n var pw = canvasNode.parentNode.clientWidth;\n var ph = canvasNode.parentNode.clientHeight;\n canvasNode.height = pw * 0.5 * (canvasNode.height / canvasNode.width);\n canvasNode.width = pw * 0.5;\n canvasNode.style.top = (ph - canvasNode.height) / 2 + \"px\";\n canvasNode.style.left = (pw - canvasNode.width) / 2 + \"px\";\n width = canvasNode.width;\n height = canvasNode.height;\n widthInBlocks = width / blockSize;\n heightInBlocks = height / blockSize;\n }", "resizeGameWindow() {\n // utworzenie stałych z destrukturyzacji obiektu, tj. wyciągnięcie z window.innerWidth/window.innerHeigth zmiennych bezpośrednio do innerWidth (pod nazwą width) i innerHeigth(pod nazwą height)\n const { innerWidth: width, innerHeight: height } = window;\n const scale = Math.min(width / CANVAS_WIDTH, height / CANVAS_HEIGHT);\n\n //ustawienie aktualnej skali do wartości skali\n document.documentElement.style.setProperty(SCALE_PROPERTY, scale);\n }", "function resizeCanvas()\n{\n\tvar canvas = $('#canvas');\n\tvar container = $(canvas).parent();\n\tcanvas.attr('width', $(container).width() ); // Max width\n\tcanvas.attr('height', $(container).height() ); // Max height\n}", "function resizeCanvas() {\n \t\t\t\thtmlCanvas.width = window.innerWidth;\n \t\t\t\thtmlCanvas.height = window.innerHeight;\n \t\t\t\tredraw();\n \t\t\t}", "function resizedw(){\n\t\n}", "function resize() {\n\t var box = c.getBoundingClientRect();\n\t c.width = box.width;\n\t\tc.height = (typeof canvasHeight !== 'undefined') ? canvasHeight : document.body.scrollHeight;\n\t}", "resize() {\n if (!this._html) {\n return;\n }\n const mib = this.getMapInnerBounds();\n // Handle the max width\n let maxWidth = mib.width;\n if (this._opts.maxWidth !== undefined) {\n maxWidth = Math.min(maxWidth, this._opts.maxWidth);\n }\n maxWidth -=\n this._html.floatWrapper.offsetWidth - this._html.content.offsetWidth;\n this._html.content.style.maxWidth = `${maxWidth}px`;\n\n // Handle the max height\n let maxHeight = mib.height;\n if (this._opts.maxHeight !== undefined) {\n maxHeight = Math.min(maxHeight, this._opts.maxHeight);\n }\n maxHeight -=\n this._html.floatWrapper.offsetHeight - this._html.content.offsetHeight;\n this._html.content.style.maxHeight = `${maxHeight}px`;\n }", "function changeToSize(size) {\n setMedia();\n media.height = size;\n var ratio = media.videoWidth / media.videoHeight;\n $('#media-bench').width(media.height * ratio);\n trjs.editor.resizeTranscript();\n }", "function fitToContainer(canvasName){\n var canvas = document.getElementById(canvasName)\n canvas.style.width=\"100%\";\n canvas.style.height=\"100%\";\n canvas.width = canvas.offsetWidth;\n canvas.height = canvas.offsetHeight;\n}", "function canvas_resize()\n{\n canvas.style.width = window.innerWidth + 'px';\n canvas.style.height = window.innerHeight + 'px';\n}", "setSize(w, h) {\n this.width = w;\n this.height = h;\n this.DOM.el.style.width = `${this.width}px`;\n this.DOM.el.style.height = `${this.height}px`;\n }", "_resize() {\n const ratio = window.devicePixelRatio || 1;\n const width = window.innerWidth;\n const height = window.innerHeight;\n\n if (this.options.dpi) {\n this.width = width * ratio;\n this.height = height * ratio;\n } else {\n this.width = width;\n this.height = height;\n }\n\n this._canvas.width = this.width;\n this._canvas.height = this.height;\n\n this._canvas.style.width = width + 'px';\n this._canvas.style.height = height + 'px';\n }", "function resize() {\n\n const bodyWidth = parseInt(getComputedStyle(document.body).width.slice(0, -2), 10);\n\n if (bodyWidth < screenWidth) { //TODO fix width change\n screenWidth = bodyWidth;\n screenHeight = screenWidth / roadWidthSegments * roadHeightSegments;\n } else {\n screenHeight = parseInt(getComputedStyle(domElement).height.slice(0, -2), 10);\n screenWidth = Math.floor(screenHeight / roadHeightSegments * roadWidthSegments);\n }\n\n squareWidth = Math.floor(screenWidth / roadWidthSegments);\n screenWidth = roadWidthSegments * squareWidth; // pixel perfect :v\n\n domElement.setAttribute('height', screenHeight);\n domElement.setAttribute('width', screenWidth);\n\n render();\n }", "function sizeVideo() {\n\n console.log(new Date());\n\n // Get parent element height and width\n var parentHeight = elem.parentNode.offsetHeight;\n var parentWidth = elem.parentNode.offsetWidth;\n\n // Get native video width and height\n var nativeWidth = width;\n var nativeHeight = height;\n\n // Get the scale factors\n var heightScaleFactor = parentHeight / nativeHeight;\n var widthScaleFactor = parentWidth / nativeWidth;\n\n // Based on highest scale factor set width and height\n if (widthScaleFactor > heightScaleFactor) {\n elem.style.height = 'auto';\n elem.style.width = parentWidth+'px';\n } else {\n elem.style.height = parentHeight+'px';\n elem.style.width = 'auto';\n }\n }", "function setDivSize(){\n let box = document.getElementById('F-dynamicbg-box'),\n div = box.getElementsByTagName('div'),\n math = [0,1];\n for (let i=0;i<div.length;i++) {\n math[1] = getSJS(100,40,9)\n if(math[1] != math[2]){\n div[i].style.width = math[1] + 'px';\n div[i].style.height = math[1] + 'px';\n math[2] = math[1];\n }\n }\n\n for(let i=0;i<div.length;i++){\n div[i].style.left = getSJS(100,10,8) + 'vw';\n div[i].style.transform = 'rotate(' + getSJS(360,5,9) + 'deg)';\n }\n}", "function onResize() {\n var canvas = document.getElementById('canvas');\n canvas.width = document.body.offsetWidth;\n canvas.height = document.body.offsetHeight;\n}", "resize(width, height) {\n this.canvas.width = width;\n this.canvas.height = height;\n }", "resizeImmediate() {\n this.size = vec2.fromValues(this.canvas.parentElement.clientWidth, this.canvas.parentElement.clientHeight);\n this.dpi = window.devicePixelRatio;\n\n this.canvas.style.width = '100%';\n this.canvas.style.height = '100%';\n\n vec2.scale(this.size, this.size, this.options.scale);\n\n this.canvas.width = this.size[0] * this.dpi;\n this.canvas.height = this.size[1] * this.dpi;\n\n this.flagDirty();\n this.draw_required = true;\n\n Logger.debug(`Resizing renderer to ${this.size} @ ${this.dpi}x`);\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 changeSize() {\r\n if (w3.matches) {\r\n canvas.setAttribute(\"width\", \"300\");\r\n canvas.setAttribute(\"height\", \"450\");\r\n h = 450;\r\n w = 300;\r\n if (window.matchMedia(\"(max-height: 700px)\").matches) {\r\n canvas.setAttribute(\"height\", \"375\");\r\n h = 375;\r\n }\r\n if (window.matchMedia(\"(max-height: 600px)\").matches) {\r\n canvas.setAttribute(\"height\", \"300\");\r\n h = 300;\r\n } \r\n unit = 15;\r\n space = unit * nSpace;\r\n clearCanvas();\r\n } else if (w2.matches) {\r\n canvas.setAttribute(\"width\", \"600\");\r\n canvas.setAttribute(\"height\", \"600\");\r\n h = 600;\r\n w = 600;\r\n clearCanvas();\r\n } else if (w1.matches) {\r\n canvas.setAttribute(\"width\", \"600\");\r\n canvas.setAttribute(\"height\", \"800\");\r\n h = 800;\r\n w = 600;\r\n clearCanvas();\r\n } else {\r\n canvas.setAttribute(\"width\", \"600\");\r\n canvas.setAttribute(\"height\", \"500\");\r\n h = 500;\r\n w = 600;\r\n clearCanvas();\r\n }\r\n}", "function resizeDiv() {\r\n\t\t$this = $['mapsettings'].element;\r\n\t\tvar divsize = \"width:\" + $this.parent().get(0).clientWidth + \"px; height: \" + $(window).height() + 'px;';\r\n\t $this.attr('style', divsize);\t\t\r\n\t\tvar divsize = \"width:\" + ($this.parent().get(0).clientWidth - $this.get(0).offsetLeft) + \"px; height: \" + ($(window).height()-$this.get(0).offsetTop) + 'px;';\r\n\t $this.attr('style', divsize);\t\t\r\n\t\tloadImages();\r\n\t}", "function resizeCanvas(size)\n{\n\t$(\"#map-canvas\").attr(\"width\", size);\n\t$(\"#map-canvas\").attr(\"height\", size);\n\t$(\"#map-canvas\").css(\"width\", size + \"px\");\n\t$(\"#map-canvas\").css(\"height\", size + \"px\");\n\t\n\t$(\"#map-container\").css(\"width\", size + \"px\");\n\t$(\"#map-container\").css(\"height\", size + \"px\");\n\t$(\"#map-container\").css(\"flex-basis\", size + \"px\");\n\t\n\t$(\"#map-content\").css(\"width\", size + \"px\");\n\t$(\"#map-content\").css(\"height\", size + \"px\");\n\t\n\t$(\"#map-canvas\").css(\"width\", size + \"px\");\n\t$(\"#map-canvas\").css(\"height\", size + \"px\");\n\t\n\t$(\"#map-image\").css(\"width\", size + \"px\");\n\n\t$(\"#map-canvas\").css(\"width\", size + \"px\");\n\t$(\"#map-canvas\").css(\"height\", size + \"px\");\n}", "function encojer(){\n reducir.style.width = \"20em\";\n reducir.style.height = \"20em\";\n\n\n}", "function setSize(){\n\n\tvar winW = 600, winH = 400;\n\tif (document.body && document.body.offsetWidth) {\n\t winW = document.body.offsetWidth;\n\t winH = document.body.offsetHeight;\n\t}\n\tif (document.compatMode=='CSS1Compat' &&\n\t\tdocument.documentElement &&\n\t\tdocument.documentElement.offsetWidth ) {\n\t winW = document.documentElement.offsetWidth;\n\t winH = document.documentElement.offsetHeight;\n\t}\n\tif (window.innerWidth && window.innerHeight) {\n\t winW = window.innerWidth;\n\t winH = window.innerHeight;\n\t}\n\t\n\tvar canvas = document.getElementById(\"canvas\");\n\t\tcanvas.height = (winH - 25);\n\t\tcanvas.width = (winW - 5);\n\t\tconstants.MAX_X = winW - 5;\n\t\tconstants.MAX_Y = winH - 25;\n\t\n}", "resizeCanvas () {\n if (this._type === Sandpit.CANVAS && window.devicePixelRatio !== 1 && this._retina) {\n this._handleRetina()\n } else {\n this._canvas.width = this._canvas.clientWidth\n this._canvas.height = this._canvas.clientHeight\n }\n if (this._type === Sandpit.WEBGL || this._type === Sandpit.EXPERIMENTAL_WEBGL) {\n this._context.viewport(0, 0, this._context.drawingBufferWidth, this._context.drawingBufferHeight)\n }\n if (this.change) this.change()\n }", "function resizeVideo(){\r\n var width = $(window).width();\r\n var height = width*(16/9);\r\n }", "function resizeContent()\n{\n\tdocument.getElementById('editableDiv').style.width = document.body.clientWidth + \"px\";\n\tdocument.getElementById('editableDiv').style.height = document.body.clientHeight + \"px\";\n}", "function resize(){\n\n\tscreenW=$(window).width()-20;\n\tscreenH=$(window).height()-60;\n\t$(\"#buttonHolder\").css({width:screenW})\n\t$(\"#canvasHolder\").css({width:screenW, height:screenH})\n\tscreenRatio=screenW/screenH;\n\tif(canvasRatio>screenRatio){\n\t\tdefaultZoomLevel=(canvas.height/screenH)\n\t}else{\n\t\tdefaultZoomLevel =(canvas.width/screenW)\n\t}\n\tdefaultZoomLevel= defaultZoomLevel/2\n\tmodBrushSize=brushSize*defaultZoomLevel;\n\tif(canvasRatio>screenRatio){\n\t\tshowAllZoomLevel=(canvas.width/screenW)\n\t}else{\n\t\tshowAllZoomLevel=(canvas.height/screenH)\n\t}\n\t$(\"#buttonHolder\").css({marginTop:(screenH+50)+\"px\"});\n\t$(\"#markerHolder\").css({marginTop:(-($(\"#markerHolder\").height()))});\n\tzoomCanvasTo((canvas.width/2),(canvas.height/2), currentZoomLevel , currentZoomLevel)\n}", "adjustToContainer() {\n if (this.isFullscreen()) {\n return\n }\n let parent = window.getComputedStyle(this._domElement.parentNode),\n width = parseInt(parent.width, 10),\n height = parseInt(parent.height, 10)\n\n this.setSize(width, height)\n }", "function doResize() {\n var canvas = document.getElementById(\"drone-sim-canvas\");\n if((window.innerWidth > 40) && (window.innerHeight > 240)) {\n console.log(\"Canvas size changed.\");\n canvas.width = window.innerWidth-16;\n canvas.height = window.innerHeight-200;\n var w=canvas.clientWidth;\n var h=canvas.clientHeight;\n\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n gl.viewport(0.0, 0.0, w, h);\n\n aspectRatio = w/h;\n }\n}", "resize() {\n if (!this._html) {\n return;\n }\n const mib = this.getMapInnerBounds();\n // Handle the max width\n let maxWidth = mib.width;\n if (this._opts.maxWidth !== undefined) {\n maxWidth = Math.min(maxWidth, this._opts.maxWidth);\n }\n maxWidth -= (this._html.wrapper.offsetWidth - this._html.content.offsetWidth);\n this._html.content.style.maxWidth = `${maxWidth}px`;\n\n // Handle the max height\n let maxHeight = mib.height;\n if (this._opts.maxHeight !== undefined) {\n maxHeight = Math.min(maxHeight, this._opts.maxHeight);\n }\n maxHeight -= (this._html.wrapper.offsetHeight - this._html.content.offsetHeight);\n this._html.content.style.maxHeight = `${maxHeight}px`;\n }", "function rescale() {\n var val = parseFloat(document.getElementById(\"widthSlider\").value);\n myGanttDiagram.startTransaction(\"rescale\");\n myGanttDiagram.grid.gridCellSize = new go.Size(val, 150);\n myGanttDiagram._widthFactor = val / 30;\n myGanttDiagram.updateAllTargetBindings();\n myGanttDiagram.commitTransaction(\"rescale\");\n}", "function resizeMain(width, height)\n{\n var target = $(\"#main\");\n target.css('width', parseInt(width));\n target.css('height', parseInt(height));\n}", "function resizeHandler() {\n\t\tcanvas.setAttribute('width', document.documentElement.offsetWidth);\n\t\tcanvas.setAttribute('height', document.documentElement.offsetHeight);\n\t}", "redraw() {\n // size to content\n if(this.autoSize) {\n let size = this.getContentSize();\n this.width = size.w;\n this.height = size.h;\n }\n\n // apply the real size\n this.iframe.style.width = this.width + 'px';\n this.iframe.style.height = this.height + 'px';\n\n // det the scale to fit the container\n let containerSize = {\n w: this.element.offsetWidth,\n h: this.element.offsetHeight\n };\n let scale = {\n x: containerSize.w / this.width,\n y: containerSize.h / this.height\n };\n let finalScale = Math.min(1, scale.x, scale.y);\n\n // apply the transform\n let str = 'scale(' + finalScale + ')';\n this.iframe.style.transform = str;\n this.iframe.style.transformOrigin = '0 0';\n\n // center in the container\n let offset = {\n x: (containerSize.w - (this.width * finalScale)) / 2,\n y: (containerSize.h - (this.height * finalScale)) / 2\n };\n this.iframe.style.left = offset.x + 'px';\n this.iframe.style.top = offset.y + 'px';\n }", "scaleCanvas() {\n this.canvas.setWidth(this.width);\n this.canvas.setHeight(this.height);\n this.canvas.renderAll();\n }", "function handleResize() {\n container.style.width = (container.offsetHeight / 11) * 14 + \"px\";\n updateDisplay()\n}", "function pChangeSize(bean,aimWidth,aimHeight) {\n bean.style.width = aimWidth +_PX;\n bean.style.height = aimHeight + _PX; \n}", "function _resize(size){\n var sz = (size < 100) ? sz = 100 : sz = size;\n placeholder.each(function(){\n $(this).find('div.instrument').css({height : sz, width : sz});\n });\n }", "function resizeCanvas() {\n c.width = window.innerWidth;\n c.height = window.innerHeight; \n}", "function sizeCanvas() {\n var ratio = mMapHeight / mMapWidth;\n var width = window.innerWidth;\n var height = width * ratio;\n var canvas = $('#MapCanvas');\n canvas.css('width', width + 'px');\n canvas.css('height', height + 'px');\n\n document.getElementById(\"Instructions\").style.top = height + titleHeight - 8 + \"px\";\n\n // Save scale value for use with touch events.\n mCanvasScale = mMapWidth / width\n }", "function trx_addons_resize_video(cont) {\n if (cont===undefined) cont = jQuery('body');\n cont.find('video').each(function() {\n \"use strict\";\n var video = jQuery(this).eq(0);\n var ratio = (video.data('ratio')!=undefined ? video.data('ratio').split(':') : [16,9]);\n ratio = ratio.length!=2 || ratio[0]==0 || ratio[1]==0 ? 16/9 : ratio[0]/ratio[1];\n var mejs_cont = video.parents('.mejs-video');\n var w_attr = video.data('width');\n var h_attr = video.data('height');\n if (!w_attr || !h_attr) {\n w_attr = video.attr('width');\n h_attr = video.attr('height');\n if (!w_attr || !h_attr) return;\n video.data({'width': w_attr, 'height': h_attr});\n }\n var percent = (''+w_attr).substr(-1)=='%';\n w_attr = parseInt(w_attr, 0);\n h_attr = parseInt(h_attr, 0);\n var w_real = Math.round(mejs_cont.length > 0 ? Math.min(percent ? 10000 : w_attr, mejs_cont.parents('div,article').width()) : video.width()),\n h_real = Math.round(percent ? w_real/ratio : w_real/w_attr*h_attr);\n if (parseInt(video.attr('data-last-width'), 0)==w_real) return;\n if (mejs_cont.length > 0 && mejs) {\n trx_addons_set_mejs_player_dimensions(video, w_real, h_real);\n }\n if (percent) {\n video.height(h_real);\n } else {\n video.attr({'width': w_real, 'height': h_real}).css({'width': w_real+'px', 'height': h_real+'px'});\n }\n video.attr('data-last-width', w_real);\n });\n cont.find('.video_frame iframe').each(function() {\n \"use strict\";\n var iframe = jQuery(this).eq(0);\n if (iframe.attr('src').indexOf('soundcloud')>0) return;\n var ratio = (iframe.data('ratio')!=undefined \n ? iframe.data('ratio').split(':') \n : (iframe.parent().data('ratio')!=undefined \n ? iframe.parent().data('ratio').split(':') \n : (iframe.find('[data-ratio]').length>0 \n ? iframe.find('[data-ratio]').data('ratio').split(':') \n : [16,9]\n )\n )\n );\n ratio = ratio.length!=2 || ratio[0]==0 || ratio[1]==0 ? 16/9 : ratio[0]/ratio[1];\n var w_attr = iframe.attr('width');\n var h_attr = iframe.attr('height');\n if (!w_attr || !h_attr) {\n return;\n }\n var percent = (''+w_attr).substr(-1)=='%';\n w_attr = parseInt(w_attr, 0);\n h_attr = parseInt(h_attr, 0);\n var pw = iframe.parent().width(),\n ph = iframe.parent().height(),\n w_real = pw,\n h_real = Math.round(percent ? w_real/ratio : w_real/w_attr*h_attr);\n if (iframe.parent().css('position') == 'absolute' && h_real > ph) {\n h_real = ph;\n w_real = Math.round(percent ? h_real*ratio : h_real*w_attr/h_attr)\n }\n if (parseInt(iframe.attr('data-last-width'), 0)==w_real) return;\n iframe.css({'width': w_real+'px', 'height': h_real+'px'});\n iframe.attr('data-last-width', w_real);\n });\n}", "function do_onResize() {\n var elem = $('#transcript_display');\n if (!elem) {\n return;\n }\n if ($.browser.msie) {\n //y = document.body.clientHeight - 95;\n var x = $('body').offsetWidth - 380;\n elem.width(x);\n //elem.style.height = '700px';\n } \n else if ($.browser.opera) {\n // Opera is special: it doesn't like changing width\n elem.height(window.innerHeight - 140);\n } \n else {\n elem.width(window.innerWidth - 395);\n elem.height(window.innerHeight - 140);\n }\n}", "function ScaleSlider() {\n var refSize = jssor_1_slider.$Elmt.parentNode.clientWidth;\n if (refSize) {\n refSize = Math.min(refSize, 1920);\n jssor_1_slider.$ScaleWidth(refSize);\n }else{\n window.setTimeout(ScaleSlider, 30);\n }\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 subResize(event) {\n var e_sub = subtitles.canvas;\n var e_vid = player.elements.wrapper;\n\n e_sub.style.display = \"block\";\n e_sub.style.top = 0;\n e_sub.style.position = \"absolute\";\n e_sub.style.pointerEvents = \"none\";\n\n e_sub.width = e_vid.clientWidth * 2;\n e_sub.height = e_vid.clientHeight * 2;\n e_sub.style.transform = \"scale(0.5, 0.5) translate(-50%, -50%)\";\n\n subtitles.resize(e_sub.width, e_sub.height);\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 }" ]
[ "0.730455", "0.68586385", "0.6810608", "0.67658746", "0.67411005", "0.67411005", "0.67367375", "0.6717239", "0.66893893", "0.6601592", "0.6598368", "0.65592873", "0.64905846", "0.6427998", "0.6384384", "0.6364894", "0.63329726", "0.6315134", "0.6311764", "0.6278579", "0.6277266", "0.6277266", "0.6268742", "0.6227176", "0.62221634", "0.6220806", "0.6206545", "0.6177857", "0.614973", "0.6144711", "0.61427253", "0.6139111", "0.61320794", "0.6122548", "0.6119096", "0.61144453", "0.6113748", "0.61066943", "0.60816664", "0.6081408", "0.60699916", "0.60657513", "0.6057328", "0.60558164", "0.6049407", "0.60433537", "0.6040386", "0.6037282", "0.60359573", "0.6031223", "0.6029105", "0.60255384", "0.60106015", "0.6005651", "0.60014635", "0.5999245", "0.59967893", "0.5986717", "0.5978348", "0.597459", "0.5970435", "0.5969245", "0.59673035", "0.5966002", "0.59606504", "0.5959961", "0.59578294", "0.595772", "0.59529984", "0.5951632", "0.59493935", "0.5938147", "0.5931026", "0.59248775", "0.59228086", "0.5908465", "0.5905467", "0.59053534", "0.5900435", "0.58982843", "0.5897386", "0.58960354", "0.5894326", "0.589271", "0.58907574", "0.5883891", "0.5878792", "0.5878155", "0.5862771", "0.58621216", "0.585585", "0.5852937", "0.5849419", "0.58489996", "0.5842233", "0.5839939", "0.58351386", "0.5830559", "0.5829513", "0.58290225" ]
0.77290565
0
this toggles the visibility of our parent permission fields depending on the current selected value of the underAge field
function toggleFields() { if ($("#firstName").val() < 100) $("#formField2").show(); if ($("#middleName").val() > 0) $("#formField3").show(); else return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggleAge (check) {\n let c = check\n if (c === true) {\n $('.aging').show()\n } else if (c === false) {\n $('.aging').hide()\n } else {\n c = !$('.aging').is(':visible')\n c ? $('.aging').show() : $('.aging').hide()\n }\n remote.Menu.getApplicationMenu().getMenuItemById('menu-task-age').checked = c\n}", "showEdit() {\n this.closeFoldersInputs.closeAllInputs();\n // set Manage checkbox\n if (this.folderUser.get('access') === 2) {\n this.set('access', true);\n } else {\n this.set('access', false);\n }\n\n this.folderUser.set('isEdit', true);\n }", "changeAgeDisplay(e) {\n\n StateManager.UpdateValue(\n \"Account.Settings.DisplayAgeAsAdjusted\",\n !StateManager.State().Account.Settings.DisplayAgeAsAdjusted\n );\n\n }", "function ageValidation(){\t\n\tvar value = $(\"#patientAge\").val();\t\n\tif(parseInt(value) < 18){\n\t\t$(\"#vaccinationCondition\").css(\"display\",\"block\");\n\t}else{\n\t\t$(\"#vaccinationCondition\").css(\"display\",\"none\");\n\t}\n }", "applyPermission() {\n if (this.permission[2] == 0) {\n this.showEditColumn(false);\n }\n if (this.permission[3] == 0) {\n this.showDeleteColumn(false);\n }\n }", "function vis18() {\r\n if (document.getElementById(\"children\").value.toLowerCase()=='yes') {\r\n document.getElementById(\"children18div\").style.display=\"\";\r\n }\r\n else {\r\n document.getElementById(\"children18div\").style.display=\"none\";\r\n }\r\n}", "function checkAge(age) {\n if (age >= 18) {\n return true;\n } else {\n return confirm('Do you have permission from your parents?');\n }\n }", "function ChoiceLevel(nivel){\n\n Nivel = nivel;\n $(\"button.play\").show();\n $(\"button.nivel-1\").hide();\n $(\"button.nivel-2\").hide();\n $(\"button.back\").show(); \n\n \n }", "function checkAge(age) {\n return (age > 18) ? true : confirm('Do you have your parents permission to access this page?');\n}", "function checkUserAge(){\n var userAge = document.getElementById(\"userAge\").value;\n var flag = false;\n if(flag){\n document.getElementById(\"userBioError\").style.display = \"block\";\n }else{\n document.getElementById(\"userBioError\").style.display = \"none\";\n }\n}", "function toggleSubfields(e) {\n e.stopPropagation();\n $ul = getUl(this, 1);\n $ul.toggleClass('visible');\n}", "function changeOwnerLoad() {\n//\t$('form_change_ownership___ownership_id').getParent().getParent().hide();\n\t$('form_change_ownership___seller_account_id').getParent().getParent().hide();\n\t$('form_change_ownership___new_account_id').getParent().getParent().hide();\n\t$('form_change_ownership___transfer_date').getParent().getParent().hide();\n\tchangeOwnerProspectShow(false);\n\tchangeOwnerProspect2Show(false);\n\tchangeOwnerAddressShow(false);\n\t$('form_change_ownership___primary_flag').getParent().getParent().hide();\n\t$('form_change_ownership___new_primary_local_address_id').getParent().getParent().hide();\n}", "setSubformVisibility(options) {\n console.assert(_.isObject(options),\n 'An options object must be provided.');\n\n const group = options.group;\n const subformID = options.subformID;\n const visible = options.visible;\n\n console.assert(group, 'Missing option \"group\"');\n\n const subformIDs = this._subformsByGroup[group];\n console.assert(subformIDs, `Invalid subform group ${group}`);\n\n if (options.hideOthers || !subformID) {\n _.each(subformIDs, ($subform, id) => {\n const isHidden = (subformID === undefined\n ? !visible\n : (id !== subformID));\n\n $subform.prop({\n disabled: isHidden,\n hidden: isHidden,\n });\n });\n } else {\n console.assert(visible !== undefined, 'Missing option \"visible\"');\n\n const $subform = subformIDs[subformID];\n console.assert($subform, `Invalid subform ID ${subformID}`);\n\n $subform.prop({\n disabled: !visible,\n hidden: !visible,\n });\n }\n }", "function checkAge(age) {\n if (age > 18) {\n return true;\n } else {\n return confirm('Do you have your parents permission to access this page?');\n }\n}", "function checkHidden() {\n\t\tvar ptAge,ptWt;\n\t\t\n\t\tptAge = document.getElementById(\"patientAge\").value;\n\t\tptWt = document.getElementById(\"patientWeight\").value;\n\t\tconsole.log(\"im here\");\n\t\tif (ptAge>0 && ptWt>0){\n\t\t\tdocument.getElementById('searchBar').hidden = false;\n\t\t\tdocument.getElementById('mainArea').hidden = false;\n\t\t\tdocument.getElementById('pdfBox').hidden = false;\n\t\t\tcalculateValues(ptAge,ptWt);\n\t\t}else{\n\t\t\tdocument.getElementById('searchBar').hidden = true;\n\t\t\tdocument.getElementById('mainArea').hidden = true;\n\t\t\tdocument.getElementById('pdfBox').hidden = true;\n\t\t}\n\t\t\n\n\t}", "function hideMembersSettings() {\n $(this).parent().slideUp(600);\n }", "function showGuardianInput(){\n if(document.getElementById('add_guardian').checked){\n document.getElementById('guardian_details').style.display = 'block';\n } else {\n document.getElementById('guardian_details').style.display = 'none';\n }\n }", "function birthday_visbility_bind(){\n\t$(\"#person_birthday_visibility\").bind('change', function(event) {\n\t\tswitch($(this).val()){\n\t\t\tcase \"Show only month & day in my profile.\":\n\t\t\t\t$('#person_dob_1i').hide();\n\t\t \tbreak;\n\t\t\tcase \"Don't show my birthday in my profile.\":\n\t\t\t\t$('#person_dob_1i').hide();\n\t\t\t\t$('#person_dob_2i').hide();\n\t\t\t\t$('#person_dob_3i').hide();\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$('#person_dob_1i').show();\n\t\t\t\t$('#person_dob_2i').show();\n\t\t\t\t$('#person_dob_3i').show();\n\t\t\t}\n\t});\n}", "function test_form(t) {\n if (t === 'child') {\n window.age_range = 2\n show_form(\"#child_form\");\n } else if (t === 'teen') {\n window.age_range = 3\n show_form(\"#teen_form\");\n } else if (t === 'adult') {\n window.age_range = 4\n show_form(\"#adult_form\");\n }\n}", "function checkParentGroups() {\n showOnlyParentGroups = !showOnlyParentGroups;\n\n checkGroupsSidebar();\n getAllGroups();\n}", "function handleClick() {\n if (isAuthenticated) {\n document.getElementById(\"edit\").children[2].style.display = \"none\"; // Show only authorise buttons\n document.getElementById(\"edit\").children[1].style.display = \"none\";\n document.getElementById(\"edit\").children[6].style.display = \"block\";\n document.getElementById(\"edit\").children[5].style.display = \"block\";\n document.getElementById(\"edit\").children[4].style.display = \"block\";\n document.getElementById(\"edit\").children[3].style.display = \"block\";\n }\n if (!isAuthenticated) {\n document.getElementById(\"edit\").children[2].style.display = \"block\";\n document.getElementById(\"edit\").children[6].style.display = \"none\";\n }\n }", "ViewAllAccountFields() {\r\n this.showFields = !this.showFields;\r\n }", "function toggleField(val) {\n var o = document.getElementById('otherPrimary');\n (val == 'Other') ? o.style.display = 'block' : o.style.display = 'none';\n\n var currentState = $(\"#CurrentState\").val();\n\n if ((currentState == 'FL' || !IsUnderwritingNonCompliantState(currentState)) && IsSpecialRelationship(val))\n $(\"#PrimaryBeneRelationshipDetails\").show();\n else {\n $(\"#PrimaryBeneRelationshipDetails\").hide();\n $(\"#PrimaryBeneRelationshipDetailsImmediateFamily\").hide();\n clearDivInputs('PrimaryBeneRelationshipDetails');\n clearDivInputs('PrimaryBeneRelationshipDetailsImmediateFamily');\n }\n \n }", "function toggleDisplay2() {\n $('.srchGrpAttr2')\n .not('#' + srchSlctCat2)\n .hide(); //selects and hides all subcategories (i.e. Category = Gender and subcategory = Gender > Male or Female; identifies it by class 'i.e. btype, gender, etc.')\n $('#' + srchSlctCat2).show(); // only shows the Subcategory dropdown menu\n //Hiding NTA Maps & Ratio Groups when a new category is selected\n }", "function showJobRoleField(){\n if ($(\"#title\").val() === \"other\") {jobRoleField.show()}\n else jobRoleField.hide();\n}", "function toggleFields() {\n selection = $(\".roleUser option:selected\").text();\n switch (selection){\n case 'driver':\n $(\".dependOnRegion\").show();\n break;\n default:\n $(\".dependOnRegion\").hide();\n }\n}", "function toggle_household_income() {\n var selected = _form_marital_status.find(':selected').val();\n\n // 0 = not married \n if (selected == 0) { \n _form_household_income\n .closest('.onboard-field-wrapper')\n .addClass('disabled');\n _form_individual_income\n .closest('.onboard-field-wrapper')\n .removeClass('disabled');\n } \n\n // 1 = married\n else { \n _form_individual_income\n .closest('.onboard-field-wrapper')\n .addClass('disabled');\n _form_household_income\n .closest('.onboard-field-wrapper')\n .removeClass('disabled');\n }\n }", "function ShowAge()\n{\n\tlet birthDate = $(\"#name-born-info > time\");\n\tlet deathDate = $(\"#name-death-info > time\");\n\tlet born = new Date();\n\tlet age;\n\n\t//If true change it\n\tif (birthDate && birthDate.attr('datetime'))\n\t{\n\t\tdate = birthDate.attr('datetime').split('-');\n\t\tborn.setFullYear(date[0]);\n\t\tborn.setMonth(date[1] - 1);\n\t\tborn.setDate(date[2]);\n\n\t\tage = new Date() - born.getTime();\n\t\tage = age / (1000 * 60 * 60 * 24 * 365.242199);\n\n\t\tlet years = Math.floor(age);\n\t\tlet months = Math.floor((age - years) * 12);\n\t\tif (deathDate.length === 0)\n\t\t{\n\t\t\tlet container = \" <span>(Age: \" + years + \" year\" + (years === 1 ? '' : 's') + \", \" + months + \" month\" + (months === 1 ? '' : 's') + \")</span>\";\n\n\t\t\t$(container).insertAfter(birthDate);\n\t\t}\n\t}\n\n}", "function checkAge(age) {\n if (age > 18) {\n return true;\n } else {\n return confirm('Do you have your parents permission to access this page?');\n }\n}", "function checkAge(age) {\n if (age > 18) {\n return true;\n }\n // ...\n return confirm('Did parents allow you?');\n }", "isAdult(){\n return this.age >= 18;\n }", "function toggleDisplay() {\n $('.grpCat')\n .not('#' + slctCat)\n .hide(); //selects and hides all subcategories (i.e. Category = Gender and subcategory = Gender > Male or Female; identifies it by class 'i.e. btype, gender, etc.')\n $('#' + slctCat).show(); // only shows the Subcategory dropdown menu\n //Hiding NTA Maps & Ratio Groups when a new category is selected\n $('.grpMap, .grpMet').show();\n $('.grpNTAMap, .grpNTARatio').hide();\n\n //resets category dropdown\n \n //resets metric dropdowns\n $('.grpCat .selected').attr('value', '').text('Please Select');\n $('.grpMet .selected').attr('value', '').text('Please Select');\n $('.grpMap .selected').attr('value', '').text('Please Select');\n $('.grpNTAMap .selected').attr('value', '').text('Please Select');\n $('.grpNTARatio .selected').attr('value', '').text('Please Select');\n slctAttr = '';\n slctMet = '';\n slctMap = '';\n slctNTARatio = '';\n slctNTAMap = '';\n }", "function onlyBabies(selected_age) {\n return selected_age.age < 3\n}", "visibilityChanged()\n {\n super.visibilityChanged();\n\n if(!this.visibleRecursively)\n this.dropdownOpener.visible = false;\n }", "onChildEdit() {\n if (this._childEdit) {\n this._childEdit.raise();\n }\n }", "onChildEdit() {\n if (this._childEdit) {\n this._childEdit.raise();\n }\n }", "function showSelect() {\n let sexValue = document.getElementById(\"selectSex\").value;\n \n if (sexValue === \"female\") {\n document.getElementById(\"selectPregnantLactating\").style.display = \"inline-block\";\n document.getElementById(\"pregnantLactating\").style.display = \"inline-block\";\n }\n\n else {\n document.getElementById(\"selectPregnantLactating\").style.display = \"none\";\n document.getElementById(\"pregnantLactating\").style.display = \"none\";\n document.getElementById(\"selectPregnantLactating\").value = \"\";\n }\n }", "_toggleElevationField() {\n // Select the closest parent with the form row (DOM traversal) and toggle the hidden class\n inputElevation.closest(\".form__row\").classList.toggle(\"form__row--hidden\");\n inputCadence.closest(\".form__row\").classList.toggle(\"form__row--hidden\");\n }", "function view_my_profile_parent()\n{\n\tif(window.localStorage['loggedin'] == '1')\n\t{\n\t\tvar userdetails=[];\n\t\tuserdetails=JSON.parse(window.localStorage['userdata']);\n\t\tvar lname,kids,type,phone,skype,premium;\n\t\tif(userdetails.lastname != null)\n\t\t{\n\t\t\tlname=userdetails.lastname;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tlname=\"\";\n\t\t}\n\t\tif(userdetails.type_sitter != null)\n\t\t{\n\t\t\ttype=userdetails.type_sitter+\" - \";\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttype=\"\";\n\t\t}\n\t\tif(userdetails.kids != 0)\n\t\t{\n\t\t\tvar kids_age_arr=[];\n\t\t\tfor(i=0;i<userdetails.kids.length;i++)\n\t\t\t{\n\t\t\t\t kids_age_arr+=userdetails.kids[i]+\",\";\n\t\t\t};\n\t\t\tvar kids_age= kids_age_arr.slice(0,-1); \n\t\t\tkids=userdetails.kids.length+' enfants - Agé '+kids_age+' ans';\n\t\t}\n\t\telse\n\t\t{\n\t\t\tkids=userdetails.kids+' enfants ';\n\t\t}\n\t\tif(userdetails.phone != null)\n\t\t{\n\t\t\tphone=userdetails.phone;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tphone=\"\";\n\t\t}\n\t\t\n\t\tif(userdetails.skype != null)\n\t\t{\n\t\t\tskype='Skype :'+userdetails.skype;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tskype=\"\";\n\t\t}\n\t\tif(userdetails.premium != null)\n\t\t{\n\t\t\tvar diffDays=get_date_diff(userdetails.premium.endDate.date,userdetails.server);\n\t\t\tif(diffDays<=0)\n\t\t\t{\n\t\t\t\tpremium=\"Premium\";\n\t\t\t\t$('#fiche-parents').find('.abonnement').find('.premium').css('display','none');\n\t\t\t $('#fiche-parents').find('.abonnement > div').first().css('display','block');\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tpremium=\"Gratuit \";\n\t\t\t\t$('#fiche-parents').find('.abonnement > .premium').css('display','block');\n\t\t\t $('#fiche-parents').find('.abonnement > div').last().css('display','block');\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tpremium=\"Gratuit \";\n\t\t\t$('#fiche-parents').find('.abonnement > .premium').css('display','block');\n\t\t\t$('#fiche-parents').find('.abonnement > div').last().css('display','block');\n\t\t}\n\t\tvar htmls='<a href=\"#par-ppedit-image\" data-rel=\"popup\" data-transition=\"pop\" class=\"signalement edit-image\">'+\n\t\t'<img src=\"'+userdetails.src+'\" height=\"80\" alt=\"\"></a><h1>'+userdetails.firstname+' '+lname+'<strong> '+type+''+userdetails.locality+'</strong></h1><p>'+kids+'<br/>'+phone+'<br/>'+window.localStorage['username']+'<br/>'+skype+'</p>';\n\t\t$('#fiche-parents .user').html('');\n\t\t$('#fiche-parents .user').html(htmls);\n\t\t$('#fiche-edit-planning').find('input:checkbox[name=\"e_planning[]\"]:checked').each(function() \n\t\t{\n\t\t\t$(this).attr('checked',false);\n\t\t});\n\t\t$('#fiche-edit-planning').find('td').removeClass('check');\n\t\tvar plan=[];\n\t\tplan=JSON.parse(window.localStorage['planning']);\n\t\t//alert(plan);\n\t\tfor(i=0;i<plan.length;i++)\n\t\t{\n\t\t\t$('#fiche-edit-planning').find('#e_planning_'+plan[i]).attr('checked',true);\n\t\t\t$('#fiche-edit-planning').find('#e_planning_'+plan[i]).parent('td').addClass('check');\n\t\t\t$('#fiche-edit-planning').find('#e_planning_'+plan[i]).parent('div').parent('td').addClass('check');\n\t\t}\n\t\t\n\t\t$('#fiche-parents').find('.subscription_status').html(premium);\n\t\t$.mobile.changePage('#fiche-parents',{transition:'flip'});\t\n\t}\n\telse\n\t{\n\t\talert('please login to view your profile.');\n\t}\n\t\n}", "function age_minus() {\n var minus = document.getElementById(\"age_minus\");\n var plus = document.getElementById(\"age_plus\");\n var age_tracker = document.getElementById(\"age_result\");\n age = age_tracker.innerHTML;\n age--;\n age_tracker.innerHTML = age;\n \n minus.disabled = true;\n if(age >= age_min\n plus.disabled = false;\n}", "function updateBioVisibility(evt) {\n evt = evt || window.event;\n //get the layer index from the element id\n var lName = evt.target.id.split(\"_\");\n //If radio button is checked show Map layer\n if (dom.byId(evt.target.id).checked) {\n dynamicMapSerives[lName[1]].show();\n } else {\n dynamicMapSerives[lName[1]].hide();\n }\n }", "function updateEditPage () {\n\n var nameMap = table.makePermissionMap(true);\n\n // todo: refactor these doubled 4 lines of code.\n // todo: refactor this doubled line of comments.\n var viewSummaryDiv = $(\"#permissions-view-summary\");\n var viewNames = [].concat(nameMap.group.view).concat(nameMap.user.view);\n if (viewNames.length) viewSummaryDiv.find(\".summary-content\").text(viewNames.join(\", \"));\n AJS.setVisible(viewSummaryDiv, viewNames.length);\n\n var editSummaryDiv = $(\"#permissions-edit-summary\");\n var editNames = [].concat(nameMap.group.edit).concat(nameMap.user.edit);\n if (editNames.length) editSummaryDiv.find(\".summary-content\").text(editNames.join(\", \"));\n AJS.setVisible(editSummaryDiv, editNames.length);\n\n /**\n * Updates the hidden fields that submit the edited permissions in the form. The fields are updated with the\n * data in the Permissions table.\n */\n permissionManager.permissionsEdited = false;\n var permissionStrs = permissionManager.makePermissionStrings();\n for (var key in permissionStrs) {\n var updatedPermStr = permissionStrs[key];\n $(\"#\" + key).val(updatedPermStr);\n\n if (permissionManager.originalPermissions[key] != updatedPermStr) {\n permissionManager.permissionsEdited = true;\n }\n }\n }", "function updateEditPage () {\n\n var nameMap = table.makePermissionMap(true);\n\n // todo: refactor these doubled 4 lines of code.\n // todo: refactor this doubled line of comments.\n var viewSummaryDiv = $(\"#permissions-view-summary\");\n var viewNames = [].concat(nameMap.group.view).concat(nameMap.user.view);\n if (viewNames.length) viewSummaryDiv.find(\".summary-content\").text(viewNames.join(\", \"));\n AJS.setVisible(viewSummaryDiv, viewNames.length);\n\n var editSummaryDiv = $(\"#permissions-edit-summary\");\n var editNames = [].concat(nameMap.group.edit).concat(nameMap.user.edit);\n if (editNames.length) editSummaryDiv.find(\".summary-content\").text(editNames.join(\", \"));\n AJS.setVisible(editSummaryDiv, editNames.length);\n\n /**\n * Updates the hidden fields that submit the edited permissions in the form. The fields are updated with the\n * data in the Permissions table.\n */\n permissionManager.permissionsEdited = false;\n var permissionStrs = permissionManager.makePermissionStrings();\n for (var key in permissionStrs) {\n var updatedPermStr = permissionStrs[key];\n $(\"#\" + key).val(updatedPermStr);\n\n if (permissionManager.originalPermissions[key] != updatedPermStr) {\n permissionManager.permissionsEdited = true;\n }\n }\n }", "function isDeathOnChange() {\r\n var isDeath = byId('isDead').checked;\r\n setFieldValue('deathDate', '');\r\n if( isDeath ) {\r\n showById('deathDateTR');\r\n }\r\n else {\r\n hideById('deathDateTR');\r\n }\r\n}", "function checkAge(age) {\n if (age >= 18) {\n alert(\"you can go to the club\");\n } else if (age < 18) {\n confirm(\"do you have parental permission?\");\n alert(\"you have gotten parental permission!!\");\n } else {\n alert(\"get out of here swine\");\n }\n\n }", "function checkPermissions(elem) {\n var boxCheck = $(elem).parents();\n if($(elem).is(\":checked\")){\n boxCheck.children('div.box-body').children('p').children('input').attr('checked', 'checked');\n } else {\n boxCheck.children('div.box-body').children('p').children('input').removeAttr('checked');\n }\n}", "function showLevelChildren() {\r\n if (activeGroup) {\r\n for (var i = 3; i < activeGroup.children.length; i++) {\r\n activeGroup.children[i].visible = true;\r\n }\r\n }\r\n}", "function checkAge(age) {\n return (age > 18) || confirm('Did parents allow you?');\n}", "isVisible() {\n const isOwner = this._radio.reqres.request('user:isOwner');\n\n if (isOwner) {\n return true;\n }\n\n return this.get('visible');\n }", "function makeFieldsVisible() {\n const list = planList;\n for (const item of list) {\n item.visibility = \"visible\";\n }\n setPlanList([...list]);\n }", "function showHideAllergy(allergy)\n{\n if(allergy.value=='Yes')\n document.getElementById('allergy').style.display='block';\n else\n document.getElementById('allergy').style.display='none';\n}", "function toggleAdditionalInfo() {\n\t\t\t// ng-show is used to toggle between true and false, hiding and showing the additional\n\t\t\t// input fields\n\t\t\t!$scope.additionalInfo ? $scope.additionalInfo = true : $scope.additionalInfo = false;\n\t\t}", "function inputStatusCheck() {\n if (inputPerson.max === 0 || inputPerson.value == 0) {\n inputVegan.disabled = true;\n inputVegan.value = null;\n inputVegetarian.disabled = true;\n inputVegetarian.value = null;\n } else {\n inputVegan.disabled = false;\n inputVegetarian.disabled = false;\n inputVegan.max = inputPerson.max;\n inputVegetarian.max = inputPerson.max;\n }\n inputPerson.max = inputPerson.value;\n}", "canHide() {\n return this.parent ? true : false;\n }", "function conditionFields() {\n var viewing = $(\"#change_fields\").val();\n if(viewing == \"green\" && $(\"#green-1\").val()) {\n $(\".requires-green-1\").show();\n } else {\n $(\".requires-green-1\").hide();\n }\n \n if(viewing == \"blue\") {\n if($(\"input[name=blue-1]:checked\").val() == \"two\") {\n $(\".requires-blue-1-two\").show();\n } else {\n $(\".requires-blue-1-two\").hide();\n }\n if($(\"input[name=blue-1]:checked\").val() == \"three\") {\n $(\".requires-blue-1-three\").show();\n } else {\n $(\".requires-blue-1-three\").hide();\n }\n }\n}", "function checkvalue(val)\n{\n if(val===\"other\")\n document.getElementById('otherdept').style.display='block';\n else\n document.getElementById('otherdept').style.display='none'; \n}", "function subCate_userProfile(){\n var folderShow = document.getElementById('user-profile-account-details');\n if(folderShow.style.display == \"none\"){\n folderShow.style.display = \"block\";\n } else{\n folderShow.style.display = \"none\";\n }\n}", "isAdult () { return this.age >= 18; }", "function hideAllModeOfVisitRelated(){\n\tif($(\"#ref-no-div\").css(\"display\") == \"block\"){\n\t\t$(\"#ref-no-div\").css(\"display\", \"none\");\n\t\t$(\"#ref-no\").val(\"0\")\n\t}\n\t\n\tif($(\"#screener-div\").css(\"display\") == \"block\"){\n\t\t$(\"#screener-div\").css(\"display\", \"none\");\n\t\t$(\"#screener\").val(\"\");\n\t}\n\t\n\tif($(\"#in-care-of-div\").css(\"display\") == \"block\"){\n\t\t$(\"#in-care-of-div\").css(\"display\", \"none\");\n\t\t$(\"#in-care-of\").val(\"\");\n\t}\n}", "function refreshVisibleFields() {\n const VISIBLE_FIELDS = {\n \"COLONIZE\": [\"empire_id\", \"planet_index\"],\n \"ADJUST_FOCUS\": [/*\"empire_id\", \"colony_id\", \"focus\"*/],\n \"CREATE_FLEET\": [\"empire_id\", \"design_type\", \"count\", \"full_fuel\"],\n \"ADD_BUILD_REQUEST\": [\"empire_id\", \"colony_id\", \"design_type\", \"count\"],\n \"CREATE_BUILDING\": [\"empire_id\", \"colony_id\", \"design_type\"],\n \"SPLIT_FLEET\": [\"empire_id\", \"fleet_id\", \"count\"],\n \"MERGE_FLEET\": [\"empire_id\", \"fleet_id\", \"additional_fleet_ids\"],\n \"MOVE_FLEET\": [/*\"empire_id\", \"fleet_id\", \"star_id\"*/],\n \"DELETE_BUILD_REQUEST\": [\"empire_id\", \"build_request_id\"]\n };\n\n const type = $(\"#modify-popup select[name=type]\").val()\n const $parent = $(\"#modify-popup dl\");\n\n // The <dl> will be a bunch of <dt><dd> pairs. The <dd> will have a child that has a name\n // attribute which is the name of the field we'll want to show/hide. If we want to hide the\n // field, we need to hide both the <dt> and <dd>\n $(\"dd\", $parent).each(function (index, dd) {\n let $dd = $(dd);\n let $dt = $dd.prev();\n\n $dd.find(\"[name]\").each(function (_, input) {\n const name = $(input).attr(\"name\");\n if (name === \"type\") {\n return;\n }\n\n if (VISIBLE_FIELDS[type].indexOf(name) >= 0) {\n $dd.show();\n $dt.show();\n } else {\n $dd.hide();\n $dt.hide();\n }\n });\n });\n }", "function Visited_Tab_toggle(thisTb)\n{\n if(thisTb.firstChild.value == \"YetToVisit\")\n {\n \t$('.YetToVisitedNode').each(function() {\n \t$(this).css(\"display\",\"block\");\n \t});\n \t$('.visitedNode').each(function() {\n \t$(this).css(\"display\",\"none\");\n \t});\n }\n else\n {\n \t$('.YetToVisitedNode').each(function() {\n \t$(this).css(\"display\",\"none\");\n \t});\n \t$('.visitedNode').each(function() {\n \t$(this).css(\"display\",\"block\");\n \t});\n \t\n \t$('input:checkbox.Check_node').each(function () {\n this.checked = true;\n \t});\n }\n}", "function showAdvanced(showit) {\n var vis = showit ? \"inline-block\" : \"none\";\n d3.select(parentElement + \" ~ #celestial-form\").selectAll(\".advanced\").style(\"display\", vis);\n d3.select(parentElement + \" ~ #celestial-form\").selectAll(\"#label-propername\").style(\"display\", showit ? \"none\" : \"inline-block\");\n}", "function editPermitsAndInspections() {\n document.getElementById('projectManager').style.display = 'none';\n EDIT_INTENTION = true;\n getProjectEnums_PERMIT(true);\n\n currentDivLocation = 'permitData';\n document.getElementById('permitData').style.display = 'inline';\n $('#permitData').find('#buildingPermit').addClass('active');\n $('#permitData').find('#buildingPermits').addClass('active');\n\n //window.location.href = PROJECT_PERMITS_AND_INSPECTIONS + '?id=' + projectID;\n}", "applyDisplayModeToFields(member) {\n if (this.isMemberPresent()) {\n this.$el.find('[data-display-mode=\"new_members_only\"]').hide(0);\n } else {\n this.$el.find('[data-display-mode=\"recognized_members_only\"]').hide(0);\n }\n }", "showEdit() {\n this.closeFoldersInputs.closeAllInputs();\n this.folder.set('isEdit', true);\n this.set('errors', null);\n }", "function toggleFieldsDisplay(display){\n timeCount.hidden = display;\n relToCount.hidden = display;\n sameOptions.hidden = !display;\n}", "function showAccountsPicker(isToAccountPicker) {\n if (isToAccountPicker) {\n $(\".select-account-table\")[0].style.visibility = \"hidden\"; \n if ($(\".select-account-table\")[1] != null) {\n $(\".select-account-table\")[1].style.visibility = \"visible\"; \n }\n } else {\n $(\".select-account-table\")[0].style.visibility = \"visible\";\n if ($(\".select-account-table\")[1] != null) {\n $(\".select-account-table\")[1].style.visibility = \"hidden\"; \n }\n }\n}", "function incomeVisibility() {\n 'use strict';\n\n // Earned Income\n FBRun.vis.applyRule($('#p3'), employedInHousehold());\n\n // Pensions Income:\n FBRun.vis.applyRule($('#p5'), pensionerInHousehold());\n\n // Non-dep Income:\n FBRun.vis.applyRule($('#p7'), nonDepInHousehold());\n return false;\n}", "toggleVisiblity() {\n if (hidden) {\n this.show();\n } else {\n this.hide();\n }\n return this;\n }", "function updateUIStat(person, stat){\n var personObj;\n if(person === \"child\"){\n personObj = child;\n } else {\n personObj = parent;\n }\n\n var statStr = '.'+person+'.'+stat;\n\n if(personObj[stat] === false){\n $(statStr).hide();\n $(statStr+'-label').hide();\n } else if($(statStr).is(':hidden')){ \n $(statStr).show('slow', function(){});\n $(statStr+'-label').show('slow', function(){});\n }\n}", "function loanDetailsPanel_Set(loan, userCanChangeLoanStatus) {\n $(\"#FhaCaseNo_helm\").text(helm.formatText(loan.FhaCaseNo));\n $(\"#FhaAdpCode_helm\").text(helm.formatText(loan.FhaAdpCode));\n $(\"#FhaIntakeImage_helm\").toggleClass(\"displayNone\", loan.PartnerSubmission === false);\n $(\"#LoanSkey_helm\").text(Compass.Global.loanSkey);\n $(\"#LenderCaseNo_helm\").text(helm.formatText(loan.LoanNumber));\n $(\"#MailMessageCount_helm\").text(helm.formatText(loan.MessageCount));\n $(\"#NewMailMessage_helm\").toggleClass(\"displayNone\", loan.IsNewMessages === false);\n $(\"#Officer_helm\").text(helm.formatText(loan.OfficerLastName + \" / \"));\n $(\"#Channel_helm\").text(helm.formatText(loan.Channel));\n $(\"#GroupName_helm\").text(helm.formatText(loan.Group.GroupName));\n $(\"#LoanStatuses_helm\").val(loan.LoanStatusSkey).prop(\"disabled\", userCanChangeLoanStatus === false || Compass.Global.isReadOnlyMode === false);\n $(\"#LoanSubStatuses_helm\").val(loan.LoanSubStatusSkey).prop(\"disabled\", userCanChangeLoanStatus === false || Compass.Global.isReadOnlyMode === false);\n \n\n if (loan.IsFraudAlert || loan.IsOnHold) {\n $(\"#FraudAlert_helm\").closest(\"tr.data_R0w\").toggleClass(\"redAlert\", true);\n }\n\n $(\"#FraudAlert_helm\").toggleClass(\"displayNone\", loan.IsFraudAlert === false);\n $(\"#OnHold_helm\").toggleClass(\"displayNone\", loan.IsOnHold === false);\n\n }", "function hideLevelChildren() {\r\n if (activeGroup) {\r\n for (var i = 3; i < activeGroup.children.length; i++) {\r\n activeGroup.children[i].visible = false;\r\n }\r\n }\r\n}", "function OnDenialOfAccess_Change( e )\r\n{\r\n try\r\n {\r\n var newDamageTypeValue = Alloy.Globals.replaceCharAt( current_non_structural_element * 6 + 4 , Alloy.Globals.AeDESModeSectionFive[\"DAMAGE_TYPES\"] , $.widgetAppCheckBoxAeDESModeFormsSectionFiveNonStructuralDamageDenialOfAccess.get_value() ) ;\r\n Alloy.Globals.AeDESModeSectionFive[\"DAMAGE_TYPES\"] = newDamageTypeValue ;\r\n }\r\n catch( exception )\r\n {\r\n Alloy.Globals.AlertUserAndLogAsync( L( 'generic_exception_msg' ) + exception.message ) ;\r\n }\r\n}", "function household_registration_unearned_income_step()\n{\n // alert('onload -earned income step ')\n\n if ($('#household_member_unearned_income_flag_n').is(':checked'))\n {\n $('#new_unearned_income_button').hide();\n }\n\n// Hidden field is shown on the view - if income record is present , so that new button is visible to add more income records.\n if ($('#household_member_unearned_income_flag').is('Y'))\n {\n $('#new_unearned_income_button').show();\n } \n\n\n}", "function handleAccessViewPlayer() {\n var userId = localStorage.getItem(\"user\");\n if(userId != null) {\n var query = firebase.database().ref('Users/' + userId);\n query.once(\"value\").then(function(snapshot) {\n var coach = snapshot.child(\"coach\").val();\n var manager = snapshot.child(\"manager\").val();\n\n if(coach == true || manager == true){\n var editButton = document.getElementById('edit-player-button');\n editButton.style.display = 'block';\n document.getElementById('view-player-record-id').className = \"nav-item\";\n document.getElementById('nav-edit-player').className = \"desktop-hidden\";\n }\n });\n }\n}", "function isChild() {\n if (age < 18) {\n return true;\n }\n return false;\n }", "toggleChecklistVisibility() {\n this.state.checklist.isVisible = !this.state.checklist.isVisible;\n this.save();\n }", "function showAdvancedEditingStatus(){\n var aeCheckBox = $('advancedEditing');\n var bShowCode = tabsFrame.showCode;\n if (bShowCode != undefined) {\n \n if (bShowCode == true) {\n aeCheckBox.checked = true;\n }\n else {\n aeCheckBox.checked = false;\n }\n setAdvancedEditing();\n }\n}", "toggler() {\n const visibility = this.state.visibility;\n const expanded = this.state.expanded;\n if (visibility === \"hidden\" && !expanded) {\n this.setState({\n visibility: \"visible\",\n expanded: true\n })\n } else {\n this.setState({\n visibility: \"hidden\",\n expanded: false\n })\n }\n\n }", "filterByAge(e) {\t\t\n\t\tdocument.getElementById(\"selected-age\").innerHTML = e.target.innerHTML;\n\t\tthis._setActiveClass(e);\n\t\t\n\t\tlet selected = e.target.getAttribute(\"data-value\");\n\t\tlet catchment = e.target.getAttribute(\"data-catchment\");\n\t\t\n\t\tthis._showCatchment(catchment);\n\n\t\tif(!selected) {\n\t\t\tthis.loadAllCatchments();\n\t\t\treturn this.clearFilter(\"ageFilter\").apply();\n\t\t}\n\n\t\treturn this.addFilter(\"ageFilter\", selected).apply();\t\n\t}", "updateAgeField(event) {\n let checkbox = event.target;\n /* if a box is checked, add an adult ticket */\n if (checkbox.checked == true) {\n bookingTempStore.childAdultRetiree[1]++;\n } else { /* if the box is unchecked, subtract a ticket from adult, child, or retiree as applicable */\n if (bookingTempStore.childAdultRetiree[1] > 0) {\n bookingTempStore.childAdultRetiree[1]--;\n } else if (bookingTempStore.childAdultRetiree[0] > 0) {\n bookingTempStore.childAdultRetiree[0]--;\n } else {\n bookingTempStore.childAdultRetiree[2]--;\n }\n }\n bookingTempStore.save();\n /* re-render the ticket-type button totals */\n $('.age-btn-row').html(this.ageButtons());\n $('.button-row').html(BookingUtilityFunctions.bookingPriceButton());\n }", "function v01() {\n let birthYear = Number(document.getElementById(\"year\").value);\n let present_yr = new Date().getFullYear();\n\n let age = present_yr - birthYear;\n if (age >= 18){\n document.getElementById(\"allow\").innerHTML = \"Welcome!\";\n } else {\n document.getElementById(\"allow\").innerHTML = \"too young\";\n }\n\n}", "function EditRisk() {\n\tdocument.getElementById(\"EditRisk\").style.display = \"block\";\n}", "toggleFaqVisibility() {\n this.state.faq.isVisible = !this.state.faq.isVisible;\n this.save();\n }", "function Advise_Person(data){\n sections[\"screenThinking\"].style.visibility = \"collapse\";\n\n //document.getElementById('showFlag').innerText = data.redFlag; //tracking bug section\n\n if(data.redFlag > 1 ){\n sections[\"screenRed\"].style.visibility = \"visible\";\n } else {\n sections[\"screenGreen\"].style.visibility = \"visible\";\n }\n}", "handleProfileExpand() {\n var expanded = this.state.profileExpanded;\n if (expanded == true) {\n this.setState({ profileExpanded: false });\n } else {\n this.setState({ profileExpanded: true });\n }\n }", "function _set_private_values_in_form() {\n /* jshint validthis: true */\n var clicked_el = this;\n\n var form = DOM.getAncestorByTagName(clicked_el, \"form\");\n var form_data = CPANEL.dom.get_data_from_form(form);\n\n for (var key in PRIVATE_PRIVACY_OPTIONS) {\n if (form[key].type === \"checkbox\") {\n form[key].checked = PRIVATE_PRIVACY_OPTIONS[key];\n } else {\n var acceptable = PRIVATE_PRIVACY_OPTIONS[key];\n if (!YAHOO.lang.isArray(acceptable)) {\n acceptable = [acceptable];\n }\n\n if (acceptable.indexOf(form_data[key]) === -1) {\n CPANEL.dom.set_form_el_value(form[key], acceptable[0]);\n }\n }\n }\n\n _update_access_type_text_in_form(\"private\");\n }", "function openeditpermission(id) {\n\t\t$('#editpermission'+id).click(function(e){\n\t\t\te.preventDefault();\n\t\t\t$('#permissionname'+id).hide();\n\t\t\t$('#permissionnameinput'+id).show();\n\t\t\t$('#permissiondescription'+id).hide();\n\t\t\t$('#permissiondescriptioninput'+id).show();\n\t\t\t$('#editpermission'+id).hide();\n\t\t\t$('#editpermissionbuttons'+id).show();\n\t\t\t$('#deletepermission'+id).hide();\n\t\t});\n\t}", "function changeAdultsInAtrrForm(change) {\n if (attrFormAdults + change >= minAdults && attrFormAdults + change <= maxAdults)\n attrFormAdults += change;\n setAttrFormAdults();\n}", "static set visible(value) {}", "function AgeFunction() {\r\n Age = document.getElementById(\"Age\").value;\r\n if (Age >= 26) {\r\n Health = \"You are eligible for our health insurance!\";\r\n }\r\n else {\r\n Health = \"You are not eligible for our health insurance.\";\r\n }\r\n document.getElementById(\"YourAge\").innerHTML = Health;\r\n}", "function ShowHideFields(current, type, hideFieldClass) {\n\n if (type == 'radio') {\n CountNumberOfUnknowns(current);\n if ($(current).parent().text().trim() == 'Yes') {\n showFields(hideFieldClass);\n if (hideFieldClass == 'educationProgramsClass') {\n $(\"input[name=RadioMemPursuingAdditionalEducation]\").prop('checked', false);\n $('.educationProgramsNoClass').hide();\n }\n }\n else if (hideFieldClass == 'fallenInLastMonthClass') {\n uncheckedFields(hideFieldClass);\n hideFields(hideFieldClass);\n }\n else if (hideFieldClass == 'diarrheaVomitingClass') {\n uncheckedFields(hideFieldClass);\n hideFields(hideFieldClass);\n }\n else if ((hideFieldClass == 'constipationConcernsClass' || hideFieldClass == 'oralCareNeedsClass' || hideFieldClass == 'swallowingNeedsClass' || hideFieldClass == 'gerdClass' || hideFieldClass == 'supervisionNeedsClass') && $(current).parent().text().trim() != 'No concerns at this time') {\n showFields(hideFieldClass);\n }\n else if ((hideFieldClass == 'constipationConcernsClass' || hideFieldClass == 'oralCareNeedsClass' || hideFieldClass == 'gerdClass' || hideFieldClass == 'supervisionNeedsClass') && $(current).parent().text().trim() == 'No concerns at this time') {\n hideFields(hideFieldClass);\n }\n else if (hideFieldClass == 'swallowingNeedsClass' && $(current).parent().text().trim() == 'No concerns at this time') {\n uncheckedFields(hideFieldClass);\n hideFields(hideFieldClass);\n }\n else if ((hideFieldClass == 'individualMedicaitonClass' || hideFieldClass == 'medication_s_Class') && $(current).parent().text().trim() != 'Never') {\n showFields(hideFieldClass);\n }\n else if (hideFieldClass == 'individualMedicaitonClass' && $(current).parent().text().trim() == 'Never') {\n uncheckedFields(hideFieldClass);\n hideFields(hideFieldClass);\n }\n else if (hideFieldClass == 'medication_s_Class' && $(current).parent().text().trim() == 'Never ') {\n hideFields(hideFieldClass);\n }\n else if ((hideFieldClass == 'publicTransportationClass' || hideFieldClass == 'budgetingMoneyClass') && ($(current).parent().text().trim() != 'Independent')) {\n showFields(hideFieldClass);\n }\n else if (hideFieldClass == 'publicTransportationClass' && $(current).parent().text().trim() == 'Independent ') {\n hideFields(hideFieldClass);\n }\n else if (hideFieldClass == 'administerMedicationsClass' && $(current).parent().text().trim() != 'Independent with taking medications at this time') {\n uncheckedFields(hideFieldClass);\n $('.administerMedicationsTextClass').removeAttr('hidden');\n $('.administerMedicationsTextClass').show();\n hideFields(hideFieldClass);\n }\n else if (hideFieldClass == 'administerMedicationsClass' && $(current).parent().text().trim() == 'Independent with taking medications at this time') {\n $(\".administerMedicationsTextClass\").hide();\n $('.administerMedicationsTextClass').children().children().val(\"\");\n showFields(hideFieldClass);\n }\n else if (hideFieldClass == 'psychiatricSymptomsClass') {\n uncheckedFields(hideFieldClass);\n hideFields(hideFieldClass);\n }\n else if (hideFieldClass == 'behavioralSupportPlanClass') {\n uncheckedFields(hideFieldClass);\n hideFields(hideFieldClass);\n $('.intrusiveInterventionsClass').hide();\n\n }\n else if (hideFieldClass == 'maintainSafetyClass') {\n uncheckedFields(hideFieldClass);\n hideFields(hideFieldClass);\n }\n else if (hideFieldClass == 'intrusiveInterventionsClass') {\n uncheckedFields(hideFieldClass);\n hideFields(hideFieldClass);\n }\n else if ($(current).parent().text().trim() == 'No' && hideFieldClass == 'educationProgramsClass') {\n $(\"input[name=RadioCurreEducationMeetNeed]\").prop('checked', false);\n $(\"input[name=RadioChooseCurrentEducation]\").prop('checked', false);\n hideFields(hideFieldClass);\n $('.educationProgramsNoClass').removeAttr('hidden');\n $('.educationProgramsNoClass').show();\n }\n else if (hideFieldClass == 'educationProgramsClass') {\n $(\"input[name=RadioCurreEducationMeetNeed]\").prop('checked', false);\n $(\"input[name=RadioChooseCurrentEducation]\").prop('checked', false);\n $(\"input[name=RadioMemPursuingAdditionalEducation]\").prop('checked', false);\n hideFields(hideFieldClass);\n $('.educationProgramsNoClass').hide();\n }\n else if (hideFieldClass == 'accessVRClass') {\n uncheckedFields(hideFieldClass);\n hideFields(hideFieldClass);\n }\n else if ($(current).parent().text().trim() != 'No known history' && hideFieldClass == 'significantChallengingClass') {\n showFields(hideFieldClass);\n }\n else if (hideFieldClass == 'significantChallengingClass') {\n uncheckedFields(hideFieldClass);\n hideFields(hideFieldClass);\n }\n else if (hideFieldClass == 'memberCurrentEmploymentStatusClass' && $(current).parent().text().trim() != 'Retired' && $(current).parent().text().trim() != 'Not employed') {\n showFields(hideFieldClass);\n }\n else if (hideFieldClass == 'memberCurrentEmploymentStatusClass' && ($(current).parent().text().trim() == 'Retired' || $(current).parent().text().trim() == 'Not employed')) {\n $(\"input[name=RadioMemSatisfiedWithCurrentEmployer]\").prop('checked', false);\n $(\"input[name=RadioMemPaycheck]\").prop('checked', false);\n $(\"input[name=RadioDescMemEmploymentSetting]\").prop('checked', false);\n $(\"input[name=RadioSatisfiedCurrentEmploymentSetting]\").prop('checked', false);\n $(\"input[name=RadioMemWorkInIntegratedSetting]\").prop('checked', false);\n hideFields(hideFieldClass);\n }\n else if (hideFieldClass == 'involvementInCriminalClass') {\n $(\"input[name=RadioMemCurrOnProbation]\").prop('checked', false);\n // $(\"input[name=RadioMemInvolCriminalJusticeSystem]\").prop('checked', false);\n $(\"input[name=RadioMemNeedLegalAid]\").prop('checked', false);\n $(\"input[name=RadioCrimJustSystemImpactHousing]\").prop('checked', false);\n $(\"input[name=RadioCrimJustSystemImpactEmployment]\").prop('checked', false);\n $(\"#TextBoxExpInvolCriminalJusticeSystem\").val(\"\");\n $('.paroleOrProbationClass').hide();\n $('.paroleOrProbationClass').children().children().val(\"\");\n $('.imapctHousingClass').hide();\n $('.imapctHousingClass').children().children().val(\"\");\n $('.impactCurrentEmploymentClass').hide();\n $('.impactCurrentEmploymentClass').children().children().val(\"\");\n hideFields(hideFieldClass);\n }\n else if (hideFieldClass == 'sexuallyActiveClass') {\n uncheckedFields(hideFieldClass);\n hideFields(hideFieldClass);\n }\n else if (hideFieldClass == 'mentalHealthConditionClass') {\n // uncheckedFields(hideFieldClass);\n hideFields(hideFieldClass);\n }\n else if (hideFieldClass == 'suicidalThoughtsBehaviorsClass') {\n uncheckedFields(hideFieldClass);\n hideFields(hideFieldClass);\n }\n else if (hideFieldClass == 'healthProfessionalSuicidalRiskClass') {\n uncheckedFields(hideFieldClass);\n hideFields(hideFieldClass);\n }\n else if (hideFieldClass == 'monitoredByPsychiatristClass') {\n uncheckedFields(hideFieldClass);\n hideFields(hideFieldClass);\n }\n else {\n hideFields(hideFieldClass);\n }\n\n\n }\n else if (type == 'radioNo') {\n if ($(current).parent().text().trim() == 'No' && hideFieldClass != 'satisfiedWithProviderClass') {\n showFields(hideFieldClass);\n }\n\n else if (hideFieldClass == 'selfDirectSupportsClass') {\n uncheckedFields(hideFieldClass);\n hideFields(hideFieldClass);\n }\n else if (hideFieldClass == 'satisfiedWithProviderClass' && $(current).parent().text().trim() != 'No') {\n showFields(hideFieldClass);\n }\n else if (hideFieldClass == 'satisfiedWithProviderClass' && $(current).parent().text().trim() == 'No') {\n uncheckedFields(hideFieldClass);\n hideFields(hideFieldClass);\n }\n else {\n hideFields(hideFieldClass);\n }\n }\n else if (type == 'radioWithName') {\n if (hideFieldClass == 'paroleOrProbationClass' && $(current).parent().text().trim() == 'Probation' || $(current).parent().text().trim() == 'Parole') {\n showFields(hideFieldClass);\n }\n else {\n hideFields(hideFieldClass);\n }\n }\n else if (type == 'dropdown') {\n\n if ($(current).children(\"option:selected\").text() == 'Co Representation' && hideFieldClass == 'representationStatusClass') {\n $('.cabRepContact2').removeAttr('hidden');\n $('.cabRepContact1').removeAttr('hidden');\n $('.cabRepContact1').show();\n $('.cabRepContact2').show();\n }\n else if (hideFieldClass == 'representationStatusClass' && $(current).children(\"option:selected\").text() == 'Full Representation') {\n $('.cabRepContact1').removeAttr('hidden');\n $('.cabRepContact1').show();\n $('.cabRepContact2').hide();\n $('.cabRepContact2').children().children().val(\"\");\n }\n else if ($(current).children(\"option:selected\").text() == 'No Representation' || $(current).children(\"option:selected\").val() == '' && hideFieldClass == 'representationStatusClass') {\n $('.cabRepContact1').children().children().val(\"\");\n $('.cabRepContact2').children().children().val(\"\");\n $('.cabRepContact1').hide();\n $('.cabRepContact2').hide();\n }\n else if (hideFieldClass == 'memberMakeDecisionClass' && $(current).children(\"option:selected\").text() == 'Legal Guardian') {\n showFields(hideFieldClass);\n }\n else if (hideFieldClass == 'memberMakeDecisionClass') {\n uncheckedFields(hideFieldClass);\n hideFields(hideFieldClass);\n }\n else if (hideFieldClass == 'memberCurrentDiagnosesClass' && $(current).children(\"option:selected\").text() != null && $(current).children(\"option:selected\").val() > 0) {\n showFields(hideFieldClass);\n }\n else if (hideFieldClass == 'memberCurrentDiagnosesClass' && ($(current).children(\"option:selected\").text() == null || $(current).children(\"option:selected\").val() == \"\")) {\n uncheckedFields(hideFieldClass);\n hideFields(hideFieldClass);\n }\n else {\n\n }\n }\n else if (type == 'text') {\n if (hideFieldClass == 'circleSupportContactClass') {\n if ($(current).val() != null && $(current).val() != '') {\n showFields(hideFieldClass);\n }\n }\n\n else if ($('#TextBoxNicknamePreferredName').text() == 'Professional') {\n showFields(hideFieldClass);\n }\n else if (hideFieldClass == 'genderClass') {\n if ($(current).text() == 'Female') {\n $('.femaleGenderClass').removeAttr('hidden');\n $('.femaleGenderClass').show();\n }\n else if ($(current).text() == 'Male') {\n $('.maleGenderClass').removeAttr('hidden');\n $('.maleGenderClass').show();\n }\n showFields(hideFieldClass);\n }\n else {\n hideFields(hideFieldClass);\n }\n }\n else if (type == 'checkbox') {\n if (($(current).prop(\"checked\") && (hideFieldClass == 'mentalHealthServiceClass' || hideFieldClass == 'mentalHealthServiceOtherClass'))) {\n showFields(hideFieldClass);\n }\n else if ($(current).prop(\"checked\") && hideFieldClass == 'individualsAges5Class') {\n uncheckedFields(hideFieldClass);\n hideFields(hideFieldClass);\n }\n else if (($('input[name=CheckboxLongTermInpatientTreatment]:checked').length == 1 || $('input[name=CheckboxAcuteInpatientTreatment]:checked').length == 1) && hideFieldClass == 'acuteInpatientClass') {\n showFields(hideFieldClass);\n }\n else if ($('input[name=CheckboxindividualsAges5]:checked').length == 0 && _age <= 5) {\n showFields(hideFieldClass);\n }\n else if ((hideFieldClass == 'skinIntegrityClass' || hideFieldClass == 'nutritionalNeedsClass' || hideFieldClass == 'dentalOralCareNeedsClass') && $(current).parent().text().trim() != 'No concerns at this time') {\n var check = true;\n uncheckedFields(hideFieldClass, check);\n showFields(hideFieldClass);\n }\n else if ((hideFieldClass == 'skinIntegrityClass' || hideFieldClass == 'nutritionalNeedsClass' || hideFieldClass == 'dentalOralCareNeedsClass') && $(current).parent().text().trim() == 'No concerns at this time') {\n uncheckedFields(hideFieldClass);\n hideFields(hideFieldClass);\n }\n else if (($(current).prop(\"checked\") && (hideFieldClass == 'guardianAndApplicable'))) {\n if ($('#CheckboxNoActiveGuardian').prop(\"checked\") || $('#CheckboxNotApplicableGuardian').prop(\"checked\")) {\n showFields(hideFieldClass);\n AddGuardianshipAndAdvocacy();\n $(\"#GuardianshipAndAdvocacy\").val(\"\");\n }\n }\n else if (($(current).prop != \"checked\" && (hideFieldClass == 'guardianAndApplicable'))) {\n if ($('#CheckboxNoActiveGuardian').prop(\"checked\") || $('#CheckboxNotApplicableGuardian').prop(\"checked\")) {\n showFields(hideFieldClass);\n AddGuardianshipAndAdvocacy();\n $(\"#GuardianshipAndAdvocacy\").val(\"\");\n }\n else {\n hideFields(hideFieldClass);\n }\n }\n else {\n hideFields(hideFieldClass);\n }\n\n }\n\n}", "function dropDown(that) {\r\n if (that.value == \"3\") {\r\n document.getElementById(\"chooseProperty\").style.display = \"block\";\r\n document.getElementById(\"contactinfo\").style.minHeight = \"50rem\";\r\n }\r\n else {\r\n document.getElementById(\"chooseProperty\").style.display = \"none\";\r\n document.getElementById(\"contactinfo\").style.minHeight = \"43rem\";\r\n }\r\n }", "function show_form(form_id) {\n transition = 'fast'\n $(\"div\").hide();\n $(\"#intro_header\").show();\n $(\"#lang_select\").show();\n $(\"#form_wrapper\").show();\n $(\"#form_common\").show();\n $(\"#form_common\").children().show();\n $(\"#agreement\").show();\n $(\"#agreement_box\").show();\n $(\"#footer\").show();\n switch (window.age_range) {\n case 1:\n case 2:\n log(\"displaying child form\");\n $(\"#header_child\").show();\n $(\"#form_child\").show();\n $(\"#form_child\").children().show();\n $(\"#agreement_child\").show();\n set_required([\"#last_name\", \"#first_name\",\n \"#home_address\", \"#home_city\", \"#home_zip\", \"#phone\",\n \"#guardian_last_name\", \"#guardian_first_name\",\n \"#agreement_box\"]);\n break;\n case 3:\n log(\"displaying teen form\");\n $(\"#header_teen\").show();\n $(\"#form_teen_adult\").show();\n $(\"#form_teen_adult\").children().show();\n $(\"#agreement_teen_adult\").show();\n set_required([\"#last_name\", \"#first_name\",\n \"#home_address\", \"#home_city\", \"#home_zip\", \"#phone\",\n \"#guardian_last_name\", \"#guardian_first_name\",\n \"#email\", \"#agreement_box\"]);\n break;\n case 4:\n log(\"displaying adult form\");\n $(\"#header_adult\").show();\n $(\"#form_teen_adult\").show();\n $(\"#form_teen_adult\").children().show();\n $(\"#agreement_teen_adult\").show();\n set_required([\"#last_name\", \"#first_name\",\n \"#home_address\", \"#home_city\", \"#home_zip\", \"#phone\",\n \"#guardian_last_name\", \"#guardian_first_name\",\n \"#email\", \"#agreement_box\"]);\n break;\n }\n $(\".required\").show(250);\n}", "function showSubMenu(){\n setSubMenu((privValue) =>{\n return !privValue;\n })\n }", "function toggleAccessory() { \n /* For the checkbox that fired the event, manipulate the string of the checkbox's id \n * and store the names of the body part (arms, ears, eyes, nose, mouth, ...) into 'part' variable\n */\n var temp = this.id.split(\"_\"); \n var part = temp[0];\n //When the checkbox that fired the event is checked\n if ($(this).checked === true) {\n \t$(part).fade();\n\t\t$(\"potato_\"+part).appear();\n\t\t \n //When the checkbox that fired the event is unchecked\n } else {\n\t\t$(\"potato_\"+part).fade();\n\t\t$(part).appear(); \n }\n}", "function editForm(famID) {\n // Show the parent form\n $('.add-parent-popup').show();\n $('.overlay').show();\n $('#add-button').hide();\n $('#edit-button').show();\n $(\"#header\").text(\"Edit Parent(s)\");\n $(\"#pin-label\").text(\"PIN #:\")\n $(\"#sign-instructions\").text(\"Please make any changes and click Save Changes.\");\n document.getElementById(\"PIN\").required = false;\n\n // Populate with selected family data\n populateParentData(famID);\n}", "statechangeforaccounttype() {\n if (this.firstForm.controls['fan'].value == true) {\n this.firstForm.controls['model'].setValue(false);\n this.firstForm.controls['signupaffiliate'].setValue(false);\n this.firstForm.controls['dancer'].setValue(false);\n this.firstForm.controls['musicians'].setValue(false);\n }\n if (this.firstForm.controls['musicians'].value == true || this.firstForm.controls['dancer'].value == true || this.firstForm.controls['model'].value == true) {\n this.firstForm.controls['signupaffiliate'].setValue(true);\n this.firstForm.controls['fan'].setValue(false);\n }\n }", "statechangeforaccounttype() {\n if (this.firstForm.controls['fan'].value == true) {\n this.firstForm.controls['model'].setValue(false);\n this.firstForm.controls['signupaffiliate'].setValue(false);\n this.firstForm.controls['dancer'].setValue(false);\n this.firstForm.controls['musicians'].setValue(false);\n }\n if (this.firstForm.controls['musicians'].value == true || this.firstForm.controls['dancer'].value == true || this.firstForm.controls['model'].value == true) {\n this.firstForm.controls['signupaffiliate'].setValue(true);\n this.firstForm.controls['fan'].setValue(false);\n }\n }", "function pag_configureUserProfile(profileFormId) {\n document.getElementById(profileFormId).style.visibility = \"visible\";\n}" ]
[ "0.62752753", "0.58078927", "0.5662401", "0.56078213", "0.5468041", "0.53542644", "0.5337607", "0.5194896", "0.5190862", "0.5188004", "0.5187058", "0.51732653", "0.5163104", "0.51369697", "0.51289403", "0.5121273", "0.5087605", "0.5085158", "0.5084953", "0.5079718", "0.5068355", "0.50679326", "0.50638306", "0.5056072", "0.504642", "0.5029216", "0.50234693", "0.5022651", "0.5000853", "0.49956846", "0.499384", "0.4987101", "0.49649316", "0.4960891", "0.4951112", "0.4951112", "0.49493465", "0.49476048", "0.49435222", "0.49224216", "0.49040046", "0.49007756", "0.49007756", "0.48978052", "0.4894903", "0.489428", "0.48927906", "0.4890399", "0.4887335", "0.4885559", "0.48819855", "0.48712862", "0.48553172", "0.484368", "0.48381057", "0.48302013", "0.4829283", "0.48291624", "0.4821059", "0.48197788", "0.48169494", "0.48143095", "0.48118192", "0.4809952", "0.48095536", "0.4798073", "0.4787671", "0.47698042", "0.4768629", "0.47565895", "0.47523707", "0.47521302", "0.47488368", "0.47353116", "0.47149253", "0.47118962", "0.4709207", "0.4708946", "0.47040513", "0.4700254", "0.46991596", "0.46964243", "0.46960208", "0.46930927", "0.4689805", "0.4688708", "0.46823665", "0.4676667", "0.46741563", "0.4672112", "0.46706682", "0.4669662", "0.46692446", "0.4668707", "0.46639785", "0.46633494", "0.4662633", "0.4658592", "0.4658592", "0.46486774" ]
0.5126527
15
dynamically adjust heights of all regions
function adjustRowRegionsHeights() { // handle region areas for upper rows if ($(".upperRow").length) { var rows = $(".regions").find(".upperRow"); rows.each(adjustUpperRowRegionsHeight); } // handle region areas for the bottom row if ($(".bottomRow").length) { var row = $(".regions").find(".bottomRow"); adjustBottomRowRegionsHeight(row) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function adjustRowRegionsHeights() {\n // handle region areas for upper rows\n if ($(\".upperRow\").length) {\n var rows = $(\".regions\").find(\".upperRow\");\n rows.each(adjustUpperRowRegionsHeight);\n }\n\n // handle region areas for the bottom row\n if ($(\".bottomRow\").length) {\n var row = $(\".regions\").find(\".bottomRow\");\n adjustBottomRowRegionsHeight(row)\n }\n }", "function adjustUpperRowRegionsHeight(row) {\n // when called by each, first argument is a number instead of a row value\n var row = (typeof row === 'number') ? $(this) : row;\n\n resetRowsRegionsHeight(row);\n\n // sets total region height to the height of tallest region\n setRowsRegionsHeight(row, getRowRegionsMaxHeight(row));\n\n // refresh sortables cached positions\n getNonLockedRegions().sortable(\"refreshPositions\");\n }", "function modifyHeight() {\n var $uiSelectorContainer = $(uiSelector);\n var page_header_height = $uiSelectorContainer.find('.page-header').height();\n \n // If page_header's height is changed, then modify the height of main_region\n if(page_header_height !== page_header_current_height) {\n page_header_current_height = page_header_height;\n var $main_region_selector = $uiSelectorContainer.find('#main_content'),\n right_pane_height = $uiSelectorContainer.find('.right-pane').height();\n\n $main_region_selector.outerHeight(right_pane_height - page_header_height);\n }\n }", "function adjustUpperRowRegionsHeight(row) {\n // when called by each, first argument is a number instead of a row value\n var row = (typeof row === 'number') ? $(this) : row;\n\n resetRowsRegionsHeight(row);\n\n // sets total region height to the height of tallest region\n setRowsRegionsHeight(row, getRowRegionsMaxHeight(row));\n\n // refresh sortables cached positions\n getNonLockedRegions().sortable(\"refreshPositions\");\n }", "function setRowsRegionsHeight(row, maxHeight) {\n var rowChildren = $(row).children();\n for (var x = 0; x < rowChildren.length; x++) {\n if ($(rowChildren.get(x)).outerHeight() != maxHeight) {\n var defaultPadding = parseInt($(rowChildren.get(x)).css(\"padding-bottom\").replace(\"px\", \"\"));\n $(rowChildren.get(x)).css(\"padding-bottom\", (defaultPadding + maxHeight - $(rowChildren.get(x)).outerHeight()));\n }\n }\n }", "function adjustBottomRowRegionsHeight(row) {\n resetRowsRegionsHeight(row);\n var bodyHeight = $('body').outerHeight();\n var windowHeight = $(window).height();\n // Instances where no scroll bar currently exists\n if (windowHeight >= bodyHeight) {\n var pageHeight = $(\"#pageContent\").outerHeight();\n var headerHeight = bodyHeight - pageHeight;\n var upperRegionsMaxHeights = 0;\n if ($(\".upperRow\").length) {\n var rows = $(\".regions\").find(\".upperRow\");\n for (var x = 0; x < rows.length; x++) {\n var rowMaxHeight = getRowRegionsMaxHeight(rows.get(x));\n upperRegionsMaxHeights = upperRegionsMaxHeights + rowMaxHeight;\n }\n }\n // determine maximum size possible for bottom region\n // 50 px of buffer also removed to prevent scroll-bar from appearing in any cases\n var bottomPadding = (windowHeight - 50) - (upperRegionsMaxHeights + headerHeight);\n\n setRowsRegionsHeight(row, bottomPadding);\n }\n // Instances where scroll bar currently exists, can default to upper row behavior\n else {\n adjustUpperRowRegionsHeight(row);\n }\n // refresh sortables cached positions\n getNonLockedRegions().sortable(\"refreshPositions\");\n }", "function setRowsRegionsHeight(row, maxHeight) {\n var rowChildren = $(row).children();\n for (var x = 0; x < rowChildren.length; x++) {\n if ($(rowChildren.get(x)).outerHeight() != maxHeight) {\n var defaultPadding = parseInt($(rowChildren.get(x)).css(\"padding-bottom\").replace(\"px\", \"\"));\n $(rowChildren.get(x)).css(\"padding-bottom\", (defaultPadding + maxHeight - $(rowChildren.get(x)).outerHeight()));\n }\n }\n }", "function adjustBottomRowRegionsHeight(row) {\n resetRowsRegionsHeight(row);\n var bodyHeight = $('body').outerHeight();\n var windowHeight = $(window).height();\n // Instances where no scroll bar currently exists\n if (windowHeight >= bodyHeight) {\n var pageHeight = $(\"#pageContent\").outerHeight();\n var headerHeight = bodyHeight - pageHeight;\n var upperRegionsMaxHeights = 0;\n if ($(\".upperRow\").length) {\n var rows = $(\".regions\").find(\".upperRow\");\n for (var x = 0; x < rows.length; x++) {\n var rowMaxHeight = getRowRegionsMaxHeight(rows.get(x));\n upperRegionsMaxHeights = upperRegionsMaxHeights + rowMaxHeight;\n }\n }\n // determine maximum size possible for bottom region\n // 50 px of buffer also removed to prevent scroll-bar from appearing in any cases\n var bottomPadding = (windowHeight - 50) - (upperRegionsMaxHeights + headerHeight);\n\n setRowsRegionsHeight(row, bottomPadding);\n }\n // Instances where scroll bar currently exists, can default to upper row behavior\n else {\n adjustUpperRowRegionsHeight(row);\n }\n // refresh sortables cached positions\n getNonLockedRegions().sortable(\"refreshPositions\");\n }", "function initHeights() {\n jQuery('.california-world .container .col-sm-6').matchHeight();\n jQuery('.equal-heights > .col-sm-6').matchHeight();\n}", "function adjustVizHeight(){\n viz.style(\"height\", function(){\n w = parseInt(viz.style(\"width\"), 10);\n h = w*heightRatio;\n return h;\n })\n}", "function resetRowsRegionsHeight(row) {\n // when called by each, first argument is a number instead of a row value\n var row = (typeof row === 'number') ? $(this) : row;\n\n var rowChildren = $(row).children();\n for (var x = 0; x < rowChildren.length; x++) {\n // reset to 5, the initial value before dragging\n $(rowChildren.get(x)).css(\"padding-bottom\", 5);\n }\n }", "function resetRowsRegionsHeight(row) {\n // when called by each, first argument is a number instead of a row value\n var row = (typeof row === 'number') ? $(this) : row;\n\n var rowChildren = $(row).children();\n for (var x = 0; x < rowChildren.length; x++) {\n // reset to 5, the initial value before dragging\n $(rowChildren.get(x)).css(\"padding-bottom\", 5);\n }\n }", "innerHeightDependsOnChilds(){if(this.__controlStretchedHeight)return!0;if(this.__rowOptions)for(const rowOption of this.__rowOptions)if(\"Content\"===rowOption.heightMode)return!0;return super.innerHeightDependsOnChilds()}", "changeClosetHeight(height) {\n if (height > 0) {\n var axesHeight = height / 2;\n var heighpos = this.faces.get(FaceOrientation.TOP).Y()[4]; //TODO: Remove heighpos ?\n this.faces.get(FaceOrientation.TOP).changeYAxis((this.faces.get(FaceOrientation.TOP).Y()-this.faces.get(FaceOrientation.LEFT).height()/2)+axesHeight);\n this.faces.get(FaceOrientation.TOP).changeYAxis((this.faces.get(FaceOrientation.BASE).Y()+this.faces.get(FaceOrientation.LEFT).height()/2)-axesHeight);\n this.faces.get(FaceOrientation.LEFT).changeHeight(height);\n this.faces.get(FaceOrientation.RIGHT).changeHeight(height);\n this.faces.get(FaceOrientation.BACK).changeHeight(height);\n for(let closetSlot of this.getSlotFaces()){\n closetSlot.changeHeight(height);\n }\n }\n }", "function resizesection2 (nb)\r\n{\r\n\tvar nb = nb;\r\n\tvar height = nb * 150 + 50 ; // 150 / guitare + 25 pout l'en-tête et 25 pour le bas\r\n\t// maj de la hauteur du block\r\n\tdocument.getElementById('Index_Section2').style.height = height+\"px\";\r\n}", "function setUiGridHeight( ) {\r\n\t\t// apply shadow\r\n\t\t$( '#patientvaluesmultihistory' ).find( '> div:first' ).addClass( 'ui-shadow' );\r\n\t\tvar windowsheight = $( window ).height( );\r\n\t\t/*\r\n\t\t * Random number are paddings and margins of parents and grandparents\r\n\t\t */\r\n\t\tvar allowedHeight = windowsheight - ( windowsheight / 10 + 44 + 30 + 39 + 30 + 100 );\r\n\t\tvar uiBlockHeight = $( '#multi_values_history' ).height( );\r\n\t\tif ( uiBlockHeight > allowedHeight ) {\r\n\t\t\t$( '#values_history_terms' ).height( allowedHeight );\r\n\t\t}\r\n\t}", "updateInnerHeightDependingOnChilds(){}", "function Ba(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var a=e.widgets[t],n=a.node.parentNode;n&&(a.height=n.offsetHeight)}}", "function equalizeHeight()\n{\n\tvar boxHeight = 0;\n\n\t$(\".eq-height\").removeAttr(\"style\");\n\n\t$(\".row\").each(function(){\n\n\t\t$(this).find(\".eq-height\").each(function(){\n\t\t\tvar currentBoxHeight = $(this).innerHeight();\n\t\t\tif(currentBoxHeight > boxHeight) boxHeight = currentBoxHeight;\n\t\t});\n\n\t\t$(this).find(\".eq-height\").css({\"height\":boxHeight-51+\"px\"});\n\t\t$(\".container\").css({\"height\":boxHeight+\"px\"});\n\n\t});\n}", "function 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}", "set height(value) {}", "function getRowRegionsMaxHeight(row) {\n var rowChildren = $(row).children();\n var maxHeight = 100;\n for (var x = 0; x < rowChildren.length; x++) {\n if ($(rowChildren.get(x)).outerHeight() > maxHeight) {\n maxHeight = $(rowChildren.get(x)).outerHeight();\n }\n }\n return maxHeight;\n }", "function resizeControls() {\n function rc (sel) {\n var els = document.querySelectorAll(sel)\n for (var i=0; i < els.length; i++)\n els[i].style.height = (window.innerHeight - els[i].offsetTop) + 'px'\n }\n try { rc('.full-height') } catch (e) {}\n}", "function changeAreaSize() {\n changeBackgroundSize();\n for (i = 0; i <= width; i++) {\n changeLineSize(0, i);\n }\n for (i = 0; i <= height; i++) {\n changeLineSize(1, i);\n }\n for (i = 0; i < $MAX_WIDTH_DIMENSION; i++) {\n for (j = 0; j < $MAX_HEIGTH_DIMENSION; j++) {\n changeSquareSize(i, j);\n changeSquareAuxSize(i, j);\n }\n }\n changeCalculatedSize(0);\n changeCalculatedSize(1);\n changeDecreaseArrowSize(0);\n changeIncreaseArrowSize(0);\n changeDecreaseArrowSize(1);\n changeIncreaseArrowSize(1);\n changeDecreaseArrowSize(2);\n changeIncreaseArrowSize(2);\n}", "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 setHeight(obj) {\n $(mainBlock).height(function () {\n return (obj.descriptionHeight + obj.menuListBlock) + 100;\n });\n }", "function heightses(){\n\t\t$('.page__catalog .catalog-products-list__title').height('auto').equalHeights();\n\t}", "function getRowRegionsMaxHeight(row) {\n var rowChildren = $(row).children();\n var maxHeight = 100;\n for (var x = 0; x < rowChildren.length; x++) {\n if ($(rowChildren.get(x)).outerHeight() > maxHeight) {\n maxHeight = $(rowChildren.get(x)).outerHeight();\n }\n }\n return maxHeight;\n }", "function setHeight2() {\n for (var i = 1; i < 5; i++) {\n $('.js-head' + i).css('height', 'auto');\n var maxHeight2 = Math.max.apply(null, $(\".js-head\" + i).map(function() {\n return $(this).height();\n }).get());\n $('.js-head' + i).height(maxHeight2);\n \n }\n\n\n }", "function resize() {\n var sentinel = false;\n\n for(var i = 0; i < visCount; i++) {\n if ((d3.select(\"#vis\" + i)).attr(\"height\") < 400)\n sentinel = true;\n }\n if(sentinel) {\n height *= 2;\n\n d3.selectAll(\".assignmentContainer\")\n .attr( \"height\", height );\n d3.selectAll(\".svg\")\n .attr( \"height\", height );\n } else {\n height /= 2;\n\n d3.selectAll(\".assignmentContainer\")\n .attr(\"height\", height);\n d3.selectAll(\".svg\")\n .attr(\"height\", height);\n }\n}", "function 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 resizeHeightPage() {\n\t\tvar newSizeH = sizeWin-recalculPadding(pages);\n\t\tconsole.log(newSizeH);\n\t\tpages.css({\"min-height\":sizeWin});\n\t}", "function updateRegionProperties(updateRegionsArray){\n _model.render(function(htmlContent){\n window.frames[_iframe.attr(\"id\")].jQuery('body').empty().append(htmlContent).ready(function(){\n _layoutFunctions.afterRender(function(){\n //Handle updates\n $.each(updateRegionsArray, function(){\n var regItem = this;\n _model.editRegion(regItem.regionId, function(){\n this.width = regItem.width;\n this.height = regItem.height;\n });\n });\n refreshRenderAddContent();\n });\n });\n });\n }", "function changeGridConsoleRowHeight(newHeight) {\n var allm = document.getElementById('allmain');\n var navHeight = document.getElementById('nav').clientHeight + 'px';\n\n allm.style.gridTemplateRows = navHeight + ' ' + 'auto' + ' 10px ' + newHeight;\n}", "function setSizes() {\n var containerHeight = $(\".landing-cont\").height();\n $(\".landing-cont\").height(containerHeight - 200);\n}", "function setverticalBounds() {\n\n\tlet maxExpandingHeight = document.getElementById('expandingMax').value;\n\tlet minExpandingHeight = document.getElementById('expandingMin').value;\n\n\tdocument.getElementById('expandingTextArea').setAttribute('style', \n\t\t\t\t\t\t\t'max-height:' + maxExpandingHeight + 'em;' +\n\t\t\t\t\t\t\t'min-height:' + minExpandingHeight + 'em;'\n\t\t\t\t\t\t\t);\n\n}", "updateInnerHeightDependingOnChilds(){this.__cacheWidthPerColumn=null,this.__asyncWorkData[\"System.TcHmiGrid.triggerRebuildAll\"]=!0,this.__asyncWorkData[\"System.TcHmiGrid.triggerRecheckHeight\"]=!0,this.__requestAsyncWork()}", "function resize () {\n\tvar height = $interactive.outerHeight(true);\n\n\tupdateHeight(height);\n}", "setHeight(x,z,height,refresh=true) {\n var index = this.findIndex(x,z);\n this.terrain.mapData[index+1]=height;\n this.refresh(refresh);\n return index;\n }", "function set_dimensions() \n{\n\t// Control section height\n\t$(\"#control-area.initial-contain\").css(\"height\", (h*0.6)-50); \n\t// Footer height (no search yet)\n\t$(\"#main-content > section:first-child\").css(\"height\", (h*0.4));\n\t// Content (for search results) needs to be spaced from the top of the screen\n\t$(\"#content-area\").css(\"marginTop\", (h*0.6)-50);\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 }", "set minHeight(value) {}", "updateElementsHeight() {\n const me = this;\n me.rowManager.storeKnownHeight(me.id, me.height); // prevent unnecessary style updates\n\n if (me.lastHeight !== me.height) {\n const elements = me._elementsArray;\n\n for (let i = 0; i < elements.length; i++) {\n elements[i].style.height = `${me.offsetHeight}px`;\n }\n\n me.lastHeight = me.height;\n }\n }", "calcRegionSizeGlobal() {\n // this should only get done once\n // scanCol is the column that has the data we care about putting in the color fill\n // this returns a summary object that knows things about the size of the brain json dimensions and also the min and max of hte scan data\n //!! should only do this part once\n let globals = [1000, 1000, -1000, -1000]\n for (let sliceName in this.paneOb.regionBoundaryData) {\n let slice = this.paneOb.regionBoundaryData[sliceName]\n // skip if there's a single point feature\n for (let feature of slice.features) {\n // likely nota loop because coordinates is a single element array\n for (let line of feature.geometry.coordinates) {\n for (let pt of line) {\n if (pt[0] < globals[0]) {\n globals[0] = pt[0]\n }\n if (pt[1] < globals[1]) {\n globals[1] = pt[1]\n }\n if (pt[0] > globals[2]) {\n globals[2] = pt[0]\n }\n if (pt[1] > globals[3]) {\n globals[3] = pt[1]\n }\n }\n }\n }\n\n\n\n }\n /** This is a list of smallest and largest values found in the x,y dimensions within the geojson data provided. This is used to scale the region coordinates to the space of the canvas */\n this.regionSizes = globals\n /** This is a ratio of the heightvs the width of the brain data. Helpful for determining what the maximum value of our y interpolator should be. */\n this.canvasRatio = globals[3] / globals[2]\n }", "onResizeWindow () {\n viewModel.setElementHeights();\n }", "function adaptiveHeight() {\n\t\tlet takeHeihgt = [];\n\t\t$('.header_slider__item').each(function(item, index) {\n\t\t\ttakeHeihgt.push($(this).outerHeight());\n\t\t});\n\t\t$('.header_slider__item').css('height', Math.max.apply(null, takeHeihgt));\n\t}", "adjustUI() {\n this.calculateHeightOfCy(this);\n var _this = this;\n window.addEventListener(\n \"resize\",\n function() {\n _this.calculateHeightOfCy(_this)\n },\n true\n );\n }", "setHeight(_height) {\n this.bottom = this.top + _height;\n this.updateSecondaryValues();\n return this;\n }", "function resize() {\n\t\tpositionExpandedLevels();\n\t}", "function sortByHeight() {}", "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}", "onResize() {\n const sizeCell = Cell.findSizeCell(this.elementMap, this.params.map.countX, this.params.map.countY, this.elementPool, this.params.map.pool.length);\n this.params.map.cells.forEach((v, i) => Cell.setFixedProperty(this.cell[i], this.elementMap, v, sizeCell, this.params.map.countX, this.params.map.countY));\n this.params.map.pool.forEach((v, i) => (this.colourPool[i].isBottom) ? Cell.resizePool(this.colourPool[i], this.elementPool, v.colour, sizeCell, i, this.params.map.pool.length) : Cell.resizeMap(this.colourPool[i], this.elementMap, v, sizeCell, this.params.map.countX, this.params.map.countY, i, this.params.map.pool.length, this.elementPool));\n this.borderPool.forEach(v => Cell.resizeBorderProperty(v));\n }", "function undistributeHeight(els){els.height('');}", "function setHeightLayoutMiddle(window_width){\r\n\t \tif(window_width > 768 || window_width==768){\r\n\t \t\t$('.layout-middle').each(function(){\r\n\t\t \t\t$(this).css('min-height', ($(this).parent().height())+'px');\r\n\t\t \t})\r\n\t \t}else{\r\n\t \t\t$('.layout-middle').css('min-height','0px');\r\n\t \t}\r\n\t \t\r\n\t }", "function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], height = (void 0);\n if (cur.hidden) { continue }\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n }\n var diff = cur.line.height - height;\n if (height < 2) { height = textHeight(display); }\n if (diff > .005 || diff < -.005) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n }\n }", "function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], height = (void 0);\n if (cur.hidden) { continue }\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n }\n var diff = cur.line.height - height;\n if (height < 2) { height = textHeight(display); }\n if (diff > .005 || diff < -.005) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n }\n }", "function setHeight(val) {\n bookshelf.height = val;\n voronoi.setDimensions(bookshelf.width,bookshelf.height);\n\n}", "function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], height;\n if (cur.hidden) continue;\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n }\n var diff = cur.line.height - height;\n if (height < 2) height = textHeight(display);\n if (diff > .001 || diff < -.001) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) for (var j = 0; j < cur.rest.length; j++)\n updateWidgetHeight(cur.rest[j]);\n }\n }\n }", "function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], height;\n if (cur.hidden) continue;\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n }\n var diff = cur.line.height - height;\n if (height < 2) height = textHeight(display);\n if (diff > .001 || diff < -.001) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) for (var j = 0; j < cur.rest.length; j++)\n updateWidgetHeight(cur.rest[j]);\n }\n }\n }", "function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], height;\n if (cur.hidden) continue;\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n }\n var diff = cur.line.height - height;\n if (height < 2) height = textHeight(display);\n if (diff > .001 || diff < -.001) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) for (var j = 0; j < cur.rest.length; j++)\n updateWidgetHeight(cur.rest[j]);\n }\n }\n }", "function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], height;\n if (cur.hidden) continue;\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n }\n var diff = cur.line.height - height;\n if (height < 2) height = textHeight(display);\n if (diff > .001 || diff < -.001) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) for (var j = 0; j < cur.rest.length; j++)\n updateWidgetHeight(cur.rest[j]);\n }\n }\n }", "function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], height;\n if (cur.hidden) continue;\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n }\n var diff = cur.line.height - height;\n if (height < 2) height = textHeight(display);\n if (diff > .001 || diff < -.001) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) for (var j = 0; j < cur.rest.length; j++)\n updateWidgetHeight(cur.rest[j]);\n }\n }\n }", "function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], height;\n if (cur.hidden) continue;\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n }\n var diff = cur.line.height - height;\n if (height < 2) height = textHeight(display);\n if (diff > .001 || diff < -.001) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) for (var j = 0; j < cur.rest.length; j++)\n updateWidgetHeight(cur.rest[j]);\n }\n }\n }", "function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], height;\n if (cur.hidden) continue;\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n }\n var diff = cur.line.height - height;\n if (height < 2) height = textHeight(display);\n if (diff > .001 || diff < -.001) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) for (var j = 0; j < cur.rest.length; j++)\n updateWidgetHeight(cur.rest[j]);\n }\n }\n }", "function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], height;\n if (cur.hidden) continue;\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n }\n var diff = cur.line.height - height;\n if (height < 2) height = textHeight(display);\n if (diff > .001 || diff < -.001) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) for (var j = 0; j < cur.rest.length; j++)\n updateWidgetHeight(cur.rest[j]);\n }\n }\n }", "function resizeslider(){\n\t$(\".slider .items\").css({\"height\":$(window).height()});\n\t$(\".slider\").css({\"height\":$(window).height()});\n}", "function setBoxHeight() {\n var maxHeight = -1;\n\n $('.home_box').each(function() {\n maxHeight = maxHeight > $(this).height() ? maxHeight : $(this).height();\n });\n $('.home_box').each(function() {\n $(this).height(maxHeight);\n });\n }", "function resize() {\n\t\tself.wz.height($(window).height()-self.delta);\n\t\tself.rte.updateHeight();\n\t}", "function updateHeightsInViewport(cm) {\n\t\t var display = cm.display;\n\t\t var prevBottom = display.lineDiv.offsetTop;\n\t\t for (var i = 0; i < display.view.length; i++) {\n\t\t var cur = display.view[i], height;\n\t\t if (cur.hidden) continue;\n\t\t if (ie && ie_version < 8) {\n\t\t var bot = cur.node.offsetTop + cur.node.offsetHeight;\n\t\t height = bot - prevBottom;\n\t\t prevBottom = bot;\n\t\t } else {\n\t\t var box = cur.node.getBoundingClientRect();\n\t\t height = box.bottom - box.top;\n\t\t }\n\t\t var diff = cur.line.height - height;\n\t\t if (height < 2) height = textHeight(display);\n\t\t if (diff > .001 || diff < -.001) {\n\t\t updateLineHeight(cur.line, height);\n\t\t updateWidgetHeight(cur.line);\n\t\t if (cur.rest) for (var j = 0; j < cur.rest.length; j++)\n\t\t updateWidgetHeight(cur.rest[j]);\n\t\t }\n\t\t }\n\t\t }", "function resizegridReason() {\r\n var offsetbottom = parseInt($(window).height()) - parseInt($('#grid').offset().top);\r\n var gridElement = $(\"#grid\"),\r\n dataArea = gridElement.find(\".k-grid-content\"),\r\n otherElements = gridElement.children().not(\".k-grid-content\"),\r\n otherElementsHeight = 0;\r\n otherElements.each(function () {\r\n otherElementsHeight += $(this).outerHeight();\r\n });\r\n dataArea.height(offsetbottom - otherElementsHeight - 1);\r\n}", "function actionareaHeight() {\r\n var getheight = $(\".imagedetail-section\").height();\r\n $(\".section-actionarea,.selection-detail-options\").css(\"height\", getheight);\r\n}", "adjustHeight() {\n if (this.contentNode) {\n this.itemsByIndex.forEach((item, itemIndex) => {\n const scrollItemNode = this.contentNode.querySelector(`[data-infinite-list-index=\"${itemIndex}\"]`);\n if (scrollItemNode) {\n const newHeight = scrollItemNode.getBoundingClientRect().height;\n if (!this.itemsByIndex[itemIndex].height || Math.abs(newHeight - this.itemsByIndex[itemIndex].height) > 1) {\n this.itemsByIndex[itemIndex].height = newHeight;\n }\n if (!this.itemsByIndex[itemIndex].offsetTop || Math.abs(this.itemsByIndex[itemIndex].offsetTop - scrollItemNode.offsetTop) > 1) {\n this.itemsByIndex[itemIndex].offsetTop = scrollItemNode.offsetTop;\n }\n this.adjustTrailingItems(itemIndex);\n }\n });\n\n // needs to update offset tops of every other save\n this.updateScrollGroups();\n this.boundary = {\n topBoundryIndex: -1,\n hiddenTopHeight: -1,\n bottomBoundryIndex: -1,\n hiddenBottomHeight: -1,\n };\n this.update(null, true);\n }\n }", "setLayout() {\n const {\n container,\n state,\n } = this\n const {\n heights,\n } = state\n var element = document.querySelector('.masonry-panel'),\n elements = document.querySelectorAll('.masonry-panel'),\n style = window.getComputedStyle(element),\n width = style.getPropertyValue('width');\n width = width.replace('px', '');\n width = width/window.innerWidth;\n var cols = Math.ceil(1/width) - 1;\n var number = (Math.ceil(elements.length/cols) + 1);\n this.state.maxHeight = (Math.max(...heights));\n var targetHeight = this.state.maxHeight + (17 * number);\n container.style.height = `${targetHeight}px`\n }", "function updateHeightsInViewport(cm) {\n\t var display = cm.display;\n\t var prevBottom = display.lineDiv.offsetTop;\n\t for (var i = 0; i < display.view.length; i++) {\n\t var cur = display.view[i], height;\n\t if (cur.hidden) continue;\n\t if (ie && ie_version < 8) {\n\t var bot = cur.node.offsetTop + cur.node.offsetHeight;\n\t height = bot - prevBottom;\n\t prevBottom = bot;\n\t } else {\n\t var box = cur.node.getBoundingClientRect();\n\t height = box.bottom - box.top;\n\t }\n\t var diff = cur.line.height - height;\n\t if (height < 2) height = textHeight(display);\n\t if (diff > .001 || diff < -.001) {\n\t updateLineHeight(cur.line, height);\n\t updateWidgetHeight(cur.line);\n\t if (cur.rest) for (var j = 0; j < cur.rest.length; j++)\n\t updateWidgetHeight(cur.rest[j]);\n\t }\n\t }\n\t }", "function updateHeightsInViewport(cm) {\n\t var display = cm.display;\n\t var prevBottom = display.lineDiv.offsetTop;\n\t for (var i = 0; i < display.view.length; i++) {\n\t var cur = display.view[i], height;\n\t if (cur.hidden) continue;\n\t if (ie && ie_version < 8) {\n\t var bot = cur.node.offsetTop + cur.node.offsetHeight;\n\t height = bot - prevBottom;\n\t prevBottom = bot;\n\t } else {\n\t var box = cur.node.getBoundingClientRect();\n\t height = box.bottom - box.top;\n\t }\n\t var diff = cur.line.height - height;\n\t if (height < 2) height = textHeight(display);\n\t if (diff > .001 || diff < -.001) {\n\t updateLineHeight(cur.line, height);\n\t updateWidgetHeight(cur.line);\n\t if (cur.rest) for (var j = 0; j < cur.rest.length; j++)\n\t updateWidgetHeight(cur.rest[j]);\n\t }\n\t }\n\t }", "function updateHeightsInViewport(cm) {\n\t var display = cm.display;\n\t var prevBottom = display.lineDiv.offsetTop;\n\t for (var i = 0; i < display.view.length; i++) {\n\t var cur = display.view[i], height;\n\t if (cur.hidden) continue;\n\t if (ie && ie_version < 8) {\n\t var bot = cur.node.offsetTop + cur.node.offsetHeight;\n\t height = bot - prevBottom;\n\t prevBottom = bot;\n\t } else {\n\t var box = cur.node.getBoundingClientRect();\n\t height = box.bottom - box.top;\n\t }\n\t var diff = cur.line.height - height;\n\t if (height < 2) height = textHeight(display);\n\t if (diff > .001 || diff < -.001) {\n\t updateLineHeight(cur.line, height);\n\t updateWidgetHeight(cur.line);\n\t if (cur.rest) for (var j = 0; j < cur.rest.length; j++)\n\t updateWidgetHeight(cur.rest[j]);\n\t }\n\t }\n\t }", "function calculateHeights() {\n\t var _this7 = this;\n\n\t var maxRTT = max(this.rootToTipLengths());\n\t this.nodeList.forEach(function (node) {\n\t return node._height = _this7.origin - _this7.offset - (maxRTT - _this7.rootToTipLength(node));\n\t });\n\t this.heightsKnown = true;\n\t this.treeUpdateCallback();\n\t}", "changeModuleHeight(height){\n if(height>0){\n var axesHeight=height/2;\n this.module_top_face_dimensions_axes[4]=(this.module_top_face_dimensions_axes[4]-this.module_left_face_dimensions_axes[1]/2)+axesHeight;\n this.module_base_face_dimensions_axes[4]=(this.module_base_face_dimensions_axes[4]+this.module_left_face_dimensions_axes[1]/2)-axesHeight;\n this.module_left_face_dimensions_axes[1]=height;\n this.module_right_face_dimensions_axes[1]=height;\n \n }\n }", "function updateHeightsInViewport(cm) {\r\n var display = cm.display;\r\n var prevBottom = display.lineDiv.offsetTop;\r\n for (var i = 0; i < display.view.length; i++) {\r\n var cur = display.view[i], height = (void 0);\r\n if (cur.hidden) { continue }\r\n if (ie && ie_version < 8) {\r\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\r\n height = bot - prevBottom;\r\n prevBottom = bot;\r\n } else {\r\n var box = cur.node.getBoundingClientRect();\r\n height = box.bottom - box.top;\r\n }\r\n var diff = cur.line.height - height;\r\n if (height < 2) { height = textHeight(display); }\r\n if (diff > .005 || diff < -.005) {\r\n updateLineHeight(cur.line, height);\r\n updateWidgetHeight(cur.line);\r\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\r\n { updateWidgetHeight(cur.rest[j]); } }\r\n }\r\n }\r\n}", "correctHeight(){\n this.graphicalObject.position.y = this.heightModifier + this.room.brickThickness * this.room.roomDataArray[this.positionX][this.positionY].bricks;\n }", "function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], height = (void 0);\n if (cur.hidden) { continue }\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n }\n var diff = cur.line.height - height;\n if (height < 2) { height = textHeight(display); }\n if (diff > .005 || diff < -.005) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n }\n}", "function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], height = (void 0);\n if (cur.hidden) { continue }\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n }\n var diff = cur.line.height - height;\n if (height < 2) { height = textHeight(display); }\n if (diff > .005 || diff < -.005) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n }\n}", "function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], height = (void 0);\n if (cur.hidden) { continue }\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n }\n var diff = cur.line.height - height;\n if (height < 2) { height = textHeight(display); }\n if (diff > .005 || diff < -.005) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n }\n}", "function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], height = (void 0);\n if (cur.hidden) { continue }\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n }\n var diff = cur.line.height - height;\n if (height < 2) { height = textHeight(display); }\n if (diff > .005 || diff < -.005) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n }\n}", "function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], height = (void 0);\n if (cur.hidden) { continue }\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n }\n var diff = cur.line.height - height;\n if (height < 2) { height = textHeight(display); }\n if (diff > .005 || diff < -.005) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n }\n}", "function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], height = (void 0);\n if (cur.hidden) { continue }\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n }\n var diff = cur.line.height - height;\n if (height < 2) { height = textHeight(display); }\n if (diff > .005 || diff < -.005) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n }\n}", "function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], height = (void 0);\n if (cur.hidden) { continue }\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n }\n var diff = cur.line.height - height;\n if (height < 2) { height = textHeight(display); }\n if (diff > .005 || diff < -.005) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n }\n}", "function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], height = (void 0);\n if (cur.hidden) { continue }\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n }\n var diff = cur.line.height - height;\n if (height < 2) { height = textHeight(display); }\n if (diff > .005 || diff < -.005) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n }\n}", "function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], height = (void 0);\n if (cur.hidden) { continue }\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n }\n var diff = cur.line.height - height;\n if (height < 2) { height = textHeight(display); }\n if (diff > .005 || diff < -.005) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n }\n}", "function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], height = (void 0);\n if (cur.hidden) { continue }\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n }\n var diff = cur.line.height - height;\n if (height < 2) { height = textHeight(display); }\n if (diff > .005 || diff < -.005) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n }\n}", "function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], height = (void 0);\n if (cur.hidden) { continue }\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n }\n var diff = cur.line.height - height;\n if (height < 2) { height = textHeight(display); }\n if (diff > .005 || diff < -.005) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n }\n}", "function updateHeightsInViewport(cm) {\r\n var display = cm.display;\r\n var prevBottom = display.lineDiv.offsetTop;\r\n for (var i = 0; i < display.view.length; i++) {\r\n var cur = display.view[i], height;\r\n if (cur.hidden) continue;\r\n if (ie && ie_version < 8) {\r\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\r\n height = bot - prevBottom;\r\n prevBottom = bot;\r\n } else {\r\n var box = cur.node.getBoundingClientRect();\r\n height = box.bottom - box.top;\r\n }\r\n var diff = cur.line.height - height;\r\n if (height < 2) height = textHeight(display);\r\n if (diff > .001 || diff < -.001) {\r\n updateLineHeight(cur.line, height);\r\n updateWidgetHeight(cur.line);\r\n if (cur.rest) for (var j = 0; j < cur.rest.length; j++)\r\n updateWidgetHeight(cur.rest[j]);\r\n }\r\n }\r\n }", "function setHeightCarousel3() {\n $carousel3.each(function () {\n var $allImages = $(this).find('img');\n var size = $(this).attr('data-size') || 0.8;\n var resultH = wndH * size;\n var maxItemW = Math.min($(this).parent().width(), wndW) * size;\n $allImages.each(function () {\n if (this.naturalWidth && this.naturalHeight && resultH * this.naturalWidth / this.naturalHeight > maxItemW) {\n resultH = maxItemW * this.naturalHeight / this.naturalWidth;\n }\n });\n $allImages.css('height', resultH);\n $(this).children('.nk-carousel-inner').flickity('reposition');\n });\n }", "function setDriverHeight()\n{\n\tvar i = 0;\n\t// find out how many there are in the drivers div.\n\t$('#DriversAvail div').each(function(){\n\t\ti++;\n\t});\n\n\t//get the overall hieght of the containing div\n\tvar h = $(\"#DriversAvail\").height() -i;\n\th = h/i;\n\th= h-5;\n\t$('#DriversAvail div').each(function(){\n\t\t$(this).css('height',h);\n\t\t$(this).css('color','red');\n\t});\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 }", "setPxSizes() {\n var px_per_em = this.getEmSize( this.jqueryMap.$container.get(0) );\n\n this.stateMap.px_per_em = px_per_em;\n this.stateMap.alone_height_px = this.configMap.alone_height_em * px_per_em;\n this.stateMap.other_height_px = this.configMap.other_height_em * px_per_em;\n }", "function schedule_layout(){\n $('.schedule_t_row_schedule').each(function(index){\n var dataHeight = Math.round( $(this).children('.schedule_data').height() ),\n \tdataTop = $(this).children('.schedule_list').offset.top;\n $(this).find('.schedule_data .grid_wrap').css('height', dataHeight+'px');\n });\n}", "clearKnownHeights() {\n this.heightMap.clear();\n this.averageRowHeight = this.totalKnownHeight = 0;\n }", "resizeHandles() { }", "setHeight(valueNew){let t=e.ValueConverter.toNumber(valueNew);null===t&&(t=this.getAttributeDefaultValueInternal(\"Height\")),t!==this.__height&&(this.__height=t,e.EventProvider.raise(this.__id+\".onPropertyChanged\",{propertyName:\"Height\"}),this.__processHeight())}" ]
[ "0.767654", "0.6946048", "0.6924941", "0.6866327", "0.68433464", "0.68425596", "0.6821279", "0.68204063", "0.6752954", "0.6700764", "0.6660623", "0.6592755", "0.64511824", "0.64098984", "0.64033854", "0.636346", "0.63422424", "0.6335405", "0.63190836", "0.6309503", "0.6297684", "0.6243906", "0.6240024", "0.6239788", "0.6234569", "0.62269235", "0.6217873", "0.621044", "0.6199158", "0.6197121", "0.61851513", "0.61747116", "0.6133693", "0.6133174", "0.61061907", "0.60971975", "0.6090922", "0.60859585", "0.60851943", "0.60832965", "0.6077508", "0.60603565", "0.6052733", "0.6051408", "0.6042906", "0.60358495", "0.6033148", "0.6020856", "0.6017239", "0.5988711", "0.597619", "0.59529895", "0.59477407", "0.59411305", "0.5939752", "0.5939752", "0.59176457", "0.5912667", "0.5912667", "0.5912667", "0.5912667", "0.5912667", "0.5912667", "0.5912667", "0.5912667", "0.5904804", "0.589884", "0.5898664", "0.58916706", "0.5885342", "0.5880441", "0.5878305", "0.58768576", "0.5862862", "0.5862862", "0.5862862", "0.58560133", "0.58503693", "0.5846739", "0.5842874", "0.58411944", "0.58411944", "0.58411944", "0.58411944", "0.58411944", "0.58411944", "0.58411944", "0.58411944", "0.58411944", "0.58411944", "0.58411944", "0.5839287", "0.5838794", "0.58300334", "0.582998", "0.58239925", "0.5821916", "0.58156633", "0.58156186", "0.5809704" ]
0.76559716
1
adjusts the paddingbottom value of all regions in bottom row to either fill the empty space or act as an upper row
function adjustBottomRowRegionsHeight(row) { resetRowsRegionsHeight(row); var bodyHeight = $('body').outerHeight(); var windowHeight = $(window).height(); // Instances where no scroll bar currently exists if (windowHeight >= bodyHeight) { var pageHeight = $("#pageContent").outerHeight(); var headerHeight = bodyHeight - pageHeight; var upperRegionsMaxHeights = 0; if ($(".upperRow").length) { var rows = $(".regions").find(".upperRow"); for (var x = 0; x < rows.length; x++) { var rowMaxHeight = getRowRegionsMaxHeight(rows.get(x)); upperRegionsMaxHeights = upperRegionsMaxHeights + rowMaxHeight; } } // determine maximum size possible for bottom region // 50 px of buffer also removed to prevent scroll-bar from appearing in any cases var bottomPadding = (windowHeight - 50) - (upperRegionsMaxHeights + headerHeight); setRowsRegionsHeight(row, bottomPadding); } // Instances where scroll bar currently exists, can default to upper row behavior else { adjustUpperRowRegionsHeight(row); } // refresh sortables cached positions getNonLockedRegions().sortable("refreshPositions"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setRowsRegionsHeight(row, maxHeight) {\n var rowChildren = $(row).children();\n for (var x = 0; x < rowChildren.length; x++) {\n if ($(rowChildren.get(x)).outerHeight() != maxHeight) {\n var defaultPadding = parseInt($(rowChildren.get(x)).css(\"padding-bottom\").replace(\"px\", \"\"));\n $(rowChildren.get(x)).css(\"padding-bottom\", (defaultPadding + maxHeight - $(rowChildren.get(x)).outerHeight()));\n }\n }\n }", "function setRowsRegionsHeight(row, maxHeight) {\n var rowChildren = $(row).children();\n for (var x = 0; x < rowChildren.length; x++) {\n if ($(rowChildren.get(x)).outerHeight() != maxHeight) {\n var defaultPadding = parseInt($(rowChildren.get(x)).css(\"padding-bottom\").replace(\"px\", \"\"));\n $(rowChildren.get(x)).css(\"padding-bottom\", (defaultPadding + maxHeight - $(rowChildren.get(x)).outerHeight()));\n }\n }\n }", "function adjustBottomRowRegionsHeight(row) {\n resetRowsRegionsHeight(row);\n var bodyHeight = $('body').outerHeight();\n var windowHeight = $(window).height();\n // Instances where no scroll bar currently exists\n if (windowHeight >= bodyHeight) {\n var pageHeight = $(\"#pageContent\").outerHeight();\n var headerHeight = bodyHeight - pageHeight;\n var upperRegionsMaxHeights = 0;\n if ($(\".upperRow\").length) {\n var rows = $(\".regions\").find(\".upperRow\");\n for (var x = 0; x < rows.length; x++) {\n var rowMaxHeight = getRowRegionsMaxHeight(rows.get(x));\n upperRegionsMaxHeights = upperRegionsMaxHeights + rowMaxHeight;\n }\n }\n // determine maximum size possible for bottom region\n // 50 px of buffer also removed to prevent scroll-bar from appearing in any cases\n var bottomPadding = (windowHeight - 50) - (upperRegionsMaxHeights + headerHeight);\n\n setRowsRegionsHeight(row, bottomPadding);\n }\n // Instances where scroll bar currently exists, can default to upper row behavior\n else {\n adjustUpperRowRegionsHeight(row);\n }\n // refresh sortables cached positions\n getNonLockedRegions().sortable(\"refreshPositions\");\n }", "function resetRowsRegionsHeight(row) {\n // when called by each, first argument is a number instead of a row value\n var row = (typeof row === 'number') ? $(this) : row;\n\n var rowChildren = $(row).children();\n for (var x = 0; x < rowChildren.length; x++) {\n // reset to 5, the initial value before dragging\n $(rowChildren.get(x)).css(\"padding-bottom\", 5);\n }\n }", "function resetRowsRegionsHeight(row) {\n // when called by each, first argument is a number instead of a row value\n var row = (typeof row === 'number') ? $(this) : row;\n\n var rowChildren = $(row).children();\n for (var x = 0; x < rowChildren.length; x++) {\n // reset to 5, the initial value before dragging\n $(rowChildren.get(x)).css(\"padding-bottom\", 5);\n }\n }", "function fullWidthRowPaddingAdjustCalc() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($('#boxed').length == 0) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$('.full-width-section[data-top-percent], .full-width-section[data-bottom-percent], .full-width-content[data-top-percent], .full-width-content[data-bottom-percent]').each(function () {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tvar $windowHeight = $window.width(),\r\n\t\t\t\t\t\t\t$topPadding = ($(this).attr('data-top-percent')) ? $(this).attr('data-top-percent') : 'skip',\r\n\t\t\t\t\t\t\t$bottomPadding = ($(this).attr('data-bottom-percent')) ? $(this).attr('data-bottom-percent') : 'skip';\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//top\r\n\t\t\t\t\t\t\tif ($topPadding != 'skip') {\r\n\t\t\t\t\t\t\t\t$(this).css('padding-top', $windowHeight * (parseInt($topPadding) / 100));\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\t//bottom\r\n\t\t\t\t\t\t\tif ($bottomPadding != 'skip') {\r\n\t\t\t\t\t\t\t\t$(this).css('padding-bottom', $windowHeight * (parseInt($bottomPadding) / 100));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "function adjustRowRegionsHeights() {\n // handle region areas for upper rows\n if ($(\".upperRow\").length) {\n var rows = $(\".regions\").find(\".upperRow\");\n rows.each(adjustUpperRowRegionsHeight);\n }\n\n // handle region areas for the bottom row\n if ($(\".bottomRow\").length) {\n var row = $(\".regions\").find(\".bottomRow\");\n adjustBottomRowRegionsHeight(row)\n }\n }", "function adjustRowRegionsHeights() {\n // handle region areas for upper rows\n if ($(\".upperRow\").length) {\n var rows = $(\".regions\").find(\".upperRow\");\n rows.each(adjustUpperRowRegionsHeight);\n }\n\n // handle region areas for the bottom row\n if ($(\".bottomRow\").length) {\n var row = $(\".regions\").find(\".bottomRow\");\n adjustBottomRowRegionsHeight(row)\n }\n }", "function setBottomPaddingToZero() {\n\tif (window.innerWidth > 700) {\n\t\tnavigation.style.paddingBottom = \"0%\";\n\t}\n}", "function BottomEdge() {\n $( \"#target\" ).animate({paddingTop:\"+=310px\"});\n }", "function applyBottomBorderToGoupedValues() {\n var ss = SpreadsheetApp.getActiveSpreadsheet();\n var sheet = ss.getSheetByName('Master Inventory');\n var numColumns = sheet.getLastColumn();\n \n var columnToSearchZeroIndexed = 0;\n var rowRangesArray = getRowRangesOfGroupedValues(columnToSearchZeroIndexed);\n var numGroups = rowRangesArray.length;\n \n for (var i=0; i < numGroups; i++) {\n var firstTempRow = rowRangesArray[i][0];\n var lastTempRow = rowRangesArray[i][1];\n var numTempRows = lastTempRow - firstTempRow;\n \n var tempRange = sheet.getRange(firstTempRow, columnToSearchZeroIndexed+1, numTempRows+1, numColumns);\n tempRange.setBorder(false, false, true, false, false, false);\n }\n}", "getVarPaddingBottom() {\n const {\n delta: {\n total, end, keeps, varLastCalcIndex, varAverSize\n }, size\n } = this;\n const last = total - 1;\n if (total - end <= keeps || varLastCalcIndex === last) {\n return this.getVarOffset(last) - this.getVarOffset(end);\n }\n // if unreached last zone or uncalculate real behind offset\n // return the estimate paddingBottom avoid too much calculate.\n return (total - end) * (varAverSize || size);\n }", "fillBelow(newTop) {\n const me = this,\n fillHeight = newTop - me.topRow.top - me.prependBufferHeight,\n recordCount = me.store.count,\n rowCount = me.rowCount;\n\n let accumulatedHeight = 0;\n\n // Repeat until we have filled empty height\n while (\n accumulatedHeight < fillHeight && // fill empty height\n me.topIndex + rowCount < recordCount && // as long as we have records left\n me.topRow.top + me.topRow.offsetHeight < newTop // and do not run move top row fully into view (can happen with var row height)\n ) {\n // We want to show next record at bottom of rows\n accumulatedHeight += me.displayRecordAtBottom();\n }\n }", "function fullWidthRowPaddingAdjust() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (nectarDOMInfo.usingMobileBrowser) {\r\n\t\t\t\t\t\tfullWidthRowPaddingAdjustCalc();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$window.on('resize', fullWidthRowPaddingAdjustCalc);\r\n\t\t\t\t\t\r\n\t\t\t\t}", "function footer_at_bottom() {\n\n var winWidth = $(window).width();\n var $footer = $('#footer');\n var $wrapper = $('#wrapper');\n var $footer_height = $footer.height();\n\n winWidth >= 960 ? $wrapper.css('paddingBottom',$footer_height) : $wrapper.css('paddingBottom',0)\n\n\n }", "function fixBottomWidth() {\n var percen = (($(\"span:contains('Utilization Management')\").width() / $(\".main_container\").width()) * 100) + 1;\n var val = percen * $(\".main_container\").width() * 0.013;\n $('.bottomfixed').width(($(\".main_container\").width() - val - 63) + 21);\n}", "function fixBottomWidth() {\n var percen = (($(\"span:contains('Utilization Management')\").width() / $(\".main_container\").width()) * 100) + 1;\n var val = percen * $(\".main_container\").width() * 0.013;\n $('.bottomfixed').width(($(\".main_container\").width() - val - 63) + 21);\n}", "function adjustUpperRowRegionsHeight(row) {\n // when called by each, first argument is a number instead of a row value\n var row = (typeof row === 'number') ? $(this) : row;\n\n resetRowsRegionsHeight(row);\n\n // sets total region height to the height of tallest region\n setRowsRegionsHeight(row, getRowRegionsMaxHeight(row));\n\n // refresh sortables cached positions\n getNonLockedRegions().sortable(\"refreshPositions\");\n }", "function calculate_padding() {\n padLeft = Math.floor((display.getWidth() - etch.getWidth()) / 2);\n padTop = Math.floor((display.getHeight() - etch.getHeight() - 5) / 2) + 1;\n}", "get fixedBottomGap() { return this._fixedBottomGap; }", "function adjustUpperRowRegionsHeight(row) {\n // when called by each, first argument is a number instead of a row value\n var row = (typeof row === 'number') ? $(this) : row;\n\n resetRowsRegionsHeight(row);\n\n // sets total region height to the height of tallest region\n setRowsRegionsHeight(row, getRowRegionsMaxHeight(row));\n\n // refresh sortables cached positions\n getNonLockedRegions().sortable(\"refreshPositions\");\n }", "function adjustContentPadding() {\n var topElem = document.getElementsByClassName('oj-applayout-fixed-top')[0];\n var contentElem = document.getElementsByClassName('oj-applayout-content')[0];\n var bottomElem = document.getElementsByClassName('oj-applayout-fixed-bottom')[0];\n\n if (topElem) {\n contentElem.style.paddingTop = topElem.offsetHeight+'px';\n }\n if (bottomElem) {\n contentElem.style.paddingBottom = bottomElem.offsetHeight+'px';\n }\n // Add oj-complete marker class to signal that the content area can be unhidden.\n // See the CSS demo tab to see when the content area is hidden.\n contentElem.classList.add('oj-complete');\n }", "fillBelow(newTop) {\n const me = this,\n fillHeight = newTop - me.topRow.top - me.prependBufferHeight,\n recordCount = me.store.count,\n rowCount = me.rowCount;\n let accumulatedHeight = 0; // Repeat until we have filled empty height\n\n while (accumulatedHeight < fillHeight && // fill empty height\n me.topIndex + rowCount < recordCount && // as long as we have records left\n me.topRow.top + me.topRow.offsetHeight < newTop // and do not move top row fully into view (can happen with var row height)\n ) {\n // We want to show next record at bottom of rows\n accumulatedHeight += me.displayRecordAtBottom();\n }\n\n me.trigger('renderDone');\n }", "function fixGap() {\n const navPanel = document.querySelector(`td[valign=\"bottom\"]`);\n navPanel.removeAttribute(\"valign\");\n navPanel.removeAttribute(\"align\");\n}", "function section4MiddleBottom( placeholder )\n {\n // //\\\\ config\n compCol =\n {\n \"SMALL CAP\": \"#eeaa44\",\n \"MID CAP\": \"#ccaa33\",\n \"LARGE CAP\": \"#bb6600\",\n \"DEBT & CASH\": \"#ffbb99\"\n }\n // \\\\// config\n\n\n placeholder.stack = fmethods.initTopPaneCell( \"Credit Rating Breakup\" );\n //placeholder.margin = [0,0,0,0]; //todm no dice ... chart is too low ...\n\n var JSONrecord = nheap.content_data\n [ \"Page 4\" ]\n [ \"EquityMarketCap&DebtCreditRatingBreakup.txt\" ]\n [ \"EquityMarketCap\" ][0];\n\n //------------------\n // //\\\\ chart legend\n //------------------\n //var seriesData = Object.keys( JSONrecord ).map( prop => [ prop, JSONrecord[ prop ]] );\n var chartData = Object.keys( JSONrecord ).map( prop => ({ name:prop, y:JSONrecord[ prop ] }) );\n var colors = chartData.map( serie => compCol[ serie.name ] );\n var tBody = [];\n chartData.forEach( (row,rix) => {\n var ix = rix%2;\n var iy = ( rix - ix ) /2;\n tBody[iy] = tBody[iy] || [];\n\n //----------------------------------------\n // //\\\\ tedious alignments of legend cells\n //----------------------------------------\n tBody[iy][2*ix] = { image:methods.getLabelImage({\n shape:'bar', color:compCol[ row.name ]\n }),\n fit:[8,8],\n alignment:'left',\n //.second row top margin for even vert. layout\n margin:[ 0, iy?6:6, 0, 0]\n };\n tBody[iy][2*ix+1] = [\n { text:row.y.toFixed(2)+'%', fontSize:11, color:'black', bold:true,\n alignment:'left',\n //.second row top margin for even vert. layout\n margin:[ 0, iy?0:0, 0, 0],\n lineHeight:1\n },\n { text:row.name.substring(0,14), color:'#666', alignment:'left', margin:[0,0,0,0], \n lineHeight:1\n }\n ];\n //----------------------------------------\n // \\\\// tedious alignments of legend cells\n //----------------------------------------\n\n });\n //------------------\n // \\\\// chart legend\n //------------------\n\n\n\n //==============================\n // //\\\\ chart\n //==============================\n var chartPlaceholder = {\n //image: will come from export \n fit:[110,110],\n margin: [25,0,0,0]\n };\n\n placeholder.stack[1] = fmethods.layt({\n margin : [0,0,0,0],\n widths : [ '100%', '100%' ],\n pads : { left:0, top:20, right:0, bottom:0 },\n rows : 2,\n body : [\n ////layout is vertical: one column\n //.first column\n [ chartPlaceholder ],\n //.second column\n [\n fmethods.layt({\n margin : [20,0,0,0],\n widths: [ '10%', '30%', '10%', '40%' ],\n cols : 4,\n rows : 2,\n fontSize: 9,\n bordCol : '#fff',\n body : tBody\n }).tbl\n ]\n ]\n }).tbl;\n\n contCharts.push({ \n ddContRack : chartPlaceholder,\n //---------------------------\n // //\\\\ chart options\n //---------------------------\n options :\n {\n chart: {\n plotBackgroundColor: null,\n plotBorderWidth: null,\n plotShadow: false,\n type: 'pie'\n ,width: 460\n ,height: 460\n },\n\n \"exporting\": {\n \"enabled\": false\n },\n \"credits\": {\n \"enabled\": false\n },\n \n legend: {\n enabled: false,\n },\n\n title: {\n text: ''\n },\n plotOptions: {\n pie: {\n dataLabels: {\n enabled: false\n },\n colors : colors,\n showInLegend: true\n },\n series: {\n animation: false\n }\n },\n series: [{\n colorByPoint: true,\n type: 'pie',\n innerSize: '83%',\n data: chartData\n }]\n }\n //---------------------------\n // \\\\// chart options\n //---------------------------\n });\n //==============================\n // \\\\// chart\n //==============================\n\n\n\n return placeholder;\n }", "_isBottomAligned(align) {\n const [pinAlign, baseAlign] = align.split(' ');\n return pinAlign[0] === 'b' && pinAlign[0] === baseAlign[0];\n }", "function applyTemplateNewLineHeight(item) {\n // the height seems to be calculated by the template row count (how many line of items does the template have)\n var rowCount = _options.panelRows;\n\n //calculate padding requirements based on detail-content..\n //ie. worst-case: create an invisible dom node now &find it's height.\n var lineHeight = 13; //we know cuz we wrote the custom css innit ;)\n item._sizePadding = Math.ceil(((rowCount * 2) * lineHeight) / _grid.getOptions().rowHeight);\n item._height = (item._sizePadding * _grid.getOptions().rowHeight);\n\n var idxParent = _dataView.getIdxById(item.id);\n for (var idx = 1; idx <= item._sizePadding; idx++) {\n _dataView.insertItem(idxParent + idx, getPaddingItem(item, idx));\n }\n }", "function getBottom(col) {\r\n\treturn (field[col].length - 1) * rowheight;\r\n}", "function alignBottom (){\n\t\t\tvar selectedGr = canvas.getSelectionElement();\n\t\t\tif (!selectedGr) return;\n\t\t\tvar selectedGr = canvas.getActiveGroup();\n\t\t\tvar pointC = new fabric.Point(0,0);\n\t\t\tvar deltaY = 0;\n\t\t\tvar firstObjH = 0;\n\t\t\tvar coordY1 = 0;\n\t\t\tvar coordY2 = 0;\n\t\t\ti=0;\t\t\t\n\t\t\tselectedGr.forEachObject(function(obj) {\n\t\t\t\ti++;\n\t\t\t\tobj.setOriginX('left');\n\t\t\t\tobj.setOriginY('top');\t\t\n\t\t\t\t//console.log( i + ' Point Left = ' + obj.left );\n\t\t\t\tvar boundObj = obj.getBoundingRect();\n\t\n\t\t\t\tif (i > 1 ){\n\t\t\t\t\tpointC.y = obj.top;\n\t\t\t\t\tdeltaY = boundObj.top - coordY1;\n\t\t\t\t\tconsole.log(i + ' DELTA= ' + deltaY);\n\t\t\t\t\tpointC.x = obj.left\n\t\t\t\t\tpointC.y -= deltaY+boundObj.height-firstObjH;\t\n\t\t\t\t\tobj.setTop(pointC.y); \n \n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tcoordY1 = boundObj.top;\n\t\t\t\t\tfirstObjH = boundObj.height;\n\n\t\t\t\t}\t\t\t\t\n\t\t\t});\n\t\t\n\t\t\tcanvas.deactivateAllWithDispatch();\n\t\t\tselectGrpParam();\n\t\t\tcanvas.renderAll();\n\t\t}", "adjustFooterView() {\n setTimeout(function () {\n if (document.querySelector('.footer-section')) {\n document.querySelector('.footer-section').style.paddingBottom = document.querySelector('.order-summary-section').offsetHeight + 'px';\n } else if (document.querySelector('.vx-employee-footer')) {\n document.querySelector('.vx-employee-footer').style.paddingBottom = document.querySelector('.order-summary-section').offsetHeight + 'px';\n }\n }, 50);\n }", "function tablePadding() {\n var header = $('.schedule-table-wrapper.active .schedule-table-stops-wrapper').height();\n $('.schedule-table-wrapper.active').css({'margin-top': header });\n $('.schedule-table-wrapper.active .schedule-table-stops-wrapper').css({'top': -header});\n }", "function carveBottom(s, i, j) {\n if (i + 1 < (s.length)) {\n s[i][j] = s[i][j] + BOTTOM;\n s[i+1][j] = s[i+1][j] + TOP;\n }\n}", "get xAxisAnnotationPaddingBottom() {\r\n return this.i.ng;\r\n }", "function setPad(reference, target){\n var padAmt=((reference.height() - target.height())/2);\n var styles = {\n \"padding-top\": padAmt,\n \"padding-bottom\": padAmt\n };\n target.css( styles );\n}", "function outputPaddingAdjuster() {\n if (!tutorialSettings.libraries.turtle && !tutorialSettings.libraries.DOM && !tutorialSettings.libraries.csv && !tutorialSettings.libraries.csvAndTurtle) {\n outputBlock.style.paddingLeft = \"40px\";\n } \n else {\n if($(window).width() < 1183){\n outputBlock.style.paddingLeft = \"40px\";\n }\n }\n}", "function undistributeHeight(els){els.height('');}", "function generateBrickBottom() {\n let row = 12;\n for(let i = 1; i <= canvas.width; i++) {\n ctx.fillStyle = '#000';\n ctx.save();\n ctx.fillRect((6 + row)*i, canvas.height - 8, 2, 6);\n ctx.fillRect((0 + row)*i, canvas.height - 14, 2, 6);\n ctx.fillRect((6 + row)*i, canvas.height - 20, 2, 6);\n }\n }", "function IsInBottomBorderRow(tree) {\n\n return +tree.getAttribute(\"data-y\") === TREE_COUNT_Y - 1;\n\n}", "getMaxBottomCellMargin(row) {\n if (isNullOrUndefined(row.childWidgets)) {\n return 0;\n }\n let value = 0;\n for (let i = 0; i < row.childWidgets.length; i++) {\n let cell = row.childWidgets[i];\n let bottomMargin = 0;\n if (cell.cellFormat.hasValue('bottomMargin')) {\n bottomMargin = HelperMethods.convertPointToPixel(cell.cellFormat.bottomMargin);\n }\n else if (row.rowFormat.hasValue('bottomMargin')) {\n bottomMargin = HelperMethods.convertPointToPixel(row.rowFormat.bottomMargin);\n }\n else {\n bottomMargin = HelperMethods.convertPointToPixel(row.ownerTable.tableFormat.bottomMargin);\n }\n if (bottomMargin > value) {\n value = bottomMargin;\n }\n }\n return value;\n }", "function getPaddings(element) {\n var section = element.closest(SECTION_SEL);\n if (section.length) {\n return parseInt(section.css('padding-bottom')) + parseInt(section.css('padding-top'));\n }\n return 0;\n }", "bottomRow() {\n return INDEX2ROW(this.bottomRight);\n }", "function giveFooterSomeRoom() {\n footer = $('footer#footer');\n padding = footer.outerHeight();\n $('body').css('padding-bottom',padding);\n // console.log('padding applied');\n }", "function footerBottom(){\n\tvar $footer = $('.footer');\n\tif($footer.length){\n\t\tvar $tplSpacer = $('<div />', {\n\t\t\tclass: 'spacer'\n\t\t});\n\n\t\t$('.main').after($tplSpacer.clone());\n\n\t\t$(window).on('load resizeByWidth', function () {\n\t\t\tvar footerOuterHeight = $footer.outerHeight();\n\t\t\t$footer.css({\n\t\t\t\t'margin-top': -footerOuterHeight\n\t\t\t});\n\n\t\t\t$('.spacer').css({\n\t\t\t\t'height': footerOuterHeight\n\t\t\t});\n\t\t});\n\t}\n}", "updateHeightForRowWidget(viewer, isUpdateVerticalPosition, tableCollection, rowCollection, rowWidget, isLayouted, endRowWidget, isInitialLayout) {\n for (let i = 0; i < rowWidget.childWidgets.length; i++) {\n let cellspacing = 0;\n let cellWidget = undefined;\n let childWidget = rowWidget.childWidgets[i];\n // if (childWidget instanceof TableCellWidget) {\n cellWidget = childWidget;\n // }\n let rowSpan = 1;\n rowSpan = cellWidget.cellFormat.rowSpan;\n cellspacing = HelperMethods.convertPointToPixel(cellWidget.ownerTable.tableFormat.cellSpacing);\n if (rowSpan > 1) {\n let currentRowWidgetIndex = rowWidget.containerWidget.childWidgets.indexOf(rowWidget);\n // tslint:disable-next-line:max-line-length\n let rowSpanWidgetEndIndex = currentRowWidgetIndex + rowSpan - 1 - (rowWidget.index - cellWidget.rowIndex);\n if (!isInitialLayout && (viewer.clientArea.bottom < cellWidget.y + cellWidget.height + cellWidget.margin.bottom\n || rowSpanWidgetEndIndex >= currentRowWidgetIndex + 1)) {\n this.splitSpannedCellWidget(cellWidget, tableCollection, rowCollection, viewer);\n }\n let spanEndRowWidget = rowWidget;\n if (rowSpanWidgetEndIndex > 0) {\n if (rowSpanWidgetEndIndex < rowWidget.containerWidget.childWidgets.length) {\n let childWidget = rowWidget.containerWidget.childWidgets[rowSpanWidgetEndIndex];\n if (childWidget instanceof TableRowWidget) {\n spanEndRowWidget = childWidget;\n if (spanEndRowWidget === endRowWidget) {\n spanEndRowWidget = rowWidget;\n }\n }\n }\n else {\n // tslint:disable-next-line:max-line-length\n spanEndRowWidget = rowWidget.containerWidget.childWidgets[rowWidget.containerWidget.childWidgets.length - 1];\n }\n }\n if (cellWidget.y + cellWidget.height + cellWidget.margin.bottom < spanEndRowWidget.y + spanEndRowWidget.height) {\n cellWidget.height = spanEndRowWidget.y + spanEndRowWidget.height - cellWidget.y - cellWidget.margin.bottom;\n // tslint:disable-next-line:max-line-length\n }\n else if (isLayouted && spanEndRowWidget && (spanEndRowWidget.y !== 0 && spanEndRowWidget.height !== 0) && cellWidget.y + cellWidget.height + cellWidget.margin.bottom > spanEndRowWidget.y + spanEndRowWidget.height) {\n spanEndRowWidget.height = cellWidget.y + cellWidget.height + cellWidget.margin.bottom - spanEndRowWidget.y;\n // tslint:disable-next-line:max-line-length\n //Update the next rowlayout widget location. Reason for the updation is previous row height is updated when cell height is greater. So already layouted next row location has to be updated again.\n // if (rowWidget === spanEndRowWidget && rowWidget.nextWidget instanceof TableRowWidget) {\n // let nextRow: TableRowWidget = rowWidget.nextWidget as TableRowWidget;\n // // Need to update on this further\n // // if (viewer.renderedElements.containsKey(nextRow)) {\n // // let nextWidget: TableRowWidget[] = viewer.renderedElements.get(nextRow) as TableRowWidget[];\n // // if (nextWidget.length > 0) {\n // // nextWidget[0].x = nextWidget[0].x;\n // // nextWidget[0].y = rowWidget.y + rowWidget.height;\n // // }\n // // }\n // }\n }\n }\n else {\n if (cellspacing > 0) {\n // In the Case of tableWidget is greater than one and rowWidget is start at the Top Position of the page. \n // In such case we have update the cell height with half of cell spacing.\n // Remaining cases we have to update the entire hight\n // tslint:disable-next-line:max-line-length\n if (tableCollection.length > 1 && rowWidget.y === viewer.clientArea.y && viewer instanceof PageLayoutViewer) {\n cellspacing = cellspacing / 2;\n }\n }\n cellWidget.height = rowWidget.height - cellWidget.margin.top - cellWidget.margin.bottom - cellspacing;\n }\n this.updateHeightForCellWidget(viewer, tableCollection, rowCollection, cellWidget);\n let widget = rowWidget.containerWidget;\n while (widget.containerWidget instanceof Widget) {\n widget = widget.containerWidget;\n }\n let page = undefined;\n if (widget instanceof BodyWidget) {\n page = widget.page;\n }\n // tslint:disable-next-line:max-line-length\n if ((viewer instanceof PageLayoutViewer && viewer.visiblePages.indexOf(page) !== -1) || isUpdateVerticalPosition) {\n this.updateCellVerticalPosition(cellWidget, false, false);\n }\n //Renders the current table row contents, after relayout based on editing.\n // if (viewer instanceof PageLayoutViewer && (viewer as PageLayoutViewer).visiblePages.indexOf(page) !== -1) {\n // //Added proper undefined condition check for Asynchronous operation.\n // if (!isNullOrUndefined(rowWidget.tableRow) && !isNullOrUndefined(rowWidget.tableRow.rowFormat)) {\n // this.viewer.updateScrollBars();\n // //this.render.renderTableCellWidget(page, cellWidget);\n // }\n // }\n }\n }", "function convertFrontEndPadding() {\r\n\t\t\t\t\t\r\n\t\t\t\t\t$('.vc_element > .wpb_column[class*=\"padding-\"][class*=\"-percent\"]').each(function() {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar $elPaddingPercent = 4;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar elclassName = this.className.match(/padding-\\d+/);\r\n\t\t\t\t\t\tif (elclassName) {\r\n\t\t\t\t\t\t\t$elPaddingPercent = elclassName[0].match(/\\d+/);\r\n\t\t\t\t\t\t\tif ($elPaddingPercent) {\r\n\t\t\t\t\t\t\t\t$elPaddingPercent = $elPaddingPercent[0] / 100;\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$elPaddingPercent = 0;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ($elPaddingPercent) {\r\n\t\t\t\t\t\t\tvar $parentRowWidth = $(this).parents('.span_12').width();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif ($(this).is('[data-padding-pos=\"all\"]')) {\r\n\t\t\t\t\t\t\t\t$(this).css('padding', $parentRowWidth * $elPaddingPercent);\r\n\t\t\t\t\t\t\t} else if ($(this).is('[data-padding-pos=\"top\"]')) {\r\n\t\t\t\t\t\t\t\t$(this).css('padding-top', $parentRowWidth * $elPaddingPercent);\r\n\t\t\t\t\t\t\t} else if ($(this).is('[data-padding-pos=\"bottom\"]')) {\r\n\t\t\t\t\t\t\t\t$(this).css('padding-bottom', $parentRowWidth * $elPaddingPercent);\r\n\t\t\t\t\t\t\t} else if ($(this).is('[data-padding-pos=\"left\"]')) {\r\n\t\t\t\t\t\t\t\t$(this).css('padding-left', $parentRowWidth * $elPaddingPercent);\r\n\t\t\t\t\t\t\t} else if ($(this).is('[data-padding-pos=\"right\"]')) {\r\n\t\t\t\t\t\t\t\t$(this).css('padding-right', $parentRowWidth * $elPaddingPercent);\r\n\t\t\t\t\t\t\t} else if ($(this).is('[data-padding-pos=\"top-bottom\"]')) {\r\n\t\t\t\t\t\t\t\t$(this).css({\r\n\t\t\t\t\t\t\t\t\t'padding-top': $parentRowWidth * $elPaddingPercent,\r\n\t\t\t\t\t\t\t\t\t'padding-bottom': $parentRowWidth * $elPaddingPercent,\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t} else if ($(this).is('[data-padding-pos=\"top-right\"]')) {\r\n\t\t\t\t\t\t\t\t$(this).css({\r\n\t\t\t\t\t\t\t\t\t'padding-top': $parentRowWidth * $elPaddingPercent,\r\n\t\t\t\t\t\t\t\t\t'padding-right': $parentRowWidth * $elPaddingPercent,\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t} else if ($(this).is('[data-padding-pos=\"bottom-right\"]')) {\r\n\t\t\t\t\t\t\t\t$(this).css({\r\n\t\t\t\t\t\t\t\t\t'padding-right': $parentRowWidth * $elPaddingPercent,\r\n\t\t\t\t\t\t\t\t\t'padding-bottom': $parentRowWidth * $elPaddingPercent,\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t} else if ($(this).is('[data-padding-pos=\"bottom-left\"]')) {\r\n\t\t\t\t\t\t\t\t$(this).css({\r\n\t\t\t\t\t\t\t\t\t'padding-left': $parentRowWidth * $elPaddingPercent,\r\n\t\t\t\t\t\t\t\t\t'padding-bottom': $parentRowWidth * $elPaddingPercent,\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t} else if ($(this).is('[data-padding-pos=\"left-right\"]')) {\r\n\t\t\t\t\t\t\t\t$(this).css({\r\n\t\t\t\t\t\t\t\t\t'padding-left': $parentRowWidth * $elPaddingPercent,\r\n\t\t\t\t\t\t\t\t\t'padding-right': $parentRowWidth * $elPaddingPercent,\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}\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\t$('.wpb_row[class*=\"vc_custom_\"]').each(function() {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$(this).parent().addClass('no-bottom-margin');\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}", "_getExtraBottomWidth(_id) {\n return this._getExtraSize(_id, 'bottom');\n }", "_getExtraBottomWidth(_id) {\n return this._getExtraSize(_id, 'bottom');\n }", "get _physicalBottom(){return this._physicalTop+this._physicalSize}", "pad() {\n const paddedGame = Game.duplicate(this);\n\n // add empty rows to top and bottom of grid\n paddedGame.cells[this.origin.y - 1] = {};\n paddedGame.cells[this.origin.y + this.height] = {};\n\n // update Game dimensions\n paddedGame.width += 2;\n paddedGame.height += 2;\n paddedGame.origin.x--;\n paddedGame.origin.y--;\n\n return paddedGame;\n }", "get yAxisAnnotationPaddingBottom() {\r\n return this.i.nl;\r\n }", "putBottom(b, xOffset = 0, yOffset = 0) {\n let a = this\n b.x = (a.x + a.halfWidth - b.halfWidth) + xOffset\n b.y = (a.y + b.height) + yOffset\n }", "function getABbounds (artboard, padding) { \n\tvar activeAB = artboard;\n\tvar margins = padding;\n\t\n\tvar abBounds = activeAB.artboardRect; // get bounds [left, top, right, bottom]\n\tvar ableft = abBounds[0]-margins;\n\tvar abtop = abBounds[1]+margins;\n\tvar abright = abBounds[2]+margins;\n\tvar abbottom = abBounds[3]-margins;\n\n\tvar abwidth = abright-ableft;\n\tvar abheight = abtop-abbottom;\n\n\treturn AB = {left:ableft, top:abtop, width:abwidth, height:abheight};\n}", "_createRectanglesFixedToBottom(options) {\n let { n, colours, minHeight, maxHeight, compressedHeight, speed, stroke } = options;\n // Set optional params\n minHeight = minHeight === undefined ? this.MIN_HEIGHT : minHeight;\n maxHeight = maxHeight === undefined ? this.MAX_HEIGHT : maxHeight;\n compressedHeight = compressedHeight === undefined ? this.COMPRESSED_HEIGHT : compressedHeight;\n speed = speed === undefined ? this.AMP_SPEED : speed;\n\n const width = this.canvas.width / n;\n const filled = true;\n\n for (let i = 0; i < n; i++) {\n const x = width * i;\n const height = (Math.random() * (maxHeight - minHeight)) + minHeight;\n const y = this.canvas.height - height;\n const colour = colours === undefined ? randomRGBAColour() : randomColour(colours);\n this.makeRectangle({ x, y, width, height, minHeight: compressedHeight, colour, filled, speed, stroke });\n }\n }", "function resizegridReason() {\r\n var offsetbottom = parseInt($(window).height()) - parseInt($('#grid').offset().top);\r\n var gridElement = $(\"#grid\"),\r\n dataArea = gridElement.find(\".k-grid-content\"),\r\n otherElements = gridElement.children().not(\".k-grid-content\"),\r\n otherElementsHeight = 0;\r\n otherElements.each(function () {\r\n otherElementsHeight += $(this).outerHeight();\r\n });\r\n dataArea.height(offsetbottom - otherElementsHeight - 1);\r\n}", "function removeBorders() {\n for (let i = 0; i < resultingMap.length; i++) {\n for (let j = 0; j < resultingMap[i].length; j++) {\n if (i <= 5 || j <= 5 || i + 5 >= resultingMap.length || j + 5 >= resultingMap[i].length) {\n resultingMap[i][j] = 1.5;\n continue;\n }\n }\n }\n }", "bottom(value = '') {\n this._topOffset = '';\n this._bottomOffset = value;\n this._alignItems = 'flex-end';\n return this;\n }", "function moveAllToBottom() {\n\tvar moved = false;\n\tfor (var c = 0; c < 4 ; c++ ) {\n\t\tvar s = 3;\n\t\tfor (var r = 3; r >= 0 ; r-- ) {\n\t\t\tif (!isCellEmpty(r, c)) {\n\t\t\t\tif (r != s) {\n\t\t\t\t\tmoved = true;\n\t\t\t\t\tsetGridNumRC(s, c, grid[r][c]);\n\t\t\t\t\tsetEmptyCell(r, c);\n\t\t\t\t}\n\t\t\t\ts--;\n\t\t\t}\n\t\t}\n\t}\n\treturn moved;\n}", "get _physicalBottom(){return this._physicalTop+this._physicalSize;}", "function getPaddings(element){\n var section = element.closest(SECTION_SEL);\n if(section.length){\n return parseInt(section.css('padding-bottom')) + parseInt(section.css('padding-top'));\n }\n return 0;\n }", "function cookData(array, rowPadding) {\n\t\t\n\t\tvar prev = {i: 0, h: 0, y: 0};\n\t\tvar first = array[0];\n\t\t\n\t\t// discover custom attributes\n\t\tvar attributes = [];\n\t\tfor(key in first) {\n\t\t\tif(!(key in prev)) {\n\t\t\t\tattributes.push(key);\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(var i = 0; i < array.length; i++) {\n\t\t\tvar item = array[i];\n\t\t\t\n\t\t\t// copy attributes forward\n\t\t\tfor(var a = 0; a < attributes.length; a++) {\n\t\t\t\tvar attr = attributes[a];\n\t\t\t\tif(!(attr in item)) {\n\t\t\t\t\titem[attr] = prev[attr];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// copy height forward + ensure requested padding\n\t\t\tif(item.h) {\n\t\t\t\titem.h += rowPadding;\n\t\t\t} else {\n\t\t\t\titem.h = prev.h;\n\t\t\t}\n\t\t\t\n\t\t\t// calculate segment height & spanned indices\n\t\t\tvar span = item.i - prev.i;\n\t\t\titem.y = prev.y + span * prev.h;\n\t\t\t\n\t\t\tprev.last = item.i;\n\t\t\tprev.lastY = item.y;\n\t\t\tprev = item;\n\t\t}\n\t\t\n\t\t// last item needs to be given explicitly\n\t\tvar lastEntry = array[array.length - 1];\n\t\tarray.last = lastEntry.i;\n\t\tlastEntry.last = lastEntry.i + 1;\n\n\t\tvar lastSpan = lastEntry.last - lastEntry.i;\n\t\tvar totalHeight = lastEntry.y + lastEntry.h * lastSpan;\n\t\tlastEntry.lastY = totalHeight;\n\t\t\n\t\treturn totalHeight;\n\t}", "_fillBottomLineAtCells(x, y, width = 1) {\n this._ctx.fillRect(x * this._scaledCellWidth, (y + 1) * this._scaledCellHeight - window.devicePixelRatio - 1 /* Ensure it's drawn within the cell */, width * this._scaledCellWidth, window.devicePixelRatio);\n }", "_fillBottomLineAtCells(x, y, width = 1) {\n this._ctx.fillRect(x * this._scaledCellWidth, (y + 1) * this._scaledCellHeight - window.devicePixelRatio - 1 /* Ensure it's drawn within the cell */, width * this._scaledCellWidth, window.devicePixelRatio);\n }", "updateRowHeightByCellSpacing(tableCollection, row, viewer) {\n if (row.ownerTable.tableFormat.cellSpacing > 0) {\n // In the Case of tableWidget is greater than one and rowWidget is start at the Top Position of the page. \n // In such case we have update the row height with half of cell spacing.\n // Remaining cases we have to update the entire hight\n // tslint:disable-next-line:max-line-length\n if (tableCollection.length > 1 && row.y === viewer.clientArea.y && viewer instanceof PageLayoutViewer) {\n row.height = row.height - HelperMethods.convertPointToPixel(row.ownerTable.tableFormat.cellSpacing) / 2;\n }\n }\n }", "function alterBorder() {\r\n var scrollTable = query(queryText)[0];\r\n if (scrollTable.offsetHeight >= visibleAreaHeight) { //scrollbar visible & active\r\n //dont want a border on final row, if an odd row\r\n var lastRow = query(\".odd-last-row\", scrollTable)[0];\r\n if (typeof lastRow != \"undefined\") {\r\n domClass.add(lastRow, \"no-bottom-border\");\r\n }\r\n }\r\n else if (scrollTable.offsetHeight < visibleAreaHeight) { //scrollbar visible & inactive\r\n //we want a border on final row, if an even row\r\n var lastRow = query(\".even-last-row\", scrollTable)[0];\r\n if (typeof lastRow != \"undefined\") {\r\n domClass.add(lastRow, \"add-bottom-border\");\r\n }\r\n }\r\n else {\r\n curam.debug.log(\"curam.util.alterScrollableListBottomBorder: \" \r\n + bundle.getProperty(\"curam.util.code\"));\r\n }\r\n }", "function autoHeight() {\n var bodyHeight = $(\"body\").height();\n var vwptHeight = $(window).height();\n var footer = $(\"#footer\").height()\n var gap = vwptHeight - bodyHeight;\n if (vwptHeight > bodyHeight) {\n $(\"#dime\").css( \"padding-bottom\" , gap );\n } else {\n $(\"#dime\").css( \"padding-bottom\" , \"0\" );\n }\n}", "function dropRows() {\n var x, y;\n var bottomEmptyRow = null;\n for (y = 0; y < board.BOARD_HEIGHT; ++y) {\n if (isRowEmpty(y)) {\n // Only set the bottom row if it started out as null\n if (null === bottomEmptyRow) {\n bottomEmptyRow = y;\n }\n } else if (bottomEmptyRow !== null) {\n // move the row down\n for (x = 0; x < board.BOARD_WIDTH; ++x) {\n board.space[x][bottomEmptyRow] = board.space[x][y];\n board.space[x][y] = board.SKY;\n }\n bottomEmptyRow += 1;\n }\n }\n }", "function changeGridConsoleRowHeight(newHeight) {\n var allm = document.getElementById('allmain');\n var navHeight = document.getElementById('nav').clientHeight + 'px';\n\n allm.style.gridTemplateRows = navHeight + ' ' + 'auto' + ' 10px ' + newHeight;\n}", "function setDynamicTopPadding(){ \n var $topNav_Container = $('div#topNav_Container');\n var topNav_Container_h = $topNav_Container.height();\n\n $(\"#topNav\").css(\"height\", topNav_Container_h+'px');\n $(\"#footer\").css(\"height\", topNav_Container_h+'px');\n $('.page2').css(\"height\", topNav_Container_h+'px');\n $('.page3').css(\"height\", topNav_Container_h+'px');\n $(\"#page1_inner\").css(\"margin-top\", topNav_Container_h+'px');\n\n var windowHeight = $(window).height();\n \n //for page 1\n var page1_inner_h = windowHeight - topNav_Container_h;\n $('#page1_inner').css(\"height\", page1_inner_h+'px');\n \n //for page 2\n $('#page2_inner').css(\"height\", windowHeight - topNav_Container_h+'px');\n\n //for page 3\n $('#page3_inner').css(\"height\", windowHeight - topNav_Container_h+'px');\n}", "fillAbove(newTop) {\n const me = this,\n fillHeight = newTop - me.topRow.top - me.prependBufferHeight;\n\n let accumulatedHeight = 0;\n\n while (accumulatedHeight > fillHeight && me.topIndex > 0) {\n // We want to show prev record at top of rows\n accumulatedHeight -= me.displayRecordAtTop();\n }\n }", "_updatePosFromBottom() {\n this._topLeft = this._bottomRight.$subtract(this._size);\n this._updateCenter();\n }", "setBottom(bottom) {\n this.setTop(bottom - this.offsetHeight);\n }", "innerHeightDependsOnChilds(){if(this.__controlStretchedHeight)return!0;if(this.__rowOptions)for(const rowOption of this.__rowOptions)if(\"Content\"===rowOption.heightMode)return!0;return super.innerHeightDependsOnChilds()}", "function breakHeight(bp) {\n bp == 'xs' ? y = 250 : y = 500;\n return y;\n }", "function BottomBorder(BottomBorderX,BottomBorderY){\n fill(0,0,255);\n rect(BottomBorderX,BottomBorderY,1300,1000);\n}", "function updatePadding(selection, root) {\n var textNode = selection.items[0].text ? selection.items[0] : selection.items[1];\n var rectNode = selection.items[0].text ? selection.items[1] : selection.items[0];\n\n // Extract H/V padding values from layer name\n var settings = rectNode.name.split(/[ ,]+/);\n var paddingW = parseFloat(settings[0]);\n var paddingH = parseFloat(settings[1]);\n\n var contentBounds = textNode.boundsInParent;\n rectNode.resize(contentBounds.width + paddingW*2, contentBounds.height + paddingH*2);\n rectNode.placeInParentCoordinates(rectNode.localBounds, { // move frame's visual top left to appropriate place\n x: contentBounds.x - paddingW,\n y: contentBounds.y - paddingH\n });\n}", "function establecerPaddingLateralContenedor(contenedor, padding) {\r\n\tcontenedor.style.paddingRight = padding;\r\n\tcontenedor.style.paddingLeft = padding;\r\n}", "get _physicalBottom() {\n return this._physicalTop + this._physicalSize;\n }", "function eltdSetContentBottomMargin(){\n var uncoverFooter = $('.eltd-footer-uncover');\n\n if(uncoverFooter.length){\n $('.eltd-content').css('margin-bottom', $('.eltd-footer-inner').height());\n }\n }", "function calcBoxHeight(data) {\n const line_height =\n (LINE_HEIGHT + LINE_VERTICAL_PAD) * data.lines.length + LINE_VERTICAL_PAD;\n // 4 lines means 5 paddings -> n lines means n+1 pads -> + LINE_VERTICAL_PAD\n return line_height;\n}", "function adjustMargins() {\n detectSpacesIn(body);\n} //Initiate recursion:", "function paddingBody() {\n\tvar styles = {\n \"padding-top\":padding\n\t\t};\n $('body').css(styles);\n}", "function setUiGridHeight( ) {\r\n\t\t// apply shadow\r\n\t\t$( '#patientvaluesmultihistory' ).find( '> div:first' ).addClass( 'ui-shadow' );\r\n\t\tvar windowsheight = $( window ).height( );\r\n\t\t/*\r\n\t\t * Random number are paddings and margins of parents and grandparents\r\n\t\t */\r\n\t\tvar allowedHeight = windowsheight - ( windowsheight / 10 + 44 + 30 + 39 + 30 + 100 );\r\n\t\tvar uiBlockHeight = $( '#multi_values_history' ).height( );\r\n\t\tif ( uiBlockHeight > allowedHeight ) {\r\n\t\t\t$( '#values_history_terms' ).height( allowedHeight );\r\n\t\t}\r\n\t}", "_adjustHeightValue(currentHeight) {\n const that = this,\n itemsCount = that._items.length;\n let expandedItem, collapsedItem;\n\n for (let i = 0; i < itemsCount; i++) {\n that._items[i].expanded ? expandedItem = that._items[i] : collapsedItem = that._items[i];\n\n if (expandedItem && collapsedItem) {\n break;\n }\n }\n\n if (!expandedItem) {\n expandedItem = that._items[0];\n }\n\n if (!expandedItem && !collapsedItem) {\n return;\n }\n\n const expandedItemState = expandedItem.expanded;\n\n expandedItem.expanded = true;\n\n const expandedStyles = window.getComputedStyle(expandedItem, null),\n collapsedStyles = collapsedItem ? window.getComputedStyle(collapsedItem, null) : false,\n expandedOffset = parseInt(expandedStyles.getPropertyValue('margin-top')) + parseInt(expandedStyles.getPropertyValue('margin-bottom')),\n collapsedOffset = collapsedStyles ? parseInt(collapsedStyles.getPropertyValue('margin-top')) + parseInt(collapsedStyles.getPropertyValue('margin-bottom')) : 0;\n\n expandedItem.expanded = expandedItemState;\n\n return (currentHeight - ((itemsCount - 1) * collapsedOffset + expandedOffset));\n }", "function checkBottom(){\n var count = 0\n var y = Game.Renderer.canvas.height()-blockheight\n //Loop through board bottom blocks\n for(var x=0; x<Game.Renderer.canvas.width(); x+=blockwidth){\n //Loop through taken blocks and count bottom one\n for(var b=0; b<field.length; b++){\n if (field[b][0]===x && field[b][1]===y) {\n count++\n }\n }\n }\n \n if (count===10) {return true}\n return false\n \n }", "function isPadding(cell) {\n return cell[3];\n }", "get bottom() { return this.top + this.height; }", "set BottomCenter(value) {}", "function setContentBottomMargin(){\n\tif($j('.uncover').length){\n $j('.content').css('margin-bottom', $j('footer').height());\n\t}\n}", "setVirtualHeight() {\n if (!this.settings.virtualized || !this.virtualRange) {\n return;\n }\n\n const bottom = this.virtualRange.totalHeight - this.virtualRange.bottom;\n const vTop = this.virtualRange.top;\n\n this.topSpacer = this.tableBody.find('.datagrid-virtual-row-top');\n this.bottomSpacer = this.tableBody.find('.datagrid-virtual-row-bottom');\n\n if (vTop > 0 && !this.topSpacer.length) {\n this.topSpacer = $(`<tr class=\"datagrid-virtual-row-top\" style=\"height: ${vTop}px\"><td colspan=\"${this.visibleColumns().length}\"></td></tr>`);\n this.tableBody.prepend(this.topSpacer);\n }\n\n if (vTop > 0 && this.topSpacer.length) {\n this.topSpacer.css('height', `${vTop}px`);\n }\n\n if (vTop === 0 && (this.topSpacer.length || this.virtualRange.topRow <= 1)) {\n this.topSpacer.remove();\n }\n\n if (bottom > 0 && !this.bottomSpacer.length) {\n this.bottomSpacer = $(`<tr class=\"datagrid-virtual-row-bottom\" style=\"height: ${bottom}px\"><td colspan=\"${this.visibleColumns().length}\"></td></tr>`);\n this.tableBody.append(this.bottomSpacer);\n }\n\n if (bottom > 0 && this.bottomSpacer.length) {\n this.bottomSpacer.css('height', `${bottom}px`);\n }\n\n if (bottom <= 0 && (this.bottomSpacer.length ||\n (this.virtualRange.bottomRow >= this.settings.dataset.length))) {\n this.bottomSpacer.remove();\n }\n }", "function brickLineBottom() {\n ctx.fillStyle = '#000';\n ctx.save();\n ctx.fillRect(0, canvas.height - 2, canvas.width, 2);\n ctx.fillRect(0, canvas.height - 8, canvas.width, 2);\n ctx.fillRect(0, canvas.height - 14, canvas.width, 2);\n ctx.fillRect(0, canvas.height - 20, canvas.width, 2);\n }", "function Ba(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var a=e.widgets[t],n=a.node.parentNode;n&&(a.height=n.offsetHeight)}}", "function makeThemLineUpNormallyInRowsWhyIsThisSoHard() {\n // The heights of each key in a single row.\n var heights = [],\n // The top position of keys in the current row.\n currentTop = false,\n // The 0-based index of the key at the start of the current row.\n startOfLineIdx = 0;\n\n $('.key-line').each(function(idx){\n var keyTop = $(this).position().top;\n\n if (currentTop !== false && currentTop !== keyTop) {\n // This key is at the start of a new row.\n // So give all keys in the previous row the height of the tallest\n // key in the row.\n $('.key-line').slice(startOfLineIdx,idx).height(d3.max(heights)); \n heights = [];\n startOfLineIdx = idx;\n } else if ((idx+1) == $('.key-line').length && heights.length > 0) {\n // The last element on the final row.\n // So give all keys in the final row the height of the tallest in it.\n $('.key-line').slice(startOfLineIdx,idx).height(d3.max(heights)); \n };\n \n heights.push($(this).height());\n currentTop = keyTop;\n });\n }", "function tableHeaderHeightCalc() {\n var tableHeader = $('.tabled-page .tp-header');\n var tableHeaderHeight = tableHeader.outerHeight() - parseInt(tableHeader.css('padding-top'));\n $('.tabled-page-pt').css('padding-top', tableHeaderHeight + 'px')\n}", "function equalizeHeight()\n{\n\tvar boxHeight = 0;\n\n\t$(\".eq-height\").removeAttr(\"style\");\n\n\t$(\".row\").each(function(){\n\n\t\t$(this).find(\".eq-height\").each(function(){\n\t\t\tvar currentBoxHeight = $(this).innerHeight();\n\t\t\tif(currentBoxHeight > boxHeight) boxHeight = currentBoxHeight;\n\t\t});\n\n\t\t$(this).find(\".eq-height\").css({\"height\":boxHeight-51+\"px\"});\n\t\t$(\".container\").css({\"height\":boxHeight+\"px\"});\n\n\t});\n}", "function pad(nodes) {\n var tail = nodes[nodes.length - 1]\n\n if (typeof tail === 'string' && tail.charAt(tail.length - 1) === '\\n') {\n nodes.push(h('br', {key: 'break'}))\n }\n\n return nodes\n }", "function undistributeHeight(els) {\n els.height('');\n}", "function undistributeHeight(els) {\n els.height('');\n}", "function undistributeHeight(els) {\n els.height('');\n}", "function undistributeHeight(els) {\n els.height('');\n}", "function pinToBottom(parentContainer, targetElement) {\n var newTopMargin = getTopMargin(parentContainer, targetElement);\n\n $(targetElement).css({\n \"top\": newTopMargin\n });\n }" ]
[ "0.65102696", "0.64933133", "0.64693046", "0.6463907", "0.64283013", "0.61329925", "0.59519887", "0.594856", "0.5911237", "0.5834037", "0.58103055", "0.57260495", "0.56416744", "0.5638245", "0.5634252", "0.56075853", "0.56075853", "0.5583646", "0.5534791", "0.5528559", "0.5520273", "0.55128086", "0.5468927", "0.54356194", "0.54231673", "0.5389102", "0.53784734", "0.5372472", "0.5337681", "0.53059864", "0.5305788", "0.5276613", "0.52693325", "0.52583003", "0.5248264", "0.52461207", "0.52415246", "0.52352786", "0.5232346", "0.5224931", "0.5221562", "0.5212967", "0.52113444", "0.52076274", "0.51995194", "0.5185195", "0.5185195", "0.51776195", "0.51635957", "0.5156037", "0.51440233", "0.51310253", "0.51285005", "0.5124416", "0.5122303", "0.5121959", "0.51161224", "0.51153594", "0.51083577", "0.5094812", "0.50859207", "0.50859207", "0.5085771", "0.5081534", "0.50767595", "0.5075898", "0.5075183", "0.5053912", "0.50411505", "0.50406", "0.5035043", "0.50202614", "0.50152737", "0.5014155", "0.5001427", "0.49930564", "0.49930564", "0.49862573", "0.4979912", "0.4976399", "0.49724317", "0.49684882", "0.4959733", "0.4959541", "0.49581963", "0.49577704", "0.49416357", "0.49394065", "0.49105278", "0.49069947", "0.49000633", "0.4895425", "0.48893747", "0.48891112", "0.4876978", "0.48711932", "0.48711932", "0.48711932", "0.48711932", "0.48615053" ]
0.6462671
4
adjusts the paddingbottom value of all regions in upper rows to match the value of the tallest region in the row
function adjustUpperRowRegionsHeight(row) { // when called by each, first argument is a number instead of a row value var row = (typeof row === 'number') ? $(this) : row; resetRowsRegionsHeight(row); // sets total region height to the height of tallest region setRowsRegionsHeight(row, getRowRegionsMaxHeight(row)); // refresh sortables cached positions getNonLockedRegions().sortable("refreshPositions"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetRowsRegionsHeight(row) {\n // when called by each, first argument is a number instead of a row value\n var row = (typeof row === 'number') ? $(this) : row;\n\n var rowChildren = $(row).children();\n for (var x = 0; x < rowChildren.length; x++) {\n // reset to 5, the initial value before dragging\n $(rowChildren.get(x)).css(\"padding-bottom\", 5);\n }\n }", "function resetRowsRegionsHeight(row) {\n // when called by each, first argument is a number instead of a row value\n var row = (typeof row === 'number') ? $(this) : row;\n\n var rowChildren = $(row).children();\n for (var x = 0; x < rowChildren.length; x++) {\n // reset to 5, the initial value before dragging\n $(rowChildren.get(x)).css(\"padding-bottom\", 5);\n }\n }", "function setRowsRegionsHeight(row, maxHeight) {\n var rowChildren = $(row).children();\n for (var x = 0; x < rowChildren.length; x++) {\n if ($(rowChildren.get(x)).outerHeight() != maxHeight) {\n var defaultPadding = parseInt($(rowChildren.get(x)).css(\"padding-bottom\").replace(\"px\", \"\"));\n $(rowChildren.get(x)).css(\"padding-bottom\", (defaultPadding + maxHeight - $(rowChildren.get(x)).outerHeight()));\n }\n }\n }", "function setRowsRegionsHeight(row, maxHeight) {\n var rowChildren = $(row).children();\n for (var x = 0; x < rowChildren.length; x++) {\n if ($(rowChildren.get(x)).outerHeight() != maxHeight) {\n var defaultPadding = parseInt($(rowChildren.get(x)).css(\"padding-bottom\").replace(\"px\", \"\"));\n $(rowChildren.get(x)).css(\"padding-bottom\", (defaultPadding + maxHeight - $(rowChildren.get(x)).outerHeight()));\n }\n }\n }", "function fullWidthRowPaddingAdjustCalc() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($('#boxed').length == 0) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$('.full-width-section[data-top-percent], .full-width-section[data-bottom-percent], .full-width-content[data-top-percent], .full-width-content[data-bottom-percent]').each(function () {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tvar $windowHeight = $window.width(),\r\n\t\t\t\t\t\t\t$topPadding = ($(this).attr('data-top-percent')) ? $(this).attr('data-top-percent') : 'skip',\r\n\t\t\t\t\t\t\t$bottomPadding = ($(this).attr('data-bottom-percent')) ? $(this).attr('data-bottom-percent') : 'skip';\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//top\r\n\t\t\t\t\t\t\tif ($topPadding != 'skip') {\r\n\t\t\t\t\t\t\t\t$(this).css('padding-top', $windowHeight * (parseInt($topPadding) / 100));\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\t//bottom\r\n\t\t\t\t\t\t\tif ($bottomPadding != 'skip') {\r\n\t\t\t\t\t\t\t\t$(this).css('padding-bottom', $windowHeight * (parseInt($bottomPadding) / 100));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "function adjustBottomRowRegionsHeight(row) {\n resetRowsRegionsHeight(row);\n var bodyHeight = $('body').outerHeight();\n var windowHeight = $(window).height();\n // Instances where no scroll bar currently exists\n if (windowHeight >= bodyHeight) {\n var pageHeight = $(\"#pageContent\").outerHeight();\n var headerHeight = bodyHeight - pageHeight;\n var upperRegionsMaxHeights = 0;\n if ($(\".upperRow\").length) {\n var rows = $(\".regions\").find(\".upperRow\");\n for (var x = 0; x < rows.length; x++) {\n var rowMaxHeight = getRowRegionsMaxHeight(rows.get(x));\n upperRegionsMaxHeights = upperRegionsMaxHeights + rowMaxHeight;\n }\n }\n // determine maximum size possible for bottom region\n // 50 px of buffer also removed to prevent scroll-bar from appearing in any cases\n var bottomPadding = (windowHeight - 50) - (upperRegionsMaxHeights + headerHeight);\n\n setRowsRegionsHeight(row, bottomPadding);\n }\n // Instances where scroll bar currently exists, can default to upper row behavior\n else {\n adjustUpperRowRegionsHeight(row);\n }\n // refresh sortables cached positions\n getNonLockedRegions().sortable(\"refreshPositions\");\n }", "function adjustBottomRowRegionsHeight(row) {\n resetRowsRegionsHeight(row);\n var bodyHeight = $('body').outerHeight();\n var windowHeight = $(window).height();\n // Instances where no scroll bar currently exists\n if (windowHeight >= bodyHeight) {\n var pageHeight = $(\"#pageContent\").outerHeight();\n var headerHeight = bodyHeight - pageHeight;\n var upperRegionsMaxHeights = 0;\n if ($(\".upperRow\").length) {\n var rows = $(\".regions\").find(\".upperRow\");\n for (var x = 0; x < rows.length; x++) {\n var rowMaxHeight = getRowRegionsMaxHeight(rows.get(x));\n upperRegionsMaxHeights = upperRegionsMaxHeights + rowMaxHeight;\n }\n }\n // determine maximum size possible for bottom region\n // 50 px of buffer also removed to prevent scroll-bar from appearing in any cases\n var bottomPadding = (windowHeight - 50) - (upperRegionsMaxHeights + headerHeight);\n\n setRowsRegionsHeight(row, bottomPadding);\n }\n // Instances where scroll bar currently exists, can default to upper row behavior\n else {\n adjustUpperRowRegionsHeight(row);\n }\n // refresh sortables cached positions\n getNonLockedRegions().sortable(\"refreshPositions\");\n }", "function adjustRowRegionsHeights() {\n // handle region areas for upper rows\n if ($(\".upperRow\").length) {\n var rows = $(\".regions\").find(\".upperRow\");\n rows.each(adjustUpperRowRegionsHeight);\n }\n\n // handle region areas for the bottom row\n if ($(\".bottomRow\").length) {\n var row = $(\".regions\").find(\".bottomRow\");\n adjustBottomRowRegionsHeight(row)\n }\n }", "function adjustRowRegionsHeights() {\n // handle region areas for upper rows\n if ($(\".upperRow\").length) {\n var rows = $(\".regions\").find(\".upperRow\");\n rows.each(adjustUpperRowRegionsHeight);\n }\n\n // handle region areas for the bottom row\n if ($(\".bottomRow\").length) {\n var row = $(\".regions\").find(\".bottomRow\");\n adjustBottomRowRegionsHeight(row)\n }\n }", "getVarPaddingBottom() {\n const {\n delta: {\n total, end, keeps, varLastCalcIndex, varAverSize\n }, size\n } = this;\n const last = total - 1;\n if (total - end <= keeps || varLastCalcIndex === last) {\n return this.getVarOffset(last) - this.getVarOffset(end);\n }\n // if unreached last zone or uncalculate real behind offset\n // return the estimate paddingBottom avoid too much calculate.\n return (total - end) * (varAverSize || size);\n }", "function calculate_padding() {\n padLeft = Math.floor((display.getWidth() - etch.getWidth()) / 2);\n padTop = Math.floor((display.getHeight() - etch.getHeight() - 5) / 2) + 1;\n}", "function adjustUpperRowRegionsHeight(row) {\n // when called by each, first argument is a number instead of a row value\n var row = (typeof row === 'number') ? $(this) : row;\n\n resetRowsRegionsHeight(row);\n\n // sets total region height to the height of tallest region\n setRowsRegionsHeight(row, getRowRegionsMaxHeight(row));\n\n // refresh sortables cached positions\n getNonLockedRegions().sortable(\"refreshPositions\");\n }", "function fullWidthRowPaddingAdjust() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (nectarDOMInfo.usingMobileBrowser) {\r\n\t\t\t\t\t\tfullWidthRowPaddingAdjustCalc();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$window.on('resize', fullWidthRowPaddingAdjustCalc);\r\n\t\t\t\t\t\r\n\t\t\t\t}", "function applyBottomBorderToGoupedValues() {\n var ss = SpreadsheetApp.getActiveSpreadsheet();\n var sheet = ss.getSheetByName('Master Inventory');\n var numColumns = sheet.getLastColumn();\n \n var columnToSearchZeroIndexed = 0;\n var rowRangesArray = getRowRangesOfGroupedValues(columnToSearchZeroIndexed);\n var numGroups = rowRangesArray.length;\n \n for (var i=0; i < numGroups; i++) {\n var firstTempRow = rowRangesArray[i][0];\n var lastTempRow = rowRangesArray[i][1];\n var numTempRows = lastTempRow - firstTempRow;\n \n var tempRange = sheet.getRange(firstTempRow, columnToSearchZeroIndexed+1, numTempRows+1, numColumns);\n tempRange.setBorder(false, false, true, false, false, false);\n }\n}", "getMaxBottomCellMargin(row) {\n if (isNullOrUndefined(row.childWidgets)) {\n return 0;\n }\n let value = 0;\n for (let i = 0; i < row.childWidgets.length; i++) {\n let cell = row.childWidgets[i];\n let bottomMargin = 0;\n if (cell.cellFormat.hasValue('bottomMargin')) {\n bottomMargin = HelperMethods.convertPointToPixel(cell.cellFormat.bottomMargin);\n }\n else if (row.rowFormat.hasValue('bottomMargin')) {\n bottomMargin = HelperMethods.convertPointToPixel(row.rowFormat.bottomMargin);\n }\n else {\n bottomMargin = HelperMethods.convertPointToPixel(row.ownerTable.tableFormat.bottomMargin);\n }\n if (bottomMargin > value) {\n value = bottomMargin;\n }\n }\n return value;\n }", "function cookData(array, rowPadding) {\n\t\t\n\t\tvar prev = {i: 0, h: 0, y: 0};\n\t\tvar first = array[0];\n\t\t\n\t\t// discover custom attributes\n\t\tvar attributes = [];\n\t\tfor(key in first) {\n\t\t\tif(!(key in prev)) {\n\t\t\t\tattributes.push(key);\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(var i = 0; i < array.length; i++) {\n\t\t\tvar item = array[i];\n\t\t\t\n\t\t\t// copy attributes forward\n\t\t\tfor(var a = 0; a < attributes.length; a++) {\n\t\t\t\tvar attr = attributes[a];\n\t\t\t\tif(!(attr in item)) {\n\t\t\t\t\titem[attr] = prev[attr];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// copy height forward + ensure requested padding\n\t\t\tif(item.h) {\n\t\t\t\titem.h += rowPadding;\n\t\t\t} else {\n\t\t\t\titem.h = prev.h;\n\t\t\t}\n\t\t\t\n\t\t\t// calculate segment height & spanned indices\n\t\t\tvar span = item.i - prev.i;\n\t\t\titem.y = prev.y + span * prev.h;\n\t\t\t\n\t\t\tprev.last = item.i;\n\t\t\tprev.lastY = item.y;\n\t\t\tprev = item;\n\t\t}\n\t\t\n\t\t// last item needs to be given explicitly\n\t\tvar lastEntry = array[array.length - 1];\n\t\tarray.last = lastEntry.i;\n\t\tlastEntry.last = lastEntry.i + 1;\n\n\t\tvar lastSpan = lastEntry.last - lastEntry.i;\n\t\tvar totalHeight = lastEntry.y + lastEntry.h * lastSpan;\n\t\tlastEntry.lastY = totalHeight;\n\t\t\n\t\treturn totalHeight;\n\t}", "function getPaddings(element) {\n var section = element.closest(SECTION_SEL);\n if (section.length) {\n return parseInt(section.css('padding-bottom')) + parseInt(section.css('padding-top'));\n }\n return 0;\n }", "function convertFrontEndPadding() {\r\n\t\t\t\t\t\r\n\t\t\t\t\t$('.vc_element > .wpb_column[class*=\"padding-\"][class*=\"-percent\"]').each(function() {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar $elPaddingPercent = 4;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar elclassName = this.className.match(/padding-\\d+/);\r\n\t\t\t\t\t\tif (elclassName) {\r\n\t\t\t\t\t\t\t$elPaddingPercent = elclassName[0].match(/\\d+/);\r\n\t\t\t\t\t\t\tif ($elPaddingPercent) {\r\n\t\t\t\t\t\t\t\t$elPaddingPercent = $elPaddingPercent[0] / 100;\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$elPaddingPercent = 0;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ($elPaddingPercent) {\r\n\t\t\t\t\t\t\tvar $parentRowWidth = $(this).parents('.span_12').width();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif ($(this).is('[data-padding-pos=\"all\"]')) {\r\n\t\t\t\t\t\t\t\t$(this).css('padding', $parentRowWidth * $elPaddingPercent);\r\n\t\t\t\t\t\t\t} else if ($(this).is('[data-padding-pos=\"top\"]')) {\r\n\t\t\t\t\t\t\t\t$(this).css('padding-top', $parentRowWidth * $elPaddingPercent);\r\n\t\t\t\t\t\t\t} else if ($(this).is('[data-padding-pos=\"bottom\"]')) {\r\n\t\t\t\t\t\t\t\t$(this).css('padding-bottom', $parentRowWidth * $elPaddingPercent);\r\n\t\t\t\t\t\t\t} else if ($(this).is('[data-padding-pos=\"left\"]')) {\r\n\t\t\t\t\t\t\t\t$(this).css('padding-left', $parentRowWidth * $elPaddingPercent);\r\n\t\t\t\t\t\t\t} else if ($(this).is('[data-padding-pos=\"right\"]')) {\r\n\t\t\t\t\t\t\t\t$(this).css('padding-right', $parentRowWidth * $elPaddingPercent);\r\n\t\t\t\t\t\t\t} else if ($(this).is('[data-padding-pos=\"top-bottom\"]')) {\r\n\t\t\t\t\t\t\t\t$(this).css({\r\n\t\t\t\t\t\t\t\t\t'padding-top': $parentRowWidth * $elPaddingPercent,\r\n\t\t\t\t\t\t\t\t\t'padding-bottom': $parentRowWidth * $elPaddingPercent,\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t} else if ($(this).is('[data-padding-pos=\"top-right\"]')) {\r\n\t\t\t\t\t\t\t\t$(this).css({\r\n\t\t\t\t\t\t\t\t\t'padding-top': $parentRowWidth * $elPaddingPercent,\r\n\t\t\t\t\t\t\t\t\t'padding-right': $parentRowWidth * $elPaddingPercent,\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t} else if ($(this).is('[data-padding-pos=\"bottom-right\"]')) {\r\n\t\t\t\t\t\t\t\t$(this).css({\r\n\t\t\t\t\t\t\t\t\t'padding-right': $parentRowWidth * $elPaddingPercent,\r\n\t\t\t\t\t\t\t\t\t'padding-bottom': $parentRowWidth * $elPaddingPercent,\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t} else if ($(this).is('[data-padding-pos=\"bottom-left\"]')) {\r\n\t\t\t\t\t\t\t\t$(this).css({\r\n\t\t\t\t\t\t\t\t\t'padding-left': $parentRowWidth * $elPaddingPercent,\r\n\t\t\t\t\t\t\t\t\t'padding-bottom': $parentRowWidth * $elPaddingPercent,\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t} else if ($(this).is('[data-padding-pos=\"left-right\"]')) {\r\n\t\t\t\t\t\t\t\t$(this).css({\r\n\t\t\t\t\t\t\t\t\t'padding-left': $parentRowWidth * $elPaddingPercent,\r\n\t\t\t\t\t\t\t\t\t'padding-right': $parentRowWidth * $elPaddingPercent,\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}\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\t$('.wpb_row[class*=\"vc_custom_\"]').each(function() {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$(this).parent().addClass('no-bottom-margin');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t}", "function getPaddings(element){\n var section = element.closest(SECTION_SEL);\n if(section.length){\n return parseInt(section.css('padding-bottom')) + parseInt(section.css('padding-top'));\n }\n return 0;\n }", "function tablePadding() {\n var header = $('.schedule-table-wrapper.active .schedule-table-stops-wrapper').height();\n $('.schedule-table-wrapper.active').css({'margin-top': header });\n $('.schedule-table-wrapper.active .schedule-table-stops-wrapper').css({'top': -header});\n }", "updateRowHeightByCellSpacing(tableCollection, row, viewer) {\n if (row.ownerTable.tableFormat.cellSpacing > 0) {\n // In the Case of tableWidget is greater than one and rowWidget is start at the Top Position of the page. \n // In such case we have update the row height with half of cell spacing.\n // Remaining cases we have to update the entire hight\n // tslint:disable-next-line:max-line-length\n if (tableCollection.length > 1 && row.y === viewer.clientArea.y && viewer instanceof PageLayoutViewer) {\n row.height = row.height - HelperMethods.convertPointToPixel(row.ownerTable.tableFormat.cellSpacing) / 2;\n }\n }\n }", "function outputPaddingAdjuster() {\n if (!tutorialSettings.libraries.turtle && !tutorialSettings.libraries.DOM && !tutorialSettings.libraries.csv && !tutorialSettings.libraries.csvAndTurtle) {\n outputBlock.style.paddingLeft = \"40px\";\n } \n else {\n if($(window).width() < 1183){\n outputBlock.style.paddingLeft = \"40px\";\n }\n }\n}", "function BottomEdge() {\n $( \"#target\" ).animate({paddingTop:\"+=310px\"});\n }", "function fixBottomWidth() {\n var percen = (($(\"span:contains('Utilization Management')\").width() / $(\".main_container\").width()) * 100) + 1;\n var val = percen * $(\".main_container\").width() * 0.013;\n $('.bottomfixed').width(($(\".main_container\").width() - val - 63) + 21);\n}", "function fixBottomWidth() {\n var percen = (($(\"span:contains('Utilization Management')\").width() / $(\".main_container\").width()) * 100) + 1;\n var val = percen * $(\".main_container\").width() * 0.013;\n $('.bottomfixed').width(($(\".main_container\").width() - val - 63) + 21);\n}", "get xAxisAnnotationPaddingBottom() {\r\n return this.i.ng;\r\n }", "updateHeightForRowWidget(viewer, isUpdateVerticalPosition, tableCollection, rowCollection, rowWidget, isLayouted, endRowWidget, isInitialLayout) {\n for (let i = 0; i < rowWidget.childWidgets.length; i++) {\n let cellspacing = 0;\n let cellWidget = undefined;\n let childWidget = rowWidget.childWidgets[i];\n // if (childWidget instanceof TableCellWidget) {\n cellWidget = childWidget;\n // }\n let rowSpan = 1;\n rowSpan = cellWidget.cellFormat.rowSpan;\n cellspacing = HelperMethods.convertPointToPixel(cellWidget.ownerTable.tableFormat.cellSpacing);\n if (rowSpan > 1) {\n let currentRowWidgetIndex = rowWidget.containerWidget.childWidgets.indexOf(rowWidget);\n // tslint:disable-next-line:max-line-length\n let rowSpanWidgetEndIndex = currentRowWidgetIndex + rowSpan - 1 - (rowWidget.index - cellWidget.rowIndex);\n if (!isInitialLayout && (viewer.clientArea.bottom < cellWidget.y + cellWidget.height + cellWidget.margin.bottom\n || rowSpanWidgetEndIndex >= currentRowWidgetIndex + 1)) {\n this.splitSpannedCellWidget(cellWidget, tableCollection, rowCollection, viewer);\n }\n let spanEndRowWidget = rowWidget;\n if (rowSpanWidgetEndIndex > 0) {\n if (rowSpanWidgetEndIndex < rowWidget.containerWidget.childWidgets.length) {\n let childWidget = rowWidget.containerWidget.childWidgets[rowSpanWidgetEndIndex];\n if (childWidget instanceof TableRowWidget) {\n spanEndRowWidget = childWidget;\n if (spanEndRowWidget === endRowWidget) {\n spanEndRowWidget = rowWidget;\n }\n }\n }\n else {\n // tslint:disable-next-line:max-line-length\n spanEndRowWidget = rowWidget.containerWidget.childWidgets[rowWidget.containerWidget.childWidgets.length - 1];\n }\n }\n if (cellWidget.y + cellWidget.height + cellWidget.margin.bottom < spanEndRowWidget.y + spanEndRowWidget.height) {\n cellWidget.height = spanEndRowWidget.y + spanEndRowWidget.height - cellWidget.y - cellWidget.margin.bottom;\n // tslint:disable-next-line:max-line-length\n }\n else if (isLayouted && spanEndRowWidget && (spanEndRowWidget.y !== 0 && spanEndRowWidget.height !== 0) && cellWidget.y + cellWidget.height + cellWidget.margin.bottom > spanEndRowWidget.y + spanEndRowWidget.height) {\n spanEndRowWidget.height = cellWidget.y + cellWidget.height + cellWidget.margin.bottom - spanEndRowWidget.y;\n // tslint:disable-next-line:max-line-length\n //Update the next rowlayout widget location. Reason for the updation is previous row height is updated when cell height is greater. So already layouted next row location has to be updated again.\n // if (rowWidget === spanEndRowWidget && rowWidget.nextWidget instanceof TableRowWidget) {\n // let nextRow: TableRowWidget = rowWidget.nextWidget as TableRowWidget;\n // // Need to update on this further\n // // if (viewer.renderedElements.containsKey(nextRow)) {\n // // let nextWidget: TableRowWidget[] = viewer.renderedElements.get(nextRow) as TableRowWidget[];\n // // if (nextWidget.length > 0) {\n // // nextWidget[0].x = nextWidget[0].x;\n // // nextWidget[0].y = rowWidget.y + rowWidget.height;\n // // }\n // // }\n // }\n }\n }\n else {\n if (cellspacing > 0) {\n // In the Case of tableWidget is greater than one and rowWidget is start at the Top Position of the page. \n // In such case we have update the cell height with half of cell spacing.\n // Remaining cases we have to update the entire hight\n // tslint:disable-next-line:max-line-length\n if (tableCollection.length > 1 && rowWidget.y === viewer.clientArea.y && viewer instanceof PageLayoutViewer) {\n cellspacing = cellspacing / 2;\n }\n }\n cellWidget.height = rowWidget.height - cellWidget.margin.top - cellWidget.margin.bottom - cellspacing;\n }\n this.updateHeightForCellWidget(viewer, tableCollection, rowCollection, cellWidget);\n let widget = rowWidget.containerWidget;\n while (widget.containerWidget instanceof Widget) {\n widget = widget.containerWidget;\n }\n let page = undefined;\n if (widget instanceof BodyWidget) {\n page = widget.page;\n }\n // tslint:disable-next-line:max-line-length\n if ((viewer instanceof PageLayoutViewer && viewer.visiblePages.indexOf(page) !== -1) || isUpdateVerticalPosition) {\n this.updateCellVerticalPosition(cellWidget, false, false);\n }\n //Renders the current table row contents, after relayout based on editing.\n // if (viewer instanceof PageLayoutViewer && (viewer as PageLayoutViewer).visiblePages.indexOf(page) !== -1) {\n // //Added proper undefined condition check for Asynchronous operation.\n // if (!isNullOrUndefined(rowWidget.tableRow) && !isNullOrUndefined(rowWidget.tableRow.rowFormat)) {\n // this.viewer.updateScrollBars();\n // //this.render.renderTableCellWidget(page, cellWidget);\n // }\n // }\n }\n }", "function equalizeHeight()\n{\n\tvar boxHeight = 0;\n\n\t$(\".eq-height\").removeAttr(\"style\");\n\n\t$(\".row\").each(function(){\n\n\t\t$(this).find(\".eq-height\").each(function(){\n\t\t\tvar currentBoxHeight = $(this).innerHeight();\n\t\t\tif(currentBoxHeight > boxHeight) boxHeight = currentBoxHeight;\n\t\t});\n\n\t\t$(this).find(\".eq-height\").css({\"height\":boxHeight-51+\"px\"});\n\t\t$(\".container\").css({\"height\":boxHeight+\"px\"});\n\n\t});\n}", "function getBottom(col) {\r\n\treturn (field[col].length - 1) * rowheight;\r\n}", "function setPad(reference, target){\n var padAmt=((reference.height() - target.height())/2);\n var styles = {\n \"padding-top\": padAmt,\n \"padding-bottom\": padAmt\n };\n target.css( styles );\n}", "function setBottomPaddingToZero() {\n\tif (window.innerWidth > 700) {\n\t\tnavigation.style.paddingBottom = \"0%\";\n\t}\n}", "function isPadding(cell) {\n return cell[3];\n }", "function getABbounds (artboard, padding) { \n\tvar activeAB = artboard;\n\tvar margins = padding;\n\t\n\tvar abBounds = activeAB.artboardRect; // get bounds [left, top, right, bottom]\n\tvar ableft = abBounds[0]-margins;\n\tvar abtop = abBounds[1]+margins;\n\tvar abright = abBounds[2]+margins;\n\tvar abbottom = abBounds[3]-margins;\n\n\tvar abwidth = abright-ableft;\n\tvar abheight = abtop-abbottom;\n\n\treturn AB = {left:ableft, top:abtop, width:abwidth, height:abheight};\n}", "function removeBorders() {\n for (let i = 0; i < resultingMap.length; i++) {\n for (let j = 0; j < resultingMap[i].length; j++) {\n if (i <= 5 || j <= 5 || i + 5 >= resultingMap.length || j + 5 >= resultingMap[i].length) {\n resultingMap[i][j] = 1.5;\n continue;\n }\n }\n }\n }", "get yAxisAnnotationPaddingBottom() {\r\n return this.i.nl;\r\n }", "function makeThemLineUpNormallyInRowsWhyIsThisSoHard() {\n // The heights of each key in a single row.\n var heights = [],\n // The top position of keys in the current row.\n currentTop = false,\n // The 0-based index of the key at the start of the current row.\n startOfLineIdx = 0;\n\n $('.key-line').each(function(idx){\n var keyTop = $(this).position().top;\n\n if (currentTop !== false && currentTop !== keyTop) {\n // This key is at the start of a new row.\n // So give all keys in the previous row the height of the tallest\n // key in the row.\n $('.key-line').slice(startOfLineIdx,idx).height(d3.max(heights)); \n heights = [];\n startOfLineIdx = idx;\n } else if ((idx+1) == $('.key-line').length && heights.length > 0) {\n // The last element on the final row.\n // So give all keys in the final row the height of the tallest in it.\n $('.key-line').slice(startOfLineIdx,idx).height(d3.max(heights)); \n };\n \n heights.push($(this).height());\n currentTop = keyTop;\n });\n }", "function calcBoxHeight(data) {\n const line_height =\n (LINE_HEIGHT + LINE_VERTICAL_PAD) * data.lines.length + LINE_VERTICAL_PAD;\n // 4 lines means 5 paddings -> n lines means n+1 pads -> + LINE_VERTICAL_PAD\n return line_height;\n}", "function tw_stretch() {\n var i = $(window).width();\n $(\".row .tw-stretch-element-inside-column\").each(function () {\n var $this = $(this),\n row = $this.closest(\".row\"),\n cols = $this.closest('[class^=\"col-\"]'),\n colsheight = $this.closest('[class^=\"col-\"]').height(),\n rect = this.getBoundingClientRect(),\n l = row[0].getBoundingClientRect(),\n s = cols[0].getBoundingClientRect(),\n r = rect.left,\n d = i - rect.right,\n c = l.left + (parseFloat(row.css(\"padding-left\")) || 0),\n u = i - l.right + (parseFloat(row.css(\"padding-right\")) || 0),\n p = s.left,\n f = i - s.right,\n styles = {\n \"margin-left\": 0,\n \"margin-right\": 0\n };\n if (Math.round(c) === Math.round(p)) {\n var h = parseFloat($this.css(\"margin-left\") || 0);\n styles[\"margin-left\"] = h - r;\n }\n if (Math.round(u) === Math.round(f)) {\n var w = parseFloat($this.css(\"margin-right\") || 0);\n styles[\"margin-right\"] = w - d;\n }\n $this.css(styles);\n });\n }", "function adjustContentPadding() {\n var topElem = document.getElementsByClassName('oj-applayout-fixed-top')[0];\n var contentElem = document.getElementsByClassName('oj-applayout-content')[0];\n var bottomElem = document.getElementsByClassName('oj-applayout-fixed-bottom')[0];\n\n if (topElem) {\n contentElem.style.paddingTop = topElem.offsetHeight+'px';\n }\n if (bottomElem) {\n contentElem.style.paddingBottom = bottomElem.offsetHeight+'px';\n }\n // Add oj-complete marker class to signal that the content area can be unhidden.\n // See the CSS demo tab to see when the content area is hidden.\n contentElem.classList.add('oj-complete');\n }", "function establecerPaddingLateralContenedor(contenedor, padding) {\r\n\tcontenedor.style.paddingRight = padding;\r\n\tcontenedor.style.paddingLeft = padding;\r\n}", "function getRowRegionsMaxHeight(row) {\n var rowChildren = $(row).children();\n var maxHeight = 100;\n for (var x = 0; x < rowChildren.length; x++) {\n if ($(rowChildren.get(x)).outerHeight() > maxHeight) {\n maxHeight = $(rowChildren.get(x)).outerHeight();\n }\n }\n return maxHeight;\n }", "function carveBottom(s, i, j) {\n if (i + 1 < (s.length)) {\n s[i][j] = s[i][j] + BOTTOM;\n s[i+1][j] = s[i+1][j] + TOP;\n }\n}", "function updatePadding(selection, root) {\n var textNode = selection.items[0].text ? selection.items[0] : selection.items[1];\n var rectNode = selection.items[0].text ? selection.items[1] : selection.items[0];\n\n // Extract H/V padding values from layer name\n var settings = rectNode.name.split(/[ ,]+/);\n var paddingW = parseFloat(settings[0]);\n var paddingH = parseFloat(settings[1]);\n\n var contentBounds = textNode.boundsInParent;\n rectNode.resize(contentBounds.width + paddingW*2, contentBounds.height + paddingH*2);\n rectNode.placeInParentCoordinates(rectNode.localBounds, { // move frame's visual top left to appropriate place\n x: contentBounds.x - paddingW,\n y: contentBounds.y - paddingH\n });\n}", "function getRowRegionsMaxHeight(row) {\n var rowChildren = $(row).children();\n var maxHeight = 100;\n for (var x = 0; x < rowChildren.length; x++) {\n if ($(rowChildren.get(x)).outerHeight() > maxHeight) {\n maxHeight = $(rowChildren.get(x)).outerHeight();\n }\n }\n return maxHeight;\n }", "_calculateSpacerSize() {\n this._totalContentHeight = this.orientation === 'horizontal' ? '' : `${this._totalContentSize}px`;\n this._totalContentWidth = this.orientation === 'horizontal' ? `${this._totalContentSize}px` : '';\n }", "function tableHeaderHeightCalc() {\n var tableHeader = $('.tabled-page .tp-header');\n var tableHeaderHeight = tableHeader.outerHeight() - parseInt(tableHeader.css('padding-top'));\n $('.tabled-page-pt').css('padding-top', tableHeaderHeight + 'px')\n}", "function pad(img, origRows, origCols) {\n\n var rows = powerOf2(origRows);\n var cols = powerOf2(origCols);\n if (rows > cols) {\n cols = rows;\n } else {\n rows = cols;\n }\n var rowDiff = rows - origRows;\n var colDiff = cols - origCols;\n\n for (var i = 0; i < rows; i++) {\n if (i == origRows) {\n origCols = 0;\n }\n for (var j = origCols; j < cols; j++) {\n if (j == 0) {\n img[i] = [];\n }\n img[i][j] = '0';\n }\n }\n}", "getMaxTopCellMargin(row) {\n if (isNullOrUndefined(row.childWidgets)) {\n return 0;\n }\n let value = 0;\n for (let i = 0; i < row.childWidgets.length; i++) {\n let cell = row.childWidgets[i];\n let topMargin = 0;\n if (cell.cellFormat.hasValue('topMargin')) {\n topMargin = HelperMethods.convertPointToPixel(cell.cellFormat.topMargin);\n }\n else if (row.rowFormat.hasValue('topMargin')) {\n topMargin = HelperMethods.convertPointToPixel(row.rowFormat.topMargin);\n }\n else {\n topMargin = HelperMethods.convertPointToPixel(row.ownerTable.tableFormat.topMargin);\n }\n if (topMargin > value) {\n value = topMargin;\n }\n }\n return value;\n }", "getXpadding(chartData, allChartData, allRenderers) {\n return 0;\n }", "function undistributeHeight(els){els.height('');}", "function fixAlignment(value) {\n return (2 * value) - 1;\n}", "_adjustHeightValue(currentHeight) {\n const that = this,\n itemsCount = that._items.length;\n let expandedItem, collapsedItem;\n\n for (let i = 0; i < itemsCount; i++) {\n that._items[i].expanded ? expandedItem = that._items[i] : collapsedItem = that._items[i];\n\n if (expandedItem && collapsedItem) {\n break;\n }\n }\n\n if (!expandedItem) {\n expandedItem = that._items[0];\n }\n\n if (!expandedItem && !collapsedItem) {\n return;\n }\n\n const expandedItemState = expandedItem.expanded;\n\n expandedItem.expanded = true;\n\n const expandedStyles = window.getComputedStyle(expandedItem, null),\n collapsedStyles = collapsedItem ? window.getComputedStyle(collapsedItem, null) : false,\n expandedOffset = parseInt(expandedStyles.getPropertyValue('margin-top')) + parseInt(expandedStyles.getPropertyValue('margin-bottom')),\n collapsedOffset = collapsedStyles ? parseInt(collapsedStyles.getPropertyValue('margin-top')) + parseInt(collapsedStyles.getPropertyValue('margin-bottom')) : 0;\n\n expandedItem.expanded = expandedItemState;\n\n return (currentHeight - ((itemsCount - 1) * collapsedOffset + expandedOffset));\n }", "function breakHeight(bp) {\n bp == 'xs' ? y = 250 : y = 500;\n return y;\n }", "bottomRow() {\n return INDEX2ROW(this.bottomRight);\n }", "get fixedBottomGap() { return this._fixedBottomGap; }", "fillBelow(newTop) {\n const me = this,\n fillHeight = newTop - me.topRow.top - me.prependBufferHeight,\n recordCount = me.store.count,\n rowCount = me.rowCount;\n\n let accumulatedHeight = 0;\n\n // Repeat until we have filled empty height\n while (\n accumulatedHeight < fillHeight && // fill empty height\n me.topIndex + rowCount < recordCount && // as long as we have records left\n me.topRow.top + me.topRow.offsetHeight < newTop // and do not run move top row fully into view (can happen with var row height)\n ) {\n // We want to show next record at bottom of rows\n accumulatedHeight += me.displayRecordAtBottom();\n }\n }", "function fixGap() {\n const navPanel = document.querySelector(`td[valign=\"bottom\"]`);\n navPanel.removeAttribute(\"valign\");\n navPanel.removeAttribute(\"align\");\n}", "function changePadding(){\n //get margin size and check for need here\n //var pl = document.getElementById('grid-container').style.paddingLeft;\n //document.getElementById(\"display\").innerHTML = pl;\n \n var pads = 0;\n var id3 = setInterval(frame, 30);\n function frame() {\n if (pads == 30){ clearInterval(id3); }\n else {\n pads++;\n document.getElementById(\"grid-container\").style.paddingLeft = 30-pads + \"vw\";\n document.getElementById(\"grid-container\").style.paddingRight = 30-pads + \"vw\";\n }\n }\n}", "pad() {\n const paddedGame = Game.duplicate(this);\n\n // add empty rows to top and bottom of grid\n paddedGame.cells[this.origin.y - 1] = {};\n paddedGame.cells[this.origin.y + this.height] = {};\n\n // update Game dimensions\n paddedGame.width += 2;\n paddedGame.height += 2;\n paddedGame.origin.x--;\n paddedGame.origin.y--;\n\n return paddedGame;\n }", "function adjustMargins() {\n detectSpacesIn(body);\n} //Initiate recursion:", "get _physicalBottom(){return this._physicalTop+this._physicalSize}", "get _physicalBottom(){return this._physicalTop+this._physicalSize;}", "function lnhgt(){\n var lnhite = Math.round((($( window ).height())/3)-50);\n$('.linespace').css('height', lnhite);\n\n}", "function setDynamicTopPadding(){ \n var $topNav_Container = $('div#topNav_Container');\n var topNav_Container_h = $topNav_Container.height();\n\n $(\"#topNav\").css(\"height\", topNav_Container_h+'px');\n $(\"#footer\").css(\"height\", topNav_Container_h+'px');\n $('.page2').css(\"height\", topNav_Container_h+'px');\n $('.page3').css(\"height\", topNav_Container_h+'px');\n $(\"#page1_inner\").css(\"margin-top\", topNav_Container_h+'px');\n\n var windowHeight = $(window).height();\n \n //for page 1\n var page1_inner_h = windowHeight - topNav_Container_h;\n $('#page1_inner').css(\"height\", page1_inner_h+'px');\n \n //for page 2\n $('#page2_inner').css(\"height\", windowHeight - topNav_Container_h+'px');\n\n //for page 3\n $('#page3_inner').css(\"height\", windowHeight - topNav_Container_h+'px');\n}", "function setNewPadding(sankeyData) {\n columnMap = new Map();\n for (const [key, value] of Object.entries(sankeyData.nodes)) {\n if (columnMap.has(value.assessment)) {\n columnMap.set(value.assessment, columnMap.get(value.assessment) + 1)\n }\n else {\n columnMap.set(value.assessment, 1);\n }\n }\n let highestValue = 0;\n for (let value of columnMap.values()) {\n if (highestValue < value) {\n highestValue = value\n }\n }\n if (highestValue > 16) {\n padding = 20;\n }\n else if (highestValue > 10) {\n padding = 30;\n }\n else {\n padding = 40;\n }\n sankey = d3.sankey()\n .size([width, height])\n .nodeId(d => d.id)\n .nodeWidth(nodeWdt)\n .nodePadding(padding)\n .nodeAlign(d3.sankeyCenter)\n .nodeSort(null);\n}", "function resizegridReason() {\r\n var offsetbottom = parseInt($(window).height()) - parseInt($('#grid').offset().top);\r\n var gridElement = $(\"#grid\"),\r\n dataArea = gridElement.find(\".k-grid-content\"),\r\n otherElements = gridElement.children().not(\".k-grid-content\"),\r\n otherElementsHeight = 0;\r\n otherElements.each(function () {\r\n otherElementsHeight += $(this).outerHeight();\r\n });\r\n dataArea.height(offsetbottom - otherElementsHeight - 1);\r\n}", "function centerGrid() {\n if ($(\"#grid\").height() + 40 > $(window).height()) {\n $(\"#experience\").css(\"padding\", \"60px 0px 0px 5px\");\n } else {\n $(\"#experience\").css(\"padding\", \"0px\");\n }\n}", "isBalanced() {\n return this.findMinHeight() >= this.findMinHeight() - 1;\n }", "function stretchCheckerboard() {\n\t\ty = $('.main-section .wrapper').outerWidth();\t\t\n\t\t$('.main-section header h3').each(function() {\n\t\t\tw = $(this).outerWidth();\n\t\t\t$(this).css({ marginRight: (y-w)%40 });\n\t\t});\n\t\t\n\t}", "function alignToolchainBoxes()\r\n{\r\n var container = $('#toolchains')[0];\r\n var toolchains = container.children;\r\n var maxHeights = { columns: 0, heights: []};\r\n \r\n maxHeights.columns = Math.floor(container.clientWidth / toolchains[0].clientWidth);\r\n\r\n // read max height per row\r\n Obj.eachElement( toolchains, function(k, v)\r\n {\r\n var i = Math.floor(k/maxHeights.columns);\r\n maxHeights.heights[i] = Math.max(maxHeights.heights[i] || 0, v.clientHeight);\r\n });\r\n // write new height per row\r\n Obj.eachElement( toolchains, function(k, v)\r\n {\r\n var i = Math.floor(k/maxHeights.columns);\r\n v.style.height = (maxHeights.heights[i] - 50) + 'px';\r\n });\r\n}", "function calculateSize(padding, maxPages) {\n return Math.min(2 * padding + 1, maxPages);\n}", "function treemapLayout_position(row, rowFixedLength, rect, halfGapWidth, flush) {\n // When rowFixedLength === rect.width,\n // it is horizontal subdivision,\n // rowFixedLength is the width of the subdivision,\n // rowOtherLength is the height of the subdivision,\n // and nodes will be positioned from left to right.\n // wh[idx0WhenH] means: when horizontal,\n // wh[idx0WhenH] => wh[0] => 'width'.\n // xy[idx1WhenH] => xy[1] => 'y'.\n var idx0WhenH = rowFixedLength === rect.width ? 0 : 1;\n var idx1WhenH = 1 - idx0WhenH;\n var xy = ['x', 'y'];\n var wh = ['width', 'height'];\n var last = rect[xy[idx0WhenH]];\n var rowOtherLength = rowFixedLength ? row.area / rowFixedLength : 0;\n\n if (flush || rowOtherLength > rect[wh[idx1WhenH]]) {\n rowOtherLength = rect[wh[idx1WhenH]]; // over+underflow\n }\n\n for (var i = 0, rowLen = row.length; i < rowLen; i++) {\n var node = row[i];\n var nodeLayout = {};\n var step = rowOtherLength ? node.getLayout().area / rowOtherLength : 0;\n var wh1 = nodeLayout[wh[idx1WhenH]] = treemapLayout_mathMax(rowOtherLength - 2 * halfGapWidth, 0); // We use Math.max/min to avoid negative width/height when considering gap width.\n\n var remain = rect[xy[idx0WhenH]] + rect[wh[idx0WhenH]] - last;\n var modWH = i === rowLen - 1 || remain < step ? remain : step;\n var wh0 = nodeLayout[wh[idx0WhenH]] = treemapLayout_mathMax(modWH - 2 * halfGapWidth, 0);\n nodeLayout[xy[idx1WhenH]] = rect[xy[idx1WhenH]] + treemapLayout_mathMin(halfGapWidth, wh1 / 2);\n nodeLayout[xy[idx0WhenH]] = last + treemapLayout_mathMin(halfGapWidth, wh0 / 2);\n last += modWH;\n node.setLayout(nodeLayout, true);\n }\n\n rect[xy[idx1WhenH]] += rowOtherLength;\n rect[wh[idx1WhenH]] -= rowOtherLength;\n} // Return [containerWidth, containerHeight] as default.", "function alignBottom (){\n\t\t\tvar selectedGr = canvas.getSelectionElement();\n\t\t\tif (!selectedGr) return;\n\t\t\tvar selectedGr = canvas.getActiveGroup();\n\t\t\tvar pointC = new fabric.Point(0,0);\n\t\t\tvar deltaY = 0;\n\t\t\tvar firstObjH = 0;\n\t\t\tvar coordY1 = 0;\n\t\t\tvar coordY2 = 0;\n\t\t\ti=0;\t\t\t\n\t\t\tselectedGr.forEachObject(function(obj) {\n\t\t\t\ti++;\n\t\t\t\tobj.setOriginX('left');\n\t\t\t\tobj.setOriginY('top');\t\t\n\t\t\t\t//console.log( i + ' Point Left = ' + obj.left );\n\t\t\t\tvar boundObj = obj.getBoundingRect();\n\t\n\t\t\t\tif (i > 1 ){\n\t\t\t\t\tpointC.y = obj.top;\n\t\t\t\t\tdeltaY = boundObj.top - coordY1;\n\t\t\t\t\tconsole.log(i + ' DELTA= ' + deltaY);\n\t\t\t\t\tpointC.x = obj.left\n\t\t\t\t\tpointC.y -= deltaY+boundObj.height-firstObjH;\t\n\t\t\t\t\tobj.setTop(pointC.y); \n \n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tcoordY1 = boundObj.top;\n\t\t\t\t\tfirstObjH = boundObj.height;\n\n\t\t\t\t}\t\t\t\t\n\t\t\t});\n\t\t\n\t\t\tcanvas.deactivateAllWithDispatch();\n\t\t\tselectGrpParam();\n\t\t\tcanvas.renderAll();\n\t\t}", "function oldOuterHeight(element){\r\n //return 100;\r\n return element.height();\r\n}", "function addPadding(arr) {\r\n var len = arr[arr.length - 1].length\r\n for (var i = 0; i < arr.length; i++) {\r\n if (arr[i].length < len) {\r\n for (var j = 0; j <= (len - arr[i].length); j++) {\r\n arr[i] = \"0\" + arr[i];\r\n }\r\n }\r\n }\r\n}", "function setNewPadding(sankeyData) {\n columnMap = new Map();\n for (const [key, value] of Object.entries(sankeyData.nodes)) {\n if (columnMap.has(value.assessment)) {\n columnMap.set(value.assessment, columnMap.get(value.assessment) + 1)\n }\n else {\n columnMap.set(value.assessment, 1);\n }\n }\n let highestValue = 0;\n for (let value of columnMap.values()) {\n if (highestValue < value) {\n highestValue = value\n }\n }\n if (highestValue > 16) {\n padding = 20;\n }\n else if (highestValue > 10) {\n padding = 30;\n }\n else {\n padding = 40;\n }\n sankey = d3.sankey()\n .size([width, height])\n .nodeId(d => d.id)\n .nodeWidth(nodeWdt)\n .nodePadding(padding)\n .nodeAlign(d3.sankeyCenter)\n .nodeSort(null);\n }", "function IsInBottomBorderRow(tree) {\n\n return +tree.getAttribute(\"data-y\") === TREE_COUNT_Y - 1;\n\n}", "function clamp(val) {\n if (val > padHeight) return padHeight - 1\n if (val < 0) return 1\n return val\n }", "function cleanPadding(pad) {\n var padding = {\n top: 0,\n left: 0,\n right: 0,\n bottom: 0\n };\n if (typeof pad === 'number') return {\n top: pad,\n left: pad,\n right: pad,\n bottom: pad\n };\n ['top', 'bottm', 'right', 'left'].forEach(function (d) {\n if (pad[d]) padding[d] == pad[d];\n });\n return padding;\n } // Size can contain width or height attibutes. If either are unset the", "function calculatePadding(element){\r\n var padding = [];\r\n //top right bottom left\r\n\r\n padding.push(parseFloat(element.css('padding-top')));\r\n padding.push(parseFloat(element.css('padding-right')));\r\n padding.push(parseFloat(element.css('padding-bottom')));\r\n padding.push(parseFloat(element.css('padding-left')));\r\n\r\n return padding;\r\n }", "_calculateSpacerSize() {\n this._totalContentHeight =\n this.orientation === 'horizontal' ? '' : `${this._totalContentSize}px`;\n this._totalContentWidth =\n this.orientation === 'horizontal' ? `${this._totalContentSize}px` : '';\n }", "_calculateSpacerSize() {\n this._totalContentHeight =\n this.orientation === 'horizontal' ? '' : `${this._totalContentSize}px`;\n this._totalContentWidth =\n this.orientation === 'horizontal' ? `${this._totalContentSize}px` : '';\n }", "function getHeight (data) {\n const ROW_SPACING = 198.125\n totalPostNum = data.length\n totalRow = (totalPostNum%stepsX !== 0) ? Math.floor(totalPostNum/stepsX) + 1 : totalPostNum/stepsX\n section_height = (ROW_SPACING * totalRow) + 110\n return section_height\n }", "function rowHeights(rows) {\n return rows.map(row => {\n return row.reduce((max, cell) => {\n return Math.max(max, cell.minHeight());\n }, 0);\n });\n}", "function arrangeScratchpad(event) {\n\tvar PADDING = 8;\n\t\n\tvar scratchPadRect = scratchpad.getBoundingClientRect();\n\tvar width = scratchPadRect.width;\n\tvar xOrigin = 5;\n\tvar yOrigin = 5;\n\t\n\tvar x = xOrigin;\n\tvar y = yOrigin;\n\t\n\tvar children = scratchpad.childNodes;\n\tvar maxHeight = 0;\n\t\n\tfor (var i = 0; i < children.length; i++) {\n\t if (children[i].nodeType != 3) {\n\t\tvar r = children[i];\n\t\t\n\t\tvar rBounding = r.getBoundingClientRect();\n\t\tif (rBounding.height > maxHeight) {\n\t\t maxHeight = rBounding.height;\n\t\t}\n\t\tr.style.top = y + \"px\";\n\t\tr.style.left = x + \"px\";\n\t\tx += rBounding.width + PADDING;\n\t\t\n\t\tif (x >= width - 25) {\n\t\t //We are going into a new row.\n\t\t x = xOrigin;\n\t\t y += maxHeight + PADDING;\n\t\t maxHeight = 0;\n\t\t}\n\t }\n\t}\n\t\n\t\n }", "function changeGridConsoleRowHeight(newHeight) {\n var allm = document.getElementById('allmain');\n var navHeight = document.getElementById('nav').clientHeight + 'px';\n\n allm.style.gridTemplateRows = navHeight + ' ' + 'auto' + ' 10px ' + newHeight;\n}", "function axisBeforePadding() {\n var _this = this;\n var axisLength = this.len,\n chart = this.chart,\n isXAxis = this.isXAxis,\n dataKey = isXAxis ? 'xData' : 'yData',\n min = this.min,\n range = this.max - min;\n var pxMin = 0,\n pxMax = axisLength,\n transA = axisLength / range,\n hasActiveSeries;\n // Handle padding on the second pass, or on redraw\n this.series.forEach(function (series) {\n if (series.bubblePadding &&\n (series.visible || !chart.options.chart.ignoreHiddenSeries)) {\n // Correction for #1673\n _this.allowZoomOutside = true;\n hasActiveSeries = true;\n var data = series[dataKey];\n if (isXAxis) {\n (series.onPoint || series).getRadii(0, 0, series);\n if (series.onPoint) {\n series.radii = series.onPoint.radii;\n }\n }\n if (range > 0) {\n var i = data.length;\n while (i--) {\n if (isNumber(data[i]) &&\n _this.dataMin <= data[i] &&\n data[i] <= _this.max) {\n var radius = series.radii && series.radii[i] || 0;\n pxMin = Math.min(((data[i] - min) * transA) - radius, pxMin);\n pxMax = Math.max(((data[i] - min) * transA) + radius, pxMax);\n }\n }\n }\n }\n });\n // Apply the padding to the min and max properties\n if (hasActiveSeries && range > 0 && !this.logarithmic) {\n pxMax -= axisLength;\n transA *= (axisLength +\n Math.max(0, pxMin) - // #8901\n Math.min(pxMax, axisLength)) / axisLength;\n [\n ['min', 'userMin', pxMin],\n ['max', 'userMax', pxMax]\n ].forEach(function (keys) {\n if (typeof pick(_this.options[keys[0]], _this[keys[1]]) === 'undefined') {\n _this[keys[0]] += keys[2] / transA;\n }\n });\n }\n }", "updateRowHeightBySpannedCell(tableWidget, row, insertIndex) {\n let rowSpan = 1;\n if (tableWidget.childWidgets.length === 0 || insertIndex === 0) {\n this.updateRowHeight(row, row);\n return;\n }\n for (let i = 0; i < row.childWidgets.length; i++) {\n let cellWidget = row.childWidgets[i];\n // tslint:disable-next-line:max-line-length\n rowSpan = (isNullOrUndefined(cellWidget) || isNullOrUndefined(cellWidget.cellFormat)) ? rowSpan : cellWidget.cellFormat.rowSpan;\n this.updateSpannedRowCollection(rowSpan, row);\n }\n if (!isNullOrUndefined(row.ownerTable)) {\n for (let i = 0; i < row.ownerTable.spannedRowCollection.length; i++) {\n if (row.ownerTable.spannedRowCollection.keys[i] === row.index) {\n // Back track to previous table row widgets and update it height if vertical merge ends with this row.\n for (let j = 0; j < insertIndex; j++) {\n let prevRowWidget = tableWidget.childWidgets[j];\n this.updateRowHeight(prevRowWidget, row);\n }\n row.ownerTable.spannedRowCollection.remove(row.ownerTable.spannedRowCollection.keys[i]);\n break;\n }\n }\n }\n }", "function section4MiddleBottom( placeholder )\n {\n // //\\\\ config\n compCol =\n {\n \"SMALL CAP\": \"#eeaa44\",\n \"MID CAP\": \"#ccaa33\",\n \"LARGE CAP\": \"#bb6600\",\n \"DEBT & CASH\": \"#ffbb99\"\n }\n // \\\\// config\n\n\n placeholder.stack = fmethods.initTopPaneCell( \"Credit Rating Breakup\" );\n //placeholder.margin = [0,0,0,0]; //todm no dice ... chart is too low ...\n\n var JSONrecord = nheap.content_data\n [ \"Page 4\" ]\n [ \"EquityMarketCap&DebtCreditRatingBreakup.txt\" ]\n [ \"EquityMarketCap\" ][0];\n\n //------------------\n // //\\\\ chart legend\n //------------------\n //var seriesData = Object.keys( JSONrecord ).map( prop => [ prop, JSONrecord[ prop ]] );\n var chartData = Object.keys( JSONrecord ).map( prop => ({ name:prop, y:JSONrecord[ prop ] }) );\n var colors = chartData.map( serie => compCol[ serie.name ] );\n var tBody = [];\n chartData.forEach( (row,rix) => {\n var ix = rix%2;\n var iy = ( rix - ix ) /2;\n tBody[iy] = tBody[iy] || [];\n\n //----------------------------------------\n // //\\\\ tedious alignments of legend cells\n //----------------------------------------\n tBody[iy][2*ix] = { image:methods.getLabelImage({\n shape:'bar', color:compCol[ row.name ]\n }),\n fit:[8,8],\n alignment:'left',\n //.second row top margin for even vert. layout\n margin:[ 0, iy?6:6, 0, 0]\n };\n tBody[iy][2*ix+1] = [\n { text:row.y.toFixed(2)+'%', fontSize:11, color:'black', bold:true,\n alignment:'left',\n //.second row top margin for even vert. layout\n margin:[ 0, iy?0:0, 0, 0],\n lineHeight:1\n },\n { text:row.name.substring(0,14), color:'#666', alignment:'left', margin:[0,0,0,0], \n lineHeight:1\n }\n ];\n //----------------------------------------\n // \\\\// tedious alignments of legend cells\n //----------------------------------------\n\n });\n //------------------\n // \\\\// chart legend\n //------------------\n\n\n\n //==============================\n // //\\\\ chart\n //==============================\n var chartPlaceholder = {\n //image: will come from export \n fit:[110,110],\n margin: [25,0,0,0]\n };\n\n placeholder.stack[1] = fmethods.layt({\n margin : [0,0,0,0],\n widths : [ '100%', '100%' ],\n pads : { left:0, top:20, right:0, bottom:0 },\n rows : 2,\n body : [\n ////layout is vertical: one column\n //.first column\n [ chartPlaceholder ],\n //.second column\n [\n fmethods.layt({\n margin : [20,0,0,0],\n widths: [ '10%', '30%', '10%', '40%' ],\n cols : 4,\n rows : 2,\n fontSize: 9,\n bordCol : '#fff',\n body : tBody\n }).tbl\n ]\n ]\n }).tbl;\n\n contCharts.push({ \n ddContRack : chartPlaceholder,\n //---------------------------\n // //\\\\ chart options\n //---------------------------\n options :\n {\n chart: {\n plotBackgroundColor: null,\n plotBorderWidth: null,\n plotShadow: false,\n type: 'pie'\n ,width: 460\n ,height: 460\n },\n\n \"exporting\": {\n \"enabled\": false\n },\n \"credits\": {\n \"enabled\": false\n },\n \n legend: {\n enabled: false,\n },\n\n title: {\n text: ''\n },\n plotOptions: {\n pie: {\n dataLabels: {\n enabled: false\n },\n colors : colors,\n showInLegend: true\n },\n series: {\n animation: false\n }\n },\n series: [{\n colorByPoint: true,\n type: 'pie',\n innerSize: '83%',\n data: chartData\n }]\n }\n //---------------------------\n // \\\\// chart options\n //---------------------------\n });\n //==============================\n // \\\\// chart\n //==============================\n\n\n\n return placeholder;\n }", "gridHeight(x,z,index,col,row) {\n return 0;\n }", "function rowHeights(rows) {\n return rows.map(function(row) {\n return row.reduce(function(max, cell) {\n return Math.max(max, cell.minHeight());\n }, 0);\n });\n}", "_isBottomAligned(align) {\n const [pinAlign, baseAlign] = align.split(' ');\n return pinAlign[0] === 'b' && pinAlign[0] === baseAlign[0];\n }", "function getPaddingBytes(size, alignment) {\n return (alignment - (size % alignment)) % alignment;\n}", "function rowHeights(rows) {\n return rows.map(function(row) {\n return row.reduce(function(max, cell) {\n return Math.max(max, cell.minHeight());\n }, 0);\n });\n}", "_applyRowHeight(value, old) {\n this.getPane().getRowConfig().setDefaultItemSize(value);\n }", "innerHeightDependsOnChilds(){if(this.__controlStretchedHeight)return!0;if(this.__rowOptions)for(const rowOption of this.__rowOptions)if(\"Content\"===rowOption.heightMode)return!0;return super.innerHeightDependsOnChilds()}", "padding() {\n const offset = this.bb.__offset(this.bb_pos, 28);\n return offset ? this.bb.readUint16(this.bb_pos + offset) : 0;\n }", "function shiftLayoutOnY(list, topBound, bottomBound, // If average the shifts on all labels and add them to 0\nbalanceShift) {\n return shiftLayout(list, 'y', 'height', topBound, bottomBound, balanceShift);\n}", "function applyTemplateNewLineHeight(item) {\n // the height seems to be calculated by the template row count (how many line of items does the template have)\n var rowCount = _options.panelRows;\n\n //calculate padding requirements based on detail-content..\n //ie. worst-case: create an invisible dom node now &find it's height.\n var lineHeight = 13; //we know cuz we wrote the custom css innit ;)\n item._sizePadding = Math.ceil(((rowCount * 2) * lineHeight) / _grid.getOptions().rowHeight);\n item._height = (item._sizePadding * _grid.getOptions().rowHeight);\n\n var idxParent = _dataView.getIdxById(item.id);\n for (var idx = 1; idx <= item._sizePadding; idx++) {\n _dataView.insertItem(idxParent + idx, getPaddingItem(item, idx));\n }\n }", "function innerHeight(el){\n var style = window.getComputedStyle(el, null);\n return el.clientHeight -\n parseInt(style.getPropertyValue('padding-top'), 10) -\n parseInt(style.getPropertyValue('padding-bottom'), 10);\n }" ]
[ "0.6734675", "0.67031413", "0.6612243", "0.6594719", "0.65137684", "0.63773066", "0.63694626", "0.611576", "0.6112622", "0.6062946", "0.6025898", "0.5958627", "0.5836756", "0.5812848", "0.5802763", "0.56736296", "0.566447", "0.5613556", "0.5571031", "0.55584055", "0.55314", "0.55213547", "0.55124384", "0.54691386", "0.54691386", "0.5466288", "0.5397472", "0.539724", "0.5382685", "0.53739035", "0.53344953", "0.5328277", "0.53265005", "0.5324986", "0.5316285", "0.53057384", "0.52684546", "0.526586", "0.525904", "0.5237112", "0.51752865", "0.51700836", "0.5162414", "0.516223", "0.5159786", "0.5154154", "0.51446515", "0.5138621", "0.5135403", "0.51351786", "0.5133844", "0.51319253", "0.5127905", "0.51231486", "0.5118375", "0.5115479", "0.51063055", "0.50994056", "0.5098639", "0.50984234", "0.5094218", "0.5086462", "0.5084337", "0.50774103", "0.50495464", "0.5046763", "0.5044358", "0.5042696", "0.5037904", "0.5036538", "0.50336105", "0.50259084", "0.50221604", "0.5021834", "0.50197464", "0.5017906", "0.5007504", "0.5006057", "0.5004957", "0.5003913", "0.500182", "0.500182", "0.4999413", "0.49957943", "0.49914846", "0.49911815", "0.49895534", "0.49846035", "0.49725592", "0.4969924", "0.4968405", "0.49667555", "0.49624494", "0.49567616", "0.4953808", "0.4952759", "0.49523532", "0.49369952", "0.49360502", "0.49354076" ]
0.59071386
12
Returns the height of the tallest region in row, minimum 100 px
function getRowRegionsMaxHeight(row) { var rowChildren = $(row).children(); var maxHeight = 100; for (var x = 0; x < rowChildren.length; x++) { if ($(rowChildren.get(x)).outerHeight() > maxHeight) { maxHeight = $(rowChildren.get(x)).outerHeight(); } } return maxHeight; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get minHeight() {}", "function getRowRegionsMaxHeight(row) {\n var rowChildren = $(row).children();\n var maxHeight = 100;\n for (var x = 0; x < rowChildren.length; x++) {\n if ($(rowChildren.get(x)).outerHeight() > maxHeight) {\n maxHeight = $(rowChildren.get(x)).outerHeight();\n }\n }\n return maxHeight;\n }", "get height()\n\t{\n\t\tlet height = Math.max(this._height, this.minHeight);\n\n\t\tif (this.tree.theme.hasGridBehavior)\n\t\t{\n\t\t\tlet step = this.tree.theme.gridSize;\n\t\t\theight = Math.ceil(height / step) * step;\n\t\t}\n\n\t\treturn height;\n\t}", "function rowHeights(rows) {\n return rows.map(row => {\n return row.reduce((max, cell) => {\n return Math.max(max, cell.minHeight());\n }, 0);\n });\n}", "function rowHeights(rows) {\n return rows.map(function(row) {\n return row.reduce(function(max, cell) {\n return Math.max(max, cell.minHeight());\n }, 0);\n });\n}", "function rowHeights(rows) {\n return rows.map(function(row) {\n return row.reduce(function(max, cell) {\n return Math.max(max, cell.minHeight());\n }, 0);\n });\n}", "get estimatedHeight() { return -1; }", "function getRowHeight() {\n var windowWidth, rowHeight;\n\n windowWidth = $(window).width();\n rowHeight = (windowWidth < 900) ? 44 : 32;\n return rowHeight;\n }", "get contentHeight() {\n const rowManager = this.rowManager;\n return Math.max(rowManager.totalHeight, rowManager.bottomRow ? rowManager.bottomRow.bottom : 0);\n }", "get maxHeight() {}", "getMinHeight(){return this.__minHeight}", "get minHeight()\n\t{\n\t\treturn Math.max(this.tree.theme.nodeMinHeight,\n\t\t\tthis.tree.theme.nodeHeaderSize + this.input.height) + 3;\n\t}", "function getGridCellSize() {\n return (min(width, height) / 2 - 50) / gridSize;\n}", "get height() {}", "getMinHeightUnit(){return this.__minHeightUnit}", "function minHeightBst(array) {\n return getHalf(null, array, 0, array.length - 1);\n}", "getLevelHeight() {\n return this.level.tilesHigh;\n }", "function getMaxHeight(jList){\n var rv = -1;\n for(var i = 0; i < jList.length; i++){\n var cur = jList[i];\n if(parseInt(cur.posY) > rv){\n rv = parseInt(cur.posY)\n }\n }\n return rv - (rv%100);\n}", "getBlockHeight() {\n return Promise.resolve(-1);\n }", "gridHeight(x,z,index,col,row) {\n return 0;\n }", "function getHeight (data) {\n const ROW_SPACING = 198.125\n totalPostNum = data.length\n totalRow = (totalPostNum%stepsX !== 0) ? Math.floor(totalPostNum/stepsX) + 1 : totalPostNum/stepsX\n section_height = (ROW_SPACING * totalRow) + 110\n return section_height\n }", "async getBlockHeight() {\n // Add your code here\n let blockCount = await this.bd.getBlocksCount();\n return blockCount -1;\n }", "async getBlockHeight () {\n return await this.getBlockHeightLevel()\n }", "getViewportRowHeight() {\n return this.viewport.current.gridInfo[this.gridInfoView].aspectRatio;\n }", "getHeight() {\n return this._executeAfterInitialWait(() => this.currently.getHeight());\n }", "function findMaxElementHeight(shimmerElements) {\n var shimmerElementsDefaulted = shimmerElements.map(function (element) {\n switch (element.type) {\n case _Shimmer_types__WEBPACK_IMPORTED_MODULE_3__.ShimmerElementType.circle:\n if (!element.height) {\n element.height = _Shimmer_types__WEBPACK_IMPORTED_MODULE_3__.ShimmerElementsDefaultHeights.circle;\n }\n break;\n case _Shimmer_types__WEBPACK_IMPORTED_MODULE_3__.ShimmerElementType.line:\n if (!element.height) {\n element.height = _Shimmer_types__WEBPACK_IMPORTED_MODULE_3__.ShimmerElementsDefaultHeights.line;\n }\n break;\n case _Shimmer_types__WEBPACK_IMPORTED_MODULE_3__.ShimmerElementType.gap:\n if (!element.height) {\n element.height = _Shimmer_types__WEBPACK_IMPORTED_MODULE_3__.ShimmerElementsDefaultHeights.gap;\n }\n break;\n }\n return element;\n });\n var rowHeight = shimmerElementsDefaulted.reduce(function (acc, next) {\n return next.height ? (next.height > acc ? next.height : acc) : acc;\n }, 0);\n return rowHeight;\n}", "getHeight() {\n return this._rows.length;\n }", "get pixelHeight() {\n return this.grid.layout.gridItemHeight;\n }", "function getHeight(root) {}", "getWidth() {\n return this._rows\n .map((row) => row.getWidth())\n .reduce((x, y) => Math.max(x, y), 0);\n }", "function tp_min_height(layers)\n{\n\tvar min_height = Number.MAX_VALUE;\n\tfor (var i = 0; i < layers.length; i++)\n\t\tmin_height = Math.min(min_height, layers[i].bounds[3].value - layers[i].bounds[1].value);\n\n\treturn min_height;\n}", "get height() {\n return Math.max(this.leftSubtreeHeight, this.rightSubtreeHeight);\n }", "get_grid_height() {\n\t\t\treturn this._internal_grid_size[1]\n\t\t}", "getBlockHeight() {\n let self = this;\n return new Promise(function(resolve, reject) {\n self.levelDBWrapper.getBlocksCount().then((count) => {\n let height = count - 1;\n // height will be one less than the count of blocks\n resolve(height);\n }).catch((err) => {\n reject(err);\n });\n }); \n }", "height() {\n return this.headPos().y - this.rootMesh.getAbsolutePosition().y;\n }", "height() {\n return this.heightHelper(this.root, 0)\n }", "function calculateMinHeight() {\n var minHeight = Infinity;\n $slides.each(function() {\n var thisHeight = $(this).height();\n if (thisHeight < minHeight) {\n minHeight = thisHeight;\n }\n });\n return minHeight;\n }", "function worst(row,rowFixedLength,ratio){var areaMax=0;var areaMin=Infinity;for(var i=0,area,len=row.length;i < len;i++) {area = row[i].getLayout().area;if(area){area < areaMin && (areaMin = area);area > areaMax && (areaMax = area);}}var squareArea=row.area * row.area;var f=rowFixedLength * rowFixedLength * ratio;return squareArea?mathMax(f * areaMax / squareArea,squareArea / (f * areaMin)):Infinity;}", "function getElemsHeight() {\n\tvar lowestY = 0;\n\t$(document.body).children().each( function(index, element) {\n\t\tvar bottom = $( element ).offset().top + $( element ).height();\n\t\tif (bottom > lowestY) lowestY = bottom;\n\t});\n\treturn lowestY;\n}", "getMaxHeightArena() {\n return this.maxBoundsHeight;\n }", "function minHeightBst(array) {\n // Write your code here.\n return buildTree(array, null, 0, array.length - 1);\n}", "async getBlockHeight() {\n\t\treturn await this.bd.getBlocksCount();\n\t}", "get rowHeight() { return this._rowHeight; }", "innerHeightDependsOnChilds(){if(this.__controlStretchedHeight)return!0;if(this.__rowOptions)for(const rowOption of this.__rowOptions)if(\"Content\"===rowOption.heightMode)return!0;return super.innerHeightDependsOnChilds()}", "function minHeightBst(array) {\n return constructMinHeightBst(array, 0, array.length - 1);\n}", "set minHeight(value) {}", "function getBottom(col) {\r\n\treturn (field[col].length - 1) * rowheight;\r\n}", "function minHeightBst(array) {\n return constructMinHeightBst(array, 0, array.length - 1);\n}", "getOuterHeight() {\n return this.getHeight();\n }", "function random_height(min, max)\n {\n if(i > 0 && i < rows-1 && j > 0 && j < columns-1)\n return Math.random() * (max - min) + min;\n else\n return 0;\n }", "function minHeightBst(array) {\n // Write your code here.\n return constructTree(array, 0, array.length - 1);\n}", "function headerHeight(d) {\n var headerBlocks = d.rowBlocks[0].auxiliaryBlocks;\n return headerBlocks.reduce(function(p, n) {return p + rowsHeight(n, Infinity);}, 0);\n}", "function getCurrentHeight() {\n\t\t\treturn (lineHeight * Math.max(1, Math.min(5, items.length))) + 4;\n\t\t}", "getBlockHeight() {\n return this.db.getBlocksCount();\n }", "function getMaxHeight(clmp) {\n var lineHeight = getLineHeight(element);\n return lineHeight * clmp;\n }", "function getWinHeight() {\n\treturn win_dimension()[1] * 0.8;\n}", "function minHeightBst(array) {\n return constructMinHeightBst(array, null, 0, array.length - 1);\n}", "function minHeightBst(array) {\n return constructMinHeightBst(array, null, 0, array.length - 1);\n}", "function getTreeHeight(){\r\n\t\tvar res = 0;\r\n\t\tvar addingHeight = 1;\r\n\t\tif(this.name == \"\")\r\n\t\t\taddingHeight = 0;\r\n\t\t\r\n\t\tif(this.expanded){\r\n\t\t\tfor(var i = 0; i < this.childCount; i++){\r\n\t\t\t\tvar tmp = this.child[i].getHeight();\r\n\t\t\t\tif(tmp > res)\r\n\t\t\t\t\tres = tmp\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn res + addingHeight;\r\n\t\t\r\n\t}", "get gridItemHeight() {\n return windowHeight / maxIconsPerCol * this.percent;\n }", "get gridItemHeight() {\n return windowHeight / maxIconsPerCol * this.percent;\n }", "function minHeightBst(array) {\n return constructMinHeightBst(array, null, 0, array.length - 1);\n}", "function getElementHeightAboveFold(elem)\n\t\t\t\t{\n\t\t\t\t\tvar docViewTop = $(window).scrollTop();\n\t\t\t\t\tvar docViewBottom = docViewTop + $(window).height();\n\t\t\t\t\tvar elemTop = $(elem).offset().top;\n\t\t\t\t\tvar elemHeight = $(elem).height();\n\t\t\t\t\treturn Math.min((elemHeight + $(window).height()), Math.max((docViewBottom - elemTop), 0));\n\t\t\t\t}", "function GetEraBlockHeight(current_window) \r\n\t{\r\n\t\tif (current_window.era_rc != null && current_window.era_rc[\"Height\"] != null) \r\n\t\t{\r\n\t\t\t\treturn GetStringWithQuotes(current_window.era_rc[\"Height\"]);\r\n\t\t} \r\n\t\t\r\n\t\treturn GetStringWithQuotes(500);\r\n\t}", "get height() {\n\t\treturn this._viewport[3];\n\t}", "function mostWaterContainer(ints) {\n let largestArea = 0;\n let totalLength = ints.length;\n let x = 0;\n let y = 0;\n\n while (x < totalLength) {\n // console.log(\"x,y\", x,y);\n currHeight = ints[x] > ints[y] ? ints[y] : ints[x];\n // console.log(\"height\", currHeight)\n currLength = y - x;\n // console.log(\"length\", currLength);\n currArea = currHeight * currLength;\n // console.log(\"curARea\", currArea);\n\n if (currArea > largestArea) {\n largestArea = currArea;\n }\n\n y += 1;\n\n if (y >= totalLength) {\n x += 1;\n y = x;\n }\n }\n return largestArea;\n}", "getMaxArea() {\r\n\t\treturn this.width * this.length;\r\n\t}", "height() {\n return this.heightVisitor(this.root)\n }", "function getMaxHeight(clmp) {\n var lineHeight = getLineHeight(element);\n return lineHeight * clmp;\n }", "function getMaxHeight(clmp) {\n var lineHeight = getLineHeight(element);\n return lineHeight * clmp;\n }", "getMaxHeightUnit(){return this.__maxHeightUnit}", "function alto_tabla() \n{\n if (estado > 3) return $(\"#vista_contenido\").height()-100;\n else return Math.max($(\"#vista_contenido\").height()-$(\".formulario\").height()-100,250);\n}", "max_height() {\n\t\treturn this.rectangle_y_pad + N_WORDS * char_image_dimensions.height + (N_WORDS - 1) * this.height_between_words;\n\t}", "function getTallestHeight(tabContentCol){\r\n\t\t\tvar maxHeight = 0, currentHeight = 0;\r\n\t\t\ttabContentCol.children(\"div.vtabs-content-panel\").each(function(i){\r\n\t\t\t\t//currentHeight = parseInt( $(this).css(\"height\").replace(\"px\",\"\") );\r\n\t\t\t\tcurrentHeight = $(this).height();\r\n\t\t\t\tif(currentHeight > maxHeight){\r\n\t\t\t\t\tmaxHeight = currentHeight;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\treturn maxHeight;\r\n\t\t}", "getMaxBottomCellMargin(row) {\n if (isNullOrUndefined(row.childWidgets)) {\n return 0;\n }\n let value = 0;\n for (let i = 0; i < row.childWidgets.length; i++) {\n let cell = row.childWidgets[i];\n let bottomMargin = 0;\n if (cell.cellFormat.hasValue('bottomMargin')) {\n bottomMargin = HelperMethods.convertPointToPixel(cell.cellFormat.bottomMargin);\n }\n else if (row.rowFormat.hasValue('bottomMargin')) {\n bottomMargin = HelperMethods.convertPointToPixel(row.rowFormat.bottomMargin);\n }\n else {\n bottomMargin = HelperMethods.convertPointToPixel(row.ownerTable.tableFormat.bottomMargin);\n }\n if (bottomMargin > value) {\n value = bottomMargin;\n }\n }\n return value;\n }", "function worst(row, rowFixedLength, ratio) {\n var areaMax = 0;\n var areaMin = Infinity;\n\n for (var i = 0, area = void 0, len = row.length; i < len; i++) {\n area = row[i].getLayout().area;\n\n if (area) {\n area < areaMin && (areaMin = area);\n area > areaMax && (areaMax = area);\n }\n }\n\n var squareArea = row.area * row.area;\n var f = rowFixedLength * rowFixedLength * ratio;\n return squareArea ? treemapLayout_mathMax(f * areaMax / squareArea, squareArea / (f * areaMin)) : Infinity;\n}", "get height() {\n return this.bottom - this.top;\n }", "getRowHeight(resourceRecord) {\n if (this.currentOrientation.calculateRowHeight) {\n const height = this.currentOrientation.calculateRowHeight(resourceRecord);\n this.rowManager.storeKnownHeight(resourceRecord.id, height);\n return height;\n }\n }", "function maxArea(height) {\n let area = 0, start = 0, end = height.length-1;\n while(start < end) {\n let newArea = Math.min(height[start], height[end]) * (end - start);\n area = Math.max(area, newArea);\n if(height[start] < height[end]) {\n start++;\n } else {\n end--;\n }\n }\n return area;\n}", "measureRowHeight() {\n const me = this,\n // Create a fake subgrid with one row, since styling for row is specified on .b-grid-subgrid .b-grid-row\n rowMeasureElement = DomHelper.createElement({\n tag: 'div',\n // TODO: should either get correct widgetClassList or query features for measure classes\n className: 'b-grid ' + (me.features.stripe ? 'b-stripe' : ''),\n style: 'position: absolute; visibility: hidden',\n html: '<div class=\"b-grid-subgrid\"><div class=\"b-grid-row\"></div></div>',\n parent: document.getElementById(me.appendTo) || document.body\n });\n\n // Use style height or default height from config.\n // Not using clientHeight since it will have some value even if no height specified in CSS\n const rowEl = rowMeasureElement.firstElementChild.firstElementChild,\n styleHeight = parseInt(DomHelper.getStyleValue(rowEl, 'height')),\n borderTop = parseInt(DomHelper.getStyleValue(rowEl, 'border-top-width')),\n borderBottom = parseInt(DomHelper.getStyleValue(rowEl, 'border-bottom-width'));\n\n // Change rowHeight if specified in styling, also remember that value to replace later if theme changes and\n // user has not explicitly set some other height\n if (me.rowHeight == null || me.rowHeight === me._rowHeightFromStyle) {\n me.rowHeight = !isNaN(styleHeight) && styleHeight ? styleHeight : me.defaultRowHeight;\n me._rowHeightFromStyle = me.rowHeight;\n }\n\n // this measurement will be added to rowHeight during rendering, to get correct cell height\n me._rowBorderHeight = borderTop + borderBottom;\n\n me._isRowMeasured = true;\n\n rowMeasureElement.remove();\n\n // There is a ticket about measuring the actual first row instead:\n // https://app.assembla.com/spaces/bryntum/tickets/5735-measure-first-real-rendered-row-for-rowheight/details\n }", "function height(param) {\n if (param) {\n return param.h;\n } else {\n return 0;\n }\n }", "getMaxTopCellMargin(row) {\n if (isNullOrUndefined(row.childWidgets)) {\n return 0;\n }\n let value = 0;\n for (let i = 0; i < row.childWidgets.length; i++) {\n let cell = row.childWidgets[i];\n let topMargin = 0;\n if (cell.cellFormat.hasValue('topMargin')) {\n topMargin = HelperMethods.convertPointToPixel(cell.cellFormat.topMargin);\n }\n else if (row.rowFormat.hasValue('topMargin')) {\n topMargin = HelperMethods.convertPointToPixel(row.rowFormat.topMargin);\n }\n else {\n topMargin = HelperMethods.convertPointToPixel(row.ownerTable.tableFormat.topMargin);\n }\n if (topMargin > value) {\n value = topMargin;\n }\n }\n return value;\n }", "getMaxHeight(){return this.__maxHeight}", "getHeight(curr){\n if(curr == null){\n return 0;\n }else{\n let leftHeight = getHeight(curr.left);\n let rightHeight = getHeight(curr.right);\n\n if(leftHeight > rightHeight){\n return leftHeight+1;\n }else{\n return rightHeight+1;\n }\n }\n }", "_getHeaderHeight() {\n const isExpanded = this._isExpanded();\n if (isExpanded && this.expandedHeight) {\n return this.expandedHeight;\n }\n else if (!isExpanded && this.collapsedHeight) {\n return this.collapsedHeight;\n }\n return null;\n }", "getHeight(){return this.__height}", "getHeight() {\n return this.$node.innerHeight();\n }", "function vcFullHeightRow() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar $element = $(\".vc_row-o-full-height:first\");\r\n\t\t\t\t\tif ($element.length) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar windowHeight, offsetTop, fullHeight;\r\n\t\t\t\t\t\twindowHeight = $window.height();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$(\".vc_row-o-full-height\").each(function () {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\toffsetTop = $(this).offset().top;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif (offsetTop < windowHeight && \r\n\t\t\t\t\t\t\t\t$(this).hasClass('top-level') && \r\n\t\t\t\t\t\t\t\t!nectarDOMInfo.usingFrontEndEditor) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tfullHeight = 100 - offsetTop / (windowHeight / 100);\r\n\t\t\t\t\t\t\t\t$(this).css(\"min-height\", fullHeight + \"vh\");\r\n\t\t\t\t\t\t\t\t$(this).find('> .col.span_12').css(\"min-height\", fullHeight + \"vh\");\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$(this).css(\"min-height\", windowHeight);\r\n\t\t\t\t\t\t\t\t$(this).find('> .col.span_12').css(\"min-height\", windowHeight);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}", "function equalizeHeight()\n{\n\tvar boxHeight = 0;\n\n\t$(\".eq-height\").removeAttr(\"style\");\n\n\t$(\".row\").each(function(){\n\n\t\t$(this).find(\".eq-height\").each(function(){\n\t\t\tvar currentBoxHeight = $(this).innerHeight();\n\t\t\tif(currentBoxHeight > boxHeight) boxHeight = currentBoxHeight;\n\t\t});\n\n\t\t$(this).find(\".eq-height\").css({\"height\":boxHeight-51+\"px\"});\n\t\t$(\".container\").css({\"height\":boxHeight+\"px\"});\n\n\t});\n}", "get rowHeight() {\n return this._rowHeight;\n }", "get rowHeight() {\n return this._rowHeight;\n }", "getHeight() {\n return new Promise(function(resolve, reject) {\n db.getBlocksCount().then((result) => {\n resolve(result);\n }).catch(function(err) {\n reject(err);\n });\n });\n }", "function height() {\n return canvas.height;\n }", "function heightOf(tree, count=0){\n if (!tree){\n return count;\n } else {\n count++;\n }\n return Math.max(\n heightOf(tree.left, count),\n heightOf(tree.right, count)\n );\n}", "function worst(row, rowFixedLength, ratio) {\n\t var areaMax = 0;\n\t var areaMin = Infinity;\n\t\n\t for (var i = 0, area = void 0, len = row.length; i < len; i++) {\n\t area = row[i].getLayout().area;\n\t\n\t if (area) {\n\t area < areaMin && (areaMin = area);\n\t area > areaMax && (areaMax = area);\n\t }\n\t }\n\t\n\t var squareArea = row.area * row.area;\n\t var f = rowFixedLength * rowFixedLength * ratio;\n\t return squareArea ? mathMax$7(f * areaMax / squareArea, squareArea / (f * areaMin)) : Infinity;\n\t }", "function height(n) {\n if (n !== null) {\n return n.h;\n } else {\n return 0;\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}", "measureRowHeight() {\n var _me$features2;\n\n const me = this,\n // Create a fake subgrid with one row, since styling for row is specified on .b-grid-subgrid .b-grid-row\n rowMeasureElement = DomHelper.createElement({\n tag: 'div',\n // TODO: should either get correct widgetClassList or query features for measure classes\n className: 'b-grid ' + (((_me$features2 = me.features) === null || _me$features2 === void 0 ? void 0 : _me$features2.stripe) ? 'b-stripe' : ''),\n style: 'position: absolute; visibility: hidden',\n html: '<div class=\"b-grid-subgrid\"><div class=\"b-grid-row\"></div></div>',\n parent: document.getElementById(me.appendTo) || document.body\n }); // Use style height or default height from config.\n // Not using clientHeight since it will have some value even if no height specified in CSS\n\n const rowEl = rowMeasureElement.firstElementChild.firstElementChild,\n styleHeight = parseInt(DomHelper.getStyleValue(rowEl, 'height')),\n borderTop = parseInt(DomHelper.getStyleValue(rowEl, 'border-top-width')),\n borderBottom = parseInt(DomHelper.getStyleValue(rowEl, 'border-bottom-width')); // Change rowHeight if specified in styling, also remember that value to replace later if theme changes and\n // user has not explicitly set some other height\n\n if (me.rowHeight == null || me.rowHeight === me._rowHeightFromStyle) {\n me.rowHeight = !isNaN(styleHeight) && styleHeight ? styleHeight : me.defaultRowHeight;\n me._rowHeightFromStyle = me.rowHeight;\n } // this measurement will be added to rowHeight during rendering, to get correct cell height\n\n me._rowBorderHeight = borderTop + borderBottom;\n me._isRowMeasured = true;\n rowMeasureElement.remove(); // There is a ticket about measuring the actual first row instead:\n // https://app.assembla.com/spaces/bryntum/tickets/5735-measure-first-real-rendered-row-for-rowheight/details\n }", "function worst(row, rowFixedLength, ratio) {\n var areaMax = 0;\n var areaMin = Infinity;\n\n for (var i = 0, area, len = row.length; i < len; i++) {\n area = row[i].getLayout().area;\n\n if (area) {\n area < areaMin && (areaMin = area);\n area > areaMax && (areaMax = area);\n }\n }\n\n var squareArea = row.area * row.area;\n var f = rowFixedLength * rowFixedLength * ratio;\n return squareArea ? mathMax(f * areaMax / squareArea, squareArea / (f * areaMin)) : Infinity;\n}", "function worst(row, rowFixedLength, ratio) {\n var areaMax = 0;\n var areaMin = Infinity;\n\n for (var i = 0, area, len = row.length; i < len; i++) {\n area = row[i].getLayout().area;\n\n if (area) {\n area < areaMin && (areaMin = area);\n area > areaMax && (areaMax = area);\n }\n }\n\n var squareArea = row.area * row.area;\n var f = rowFixedLength * rowFixedLength * ratio;\n return squareArea ? mathMax(f * areaMax / squareArea, squareArea / (f * areaMin)) : Infinity;\n}" ]
[ "0.7309251", "0.720936", "0.7061328", "0.6928029", "0.68662304", "0.6832829", "0.67522633", "0.6693658", "0.66890943", "0.6603465", "0.65717226", "0.6451369", "0.63987803", "0.6397883", "0.6378977", "0.63679737", "0.6314717", "0.62977296", "0.62957376", "0.6290153", "0.62632734", "0.6260506", "0.62545955", "0.6252732", "0.6226244", "0.6214307", "0.620529", "0.6204759", "0.61943924", "0.6193245", "0.61914486", "0.61511534", "0.6144596", "0.6136399", "0.61205286", "0.611912", "0.6118912", "0.61179525", "0.6117223", "0.6115508", "0.61137515", "0.6107464", "0.60960877", "0.6084362", "0.6057625", "0.60536313", "0.6053256", "0.60440123", "0.6042756", "0.6042028", "0.6040046", "0.60400003", "0.60364705", "0.6025523", "0.602525", "0.60197735", "0.60189086", "0.60189086", "0.6016609", "0.60118777", "0.60118777", "0.6009858", "0.6002816", "0.5999394", "0.59875417", "0.59792525", "0.5972419", "0.5969865", "0.59664744", "0.59664744", "0.59631336", "0.59573", "0.59558564", "0.59484637", "0.59472966", "0.5933139", "0.59206635", "0.5904292", "0.58973444", "0.58943915", "0.58920443", "0.58867544", "0.587304", "0.58710825", "0.5867299", "0.585359", "0.58533335", "0.58437324", "0.58414376", "0.58403695", "0.58403695", "0.5834964", "0.5834043", "0.58271754", "0.58136755", "0.58128947", "0.5811519", "0.5808667", "0.5807497", "0.5807497" ]
0.722758
1
Restores the paddingbottom value to the original for all regions in given row
function resetRowsRegionsHeight(row) { // when called by each, first argument is a number instead of a row value var row = (typeof row === 'number') ? $(this) : row; var rowChildren = $(row).children(); for (var x = 0; x < rowChildren.length; x++) { // reset to 5, the initial value before dragging $(rowChildren.get(x)).css("padding-bottom", 5); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetRowsRegionsHeight(row) {\n // when called by each, first argument is a number instead of a row value\n var row = (typeof row === 'number') ? $(this) : row;\n\n var rowChildren = $(row).children();\n for (var x = 0; x < rowChildren.length; x++) {\n // reset to 5, the initial value before dragging\n $(rowChildren.get(x)).css(\"padding-bottom\", 5);\n }\n }", "function setRowsRegionsHeight(row, maxHeight) {\n var rowChildren = $(row).children();\n for (var x = 0; x < rowChildren.length; x++) {\n if ($(rowChildren.get(x)).outerHeight() != maxHeight) {\n var defaultPadding = parseInt($(rowChildren.get(x)).css(\"padding-bottom\").replace(\"px\", \"\"));\n $(rowChildren.get(x)).css(\"padding-bottom\", (defaultPadding + maxHeight - $(rowChildren.get(x)).outerHeight()));\n }\n }\n }", "function setRowsRegionsHeight(row, maxHeight) {\n var rowChildren = $(row).children();\n for (var x = 0; x < rowChildren.length; x++) {\n if ($(rowChildren.get(x)).outerHeight() != maxHeight) {\n var defaultPadding = parseInt($(rowChildren.get(x)).css(\"padding-bottom\").replace(\"px\", \"\"));\n $(rowChildren.get(x)).css(\"padding-bottom\", (defaultPadding + maxHeight - $(rowChildren.get(x)).outerHeight()));\n }\n }\n }", "function adjustBottomRowRegionsHeight(row) {\n resetRowsRegionsHeight(row);\n var bodyHeight = $('body').outerHeight();\n var windowHeight = $(window).height();\n // Instances where no scroll bar currently exists\n if (windowHeight >= bodyHeight) {\n var pageHeight = $(\"#pageContent\").outerHeight();\n var headerHeight = bodyHeight - pageHeight;\n var upperRegionsMaxHeights = 0;\n if ($(\".upperRow\").length) {\n var rows = $(\".regions\").find(\".upperRow\");\n for (var x = 0; x < rows.length; x++) {\n var rowMaxHeight = getRowRegionsMaxHeight(rows.get(x));\n upperRegionsMaxHeights = upperRegionsMaxHeights + rowMaxHeight;\n }\n }\n // determine maximum size possible for bottom region\n // 50 px of buffer also removed to prevent scroll-bar from appearing in any cases\n var bottomPadding = (windowHeight - 50) - (upperRegionsMaxHeights + headerHeight);\n\n setRowsRegionsHeight(row, bottomPadding);\n }\n // Instances where scroll bar currently exists, can default to upper row behavior\n else {\n adjustUpperRowRegionsHeight(row);\n }\n // refresh sortables cached positions\n getNonLockedRegions().sortable(\"refreshPositions\");\n }", "function adjustBottomRowRegionsHeight(row) {\n resetRowsRegionsHeight(row);\n var bodyHeight = $('body').outerHeight();\n var windowHeight = $(window).height();\n // Instances where no scroll bar currently exists\n if (windowHeight >= bodyHeight) {\n var pageHeight = $(\"#pageContent\").outerHeight();\n var headerHeight = bodyHeight - pageHeight;\n var upperRegionsMaxHeights = 0;\n if ($(\".upperRow\").length) {\n var rows = $(\".regions\").find(\".upperRow\");\n for (var x = 0; x < rows.length; x++) {\n var rowMaxHeight = getRowRegionsMaxHeight(rows.get(x));\n upperRegionsMaxHeights = upperRegionsMaxHeights + rowMaxHeight;\n }\n }\n // determine maximum size possible for bottom region\n // 50 px of buffer also removed to prevent scroll-bar from appearing in any cases\n var bottomPadding = (windowHeight - 50) - (upperRegionsMaxHeights + headerHeight);\n\n setRowsRegionsHeight(row, bottomPadding);\n }\n // Instances where scroll bar currently exists, can default to upper row behavior\n else {\n adjustUpperRowRegionsHeight(row);\n }\n // refresh sortables cached positions\n getNonLockedRegions().sortable(\"refreshPositions\");\n }", "function fullWidthRowPaddingAdjustCalc() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($('#boxed').length == 0) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$('.full-width-section[data-top-percent], .full-width-section[data-bottom-percent], .full-width-content[data-top-percent], .full-width-content[data-bottom-percent]').each(function () {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tvar $windowHeight = $window.width(),\r\n\t\t\t\t\t\t\t$topPadding = ($(this).attr('data-top-percent')) ? $(this).attr('data-top-percent') : 'skip',\r\n\t\t\t\t\t\t\t$bottomPadding = ($(this).attr('data-bottom-percent')) ? $(this).attr('data-bottom-percent') : 'skip';\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//top\r\n\t\t\t\t\t\t\tif ($topPadding != 'skip') {\r\n\t\t\t\t\t\t\t\t$(this).css('padding-top', $windowHeight * (parseInt($topPadding) / 100));\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\t//bottom\r\n\t\t\t\t\t\t\tif ($bottomPadding != 'skip') {\r\n\t\t\t\t\t\t\t\t$(this).css('padding-bottom', $windowHeight * (parseInt($bottomPadding) / 100));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "function adjustUpperRowRegionsHeight(row) {\n // when called by each, first argument is a number instead of a row value\n var row = (typeof row === 'number') ? $(this) : row;\n\n resetRowsRegionsHeight(row);\n\n // sets total region height to the height of tallest region\n setRowsRegionsHeight(row, getRowRegionsMaxHeight(row));\n\n // refresh sortables cached positions\n getNonLockedRegions().sortable(\"refreshPositions\");\n }", "function adjustUpperRowRegionsHeight(row) {\n // when called by each, first argument is a number instead of a row value\n var row = (typeof row === 'number') ? $(this) : row;\n\n resetRowsRegionsHeight(row);\n\n // sets total region height to the height of tallest region\n setRowsRegionsHeight(row, getRowRegionsMaxHeight(row));\n\n // refresh sortables cached positions\n getNonLockedRegions().sortable(\"refreshPositions\");\n }", "function adjustRowRegionsHeights() {\n // handle region areas for upper rows\n if ($(\".upperRow\").length) {\n var rows = $(\".regions\").find(\".upperRow\");\n rows.each(adjustUpperRowRegionsHeight);\n }\n\n // handle region areas for the bottom row\n if ($(\".bottomRow\").length) {\n var row = $(\".regions\").find(\".bottomRow\");\n adjustBottomRowRegionsHeight(row)\n }\n }", "function adjustRowRegionsHeights() {\n // handle region areas for upper rows\n if ($(\".upperRow\").length) {\n var rows = $(\".regions\").find(\".upperRow\");\n rows.each(adjustUpperRowRegionsHeight);\n }\n\n // handle region areas for the bottom row\n if ($(\".bottomRow\").length) {\n var row = $(\".regions\").find(\".bottomRow\");\n adjustBottomRowRegionsHeight(row)\n }\n }", "function fullWidthRowPaddingAdjust() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (nectarDOMInfo.usingMobileBrowser) {\r\n\t\t\t\t\t\tfullWidthRowPaddingAdjustCalc();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$window.on('resize', fullWidthRowPaddingAdjustCalc);\r\n\t\t\t\t\t\r\n\t\t\t\t}", "function cookData(array, rowPadding) {\n\t\t\n\t\tvar prev = {i: 0, h: 0, y: 0};\n\t\tvar first = array[0];\n\t\t\n\t\t// discover custom attributes\n\t\tvar attributes = [];\n\t\tfor(key in first) {\n\t\t\tif(!(key in prev)) {\n\t\t\t\tattributes.push(key);\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(var i = 0; i < array.length; i++) {\n\t\t\tvar item = array[i];\n\t\t\t\n\t\t\t// copy attributes forward\n\t\t\tfor(var a = 0; a < attributes.length; a++) {\n\t\t\t\tvar attr = attributes[a];\n\t\t\t\tif(!(attr in item)) {\n\t\t\t\t\titem[attr] = prev[attr];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// copy height forward + ensure requested padding\n\t\t\tif(item.h) {\n\t\t\t\titem.h += rowPadding;\n\t\t\t} else {\n\t\t\t\titem.h = prev.h;\n\t\t\t}\n\t\t\t\n\t\t\t// calculate segment height & spanned indices\n\t\t\tvar span = item.i - prev.i;\n\t\t\titem.y = prev.y + span * prev.h;\n\t\t\t\n\t\t\tprev.last = item.i;\n\t\t\tprev.lastY = item.y;\n\t\t\tprev = item;\n\t\t}\n\t\t\n\t\t// last item needs to be given explicitly\n\t\tvar lastEntry = array[array.length - 1];\n\t\tarray.last = lastEntry.i;\n\t\tlastEntry.last = lastEntry.i + 1;\n\n\t\tvar lastSpan = lastEntry.last - lastEntry.i;\n\t\tvar totalHeight = lastEntry.y + lastEntry.h * lastSpan;\n\t\tlastEntry.lastY = totalHeight;\n\t\t\n\t\treturn totalHeight;\n\t}", "function convertFrontEndPadding() {\r\n\t\t\t\t\t\r\n\t\t\t\t\t$('.vc_element > .wpb_column[class*=\"padding-\"][class*=\"-percent\"]').each(function() {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar $elPaddingPercent = 4;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar elclassName = this.className.match(/padding-\\d+/);\r\n\t\t\t\t\t\tif (elclassName) {\r\n\t\t\t\t\t\t\t$elPaddingPercent = elclassName[0].match(/\\d+/);\r\n\t\t\t\t\t\t\tif ($elPaddingPercent) {\r\n\t\t\t\t\t\t\t\t$elPaddingPercent = $elPaddingPercent[0] / 100;\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$elPaddingPercent = 0;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ($elPaddingPercent) {\r\n\t\t\t\t\t\t\tvar $parentRowWidth = $(this).parents('.span_12').width();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif ($(this).is('[data-padding-pos=\"all\"]')) {\r\n\t\t\t\t\t\t\t\t$(this).css('padding', $parentRowWidth * $elPaddingPercent);\r\n\t\t\t\t\t\t\t} else if ($(this).is('[data-padding-pos=\"top\"]')) {\r\n\t\t\t\t\t\t\t\t$(this).css('padding-top', $parentRowWidth * $elPaddingPercent);\r\n\t\t\t\t\t\t\t} else if ($(this).is('[data-padding-pos=\"bottom\"]')) {\r\n\t\t\t\t\t\t\t\t$(this).css('padding-bottom', $parentRowWidth * $elPaddingPercent);\r\n\t\t\t\t\t\t\t} else if ($(this).is('[data-padding-pos=\"left\"]')) {\r\n\t\t\t\t\t\t\t\t$(this).css('padding-left', $parentRowWidth * $elPaddingPercent);\r\n\t\t\t\t\t\t\t} else if ($(this).is('[data-padding-pos=\"right\"]')) {\r\n\t\t\t\t\t\t\t\t$(this).css('padding-right', $parentRowWidth * $elPaddingPercent);\r\n\t\t\t\t\t\t\t} else if ($(this).is('[data-padding-pos=\"top-bottom\"]')) {\r\n\t\t\t\t\t\t\t\t$(this).css({\r\n\t\t\t\t\t\t\t\t\t'padding-top': $parentRowWidth * $elPaddingPercent,\r\n\t\t\t\t\t\t\t\t\t'padding-bottom': $parentRowWidth * $elPaddingPercent,\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t} else if ($(this).is('[data-padding-pos=\"top-right\"]')) {\r\n\t\t\t\t\t\t\t\t$(this).css({\r\n\t\t\t\t\t\t\t\t\t'padding-top': $parentRowWidth * $elPaddingPercent,\r\n\t\t\t\t\t\t\t\t\t'padding-right': $parentRowWidth * $elPaddingPercent,\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t} else if ($(this).is('[data-padding-pos=\"bottom-right\"]')) {\r\n\t\t\t\t\t\t\t\t$(this).css({\r\n\t\t\t\t\t\t\t\t\t'padding-right': $parentRowWidth * $elPaddingPercent,\r\n\t\t\t\t\t\t\t\t\t'padding-bottom': $parentRowWidth * $elPaddingPercent,\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t} else if ($(this).is('[data-padding-pos=\"bottom-left\"]')) {\r\n\t\t\t\t\t\t\t\t$(this).css({\r\n\t\t\t\t\t\t\t\t\t'padding-left': $parentRowWidth * $elPaddingPercent,\r\n\t\t\t\t\t\t\t\t\t'padding-bottom': $parentRowWidth * $elPaddingPercent,\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t} else if ($(this).is('[data-padding-pos=\"left-right\"]')) {\r\n\t\t\t\t\t\t\t\t$(this).css({\r\n\t\t\t\t\t\t\t\t\t'padding-left': $parentRowWidth * $elPaddingPercent,\r\n\t\t\t\t\t\t\t\t\t'padding-right': $parentRowWidth * $elPaddingPercent,\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}\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\t$('.wpb_row[class*=\"vc_custom_\"]').each(function() {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$(this).parent().addClass('no-bottom-margin');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t}", "function outputPaddingAdjuster() {\n if (!tutorialSettings.libraries.turtle && !tutorialSettings.libraries.DOM && !tutorialSettings.libraries.csv && !tutorialSettings.libraries.csvAndTurtle) {\n outputBlock.style.paddingLeft = \"40px\";\n } \n else {\n if($(window).width() < 1183){\n outputBlock.style.paddingLeft = \"40px\";\n }\n }\n}", "function setPad(reference, target){\n var padAmt=((reference.height() - target.height())/2);\n var styles = {\n \"padding-top\": padAmt,\n \"padding-bottom\": padAmt\n };\n target.css( styles );\n}", "function applyBottomBorderToGoupedValues() {\n var ss = SpreadsheetApp.getActiveSpreadsheet();\n var sheet = ss.getSheetByName('Master Inventory');\n var numColumns = sheet.getLastColumn();\n \n var columnToSearchZeroIndexed = 0;\n var rowRangesArray = getRowRangesOfGroupedValues(columnToSearchZeroIndexed);\n var numGroups = rowRangesArray.length;\n \n for (var i=0; i < numGroups; i++) {\n var firstTempRow = rowRangesArray[i][0];\n var lastTempRow = rowRangesArray[i][1];\n var numTempRows = lastTempRow - firstTempRow;\n \n var tempRange = sheet.getRange(firstTempRow, columnToSearchZeroIndexed+1, numTempRows+1, numColumns);\n tempRange.setBorder(false, false, true, false, false, false);\n }\n}", "function calculate_padding() {\n padLeft = Math.floor((display.getWidth() - etch.getWidth()) / 2);\n padTop = Math.floor((display.getHeight() - etch.getHeight() - 5) / 2) + 1;\n}", "function isPadding(cell) {\n return cell[3];\n }", "function establecerPaddingLateralContenedor(contenedor, padding) {\r\n\tcontenedor.style.paddingRight = padding;\r\n\tcontenedor.style.paddingLeft = padding;\r\n}", "pad() {\n const paddedGame = Game.duplicate(this);\n\n // add empty rows to top and bottom of grid\n paddedGame.cells[this.origin.y - 1] = {};\n paddedGame.cells[this.origin.y + this.height] = {};\n\n // update Game dimensions\n paddedGame.width += 2;\n paddedGame.height += 2;\n paddedGame.origin.x--;\n paddedGame.origin.y--;\n\n return paddedGame;\n }", "getVarPaddingBottom() {\n const {\n delta: {\n total, end, keeps, varLastCalcIndex, varAverSize\n }, size\n } = this;\n const last = total - 1;\n if (total - end <= keeps || varLastCalcIndex === last) {\n return this.getVarOffset(last) - this.getVarOffset(end);\n }\n // if unreached last zone or uncalculate real behind offset\n // return the estimate paddingBottom avoid too much calculate.\n return (total - end) * (varAverSize || size);\n }", "function pad(img, origRows, origCols) {\n\n var rows = powerOf2(origRows);\n var cols = powerOf2(origCols);\n if (rows > cols) {\n cols = rows;\n } else {\n rows = cols;\n }\n var rowDiff = rows - origRows;\n var colDiff = cols - origCols;\n\n for (var i = 0; i < rows; i++) {\n if (i == origRows) {\n origCols = 0;\n }\n for (var j = origCols; j < cols; j++) {\n if (j == 0) {\n img[i] = [];\n }\n img[i][j] = '0';\n }\n }\n}", "function removeBorders() {\n for (let i = 0; i < resultingMap.length; i++) {\n for (let j = 0; j < resultingMap[i].length; j++) {\n if (i <= 5 || j <= 5 || i + 5 >= resultingMap.length || j + 5 >= resultingMap[i].length) {\n resultingMap[i][j] = 1.5;\n continue;\n }\n }\n }\n }", "function BottomEdge() {\n $( \"#target\" ).animate({paddingTop:\"+=310px\"});\n }", "getMaxBottomCellMargin(row) {\n if (isNullOrUndefined(row.childWidgets)) {\n return 0;\n }\n let value = 0;\n for (let i = 0; i < row.childWidgets.length; i++) {\n let cell = row.childWidgets[i];\n let bottomMargin = 0;\n if (cell.cellFormat.hasValue('bottomMargin')) {\n bottomMargin = HelperMethods.convertPointToPixel(cell.cellFormat.bottomMargin);\n }\n else if (row.rowFormat.hasValue('bottomMargin')) {\n bottomMargin = HelperMethods.convertPointToPixel(row.rowFormat.bottomMargin);\n }\n else {\n bottomMargin = HelperMethods.convertPointToPixel(row.ownerTable.tableFormat.bottomMargin);\n }\n if (bottomMargin > value) {\n value = bottomMargin;\n }\n }\n return value;\n }", "function setBottomPaddingToZero() {\n\tif (window.innerWidth > 700) {\n\t\tnavigation.style.paddingBottom = \"0%\";\n\t}\n}", "function fixGap() {\n const navPanel = document.querySelector(`td[valign=\"bottom\"]`);\n navPanel.removeAttribute(\"valign\");\n navPanel.removeAttribute(\"align\");\n}", "function dropRows() {\n var x, y;\n var bottomEmptyRow = null;\n for (y = 0; y < board.BOARD_HEIGHT; ++y) {\n if (isRowEmpty(y)) {\n // Only set the bottom row if it started out as null\n if (null === bottomEmptyRow) {\n bottomEmptyRow = y;\n }\n } else if (bottomEmptyRow !== null) {\n // move the row down\n for (x = 0; x < board.BOARD_WIDTH; ++x) {\n board.space[x][bottomEmptyRow] = board.space[x][y];\n board.space[x][y] = board.SKY;\n }\n bottomEmptyRow += 1;\n }\n }\n }", "updateRowHeightByCellSpacing(tableCollection, row, viewer) {\n if (row.ownerTable.tableFormat.cellSpacing > 0) {\n // In the Case of tableWidget is greater than one and rowWidget is start at the Top Position of the page. \n // In such case we have update the row height with half of cell spacing.\n // Remaining cases we have to update the entire hight\n // tslint:disable-next-line:max-line-length\n if (tableCollection.length > 1 && row.y === viewer.clientArea.y && viewer instanceof PageLayoutViewer) {\n row.height = row.height - HelperMethods.convertPointToPixel(row.ownerTable.tableFormat.cellSpacing) / 2;\n }\n }\n }", "function tw_stretch() {\n var i = $(window).width();\n $(\".row .tw-stretch-element-inside-column\").each(function () {\n var $this = $(this),\n row = $this.closest(\".row\"),\n cols = $this.closest('[class^=\"col-\"]'),\n colsheight = $this.closest('[class^=\"col-\"]').height(),\n rect = this.getBoundingClientRect(),\n l = row[0].getBoundingClientRect(),\n s = cols[0].getBoundingClientRect(),\n r = rect.left,\n d = i - rect.right,\n c = l.left + (parseFloat(row.css(\"padding-left\")) || 0),\n u = i - l.right + (parseFloat(row.css(\"padding-right\")) || 0),\n p = s.left,\n f = i - s.right,\n styles = {\n \"margin-left\": 0,\n \"margin-right\": 0\n };\n if (Math.round(c) === Math.round(p)) {\n var h = parseFloat($this.css(\"margin-left\") || 0);\n styles[\"margin-left\"] = h - r;\n }\n if (Math.round(u) === Math.round(f)) {\n var w = parseFloat($this.css(\"margin-right\") || 0);\n styles[\"margin-right\"] = w - d;\n }\n $this.css(styles);\n });\n }", "_applyRowHeight(value, old) {\n this.getPane().getRowConfig().setDefaultItemSize(value);\n }", "get xAxisAnnotationPaddingBottom() {\r\n return this.i.ng;\r\n }", "function getBottom(col) {\r\n\treturn (field[col].length - 1) * rowheight;\r\n}", "function tablePadding() {\n var header = $('.schedule-table-wrapper.active .schedule-table-stops-wrapper').height();\n $('.schedule-table-wrapper.active').css({'margin-top': header });\n $('.schedule-table-wrapper.active .schedule-table-stops-wrapper').css({'top': -header});\n }", "function undistributeHeight(els){els.height('');}", "function getPaddings(element) {\n var section = element.closest(SECTION_SEL);\n if (section.length) {\n return parseInt(section.css('padding-bottom')) + parseInt(section.css('padding-top'));\n }\n return 0;\n }", "withPadding(padding) {\n let r = this.copy();\n\n r.pad(padding);\n\n return r;\n }", "shiftRowsDown(row_index) {\n // replace each row with row above from bottom to top\n for (let i = row_index; i > 1; i--) {\n for (let j = 0; j < this.numCols; j++) {\n let topCell = this.rows[i - 1][j];\n let bottomCell = this.rows[i][j];\n bottomCell.block = topCell.block;\n bottomCell.filled = topCell.filled;\n\n if (bottomCell.block !== null) {\n bottomCell.block.y += this.cellHeight;\n }\n }\n }\n // erase top row\n for (let j = 0; j < this.numCols; j++) {\n let cell = this.rows[0][j];\n cell.block = null;\n cell.filled = false;\n }\n }", "function getRowRegionsMaxHeight(row) {\n var rowChildren = $(row).children();\n var maxHeight = 100;\n for (var x = 0; x < rowChildren.length; x++) {\n if ($(rowChildren.get(x)).outerHeight() > maxHeight) {\n maxHeight = $(rowChildren.get(x)).outerHeight();\n }\n }\n return maxHeight;\n }", "function makeThemLineUpNormallyInRowsWhyIsThisSoHard() {\n // The heights of each key in a single row.\n var heights = [],\n // The top position of keys in the current row.\n currentTop = false,\n // The 0-based index of the key at the start of the current row.\n startOfLineIdx = 0;\n\n $('.key-line').each(function(idx){\n var keyTop = $(this).position().top;\n\n if (currentTop !== false && currentTop !== keyTop) {\n // This key is at the start of a new row.\n // So give all keys in the previous row the height of the tallest\n // key in the row.\n $('.key-line').slice(startOfLineIdx,idx).height(d3.max(heights)); \n heights = [];\n startOfLineIdx = idx;\n } else if ((idx+1) == $('.key-line').length && heights.length > 0) {\n // The last element on the final row.\n // So give all keys in the final row the height of the tallest in it.\n $('.key-line').slice(startOfLineIdx,idx).height(d3.max(heights)); \n };\n \n heights.push($(this).height());\n currentTop = keyTop;\n });\n }", "function changePadding(){\n //get margin size and check for need here\n //var pl = document.getElementById('grid-container').style.paddingLeft;\n //document.getElementById(\"display\").innerHTML = pl;\n \n var pads = 0;\n var id3 = setInterval(frame, 30);\n function frame() {\n if (pads == 30){ clearInterval(id3); }\n else {\n pads++;\n document.getElementById(\"grid-container\").style.paddingLeft = 30-pads + \"vw\";\n document.getElementById(\"grid-container\").style.paddingRight = 30-pads + \"vw\";\n }\n }\n}", "function getRowRegionsMaxHeight(row) {\n var rowChildren = $(row).children();\n var maxHeight = 100;\n for (var x = 0; x < rowChildren.length; x++) {\n if ($(rowChildren.get(x)).outerHeight() > maxHeight) {\n maxHeight = $(rowChildren.get(x)).outerHeight();\n }\n }\n return maxHeight;\n }", "function applyTemplateNewLineHeight(item) {\n // the height seems to be calculated by the template row count (how many line of items does the template have)\n var rowCount = _options.panelRows;\n\n //calculate padding requirements based on detail-content..\n //ie. worst-case: create an invisible dom node now &find it's height.\n var lineHeight = 13; //we know cuz we wrote the custom css innit ;)\n item._sizePadding = Math.ceil(((rowCount * 2) * lineHeight) / _grid.getOptions().rowHeight);\n item._height = (item._sizePadding * _grid.getOptions().rowHeight);\n\n var idxParent = _dataView.getIdxById(item.id);\n for (var idx = 1; idx <= item._sizePadding; idx++) {\n _dataView.insertItem(idxParent + idx, getPaddingItem(item, idx));\n }\n }", "function eraseRow(x,k){\n for(var z=0;z<gridWidth;z++)\n {\n updateOccupyPropertyOfBlocks(x,z,0,k);\n updateBackgroundPropertyOfBlocks(x,z,defaultBackgroundColor,k);\n }\n }", "updateHeightForRowWidget(viewer, isUpdateVerticalPosition, tableCollection, rowCollection, rowWidget, isLayouted, endRowWidget, isInitialLayout) {\n for (let i = 0; i < rowWidget.childWidgets.length; i++) {\n let cellspacing = 0;\n let cellWidget = undefined;\n let childWidget = rowWidget.childWidgets[i];\n // if (childWidget instanceof TableCellWidget) {\n cellWidget = childWidget;\n // }\n let rowSpan = 1;\n rowSpan = cellWidget.cellFormat.rowSpan;\n cellspacing = HelperMethods.convertPointToPixel(cellWidget.ownerTable.tableFormat.cellSpacing);\n if (rowSpan > 1) {\n let currentRowWidgetIndex = rowWidget.containerWidget.childWidgets.indexOf(rowWidget);\n // tslint:disable-next-line:max-line-length\n let rowSpanWidgetEndIndex = currentRowWidgetIndex + rowSpan - 1 - (rowWidget.index - cellWidget.rowIndex);\n if (!isInitialLayout && (viewer.clientArea.bottom < cellWidget.y + cellWidget.height + cellWidget.margin.bottom\n || rowSpanWidgetEndIndex >= currentRowWidgetIndex + 1)) {\n this.splitSpannedCellWidget(cellWidget, tableCollection, rowCollection, viewer);\n }\n let spanEndRowWidget = rowWidget;\n if (rowSpanWidgetEndIndex > 0) {\n if (rowSpanWidgetEndIndex < rowWidget.containerWidget.childWidgets.length) {\n let childWidget = rowWidget.containerWidget.childWidgets[rowSpanWidgetEndIndex];\n if (childWidget instanceof TableRowWidget) {\n spanEndRowWidget = childWidget;\n if (spanEndRowWidget === endRowWidget) {\n spanEndRowWidget = rowWidget;\n }\n }\n }\n else {\n // tslint:disable-next-line:max-line-length\n spanEndRowWidget = rowWidget.containerWidget.childWidgets[rowWidget.containerWidget.childWidgets.length - 1];\n }\n }\n if (cellWidget.y + cellWidget.height + cellWidget.margin.bottom < spanEndRowWidget.y + spanEndRowWidget.height) {\n cellWidget.height = spanEndRowWidget.y + spanEndRowWidget.height - cellWidget.y - cellWidget.margin.bottom;\n // tslint:disable-next-line:max-line-length\n }\n else if (isLayouted && spanEndRowWidget && (spanEndRowWidget.y !== 0 && spanEndRowWidget.height !== 0) && cellWidget.y + cellWidget.height + cellWidget.margin.bottom > spanEndRowWidget.y + spanEndRowWidget.height) {\n spanEndRowWidget.height = cellWidget.y + cellWidget.height + cellWidget.margin.bottom - spanEndRowWidget.y;\n // tslint:disable-next-line:max-line-length\n //Update the next rowlayout widget location. Reason for the updation is previous row height is updated when cell height is greater. So already layouted next row location has to be updated again.\n // if (rowWidget === spanEndRowWidget && rowWidget.nextWidget instanceof TableRowWidget) {\n // let nextRow: TableRowWidget = rowWidget.nextWidget as TableRowWidget;\n // // Need to update on this further\n // // if (viewer.renderedElements.containsKey(nextRow)) {\n // // let nextWidget: TableRowWidget[] = viewer.renderedElements.get(nextRow) as TableRowWidget[];\n // // if (nextWidget.length > 0) {\n // // nextWidget[0].x = nextWidget[0].x;\n // // nextWidget[0].y = rowWidget.y + rowWidget.height;\n // // }\n // // }\n // }\n }\n }\n else {\n if (cellspacing > 0) {\n // In the Case of tableWidget is greater than one and rowWidget is start at the Top Position of the page. \n // In such case we have update the cell height with half of cell spacing.\n // Remaining cases we have to update the entire hight\n // tslint:disable-next-line:max-line-length\n if (tableCollection.length > 1 && rowWidget.y === viewer.clientArea.y && viewer instanceof PageLayoutViewer) {\n cellspacing = cellspacing / 2;\n }\n }\n cellWidget.height = rowWidget.height - cellWidget.margin.top - cellWidget.margin.bottom - cellspacing;\n }\n this.updateHeightForCellWidget(viewer, tableCollection, rowCollection, cellWidget);\n let widget = rowWidget.containerWidget;\n while (widget.containerWidget instanceof Widget) {\n widget = widget.containerWidget;\n }\n let page = undefined;\n if (widget instanceof BodyWidget) {\n page = widget.page;\n }\n // tslint:disable-next-line:max-line-length\n if ((viewer instanceof PageLayoutViewer && viewer.visiblePages.indexOf(page) !== -1) || isUpdateVerticalPosition) {\n this.updateCellVerticalPosition(cellWidget, false, false);\n }\n //Renders the current table row contents, after relayout based on editing.\n // if (viewer instanceof PageLayoutViewer && (viewer as PageLayoutViewer).visiblePages.indexOf(page) !== -1) {\n // //Added proper undefined condition check for Asynchronous operation.\n // if (!isNullOrUndefined(rowWidget.tableRow) && !isNullOrUndefined(rowWidget.tableRow.rowFormat)) {\n // this.viewer.updateScrollBars();\n // //this.render.renderTableCellWidget(page, cellWidget);\n // }\n // }\n }\n }", "updateRowHeightBySpannedCell(tableWidget, row, insertIndex) {\n let rowSpan = 1;\n if (tableWidget.childWidgets.length === 0 || insertIndex === 0) {\n this.updateRowHeight(row, row);\n return;\n }\n for (let i = 0; i < row.childWidgets.length; i++) {\n let cellWidget = row.childWidgets[i];\n // tslint:disable-next-line:max-line-length\n rowSpan = (isNullOrUndefined(cellWidget) || isNullOrUndefined(cellWidget.cellFormat)) ? rowSpan : cellWidget.cellFormat.rowSpan;\n this.updateSpannedRowCollection(rowSpan, row);\n }\n if (!isNullOrUndefined(row.ownerTable)) {\n for (let i = 0; i < row.ownerTable.spannedRowCollection.length; i++) {\n if (row.ownerTable.spannedRowCollection.keys[i] === row.index) {\n // Back track to previous table row widgets and update it height if vertical merge ends with this row.\n for (let j = 0; j < insertIndex; j++) {\n let prevRowWidget = tableWidget.childWidgets[j];\n this.updateRowHeight(prevRowWidget, row);\n }\n row.ownerTable.spannedRowCollection.remove(row.ownerTable.spannedRowCollection.keys[i]);\n break;\n }\n }\n }\n }", "setBackgroundImagePadding(valueNew){let t=e.ValueConverter.toObject(valueNew);null===t&&(t=this.getAttributeDefaultValueInternal(\"BackgroundImagePadding\"));let r=this.__objectResolvers.get(\"backgroundImagePadding\");r&&(r.watchDestroyer&&r.watchDestroyer(),r.resolver.destroy());let s=new e.Symbol.ObjectResolver(t);this.__objectResolvers.set(\"backgroundImagePadding\",{resolver:s,watchCallback:this.__onResolverForBackgroundImagePaddingWatchCallback,watchDestroyer:s.watch(this.__onResolverForBackgroundImagePaddingWatchCallback)})}", "function getPaddings(element){\n var section = element.closest(SECTION_SEL);\n if(section.length){\n return parseInt(section.css('padding-bottom')) + parseInt(section.css('padding-top'));\n }\n return 0;\n }", "set MainBackgroundImagePadding(value) {\n this._backgroundImagePadding = value;\n }", "get yAxisAnnotationPaddingBottom() {\r\n return this.i.nl;\r\n }", "function updatePadding(selection, root) {\n var textNode = selection.items[0].text ? selection.items[0] : selection.items[1];\n var rectNode = selection.items[0].text ? selection.items[1] : selection.items[0];\n\n // Extract H/V padding values from layer name\n var settings = rectNode.name.split(/[ ,]+/);\n var paddingW = parseFloat(settings[0]);\n var paddingH = parseFloat(settings[1]);\n\n var contentBounds = textNode.boundsInParent;\n rectNode.resize(contentBounds.width + paddingW*2, contentBounds.height + paddingH*2);\n rectNode.placeInParentCoordinates(rectNode.localBounds, { // move frame's visual top left to appropriate place\n x: contentBounds.x - paddingW,\n y: contentBounds.y - paddingH\n });\n}", "bottomRow() {\n return INDEX2ROW(this.bottomRight);\n }", "function fixColspan(row)\r\n{\r\n var tdElem = row.getElementsByTagName('td')[0];\r\n var oldColspan = parseInt(tdElem.getAttribute('colspan'));\r\n tdElem.setAttribute('colspan', oldColspan+4);\r\n}", "function cleanPadding(pad) {\n var padding = {\n top: 0,\n left: 0,\n right: 0,\n bottom: 0\n };\n if (typeof pad === 'number') return {\n top: pad,\n left: pad,\n right: pad,\n bottom: pad\n };\n ['top', 'bottm', 'right', 'left'].forEach(function (d) {\n if (pad[d]) padding[d] == pad[d];\n });\n return padding;\n } // Size can contain width or height attibutes. If either are unset the", "function footer_at_bottom() {\n\n var winWidth = $(window).width();\n var $footer = $('#footer');\n var $wrapper = $('#wrapper');\n var $footer_height = $footer.height();\n\n winWidth >= 960 ? $wrapper.css('paddingBottom',$footer_height) : $wrapper.css('paddingBottom',0)\n\n\n }", "function carveBottom(s, i, j) {\n if (i + 1 < (s.length)) {\n s[i][j] = s[i][j] + BOTTOM;\n s[i+1][j] = s[i+1][j] + TOP;\n }\n}", "function applyPadding(paddedElement, correspondingValue, className) {\n paddedElement.eq(0).hover(function(){\n $(this).find(correspondingValue).toggleClass(className);\n\n });\n }", "fillBelow(newTop) {\n const me = this,\n fillHeight = newTop - me.topRow.top - me.prependBufferHeight,\n recordCount = me.store.count,\n rowCount = me.rowCount;\n\n let accumulatedHeight = 0;\n\n // Repeat until we have filled empty height\n while (\n accumulatedHeight < fillHeight && // fill empty height\n me.topIndex + rowCount < recordCount && // as long as we have records left\n me.topRow.top + me.topRow.offsetHeight < newTop // and do not run move top row fully into view (can happen with var row height)\n ) {\n // We want to show next record at bottom of rows\n accumulatedHeight += me.displayRecordAtBottom();\n }\n }", "function changeGridConsoleRowHeight(newHeight) {\n var allm = document.getElementById('allmain');\n var navHeight = document.getElementById('nav').clientHeight + 'px';\n\n allm.style.gridTemplateRows = navHeight + ' ' + 'auto' + ' 10px ' + newHeight;\n}", "function equalizeHeight()\n{\n\tvar boxHeight = 0;\n\n\t$(\".eq-height\").removeAttr(\"style\");\n\n\t$(\".row\").each(function(){\n\n\t\t$(this).find(\".eq-height\").each(function(){\n\t\t\tvar currentBoxHeight = $(this).innerHeight();\n\t\t\tif(currentBoxHeight > boxHeight) boxHeight = currentBoxHeight;\n\t\t});\n\n\t\t$(this).find(\".eq-height\").css({\"height\":boxHeight-51+\"px\"});\n\t\t$(\".container\").css({\"height\":boxHeight+\"px\"});\n\n\t});\n}", "function setNewPadding(sankeyData) {\n columnMap = new Map();\n for (const [key, value] of Object.entries(sankeyData.nodes)) {\n if (columnMap.has(value.assessment)) {\n columnMap.set(value.assessment, columnMap.get(value.assessment) + 1)\n }\n else {\n columnMap.set(value.assessment, 1);\n }\n }\n let highestValue = 0;\n for (let value of columnMap.values()) {\n if (highestValue < value) {\n highestValue = value\n }\n }\n if (highestValue > 16) {\n padding = 20;\n }\n else if (highestValue > 10) {\n padding = 30;\n }\n else {\n padding = 40;\n }\n sankey = d3.sankey()\n .size([width, height])\n .nodeId(d => d.id)\n .nodeWidth(nodeWdt)\n .nodePadding(padding)\n .nodeAlign(d3.sankeyCenter)\n .nodeSort(null);\n }", "function fallDown(bottomRow, topRow) {\n // starting from the top, iterate upwards and bring down\n // any blocks with space beneath them\n for (let i = topRow - 1; i > 0; i--) {\n for (let j = 0; j < 10; j++) {\n // current row is pushed down to the first open row\n occupied[bottomRow][j] = occupied[i][j];\n\n // no longer any blocks in current row\n occupied[i][j] = 0;\n }\n\n // each time a new row is pushed down, the next open row available would be\n // the one above the current open row.\n bottomRow--;\n }\n}", "function arrangeScratchpad(event) {\n\tvar PADDING = 8;\n\t\n\tvar scratchPadRect = scratchpad.getBoundingClientRect();\n\tvar width = scratchPadRect.width;\n\tvar xOrigin = 5;\n\tvar yOrigin = 5;\n\t\n\tvar x = xOrigin;\n\tvar y = yOrigin;\n\t\n\tvar children = scratchpad.childNodes;\n\tvar maxHeight = 0;\n\t\n\tfor (var i = 0; i < children.length; i++) {\n\t if (children[i].nodeType != 3) {\n\t\tvar r = children[i];\n\t\t\n\t\tvar rBounding = r.getBoundingClientRect();\n\t\tif (rBounding.height > maxHeight) {\n\t\t maxHeight = rBounding.height;\n\t\t}\n\t\tr.style.top = y + \"px\";\n\t\tr.style.left = x + \"px\";\n\t\tx += rBounding.width + PADDING;\n\t\t\n\t\tif (x >= width - 25) {\n\t\t //We are going into a new row.\n\t\t x = xOrigin;\n\t\t y += maxHeight + PADDING;\n\t\t maxHeight = 0;\n\t\t}\n\t }\n\t}\n\t\n\t\n }", "function setNewPadding(sankeyData) {\n columnMap = new Map();\n for (const [key, value] of Object.entries(sankeyData.nodes)) {\n if (columnMap.has(value.assessment)) {\n columnMap.set(value.assessment, columnMap.get(value.assessment) + 1)\n }\n else {\n columnMap.set(value.assessment, 1);\n }\n }\n let highestValue = 0;\n for (let value of columnMap.values()) {\n if (highestValue < value) {\n highestValue = value\n }\n }\n if (highestValue > 16) {\n padding = 20;\n }\n else if (highestValue > 10) {\n padding = 30;\n }\n else {\n padding = 40;\n }\n sankey = d3.sankey()\n .size([width, height])\n .nodeId(d => d.id)\n .nodeWidth(nodeWdt)\n .nodePadding(padding)\n .nodeAlign(d3.sankeyCenter)\n .nodeSort(null);\n}", "function adjustMargins() {\n detectSpacesIn(body);\n} //Initiate recursion:", "function generateBrickBottom() {\n let row = 12;\n for(let i = 1; i <= canvas.width; i++) {\n ctx.fillStyle = '#000';\n ctx.save();\n ctx.fillRect((6 + row)*i, canvas.height - 8, 2, 6);\n ctx.fillRect((0 + row)*i, canvas.height - 14, 2, 6);\n ctx.fillRect((6 + row)*i, canvas.height - 20, 2, 6);\n }\n }", "getXpadding(chartData, allChartData, allRenderers) {\n return 0;\n }", "getBackgroundImagePadding(){return this.__background.imagePadding}", "padding() {\n const offset = this.bb.__offset(this.bb_pos, 28);\n return offset ? this.bb.readUint16(this.bb_pos + offset) : 0;\n }", "function lnhgt(){\n var lnhite = Math.round((($( window ).height())/3)-50);\n$('.linespace').css('height', lnhite);\n\n}", "function undistributeHeight(els) {\n els.height('');\n}", "function undistributeHeight(els) {\n els.height('');\n}", "function undistributeHeight(els) {\n els.height('');\n}", "function undistributeHeight(els) {\n els.height('');\n}", "function setCellPadStr(parameter) {\r\n\tvar Str='', j=0, ary = new Array(), top, bottom, left, right;\r\n\r\n\tStr+='padding: ';\r\n\tary=parameter.replace(/\\s+/g,'').split(',');\r\n\r\n\tswitch(ary.length) {\r\n\t\tcase 2:\r\n\t\t\ttop=bottom=ary[j];\r\n\t\t\tleft=right=ary[++j];\r\n\t\t\tbreak;\r\n\t\tcase 3:\r\n\t\t\ttop=ary[j];\r\n\t\t\tleft=right=ary[++j];\r\n\t\t\tbottom=ary[++j];\r\n\t\t\tbreak;\r\n\t\tcase 4:\r\n\t\t\ttop=ary[j];\r\n\t\t\tright=ary[++j];\r\n\t\t\tbottom=ary[++j];\r\n\t\t\tleft=ary[++j];\r\n\t\t\tbreak;\r\n\t}\r\n\r\n\tStr+= ((ary.length==1) ? ary[0] + 'px;' : top + 'px ' + right + 'px ' + bottom + 'px ' + left + 'px;');\r\n\r\n\treturn Str;\r\n}", "_isBottomAligned(align) {\n const [pinAlign, baseAlign] = align.split(' ');\n return pinAlign[0] === 'b' && pinAlign[0] === baseAlign[0];\n }", "function addPadding(arr) {\r\n var len = arr[arr.length - 1].length\r\n for (var i = 0; i < arr.length; i++) {\r\n if (arr[i].length < len) {\r\n for (var j = 0; j <= (len - arr[i].length); j++) {\r\n arr[i] = \"0\" + arr[i];\r\n }\r\n }\r\n }\r\n}", "updateChildLocationForRow(top, rowWidget) {\n let spacing = 0;\n if (rowWidget.ownerTable.tableFormat.cellSpacing > 0) {\n spacing = HelperMethods.convertPointToPixel(rowWidget.ownerTable.tableFormat.cellSpacing);\n }\n for (let i = 0; i < rowWidget.childWidgets.length; i++) {\n let cellWidget = rowWidget.childWidgets[i];\n cellWidget.x = cellWidget.x;\n cellWidget.y = top + cellWidget.margin.top + spacing;\n this.updateChildLocationForCell(cellWidget.y, cellWidget);\n }\n }", "get fixedBottomGap() { return this._fixedBottomGap; }", "padMarkerMap(){\n\t\tvar format = \" \",\n\t\t\twithgp = MarkerData.gp_array.length > 1 ;\n\n\n\t\tfor (var i=0; i < MarkerData.rs_array.length; i++){\n\t\t\tMarkerData.padded[i] = (MarkerData.rs_array[i] + format).slice(0,MarkerData.maxlen_marker);\n\n\t\t\tif (withgp){\n\t\t\t\tMarkerData.padded[i] += \" : \" + (MarkerData.gp_array[i] + format).slice(0,5); // 5 sf\n\t\t\t}\n\t\t}\n\t\tMarkerData.hasGPData = withgp\n\n\t\t// Also set display format\n\t\tHaploBlockFormat.hasGPData(withgp);\n\t}", "clearKnownHeights() {\n this.heightMap.clear();\n this.averageRowHeight = this.totalKnownHeight = 0;\n }", "function paddingBody() {\n\tvar styles = {\n \"padding-top\":padding\n\t\t};\n $('body').css(styles);\n}", "function RowLayoutResult(){this.layoutedBounds=new RectangleF(0,0,0,0);}", "function treemapLayout_position(row, rowFixedLength, rect, halfGapWidth, flush) {\n // When rowFixedLength === rect.width,\n // it is horizontal subdivision,\n // rowFixedLength is the width of the subdivision,\n // rowOtherLength is the height of the subdivision,\n // and nodes will be positioned from left to right.\n // wh[idx0WhenH] means: when horizontal,\n // wh[idx0WhenH] => wh[0] => 'width'.\n // xy[idx1WhenH] => xy[1] => 'y'.\n var idx0WhenH = rowFixedLength === rect.width ? 0 : 1;\n var idx1WhenH = 1 - idx0WhenH;\n var xy = ['x', 'y'];\n var wh = ['width', 'height'];\n var last = rect[xy[idx0WhenH]];\n var rowOtherLength = rowFixedLength ? row.area / rowFixedLength : 0;\n\n if (flush || rowOtherLength > rect[wh[idx1WhenH]]) {\n rowOtherLength = rect[wh[idx1WhenH]]; // over+underflow\n }\n\n for (var i = 0, rowLen = row.length; i < rowLen; i++) {\n var node = row[i];\n var nodeLayout = {};\n var step = rowOtherLength ? node.getLayout().area / rowOtherLength : 0;\n var wh1 = nodeLayout[wh[idx1WhenH]] = treemapLayout_mathMax(rowOtherLength - 2 * halfGapWidth, 0); // We use Math.max/min to avoid negative width/height when considering gap width.\n\n var remain = rect[xy[idx0WhenH]] + rect[wh[idx0WhenH]] - last;\n var modWH = i === rowLen - 1 || remain < step ? remain : step;\n var wh0 = nodeLayout[wh[idx0WhenH]] = treemapLayout_mathMax(modWH - 2 * halfGapWidth, 0);\n nodeLayout[xy[idx1WhenH]] = rect[xy[idx1WhenH]] + treemapLayout_mathMin(halfGapWidth, wh1 / 2);\n nodeLayout[xy[idx0WhenH]] = last + treemapLayout_mathMin(halfGapWidth, wh0 / 2);\n last += modWH;\n node.setLayout(nodeLayout, true);\n }\n\n rect[xy[idx1WhenH]] += rowOtherLength;\n rect[wh[idx1WhenH]] -= rowOtherLength;\n} // Return [containerWidth, containerHeight] as default.", "function adjustContentPadding() {\n var topElem = document.getElementsByClassName('oj-applayout-fixed-top')[0];\n var contentElem = document.getElementsByClassName('oj-applayout-content')[0];\n var bottomElem = document.getElementsByClassName('oj-applayout-fixed-bottom')[0];\n\n if (topElem) {\n contentElem.style.paddingTop = topElem.offsetHeight+'px';\n }\n if (bottomElem) {\n contentElem.style.paddingBottom = bottomElem.offsetHeight+'px';\n }\n // Add oj-complete marker class to signal that the content area can be unhidden.\n // See the CSS demo tab to see when the content area is hidden.\n contentElem.classList.add('oj-complete');\n }", "serializeRowFormat(writer, row) {\n this.serializeRowMargins(writer, row.rowFormat);\n writer.writeStartElement(undefined, 'trPr', this.wNamespace);\n //Serialize Row Height\n if (row.rowFormat.height > 0) {\n writer.writeStartElement(undefined, 'trHeight', this.wNamespace);\n if (row.rowFormat.heightType === 'Exactly') {\n writer.writeAttributeString('w', 'hRule', this.wNamespace, 'exact');\n }\n else if (row.rowFormat.heightType === 'AtLeast') {\n writer.writeAttributeString('w', 'hRule', this.wNamespace, 'atLeast');\n }\n let height = this.roundToTwoDecimal(row.rowFormat.height * this.twentiethOfPoint).toString();\n writer.writeAttributeString('w', 'val', this.wNamespace, height);\n writer.writeEndElement();\n }\n let rowFormat = row.rowFormat;\n // //Serialize 'gridBefore' element\n let gridBefore = rowFormat.gridBefore;\n if (gridBefore > 0) {\n writer.writeStartElement(undefined, 'gridBefore', this.wNamespace);\n writer.writeAttributeString('w', 'val', this.wNamespace, gridBefore.toString());\n writer.writeEndElement();\n }\n // //Serialize 'gridAfter' element\n let gridAfter = rowFormat.gridAfter;\n if (gridAfter > 0) {\n writer.writeStartElement(undefined, 'gridAfter', this.wNamespace);\n writer.writeAttributeString('w', 'val', this.wNamespace, gridAfter.toString());\n writer.writeEndElement();\n }\n // //Serialize 'wBefore' element \n if (gridBefore > 0) {\n writer.writeStartElement(undefined, 'wBefore', this.wNamespace);\n switch (rowFormat.gridBeforeWidthType) {\n case 'Percent':\n let width = this.roundToTwoDecimal(rowFormat.gridBeforeWidth * this.percentageFactor).toString();\n writer.writeAttributeString('w', 'val', this.wNamespace, width);\n writer.writeAttributeString('w', 'type', this.wNamespace, 'pct');\n break;\n case 'Point':\n let pointWidth = this.roundToTwoDecimal(rowFormat.gridBeforeWidth * this.twipsInOnePoint).toString();\n writer.writeAttributeString('w', 'val', this.wNamespace, pointWidth);\n writer.writeAttributeString('w', 'type', this.wNamespace, 'dxa');\n break;\n }\n writer.writeEndElement();\n }\n //Serialize 'wAfter' element\n if (gridAfter > 0) {\n writer.writeStartElement(undefined, 'wAfter', this.wNamespace);\n switch (rowFormat.gridAfterWidthType) {\n case 'Percent':\n let width = this.roundToTwoDecimal(rowFormat.gridAfterWidth * this.percentageFactor).toString();\n writer.writeAttributeString('w', 'val', this.wNamespace, width);\n writer.writeAttributeString('w', 'type', this.wNamespace, 'pct');\n break;\n case 'Point':\n let pointWidth = this.roundToTwoDecimal(rowFormat.gridAfterWidth * this.twipsInOnePoint).toString();\n writer.writeAttributeString('w', 'val', this.wNamespace, pointWidth);\n writer.writeAttributeString('w', 'type', this.wNamespace, 'dxa');\n break;\n }\n writer.writeEndElement();\n }\n //Serialize 'cantSplit' element \n if (!rowFormat.allowBreakAcrossPages) {\n writer.writeStartElement(undefined, 'cantSplit', this.wNamespace);\n writer.writeEndElement();\n }\n // //Serialize 'tblHeader' element \n if (rowFormat.isHeader) {\n writer.writeStartElement(undefined, 'tblHeader', this.wNamespace);\n writer.writeEndElement();\n }\n writer.writeEndElement();\n }", "function stbValign() {\n\t\t\t$(\".split-text-block.fullWidth .valign\").each(function(){\n\t\t\t\tvar height = $(this).outerHeight();\n\t\t\t\tvar margin = height / 2;\n\t\t\t\tvar rightHeight = $(this).parent('.right').siblings('.left').children('img').height();\n\t\t\t\tif (height > rightHeight) {\n\t\t\t\t\t// $(this).css({\"position\": \"relative\", \"margin-top\": \"inherit\", \"top\": \"inherit\", \"left\":\"inherit\", \"right\":\"inherit\", \"padding-bottom\":\"6rem\"});\n\t\t\t\t\t$(this).parent('.right').siblings('.left').height(height);\n\t\t\t\t} else {\n\t\t\t\t\t$(this).parent('.right').height(rightHeight).css('position','relative');\n\t\t\t\t\t$(this).css({\"position\": \"absolute\", \"margin-top\": \"-\"+margin+\"px\", \"top\": \"50%\", \"left\":\"0\", \"right\":\"0\", \"padding-bottom\":\"0\"});\n\t\t\t\t}\n\t\t\t\tif ($(window).width() < '868') {\n\t\t\t\t\t$(this).attr('style', '');\n\t\t\t\t\t$(this).parent('.right').siblings('.left').attr('style', '');\n\t\t\t\t}\n\t\t\t});\n\t\t}", "function undistributeHeight(els) {\n\tels.height('');\n}", "function undistributeHeight(els) {\n\tels.height('');\n}", "function undistributeHeight(els) {\n\tels.height('');\n}", "function undistributeHeight(els) {\n\tels.height('');\n}", "function undistributeHeight(els) {\n\tels.height('');\n}", "function undistributeHeight(els) {\n\tels.height('');\n}", "function undistributeHeight(els) {\n\tels.height('');\n}", "function undistributeHeight(els) {\n\tels.height('');\n}", "updateWidgetToRow(cell) {\n let viewer = this.viewer;\n //Adds table cell widget to owner row widget.\n let rowWidget = cell.ownerRow;\n let cellLeft = rowWidget.x;\n if (rowWidget.childWidgets.length > 0) {\n let lastWidget = rowWidget.childWidgets[rowWidget.childWidgets.length - 1];\n cellLeft = lastWidget.x + lastWidget.width + lastWidget.margin.right;\n }\n // rowWidget.childWidgets.push(cell);\n cell.containerWidget = rowWidget;\n //If the row height is set as Atleast then height is set to atleast height for the first cell of the row.\n // tslint:disable-next-line:max-line-length\n if (!isNullOrUndefined(cell.ownerRow) && cell.ownerRow.rowFormat.heightType !== 'Exactly' && HelperMethods.convertPointToPixel(cell.ownerRow.rowFormat.height) > 0 && cell.cellIndex === 0) {\n rowWidget.height = rowWidget.height + HelperMethods.convertPointToPixel(cell.ownerRow.rowFormat.height);\n }\n //Add condition not cell merged vertically.\n if (cell.cellFormat.rowSpan === 1) {\n let cellHeight = cell.height + cell.margin.top + cell.margin.bottom;\n if (rowWidget.height - HelperMethods.convertPointToPixel(cell.ownerTable.tableFormat.cellSpacing) < cellHeight) {\n rowWidget.height = cellHeight + HelperMethods.convertPointToPixel(cell.ownerTable.tableFormat.cellSpacing);\n }\n }\n }", "fillBelow(newTop) {\n const me = this,\n fillHeight = newTop - me.topRow.top - me.prependBufferHeight,\n recordCount = me.store.count,\n rowCount = me.rowCount;\n let accumulatedHeight = 0; // Repeat until we have filled empty height\n\n while (accumulatedHeight < fillHeight && // fill empty height\n me.topIndex + rowCount < recordCount && // as long as we have records left\n me.topRow.top + me.topRow.offsetHeight < newTop // and do not move top row fully into view (can happen with var row height)\n ) {\n // We want to show next record at bottom of rows\n accumulatedHeight += me.displayRecordAtBottom();\n }\n\n me.trigger('renderDone');\n }", "function alignLeft(row) {\r\n\tvar i, newRow = [];\r\n\trow = [+row[0], +row[1], +row[2], +row[3]];\r\n\r\n\tif((row[0] + row[1] + row[2] + row[3]) === 0) {\r\n\t\tnewRow = row;\r\n\t\treturn newRow; \r\n\t} else {\r\n\t\tfor(i = 0; i < row.length; i += 1) {\r\n\t\t\tif(row[i] > 0) {\r\n\t\t\t\tnewRow.push(row[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\tsumLeftRow(newRow).filter(cell => cell > 0);\r\n\r\n\t\tif(newRow.length < row.length) {\r\n\t\t\tvar j = new Array(row.length - newRow.length).fill(0);\r\n\t\t\tnewRow = newRow.concat(j);\r\n\t\t}\r\n\t\t}\r\n\treturn newRow;\t\t\r\n}", "function alignRight(row) {\r\n\tvar i, newRow = [];\r\n\trow = [+row[0], +row[1], +row[2], +row[3]];\r\n\r\n\tif((row[0] + row[1] + row[2] + row[3]) === 0) {\r\n\t\tnewRow = row;\r\n\t\treturn newRow;\r\n\t} else {\r\n\t\tfor(i = 0; i < row.length; i += 1) {\r\n\t\t\tif(row[i] > 0) {\r\n\t\t\t\tnewRow.push(row[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\tsumRightRow(newRow).filter(cell => cell > 0);\r\n\t\t\r\n\t\tif(newRow.length < row.length) {\r\n\t\t\tvar j = new Array(row.length - newRow.length).fill(0);\r\n\t\t\tnewRow = j.concat(newRow);\r\n\t\t}\r\n\r\n\t\t}\r\n\treturn newRow;\t\t\r\n}", "function undistributeHeight(els) {\n\t\tels.height('');\n\t}" ]
[ "0.74660003", "0.6997538", "0.6979533", "0.66051126", "0.6583506", "0.620614", "0.6187582", "0.6145343", "0.59674925", "0.5963164", "0.59057003", "0.5684015", "0.56322247", "0.55764294", "0.5542175", "0.5515858", "0.54533577", "0.5434285", "0.54274756", "0.54113954", "0.53829485", "0.5368706", "0.535968", "0.535298", "0.53249824", "0.5300434", "0.52986336", "0.5284723", "0.52714247", "0.5209514", "0.5175189", "0.51739836", "0.5165385", "0.5149909", "0.51477474", "0.5102814", "0.5094672", "0.50884444", "0.5068264", "0.5060786", "0.5050612", "0.5044573", "0.5033587", "0.5028538", "0.50232446", "0.5012156", "0.5006251", "0.50001234", "0.49987066", "0.49954814", "0.49916747", "0.49782887", "0.49769604", "0.49666342", "0.49545026", "0.49496567", "0.49437252", "0.4942795", "0.49284026", "0.49160793", "0.49108326", "0.49069738", "0.48968965", "0.4883037", "0.4882512", "0.48742288", "0.48663592", "0.48617524", "0.4837323", "0.48285875", "0.482538", "0.482538", "0.482538", "0.482538", "0.48153502", "0.48128998", "0.48116603", "0.4807891", "0.48078582", "0.47892848", "0.4789161", "0.47831124", "0.47821605", "0.4781632", "0.4777111", "0.47733068", "0.47680628", "0.47603634", "0.47603634", "0.47603634", "0.47603634", "0.47603634", "0.47603634", "0.47603634", "0.47603634", "0.47597563", "0.47581124", "0.4744415", "0.47407344", "0.47300777" ]
0.7457637
1
Sets the paddingbottom value, so that the total height is the given value for all regions in given row
function setRowsRegionsHeight(row, maxHeight) { var rowChildren = $(row).children(); for (var x = 0; x < rowChildren.length; x++) { if ($(rowChildren.get(x)).outerHeight() != maxHeight) { var defaultPadding = parseInt($(rowChildren.get(x)).css("padding-bottom").replace("px", "")); $(rowChildren.get(x)).css("padding-bottom", (defaultPadding + maxHeight - $(rowChildren.get(x)).outerHeight())); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setRowsRegionsHeight(row, maxHeight) {\n var rowChildren = $(row).children();\n for (var x = 0; x < rowChildren.length; x++) {\n if ($(rowChildren.get(x)).outerHeight() != maxHeight) {\n var defaultPadding = parseInt($(rowChildren.get(x)).css(\"padding-bottom\").replace(\"px\", \"\"));\n $(rowChildren.get(x)).css(\"padding-bottom\", (defaultPadding + maxHeight - $(rowChildren.get(x)).outerHeight()));\n }\n }\n }", "function resetRowsRegionsHeight(row) {\n // when called by each, first argument is a number instead of a row value\n var row = (typeof row === 'number') ? $(this) : row;\n\n var rowChildren = $(row).children();\n for (var x = 0; x < rowChildren.length; x++) {\n // reset to 5, the initial value before dragging\n $(rowChildren.get(x)).css(\"padding-bottom\", 5);\n }\n }", "function resetRowsRegionsHeight(row) {\n // when called by each, first argument is a number instead of a row value\n var row = (typeof row === 'number') ? $(this) : row;\n\n var rowChildren = $(row).children();\n for (var x = 0; x < rowChildren.length; x++) {\n // reset to 5, the initial value before dragging\n $(rowChildren.get(x)).css(\"padding-bottom\", 5);\n }\n }", "function adjustBottomRowRegionsHeight(row) {\n resetRowsRegionsHeight(row);\n var bodyHeight = $('body').outerHeight();\n var windowHeight = $(window).height();\n // Instances where no scroll bar currently exists\n if (windowHeight >= bodyHeight) {\n var pageHeight = $(\"#pageContent\").outerHeight();\n var headerHeight = bodyHeight - pageHeight;\n var upperRegionsMaxHeights = 0;\n if ($(\".upperRow\").length) {\n var rows = $(\".regions\").find(\".upperRow\");\n for (var x = 0; x < rows.length; x++) {\n var rowMaxHeight = getRowRegionsMaxHeight(rows.get(x));\n upperRegionsMaxHeights = upperRegionsMaxHeights + rowMaxHeight;\n }\n }\n // determine maximum size possible for bottom region\n // 50 px of buffer also removed to prevent scroll-bar from appearing in any cases\n var bottomPadding = (windowHeight - 50) - (upperRegionsMaxHeights + headerHeight);\n\n setRowsRegionsHeight(row, bottomPadding);\n }\n // Instances where scroll bar currently exists, can default to upper row behavior\n else {\n adjustUpperRowRegionsHeight(row);\n }\n // refresh sortables cached positions\n getNonLockedRegions().sortable(\"refreshPositions\");\n }", "function adjustBottomRowRegionsHeight(row) {\n resetRowsRegionsHeight(row);\n var bodyHeight = $('body').outerHeight();\n var windowHeight = $(window).height();\n // Instances where no scroll bar currently exists\n if (windowHeight >= bodyHeight) {\n var pageHeight = $(\"#pageContent\").outerHeight();\n var headerHeight = bodyHeight - pageHeight;\n var upperRegionsMaxHeights = 0;\n if ($(\".upperRow\").length) {\n var rows = $(\".regions\").find(\".upperRow\");\n for (var x = 0; x < rows.length; x++) {\n var rowMaxHeight = getRowRegionsMaxHeight(rows.get(x));\n upperRegionsMaxHeights = upperRegionsMaxHeights + rowMaxHeight;\n }\n }\n // determine maximum size possible for bottom region\n // 50 px of buffer also removed to prevent scroll-bar from appearing in any cases\n var bottomPadding = (windowHeight - 50) - (upperRegionsMaxHeights + headerHeight);\n\n setRowsRegionsHeight(row, bottomPadding);\n }\n // Instances where scroll bar currently exists, can default to upper row behavior\n else {\n adjustUpperRowRegionsHeight(row);\n }\n // refresh sortables cached positions\n getNonLockedRegions().sortable(\"refreshPositions\");\n }", "getVarPaddingBottom() {\n const {\n delta: {\n total, end, keeps, varLastCalcIndex, varAverSize\n }, size\n } = this;\n const last = total - 1;\n if (total - end <= keeps || varLastCalcIndex === last) {\n return this.getVarOffset(last) - this.getVarOffset(end);\n }\n // if unreached last zone or uncalculate real behind offset\n // return the estimate paddingBottom avoid too much calculate.\n return (total - end) * (varAverSize || size);\n }", "function setPad(reference, target){\n var padAmt=((reference.height() - target.height())/2);\n var styles = {\n \"padding-top\": padAmt,\n \"padding-bottom\": padAmt\n };\n target.css( styles );\n}", "function adjustRowRegionsHeights() {\n // handle region areas for upper rows\n if ($(\".upperRow\").length) {\n var rows = $(\".regions\").find(\".upperRow\");\n rows.each(adjustUpperRowRegionsHeight);\n }\n\n // handle region areas for the bottom row\n if ($(\".bottomRow\").length) {\n var row = $(\".regions\").find(\".bottomRow\");\n adjustBottomRowRegionsHeight(row)\n }\n }", "function adjustRowRegionsHeights() {\n // handle region areas for upper rows\n if ($(\".upperRow\").length) {\n var rows = $(\".regions\").find(\".upperRow\");\n rows.each(adjustUpperRowRegionsHeight);\n }\n\n // handle region areas for the bottom row\n if ($(\".bottomRow\").length) {\n var row = $(\".regions\").find(\".bottomRow\");\n adjustBottomRowRegionsHeight(row)\n }\n }", "function fullWidthRowPaddingAdjustCalc() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($('#boxed').length == 0) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$('.full-width-section[data-top-percent], .full-width-section[data-bottom-percent], .full-width-content[data-top-percent], .full-width-content[data-bottom-percent]').each(function () {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tvar $windowHeight = $window.width(),\r\n\t\t\t\t\t\t\t$topPadding = ($(this).attr('data-top-percent')) ? $(this).attr('data-top-percent') : 'skip',\r\n\t\t\t\t\t\t\t$bottomPadding = ($(this).attr('data-bottom-percent')) ? $(this).attr('data-bottom-percent') : 'skip';\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//top\r\n\t\t\t\t\t\t\tif ($topPadding != 'skip') {\r\n\t\t\t\t\t\t\t\t$(this).css('padding-top', $windowHeight * (parseInt($topPadding) / 100));\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\t//bottom\r\n\t\t\t\t\t\t\tif ($bottomPadding != 'skip') {\r\n\t\t\t\t\t\t\t\t$(this).css('padding-bottom', $windowHeight * (parseInt($bottomPadding) / 100));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "function adjustUpperRowRegionsHeight(row) {\n // when called by each, first argument is a number instead of a row value\n var row = (typeof row === 'number') ? $(this) : row;\n\n resetRowsRegionsHeight(row);\n\n // sets total region height to the height of tallest region\n setRowsRegionsHeight(row, getRowRegionsMaxHeight(row));\n\n // refresh sortables cached positions\n getNonLockedRegions().sortable(\"refreshPositions\");\n }", "set height(value) {}", "function addItemHeight(element) {\n\t\t//get key dimensions to calculate height\n\t\tlet dimensions = [\n\t\t\tparseInt(window.getComputedStyle(element, null).getPropertyValue('margin-top')),\n\t\t\tparseInt(window.getComputedStyle(element, null).getPropertyValue('margin-bottom')),\n\t\t\tparseInt(window.getComputedStyle(element, null).getPropertyValue('padding-top')),\n\t\t\tparseInt(window.getComputedStyle(element, null).getPropertyValue('padding-bottom')),\n\t\t\tparseInt(window.getComputedStyle(element, null).getPropertyValue('height'))\n\t\t];\n\t\titemHeight += arraySum(dimensions);\n\t}", "function adjustUpperRowRegionsHeight(row) {\n // when called by each, first argument is a number instead of a row value\n var row = (typeof row === 'number') ? $(this) : row;\n\n resetRowsRegionsHeight(row);\n\n // sets total region height to the height of tallest region\n setRowsRegionsHeight(row, getRowRegionsMaxHeight(row));\n\n // refresh sortables cached positions\n getNonLockedRegions().sortable(\"refreshPositions\");\n }", "function applyTemplateNewLineHeight(item) {\n // the height seems to be calculated by the template row count (how many line of items does the template have)\n var rowCount = _options.panelRows;\n\n //calculate padding requirements based on detail-content..\n //ie. worst-case: create an invisible dom node now &find it's height.\n var lineHeight = 13; //we know cuz we wrote the custom css innit ;)\n item._sizePadding = Math.ceil(((rowCount * 2) * lineHeight) / _grid.getOptions().rowHeight);\n item._height = (item._sizePadding * _grid.getOptions().rowHeight);\n\n var idxParent = _dataView.getIdxById(item.id);\n for (var idx = 1; idx <= item._sizePadding; idx++) {\n _dataView.insertItem(idxParent + idx, getPaddingItem(item, idx));\n }\n }", "function cookData(array, rowPadding) {\n\t\t\n\t\tvar prev = {i: 0, h: 0, y: 0};\n\t\tvar first = array[0];\n\t\t\n\t\t// discover custom attributes\n\t\tvar attributes = [];\n\t\tfor(key in first) {\n\t\t\tif(!(key in prev)) {\n\t\t\t\tattributes.push(key);\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(var i = 0; i < array.length; i++) {\n\t\t\tvar item = array[i];\n\t\t\t\n\t\t\t// copy attributes forward\n\t\t\tfor(var a = 0; a < attributes.length; a++) {\n\t\t\t\tvar attr = attributes[a];\n\t\t\t\tif(!(attr in item)) {\n\t\t\t\t\titem[attr] = prev[attr];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// copy height forward + ensure requested padding\n\t\t\tif(item.h) {\n\t\t\t\titem.h += rowPadding;\n\t\t\t} else {\n\t\t\t\titem.h = prev.h;\n\t\t\t}\n\t\t\t\n\t\t\t// calculate segment height & spanned indices\n\t\t\tvar span = item.i - prev.i;\n\t\t\titem.y = prev.y + span * prev.h;\n\t\t\t\n\t\t\tprev.last = item.i;\n\t\t\tprev.lastY = item.y;\n\t\t\tprev = item;\n\t\t}\n\t\t\n\t\t// last item needs to be given explicitly\n\t\tvar lastEntry = array[array.length - 1];\n\t\tarray.last = lastEntry.i;\n\t\tlastEntry.last = lastEntry.i + 1;\n\n\t\tvar lastSpan = lastEntry.last - lastEntry.i;\n\t\tvar totalHeight = lastEntry.y + lastEntry.h * lastSpan;\n\t\tlastEntry.lastY = totalHeight;\n\t\t\n\t\treturn totalHeight;\n\t}", "function getBottom(col) {\r\n\treturn (field[col].length - 1) * rowheight;\r\n}", "function calculate_padding() {\n padLeft = Math.floor((display.getWidth() - etch.getWidth()) / 2);\n padTop = Math.floor((display.getHeight() - etch.getHeight() - 5) / 2) + 1;\n}", "setHeight(_height) {\n this.bottom = this.top + _height;\n this.updateSecondaryValues();\n return this;\n }", "function BottomEdge() {\n $( \"#target\" ).animate({paddingTop:\"+=310px\"});\n }", "function footer_at_bottom() {\n\n var winWidth = $(window).width();\n var $footer = $('#footer');\n var $wrapper = $('#wrapper');\n var $footer_height = $footer.height();\n\n winWidth >= 960 ? $wrapper.css('paddingBottom',$footer_height) : $wrapper.css('paddingBottom',0)\n\n\n }", "getMaxBottomCellMargin(row) {\n if (isNullOrUndefined(row.childWidgets)) {\n return 0;\n }\n let value = 0;\n for (let i = 0; i < row.childWidgets.length; i++) {\n let cell = row.childWidgets[i];\n let bottomMargin = 0;\n if (cell.cellFormat.hasValue('bottomMargin')) {\n bottomMargin = HelperMethods.convertPointToPixel(cell.cellFormat.bottomMargin);\n }\n else if (row.rowFormat.hasValue('bottomMargin')) {\n bottomMargin = HelperMethods.convertPointToPixel(row.rowFormat.bottomMargin);\n }\n else {\n bottomMargin = HelperMethods.convertPointToPixel(row.ownerTable.tableFormat.bottomMargin);\n }\n if (bottomMargin > value) {\n value = bottomMargin;\n }\n }\n return value;\n }", "function lnhgt(){\n var lnhite = Math.round((($( window ).height())/3)-50);\n$('.linespace').css('height', lnhite);\n\n}", "function calcBoxHeight(data) {\n const line_height =\n (LINE_HEIGHT + LINE_VERTICAL_PAD) * data.lines.length + LINE_VERTICAL_PAD;\n // 4 lines means 5 paddings -> n lines means n+1 pads -> + LINE_VERTICAL_PAD\n return line_height;\n}", "get yAxisAnnotationPaddingBottom() {\r\n return this.i.nl;\r\n }", "get fixedBottomGap() { return this._fixedBottomGap; }", "function setBottomPaddingToZero() {\n\tif (window.innerWidth > 700) {\n\t\tnavigation.style.paddingBottom = \"0%\";\n\t}\n}", "function giveFooterSomeRoom() {\n footer = $('footer#footer');\n padding = footer.outerHeight();\n $('body').css('padding-bottom',padding);\n // console.log('padding applied');\n }", "function adjustCanvasHeight( callback )\n{\n\t$( \".content\" ).css( \"padding-bottom\", \"50px\" );\n\t$( \".content\" ).css( \"height\", \"auto\" );\n\tcallback();\n}", "get xAxisAnnotationPaddingBottom() {\r\n return this.i.ng;\r\n }", "function getHeight (data) {\n const ROW_SPACING = 198.125\n totalPostNum = data.length\n totalRow = (totalPostNum%stepsX !== 0) ? Math.floor(totalPostNum/stepsX) + 1 : totalPostNum/stepsX\n section_height = (ROW_SPACING * totalRow) + 110\n return section_height\n }", "function generateBrickBottom() {\n let row = 12;\n for(let i = 1; i <= canvas.width; i++) {\n ctx.fillStyle = '#000';\n ctx.save();\n ctx.fillRect((6 + row)*i, canvas.height - 8, 2, 6);\n ctx.fillRect((0 + row)*i, canvas.height - 14, 2, 6);\n ctx.fillRect((6 + row)*i, canvas.height - 20, 2, 6);\n }\n }", "updateRowHeightByCellSpacing(tableCollection, row, viewer) {\n if (row.ownerTable.tableFormat.cellSpacing > 0) {\n // In the Case of tableWidget is greater than one and rowWidget is start at the Top Position of the page. \n // In such case we have update the row height with half of cell spacing.\n // Remaining cases we have to update the entire hight\n // tslint:disable-next-line:max-line-length\n if (tableCollection.length > 1 && row.y === viewer.clientArea.y && viewer instanceof PageLayoutViewer) {\n row.height = row.height - HelperMethods.convertPointToPixel(row.ownerTable.tableFormat.cellSpacing) / 2;\n }\n }\n }", "function paddingBody() {\n\tvar styles = {\n \"padding-top\":padding\n\t\t};\n $('body').css(styles);\n}", "setVirtualHeight() {\n if (!this.settings.virtualized || !this.virtualRange) {\n return;\n }\n\n const bottom = this.virtualRange.totalHeight - this.virtualRange.bottom;\n const vTop = this.virtualRange.top;\n\n this.topSpacer = this.tableBody.find('.datagrid-virtual-row-top');\n this.bottomSpacer = this.tableBody.find('.datagrid-virtual-row-bottom');\n\n if (vTop > 0 && !this.topSpacer.length) {\n this.topSpacer = $(`<tr class=\"datagrid-virtual-row-top\" style=\"height: ${vTop}px\"><td colspan=\"${this.visibleColumns().length}\"></td></tr>`);\n this.tableBody.prepend(this.topSpacer);\n }\n\n if (vTop > 0 && this.topSpacer.length) {\n this.topSpacer.css('height', `${vTop}px`);\n }\n\n if (vTop === 0 && (this.topSpacer.length || this.virtualRange.topRow <= 1)) {\n this.topSpacer.remove();\n }\n\n if (bottom > 0 && !this.bottomSpacer.length) {\n this.bottomSpacer = $(`<tr class=\"datagrid-virtual-row-bottom\" style=\"height: ${bottom}px\"><td colspan=\"${this.visibleColumns().length}\"></td></tr>`);\n this.tableBody.append(this.bottomSpacer);\n }\n\n if (bottom > 0 && this.bottomSpacer.length) {\n this.bottomSpacer.css('height', `${bottom}px`);\n }\n\n if (bottom <= 0 && (this.bottomSpacer.length ||\n (this.virtualRange.bottomRow >= this.settings.dataset.length))) {\n this.bottomSpacer.remove();\n }\n }", "function changeGridConsoleRowHeight(newHeight) {\n var allm = document.getElementById('allmain');\n var navHeight = document.getElementById('nav').clientHeight + 'px';\n\n allm.style.gridTemplateRows = navHeight + ' ' + 'auto' + ' 10px ' + newHeight;\n}", "get _physicalBottom(){return this._physicalTop+this._physicalSize}", "_applyRowHeight(value, old) {\n this.getPane().getRowConfig().setDefaultItemSize(value);\n }", "function getPaddings(element) {\n var section = element.closest(SECTION_SEL);\n if (section.length) {\n return parseInt(section.css('padding-bottom')) + parseInt(section.css('padding-top'));\n }\n return 0;\n }", "function setRowsHeight() {\n var ulHeight = (options.items * options.height) + \"px\";\n rows.css(\"height\", ulHeight);\n }", "function breakHeight(bp) {\n bp == 'xs' ? y = 250 : y = 500;\n return y;\n }", "set MainBackgroundImagePadding(value) {\n this._backgroundImagePadding = value;\n }", "setHeight(height) {\n const realFeet = ((height * 3.93700) / 12);\n const feet = Math.floor(realFeet);\n const inches = Math.round((realFeet - feet) * 12);\n this.height = `${feet}' ${(`0${inches}`).substr(-2)}''`;\n }", "get _physicalBottom(){return this._physicalTop+this._physicalSize;}", "bottom(value = '') {\n this._topOffset = '';\n this._bottomOffset = value;\n this._alignItems = 'flex-end';\n return this;\n }", "set bottomMargin(value) {\n this.bottomMarginIn = value;\n this.notifyPropertyChanged('bottomMargin');\n }", "get contentHeight() {\n const rowManager = this.rowManager;\n return Math.max(rowManager.totalHeight, rowManager.bottomRow ? rowManager.bottomRow.bottom : 0);\n }", "setBottom(bottom) {\n this.setTop(bottom - this.offsetHeight);\n }", "function IsInBottomBorderRow(tree) {\n\n return +tree.getAttribute(\"data-y\") === TREE_COUNT_Y - 1;\n\n}", "function getPaddings(element){\n var section = element.closest(SECTION_SEL);\n if(section.length){\n return parseInt(section.css('padding-bottom')) + parseInt(section.css('padding-top'));\n }\n return 0;\n }", "function autoHeight() {\n var bodyHeight = $(\"body\").height();\n var vwptHeight = $(window).height();\n var footer = $(\"#footer\").height()\n var gap = vwptHeight - bodyHeight;\n if (vwptHeight > bodyHeight) {\n $(\"#dime\").css( \"padding-bottom\" , gap );\n } else {\n $(\"#dime\").css( \"padding-bottom\" , \"0\" );\n }\n}", "function setHeaderHeightPadding(element, direction){\n //Get the header height\n var headerHeight = getHeaderHeight();\n //Apply that height to the main wrapper as padding top\n $(element).css('padding-'+direction, headerHeight);\n}", "function fullWidthRowPaddingAdjust() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (nectarDOMInfo.usingMobileBrowser) {\r\n\t\t\t\t\t\tfullWidthRowPaddingAdjustCalc();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$window.on('resize', fullWidthRowPaddingAdjustCalc);\r\n\t\t\t\t\t\r\n\t\t\t\t}", "verticalPadding() {\n\t\t\treturn this.uiSetting?.dataObject?.verticalPadding ?? {};\n\t\t}", "set BottomCenter(value) {}", "putBottom(b, xOffset = 0, yOffset = 0) {\n let a = this\n b.x = (a.x + a.halfWidth - b.halfWidth) + xOffset\n b.y = (a.y + b.height) + yOffset\n }", "function tableHeaderHeightCalc() {\n var tableHeader = $('.tabled-page .tp-header');\n var tableHeaderHeight = tableHeader.outerHeight() - parseInt(tableHeader.css('padding-top'));\n $('.tabled-page-pt').css('padding-top', tableHeaderHeight + 'px')\n}", "function tablePadding() {\n var header = $('.schedule-table-wrapper.active .schedule-table-stops-wrapper').height();\n $('.schedule-table-wrapper.active').css({'margin-top': header });\n $('.schedule-table-wrapper.active .schedule-table-stops-wrapper').css({'top': -header});\n }", "fillBelow(newTop) {\n const me = this,\n fillHeight = newTop - me.topRow.top - me.prependBufferHeight,\n recordCount = me.store.count,\n rowCount = me.rowCount;\n\n let accumulatedHeight = 0;\n\n // Repeat until we have filled empty height\n while (\n accumulatedHeight < fillHeight && // fill empty height\n me.topIndex + rowCount < recordCount && // as long as we have records left\n me.topRow.top + me.topRow.offsetHeight < newTop // and do not run move top row fully into view (can happen with var row height)\n ) {\n // We want to show next record at bottom of rows\n accumulatedHeight += me.displayRecordAtBottom();\n }\n }", "get _physicalBottom() {\n return this._physicalTop + this._physicalSize;\n }", "function applyBottomBorderToGoupedValues() {\n var ss = SpreadsheetApp.getActiveSpreadsheet();\n var sheet = ss.getSheetByName('Master Inventory');\n var numColumns = sheet.getLastColumn();\n \n var columnToSearchZeroIndexed = 0;\n var rowRangesArray = getRowRangesOfGroupedValues(columnToSearchZeroIndexed);\n var numGroups = rowRangesArray.length;\n \n for (var i=0; i < numGroups; i++) {\n var firstTempRow = rowRangesArray[i][0];\n var lastTempRow = rowRangesArray[i][1];\n var numTempRows = lastTempRow - firstTempRow;\n \n var tempRange = sheet.getRange(firstTempRow, columnToSearchZeroIndexed+1, numTempRows+1, numColumns);\n tempRange.setBorder(false, false, true, false, false, false);\n }\n}", "set minHeight(value) {}", "function adjustVizHeight(){\n viz.style(\"height\", function(){\n w = parseInt(viz.style(\"width\"), 10);\n h = w*heightRatio;\n return h;\n })\n}", "function getRowRegionsMaxHeight(row) {\n var rowChildren = $(row).children();\n var maxHeight = 100;\n for (var x = 0; x < rowChildren.length; x++) {\n if ($(rowChildren.get(x)).outerHeight() > maxHeight) {\n maxHeight = $(rowChildren.get(x)).outerHeight();\n }\n }\n return maxHeight;\n }", "function equalizeHeight()\n{\n\tvar boxHeight = 0;\n\n\t$(\".eq-height\").removeAttr(\"style\");\n\n\t$(\".row\").each(function(){\n\n\t\t$(this).find(\".eq-height\").each(function(){\n\t\t\tvar currentBoxHeight = $(this).innerHeight();\n\t\t\tif(currentBoxHeight > boxHeight) boxHeight = currentBoxHeight;\n\t\t});\n\n\t\t$(this).find(\".eq-height\").css({\"height\":boxHeight-51+\"px\"});\n\t\t$(\".container\").css({\"height\":boxHeight+\"px\"});\n\n\t});\n}", "gridHeight(x,z,index,col,row) {\n return 0;\n }", "function getRowRegionsMaxHeight(row) {\n var rowChildren = $(row).children();\n var maxHeight = 100;\n for (var x = 0; x < rowChildren.length; x++) {\n if ($(rowChildren.get(x)).outerHeight() > maxHeight) {\n maxHeight = $(rowChildren.get(x)).outerHeight();\n }\n }\n return maxHeight;\n }", "function setUiGridHeight( ) {\r\n\t\t// apply shadow\r\n\t\t$( '#patientvaluesmultihistory' ).find( '> div:first' ).addClass( 'ui-shadow' );\r\n\t\tvar windowsheight = $( window ).height( );\r\n\t\t/*\r\n\t\t * Random number are paddings and margins of parents and grandparents\r\n\t\t */\r\n\t\tvar allowedHeight = windowsheight - ( windowsheight / 10 + 44 + 30 + 39 + 30 + 100 );\r\n\t\tvar uiBlockHeight = $( '#multi_values_history' ).height( );\r\n\t\tif ( uiBlockHeight > allowedHeight ) {\r\n\t\t\t$( '#values_history_terms' ).height( allowedHeight );\r\n\t\t}\r\n\t}", "function getHeight( t, a ) {\n\n\tvar h = 0,\n\t\ti;\n\n\tt.children().each( function() {\n\n\t\ti = $( this ).outerHeight( true );\n\n\t\th = h + i;\n\n\t});\n\n\tt.attr( 'data-height', h );\n\n}", "_getExtraBottomWidth(_id) {\n return this._getExtraSize(_id, 'bottom');\n }", "_getExtraBottomWidth(_id) {\n return this._getExtraSize(_id, 'bottom');\n }", "get bottom() { return this.top + this.height; }", "function setDynamicTopPadding(){ \n var $topNav_Container = $('div#topNav_Container');\n var topNav_Container_h = $topNav_Container.height();\n\n $(\"#topNav\").css(\"height\", topNav_Container_h+'px');\n $(\"#footer\").css(\"height\", topNav_Container_h+'px');\n $('.page2').css(\"height\", topNav_Container_h+'px');\n $('.page3').css(\"height\", topNav_Container_h+'px');\n $(\"#page1_inner\").css(\"margin-top\", topNav_Container_h+'px');\n\n var windowHeight = $(window).height();\n \n //for page 1\n var page1_inner_h = windowHeight - topNav_Container_h;\n $('#page1_inner').css(\"height\", page1_inner_h+'px');\n \n //for page 2\n $('#page2_inner').css(\"height\", windowHeight - topNav_Container_h+'px');\n\n //for page 3\n $('#page3_inner').css(\"height\", windowHeight - topNav_Container_h+'px');\n}", "function BottomBorder(BottomBorderX,BottomBorderY){\n fill(0,0,255);\n rect(BottomBorderX,BottomBorderY,1300,1000);\n}", "setBottom(_bottom) {\n this.bottom = _bottom;\n this.updateSecondaryValues();\n return this;\n }", "function Ba(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var a=e.widgets[t],n=a.node.parentNode;n&&(a.height=n.offsetHeight)}}", "function innerHeight(el){\n var style = window.getComputedStyle(el, null);\n return el.clientHeight -\n parseInt(style.getPropertyValue('padding-top'), 10) -\n parseInt(style.getPropertyValue('padding-bottom'), 10);\n }", "set bottomMargin(value) {\n if (value === this.bottomMarginIn) {\n return;\n }\n this.bottomMarginIn = value;\n this.notifyPropertyChanged('bottomMargin');\n }", "set bottomMargin(value) {\n if (value === this.bottomMarginIn) {\n return;\n }\n this.bottomMarginIn = value;\n this.notifyPropertyChanged('bottomMargin');\n }", "measureRowHeight() {\n const me = this,\n // Create a fake subgrid with one row, since styling for row is specified on .b-grid-subgrid .b-grid-row\n rowMeasureElement = DomHelper.createElement({\n tag: 'div',\n // TODO: should either get correct widgetClassList or query features for measure classes\n className: 'b-grid ' + (me.features.stripe ? 'b-stripe' : ''),\n style: 'position: absolute; visibility: hidden',\n html: '<div class=\"b-grid-subgrid\"><div class=\"b-grid-row\"></div></div>',\n parent: document.getElementById(me.appendTo) || document.body\n });\n\n // Use style height or default height from config.\n // Not using clientHeight since it will have some value even if no height specified in CSS\n const rowEl = rowMeasureElement.firstElementChild.firstElementChild,\n styleHeight = parseInt(DomHelper.getStyleValue(rowEl, 'height')),\n borderTop = parseInt(DomHelper.getStyleValue(rowEl, 'border-top-width')),\n borderBottom = parseInt(DomHelper.getStyleValue(rowEl, 'border-bottom-width'));\n\n // Change rowHeight if specified in styling, also remember that value to replace later if theme changes and\n // user has not explicitly set some other height\n if (me.rowHeight == null || me.rowHeight === me._rowHeightFromStyle) {\n me.rowHeight = !isNaN(styleHeight) && styleHeight ? styleHeight : me.defaultRowHeight;\n me._rowHeightFromStyle = me.rowHeight;\n }\n\n // this measurement will be added to rowHeight during rendering, to get correct cell height\n me._rowBorderHeight = borderTop + borderBottom;\n\n me._isRowMeasured = true;\n\n rowMeasureElement.remove();\n\n // There is a ticket about measuring the actual first row instead:\n // https://app.assembla.com/spaces/bryntum/tickets/5735-measure-first-real-rendered-row-for-rowheight/details\n }", "function isPadding(cell) {\n return cell[3];\n }", "innerHeightDependsOnChilds(){if(this.__controlStretchedHeight)return!0;if(this.__rowOptions)for(const rowOption of this.__rowOptions)if(\"Content\"===rowOption.heightMode)return!0;return super.innerHeightDependsOnChilds()}", "function eltdSetContentBottomMargin(){\n var uncoverFooter = $('.eltd-footer-uncover');\n\n if(uncoverFooter.length){\n $('.eltd-content').css('margin-bottom', $('.eltd-footer-inner').height());\n }\n }", "_fillBottomLineAtCells(x, y, width = 1) {\n this._ctx.fillRect(x * this._scaledCellWidth, (y + 1) * this._scaledCellHeight - window.devicePixelRatio - 1 /* Ensure it's drawn within the cell */, width * this._scaledCellWidth, window.devicePixelRatio);\n }", "_fillBottomLineAtCells(x, y, width = 1) {\n this._ctx.fillRect(x * this._scaledCellWidth, (y + 1) * this._scaledCellHeight - window.devicePixelRatio - 1 /* Ensure it's drawn within the cell */, width * this._scaledCellWidth, window.devicePixelRatio);\n }", "adjustFooterView() {\n setTimeout(function () {\n if (document.querySelector('.footer-section')) {\n document.querySelector('.footer-section').style.paddingBottom = document.querySelector('.order-summary-section').offsetHeight + 'px';\n } else if (document.querySelector('.vx-employee-footer')) {\n document.querySelector('.vx-employee-footer').style.paddingBottom = document.querySelector('.order-summary-section').offsetHeight + 'px';\n }\n }, 50);\n }", "function section4MiddleBottom( placeholder )\n {\n // //\\\\ config\n compCol =\n {\n \"SMALL CAP\": \"#eeaa44\",\n \"MID CAP\": \"#ccaa33\",\n \"LARGE CAP\": \"#bb6600\",\n \"DEBT & CASH\": \"#ffbb99\"\n }\n // \\\\// config\n\n\n placeholder.stack = fmethods.initTopPaneCell( \"Credit Rating Breakup\" );\n //placeholder.margin = [0,0,0,0]; //todm no dice ... chart is too low ...\n\n var JSONrecord = nheap.content_data\n [ \"Page 4\" ]\n [ \"EquityMarketCap&DebtCreditRatingBreakup.txt\" ]\n [ \"EquityMarketCap\" ][0];\n\n //------------------\n // //\\\\ chart legend\n //------------------\n //var seriesData = Object.keys( JSONrecord ).map( prop => [ prop, JSONrecord[ prop ]] );\n var chartData = Object.keys( JSONrecord ).map( prop => ({ name:prop, y:JSONrecord[ prop ] }) );\n var colors = chartData.map( serie => compCol[ serie.name ] );\n var tBody = [];\n chartData.forEach( (row,rix) => {\n var ix = rix%2;\n var iy = ( rix - ix ) /2;\n tBody[iy] = tBody[iy] || [];\n\n //----------------------------------------\n // //\\\\ tedious alignments of legend cells\n //----------------------------------------\n tBody[iy][2*ix] = { image:methods.getLabelImage({\n shape:'bar', color:compCol[ row.name ]\n }),\n fit:[8,8],\n alignment:'left',\n //.second row top margin for even vert. layout\n margin:[ 0, iy?6:6, 0, 0]\n };\n tBody[iy][2*ix+1] = [\n { text:row.y.toFixed(2)+'%', fontSize:11, color:'black', bold:true,\n alignment:'left',\n //.second row top margin for even vert. layout\n margin:[ 0, iy?0:0, 0, 0],\n lineHeight:1\n },\n { text:row.name.substring(0,14), color:'#666', alignment:'left', margin:[0,0,0,0], \n lineHeight:1\n }\n ];\n //----------------------------------------\n // \\\\// tedious alignments of legend cells\n //----------------------------------------\n\n });\n //------------------\n // \\\\// chart legend\n //------------------\n\n\n\n //==============================\n // //\\\\ chart\n //==============================\n var chartPlaceholder = {\n //image: will come from export \n fit:[110,110],\n margin: [25,0,0,0]\n };\n\n placeholder.stack[1] = fmethods.layt({\n margin : [0,0,0,0],\n widths : [ '100%', '100%' ],\n pads : { left:0, top:20, right:0, bottom:0 },\n rows : 2,\n body : [\n ////layout is vertical: one column\n //.first column\n [ chartPlaceholder ],\n //.second column\n [\n fmethods.layt({\n margin : [20,0,0,0],\n widths: [ '10%', '30%', '10%', '40%' ],\n cols : 4,\n rows : 2,\n fontSize: 9,\n bordCol : '#fff',\n body : tBody\n }).tbl\n ]\n ]\n }).tbl;\n\n contCharts.push({ \n ddContRack : chartPlaceholder,\n //---------------------------\n // //\\\\ chart options\n //---------------------------\n options :\n {\n chart: {\n plotBackgroundColor: null,\n plotBorderWidth: null,\n plotShadow: false,\n type: 'pie'\n ,width: 460\n ,height: 460\n },\n\n \"exporting\": {\n \"enabled\": false\n },\n \"credits\": {\n \"enabled\": false\n },\n \n legend: {\n enabled: false,\n },\n\n title: {\n text: ''\n },\n plotOptions: {\n pie: {\n dataLabels: {\n enabled: false\n },\n colors : colors,\n showInLegend: true\n },\n series: {\n animation: false\n }\n },\n series: [{\n colorByPoint: true,\n type: 'pie',\n innerSize: '83%',\n data: chartData\n }]\n }\n //---------------------------\n // \\\\// chart options\n //---------------------------\n });\n //==============================\n // \\\\// chart\n //==============================\n\n\n\n return placeholder;\n }", "function updatePadding(selection, root) {\n var textNode = selection.items[0].text ? selection.items[0] : selection.items[1];\n var rectNode = selection.items[0].text ? selection.items[1] : selection.items[0];\n\n // Extract H/V padding values from layer name\n var settings = rectNode.name.split(/[ ,]+/);\n var paddingW = parseFloat(settings[0]);\n var paddingH = parseFloat(settings[1]);\n\n var contentBounds = textNode.boundsInParent;\n rectNode.resize(contentBounds.width + paddingW*2, contentBounds.height + paddingH*2);\n rectNode.placeInParentCoordinates(rectNode.localBounds, { // move frame's visual top left to appropriate place\n x: contentBounds.x - paddingW,\n y: contentBounds.y - paddingH\n });\n}", "function brickLineBottom() {\n ctx.fillStyle = '#000';\n ctx.save();\n ctx.fillRect(0, canvas.height - 2, canvas.width, 2);\n ctx.fillRect(0, canvas.height - 8, canvas.width, 2);\n ctx.fillRect(0, canvas.height - 14, canvas.width, 2);\n ctx.fillRect(0, canvas.height - 20, canvas.width, 2);\n }", "function setCellPadStr(parameter) {\r\n\tvar Str='', j=0, ary = new Array(), top, bottom, left, right;\r\n\r\n\tStr+='padding: ';\r\n\tary=parameter.replace(/\\s+/g,'').split(',');\r\n\r\n\tswitch(ary.length) {\r\n\t\tcase 2:\r\n\t\t\ttop=bottom=ary[j];\r\n\t\t\tleft=right=ary[++j];\r\n\t\t\tbreak;\r\n\t\tcase 3:\r\n\t\t\ttop=ary[j];\r\n\t\t\tleft=right=ary[++j];\r\n\t\t\tbottom=ary[++j];\r\n\t\t\tbreak;\r\n\t\tcase 4:\r\n\t\t\ttop=ary[j];\r\n\t\t\tright=ary[++j];\r\n\t\t\tbottom=ary[++j];\r\n\t\t\tleft=ary[++j];\r\n\t\t\tbreak;\r\n\t}\r\n\r\n\tStr+= ((ary.length==1) ? ary[0] + 'px;' : top + 'px ' + right + 'px ' + bottom + 'px ' + left + 'px;');\r\n\r\n\treturn Str;\r\n}", "setupBottomMargin() {\n const height = document.getElementById('columnTooltip').clientHeight\n document.getElementById('columnTooltip').style.marginBottom = `${-height}px`\n }", "get bottom() {\n return this.y + this.height\n }", "get rowHeight() { return this._rowHeight; }", "height(height) {\n return this.attr('markerHeight', height);\n }", "function setGutterHeight(){\n var header = document.querySelector('.header'),\n gutter = document.querySelector('.header_gutter');\n gutter.style.height = header.offsetHeight + 'px';\n }", "pad() {\n const paddedGame = Game.duplicate(this);\n\n // add empty rows to top and bottom of grid\n paddedGame.cells[this.origin.y - 1] = {};\n paddedGame.cells[this.origin.y + this.height] = {};\n\n // update Game dimensions\n paddedGame.width += 2;\n paddedGame.height += 2;\n paddedGame.origin.x--;\n paddedGame.origin.y--;\n\n return paddedGame;\n }", "function undistributeHeight(els){els.height('');}", "function footerBottom(){\n\tvar $footer = $('.footer');\n\tif($footer.length){\n\t\tvar $tplSpacer = $('<div />', {\n\t\t\tclass: 'spacer'\n\t\t});\n\n\t\t$('.main').after($tplSpacer.clone());\n\n\t\t$(window).on('load resizeByWidth', function () {\n\t\t\tvar footerOuterHeight = $footer.outerHeight();\n\t\t\t$footer.css({\n\t\t\t\t'margin-top': -footerOuterHeight\n\t\t\t});\n\n\t\t\t$('.spacer').css({\n\t\t\t\t'height': footerOuterHeight\n\t\t\t});\n\t\t});\n\t}\n}", "function carveBottom(s, i, j) {\n if (i + 1 < (s.length)) {\n s[i][j] = s[i][j] + BOTTOM;\n s[i+1][j] = s[i+1][j] + TOP;\n }\n}", "updateHeightForRowWidget(viewer, isUpdateVerticalPosition, tableCollection, rowCollection, rowWidget, isLayouted, endRowWidget, isInitialLayout) {\n for (let i = 0; i < rowWidget.childWidgets.length; i++) {\n let cellspacing = 0;\n let cellWidget = undefined;\n let childWidget = rowWidget.childWidgets[i];\n // if (childWidget instanceof TableCellWidget) {\n cellWidget = childWidget;\n // }\n let rowSpan = 1;\n rowSpan = cellWidget.cellFormat.rowSpan;\n cellspacing = HelperMethods.convertPointToPixel(cellWidget.ownerTable.tableFormat.cellSpacing);\n if (rowSpan > 1) {\n let currentRowWidgetIndex = rowWidget.containerWidget.childWidgets.indexOf(rowWidget);\n // tslint:disable-next-line:max-line-length\n let rowSpanWidgetEndIndex = currentRowWidgetIndex + rowSpan - 1 - (rowWidget.index - cellWidget.rowIndex);\n if (!isInitialLayout && (viewer.clientArea.bottom < cellWidget.y + cellWidget.height + cellWidget.margin.bottom\n || rowSpanWidgetEndIndex >= currentRowWidgetIndex + 1)) {\n this.splitSpannedCellWidget(cellWidget, tableCollection, rowCollection, viewer);\n }\n let spanEndRowWidget = rowWidget;\n if (rowSpanWidgetEndIndex > 0) {\n if (rowSpanWidgetEndIndex < rowWidget.containerWidget.childWidgets.length) {\n let childWidget = rowWidget.containerWidget.childWidgets[rowSpanWidgetEndIndex];\n if (childWidget instanceof TableRowWidget) {\n spanEndRowWidget = childWidget;\n if (spanEndRowWidget === endRowWidget) {\n spanEndRowWidget = rowWidget;\n }\n }\n }\n else {\n // tslint:disable-next-line:max-line-length\n spanEndRowWidget = rowWidget.containerWidget.childWidgets[rowWidget.containerWidget.childWidgets.length - 1];\n }\n }\n if (cellWidget.y + cellWidget.height + cellWidget.margin.bottom < spanEndRowWidget.y + spanEndRowWidget.height) {\n cellWidget.height = spanEndRowWidget.y + spanEndRowWidget.height - cellWidget.y - cellWidget.margin.bottom;\n // tslint:disable-next-line:max-line-length\n }\n else if (isLayouted && spanEndRowWidget && (spanEndRowWidget.y !== 0 && spanEndRowWidget.height !== 0) && cellWidget.y + cellWidget.height + cellWidget.margin.bottom > spanEndRowWidget.y + spanEndRowWidget.height) {\n spanEndRowWidget.height = cellWidget.y + cellWidget.height + cellWidget.margin.bottom - spanEndRowWidget.y;\n // tslint:disable-next-line:max-line-length\n //Update the next rowlayout widget location. Reason for the updation is previous row height is updated when cell height is greater. So already layouted next row location has to be updated again.\n // if (rowWidget === spanEndRowWidget && rowWidget.nextWidget instanceof TableRowWidget) {\n // let nextRow: TableRowWidget = rowWidget.nextWidget as TableRowWidget;\n // // Need to update on this further\n // // if (viewer.renderedElements.containsKey(nextRow)) {\n // // let nextWidget: TableRowWidget[] = viewer.renderedElements.get(nextRow) as TableRowWidget[];\n // // if (nextWidget.length > 0) {\n // // nextWidget[0].x = nextWidget[0].x;\n // // nextWidget[0].y = rowWidget.y + rowWidget.height;\n // // }\n // // }\n // }\n }\n }\n else {\n if (cellspacing > 0) {\n // In the Case of tableWidget is greater than one and rowWidget is start at the Top Position of the page. \n // In such case we have update the cell height with half of cell spacing.\n // Remaining cases we have to update the entire hight\n // tslint:disable-next-line:max-line-length\n if (tableCollection.length > 1 && rowWidget.y === viewer.clientArea.y && viewer instanceof PageLayoutViewer) {\n cellspacing = cellspacing / 2;\n }\n }\n cellWidget.height = rowWidget.height - cellWidget.margin.top - cellWidget.margin.bottom - cellspacing;\n }\n this.updateHeightForCellWidget(viewer, tableCollection, rowCollection, cellWidget);\n let widget = rowWidget.containerWidget;\n while (widget.containerWidget instanceof Widget) {\n widget = widget.containerWidget;\n }\n let page = undefined;\n if (widget instanceof BodyWidget) {\n page = widget.page;\n }\n // tslint:disable-next-line:max-line-length\n if ((viewer instanceof PageLayoutViewer && viewer.visiblePages.indexOf(page) !== -1) || isUpdateVerticalPosition) {\n this.updateCellVerticalPosition(cellWidget, false, false);\n }\n //Renders the current table row contents, after relayout based on editing.\n // if (viewer instanceof PageLayoutViewer && (viewer as PageLayoutViewer).visiblePages.indexOf(page) !== -1) {\n // //Added proper undefined condition check for Asynchronous operation.\n // if (!isNullOrUndefined(rowWidget.tableRow) && !isNullOrUndefined(rowWidget.tableRow.rowFormat)) {\n // this.viewer.updateScrollBars();\n // //this.render.renderTableCellWidget(page, cellWidget);\n // }\n // }\n }\n }" ]
[ "0.68334526", "0.6578797", "0.6561409", "0.630481", "0.6295874", "0.5793617", "0.56938", "0.5602352", "0.5601591", "0.55623657", "0.55230147", "0.55177695", "0.54822874", "0.54765254", "0.5461051", "0.5428732", "0.5417098", "0.5392952", "0.53739333", "0.5355399", "0.5340248", "0.5331257", "0.5323316", "0.5305571", "0.5301572", "0.52733046", "0.52558535", "0.52530986", "0.52315515", "0.52279156", "0.51995003", "0.519938", "0.5197742", "0.51977307", "0.51580775", "0.51559615", "0.5142641", "0.5134269", "0.51315063", "0.51309526", "0.5098933", "0.5086507", "0.5069428", "0.50692195", "0.5064882", "0.5064245", "0.50592214", "0.5055871", "0.5039288", "0.50373", "0.50263214", "0.50114137", "0.5011157", "0.49995092", "0.49991965", "0.4980558", "0.49804386", "0.4977484", "0.4969131", "0.4965017", "0.4952398", "0.49406964", "0.49377644", "0.49092242", "0.49063858", "0.4906158", "0.49015173", "0.4896795", "0.48945785", "0.48937404", "0.48937404", "0.48900336", "0.48815432", "0.48687878", "0.48685718", "0.48684487", "0.486627", "0.48649195", "0.48649195", "0.48637977", "0.48596182", "0.48583004", "0.48559448", "0.48500803", "0.48500803", "0.48459035", "0.48388788", "0.48282063", "0.4825952", "0.48250937", "0.48147926", "0.4806615", "0.47863322", "0.4786201", "0.4782024", "0.47793922", "0.47779945", "0.4776235", "0.47713014", "0.47602522" ]
0.6856896
0
Takes care of the UI part of the widget rendering. Depends heavily on the HTML structure
function initWidgetUI() { $(".widget-wrapper").each(function () { var widgetId = extractObjectIdFromElementId($(this).attr("id")); styleWidgetButtons(widgetId); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initHtml () {\n\t\t\t$container.addClass(\"ibm-widget-processed\");\n\n\t\t\tif (config.type === \"simple\") {\n\t\t\t\t$hideables.addClass(\"ibm-hide\");\n\t\t\t}\n\n\t\t\tif (config.type === \"panel\") {\n\t\t\t\t$headings.removeClass(\"ibm-active\");\n\t\t\t\t$containers.slideUp(slideupSpeed);\n\t\t\t}\n\t\t}", "initHtml() {\n\t\tlet cx = name => className(name, this.service);\n\t\tlet widget = this.widget;\n\t\tlet options = this.options;\n\n\t\t// Remove existing class (.facebook) with a proper one\n\t\twidget.classList.remove(this.service);\n\t\tcx('widget').split(' ').forEach(cls => widget.classList.add(cls));\n\n\t\t// Button:\n\t\t// 1. Normal button with <button> tag.\n\t\t// 2. Link <a> if the service has the clickUrl option.\n\t\t// 3. Link <a> with .social-likes__invisible-button class if has clickUrl option but widget markup has no text.\n\t\t// 4. No button if there’s no text in the markup and no clickUrl option.\n\t\tlet buttonHtml = '';\n\t\tlet oldHtml = widget.innerHTML.trim();\n\t\tif (options.clickUrl || oldHtml) {\n\t\t\tlet buttonTag = 'div';\n\t\t\tlet buttonHref = '';\n\t\t\tlet buttonClasses = cx('button');\n\t\t\tif (options.clickUrl) {\n\t\t\t\tlet url = this.makeUrl(options.clickUrl);\n\t\t\t\tbuttonTag = 'a';\n\t\t\t\tbuttonHref = `href=\"${url}\"`;\n\t\t\t\tif (!oldHtml) {\n\t\t\t\t\tbuttonClasses = cx('invisible-button');\n\t\t\t\t}\n\t\t\t}\n\t\t\tbuttonHtml = `\n\t\t\t\t<${buttonTag} ${buttonHref} class=\"${buttonClasses}\">\n\t\t\t\t\t${oldHtml}\n\t\t\t\t</${buttonTag}>\n\t\t\t`;\n\t\t}\n\t\telse {\n\t\t\twidget.classList.add(className('widget_notext'));\n\t\t}\n\n\t\t// Icon\n\t\tlet svgHtml = svg(this.options.icon, cx('icon'));\n\n\t\twidget.innerHTML = svgHtml + buttonHtml;\n\t}", "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 this._addChooserHandler();\n this._addLoggerListeners();\n this._addButtonHandler();\n }", "function buildUI(){\t\n\t\t\n\t\treturn;\n\t\t\n\t}", "render(){\n\t\tif(this.has_elements){\n\t\t\tthis.$title.html(this.form_data.title);\n\t\t\tthis.$pb_form.hide();\n\t\t\tthis.create_reset_button();\n\t\t\tthis.create_submit_button();\n\t\t\tthis.$content_container.append(this.$wrapper);\n\t\t}\n\t}", "_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 }", "function initHtml () {\n\t\t\t$container.addClass(\"ibm-widget-processed\");\n\n\t\t\t$listItems = $container.find(\"li\");\n\t\t\t\n\t\t\t$listItems.each(function () {\n\t\t\t\tvar $li = $(this);\n\n\t\t\t\t// If they coded the HTML with the new way (don't put the link in there), add it.\n\t\t\t\tif ($(\" > a.ibm-twisty-trigger\", $li).length === 0 && $(\" > .ibm-twisty-head\", $li).length === 1){\n\t\t\t\t\t$li.prepend(twistyTriggerHtml);\n\t\t\t\t}\n\n\t\t\t\t// Now adjust the HTML for the v18 way to make the twisty link/control\n\t\t\t\t$(\" > a.ibm-twisty-trigger\", $li).html($(\" > .ibm-twisty-head\", $li).html());\n\t\t\t\t$(\" > .ibm-twisty-head\", $li).remove();\n\n\t\t\t\tif ($li.data(\"open\") !== true) {\n\t\t\t\t\tcollapse($li);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\texpand($li);\n\t\t\t\t}\n\t\t\t});\t\t\t\n\t\t}", "_render(html){this.$.container.innerHTML=html}", "_render() {\n\n this._el.innerHTML = `\n <div class='itk-slider'>\n <button class='show-prev-btn'> left </button>\n <img class='slide-img' src=''>\n <button class='show-next-btn'> right </button>\n </div>`;\n\n this.showPrevBtn = this._el.querySelector('.show-prev-btn');\n this.showNextBtn = this._el.querySelector('.show-next-btn');\n this.slideImage = this._el.querySelector('.slide-img');\n }", "renderHTML() {\n \n }", "onAfterRendering() {}", "render() {\n this._userEvent('beforeRender');\n const html = this.template.render({data: this.viewData}, (data) => {\n return this.wrapTemplate(data);\n });\n if (!this.wrapper) {\n this.wrapper = this._createWrapper();\n }\n this.updateNode(this.wrapper, html);\n this.resize();\n this._userEvent('afterRender');\n }", "render() {\n this.widgets.forEach((widget) => {\n widget.render();\n });\n }", "_drawUi() {\n\t\tthis.elementReplyForm.reset()\n\t\tthis.elementEditForm.reset()\n\t\tif(this.commentJSON.removed)\n\t\t\tthis._drawRemoved()\n\t\telse if(getToken())\n\t\t\tthis._drawUiAuthenticated()\n\t\telse\n\t\t\tthis._drawUiAnonymous()\n\t}", "function HTMLUI () {}", "render(){\n //createDom (tag, type, name, value, domClass, id, parent)\n this.containerDom = this.htmlHelper.createDom('div', this.parentDom,this.domClass + '_conatiner')\n this.dom = this.htmlHelper.createDom('canvas', this.containerDom);\n this.dom.style.touchAction=\"none\"; // prevent default browser actions\n\n this.setContextData(this.defaultLineWidth, '#000000')\n }", "function _doIt(inWidget) {\r\n\t\t\t\t\tvar subWidgets, container, labelObj, anArray, anObject, aProperty, aValue;\r\n\r\n\t\t\t\t\tif (inWidget) {\r\n\t\t\t\t\t\tswitch (inWidget.kind) {\r\n\t\t\t\t\t\tcase 'dataGrid':\r\n\t\t\t\t\t\t\tinWidget.columns().forEach(function(inColumn) {\r\n\t\t\t\t\t\t\t\tinColumn.title = _getLocalizedValue(inColumn.title);\r\n\t\t\t\t\t\t\t\tinColumn.gridview._private.globals.headerContainerNode.cells[inColumn.columnNumber].title.html(inColumn.title);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tcase 'autoForm':\r\n\t\t\t\t\t\tcase 'queryForm':\r\n\t\t\t\t\t\t\t// Hum, the autoForm class can be used for an autoForm or a queryForm...\r\n\t\t\t\t\t\t\tanArray = $('#' + inWidget.id + ' .waf-form-att-label-text');\r\n\t\t\t\t\t\t\tif (anArray.length > 0) { // We have a true autoform\r\n\t\t\t\t\t\t\t\tfor (i = 0, max = anArray.length; i < max; i++) {\r\n\t\t\t\t\t\t\t\t\tanObject = anArray[i];\r\n\t\t\t\t\t\t\t\t\tanObject.innerText = _getLocalizedValue(anObject.innerText);\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\telse {\r\n\t\t\t\t\t\t\t\tanArray = $('#' + inWidget.id + ' .attribute-div');\r\n\t\t\t\t\t\t\t\tif (anArray.length > 0) { // We have a queryform\r\n\t\t\t\t\t\t\t\t\tfor (i = 0, max = anArray.length; i < max; i++) {\r\n\t\t\t\t\t\t\t\t\t\tanObject = anArray[i];\r\n\t\t\t\t\t\t\t\t\t\tanObject.innerText = _getLocalizedValue(anObject.innerText);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tcase 'login':\r\n\t\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t\tlabels: Object\r\n\t\t\t\t\t\t\t\tloginAction: \"Login\"\r\n\t\t\t\t\t\t\t\tloginButton: \"Login\"\r\n\t\t\t\t\t\t\t\tloginTitle: \"Login Dialog\"\r\n\t\t\t\t\t\t\t\tlogoutAction: \"Logout\"\r\n\t\t\t\t\t\t\t\tnoUserDisplay: \"\"\r\n\t\t\t\t\t\t\t\tpasswordLabel: \"Password: \"\r\n\t\t\t\t\t\t\t\tuserDisplay: \"Signed in as \"\r\n\t\t\t\t\t\t\t\tuserLabel: \"User:\r\n\t\t\t\t\t\t\t*/\r\n\t\t\t\t\t\t\tif(inWidget.labels) {\r\n\t\t\t\t\t\t\t\tfor(aProperty in inWidget.labels) {\r\n\t\t\t\t\t\t\t\t\taValue = inWidget.labels[aProperty];\r\n\t\t\t\t\t\t\t\t\tif(aValue && typeof aValue === 'string') {\r\n\t\t\t\t\t\t\t\t\t\tinWidget.labels[aProperty] = _getLocalizedValue(aValue);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tinWidget.refresh();\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tsubWidgets = null;\r\n\t\t\t\t\t\t\t// Every menuItem of a menuBar is part of WAF.widgets => we don't\r\n\t\t\t\t\t\t\t// need to handle them separatly with getChildren()\r\n\t\t\t\t\t\t\tif (inWidget.kind !== 'menuBar') {\r\n\t\t\t\t\t\t\t\tsubWidgets = inWidget.getChildren();\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif (subWidgets && subWidgets.length > 0) {\r\n\t\t\t\t\t\t\t\tsubWidgets.forEach(function(inSubWidget) {\r\n\t\t\t\t\t\t\t\t\t_doIt(inSubWidget);\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\telse {\r\n\t\t\t\t\t\t\t\tswitch (inWidget.kind) {\r\n\t\t\t\t\t\t\t\tcase 'button':\r\n\t\t\t\t\t\t\t\tcase 'label':\r\n\t\t\t\t\t\t\t\tcase 'richText':\r\n\t\t\t\t\t\t\t\t\tinWidget.setValue(_getLocalizedValue(inWidget.getValue()));\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\t\tcase 'menuItem':\r\n\t\t\t\t\t\t\t\t\tdebugger;\r\n\t\t\t\t\t\t\t\t\tinWidget.domNode.innerText = _getLocalizedValue(inWidget.domNode.innerText);\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tif (inWidget.getLabel) {\r\n\t\t\t\t\t\t\t\t\tlabelObj = inWidget.getLabel();\r\n\t\t\t\t\t\t\t\t\tif (labelObj) {\r\n\t\t\t\t\t\t\t\t\t\tlabelObj.setValue(_getLocalizedValue(labelObj.getValue()));\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tif (inWidget.domNode && inWidget.domNode.placeholder) {\r\n\t\t\t\t\t\t\t\t\tinWidget.domNode.placeholder = _getLocalizedValue(inWidget.domNode.placeholder);\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\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "render(){if(this.renderer){this.renderer.call(this.owner,this.content,this.owner,this.model)}}", "static rendered () {}", "static rendered () {}", "render() {\n // Subclasses should override\n }", "render() {\n super.render();\n this._outputView = new OutputArea({\n rendermime: renderMime,\n contentFactory: OutputArea.defaultContentFactory,\n model: this.model.outputs\n });\n this.pWidget.insertWidget(0, this._outputView);\n\n this.pWidget.addClass('jupyter-widgets');\n this.pWidget.addClass('widget-output');\n this.update(); // Set defaults.\n }", "function buildUI() {\n setPageTitle();\n showMessageFormIfViewingSelf();\n fillMap();\n fetchLanguage();\n getInfo();\n// buildLanguageLinks();\n}", "function render() {\n\n\t\t\t}", "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 }", "function createWidget(html, $original_select) {\n //\n // setup the part_ variables:\n //\n var html_dom = $.parseHTML(html);\n var $part_main = $(\".part_main\", html_dom).first();\n var $part_text = $(\".part_text\", html_dom).first();\n var $part_popup = $(\".part_popup\", html_dom).first();\n //\n // fill the popup list:\n //\n $(\"> option\", $original_select).each(function (index, element) {\n $part_popup.append('<li data-index=\"' + index + '\">' + $(element).text() + '</li>');\n });\n var $popup_items = $(\"> li\", $part_popup);\n //\n // setup the initial selected index:\n //\n setIndex(getOriginalSelectedIndex());\n\n //\n // to adjust the widget when inserted into the page DOM:\n //\n\n function adjust() {\n // adjust the width:\n adjust_main_width();\n // close the popup\n $part_popup.slideUp(0);\n }\n\n $(window).on(\"load\", function () {\n adjust_main_width();\n });\n\n function adjust_main_width() {\n var main_width = $part_main.width();\n var main_innerWidth = $part_main.innerWidth();\n var main_outerWidth = $part_main.outerWidth();\n //\n if ((main_width === main_innerWidth) && (main_width === main_outerWidth)) {\n return; // Chrome, Firefox, Safary: adjust() call when the DOM is not good yet\n }\n //\n var popup_width = $part_popup.width();\n var popup_outerWidth = $part_popup.outerWidth();\n //\n var main_delta = main_outerWidth - main_width;\n var popup_delta = popup_outerWidth - popup_width;\n //\n if ((main_width + main_delta) < popup_outerWidth) {\n $part_main.width(popup_outerWidth - main_delta);\n } else {\n $part_popup.width(main_outerWidth - popup_delta);\n }\n }\n\n //\n // setup the UI event handlers:\n //\n\n $original_select.change(function () {\n setIndex(getOriginalSelectedIndex());\n });\n\n $part_main.click(function () {\n $part_main.focus();\n toggle();\n });\n\n $part_main.blur(function () {\n close();\n });\n\n $part_main.keydown(function (event) {\n var Key = { Space: 32, Esc: 27, Enter: 13, Left: 37, Up: 38, Right: 39, Down: 40, PgUp: 33, PgDn: 34, Home: 36, End: 35 };\n //\n switch (event.which) {\n case Key.Space: open(); break;\n case Key.Esc: close(); break;\n case Key.Enter: close(); break;\n case Key.Home: goFirst(); break;\n case Key.PgUp: goFirst(); break;\n case Key.End: goLast(); break;\n case Key.PgDn: goLast(); break;\n case Key.Left: goPrev(); break;\n case Key.Right: goNext(); break;\n case Key.Up: if (event.altKey) { open(); } else { goPrev(); } break;\n case Key.Down: if (event.altKey) { open(); } else { goNext(); } break;\n }\n });\n\n $part_popup.on(\"click\", \"li\", function () {\n var index = Number($(this).attr(\"data-index\"));\n setIndex(index);\n $part_main.focus();\n });\n\n //\n // utility functions:\n //\n\n function getOriginalSelectedIndex() {\n return $original_select.prop(\"selectedIndex\");\n }\n\n function setOriginalSelectedIndex(value) {\n $original_select.prop(\"selectedIndex\", value);\n }\n\n function setIndex(index) {\n setOriginalSelectedIndex(index);\n //\n $popup_items.removeClass(\"selected\");\n if (index >= 0) {\n var $item = $popup_items.eq(index);\n $item.addClass(\"selected\");\n $part_text.text($item.text());\n }\n };\n\n function goPrev() {\n var index = getOriginalSelectedIndex();\n if (index > 0) setIndex(index - 1);\n }\n\n function goNext() {\n var index = getOriginalSelectedIndex();\n if (index < $popup_items.length - 1) setIndex(index + 1);\n }\n\n function goFirst() {\n setIndex(0);\n }\n\n function goLast() {\n setIndex($popup_items.length - 1);\n }\n\n function open() {\n $part_main.addClass(\"open\");\n $part_popup.slideDown(\"slow\");\n }\n\n function close() {\n $part_popup.slideUp(\"slow\", function () { $part_main.removeClass(\"open\"); });\n }\n\n function toggle() {\n if ($part_main.hasClass(\"open\")) {\n close();\n } else {\n open();\n }\n }\n\n //\n // return the widget object:\n //\n\n return { dom: html_dom, adjust: adjust };\n }", "_render() {\n const loaderInner = htmlHelper.createDivWithClass('');\n this.loader.appendChild(loaderInner);\n }", "_createDOMElements() {\n\t\tthis.$control = $( this.template( this.controlOptions ) );\n\t\tthis.$sliderGroup = this.$control.find( '.slider-group' );\n\t\tthis.$units = this.$control.find( '.unit' );\n\t\tthis.$revert = this.$control.find( '.undo' );\n\t\tthis.$deleteSaved = this.$control.find( '.delete-saved .remove' );\n\t}", "renderIncDom() {\n\t\tif (this.component_.render) {\n\t\t\tthis.component_.render();\n\t\t} else {\n\t\t\tIncrementalDOM.elementVoid('div');\n\t\t}\n\t}", "function _render() {\n _$navbar.setMod(_B_BAR, _M_WEBAPP, _isWebapp);\n _renderBtn(_$btnL);\n _renderBtn(_$btnR);\n _renderDropdown();\n _renderSearch();\n _renderHead();\n }", "_render() {}", "function render() {\n\t\t\t}", "renderContent() {\n return null;\n }", "function render() {\n let html = generateHeader();\n\n if (store.error) {\n generateError();\n }\n\n // check if form displayed\n if (store.adding) {\n html += generateBookmarkForm();\n }\n\n html += generateAllBookmarkCards();\n\n $('main').html(html);\n }", "render() {\n const container = make('div', [this.CSS.baseClass, this.CSS.container])\n this.container = container\n\n // Render the fields which are defined for this tool\n for (let key in this.fields) {\n const field = this.fields[key]\n if (field.input === false) continue\n this.renderInput(key, container)\n }\n\n return container\n }", "renderElements()\n {\n \tlet self = this;\n \t\n \t// TODO: Handle no section?\n \tif( !self.activeSection ) return;\n \t\n \tif( self.renderingElements ) \n \t{\n \t\treturn;\n \t}\n \t\n \tself.renderingElements = true;\n \t\n \tif( !self.currentPage )\n \t{\n \t\tself.currentPage = 0;\n \t}\n \t\n \tself.canvasContent.innerHTML = '';\n \t\n\t self.canvasHeader.innerHTML = self.course.Name + \n\t \t' <span class=\"IconSmall fa-chevron-right\"></span> ' + \n\t \tself.getCurrentSection().Name + \n\t \t' <span class=\"IconSmall fa-chevron-right\"></span> ' + \n\t \tself.getCurrentPage().Name;\n \t\n \tlet act = false;\n \tfor( let a in self.sections )\n \t\tif( a == self.activeSection )\n \t\t\tact = self.sections[ a ];\n \t\n \tlet csId = self.#courseSessionId;\n \t\n \tif( act && act.pages && act.pages[self.currentPage] )\n \t{\n \t\t// Ref the page\n \t\tlet page = act.pages[self.currentPage];\n\t\t\t// Load all elements for the page\n\t\t\tlet m = new Module( 'system' );\n\t\t\tm.onExecuted = function( e, d )\n\t\t\t{\n\t\t\t\tif( e != 'ok' ) \n\t\t\t\t{\n\t\t\t\t\tself.renderingElements = false;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tlet els = JSON.parse( d );\n\t\t\t\tfor( let a = 0; a < els.length; a++ )\n\t\t\t\t{\n\t\t\t\t\t// Convert from BASE64\n\t\t\t\t\tif( els[a].Properties.substr && els[a].Properties.substr( 0, 7 ) == 'BASE64:' )\n\t\t\t\t\t{\n\t\t\t\t\t\tels[a].Properties = Base64.decode( els[a].Properties.substr( 7, els[a].Properties.length - 7 ) );\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tlet ele = self.createElement( els[a].ElementType, els[a] );\n\t\t\t\t\tself.addToCanvas( ele );\n\t\t\t\t\tif( ele.init )\n\t\t\t\t\t\tele.init();\n\t\t\t\t}\n\t\t\t\tFUI.initialize();\n\t\t\t\tself.renderingElements = false;\n\t\t\t\t\n\t\t\t\t// Update page status (tick off the box)\n\t\t\t\tlet p = new Module( 'system' );\n\t\t\t\tp.onExecuted = function( pc, pd )\n\t\t\t\t{\n\t\t\t\t\t// nothing\n\t\t\t\t\tconsole.log( 'What result of page status: ', pc, pd );\n\t\t\t\t}\n\t\t\t\tp.execute( 'appmodule', {\n\t\t\t\t\tappName: 'Courses',\n\t\t\t\t\tcommand: 'setpagestatus',\n\t\t\t\t\tpageId: page.ID,\n\t\t\t\t\tcourseSessionId: csId\n\t\t\t\t} );\n\t\t\t\t\n\t\t\t\tself.redrawNavPanel();\n\t\t\t\n\t\t\t\t// Check which state the buttons are in\n\t\t\t\tself.checkNavButtons();\n\t\t\t}\n\t\t\t\n\t\t\tm.execute( 'appmodule', {\n\t\t\t\tappName: 'Courses',\n\t\t\t\tcommand: 'loadpageelements',\n\t\t\t\tpageId: page.ID\n\t\t\t} );\n\t\t}\n\t\telse\n\t\t{\n\t\t\tself.renderingElements = false;\n\t\t}\n }", "update() {\n\t this.element.parentElement.querySelector('.widget').remove();\n\t this._init();\n\t }", "render() {\n this.innerHTML = this.htmlElementsString;\n this.rootElement.appendChild(this);\n this.createScript();\n }", "postRender()\n {\n super.postRender();\n }", "render() {\n this.el.innerHTML = this.template();\n\n setTimeout(() => {\n this.bindUIElements();\n }, 0);\n }", "renderLayout() {\n const uniqueID = html.genId();\n let content = div(\n {\n class: `${cssBaseClass}__container`,\n },\n [\n div(\n {\n class: `${stateCssBaseClass}__container`,\n },\n [\n div({\n class: `${stateCssBaseClass}__status_line`,\n dataElement: 'status-line',\n }),\n ]\n ),\n div(\n {\n class: `${cssBaseClass}__logs_container`,\n dataElement: LOG_CONTAINER,\n },\n [\n div(\n {\n class: `${cssBaseClass}__logs_title collapsed`,\n role: 'button',\n dataToggle: 'collapse',\n dataTarget: '#' + uniqueID,\n ariaExpanded: 'false',\n ariaControls: uniqueID,\n },\n [span({}, ['Logs'])]\n ),\n div(\n {\n class: `${cssBaseClass}__logs_content_panel collapse`,\n id: uniqueID,\n },\n [\n this.renderControls(),\n div({\n dataElement: LOG_PANEL,\n class: logContentClass,\n }),\n ]\n ),\n ]\n ),\n ]\n );\n\n if (this.developerMode) {\n const devDiv = div(\n {\n dataElement: 'dev',\n class: `${cssBaseClass}__dev_container`,\n },\n [\n div(\n {\n class: `${cssBaseClass}__dev_container--jobId`,\n },\n [\n 'Job ID: ' +\n span(\n {\n dataElement: 'job-id',\n },\n this.jobId\n ),\n ]\n ),\n div(\n {\n class: `${cssBaseClass}__dev_container--jobState`,\n },\n [\n 'Job state: ' +\n span({\n dataElement: 'job-state',\n }),\n ]\n ),\n div(\n {\n class: `${cssBaseClass}__dev_container--fsmState`,\n },\n [\n 'Widget state: ' +\n span({\n dataElement: 'widget-state',\n }),\n ]\n ),\n ]\n );\n content = div([devDiv, content]);\n }\n\n return content;\n }", "_build(){\n\t\tthis._wrapper.classList.add('mvc-wrapper');\n\t\tif(this._parameters.stylised) this._wrapper.classList.add('mvc-stylised');\n\n\t\t/*\n\t\t *\tVolume Input\n\t\t */\n\t\tlet line = document.createElement('p');\n\n\t\tline.classList.add('mvc-volume-wrapper');\n\n\t\tthis._wrapper.appendChild(line);\n\n\t\tlet label = document.createElement('span');\n\n\t\tlabel.classList.add('mvc-label');\n\t\tlabel.innerHTML = this._translated().volume + ' (m<sup>3</sup>)';\n\t\tline.appendChild(label);\n\n\t\t/** @private */\n\t\tthis._volumeInput = document.createElement('input');\n\t\tthis._volumeInput.classList.add('mvc-volume-input');\n\t\tline.appendChild(this._volumeInput);\n\n\t\t/** @private */\n\t\tthis._quickValidator = document.createElement('button');\n\t\tthis._quickValidator.classList.add('mvc-volume-validate');\n\t\tthis._quickValidator.innerHTML = 'OK';\n\t\tline.appendChild(this._quickValidator);\n\n\t\t/*\n\t\t *\tSurface toggler\n\t\t */\n\t\tline = document.createElement('p');\n\t\tline.classList.add('mvc-surface-toggler');\n\t\tthis._wrapper.appendChild(line);\n\n\t\t/** @private */\n\t\tthis._surfaceOption = document.createElement('a');\n\t\tthis._surfaceOption.classList.add('mvc-surface-enable');\n\t\tthis._surfaceOption.innerText = this._translated().surfaceOptionEnable;\n\t\tthis._surfaceOption.href = '';\n\t\tline.appendChild(this._surfaceOption);\n\n\t\t/*\n\t\t *\tSurface Input\n\t\t */\n\t\tline = document.createElement('p');\n\t\tline.classList.add('mvc-hidden', 'mvc-surface-wrapper');\n\t\tthis._wrapper.appendChild(line);\n\n\t\tlabel = document.createElement('span');\n\t\tlabel.classList.add('mvc-label');\n\t\tlabel.innerHTML = this._translated().surface + ' (m<sup>2</sup>)';\n\t\tline.appendChild(label);\n\n\t\t/** @private */\n\t\tthis._surfaceInput = document.createElement('input');\n\t\tthis._surfaceInput.classList.add('mvc-surface-input');\n\t\tline.appendChild(this._surfaceInput);\n\n\t\t/*\n\t\t *\tRooms toggler\n\t\t */\n\t\tline = document.createElement('p');\n\t\tline.classList.add('mvc-rooms-toggler', 'mvc-hidden');\n\t\tthis._wrapper.appendChild(line);\n\n\t\t/** @private */\n\t\tthis._roomsOption = document.createElement('a');\n\t\tthis._roomsOption.classList.add('mvc-rooms-enable');\n\t\tthis._roomsOption.innerText = this._translated().roomsOptionEnable;\n\t\tthis._roomsOption.href = '';\n\t\tline.appendChild(this._roomsOption);\n\n\t\t/*\n\t\t *\tRooms choice\n\t\t */\n\t\tline = document.createElement('p');\n\t\tline.classList.add('mvc-rooms-wrapper', 'mvc-hidden');\n\t\tthis._wrapper.appendChild(line);\n\n\t\tconst roomsList = document.createElement('ul');\n\n\t\troomsList.classList.add('mvc-rooms');\n\t\tline.appendChild(roomsList);\n\n\t\t/** @private */\n\t\tthis._roomsCancel = [];\n\n\t\tObject.entries(this._rooms).forEach(([room, infos]) => {\n\t\t\tconst \tli = document.createElement('li'),\n\t\t\t\t\tspan = document.createElement('span'),\n\t\t\t\t\tcancel = document.createElement('p'),\n\t\t\t\t\tsurface = document.createElement('p');\n\n\t\t\tli.setAttribute('data-type', room);\n\t\t\tli.setAttribute('data-amount', '0');\n\t\t\tspan.innerText = this._translated()[room];\n\n\t\t\t//Create an img tag if needed\n\t\t\ttry{\n\t\t\t\tnew URL(infos.icon);\n\t\t\t\tconst icon = document.createElement('img');\n\n\t\t\t\ticon.src = infos.icon;\n\t\t\t\ticon.classList.add('mvc-rooms-icon');\n\t\t\t\tli.appendChild(icon);\n\t\t\t}catch(_){\n\t\t\t\tli.innerHTML = infos.icon;\n\t\t\t\tli.firstElementChild.classList.add('mvc-rooms-icon');\n\t\t\t}\n\n\t\t\tcancel.classList.add('mvc-rooms-cancel');\n\t\t\tcancel.innerText = 'x';\n\n\t\t\tsurface.classList.add('mvc-rooms-surface');\n\t\t\tsurface.innerText = '~' + infos.surface + 'm²';\n\n\t\t\tli.appendChild(span);\n\t\t\tli.appendChild(cancel);\n\t\t\tli.appendChild(surface);\n\t\t\troomsList.appendChild(li);\n\n\t\t\tthis._roomsCancel.push(cancel);\n\t\t});\n\n\t\t/** @private */\n\t\tthis._roomsList = Array.from(roomsList.children);\n\n\t\t/*\n\t\t *\tValidator\n\t\t */\n\t\tline = document.createElement('p');\n\t\tline.classList.add('mvc-validate', 'mvc-hidden');\n\t\tthis._wrapper.appendChild(line);\n\n\t\tthis._validator = document.createElement('button');\n\t\tthis._validator.innerText = this._translated().validateButton;\n\t\tline.appendChild(this._validator);\n\t\t\n\t}", "function buildUI(thisObj) {\n var win =\n thisObj instanceof Panel\n ? thisObj\n : new Window(\"palette\", \"example\", [0, 0, 150, 260], {\n resizeable: true\n });\n\n if (win != null) {\n var H = 25; // the height\n var W1 = 30; // the width\n var G = 5; // the gutter\n var x = G;\n var y = G;\n win.refresh_templates_button = win.add(\n \"button\",\n [x, y, x + W1 * 5, y + H],\n \"Refresh Templates\"\n );\n y += H + G;\n win.om_templates_ddl = win.add(\n \"dropdownlist\",\n [x, y, x + W1 * 5, y + H],\n SOM_meta.outputTemplates\n );\n win.om_templates_ddl.selection = 0;\n y += H + G;\n win.set_templates_button = win.add(\n \"button\",\n [x, y, x + W1 * 5, y + H],\n \"Set Output Template\"\n );\n y += H + G;\n win.help_button = win.add(\"button\", [x, y, x + W1 * 5, y + H], \"⚙/?\");\n win.help_button.graphics.font = \"dialog:17\";\n\n /**\n * This reads in all outputtemplates from the renderqueue\n *\n * @return {nothing}\n */\n win.refresh_templates_button.onClick = function() {\n get_templates();\n // now we set the dropdownlist\n win.om_templates_ddl.removeAll(); // remove the content of the ddl\n for (var i = 0; i < SOM_meta.outputTemplates.length; i++) {\n win.om_templates_ddl.add(\"item\", SOM_meta.outputTemplates[i]);\n }\n win.om_templates_ddl.selection = 0;\n }; // close refresh_templates_button\n\n win.om_templates_ddl.onChange = function() {\n SOM_meta.selectedTemplate =\n SOM_meta.outputTemplates[this.selection.index];\n };\n win.set_templates_button.onClick = function() {\n set_templates();\n };\n }\n return win;\n } // close buildUI", "render() { return super.render(); }", "_afterRender () {\n this.adjust();\n }", "render() {\n return this.renderContent();\n }", "render() {\n if (this.el) {\n const el = document.querySelector(this.el);\n if (el) {\n el.innerHTML = `${this.template}${((this.title) ? \"<h1>\" + this.title + \"</h1>\": \"\")}${((this.subTitle) ? \"<h2>\" + this.subTitle + \"</h2>\": \"\")}`;\n }\n this.delegateEvents();\n this.syncAllBoundElements();\n }\n return this;\n }", "function initWidget(){\n var tblock;\n var bg_slate = getBackgroundSlate();\n\n try{\n\n// tblock = engine.createTextBlock( 'Error', FontLibraryInstance.getFont_ERRORTITLE(), 1100 );\n// m_root_node.addChild( tblock );\n\n tblock = engine.createTextBlock( m_message, FontLibraryInstance.getFont_ERRORMESSAGE(), 1100 );\n\n var button = getButtonContainer();\n\n bg_slate.height = tblock.naturalHeight + 84 + 85\n \n tblock.x = ( bg_slate.width / 2 ) - ( tblock.naturalWidth / 2 );\n tblock.y = 30;\n\n button.y = bg_slate.height - 114;\n\n m_root_node.addChild( bg_slate );\n m_root_node.addChild( tblock );\n m_root_node.addChild( button );\n \n }catch( e ){\n if( bg_slate && m_root_node.contains( bg_slate ) ){\n m_root_node.removeChild( bg_slate );\n }\n if( tblock && m_root_node.contains( tblock ) ){\n m_root_node.removeChild( tblock );\n }\n }\n }", "render_() {\n super.render_();\n this.updateSlider_();\n }", "returnRenderText() {\n /*-- add heading part of seating chart --*/\n let layout = /*html*/`\n <div class=\"seating-container\">\n <div class=\"buffer\"></div>\n <div class=\"movie-details-row\">\n <em>${bookingTempStore.showingDetails.film}: ${bookingTempStore.showingDetails.date} (${bookingTempStore.showingDetails.time})</em>\n </div>\n <div class=\"screen-row\">\n <div></div>\n <h1>BIODUK</h1>\n <div></div>\n </div>\n <div class=\"seating-rows-container\">\n `\n /*-- add seating/checkboxes part of seating chart --*/\n layout += this.seatingChart();\n /*-- closing tags and footer part of seating chart --*/\n layout += /*html*/`\n </div>\n <div class=\"text-row\">\n <em>Välj din plats</em>\n </div>\n <div class=\"age-btn-row\">\n `\n layout += this.ageButtons();\n layout += /*html*/`\n </div>\n <div class=\"button-row\">\n ${BookingUtilityFunctions.bookingPriceButton()}\n </div>\n <div class=\"buffer\"></div>\n </div>\n `\n return layout;\n }", "function renderTopLevel()\n{\n $(\"#wrapper\").prepend(templates['header']());\n $('#center_wrap').append(templates['files']());\n $('#center_wrap').append(templates['panes']());\n console.log('-- rendered top level UI html --');\n}", "render() {\n\n\t}", "render() {\n\n\t}", "function init() {\n // Activate Widget / Cards\n weatherWidget(true);\n holidayWidget(true);\n restaurantWidget(true);\n timezoneWidget(true);\n\n // Activate the page content\n renderHeader();\n renderMainContent();\n renderFooter();\n $('.sidenav').sidenav();\n $('.fixed-action-btn').floatingActionButton();\n $('.modal').modal();\n searchInputAutoComplete();\n renderSearchLocations();\n\n // LAST: Activate Widget Filter\n renderFilterWidgets();\n}", "render() {\n return html `\n <ef-layout part=\"container\" flex nowrap ?container=\"${this.isContainer}\">\n <ef-layout flex size=\"${ifDefined(this.labelLayoutSize)}\">\n <div part=\"label\">\n <slot></slot>\n </div>\n </ef-layout>\n <ef-layout flex basis=\"${ifDefined(this.primaryLayoutFlexBasis)}\">\n <ef-progress-bar\n part=\"primary-bar\"\n alignment=${this.primaryBarAlignment}\n label=\"${ifDefined(this.primaryLabel || undefined)}\"\n value=\"${ifDefined(this.primaryValue || undefined)}\">\n </ef-progress-bar>\n </ef-layout>\n <div part=\"seperator\"></div>\n <ef-layout flex basis=\"${ifDefined(this.secondaryLayoutFlexBasis)}\">\n <ef-progress-bar\n part=\"secondary-bar\"\n alignment=\"${this.secondaryBarAlignment}\"\n label=\"${ifDefined(this.secondaryLabel || undefined)}\"\n value=\"${ifDefined(this.secondaryValue || undefined)}\">\n </ef-progress-bar>\n </ef-layout>\n </ef-layout>\n `;\n }", "function buildUI() {\n loadNavigation();\n setPageTitle();\n fetchBlobstoreUrlAndShowMessageForm();\n showMessageFormIfViewingSelf();\n fetchMessages(\"\");\n addListnerForInfiniteScroll();\n fetchAboutMe();\n initMap();\n addButtonEventForDelete();\n}", "function assignWidgetContent(){\n $.each(splittedRegionContent, function(){\n $.each(this, function(){\n var tempContent = this;\n var widgetDiv = _iframe.contents().find('div[widgetid =\"' + tempContent.widgetId + '\"]');\n try\n {\n widgetDiv.html(tempContent.content);\n }\n catch(err)\n {\n //TODO: I18N TEST\n $.perc_utils.info(I18N.message(\"perc.ui.iframe.view@Failed to fill widget content\") + tempContent.widgetId + I18N.message(\"perc.ui.iframe.view@Error is\") + err);\n }\n widgetDiv.attr('ownerId', tempContent.ownerid);\n if (tempContent.isTransparent) {\n widgetDiv.addClass('perc-widget-transperant');\n }\n //Remove the height and width attribute of Widget's Region puff\n widgetDiv.parents('.perc-region-puff:first').removeAttr('style').addClass('perc-new-splitted-region');\n\n });\n\n });\n _layoutFunctions.removeDropsSortingResizing(true);\n _layoutFunctions.setLayoutDirty(true);\n clearItoolMarkup();\n activateInspectionToolButton();\n }", "drawMarkup() {\n const _themeName = this.preserveTheme ? this.theme : HThemeManager.currentTheme;\n const _markup = HThemeManager.resourcesFor(this, _themeName);\n this.markupElemIds = {};\n if (this.isString(_markup) && _markup !== '') {\n ELEM.setHTML(this.elemId, _markup);\n this.markupElemNames.forEach(_partName => {\n const _elemName = _partName + this.elemId;\n // Optimization of matching the html string before searching the DOM:\n const _htmlIdMatch = `id=\"${_elemName}\"`;\n if (_markup.includes(_htmlIdMatch)) {\n const _elemId = this.bindDomElement(_elemName, this.elemId);\n if (this.isNumber(_elemId)) {\n this.markupElemIds[_partName] = _elemId;\n // removes the id attribute, because it's no longer needed:\n ELEM.delAttr(_elemId, 'id');\n }\n else {\n console.warn(\n `HView#drawMarkup warning; no such partNamue: ${_partName\n } for componentName: ${this.componentName}`, this);\n }\n }\n });\n if (this.isFunction(this.themeStyle)) {\n this.themeStyle.call(this);\n }\n }\n return this;\n }", "function prepareDom(){\r\n css(container, {\r\n 'height': '100%',\r\n 'position': 'relative'\r\n });\r\n\r\n //adding a class to recognize the container internally in the code\r\n addClass(container, WRAPPER);\r\n addClass($('html'), ENABLED);\r\n\r\n //due to https://github.com/alvarotrigo/fullPage.js/issues/1502\r\n windowsHeight = getWindowHeight();\r\n\r\n removeClass(container, DESTROYED); //in case it was destroyed before initializing it again\r\n\r\n addInternalSelectors();\r\n\r\n var sections = $(SECTION_SEL);\r\n\r\n //styling the sections / slides / menu\r\n for(var i = 0; i<sections.length; i++){\r\n var index = i;\r\n var section = sections[i];\r\n var slides = $(SLIDE_SEL, section);\r\n var numSlides = slides.length;\r\n\r\n //caching the original styles to add them back on destroy('all')\r\n section.setAttribute('data-fp-styles', section.getAttribute('style'));\r\n\r\n styleSection(section, index);\r\n styleMenu(section, index);\r\n\r\n // if there's any slide\r\n if (numSlides > 0) {\r\n styleSlides(section, slides, numSlides);\r\n }else{\r\n if(options.verticalCentered){\r\n addTableClass(section);\r\n }\r\n }\r\n }\r\n\r\n //fixed elements need to be moved out of the plugin container due to problems with CSS3.\r\n if(options.fixedElements && options.css3){\r\n $(options.fixedElements).forEach(function(item){\r\n $body.appendChild(item);\r\n });\r\n }\r\n\r\n //vertical centered of the navigation + active bullet\r\n if(options.navigation){\r\n addVerticalNavigation();\r\n }\r\n\r\n enableYoutubeAPI();\r\n\r\n if(options.scrollOverflow){\r\n scrollBarHandler = options.scrollOverflowHandler.init(options);\r\n }else{\r\n afterRenderActions();\r\n }\r\n }", "afterRender() { }", "afterRender() { }", "buildUI() {\n this.node.innerHTML = '<input type=\"text\" spellcheck=\"false\"></input>';\n this.textInputNode = this.node.getElementsByTagName('input')[0];\n this.setFocusableNode(this.textInputNode);\n this.setMaxLength(this.maxLength);\n }", "render() {\n if (this.renderer) {\n this.renderer.call(this.owner, this.content, this.owner, this.model);\n }\n }", "function loadWidget() {\n var div = document.getElementById('arqsiWidget');\n div.innerHTML =''; \n if (div.tagName == 'DIV') { \n sendCategoriasRequest(); \n buildMenuStrip();\n }\n}", "onBeforeRendering() {}", "render() {\n return super.render();\n }", "function buildUI() {\n let parentDiv = null;\n let nextDiv = null;\n\n GM_addStyle(enabledBtnStyle);\n GM_addStyle(disabledBtnStyle);\n GM_addStyle(blueBtnStyle);\n\n if (isBazaar) {\n parentDiv = document.getElementsByClassName('searchBar___F1E8s')[0]; // Search/sort options\n nextDiv = document.getElementsByClassName('segment___38fN3')[0]; // Items grid\n } else if (isItems) {\n parentDiv = $('#mainContainer').find('div.main-items-cont-wrap >' + // \"Your Items\"\n 'div.equipped-items-wrap').get();\n nextDiv = $('#mainContainer').find('div.main-items-cont-wrap > div.items-wrap.primary-items');\n } else {\n return;\n }\n\n if (!validPointer(parentDiv)) {return;} // Wait until enough is loaded\n if (!validPointer(nextDiv)) {return;} // ...\n if (validPointer(document.getElementById('xedx-main-div'))) {return;} // Do only once\n\n $(xedx_main_div).insertAfter(parentDiv);\n $(separator).insertAfter(parentDiv);\n\n $(targetNode).unbind('DOMNodeInserted');\n\n if (!INSTANT_UPLOAD) {\n let btnDiv = document.getElementById('button-div');\n btnDiv.style.display = \"block\";\n }\n\n let arrowDiv = document.getElementById('xedx-arrow-div');\n if (validPointer(arrowDiv)) {\n arrowDiv.addEventListener(\"click\", function() {\n var bodyDiv = document.getElementById('xedx-content-div');\n var headerDiv = document.getElementById('xedx-header-div');\n if (bodyDiv.style.display === \"block\") {\n bodyDiv.style.display = \"none\";\n headerDiv.className = 'title main-title title-black border-round';\n } else {\n bodyDiv.style.display = \"block\";\n headerDiv.className = 'title main-title title-black top-round active';\n }\n });\n }\n\n let urlInput = document.getElementById('xedx-google-key');\n let value = GM_getValue('xedx-google-key');\n if (typeof value != 'undefined' && value != null && value != '') {\n urlInput.value = value;\n }\n\n installHandlers(); // Hook up buttons\n\n //disableButtons(); // Temporary - testing enable/disable\n //enableButtons();\n\n // Save the user ID of this bazaar\n profileId = isBazaar ? useridFromProfileURL(window.location.href) : 'me';\n\n return strSuccess; // Return value is currently unused\n }", "function renderElement() {\n element = $compile(preCompiledElement)($scope);\n $scope.$digest();\n\n controller = element.controller('fsMultiselect');\n }", "_createLayout(){\n var tpl = doT.compile(\"<div class='bcd-far-configurator'></div><div class='bcd-far-filter'></div><div class='bcd-far-paginate'></div><div class='bcd-far-grid'></div>\");\n this.options.targetHtml.html(tpl);\n }", "template() {\n return `<div id='container' class='jqx-container'>\n <div id='innerContainer' class ='jqx-inner-container'>\n <span id='falseContentContainer' inner-h-t-m-l='[[falseContent]]' class ='jqx-false-content-container'></span>\n <span id='switchThumb' class ='jqx-thumb'></span>\n <span id='trueContentContainer' inner-h-t-m-l='[[trueContent]]' class ='jqx-true-content-container'></span>\n </div>\n <input id='hiddenInput' class ='jqx-hidden-input' type='hidden'>\n </div>`;\n }", "render() {\n return this.renderContent()\n }", "function refreshRenderAddContent(){\n _model.render(function(htmlContent){\n window.frames[_iframe.attr(\"id\")].jQuery('body').empty().append(htmlContent).ready(function(){\n _layoutFunctions.afterRender(function(){\n if(reactivateInspectionToolCallback)\n {\n reactivateInspectionToolCallback();\n }\n });\n\n // If splittedRegionContent array is available - iterate over the array and replace the sample content with actual content\n if (splittedRegionContent.length > 0) {\n assignWidgetContent();\n }\n });\n });\n }", "function buildUI() {\n var _ = this,\n cbs = _.config.callbacks,\n wrapper,\n header,\n content,\n footer,\n dialogPulse = function dialogPulse() {\n _.dialog.classList.add('dlg--pulse');\n setTimeout(function () {\n _.dialog.classList.remove('dlg--pulse');\n }, 200);\n },\n maxSelectCheck = function maxSelectCheck() {\n var checked = content.querySelectorAll('.dlg-select-checkbox:checked');\n if (checked.length === _.config.maxSelect) {\n content.querySelectorAll('.dlg-select-checkbox:not(:checked)').forEach(function (cb) {\n cb.setAttribute('disabled', true);\n cb.parentNode.classList.add('item--disabled');\n });\n if (cbs && cbs.maxReached) cbs.maxReached.call(_, _.config.maxSelect);\n } else {\n content.querySelectorAll('.dlg-select-checkbox:not(:checked)').forEach(function (cb) {\n cb.removeAttribute('disabled');\n cb.parentNode.classList.remove('item--disabled');\n });\n }\n },\n // global event handler\n evtHandler = function evtHandler(e) {\n if (e.type === 'click') {\n // handle overlay click if dialog has no action buttons\n if (e.target.matches('.du-dialog')) {\n if (_.type === vars.buttons.NONE) _.hide();else dialogPulse();\n }\n\n // handle selection item click\n if (e.target.matches('.dlg-select-item')) {\n e.target.querySelector('.dlg-select-lbl').click();\n }\n\n // handle action buttons click\n if (e.target.matches('.dlg-action')) {\n // OK button\n if (e.target.matches('.ok-action')) {\n if (_.config.selection && _.config.multiple) {\n var checked = content.querySelectorAll('.dlg-select-checkbox:checked'),\n checkedVals = [],\n checkedItems = [];\n for (var i = 0; i < checked.length; i++) {\n var item = _.cache[checked[i].id];\n checkedItems.push(item);\n checkedVals.push(typeof item === 'string' ? checked[i].value : item[_.config.valueField]);\n }\n if (checkedVals.length >= _.config.minSelect) {\n _.config.selectedValue = checkedVals;\n if (cbs && cbs.itemSelect) {\n cbs.itemSelect.apply({\n value: checkedVals\n }, [e, checkedItems]);\n _.hide();\n }\n } else {\n dialogPulse();\n if (cbs && cbs.minRequired) cbs.minRequired.call(_, _.config.minSelect);\n }\n } else if (_.config.selection && _.config.confirmSelect) {\n var selected = content.querySelector('.dlg-select-radio:checked');\n if (selected) {\n var _item = _.cache[selected.id];\n _.config.selectedValue = typeof _item === 'string' ? selected.value : _item[_.config.valueField];\n _.hide();\n if (cbs && cbs.itemSelect) cbs.itemSelect.apply(selected, [e, _item]);\n } else dialogPulse();\n } else {\n if (cbs && cbs.okClick) {\n cbs.okClick.apply(_, e);\n if (_.config.hideOnAction) _.hide();\n } else _.hide();\n }\n }\n\n // Yes button\n if (e.target.matches('.yes-action')) {\n if (cbs && cbs.yesClick) {\n cbs.yesClick.apply(_, e);\n if (_.config.hideOnAction) _.hide();\n } else _.hide();\n }\n\n // No button\n if (e.target.matches('.no-action')) {\n if (cbs && cbs.noClick) {\n cbs.noClick.apply(_, e);\n if (_.config.hideOnAction) _.hide();\n } else _.hide();\n }\n\n // CANCEL button\n if (e.target.matches('.cancel-action')) {\n if (cbs && cbs.cancelClick) {\n cbs.cancelClick.apply(_, e);\n if (_.config.hideOnAction) _.hide();\n } else _.hide();\n }\n }\n }\n if (e.type === 'change') {\n // handle selection radio change\n if (e.target.matches('.dlg-select-radio')) {\n var el = e.target;\n if (el.checked && !_.config.confirmSelect) {\n var _item2 = _.cache[el.id];\n _.config.selectedValue = typeof _item2 === 'string' ? el.value : _item2[_.config.valueField];\n _.hide();\n if (cbs && cbs.itemSelect) cbs.itemSelect.apply(el, [e, _item2]);\n }\n } else if (e.target.matches('.dlg-select-checkbox')) {\n if (_.config.maxSelect) maxSelectCheck();\n } else if (e.target.matches('.opt-out-cb')) {\n _.optOut = e.target.checked;\n if (cbs && cbs.optOutChanged) cbs.optOutChanged.call(_, e.target.checked);\n }\n }\n if (e.type === 'scroll') {\n if (e.target.matches('.dlg-content')) e.target.classList[e.target.scrollTop > 5 ? 'add' : 'remove']('content--scrolled');\n }\n if (e.type === 'keyup') {\n if (e.target.matches('.dlg-search')) {\n var _keyword = e.target.value,\n _items = content.querySelectorAll('.dlg-select-item');\n _items.forEach(function (dlgItem) {\n if (dlgItem.classList.contains('select--group')) return;\n var input = dlgItem.querySelector(_.config.multiple ? '.dlg-select-checkbox' : '.dlg-select-radio'),\n item = _.cache[input.id],\n iType = _typeof(item),\n iText = iType === 'string' ? item : item[_.config.textField],\n _matched = false;\n _matched = cbs && cbs.onSearch ? cbs.onSearch.call(_, item, _keyword) : iText.toLowerCase().indexOf(_keyword.toLowerCase()) >= 0;\n dlgItem.classList[_matched ? 'remove' : 'add']('item--nomatch');\n });\n }\n }\n },\n addItemDOM = function addItemDOM(item, id, value, label) {\n var isGroup = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;\n if (isGroup) {\n var groupEl = createElem('div', {\n className: 'dlg-select-item select--group'\n }, item);\n appendTo(groupEl, content);\n } else {\n var itemEl = createElem('div', {\n className: 'dlg-select-item'\n }),\n selectEl = createElem('input', {\n className: _.config.multiple ? 'dlg-select-checkbox' : 'dlg-select-radio',\n id: id,\n name: 'dlg-selection',\n type: _.config.multiple ? 'checkbox' : 'radio',\n value: value,\n checked: _.config.multiple ? _.config.selectedValue && inArray(_.config.selectedValue, value) : _.config.selectedValue === value\n }),\n labelEl = createElem('label', {\n className: 'dlg-select-lbl',\n htmlFor: id\n }, cbs && cbs.itemRender ? cbs.itemRender.call(_, item) : '<span class=\"select-item\">' + label + '</span>', true);\n _.cache[id] = item;\n appendTo([selectEl, labelEl], itemEl);\n appendTo(itemEl, content);\n }\n },\n addItem = function addItem(item) {\n var type = _typeof(item),\n id = '';\n if (type === 'string') {\n id = (_.config.multiple ? 'dlg-cb' : 'dlg-radio') + removeSpace(item.toString());\n addItemDOM(item, id, item, item);\n } else {\n if (item.group && Array.isArray(item.items)) {\n addItemDOM(item.group, null, null, null, true);\n item.items.forEach(function (i) {\n return addItem(i);\n });\n } else {\n var value = type === 'string' ? item : item[_.config.valueField],\n text = type === 'string' ? item : item[_.config.textField];\n id = (_.config.multiple ? 'dlg-cb' : 'dlg-radio') + removeSpace(value.toString());\n addItemDOM(item, id, value, text);\n }\n }\n };\n _.docFrag = document.createDocumentFragment();\n _.dialog = createElem('div', {\n className: 'du-dialog',\n id: _.config.id\n });\n if (_.config.dark) _.dialog.setAttribute('dark', true);\n if (_.config.selection) _.dialog.setAttribute('selection', true);\n appendTo(_.dialog, _.docFrag);\n wrapper = createElem('div', {\n className: 'dlg-wrapper',\n tabIndex: 0\n });\n\n // dialog loader\n var loader = createElem('div', {\n className: 'dlg-loader'\n });\n var loaderWrapper = createElem('div', {\n className: 'loader-wrapper'\n });\n appendTo(createElem('div', {\n className: 'loading-buffer'\n }), loaderWrapper);\n appendTo(createElem('div', {\n className: 'loading-indicator'\n }), loaderWrapper);\n appendTo(loaderWrapper, loader);\n appendTo(loader, wrapper);\n appendTo(wrapper, _.dialog);\n if (_.title) {\n header = createElem('div', {\n className: 'dlg-header'\n }, _.title);\n appendTo(header, wrapper);\n } else {\n _.dialog.classList.add('dlg--no-title');\n }\n content = createElem('div', {\n className: 'dlg-content'\n });\n if (_.config.selection) {\n if (_.config.allowSearch) {\n appendTo(createElem('input', {\n className: 'dlg-search',\n placeholder: 'Search...'\n }), header);\n }\n _.content.forEach(function (i) {\n return addItem(i);\n });\n if (_.config.multiple && _.config.maxSelect) maxSelectCheck();\n } else content.innerHTML = _.content;\n appendTo(content, wrapper);\n if (_.type !== vars.buttons.NONE) {\n footer = createElem('div', {\n className: 'dlg-actions'\n });\n if (_.config.optOutCb) {\n var cbID = 'opt-out-cb';\n var group = createElem('div', {\n className: 'opt-out-grp'\n });\n appendTo(createElem('input', {\n id: cbID,\n className: cbID,\n type: 'checkbox',\n checked: _.optOut\n }), group);\n appendTo(createElem('label', {\n htmlFor: cbID\n }, _.config.optOutText), group);\n appendTo(group, footer);\n }\n appendTo(footer, wrapper);\n }\n\n /* Setup action buttons */\n switch (_.type) {\n case vars.buttons.OK_CANCEL:\n appendTo([createElem('button', {\n className: 'dlg-action cancel-action',\n tabIndex: 2\n }, _.config.cancelText), createElem('button', {\n className: 'dlg-action ok-action',\n tabIndex: 1\n }, _.config.okText)], footer);\n break;\n case vars.buttons.YES_NO_CANCEL:\n appendTo([createElem('button', {\n className: 'dlg-action cancel-action',\n tabIndex: 3\n }, _.config.cancelText), createElem('button', {\n className: 'dlg-action no-action',\n tabIndex: 2\n }, _.config.noText), createElem('button', {\n className: 'dlg-action yes-action',\n tabIndex: 1\n }, _.config.yesText)], footer);\n break;\n case vars.buttons.DEFAULT:\n appendTo(createElem('button', {\n className: 'dlg-action ok-action',\n tabIndex: 1\n }, _.config.okText), footer);\n break;\n }\n\n /* Register event handler */\n addEvent(content, 'scroll', evtHandler);\n addEvents(_.dialog, ['click', 'change', 'keyup'], evtHandler);\n if (!_.config.init) _.show();\n }", "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 }", "function maybeStaticRenderLater() {\r\n if (shinyMode && has_jQuery3()) {\r\n window.jQuery(window.HTMLWidgets.staticRender);\r\n } else {\r\n window.HTMLWidgets.staticRender();\r\n }\r\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 prepareDom(){\r\n container.css({\r\n 'height': '100%',\r\n 'position': 'relative'\r\n });\r\n\r\n //adding a class to recognize the container internally in the code\r\n container.addClass(WRAPPER);\r\n $('html').addClass(ENABLED);\r\n\r\n //due to https://github.com/alvarotrigo/fullPage.js/issues/1502\r\n windowsHeight = $window.height();\r\n\r\n container.removeClass(DESTROYED); //in case it was destroyed before initializing it again\r\n\r\n addInternalSelectors();\r\n\r\n //styling the sections / slides / menu\r\n $(SECTION_SEL).each(function(index){\r\n var section = $(this);\r\n var slides = section.find(SLIDE_SEL);\r\n var numSlides = slides.length;\r\n\r\n //caching the original styles to add them back on destroy('all')\r\n section.data('fp-styles', section.attr('style'));\r\n\r\n styleSection(section, index);\r\n styleMenu(section, index);\r\n\r\n // if there's any slide\r\n if (numSlides > 0) {\r\n styleSlides(section, slides, numSlides);\r\n }else{\r\n if(options.verticalCentered){\r\n addTableClass(section);\r\n }\r\n }\r\n });\r\n\r\n //fixed elements need to be moved out of the plugin container due to problems with CSS3.\r\n if(options.fixedElements && options.css3){\r\n $(options.fixedElements).appendTo($body);\r\n }\r\n\r\n //vertical centered of the navigation + active bullet\r\n if(options.navigation){\r\n addVerticalNavigation();\r\n }\r\n\r\n enableYoutubeAPI();\r\n\r\n if(options.scrollOverflow){\r\n scrollBarHandler = options.scrollOverflowHandler.init(options);\r\n }else{\r\n afterRenderActions();\r\n }\r\n }", "display(){\n this.htmlBuilder.build();\n this.displayCityName();\n this.displayTodayWeather();\n this.displayWeekWeather();\n this.displayTimeSlots();\n }", "function displayWidget () \n{\n\tif(!window.TGS || !TGS.IsReady())\n\t{\n\t\treturn;\n\t}\n\n\tinitWidget();\n}", "renderFiller() {\n if (this.state.currentPane != \"myposts\") return <div class=\"AccountsContainerFiller\" />;\n return null;\n }", "function prepareDom(){\r\n css(container, {\r\n 'height': '100%',\r\n 'position': 'relative'\r\n });\r\n\r\n //adding a class to recognize the container internally in the code\r\n addClass(container, WRAPPER);\r\n addClass($html, ENABLED);\r\n\r\n //due to https://github.com/alvarotrigo/fullPage.js/issues/1502\r\n windowsHeight = getWindowHeight();\r\n\r\n removeClass(container, DESTROYED); //in case it was destroyed before initializing it again\r\n\r\n addInternalSelectors();\r\n\r\n var sections = $(SECTION_SEL);\r\n\r\n //styling the sections / slides / menu\r\n for(var i = 0; i<sections.length; i++){\r\n var sectionIndex = i;\r\n var section = sections[i];\r\n var slides = $(SLIDE_SEL, section);\r\n var numSlides = slides.length;\r\n\r\n //caching the original styles to add them back on destroy('all')\r\n section.setAttribute('data-fp-styles', section.getAttribute('style'));\r\n\r\n styleSection(section, sectionIndex);\r\n styleMenu(section, sectionIndex);\r\n\r\n // if there's any slide\r\n if (numSlides > 0) {\r\n styleSlides(section, slides, numSlides);\r\n }else{\r\n if(options.verticalCentered){\r\n addTableClass(section);\r\n }\r\n }\r\n }\r\n\r\n //fixed elements need to be moved out of the plugin container due to problems with CSS3.\r\n if(options.fixedElements && options.css3){\r\n $(options.fixedElements).forEach(function(item){\r\n $body.appendChild(item);\r\n });\r\n }\r\n\r\n //vertical centered of the navigation + active bullet\r\n if(options.navigation){\r\n addVerticalNavigation();\r\n }\r\n\r\n enableYoutubeAPI();\r\n\r\n if(options.scrollOverflow){\r\n scrollBarHandler = options.scrollOverflowHandler.init(options);\r\n }\r\n }", "function renderPage() {\n // set up any necessary events\n Main.addClickEventToElement(document.getElementById(\"homeOptP\"), function () {\n Main.changeHash(Main.pageHashes.home);\n });\n Main.addClickEventToElement(document.getElementById(\"infoOptP\"), function () {\n Main.changeHash(Main.pageHashes.info);\n });\n Main.addClickEventToElement(document.getElementById(\"quizOptP\"), function () {\n Main.changeHash(Main.pageHashes.quiz);\n });\n Main.addClickEventToElement(document.getElementById(\"econ\"), function () {\n Main.sendAnalyticsEvent(\"UX\", \"click\", \"Economy\");\n _loadPlatformSection(_platformSections.economy);\n });\n Main.addClickEventToElement(document.getElementById(\"immigration\"), function () {\n Main.sendAnalyticsEvent(\"UX\", \"click\", \"Immigration\");\n _loadPlatformSection(_platformSections.immigration);\n });\n Main.addClickEventToElement(document.getElementById(\"domSoc\"), function () {\n Main.sendAnalyticsEvent(\"UX\", \"click\", \"Domestic Policy\");\n _loadPlatformSection(_platformSections.domestic);\n });\n Main.addClickEventToElement(document.getElementById(\"foreignPol\"), function () {\n Main.sendAnalyticsEvent(\"UX\", \"click\", \"Foreign Policy\");\n _loadPlatformSection(_platformSections.foreign);\n });\n\n // show page\n Main.sendPageview(Main.analyticPageTitles.platform);\n Main.showPage(Main.pageContainers.partyPlatformContainer);\n }", "function init() { render(this); }", "function prepareDom(){\r\n container.css({\r\n 'height': '100%',\r\n 'position': 'relative'\r\n });\r\n\r\n //adding a class to recognize the container internally in the code\r\n container.addClass(WRAPPER);\r\n $('html').addClass(ENABLED);\r\n\r\n //due to https://github.com/alvarotrigo/fullPage.js/issues/1502\r\n windowsHeight = $window.height();\r\n\r\n container.removeClass(DESTROYED); //in case it was destroyed before initializing it again\r\n\r\n addInternalSelectors();\r\n\r\n //styling the sections / slides / menu\r\n $(SECTION_SEL).each(function(index){\r\n var section = $(this);\r\n var slides = section.find(SLIDE_SEL);\r\n var numSlides = slides.length;\r\n\r\n styleSection(section, index);\r\n styleMenu(section, index);\r\n\r\n // if there's any slide\r\n if (numSlides > 0) {\r\n styleSlides(section, slides, numSlides);\r\n }else{\r\n if(options.verticalCentered){\r\n addTableClass(section);\r\n }\r\n }\r\n });\r\n\r\n //fixed elements need to be moved out of the plugin container due to problems with CSS3.\r\n if(options.fixedElements && options.css3){\r\n $(options.fixedElements).appendTo($body);\r\n }\r\n\r\n //vertical centered of the navigation + active bullet\r\n if(options.navigation){\r\n addVerticalNavigation();\r\n }\r\n\r\n enableYoutubeAPI();\r\n\r\n if(options.scrollOverflow){\r\n if(document.readyState === 'complete'){\r\n createScrollBarHandler();\r\n }\r\n //after DOM and images are loaded\r\n $window.on('load', createScrollBarHandler);\r\n }else{\r\n afterRenderActions();\r\n }\r\n }", "function prepareDom(){\r\n container.css({\r\n 'height': '100%',\r\n 'position': 'relative'\r\n });\r\n\r\n //adding a class to recognize the container internally in the code\r\n container.addClass(WRAPPER);\r\n $('html').addClass(ENABLED);\r\n\r\n //due to https://github.com/alvarotrigo/fullPage.js/issues/1502\r\n windowsHeight = $window.height();\r\n\r\n container.removeClass(DESTROYED); //in case it was destroyed before initializing it again\r\n\r\n addInternalSelectors();\r\n\r\n //styling the sections / slides / menu\r\n $(SECTION_SEL).each(function(index){\r\n var section = $(this);\r\n var slides = section.find(SLIDE_SEL);\r\n var numSlides = slides.length;\r\n\r\n styleSection(section, index);\r\n styleMenu(section, index);\r\n\r\n // if there's any slide\r\n if (numSlides > 0) {\r\n styleSlides(section, slides, numSlides);\r\n }else{\r\n if(options.verticalCentered){\r\n addTableClass(section);\r\n }\r\n }\r\n });\r\n\r\n //fixed elements need to be moved out of the plugin container due to problems with CSS3.\r\n if(options.fixedElements && options.css3){\r\n $(options.fixedElements).appendTo($body);\r\n }\r\n\r\n //vertical centered of the navigation + active bullet\r\n if(options.navigation){\r\n addVerticalNavigation();\r\n }\r\n\r\n enableYoutubeAPI();\r\n\r\n if(options.scrollOverflow){\r\n if(document.readyState === 'complete'){\r\n createScrollBarHandler();\r\n }\r\n //after DOM and images are loaded\r\n $window.on('load', createScrollBarHandler);\r\n }else{\r\n afterRenderActions();\r\n }\r\n }", "render() {\n return super.render();\n }", "render() {\n return super.render();\n }", "function buildUI() {\n showForms();\n const config = {removePlugins: [ 'Heading', 'List' ]};\n ClassicEditor.create(document.getElementById('message-input'), config );\n fetchAboutMe();\n}", "function initEditor() {\n renderWorkingLine();\n renderTextInput();\n renderFontColorPicker();\n renderFontSize();\n toggleStrokeBtn();\n renderStrokeColorPicker();\n renderStrokeSize();\n renderStickers();\n}", "function runOnloadIfWidgetsEnabled () {\n\t\t// Init these widgets on the elements that tell us they want to be converted to a widget, but that aren't disabled.\n\t\t// They are in A-Z order, except certain ones have been shuffled to the bottom b/c they can be used in other widget.\n\n\t\tif (IBM.common.widget.dyntabs) {\n\t\t\t$(\"div[data-widget=dyntabs]:not([data-init=false])\").dyntabs();\n\t\t}\n\t\t\n\t\tif (IBM.common.widget.expertise) {\n\t\t\tIBM.common.widget.expertise.autoInit();\n\t\t}\n\t\t\n\t\tif (IBM.common.widget.formvalidator) {\n\t\t\t$(\"form[data-formvalidator=enable]:not([data-init=false])\").each(function(){\n\t\t\t\tIBM.common.widget.formvalidator.init(this);\n\t\t\t});\n\t\t}\n\t\t\n\t\tif (IBM.common.widget.hiresimageswap) {\n\t\t\t$(\"[data-widget=hiresimageswap]:not([data-init=false])\").hiresimageswap();\n\t\t}\n\n\t\t// Map old jumpform to this for existing users. Remove legacy mapping soon.\n\t\tif (IBM.common.widget.selectlistnav) {\n\t\t\t$(\"[data-widget=selectlistnav]:not([data-init=false]), [data-widget=jumpform]:not([data-init=false])\").selectlistnav();\n\t\t}\n\t\t\n\t\tif (IBM.common.widget.leavingibm) {\n\t\t\t$(\"[data-widget=leavingibm]:not([data-init=false])\").leavingibm();\t\n\t\t}\n\n\t\tif (IBM.common.widget.masonry) {\n\t\t\t$(\"[data-widget=masonry]:not([data-init=false])\").each(function(){\n\t\t\t\tIBM.common.widget.masonry.init(this);\n\t\t\t});\n\t\t}\n\n\t\tif (IBM.common.widget.overlay) {\n\t\t\t$(\"[data-widget=overlay]:not([data-init=false])\").overlay();\n\t\t}\n\n\t\t// Checkbox has to come AFTER overlay b/c there's some binding issue going on and checkbox no workie (for now until we sort it out).\n\t\t// Checkbox has to be BEFORE datatable else only the first page of paginated table results get init'd.\n\t\tif (IBM.common.widget.checkboxradio) {\n\t\t\t$(\"form input:checkbox:not([data-init=false]), form input:radio:not([data-init=false]), table input:checkbox:not([data-init=false]), table input:radio:not([data-init=false])\").each(function(){\n\t\t\t\tIBM.common.widget.checkboxradio.init(this);\n\t\t\t});\n\t\t}\n\n\t\tif (IBM.common.widget.datatable) {\n\t\t\t$(\"table[data-widget=datatable]:not([data-init=false])\").each(function(){\n\t\t\t\tIBM.common.widget.datatable.init(this);\n\t\t\t});\n\t\t}\n\t\t\n\t\tif (IBM.common.widget.parallaxscroll) {\n\t\t\t$(\"[data-widget=parallaxscroll]:not([data-init=false])\").each(function(){\n\t\t\t\tIBM.common.widget.parallaxscroll.init(this);\n\t\t\t});\n\t\t}\n\n\t\tif (IBM.common.widget.rssdisplay) {\n\t\t\t$(\"[data-widget=rssdisplay]:not([data-init=false])\").rssdisplay();\n\t\t}\n\n\t\tif (IBM.common.widget.scrollable) {\n\t\t\t$(\"[data-widget=scrollable]:not([data-init=false])\").scrollable();\n\t\t}\n\n\t\tif (IBM.common.widget.setsameheight) {\n\t\t\t$(\"[data-widget=setsameheight]:not([data-init=false])\").setsameheight();\n\t\t}\n\n\t\tif (IBM.common.widget.showhide) {\n\t\t\t$(\"[data-widget=showhide]:not([data-init=false])\").showhide();\n\t\t}\n\n\t\tif (IBM.common.widget.stepindicator) {\n\t\t\t$(\"div[data-widget=stepindicator]:not([data-init=false])\").stepindicator();\n\t\t}\n\n\t\tif (typeof window.SyntaxHighlighter !== \"undefined\") {\n\t\t\t$(\"[data-widget=syntaxhighlighter]:not([data-init=false])\").syntaxhighlighter();\n\t\t}\n\n\t\tif (IBM.common.widget.tooltip) {\n\t\t\t$(\"[data-widget=tooltip]:not([data-init=false])\").tooltip();\n\t\t}\n\t\t\n\t\tif (IBM.common.widget.twisty) {\n\t\t\t$(\"[data-widget=twisty]:not([data-init=false])\").twisty();\n\t\t}\n\t\t\n\t\tif (IBM.common.widget.videoplayer) {\n\t\t\t$(\"[data-widget=videoplayer]:not([data-init=false])\").videoplayer();\n\t\t}\n\t\t\n\t\tif (IBM.common.widget.videolooper) {\n\t\t\t$(\"[data-widget=videolooper]:not([data-init=false])\").videolooper();\n\t\t}\n\n\t\t// Putting carousel last since it's a container that can hold other widget and should init after they have.\n\t\tif (IBM.common.widget.carousel) {\n\t\t\t$(\"div[data-widget=carousel]:not([data-init=false])\").carousel();\n\t\t}\n\n\t\t// Form widgets that can be used in some of the widgets above, wait until the widgets above have init'd and\n\t\t// possible created some of these form elements, so we can then turn them into widgets.\n\n\t\tif (IBM.common.widget.selectlist) {\n\t\t\t$(\"div.dataTables_length > label > select:not([data-init=false]), form select:not([data-init=false]), table select:not([data-init=false])\").each(function(){\n\t\t\t\tIBM.common.widget.selectlist.init(this);\n\t\t\t});\n\t\t}\n\n\t\tif (IBM.common.widget.fileinput) {\n\t\t\t$(\"input:file[data-widget=fileinput]:not([data-init=false])\").fileinput();\n\t\t}\n\t\t\n\t\tif (IBM.common.widget.tablesrowselector) {\n\t\t\t$(\"table[data-tablerowselector=enable]:not([data-init=false])\").tablesrowselector();\n\t\t}\n\t\t\n\t\t// END runOnloadIfWidgetsEnabled\n\t}", "_createWidget() {\n try {\n createWidget(this.iframeEl, (widget) => {\n if (widget) {\n this._setupWidget(widget);\n this._reloadWidget();\n }\n });\n } catch (err) {\n console.log(err)\n }\n }", "function WebpageSettingsWidget(instanceId, data){\r\n this.loader=function(){\r\n \r\n var targetPlugin = (data!=undefined&&data.plugin!=undefined)?data.plugin:\"aurora\";\r\n var themesR = DATA.getRemote(\"aurora_theme_list\", \"\", NOT_READY, POLL_RATES.VERY_FAST); //, NOT_READY, POLL_RATES.SLOW \r\n var dataR = DATA.getRemote(\"aurora_settings\", targetPlugin, NOT_READY, POLL_RATES.VERY_FAST); //, NOT_READY, POLL_RATES.SLOW \r\n var dataBI = dataR.behaviour;\r\n //log(\"loader\");\r\n var rendererTypedB = F.liftBI(\r\n function(settingTable, themes){\r\n //log(\"lift1\"); \r\n if(settingTable==NOT_READY||themes==NOT_READY)\r\n return NOT_READY;\r\n if(settingTable==NO_PERMISSION||themes==NO_PERMISSION)\r\n return NO_PERMISSION;\r\n //log(\"lift2\"); \r\n //var settingTable = clone(settingTable);\r\n var cellMetaData = [];\r\n for(rowIndex in settingTable[\"DATA\"]){\r\n // log(\"Loop: \"+rowIndex);\r\n var cellMetaDataRow = [];\r\n var name = getTableValue(settingTable, rowIndex, \"name\"); \r\n var type = getTableValue(settingTable, rowIndex, \"type\");\r\n var description = getTableValue(settingTable, rowIndex, \"description\");\r\n var value = getTableValue(settingTable, rowIndex, \"value\");\r\n var valueColIndex = getColumnIndex(settingTable, \"value\");\r\n \r\n if(CELL_RENDERERS[type]!=undefined){\r\n var renderer = new BasicCellRenderer(type, name); \r\n cellMetaDataRow[valueColIndex] = {\"renderer\": renderer}; \r\n }\r\n else if(type==\"userDisplay\"){\r\n var options = [{\"display\": \"Username\", value: 1}, {\"display\": \"Firstname\", \"value\": 2}, {\"display\": \"Full Name\", \"value\": 3}];\r\n var renderer = new BasicRadioCellRendererContainer(name, options);\r\n cellMetaDataRow[valueColIndex] = {\"renderer\": renderer}; \r\n }\r\n else if(type==\"themeSelect\"){\r\n var options = [];\r\n for(rowId in themes[\"DATA\"]){\r\n var themeId = getTableValue(themes, rowId, \"theme_id\");\r\n var themeName = getTableValue(themes, rowId, \"theme_name\");\r\n options.push({\"display\": themeName, \"value\": themeId});\r\n }\r\n var renderer = new BasicSelectCellRendererContainer(options);\r\n cellMetaDataRow[valueColIndex] = {\"renderer\": renderer}; \r\n }\r\n cellMetaData.push(cellMetaDataRow);\r\n }\r\n settingTable[\"CELLMETADATA\"] = cellMetaData;\r\n //log(\"Lift Return\");\r\n return settingTable;\r\n },\r\n function(settingTable, themes){\r\n // var settingTable = clone(settingTable);\r\n return [settingTable, undefined];\r\n },\r\n dataBI, themesR.behaviour); \r\n tableBI = TableWidgetB(instanceId+\"_table\", data, rendererTypedB); \r\n F.insertDomB(tableBI, instanceId+\"_container\");\r\n \r\n }\r\n this.destroy=function(){\r\n DATA.deregister(\"aurora_settings\", \"\");\r\n }\r\n this.build=function(){\r\n return \"<span id=\\\"\"+instanceId+\"_container\\\">&nbsp;</span>\";\r\n }\r\n}", "function HTMLUI(){\n\n }", "buildLayout(){\r\n this.phaseElement.id = \"rid-opacity\";\r\n\r\n this.sidebar.classList.add(\"sidebar\");\r\n \r\n this.turnImage.classList.add(\"player-img\")\r\n \r\n this.turnImageContainer.classList.add(\"player-img-container\");\r\n this.turnImageContainer.appendChild(this.turnImage);\r\n\r\n this.sidebar.append(this.turnImageContainer);\r\n\r\n this.renderPlayerImg();\r\n\r\n this.createTurnOrder();\r\n this.updateTurnOrder();\r\n\r\n this.createMap();\r\n this.sidebar.appendChild(this.btnContainer);\r\n this.gameWindowElement.append(this.sidebar);\r\n \r\n }", "function prepareDom(){\n css(container, {\n 'height': '100%',\n 'position': 'relative'\n });\n\n //adding a class to recognize the container internally in the code\n addClass(container, WRAPPER);\n addClass($html, ENABLED);\n\n //due to https://github.com/alvarotrigo/fullPage.js/issues/1502\n windowsHeight = getWindowHeight();\n\n removeClass(container, DESTROYED); //in case it was destroyed before initializing it again\n\n addInternalSelectors();\n\n var sections = $(SECTION_SEL);\n\n //styling the sections / slides / menu\n for(var i = 0; i<sections.length; i++){\n var sectionIndex = i;\n var section = sections[i];\n var slides = $(SLIDE_SEL, section);\n var numSlides = slides.length;\n\n //caching the original styles to add them back on destroy('all')\n section.setAttribute('data-fp-styles', section.getAttribute('style'));\n\n styleSection(section, sectionIndex);\n styleMenu(section, sectionIndex);\n\n // if there's any slide\n if (numSlides > 0) {\n styleSlides(section, slides, numSlides);\n }else{\n if(options.verticalCentered){\n addTableClass(section);\n }\n }\n }\n\n //fixed elements need to be moved out of the plugin container due to problems with CSS3.\n if(options.fixedElements && options.css3){\n $(options.fixedElements).forEach(function(item){\n $body.appendChild(item);\n });\n }\n\n //vertical centered of the navigation + active bullet\n if(options.navigation){\n addVerticalNavigation();\n }\n\n enableYoutubeAPI();\n\n if(options.scrollOverflow){\n scrollBarHandler = options.scrollOverflowHandler.init(options);\n }\n }", "function prepareDom(){\n css(container, {\n 'height': '100%',\n 'position': 'relative'\n });\n\n //adding a class to recognize the container internally in the code\n addClass(container, WRAPPER);\n addClass($html, ENABLED);\n\n //due to https://github.com/alvarotrigo/fullPage.js/issues/1502\n windowsHeight = getWindowHeight();\n\n removeClass(container, DESTROYED); //in case it was destroyed before initializing it again\n\n addInternalSelectors();\n\n var sections = $(SECTION_SEL);\n\n //styling the sections / slides / menu\n for(var i = 0; i<sections.length; i++){\n var sectionIndex = i;\n var section = sections[i];\n var slides = $(SLIDE_SEL, section);\n var numSlides = slides.length;\n\n //caching the original styles to add them back on destroy('all')\n section.setAttribute('data-fp-styles', section.getAttribute('style'));\n\n styleSection(section, sectionIndex);\n styleMenu(section, sectionIndex);\n\n // if there's any slide\n if (numSlides > 0) {\n styleSlides(section, slides, numSlides);\n }else{\n if(options.verticalCentered){\n addTableClass(section);\n }\n }\n }\n\n //fixed elements need to be moved out of the plugin container due to problems with CSS3.\n if(options.fixedElements && options.css3){\n $(options.fixedElements).forEach(function(item){\n $body.appendChild(item);\n });\n }\n\n //vertical centered of the navigation + active bullet\n if(options.navigation){\n addVerticalNavigation();\n }\n\n enableYoutubeAPI();\n\n if(options.scrollOverflow){\n scrollBarHandler = options.scrollOverflowHandler.init(options);\n }\n }", "function prepareDom(){\n css(container, {\n 'height': '100%',\n 'position': 'relative'\n });\n\n //adding a class to recognize the container internally in the code\n addClass(container, WRAPPER);\n addClass($html, ENABLED);\n\n //due to https://github.com/alvarotrigo/fullPage.js/issues/1502\n windowsHeight = getWindowHeight();\n\n removeClass(container, DESTROYED); //in case it was destroyed before initializing it again\n\n addInternalSelectors();\n\n var sections = $(SECTION_SEL);\n\n //styling the sections / slides / menu\n for(var i = 0; i<sections.length; i++){\n var sectionIndex = i;\n var section = sections[i];\n var slides = $(SLIDE_SEL, section);\n var numSlides = slides.length;\n\n //caching the original styles to add them back on destroy('all')\n section.setAttribute('data-fp-styles', section.getAttribute('style'));\n\n styleSection(section, sectionIndex);\n styleMenu(section, sectionIndex);\n\n // if there's any slide\n if (numSlides > 0) {\n styleSlides(section, slides, numSlides);\n }else{\n if(options.verticalCentered){\n addTableClass(section);\n }\n }\n }\n\n //fixed elements need to be moved out of the plugin container due to problems with CSS3.\n if(options.fixedElements && options.css3){\n $(options.fixedElements).forEach(function(item){\n $body.appendChild(item);\n });\n }\n\n //vertical centered of the navigation + active bullet\n if(options.navigation){\n addVerticalNavigation();\n }\n\n enableYoutubeAPI();\n\n if(options.scrollOverflow){\n scrollBarHandler = options.scrollOverflowHandler.init(options);\n }\n }" ]
[ "0.70765686", "0.6610348", "0.656258", "0.6483031", "0.6406047", "0.63583994", "0.62854594", "0.62382495", "0.6182108", "0.61615986", "0.61559427", "0.6122311", "0.61053365", "0.6097434", "0.6077922", "0.6069247", "0.6061592", "0.603879", "0.60316366", "0.6028217", "0.6028217", "0.6007857", "0.5997669", "0.59916306", "0.59791684", "0.5968563", "0.5968563", "0.5968563", "0.5939491", "0.59242326", "0.59175086", "0.58954495", "0.5885731", "0.5871889", "0.5869063", "0.5866667", "0.58594227", "0.5855533", "0.5835724", "0.5825517", "0.58242947", "0.5813672", "0.57864654", "0.5781065", "0.57757175", "0.5763637", "0.5760232", "0.57533777", "0.57466024", "0.5746046", "0.5743112", "0.5742296", "0.5741678", "0.57297623", "0.5724845", "0.5724845", "0.5724839", "0.572266", "0.5716309", "0.5716022", "0.5712628", "0.57032096", "0.5699997", "0.5699997", "0.5698783", "0.5691389", "0.56913006", "0.56898916", "0.56883115", "0.5686661", "0.5682888", "0.56809294", "0.56803846", "0.5672115", "0.5669702", "0.56678385", "0.5666095", "0.56651163", "0.5662997", "0.5661103", "0.56558377", "0.5655033", "0.5652383", "0.5650211", "0.5646128", "0.5643281", "0.5641632", "0.5641632", "0.5641033", "0.5641033", "0.5633897", "0.5626226", "0.5618409", "0.5613682", "0.5608838", "0.5604774", "0.5604512", "0.56038624", "0.56038624", "0.56038624" ]
0.6849971
1